|
|
|
@ -2,26 +2,29 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesPartPullService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesPullingOrderInfoService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.utils.MesException;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
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.base.util.StringUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartPull;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPullingOrderInfo;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesPullingOrderPartInfoRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.shiro.util.CollectionUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
@ -29,7 +32,14 @@ public class MesPullingOrderInfoService extends BaseMesService<MesPullingOrderIn
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesPullingOrderPartInfoRepository mesPullingOrderPartInfoRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesPartPullRepository mesPartPullRDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesPartPullDetailRepository mesPartPullDetailRDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesWorkOrderRepository mesWorkOrderRepository;
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesWorkCenterRepository mesWorkCenterRepository;
|
|
|
|
|
protected void setPackQueryBean(MesPullingOrderInfo bean, DdlPackBean packBean) {
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getPullCode(), "pullCode", packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getPullingOrderNo(), "pullingOrderNo", packBean);
|
|
|
|
@ -63,6 +73,27 @@ public class MesPullingOrderInfoService extends BaseMesService<MesPullingOrderIn
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void doCreatePullOrderByPullGroupAndWorkOrder(String organizeCode, String userName) {
|
|
|
|
|
//1.拉动组集合+拉动组明细集合pullingGroupList+ pullingpartlist
|
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
List<MesPartPull> pulliGroupList = mesPartPullRDao.findByHqlWhere(ddlPackBean);
|
|
|
|
|
if (CollectionUtils.isEmpty(pulliGroupList)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
DdlPackBean ddlPackBeanDetail = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
List<MesPartPullDetail> pullDetailList = mesPartPullDetailRDao.findByHqlWhere(ddlPackBeanDetail);
|
|
|
|
|
if (CollectionUtils.isEmpty(pullDetailList)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//2.客户物料集合 [PART_NO] in 拉动组明细物料集合
|
|
|
|
|
//3.产线数据
|
|
|
|
|
DdlPackBean workPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getInPackList(pulliGroupList.stream().map(MesPartPull::getWorkCenterCode).collect(Collectors.toList()), "workCenterCode", workPackBean);
|
|
|
|
|
List<MesWorkCenter> mesWorkCenterList = mesWorkCenterRepository.findByHqlWhere(workPackBean);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map doSPSForEquipment(String assemblyLine, String pullingGroupCode, String organizeCode) {
|
|
|
|
|
Map resultMap = new HashMap();
|
|
|
|
|
//查询拉动单状态为已扫描=20的 拉动单
|
|
|
|
|