|
|
@ -3,19 +3,25 @@ package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesShippingOrderManagementService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesShippingOrderManagementService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.config.AuthUtilExt;
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.config.AuthUtilExt;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagement;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagement;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
@Api(description = "发运单管理主页面")
|
|
|
|
@Api(description = "发运单管理主页面")
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
@ -31,6 +37,20 @@ public class MesShippingOrderManagementController extends BaseMesController<MesS
|
|
|
|
@ApiOperation(value = "发运")
|
|
|
|
@ApiOperation(value = "发运")
|
|
|
|
public ResultBean<MesShippingOrderManagement> saveShipping(@RequestBody List<MesShippingOrderManagement> beanList) {
|
|
|
|
public ResultBean<MesShippingOrderManagement> saveShipping(@RequestBody List<MesShippingOrderManagement> beanList) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> orderNoList =
|
|
|
|
|
|
|
|
beanList.stream().filter(k -> k.getStatus() != MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue() &&
|
|
|
|
|
|
|
|
k.getStatus() != MesExtEnumUtil.SHIPPING_ORDER_STATUS.PUBLISHED.getValue()).map(k -> k.getShippingOrderNo()).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(orderNoList)) {
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("【%s】发运单状态不是【%s】或【%s】,请选择状态为【%s】或【%s】的数据", orderNoList, MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getDescription(),
|
|
|
|
|
|
|
|
MesExtEnumUtil.SHIPPING_ORDER_STATUS.PUBLISHED.getDescription(), MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getDescription(),
|
|
|
|
|
|
|
|
MesExtEnumUtil.SHIPPING_ORDER_STATUS.PUBLISHED.getDescription())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
//新增初始化
|
|
|
|
//新增初始化
|
|
|
|
for (MesShippingOrderManagement orderManagement : beanList) {
|
|
|
|
for (MesShippingOrderManagement orderManagement : beanList) {
|
|
|
|
orderManagement.setOrganizeCode(AuthUtilExt.getOrganizeCode());
|
|
|
|
orderManagement.setOrganizeCode(AuthUtilExt.getOrganizeCode());
|
|
|
|