|
|
|
@ -4,13 +4,17 @@ import cn.estsh.i3plus.ext.mes.api.base.IMesPartService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.unit.exception.MesException;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartSap;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesPartRepository;
|
|
|
|
|
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 org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
@ -20,6 +24,9 @@ import java.util.List;
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class MesPartService extends BaseMesService<MesPart> implements IMesPartService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesPartRepository mesPartRepository;
|
|
|
|
|
|
|
|
|
|
protected void setPackQueryBean(MesPart bean, DdlPackBean packBean) {
|
|
|
|
|
DdlPreparedPack.getStringLikerPack(bean.getPartNo(), "partNo", packBean);
|
|
|
|
|
DdlPreparedPack.getStringLikerPack(bean.getPartName(), "partName", packBean);
|
|
|
|
@ -49,6 +56,17 @@ public class MesPartService extends BaseMesService<MesPart> implements IMesPartS
|
|
|
|
|
return mesPartList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ListPager<MesPart> queryMesPartByPagerExt(MesPart mesPart, Pager pager) {
|
|
|
|
|
DdlPackBean partQueryPackBean = DdlPackBean.getDdlPackBean();
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(mesPart.getIsValid(), "isValid", partQueryPackBean);
|
|
|
|
|
DdlPreparedPack.getStringLikerPack(mesPart.getPartNo(), "partNo", partQueryPackBean);
|
|
|
|
|
DdlPreparedPack.getStringLikerPack(mesPart.getPartName(), "partName", partQueryPackBean);
|
|
|
|
|
pager = PagerHelper.getPager(pager, mesPartRepository.findByHqlWhereCount(partQueryPackBean));
|
|
|
|
|
List<MesPart> mesPartList = mesPartRepository.findByHqlWherePage(partQueryPackBean, pager);
|
|
|
|
|
return new ListPager<>(mesPartList, pager);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void onInsertBean(MesPart item) {
|
|
|
|
|
// 数据校验
|
|
|
|
|
ValidatorBean.checkNotNull(item.getPartNo(), "物料号不能为空");
|
|
|
|
|