|
|
|
@ -10,10 +10,7 @@ import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesJisShippingRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesPartRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesPartShippingGroupRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
@ -44,6 +41,9 @@ public class MesShippingOrderManagementService extends BaseMesService<MesShippin
|
|
|
|
|
private MesPartShippingGroupRepository partShippingGroupRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesCustomerDockRepository customerDockRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesJisShippingRepository jisShippingRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@ -109,6 +109,19 @@ public class MesShippingOrderManagementService extends BaseMesService<MesShippin
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DdlPackBean custDockPackBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getCustCode(), "custCode", custDockPackBean);
|
|
|
|
|
MesCustomerDock customerDock = customerDockRepository.getByProperty(custDockPackBean);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(customerDock)) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("【%s】客户零件号未维护客户道口,请检查数据", bean.getCustCode())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bean.setCustDockCode(customerDock.getCustDockCode());
|
|
|
|
|
bean.setPartShippingId(partShippingGroup.getId());
|
|
|
|
|
bean.setShippingType(MesExtEnumUtil.SHIPPING_ORDER_TYPE.SORT_SHIPPING.getValue());
|
|
|
|
|
bean.setIsLoading(partShippingGroup.getIsLoading());
|
|
|
|
@ -136,8 +149,10 @@ public class MesShippingOrderManagementService extends BaseMesService<MesShippin
|
|
|
|
|
BeanUtils.copyProperties(k, detail, "id");
|
|
|
|
|
MesPart part = partService.getPartByPartNo(k.getPartNo(), k.getOrganizeCode());
|
|
|
|
|
detail.setPartName(part.getPartName());
|
|
|
|
|
detail.setUnit(part.getUnit());
|
|
|
|
|
detail.setCustPartNo(k.getCustPartNo());
|
|
|
|
|
detail.setPlanQty(1);
|
|
|
|
|
detail.setShippingId(finalBean.getId());
|
|
|
|
|
// detail.setActualQty(1);
|
|
|
|
|
detail.setShippingCode(finalBean.getShippingCode());
|
|
|
|
|
detail.setOrganizeCode(k.getOrganizeCode());
|
|
|
|
@ -191,10 +206,18 @@ public class MesShippingOrderManagementService extends BaseMesService<MesShippin
|
|
|
|
|
List<MesShippingOrderManagementDetail> detailInsertList = new ArrayList<>();
|
|
|
|
|
shippingGroupDetailList.forEach(k -> {
|
|
|
|
|
MesShippingOrderManagementDetail detail = new MesShippingOrderManagementDetail();
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(k, detail, "id");
|
|
|
|
|
MesPart part = partService.getPartByPartNo(k.getPartNo(), k.getOrganizeCode());
|
|
|
|
|
detail.setPartName(part.getPartName());
|
|
|
|
|
detail.setUnit(part.getUnit());
|
|
|
|
|
detail.setCustPartNo(k.getCustPartNo());
|
|
|
|
|
detail.setPlanQty(1);
|
|
|
|
|
detail.setShippingId(originBean.getId());
|
|
|
|
|
detail.setShippingCode(originBean.getShippingCode());
|
|
|
|
|
detail.setOrganizeCode(k.getOrganizeCode());
|
|
|
|
|
detail.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.CREATE.getValue());
|
|
|
|
|
|
|
|
|
|
ConvertBean.serviceModelInitialize(detail, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
BeanUtils.copyProperties(k, detail, "id");
|
|
|
|
|
detailInsertList.add(detail);
|
|
|
|
|
});
|
|
|
|
|
//软删原明细数据
|
|
|
|
@ -258,7 +281,7 @@ public class MesShippingOrderManagementService extends BaseMesService<MesShippin
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("【%s】顺序号已经存在,请检查数据", item.getShippingCode())
|
|
|
|
|
.setErrorDetail("【%s】顺序号已经存在,请检查数据", item.getSeq())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -295,7 +318,7 @@ public class MesShippingOrderManagementService extends BaseMesService<MesShippin
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("【%s】顺序号已经存在,请检查数据", item.getShippingCode())
|
|
|
|
|
.setErrorDetail("【%s】顺序号已经存在,请检查数据", item.getSeq())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|