skyouc
1 天以前 4e0470a90f640f57d8f8af6708eb05f77bf561dd
rsf-server/src/main/java/com/vincent/rsf/server/api/controller/erp/ReportMsgController.java
@@ -1,9 +1,19 @@
package com.vincent.rsf.server.api.controller.erp;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.api.controller.erp.params.ReportParams;
import com.vincent.rsf.server.api.service.ReportMsgService;
import com.vincent.rsf.server.system.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Objects;
/**
 * @author Ryan
@@ -17,4 +27,24 @@
@Api(tags = "上报信息接口管理器")
public class ReportMsgController extends BaseController {
    @Autowired
    private ReportMsgService reportMsgService;
    @ApiOperation("完成订单上报")
    @PostMapping("/complete/orders")
    public R reportOrder(@RequestBody ReportParams params) {
        if (Objects.isNull(params)) {
            return R.error("参数不能为空!");
        }
        if (Objects.isNull(params.getOrderType())) {
            return R.error("订单类型不能为空!!");
        }
        if (Objects.isNull(params.getAction()) || params.getAction().isEmpty()) {
            return R.error("上报明细不能为空!!");
        }
        return reportMsgService.reportOrders(params);
    }
}