|
|
|
@ -1,19 +1,17 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesProdRuleSortCfgService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesTimeEfficientCfgService;
|
|
|
|
|
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.MesProdRuleSortCfg;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleSortCfg;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesTimeEfficientCfg;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
@ -58,6 +56,32 @@ public class MesProdRuleSortCfgService extends BaseMesService<MesProdRuleSortCfg
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void validateImport(List<MesProdRuleSortCfg> beanList) {
|
|
|
|
|
|
|
|
|
|
for (MesProdRuleSortCfg item : beanList) {
|
|
|
|
|
// 数据校验
|
|
|
|
|
//ValidatorBean.checkNotNull(item.getInPartNo(), "进件零件号不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(item.getWorkCenterCode(), "产线不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(item.getWorkCellCode(), "工位不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(item.getAssemblyPartNo(), "零件号不能为空");
|
|
|
|
|
|
|
|
|
|
DdlPackBean seriesPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getWorkCellCode(), "workCellCode", seriesPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getWorkCenterCode(), "workCenterCode", seriesPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getAssemblyPartNo(), "assemblyPartNo", seriesPackBean);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean flg = baseRDao.isExitByHql(seriesPackBean);
|
|
|
|
|
if (flg) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("该排序加工规则已存在,请检查数据")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|