forked from I3-YF/i3plus-mes-yfai
解决冲突
commit
002ea6bf2d
@ -0,0 +1,7 @@
|
||||
package cn.estsh.i3plus.ext.mes.api.base;
|
||||
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesPackingPartType;
|
||||
|
||||
public interface IMesPackingPartTypeService extends IBaseMesService<MesPackingPartType> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesPackingPartType;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api("成品包装类型零件信息")
|
||||
@RestController
|
||||
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesPackingPartType")
|
||||
public class MesPackingPartTypeController extends BaseMesController<MesPackingPartType>{
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.api.base.IMesPackingPartTypeService;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
|
||||
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.MesPackingPartType;
|
||||
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 java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MesPackingPartTypeService extends BaseMesService<MesPackingPartType> implements IMesPackingPartTypeService {
|
||||
|
||||
@Override
|
||||
protected void setPackQueryBean(MesPackingPartType bean, DdlPackBean packBean) {
|
||||
DdlPreparedPack.getStringLikerPack(bean.getPartNo(), MesExtConstWords.PART_NO, packBean);
|
||||
DdlPreparedPack.getStringLikerPack(bean.getPartName(), MesExtConstWords.PART_NAME, packBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInsertBean(MesPackingPartType item) {
|
||||
ValidatorBean.checkNotNull(item.getPartNo(), "零件代码不能为空");
|
||||
ValidatorBean.checkNotNull(item.getPartName(), "零件名称不能为空");
|
||||
|
||||
DdlPackBean packBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
||||
DdlPreparedPack.getStringEqualPack(item.getPartNo(), MesExtConstWords.PART_NO, packBean);
|
||||
Boolean flg = baseRDao.isExitByHql(packBean);
|
||||
if (flg) {
|
||||
throw ImppExceptionBuilder.newInstance()
|
||||
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
||||
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||
.setErrorDetail("零件代码[%s]信息已经存在,请检查数据", item.getPartNo())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onUpdateBean(MesPackingPartType item) {
|
||||
ValidatorBean.checkNotNull(item.getId(), "包装代码不能为空");
|
||||
ValidatorBean.checkNotNull(item.getPartNo(), "零件代码不能为空");
|
||||
ValidatorBean.checkNotNull(item.getPartName(), "零件名称不能为空");
|
||||
|
||||
DdlPackBean packBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode());
|
||||
DdlPreparedPack.getStringEqualPack(item.getPartNo(), MesExtConstWords.PART_NO, packBean);
|
||||
DdlPreparedPack.getNumNOEqualPack(item.getId(), MesExtConstWords.ID, packBean);
|
||||
Boolean flg = baseRDao.isExitByHql(packBean);
|
||||
if (flg) {
|
||||
throw ImppExceptionBuilder.newInstance()
|
||||
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
||||
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||
.setErrorDetail("零件代码[%s]信息已经存在,请检查数据", item.getPartNo())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MesPackingPartType> validateReturnImport(List<MesPackingPartType> beanList) {
|
||||
for (MesPackingPartType item : beanList) {
|
||||
onInsertBean(item);
|
||||
}
|
||||
return beanList;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue