|
|
@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesProdCraftRouteService;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.MesConstWords;
|
|
|
|
|
|
|
|
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.base.util.StringUtil;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesCraftRoute;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipment;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdCraftRoute;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.IMesCraftRouteRepository;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCenterRepository;
|
|
|
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @Description : 产品工艺路线
|
|
|
|
|
|
|
|
* @Reference :
|
|
|
|
|
|
|
|
* @Author : gsz
|
|
|
|
|
|
|
|
* @CreateDate 2024/5/13 13:13
|
|
|
|
|
|
|
|
* @Modify:
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
|
|
|
public class MesProdCraftRouteServiceImpl extends BaseMesService<MesProdCraftRoute> implements IMesProdCraftRouteService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IMesCraftRouteRepository mesCraftRouteRDao;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private MesWorkCenterRepository mesWorkCenterRDao;
|
|
|
|
|
|
|
|
protected void setPackQueryBean(MesProdCraftRoute bean, DdlPackBean packBean) {
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getCraftRouteCode(), "craftRouteCode", packBean);
|
|
|
|
|
|
|
|
// DdlPreparedPack.getStringLikerPack(bean.getCraftRouteName(), "craftRouteName", packBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(bean.getCraftRouteType(), "craftRouteType", packBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getWorkCenterCode(), "workCenterCode", packBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getPptCode(), "pptCode", packBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getPartNo(), "partNo", packBean);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void onInsertBean(MesProdCraftRoute item) {
|
|
|
|
|
|
|
|
// 数据校验
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(item.getOrganizeCode(), "工厂号不能为空");
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(item.getCraftRouteCode(), "工艺路线代码不能为空");
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(item.getCraftRouteName(), "工艺路线名称不能为空");
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(item.getCraftRouteType(), "工艺路线类型不能为空");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String partNo = item.getPartNo();
|
|
|
|
|
|
|
|
String pptCode = item.getPptCode();
|
|
|
|
|
|
|
|
String workCenterCode = item.getWorkCenterCode();
|
|
|
|
|
|
|
|
//校验产线
|
|
|
|
|
|
|
|
MesCraftRoute mesCraftRoute = mesCraftRouteRDao.getByProperty(
|
|
|
|
|
|
|
|
new String[]{MesConstWords.ORGANIZE_CODE, MesConstWords.IS_DELETED, MesConstWords.IS_VALID, "craftRouteCode"},
|
|
|
|
|
|
|
|
new Object[]{item.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),
|
|
|
|
|
|
|
|
CommonEnumUtil.IS_VAILD.VAILD.getValue(), item.getCraftRouteCode()});
|
|
|
|
|
|
|
|
if (null == mesCraftRoute) {
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】无效", item.getWorkCenterCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(workCenterCode)){//生产线维度配置 工艺路线类型必须与产线类型保持一致
|
|
|
|
|
|
|
|
//校验产线
|
|
|
|
|
|
|
|
MesWorkCenter mesWorkCenter = mesWorkCenterRDao.getByProperty(
|
|
|
|
|
|
|
|
new String[]{MesConstWords.ORGANIZE_CODE, MesConstWords.IS_DELETED, MesConstWords.IS_VALID, "workCenterCode"},
|
|
|
|
|
|
|
|
new Object[]{item.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),
|
|
|
|
|
|
|
|
CommonEnumUtil.IS_VAILD.VAILD.getValue(), item.getWorkCenterCode()});
|
|
|
|
|
|
|
|
if (null == mesWorkCenter) {
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("产线代码【%s】无效", item.getWorkCenterCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!Objects.equals(mesCraftRoute.getCraftRouteType(), mesWorkCenter.getWorkVer())){//todo 工作版本",notes = "使用: 生产线类型: 排序/非排序
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】工艺路线类型必须与产线类型保持一致,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//20 非排序类型
|
|
|
|
|
|
|
|
if(item.getCraftRouteType().equals("20")){
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(partNo)){//零件维度配置 ①非排序类型的工艺路线直接跟物料关联,生产线与零件产品类型均不填
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(workCenterCode) || !StringUtil.isEmpty(pptCode)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】【非排序类型】【零件维度配置】生产线与零件产品类型均不填,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else if(!StringUtil.isEmpty(pptCode)){//零件产品类型维度配置 ①非排序类型的工艺路线直接跟零件产品类型关联,生产线与零件均不填
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(workCenterCode) || !StringUtil.isEmpty(partNo)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】【非排序类型】【零件产品类型维度配置】生产线与零件均不填,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {//10 排序类型
|
|
|
|
|
|
|
|
if(StringUtil.isEmpty(workCenterCode)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】产线代码【%s】不能为空", item.getCraftRouteCode(), item.getWorkCenterCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(partNo)){//零件维度配置 -排序类型的工艺路线与生产线+零件关联,零件产品类型不填;
|
|
|
|
|
|
|
|
if( !StringUtil.isEmpty(pptCode)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】【排序类型】的工艺路线与生产线+零件关联,零件产品类型不填,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else if(!StringUtil.isEmpty(pptCode)){//零件产品类型维度配置 -排序类型的工艺路线与生产线+零件产品类型关联,零件不填
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(partNo)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】【非排序类型】的工艺路线与生产线+零件产品类型关联,零件不填,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean roadPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getCraftRouteCode(), "craftRouteCode", roadPackBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getCraftRouteName(), "craftRouteName", roadPackBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(item.getCraftRouteType(), "craftRouteType", roadPackBean);
|
|
|
|
|
|
|
|
boolean flg = baseRDao.isExitByHql(roadPackBean);
|
|
|
|
|
|
|
|
if (flg) {
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】已经存在,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void onUpdateBean(MesProdCraftRoute item) {
|
|
|
|
|
|
|
|
// 数据校验
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(item.getCraftRouteCode(), "工艺路线代码不能为空");
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(item.getCraftRouteName(), "工艺路线名称不能为空");
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(item.getCraftRouteType(), "工艺路线类型不能为空");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String partNo = item.getPartNo();
|
|
|
|
|
|
|
|
String pptCode = item.getPptCode();
|
|
|
|
|
|
|
|
String workCenterCode = item.getWorkCenterCode();
|
|
|
|
|
|
|
|
//校验产线
|
|
|
|
|
|
|
|
MesCraftRoute mesCraftRoute = mesCraftRouteRDao.getByProperty(
|
|
|
|
|
|
|
|
new String[]{MesConstWords.ORGANIZE_CODE, MesConstWords.IS_DELETED, MesConstWords.IS_VALID, "craftRouteCode"},
|
|
|
|
|
|
|
|
new Object[]{item.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),
|
|
|
|
|
|
|
|
CommonEnumUtil.IS_VAILD.VAILD.getValue(), item.getCraftRouteCode()});
|
|
|
|
|
|
|
|
if (null == mesCraftRoute) {
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】无效", item.getWorkCenterCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(workCenterCode)){//生产线维度配置 工艺路线类型必须与产线类型保持一致
|
|
|
|
|
|
|
|
//校验产线
|
|
|
|
|
|
|
|
MesWorkCenter mesWorkCenter = mesWorkCenterRDao.getByProperty(
|
|
|
|
|
|
|
|
new String[]{MesConstWords.ORGANIZE_CODE, MesConstWords.IS_DELETED, MesConstWords.IS_VALID, "workCenterCode"},
|
|
|
|
|
|
|
|
new Object[]{item.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),
|
|
|
|
|
|
|
|
CommonEnumUtil.IS_VAILD.VAILD.getValue(), item.getWorkCenterCode()});
|
|
|
|
|
|
|
|
if (null == mesWorkCenter) {
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("产线代码【%s】无效", item.getWorkCenterCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!Objects.equals(mesCraftRoute.getCraftRouteType(), mesWorkCenter.getWorkVer())){//todo 工作版本",notes = "使用: 生产线类型: 排序/非排序
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】工艺路线类型必须与产线类型保持一致,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//20 非排序类型
|
|
|
|
|
|
|
|
if(item.getCraftRouteType().equals("20")){
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(partNo)){//零件维度配置 ①非排序类型的工艺路线直接跟物料关联,生产线与零件产品类型均不填
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(workCenterCode) || !StringUtil.isEmpty(pptCode)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】【非排序类型】【零件维度配置】生产线与零件产品类型均不填,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else if(!StringUtil.isEmpty(pptCode)){//零件产品类型维度配置 ①非排序类型的工艺路线直接跟零件产品类型关联,生产线与零件均不填
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(workCenterCode) || !StringUtil.isEmpty(partNo)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】【非排序类型】【零件产品类型维度配置】生产线与零件均不填,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {//10 排序类型
|
|
|
|
|
|
|
|
if(StringUtil.isEmpty(workCenterCode)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】产线代码【%s】不能为空", item.getCraftRouteCode(), item.getWorkCenterCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(partNo)){//零件维度配置 -排序类型的工艺路线与生产线+零件关联,零件产品类型不填;
|
|
|
|
|
|
|
|
if( !StringUtil.isEmpty(pptCode)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】【排序类型】的工艺路线与生产线+零件关联,零件产品类型不填,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else if(!StringUtil.isEmpty(pptCode)){//零件产品类型维度配置 -排序类型的工艺路线与生产线+零件产品类型关联,零件不填
|
|
|
|
|
|
|
|
if(!StringUtil.isEmpty(partNo)){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】【非排序类型】的工艺路线与生产线+零件产品类型关联,零件不填,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean roadPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getCraftRouteCode(), "craftRouteCode", roadPackBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(item.getCraftRouteName(), "craftRouteName", roadPackBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(item.getCraftRouteType(), "craftRouteType", roadPackBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getNumNOEqualPack(item.getId(), "id", roadPackBean);
|
|
|
|
|
|
|
|
boolean flg = baseRDao.isExitByHql(roadPackBean);
|
|
|
|
|
|
|
|
if (flg) {
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("工艺路线代码【%s】已经存在,请检查数据", item.getCraftRouteCode())
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|