|
|
|
@ -1,11 +1,13 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.roundness;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesConfigService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.IMesCustSoftInfoService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.base.strategy.IRoundnessStrategy;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.MesBomService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.MesPartSapService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.MesWorkOrderService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.MesCreateWorkOrderImpl;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.mes.api.iservice.busi.ISyncFuncService;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
@ -101,6 +103,9 @@ public class MesPackageRoundnessService implements IRoundnessStrategy {
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesCreateWorkOrderImpl mesCreateWorkOrder;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesConfigService mesConfigService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void execute(MesPartProdGroup partProdGroup, List<MesCustSortInfo> sortInfoList, List<MesPartProdGroupDetail> details) {
|
|
|
|
|
try {
|
|
|
|
@ -791,12 +796,18 @@ public class MesPackageRoundnessService implements IRoundnessStrategy {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<MesBom> getPlatBom(String partNo, String effectiveTime, String bomCode, String organizeCode) {
|
|
|
|
|
|
|
|
|
|
//MES汇报查询BOM是否携带结束查询条件
|
|
|
|
|
MesConfig config = mesConfigService.getCfgValueByCode(organizeCode, MesExtConstWords.MES_REPORT_FIND_BOM_WITH_EFFENDTIME);
|
|
|
|
|
Boolean isWithEffEndTime = (null != config && !org.springframework.util.StringUtils.isEmpty(config.getCfgValue()) && config.getCfgValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? true : false;
|
|
|
|
|
|
|
|
|
|
if (bomCode == null) {
|
|
|
|
|
//首先根据虚结构的零件号查询出最新的一条bom信息作为bomCode
|
|
|
|
|
DdlPackBean bomCodePackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partNo, "partNo", bomCodePackBean);
|
|
|
|
|
DdlPreparedPack.getTimeBetweenCol(effectiveTime, "effStartTime", "effEndTime", bomCodePackBean, false);
|
|
|
|
|
DdlPreparedPack.getOrderBy("effStartTime", CommonEnumUtil.ASC_OR_DESC.DESC.getValue(), bomCodePackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partNo, MesExtConstWords.PART_NO, bomCodePackBean);
|
|
|
|
|
DdlPreparedPack.getStringSmallerPack(effectiveTime, MesExtConstWords.EFF_START_TIME, bomCodePackBean);
|
|
|
|
|
if (isWithEffEndTime) DdlPreparedPack.getStringBiggerPack(effectiveTime, MesExtConstWords.EFF_END_TIME, bomCodePackBean);
|
|
|
|
|
DdlPreparedPack.getOrderBy(MesExtConstWords.EFF_START_TIME, CommonEnumUtil.ASC_OR_DESC.DESC.getValue(), bomCodePackBean);
|
|
|
|
|
List<MesBom> bomList = bomRao.findByHqlTopWhere(bomCodePackBean, 1);
|
|
|
|
|
if (bomList == null || bomList.isEmpty()) {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
@ -806,9 +817,9 @@ public class MesPackageRoundnessService implements IRoundnessStrategy {
|
|
|
|
|
List<MesBom> bomResultList = new ArrayList<>();
|
|
|
|
|
DdlPackBean bomPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bomCode, "bomCode", bomPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partNo, "partNo", bomPackBean);
|
|
|
|
|
DdlPreparedPack.getStringSmallerPack(effectiveTime, "effStartTime", bomPackBean);
|
|
|
|
|
DdlPreparedPack.getStringBiggerPack(effectiveTime, "effEndTime", bomPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partNo, MesExtConstWords.PART_NO, bomPackBean);
|
|
|
|
|
DdlPreparedPack.getStringSmallerPack(effectiveTime, MesExtConstWords.EFF_START_TIME, bomPackBean);
|
|
|
|
|
if (isWithEffEndTime) DdlPreparedPack.getStringBiggerPack(effectiveTime, MesExtConstWords.EFF_END_TIME, bomPackBean);
|
|
|
|
|
List<MesBom> bomList = bomRao.findByHqlWhere(bomPackBean);
|
|
|
|
|
|
|
|
|
|
for (MesBom bom : bomList) {
|
|
|
|
|