Merge remote-tracking branch 'origin/dev' into dev

tags/yfai-mes-ext-v1.2
jun 9 months ago
commit 8f341689c9

@ -54,7 +54,7 @@ public class MesBtoJobServiceImpl implements IMesBtoJobService {
continue; continue;
} }
//6. 根据零件生产组的RoundnessType 去做策略,现在只做 窗口时间 策略; 入参 //6. 根据零件生产组的RoundnessType 去做策略,现在只做 窗口时间 策略; 入参
String roundnessService = MesExtEnumUtil.SHIPPING_GROUP_ROUND_METHOD.valueOfService(prodGroup.getRoundType()); String roundnessService = MesExtEnumUtil.SHIPPING_GROUP_ROUND_METHOD.valueOfService(prodGroup.getRoundMethod());
IRoundnessStrategy roundnessStrategy = (IRoundnessStrategy)SpringContextsUtil.getBean(roundnessService); IRoundnessStrategy roundnessStrategy = (IRoundnessStrategy)SpringContextsUtil.getBean(roundnessService);
roundnessStrategy.execute(prodGroup,sortInfoList, details); roundnessStrategy.execute(prodGroup,sortInfoList, details);
} }

@ -2,7 +2,9 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
import cn.estsh.i3plus.ext.mes.api.base.IMesCustSoftInfoService; import cn.estsh.i3plus.ext.mes.api.base.IMesCustSoftInfoService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; 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.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesCustSortInfo; import cn.estsh.i3plus.pojo.mes.bean.shipping.MesCustSortInfo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -23,6 +25,7 @@ public class MesCustSoftInfoServiceImpl extends BaseMesService<MesCustSortInfo>
public List<MesCustSortInfo> queryCustSortInfoList(String custCode, String custOrganizeCode, String infoPointCode, String organizeCode, List<String> custPartNoList) { public List<MesCustSortInfo> queryCustSortInfoList(String custCode, String custOrganizeCode, String infoPointCode, String organizeCode, List<String> custPartNoList) {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(custCode,"custCode", ddlPackBean); DdlPreparedPack.getStringEqualPack(custCode,"custCode", ddlPackBean);
DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),"serviceFlag", ddlPackBean);
DdlPreparedPack.getStringEqualPack(custOrganizeCode, "custOrganizeCode", ddlPackBean); DdlPreparedPack.getStringEqualPack(custOrganizeCode, "custOrganizeCode", ddlPackBean);
DdlPreparedPack.getStringEqualPack(infoPointCode, "infoPointCode", ddlPackBean); DdlPreparedPack.getStringEqualPack(infoPointCode, "infoPointCode", ddlPackBean);
DdlPreparedPack.getInPackList(custPartNoList,"custPartNo", ddlPackBean); DdlPreparedPack.getInPackList(custPartNoList,"custPartNo", ddlPackBean);
@ -31,8 +34,9 @@ public class MesCustSoftInfoServiceImpl extends BaseMesService<MesCustSortInfo>
@Override @Override
public void updateCustSortInfo(MesCustSortInfo custSortInfo) { public void updateCustSortInfo(MesCustSortInfo custSortInfo) {
ConvertBean.saveOrUpdate(custSortInfo,"edi"); DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(custSortInfo.getOrganizeCode());
baseRDao.update(custSortInfo); DdlPreparedPack.getNumEqualPack(custSortInfo.getId(),"id",ddlPackBean);
baseRDao.updateByProperties(new String[]{"serviceFlag","modifyUser","modifyDatetime"},new Object[]{CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(),"edi", TimeTool.getNowTime(true)},ddlPackBean);
} }
} }

@ -71,9 +71,14 @@ public class MesTimeRoundnessService implements IRoundnessStrategy {
try { //4. 如果没有订单需要更新窗口时间 TM_BAS_PRODUCT_GROUP_WINDOW_TIME try { //4. 如果没有订单需要更新窗口时间 TM_BAS_PRODUCT_GROUP_WINDOW_TIME
MesPartProdGroupWindowTime time = getWindowTimeByProductGroup(partProdGroup.id, partProdGroup.getOrganizeCode()); MesPartProdGroupWindowTime time = getWindowTimeByProductGroup(partProdGroup.id, partProdGroup.getOrganizeCode());
if (Objects.isNull(time)) { if (Objects.isNull(time)) {
log.info("当前零件生产组:{}没有维护时间窗口", partProdGroup.getPartProdGroupName()); log.info("当前零件生产组:{} 没有到达生产工单的窗口", partProdGroup.getPartProdGroupName());
return; return;
} }
String lastRunTime = TimeTool.getNowTime(true);
log.info("当前零件生产组:{},更新本次执行时间:{}",partProdGroup.getPartProdGroupName(),lastRunTime);
ConvertBean.saveOrUpdate(time, "JOB");
time.setLastRunTime(lastRunTime);
windowTimeRao.update(time);
DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
long createSeq = Long.parseLong(dateFormat.format(new Date())); long createSeq = Long.parseLong(dateFormat.format(new Date()));
Map<String, List<MesCustSortInfo>> sortInfoMap = sortInfoList.stream().collect(Collectors.groupingBy(MesCustSortInfo::getCustPartNo)); Map<String, List<MesCustSortInfo>> sortInfoMap = sortInfoList.stream().collect(Collectors.groupingBy(MesCustSortInfo::getCustPartNo));
@ -236,9 +241,7 @@ public class MesTimeRoundnessService implements IRoundnessStrategy {
} }
} }
ConvertBean.saveOrUpdate(time, "JOB");
time.setLastRunTime(TimeTool.getNowTime(true));
windowTimeRao.update(time);
} catch (Exception e) { } catch (Exception e) {
log.error("创建工单报错:{}", Arrays.toString(e.getStackTrace())); log.error("创建工单报错:{}", Arrays.toString(e.getStackTrace()));
} }
@ -265,7 +268,7 @@ public class MesTimeRoundnessService implements IRoundnessStrategy {
//使用降序 //使用降序
List<MesPartProdGroupWindowTime> sortedTime = windowTimeList.stream().sorted(Comparator.comparing(MesPartProdGroupWindowTime::getWindowTime,Comparator.reverseOrder())).collect(Collectors.toList()); List<MesPartProdGroupWindowTime> sortedTime = windowTimeList.stream().sorted(Comparator.comparing(MesPartProdGroupWindowTime::getWindowTime,Comparator.reverseOrder())).collect(Collectors.toList());
for (MesPartProdGroupWindowTime time : sortedTime) { for (MesPartProdGroupWindowTime time : sortedTime) {
if(Integer.parseInt(time.getWindowTime().replace(":","")) > Integer.parseInt(nowTime.replace(":",""))){ if (Integer.parseInt(time.getWindowTime().replace(":", "")) > Integer.parseInt(nowTime.replace(":", ""))) {
continue; continue;
} }
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(time.getWindowTime().substring(0, 2))); calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(time.getWindowTime().substring(0, 2)));
@ -274,6 +277,7 @@ public class MesTimeRoundnessService implements IRoundnessStrategy {
if (Objects.isNull(time.getLastRunTime())) { if (Objects.isNull(time.getLastRunTime())) {
return time; return time;
} }
//校验lastRuntime 是否已经在当前圆整时区已经生成完了工单
Date lastRunTime = sdf.parse(time.getLastRunTime()); Date lastRunTime = sdf.parse(time.getLastRunTime());
if (dateCreateOrder.before(lastRunTime)) { if (dateCreateOrder.before(lastRunTime)) {
continue; continue;

Loading…
Cancel
Save