|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesPartSapService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesProdRuleNosortCfgService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.dao.IMesProdRuleNosortCfgDao;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.unit.exception.MesException;
|
|
|
|
@ -7,6 +8,8 @@ import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
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.MesEquipment;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartSap;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleNosortCfg;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
@ -25,6 +28,9 @@ public class MesProdRuleNosortCfgService extends BaseMesService<MesProdRuleNosor
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesProdRuleNosortCfgDao mesProdRuleNosortCfgDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesPartSapService partSapService;
|
|
|
|
|
|
|
|
|
|
protected void setPackQueryBean(MesProdRuleNosortCfg bean, DdlPackBean packBean) {
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getInPartNo(), "inPartNo", packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getOutPartNo(), "outPartNo", packBean);
|
|
|
|
@ -53,8 +59,26 @@ public class MesProdRuleNosortCfgService extends BaseMesService<MesProdRuleNosor
|
|
|
|
|
}
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getOutPartNo(), "outPartNo", seriesPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getEquipmentCode(), "equipmentCode", seriesPackBean);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(item.getInPartNo())) {
|
|
|
|
|
MesPartSap inPart = partSapService.getMesPartSapByPartNo(item.getOrganizeCode(), item.getInPartNo());
|
|
|
|
|
if (inPart == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("进料零件号不存在,请检查数据")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(item.getOutPartNo())) {
|
|
|
|
|
MesPartSap outPart = partSapService.getMesPartSapByPartNo(item.getOrganizeCode(), item.getOutPartNo());
|
|
|
|
|
if (outPart == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("产成零件号不存在,请检查数据")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
boolean flg = baseRDao.isExitByHql(seriesPackBean);
|
|
|
|
|
if (flg) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
@ -66,7 +90,37 @@ public class MesProdRuleNosortCfgService extends BaseMesService<MesProdRuleNosor
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void onUpdateBean(MesProdRuleNosortCfg item) {
|
|
|
|
|
ValidatorBean.checkNotNull(item.getOutPartNo(), "产成零件号不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(item.getOutPartNo(), "设备不能为空");
|
|
|
|
|
|
|
|
|
|
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
|
|
|
|
if (StringUtils.isEmpty(item.getInPartNo())) {
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getInPartNo(), "inPartNo", seriesPackBean);
|
|
|
|
|
}
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getOutPartNo(), "outPartNo", seriesPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getEquipmentCode(), "equipmentCode", seriesPackBean);
|
|
|
|
|
if (!StringUtils.isEmpty(item.getInPartNo())) {
|
|
|
|
|
MesPartSap inPart = partSapService.getMesPartSapByPartNo(item.getInPartNo(), item.getOrganizeCode());
|
|
|
|
|
if (inPart == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("进料零件号不存在,请检查数据")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(item.getOutPartNo())) {
|
|
|
|
|
MesPartSap outPart = partSapService.getMesPartSapByPartNo(item.getOutPartNo(), item.getOrganizeCode());
|
|
|
|
|
if (outPart == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("产成零件号不存在,请检查数据")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesProdRuleNosortCfg findMesProdRuleNosortCfgByWorkCenterCode(String workCenterCode, String partNo, String organizeCode) {
|
|
|
|
|