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

tags/yfai-pcn-ext-v2.3
臧学普 7 months ago
commit e8b651168f

@ -15,10 +15,10 @@ public interface IMesAssemblyExtService {
List<MesProductionAssemblySortContext> getProductionAssemblySortContextList(MesProdRuleContext prodRuleContext);
@ApiOperation(value = "【排序线】获取生产工单装配件绑定记录 [前道所有装配件]")
List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap);
List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, String workCellCode);
@ApiOperation(value = "【排序线】获取生产工单装配件清单")
List<MesWorkOrderAssembly> getWorkOrderAssemblyList(MesProdRuleContext prodRuleContext);
List<MesWorkOrderAssembly> getWorkOrderAssemblyList(MesProdRuleContext prodRuleContext, Boolean isShowAll);
@ApiOperation(value = "获取装配件绑定记录【排序】")
List<MesProductionAssembly> getProductionAssemblySortList(String organizeCode, String productSn);

@ -26,7 +26,7 @@ public interface IMesProdRuleCfgExtService {
MesProdRuleContext getProdRuleSortContext(MesProdRuleContext prodRuleContext);
@ApiOperation(value = "【排序线】获取产品加工规则 [前道所有装配件]")
MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap);
MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, String workCellCode);
@ApiOperation(value = "【非排序线】获取产品加工规则 【根据PID获取】")
MesProdRuleNosortCfg getProdRuleNosortCfg(String organizeCode, Long id);

@ -93,15 +93,15 @@ public class MesSortShippingCheckController {
organizeCode = !StringUtils.isEmpty(model.getOrganizeCode()) ? model.getOrganizeCode() : AuthUtil.getOrganize().getOrganizeCode();
userInfo = !StringUtils.isEmpty(model.getUserInfo()) ? model.getUserInfo() : AuthUtil.getSessionUser().getUserName();
//增加单据锁
moduleKey = organizeCode + key + "SHIPPING_CODE:" + model.getShippingCode();
moduleKey = organizeCode + key + "SN:" + model.getSn();
log.info("工厂:{} 排序发运扫描条码 --- {} --- START --- 操作人:{} --- THREAD:{}", organizeCode, moduleKey, userInfo, Thread.currentThread().getName());
log.info("工厂:{} 排序发运扫描条码 --- {} --- START --- 操作人:{} --- THREAD:{}", organizeCode, model.getSn(), userInfo, Thread.currentThread().getName());
//加锁
lockFlg = redisLockUtil.redisLock(moduleKey);
log.info("工厂:{} 排序发运扫描条码 --- {} --- LOCKED --- 操作人:{} --- THREAD:{}", organizeCode, moduleKey, userInfo, Thread.currentThread().getName());
log.info("工厂:{} 排序发运扫描条码 --- {} --- LOCKED --- 操作人:{} --- THREAD:{}", organizeCode, model.getSn(), userInfo, Thread.currentThread().getName());
// 数据校验
ValidatorBean.checkNotNull(model.getShippingCode(), "发运单不能为空");
@ -119,7 +119,7 @@ public class MesSortShippingCheckController {
//解锁
if (lockFlg) {
redisLockUtil.redisUnLock(lockFlg, moduleKey);
log.info("工厂:{} 排序发运扫描条码 --- {} --- UNLOCK --- 操作人:{} --- THREAD:{}", organizeCode, moduleKey, userInfo, Thread.currentThread().getName());
log.info("工厂:{} 排序发运扫描条码 --- {} --- UNLOCK --- 操作人:{} --- THREAD:{}", organizeCode, model.getSn(), userInfo, Thread.currentThread().getName());
}
}
}

@ -138,6 +138,9 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
private IMesWorkOrderExtService workOrderExtService;
@Autowired
private MesWorkOrderRepository workOrderRepository;
@Autowired
private MesProductVersionRepository productVersionRepository;
@Override
public ListPager<MesReworkTask> queryReworkTask(MesReworkTask mesReworkTask, Pager pager) {
String organizeCode = !StringUtils.isEmpty(mesReworkTask.getOrganizeCode())?mesReworkTask.getOrganizeCode():AuthUtil.getOrganizeCode();
@ -292,6 +295,23 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
if (MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.LOT.getValue() == mesReworkTask.getType()) {
mesReworkTask.setReworkedQty(requestModel.getReworkedQty());
mesReworkTask.setScrapQty(requestModel.getScrapQty());
// 如果是批次还需要移库
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getStringEqualPack(requestModel.getPartNo(), "partNo", ddlPackBean);
MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean);
String target = mesConfigService.getCfgValue(requestModel.getOrganizeCode(), "LGORT");
if (version != null) {
target = version.getReceiveInventoryPoint();
}
String workCenterCode = "";
// 获取替换条码信息列表
if (mesPartInspection != null) {
workCenterCode = mesPartInspection.getWorkCenterCode();
}
doCreateReworkMove(requestModel,getDestLocateNo(requestModel.getOrganizeCode(), mesPartInspection.getId()),target,workCenterCode,mesReworkTask.getPartNo(), mesPartInspection.getId());
} else {
//拆解
if(!CollectionUtils.isEmpty(requestModel.getAssemblyModelList())){
@ -796,6 +816,14 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
userName, organizeCode, 1).getResultList().get(0).toString();
}
private String getDestLocateNo(String organizeCode, Long partInspectionId) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(partInspectionId, "partInspectionId", packBean);
DdlPreparedPack.getOrderBy(null, null, packBean);
MesMove mesMove = moveRepository.getByProperty(packBean);
return Objects.isNull(mesMove) ? null : mesMove.getUmlgo();
}
private String getDestLocateNo(String organizeCode, String productSn) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getStringEqualPack(productSn, "productSn", packBean);
@ -803,8 +831,6 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
MesMove mesMove = moveRepository.getByProperty(packBean);
return Objects.isNull(mesMove) ? null : mesMove.getUmlgo();
}
private MesPartInspection getMesPartInspection(MesReworkTask mesReworkTask) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesReworkTask.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(mesReworkTask.getSn(), "sn", packBean);
@ -952,4 +978,25 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
ConvertBean.serviceModelInitialize(move, requestModel.getUserName());
moveRepository.insert(move);
}
private void doCreateReworkMove(MesReworkTaskRequestModel requestModel,String srcLocate, String destLocate,String workCenterCode,String partNo,Long partInspectionId) {
MesPartSap mesPartSap = mesPartService.getMesPartSapByPartNo(partNo, requestModel.getOrganizeCode());
MesMove move = new MesMove();
move.setMatnr(mesPartSap.getPartNo());
move.setOrganizeCode(requestModel.getOrganizeCode());
move.setFactoryCode(requestModel.getOrganizeCode());
move.setLgort(srcLocate);
move.setUmlgo(destLocate);
move.setPartInspectionId(partInspectionId);
move.setMenge(Double.valueOf(requestModel.getReworkedQty()+""));
move.setMeins(mesPartSap.getUnit());
move.setPostDate(TimeTool.getToday());
move.setPostTime(TimeTool.getTimeShortWithColon());
move.setMoveType(MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE.getValue());
move.setProductSn(requestModel.getSn());
move.setWorkCenter(workCenterCode);
ConvertBean.serviceModelInitialize(move, requestModel.getUserName());
moveRepository.insert(move);
}
}

@ -59,7 +59,9 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) || StringUtils.isEmpty(prodRuleContext.getProcessCode()) || StringUtils.isEmpty(prodRuleContext.getProductSn())) return null;
//【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = filterWorkOrderAssemblyList(getWorkOrderAssemblyList(prodRuleContext), prodRuleContext.getEquipmentCode());
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, false);
//搜集匹配当前设备的装配件信息
workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o && o.getEquipmentCode().equals(prodRuleContext.getEquipmentCode()))).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
@ -75,19 +77,20 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
//【排序线】获取生产工单装配件绑定记录 [前道所有装配件,无爆炸图与音频文件逻辑]
@Override
public List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap) {
public List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, String workCellCode) {
if (null == prodRuleContext) return null;
if (StringUtils.isEmpty(prodRuleContext.getOrganizeCode()) || StringUtils.isEmpty(prodRuleContext.getWorkCenterCode()) ||
StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) || StringUtils.isEmpty(prodRuleContext.getProcessCode()) || StringUtils.isEmpty(prodRuleContext.getProductSn())) return null;
if (StringUtils.isEmpty(prodRuleContext.getOrganizeCode()) || StringUtils.isEmpty(prodRuleContext.getWorkCenterCode()) || StringUtils.isEmpty(prodRuleContext.getProductSn())) return null;
//【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = filterWorkOrderAssemblyList(getWorkOrderAssemblyList(prodRuleContext), prodRuleContext.getEquipmentCode());
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, true);
// 显示前道所有工序装配件工步: 不携带工位
workOrderAssemblyList = !StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) ? workOrderAssemblyList :
workOrderAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
//搜集匹配当前工位设备及其他工位的的装配件信息
workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o && (!o.getWorkCellCode().equals(workCellCode) || (o.getWorkCellCode().equals(workCellCode) && o.getEquipmentCode().equals(prodRuleContext.getEquipmentCode()))))).collect(Collectors.toList());
// 搜集非已装配的数据
workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
@ -101,20 +104,15 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
return productionAssemblySortContextList;
}
//搜集匹配当前设备的装配件信息
private List<MesWorkOrderAssembly> filterWorkOrderAssemblyList(List<MesWorkOrderAssembly> workOrderAssemblyList, String equipmentCode) {
return CollectionUtils.isEmpty(workOrderAssemblyList) ? null :
workOrderAssemblyList.stream().filter(o -> (null != o && o.getEquipmentCode().equals(equipmentCode))).collect(Collectors.toList());
}
//【排序线】获取生产工单装配件清单
@Override
public List<MesWorkOrderAssembly> getWorkOrderAssemblyList(MesProdRuleContext prodRuleContext) {
public List<MesWorkOrderAssembly> getWorkOrderAssemblyList(MesProdRuleContext prodRuleContext, Boolean isShowAll) {
if (null == prodRuleContext) return null;
if (StringUtils.isEmpty(prodRuleContext.getOrganizeCode()) || StringUtils.isEmpty(prodRuleContext.getWorkCenterCode()) ||
StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) || StringUtils.isEmpty(prodRuleContext.getProcessCode()) || StringUtils.isEmpty(prodRuleContext.getProductSn())) return null;
if (StringUtils.isEmpty(prodRuleContext.getOrganizeCode()) || StringUtils.isEmpty(prodRuleContext.getWorkCenterCode()) || StringUtils.isEmpty(prodRuleContext.getProductSn())) return null;
if (!isShowAll && (StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) || StringUtils.isEmpty(prodRuleContext.getProcessCode()))) return null;
DdlPackBean packBean = DdlPackBean.getDdlPackBean(prodRuleContext.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(prodRuleContext.getWorkCenterCode(), MesPcnExtConstWords.WORK_CENTER_CODE, packBean);

@ -243,11 +243,20 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
//返工单返修完成,需可疑品移正常库
if (model.isTransferFlg() && model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
//移库
if (model.getOptType() != 2) {
MesMove move = createMove(model, getDestLocateNo(model, org), configService.getCfgValue(org, "LGORT"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode());
moveRepository.save(move);
//电子化检验
String target = configService.getCfgValue(org, "LGORT");
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getStringEqualPack(model.getPartNo(), "partNo", ddlPackBean);
MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean);
if (version != null) {
target = version.getReceiveInventoryPoint();
}
MesMove move = createMove(model, getDestLocateNo(model, org), target, org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode());
moveRepository.save(move);
}
//判断首次合格还是 多次检验最终为合格品
@ -411,7 +420,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
}
}
//查询条码所在库位
srcLocateNo = getDestLocateNo(model, org);
// 20241010不找当前所在库位先找生产版本库位再找2000
// srcLocateNo = getDestLocateNo(model, org);
}
if (Objects.isNull(srcLocateNo)) {
srcLocateNo = configService.getCfgValue(org, "LGORT");
@ -421,7 +431,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean);
if (version != null) {
srcLocateNo = version.getShipInventoryPoint();
srcLocateNo = version.getReceiveInventoryPoint();
}
}
if (model.getOptType() != 2) {
@ -495,7 +505,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean);
if (version != null) {
srcLocateNo = version.getShipInventoryPoint();
srcLocateNo = version.getReceiveInventoryPoint();
}
MesMove move = createMove(model, srcLocateNo, configService.getCfgValue(org, "UMLGO"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode());
@ -536,9 +546,15 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
*/
private MesPartInspection getPartInspection(MesProduceSn produceSn,MesPartInspectionInputModel inputModel, String org) {
Integer refundFlag = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
if (inputModel.getOptType() == 2) {
refundFlag = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
}
//根据条码找最近一条单据
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(produceSn.getProductSn(), "sn", packBean);
DdlPreparedPack.getNumEqualPack(refundFlag, "refundFlag", packBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
MesPartInspection partInspection = partInspectionRepository.getByProperty(packBean);

@ -357,7 +357,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean);
if (version != null) {
source = version.getShipInventoryPoint();
source = version.getReceiveInventoryPoint();
}
}
@ -403,7 +403,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean);
if (version != null) {
target = version.getShipInventoryPoint();
target = version.getReceiveInventoryPoint();
}
//移库 转正常、放行8000移至2000
@ -562,8 +562,17 @@ public class MesNcProcessingService implements IMesNcProcessingService {
}
partInspectionRepository.save(model.getPartInspection());
String target = configService.getCfgValue(org, "LGORT");
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getStringEqualPack(model.getPart().getPartNo(), "partNo", ddlPackBean);
MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean);
if (version != null) {
target = version.getReceiveInventoryPoint();
}
//移库 转正常、放行8000移至2000
MesMove move = createMove(model, sourceValue, configService.getCfgValue(org, "LGORT"), org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
MesMove move = createMove(model, sourceValue, target, org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
ConvertBean.serviceModelInitialize(move,model.getUserName());
moveRepository.save(move);

@ -117,8 +117,8 @@ public class MesProdRuleCfgExtService implements IMesProdRuleCfgExtService {
//【排序线】获取产品加工规则 [前道所有装配件]
@Override
public MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap) {
return prodRuleContext.assemblyDataJson(assemblyExtService.getProductionAssemblySortPreCraftContextList(prodRuleContext, workCellMap));
public MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, String workCellCode) {
return prodRuleContext.assemblyDataJson(assemblyExtService.getProductionAssemblySortPreCraftContextList(prodRuleContext, workCellMap, workCellCode));
}

@ -161,8 +161,7 @@ public class MesProduceSnExtService implements IMesProduceSnExtService {
public void saveProduceSnList(StationRequestBean reqBean, Integer snStatus, List<Long> idList) {
idList = CollectionUtils.isEmpty(idList) ? idList : idList.stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(idList)) return;
DdlPackBean packBean = new DdlPackBean();
DdlPreparedPack.getStringEqualPack(reqBean.getOrganizeCode(), MesPcnExtConstWords.ORGANIZE_CODE, packBean);
DdlPackBean packBean = DdlPackBean.getDdlPackBean(reqBean.getOrganizeCode());
if (idList.size() == 1) DdlPreparedPack.getNumEqualPack(idList.get(0), MesPcnExtConstWords.ID, packBean);
else DdlPreparedPack.getInPackList(idList, MesPcnExtConstWords.ID, packBean);
produceSnRepository.updateByProperties(

@ -56,6 +56,9 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
@Autowired
private IMesConfigService configService;
@Autowired
private IMesPrintedSnLogRepository snLogRao;
@Override
public ListPager<MesPullingOrderInfo> queryMesPullingOrderInfoByPager(MesPullingOrderInfo bean, Pager pager) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
@ -176,6 +179,7 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
List<MesPullingOrderInfo> pullingOrderInfos = mesPullingOrderInfoRepository.findByHqlWhere(packBean);
if (!CollectionUtils.isEmpty(pullingOrderInfos)) {
//把查出来的拉动单打印并修改打印状态为已打印
List<MesPrintedSnLog> snLogList = new ArrayList<>();
for (MesPullingOrderInfo pullingOrderInfo : pullingOrderInfos) {
//查询拉动组明细
DdlPackBean partPackBean = DdlPackBean.getDdlPackBean(pullingOrderInfo.getOrganizeCode());
@ -188,9 +192,24 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
pullingOrderInfo.setPrintTime(TimeTool.getNowTime(true));
pullingOrderInfo.setPrintStatus(MesExtEnumUtil.PRINT_STATUS.PRINTED.getValue());
pullingOrderInfo.setIsPrint(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
ConvertBean.serviceModelUpdate(pullingOrderInfo, userName);
//10-12 打印补打拉动单新增log表
MesPrintedSnLog snLog = new MesPrintedSnLog();
snLog.setBarcode(pullingOrderInfo.getPullingOrderNo());
snLog.setCustPartNo(pullingOrderInfo.getCustPartNo());
snLog.setWorkOrderNo(pullingOrderInfo.getWorkOrderNo());
snLog.setPartNo(pullingOrderInfo.getPartNo());
snLog.setPartName(pullingOrderInfo.getPartName());
ConvertBean.serviceModelInitialize(snLog, userName);
snLog.setOrganizeCode(bean.getOrganizeCode());
snLogList.add(snLog);
}
mesPullingOrderInfoRepository.saveAll(pullingOrderInfos);
//保存打印条码记录
snLogRao.saveAll(snLogList);
}
return pullingOrderInfos;
}
@ -267,6 +286,9 @@ public class MesPullingOrderInfoService implements IMesPullingOrderInfoService {
String rule = mesPartPullDetail.getRuleValidation();
if (mesPullingOrderInfo.getScanValidationType() == MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.HOMEMADE_VALIDATE.getValue()) {
List<MesProduceSn> produceSnList = mesProduceSnExtService.getProduceSnList(mesPullingOrderInfo.getOrganizeCode(), mesPullingOrderInfo.getProductSn());
if (CollectionUtils.isEmpty(produceSnList)) {
return false;
}
return mesPartPullDetail.getPullPartNo().equals(produceSnList.get(0).getPartNo());
} else if (mesPullingOrderInfo.getScanValidationType() == MesExtEnumUtil.PART_PULL_DETAIL_SCAN_VALIDATION_TYPE.COOPERATION_VALIDATE.getValue()) {
return (Boolean) ((IMesNumberRuleMatchDispatchService) SpringContextsUtil.getBean(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.MATCH_TYPE_20.getStrategyClass()))

@ -144,9 +144,7 @@ public class MesRawPartChargingServiceImpl implements IMesRawPartChargingService
checkNotNull(mesRawPartChargingModel);
List<MesRawPartCharging> mesRawPartChargingList = findMesRawPartCharging(mesRawPartChargingModel);
if(CollectionUtils.isEmpty(mesRawPartChargingList)){
MesPcnException.throwMesBusiException("料筒条码【%s】未绑定无需初始化", mesRawPartChargingModel.getPackageSn());
}
if(!CollectionUtils.isEmpty(mesRawPartChargingList)){
for (MesRawPartCharging mesRawPartCharging : mesRawPartChargingList) {
//删除绑定信息
mesRawPartCharging.setIsDeleted(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
@ -155,6 +153,9 @@ public class MesRawPartChargingServiceImpl implements IMesRawPartChargingService
//保存日志
saveLog(mesRawPartChargingModel, mesRawPartCharging, MesExtEnumUtil.CHARGING_LOG_STATUS.CLEAR);
}
// MesPcnException.throwMesBusiException("料筒条码【%s】未绑定无需初始化", mesRawPartChargingModel.getPackageSn());
}
}

@ -189,7 +189,9 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS
//根据扫描的装车单找到是否先装车配置
//若配置为否,则查询装车单中所有的发运单是否都进行【排序发运校验】完成,若【排序发运校验】没完成,则提示,先进行排序发运校验。
if (Objects.equals(loadingList.getIsFirstInstall(), MesCommonConstant.FALSE_INTEGER)) {
MesShippingOrderManagement orderManagement = shippingOrderManagementRepository.getById(loadingListDetail.getShippingId());
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(loadingListDetail.getShippingId(),"id",packBean);
MesShippingOrderManagement orderManagement = shippingOrderManagementRepository.getByProperty(packBean);
if (!StringUtils.isEmpty(orderManagement)) {
throw new ImppBusiException(String.format("【%s】此装车单中发运单为【%s】还未做完【排序发运校验】请检查数据", model.getShippingCode(), loadingListDetail.getShippingCode()));
}

@ -179,7 +179,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.SHIPPING_ORDER_STATUS.PUBLISHED.getValue(), "status", orderPackBean);
DdlPreparedPack.getStringEqualPack(shippingGroupNo, "shippingGroupCode", orderPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"seq"}, orderPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"seq"}, orderPackBean);
return shippingOrderManagementRepository.getByProperty(orderPackBean);
}
@ -427,7 +427,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
//根据扫描的条码查询条码是否存在
packBean = DdlPackBean.getDdlPackBean(organizeCode);
if (Objects.equals(orderManagement.getIsEnableMemory(), MesCommonConstant.TRUE_INTEGER)) {
DdlPreparedPack.getStringEqualPack(detail.getBarcode(), "productSn", packBean);
DdlPreparedPack.getStringEqualPack(detail.getBarcode(), "custSn", packBean);
} else {
List<MesShippingOrderManagementDetail> mesShippingOrderManagementDetails = custInfoSeqMap.get(detail.getCustInfoSeq());
MesShippingOrderManagementDetail managementDetail = mesShippingOrderManagementDetails.get(0);
@ -435,7 +435,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
detail.setStatus(managementDetail.getStatus());
detail.setBarcode(managementDetail.getBarcode());
detail.setVisualOrderNo(managementDetail.getVisualOrderNo());
DdlPreparedPack.getStringEqualPack(detail.getBarcode(), "productSn", packBean);
DdlPreparedPack.getStringEqualPack(detail.getBarcode(), "custSn", packBean);
}
//更新条码信息,更新目视单信息
if(!StringUtils.isEmpty(detail.getBarcode()) && !Objects.equals(orderManagement.getIsEnableMemory(), MesCommonConstant.TRUE_INTEGER)){
@ -451,6 +451,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
if(!StringUtils.isEmpty(detail.getVisualOrderNo())){
MesWorkOrder workOrder = mesWorkOrderExtService.getWorkOrder(organizeCode, detail.getVisualOrderNo());
if(!Objects.isNull(workOrder)){
workOrder.setShippingTime(TimeTool.getNowTime(true));
workOrder.setWorkOrderStatus(MesExtEnumUtil.ORDER_STATUS.SHIPPING.getValue());
produceSn.setSystemSyncStatus(CommonEnumUtil.FALSE);
ConvertBean.serviceModelUpdate(workOrder, userInfo);

@ -334,7 +334,12 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
public void saveReCheck(MesSpotCheckOrderModel model, String org) {
//校验点检单
MesSpotCheckOrder spotCheckOrder = spotCheckOrderRepository.getById(model.getSpotCheckOrder().getId());
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getNumEqualPack(model.getSpotCheckOrder().getId(),"id",ddlPackBean);
MesSpotCheckOrder spotCheckOrder = spotCheckOrderRepository.getByProperty(ddlPackBean);
if(Objects.isNull(spotCheckOrder)){
throw new ImppBusiException(String.format("点检单【%s】不存在", model.getSpotCheckOrder().getId()));
}
if (spotCheckOrder.getStatus() != MesExtEnumUtil.SPOT_CHECK_ORDER_STATUS.CREATE.getValue() && spotCheckOrder.getStatus() != MesExtEnumUtil.SPOT_CHECK_ORDER_STATUS.COMPLETE.getValue()) {
throw new ImppBusiException(String.format("【%s】单据状态为【%s】请选择状态为【%s】或【%s】的单据",
model.getSpotCheckOrder().getId(), MesExtEnumUtil.SPOT_CHECK_ORDER_STATUS.valueOfDescription(spotCheckOrder.getStatus()),
@ -452,7 +457,9 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
bean.setTaskResource(MesCommonConstant.SPOT_CHECK_ORDER_TASK_RESOURCE);
bean.setStatus(MesExtEnumUtil.SPOT_CHECK_ORDER_STATUS.CREATE.getValue());
//查询点检方案 点检单点检方案 spotCheckId-id关联
MesEquipmentSpotCheck equipmentSpotCheck = equipmentSpotCheckRepository.getById(bean.getSpotCheckId());
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
DdlPreparedPack.getNumEqualPack(bean.getSpotCheckId(),"id",ddlPackBean);
MesEquipmentSpotCheck equipmentSpotCheck = equipmentSpotCheckRepository.getByProperty(ddlPackBean);
if (StringUtils.isEmpty(equipmentSpotCheck)) {
throw ImppExceptionBuilder.newInstance()
@ -601,8 +608,12 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
* @return
*/
private MesSpotCheckOrder checkSpotCheckOrder(MesSpotCheckOrder spotCheckOrder) {
MesSpotCheckOrder result = spotCheckOrderRepository.getById(spotCheckOrder.getId());
DdlPackBean packBean = DdlPackBean.getDdlPackBean(spotCheckOrder.getOrganizeCode());
DdlPreparedPack.getNumEqualPack(spotCheckOrder.getId(),"id",packBean);
MesSpotCheckOrder result = spotCheckOrderRepository.getByProperty(packBean);
if(Objects.isNull(result)){
throw new ImppBusiException(String.format("单据【%s】信息不存在", spotCheckOrder.getSpotCheckOrderNo()));
}
if (result.getStatus() != MesExtEnumUtil.SPOT_CHECK_ORDER_STATUS.CREATE.getValue()) {
throw new ImppBusiException(String.format("【%s】单据状态为【%s】请选择状态为【%s】的单据",
spotCheckOrder.getId(), MesExtEnumUtil.SPOT_CHECK_ORDER_STATUS.valueOfDescription(result.getStatus()),

@ -301,6 +301,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
newMesProductOffLine.setSapWorkCenter(oldMesWorkOrder.getErpWorkCenter());
newMesProductOffLine.setOrganizeCode(oldMesWorkOrder.getOrganizeCode());
newMesProductOffLine.setDescription(nowTime);
newMesProductOffLine.setBomTotalSize(mesBoms.size());
ConvertBean.serviceModelInitialize(newMesProductOffLine, userName);
mesProductOffLineList.add(newMesProductOffLine);
}
@ -371,6 +372,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
newMesProductOffLine.setOrganizeCode(organizeCode);
newMesProductOffLine.setDescription(mesProductionRecord.getCompleteDateTime());
newMesProductOffLine.setBomCode(mesBom.getBomCode());
newMesProductOffLine.setBomTotalSize(mesBoms.size());
ConvertBean.serviceModelInitialize(newMesProductOffLine, userName);
mesProductOffLineList.add(newMesProductOffLine);
}
@ -702,14 +704,13 @@ public class MesWorkOrderService implements IMesWorkOrderService {
}
// 同步工单信息给加工记录、条码信息
DdlPackBean snDdlPackBean = DdlPackBean.getDdlPackBean();
DdlPackBean snDdlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", snDdlPackBean);
DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", snDdlPackBean);
mesProduceSnRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "workOrderNo"},
new Object[]{userName, TimeTool.getNowTime(true), oldMesWorkOrder.getWorkOrderNo()}, snDdlPackBean);
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", packBean);
productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "workOrderNo", "reportStatus"},
new Object[]{userName, TimeTool.getNowTime(true), oldMesWorkOrder.getWorkOrderNo(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue()}, packBean);
@ -717,6 +718,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
LOGGER.info("条码【{}】报工成功,报工工单【{}】", productionRecord.getProductSn(), oldMesWorkOrder.getWorkOrderNo());
}
List<MesMove> mesMoveList = new ArrayList<>();
private MesProductOffLine getMesProductOffLine(MesProductionRecord productionRecord, String userName, MesWorkOrder oldMesWorkOrder, MesProductVersion mesProductVersion, MesBom mesBom) {
MesProductOffLine newMesProductOffLine = new MesProductOffLine();
@ -1027,7 +1029,9 @@ public class MesWorkOrderService implements IMesWorkOrderService {
@Override
public void doProductReport(MesWorkOrder mesWorkOrder, String userName) {
MesWorkOrder mesWorkOrderDb = mesWorkOrderRDao.getById(mesWorkOrder.getId());
DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesWorkOrder.getOrganizeCode());
DdlPreparedPack.getNumEqualPack(mesWorkOrder.getId(),"id",packBean);
MesWorkOrder mesWorkOrderDb = mesWorkOrderRDao.getByProperty(packBean);
if (Objects.isNull(mesWorkOrderDb)) {
MesPcnException.throwMesBusiException("工单id为【%s】工单信息不存在", mesWorkOrder.getId());
}
@ -1074,7 +1078,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
List<MesProductOffLine> mesProductOffLineList = new ArrayList<>();
String nowTime = TimeTool.getNowTime(true);
for (MesBom mesBom : mesBoms) {
mesProductOffLineList.add(creatMesProductOffLine(mesWorkOrder, mesProductVersion, sn, mesBom, nowTime));
mesProductOffLineList.add(creatMesProductOffLine(mesWorkOrder, mesProductVersion, sn, mesBom, nowTime,mesBoms.size()));
}
mesProductOffLineRDao.saveAll(mesProductOffLineList);
}
@ -1101,7 +1105,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
List<MesProductOffLine> mesProductOffLineList = new ArrayList<>();
String nowTime = TimeTool.getNowTime(true);
for (MesBom mesBom : mesBomList) {
mesProductOffLineList.add(creatMesProductOffLine(mesWorkOrder, mesProductVersion, sn, mesBom, nowTime));
mesProductOffLineList.add(creatMesProductOffLine(mesWorkOrder, mesProductVersion, sn, mesBom, nowTime, mesBomList.size()));
}
mesProductOffLineRDao.saveAll(mesProductOffLineList);
}
@ -1165,10 +1169,16 @@ public class MesWorkOrderService implements IMesWorkOrderService {
}
//更新加工记录
productionRecordService.updateProductionRecord(model.getMesProductionRecordMap().get(orderNo), userName, MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue(), "");
//更新工单汇报数量
workOrder.setSystemSyncStatus(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
workOrder.setReportedQty(workOrder.getReportedQty()+MesPcnExtConstWords.ONE);
workOrder.setModifyDatetime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")).format(new Date()));
workOrder.setModifyUser(userName);
workOrderExtService.update(workOrder);
} catch (Exception e) {
String msg = e.getMessage();
if (e instanceof ImppBusiException) {
msg = ((ImppBusiException) e).getErrorMsg();
msg = ((ImppBusiException) e).getErrorDetail();
}
log.error("工单:{}报工失败{}", orderNo, ExceptionUtils.getStackTrace(e));
productionRecordService.updateProductionRecord(model.getMesProductionRecordMap().get(orderNo), userName, MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue(), msg);
@ -1404,7 +1414,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
}
private MesProductOffLine creatMesProductOffLine(MesWorkOrder mesWorkOrder, MesProductVersion mesProductVersion,
String sn, MesBom mesBom, String nowTime) {
String sn, MesBom mesBom, String nowTime,Integer bomTotalSize) {
MesProductOffLine newMesProductOffLine;
newMesProductOffLine = new MesProductOffLine();
newMesProductOffLine.setReportPartNo(mesWorkOrder.getPartNo());
@ -1428,6 +1438,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
newMesProductOffLine.setSapWorkCenter(mesWorkOrder.getErpWorkCenter());
newMesProductOffLine.setOrganizeCode(mesWorkOrder.getOrganizeCode());
newMesProductOffLine.setDescription(nowTime);
newMesProductOffLine.setBomTotalSize(bomTotalSize);
ConvertBean.serviceModelInitialize(newMesProductOffLine, mesWorkOrder.getCreateUser());
return newMesProductOffLine;
}
@ -1666,10 +1677,8 @@ public class MesWorkOrderService implements IMesWorkOrderService {
private MesMove createMove(MesPartSap mesPart, MesProductionRecord record, String source, String target, String erpWorkCenterCode, Double qty, Integer moveType,String userName) {
MesMove move = new MesMove();
move.setMeins(record.getReportPartNo());
if (!Objects.isNull(mesPart)) {
move.setMatnr(mesPart.getPartNo());
move.setMeins(mesPart.getUnit());
}
move.setOrganizeCode(record.getOrganizeCode());
move.setFactoryCode(record.getOrganizeCode());
move.setLgort(source);

@ -136,8 +136,8 @@ public class AionPrintStrategy implements IPrintTemplateStrategyService {
if (StringUtils.isEmpty(part.getProductMatchRule())) MesPcnException.throwMesBusiException("物料[%s]未维护零件条码匹配规则", part.getPartNo());
MesNumberRule numberRule = numberRuleRepository.getByProperty(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.RULE_CODE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), part.getProcessMatchRule()});
if (null == numberRule) MesPcnException.throwMesBusiException("物料[%s]维护的零件条码匹配规则[%s]信息不存在", part.getPartNo(), part.getProcessMatchRule());
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), part.getProductMatchRule()});
if (null == numberRule) MesPcnException.throwMesBusiException("物料[%s]维护的零件条码匹配规则[%s]信息不存在", part.getPartNo(), part.getProductMatchRule());
return numberRule;
}

@ -151,8 +151,8 @@ public class GqxnyPrintStrategy implements IPrintTemplateStrategyService {
if (StringUtils.isEmpty(part.getProductMatchRule())) MesPcnException.throwMesBusiException("物料[%s]未维护零件条码匹配规则", part.getPartNo());
MesNumberRule numberRule = numberRuleRepository.getByProperty(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.RULE_CODE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), part.getProcessMatchRule()});
if (null == numberRule) MesPcnException.throwMesBusiException("物料[%s]维护的零件条码匹配规则[%s]信息不存在", part.getPartNo(), part.getProcessMatchRule());
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), part.getProductMatchRule()});
if (null == numberRule) MesPcnException.throwMesBusiException("物料[%s]维护的零件条码匹配规则[%s]信息不存在", part.getPartNo(), part.getProductMatchRule());
return numberRule;
}

@ -123,8 +123,8 @@ public class XiaoPengNewPrintStrategy implements IPrintTemplateStrategyService {
if (StringUtils.isEmpty(part.getProductMatchRule())) MesPcnException.throwMesBusiException("物料[%s]未维护零件条码匹配规则", part.getPartNo());
MesNumberRule numberRule = numberRuleRepository.getByProperty(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.RULE_CODE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), part.getProcessMatchRule()});
if (null == numberRule) MesPcnException.throwMesBusiException("物料[%s]维护的零件条码匹配规则[%s]信息不存在", part.getPartNo(), part.getProcessMatchRule());
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), part.getProductMatchRule()});
if (null == numberRule) MesPcnException.throwMesBusiException("物料[%s]维护的零件条码匹配规则[%s]信息不存在", part.getPartNo(), part.getProductMatchRule());
return numberRule;
}

@ -125,8 +125,8 @@ public class XiaoPengPrintStrategy implements IPrintTemplateStrategyService {
if (StringUtils.isEmpty(part.getProductMatchRule())) MesPcnException.throwMesBusiException("物料[%s]未维护零件条码匹配规则", part.getPartNo());
MesNumberRule numberRule = numberRuleRepository.getByProperty(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.RULE_CODE},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), part.getProcessMatchRule()});
if (null == numberRule) MesPcnException.throwMesBusiException("物料[%s]维护的零件条码匹配规则[%s]信息不存在", part.getPartNo(), part.getProcessMatchRule());
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), part.getProductMatchRule()});
if (null == numberRule) MesPcnException.throwMesBusiException("物料[%s]维护的零件条码匹配规则[%s]信息不存在", part.getPartNo(), part.getProductMatchRule());
return numberRule;
}

@ -107,7 +107,7 @@ public class MesProductionSortModuleService extends BaseModuleService {
//队列工单清单列表标题
public List<AttrBean> dataAttrList() {
List<AttrBean> attrBeanList = new ArrayList<>();
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.PRODUCE_SEQ, "工单序号");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.WORK_ORDER_SEQ, "工单序号");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.CAR_MODEL_CODE, "车型配置");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.CUST_ORDER_NO, "客户订单号");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.PART_NO, "零件号");

@ -169,7 +169,7 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService {
if (!CollectionUtils.isEmpty(productionPsInContextList)) productionDispatchContextStepService.dispatchProductionPsInContext(reqBean, productionPsInContextList);
//显示装配件信息
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), cellEquipContext, prodRuleContextList);
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), prodRuleContextList);
//验证主条码是否全部匹配完毕
if (!CollectionUtils.isEmpty(productionPsInContextList)) {

@ -127,7 +127,7 @@ public class MesAssemblyGeneratePartNoStepServiceBak extends BaseStepService {
productionDispatchContextStepService.dispatchProdRuleDataContext(reqBean, prodRuleContextList);
//显示装配件信息
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), cellEquipContext, prodRuleContextList);
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), prodRuleContextList);
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(assemblySn), stepResult.nextTriggerEvent(null), String.format("装配件条码%s匹配成功!", assemblySn));

@ -169,7 +169,7 @@ public class MesAssemblyMatchNosortRetrodictStepService extends BaseStepService
if (!CollectionUtils.isEmpty(productionPsInContextList)) productionDispatchContextStepService.dispatchProductionPsInContext(reqBean, productionPsInContextList);
//显示装配件信息
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), cellEquipContext, prodRuleContextList);
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), prodRuleContextList);
//验证主条码是否全部匹配完毕
if (!CollectionUtils.isEmpty(productionPsInContextList)) {

@ -124,7 +124,7 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
//匹配成功 【result=true 代表单次扫描匹配成功; hasUnBindAssembly=false 代表浑腔模式全部匹配成功】
if (result || !hasUnBindAssembly) {
productionDispatchContextStepService.dispatchProdRuleDataContext(reqBean, prodRuleContextList);
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), cellEquipContext, prodRuleContextList);
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), prodRuleContextList);
suffix = isSkip ? stepResult.getMsg() : String.format("装配件条码%s匹配成功!", assemblySn);
}
@ -146,7 +146,7 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
MesWorkCell workCell = productionProcessContext.getWorkCell();
if (!StringUtils.isEmpty(workCell.getIsResetScan()) && workCell.getIsResetScan().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) {
productionDispatchContextStepService.dispatchProdRuleDataContext(reqBean, resetAssembly(reqBean, prodRuleContextList));
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), cellEquipContext, prodRuleContextList);
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), prodRuleContextList);
}
stepResult.msg(String.format("装配件条码%s匹配失败!%s", assemblySn, StringUtils.isEmpty(stepResult.getMsg()) ? MesPcnExtConstWords.EMPTY : stepResult.getMsg()));

@ -11,6 +11,7 @@ import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
import cn.estsh.i3plus.pojo.mes.model.StepResult;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -40,9 +41,6 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
private IMesNumberRuleMatchDispatchService numberRuleMatchDispatchService;
@Autowired
private MesAssemblyShowNosortStepService assemblyShowNosortStepService;
@Autowired
private IMesProductionRecordService productionRecordService;
@Autowired
@ -71,9 +69,6 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
List<MesProdRuleContext> prodRuleContextList = productionDispatchContextStepService.getProdRuleDataContext(reqBean);
if (CollectionUtils.isEmpty(prodRuleContextList)) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), "当前不存在非排序加工规则数据,请重置工序!");
//从上下文中取出生产线对象
MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
//获取上下文产出零件数据信息集合
List<MesProductionPartContext> productionPartContextList = productionDispatchContextStepService.getProductionPartContext(reqBean);
@ -111,7 +106,7 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
//匹配成功 【result=true 代表单次扫描匹配成功; hasUnBindAssembly=false 代表浑腔模式全部匹配成功】
if (result || !hasUnBindAssembly) {
productionDispatchContextStepService.dispatchProdRuleDataContext(reqBean, prodRuleContextList);
assemblyShowNosortStepService.showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), cellEquipContext, prodRuleContextList);
((MesAssemblyShowSortStepService) SpringContextsUtil.getBean("mesAssemblyShowSortStepService")).showProductionAssembly(reqBean, resultBean, productionProcessContext.getWorkCenter(), prodRuleContextList, true);
suffix = (isSkip || isCavitySkip) ? stepResult.getMsg() : String.format("装配件条码%s匹配成功!", assemblySn);
}
@ -199,7 +194,7 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
if (null == equipVariableCollectContext || equipVariableCollectContext.getIsConsume().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) continue;
//装配件跳过, 必须顺序扫描才生效
if (isSkip && !StringUtils.isEmpty(prodRuleContext.getIsCheckBindSeq()) && prodRuleContext.getIsCheckBindSeq().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) {
if (isSkip && isCheckBindSeq(prodRuleContext, productionAssemblySortContext)) {
//装配件清单该数据标记跳过
productionAssemblySortContext.assemblySkip();
@ -230,9 +225,11 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
flag = true;
break LOOP;
}
break LOOP;
continue;
}

@ -179,8 +179,8 @@ public class MesAssemblySaveStepService extends BaseStepService {
private void saveWorkOrderAssembly(StationRequestBean reqBean, MesProductionAssemblyContext productionAssemblyContext) {
workOrderAssemblyRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID},
new Object[]{productionAssemblyContext.getSourceId()},
new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionAssemblyContext.getSourceId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.ASSEMBLY_STATUS},
new Object[]{reqBean.getUserInfo(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), productionAssemblyContext.getAssemblyStatus()});
}

@ -106,7 +106,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
}
//显示装配件信息
showProductionAssembly(reqBean, resultBean, workCenter, cellEquipContext, prodRuleContextList);
showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList);
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "装配件扫描项已查询完毕,请查看!");
}
@ -431,14 +431,14 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
}
//显示装配件信息
public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, MesCellEquipContext cellEquipContext, List<MesProdRuleContext> prodRuleContextList) {
public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
//封装匹配当前设备的装配件信息
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(cellEquipContext, prodRuleContext.getAssemblyDataContext(workCenter));
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getAssemblyDataContext(workCenter));
if (CollectionUtils.isEmpty(assemblyShowContextList)) continue;
//装配件清单列表标题
@ -463,7 +463,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
}
//封装匹配当前设备的装配件信息
private List<MesAssemblyShowContext> getAssemblyShowContextList(MesCellEquipContext cellEquipContext, List<MesProductionAssemblyContext> productionAssemblyContextList) {
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList) {
if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null;
List<MesAssemblyShowContext> assemblyShowContextList = new ArrayList<>();
for (MesProductionAssemblyContext item : productionAssemblyContextList) {
@ -484,7 +484,11 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
private MesAssemblyShowContext assemblyShowContext(MesProductionAssemblyContext o) {
MesAssemblyShowContext assemblyShowContext = new MesAssemblyShowContext();
BeanUtils.copyProperties(o, assemblyShowContext);
if (!MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedShowMatchRule(assemblyShowContext.getMatchType())) {
assemblyShowContext.setMatchTypeName(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.valueOfDescription(assemblyShowContext.getMatchType()));
} else {
assemblyShowContext.setMatchTypeName(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.valueOfDescription(assemblyShowContext.getMatchType()) + "【" + assemblyShowContext.getMatchRule() + "】");
}
assemblyShowContext.setAssemblyStatusName(MesExtEnumUtil.ASSEMBLY_STATUS.valueOfDescription(assemblyShowContext.getAssemblyStatus()));
if (MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue() != assemblyShowContext.getAssemblyStatus())
assemblyShowContext.setColor(StringUtils.isEmpty(assemblyShowContext.getShowColor()) ? MesExtEnumUtil.COLOR.GREEN.getValue() : assemblyShowContext.getShowColor());

@ -1,20 +1,16 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.util.PojoAttrUtil;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsInContext;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
import cn.estsh.i3plus.pojo.mes.model.AttrBean;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.model.StepResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Description :
@ -34,27 +30,7 @@ public class MesAssemblyShowSortPreCraftStepService extends MesAssemblyShowSortS
//不携带工位工序条件
MesProdRuleContext prodRuleContext = new MesProdRuleContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode())
.equipmentCode(cellEquipContext.getEquipmentCode()).workOrderNo(productionPsInContext.getWorkOrderNo()).productSn(productionPsInContext.getProductSn()).foreignKey(productionPsInContext.getForeignKey());
return prodRuleCfgExtService.getProdRuleSortPreCraftContext(prodRuleContext, workCellMap);
}
//装配件清单列表标题
public List<AttrBean> dataAttrList(List<MesProdRuleContext> prodRuleContextList) {
List<AttrBean> attrBeanList = new ArrayList<>();
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.INDEX, "序号");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.WORK_CELL_CODE, "工位代码");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.MATCH_TYPE_NAME, "装配方式");
if (prodRuleContextList.size() > 1) PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.WORK_ORDER_NO, "生产工单编号");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.PART_NO, "零件编码");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.ASSEMBLY_PART_NO, "原料编码");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.ASSEMBLY_PART_NAME, "原料名称");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.ASSEMBLY_SN, "原料条码");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.ASSEMBLY_STATUS_NAME, "装配状态");
return attrBeanList;
}
//每个表格重新排序
public List<MesAssemblyShowContext> sortAssemblyShowContextList(List<MesAssemblyShowContext> assemblyShowContextList) {
return assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getProcessSeq).thenComparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
return prodRuleCfgExtService.getProdRuleSortPreCraftContext(prodRuleContext, workCellMap, reqBean.getWorkCellCode());
}
}

@ -95,7 +95,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//显示装配件信息
if (!showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList))
if (!showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList, false))
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "当前未查询到相关的装配件清单");
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, "显示装配件扫描项成功!");
@ -110,9 +110,10 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//装配件清单列表标题
public List<AttrBean> dataAttrList(List<MesProdRuleContext> prodRuleContextList) {
private List<AttrBean> dataAttrList(List<MesProdRuleContext> prodRuleContextList, Boolean isNeedShowCell) {
List<AttrBean> attrBeanList = new ArrayList<>();
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.INDEX, "序号");
if (isNeedShowCell) PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.WORK_CELL_CODE, "工位代码");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.MATCH_TYPE_NAME, "装配方式");
if (prodRuleContextList.size() > 1) PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.WORK_ORDER_NO, "生产工单编号");
PojoAttrUtil.loadPojoAttrs(attrBeanList, MesPcnExtConstWords.PART_NO, "零件编码");
@ -124,8 +125,8 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//每个表格重新排序
public List<MesAssemblyShowContext> sortAssemblyShowContextList(List<MesAssemblyShowContext> assemblyShowContextList) {
return assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
private List<MesAssemblyShowContext> sortAssemblyShowContextList(List<MesAssemblyShowContext> assemblyShowContextList) {
return assemblyShowContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesAssemblyShowContext::getProcessSeq).thenComparing(MesAssemblyShowContext::getRouteSeq)).collect(Collectors.toList());
}
//查询排序线加工规则装配件数据信息
@ -156,10 +157,12 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
private Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList, Boolean isNeedShowCell) {
List<AttrBean> attrBeanList = null;
if (isNeedShowCell) isNeedShowCell = checkIsNeedShowCell(reqBean, workCenter, prodRuleContextList);
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
@ -169,7 +172,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
if (CollectionUtils.isEmpty(assemblyShowContextList)) continue;
//装配件清单列表标题
if (CollectionUtils.isEmpty(attrBeanList)) attrBeanList = dataAttrList(prodRuleContextList);
if (CollectionUtils.isEmpty(attrBeanList)) attrBeanList = dataAttrList(prodRuleContextList, isNeedShowCell);
//封装多表格
resultBean.addStationResultBeans(new StationResultBean().dataType(MesPcnEnumUtil.STATION_DATA_TYPE.TABLE.getValue()).dataAttrList(attrBeanList).resultList(assemblyShowContextList));
@ -185,6 +188,15 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//验证是否需要演示工位代码列
private Boolean checkIsNeedShowCell(StationRequestBean reqBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
if (!prodRuleContext.getAssemblyDataContext(workCenter).get(0).getWorkCellCode().equals(reqBean.getWorkCellCode())) return true;
}
return false;
}
//封装匹配当前设备的装配件信息
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList) {
if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null;
@ -207,7 +219,11 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
private MesAssemblyShowContext assemblyShowContext(MesProductionAssemblyContext o) {
MesAssemblyShowContext assemblyShowContext = new MesAssemblyShowContext();
BeanUtils.copyProperties(o, assemblyShowContext);
if (!MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedShowMatchRule(assemblyShowContext.getMatchType())) {
assemblyShowContext.setMatchTypeName(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.valueOfDescription(assemblyShowContext.getMatchType()));
} else {
assemblyShowContext.setMatchTypeName(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.valueOfDescription(assemblyShowContext.getMatchType()) + "【" + assemblyShowContext.getMatchRule() + "】");
}
assemblyShowContext.setAssemblyStatusName(MesExtEnumUtil.ASSEMBLY_STATUS.valueOfDescription(o.getAssemblyStatus()));
if (MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue() != assemblyShowContext.getAssemblyStatus())
assemblyShowContext.setColor(StringUtils.isEmpty(assemblyShowContext.getShowColor()) ? MesExtEnumUtil.COLOR.GREEN.getValue() : assemblyShowContext.getShowColor());

@ -23,7 +23,10 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -128,17 +131,10 @@ public class MesProductSnPrintSortStepService extends BaseStepService {
// 从物料信息中获取标签模板
String labelTemplateCode = partDataContext.get(sn.getPartNo()).getCustLabelTemplate();
// 从物料信息中获取打印机
String productPrinterCode = partDataContext.get(sn.getPartNo()).getProductPrinterCode();
if (labelTemplateCode == null) {
stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("工单号[%s]零件号[%s]未在ERP物料信息维护打印模板,请检查并修改!", sn.getWorkOrderNo(), sn.getPartNo()));
}
if (StringUtils.isEmpty(productPrinterCode)) {
stepExpSendMsgAndThrowEx(reqBean, resultBean, String.format("工单号[%s]零件号[%s]未在ERP物料信息维护打印机,请检查并修改!", sn.getWorkOrderNo(), sn.getPartNo()));
}
MesProduceSnPrintModel mesProduceSnPrintModel = new MesProduceSnPrintModel();
// 查模板代码
MesLabelTemplate labelTemplate = getLabelTemplate(labelTemplateCode, organizeCode);
@ -148,7 +144,7 @@ public class MesProductSnPrintSortStepService extends BaseStepService {
}
mesProduceSnPrintModel.setMesLabelTemplate(labelTemplate);
mesProduceSnPrintModel.setPrinter(productPrinterCode);
mesProduceSnPrintModel.setPrinter(partDataContext.get(sn.getPartNo()).getProductPrinterCode());
mesProduceSnPrintModel.setPartNo(sn.getPartNo());
mesProduceSnPrintModel.setOrganizeCode(organizeCode);
mesProduceSnPrintModel.setSourceData(workOrder);

@ -5,6 +5,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepSer
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
@ -25,10 +26,8 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -123,7 +122,7 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
MesProdRuleContext prodRuleContext = CollectionUtils.isEmpty(prMap) ? null : prMap.get(productionPsOutContext.getForeignKey());
MesProductionRecord productionRecord = new MesProductionRecord();
BeanUtils.copyProperties(productionPsOutContext, productionRecord);
BeanUtils.copyProperties(productionPsOutContext, productionRecord, MesPcnExtConstWords.BASE_BEAN_FIELDS);
productionRecord.setMouldNo(mouldNo);
productionRecord.setEquipmentCode(cellEquipContext.getEquipmentCode());
@ -172,6 +171,7 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
productionRecord.setOrganizeCode(reqBean.getOrganizeCode());
ConvertBean.serviceModelInitialize(productionRecord, reqBean.getUserInfo());
productionRecord.setCompleteDateTime(productionRecord.getModifyDatetime());
productionRecord.setCreateDatetime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")).format(new Date()));
productionRecord.setFid(UUID.randomUUID().toString());
productionRecord.setOneMouldMoreId(UUID.randomUUID().toString());

@ -105,14 +105,14 @@ public class MesSendCavityGroupParamsCmdStepService extends BaseStepService {
for (MesCavityGroupDetailCfg mesCavityGroupDetailCfg : mesCavityGroupDetailCfgs) {
index ++;
// 获取加工参数
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean();
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(reqBean.getOrganizeCode());
DdlPreparedPack.getNumEqualPack(mesCavityGroupDetailCfg.getId(), "sourceId", ddlPackBean);
List<MesEquipmentProdParamCfg> mesEquipmentProdParamCfgs = mesEquipmentProdParamCfgRepository.findByHqlWhere(ddlPackBean);
for (MesEquipmentProdParamCfg mesEquipmentProdParamCfg : mesEquipmentProdParamCfgs) {//
String strategyClass = getStrateClass(mesEquipmentProdParamCfg.getMatchRule());
AbstractWriteVariableService equipVariableRwExtService = ((AbstractWriteVariableService) SpringContextsUtil.getBean(strategyClass));
DdlPackBean paramPackBean = DdlPackBean.getDdlPackBean();
DdlPackBean paramPackBean = DdlPackBean.getDdlPackBean(reqBean.getOrganizeCode());
DdlPreparedPack.getNumEqualPack(mesEquipmentProdParamCfg.getEquipVariableId(), "id", paramPackBean);
MesEquipmentVariable mesEquipmentVariable = mesEquipmentVariableRepository.getByProperty(paramPackBean);
if (mesEquipmentVariable == null) {

@ -67,8 +67,8 @@ public class MesWorkOrderQueueSaveStepService extends BaseStepService {
private void saveWorkOrderQueue(StationRequestBean reqBean, MesProductionPsInContext productionPsInContext) {
queueOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID},
new Object[]{productionPsInContext.getRelateId()},
new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionPsInContext.getRelateId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.STATUS},
new Object[]{reqBean.getUserInfo(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.QUEUE_ORDER_STATUS.FINISH.getValue()});
}

@ -93,20 +93,20 @@ public class MesWorkOrderSaveSortStepService extends BaseStepService {
if (null == productionPartContext || StringUtils.isEmpty(productionPartContext.getForeignKey())) continue;
Boolean isEndWorkCell = (StringUtils.isEmpty(workCell.getIsEndWorkCell()) || workCell.getIsEndWorkCell().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0) ? false : true;
Boolean isEndWorkCell = (!StringUtils.isEmpty(workCell.getIsEndWorkCell()) && workCell.getIsEndWorkCell().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) ? true : false;
if (!isEndWorkCell && productionPartContext.getWorkOrderStatus().compareTo(MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()) == 0) continue;
if (!isEndWorkCell) {
workOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID},
new Object[]{productionPartContext.getId()},
new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionPartContext.getId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.ONLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue(), TimeTool.getNowTime(true)});
} else {
workOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID},
new Object[]{productionPartContext.getId()},
new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionPartContext.getId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLETE_QTY, MesPcnExtConstWords.UN_COMPLETE_QTY, MesPcnExtConstWords.OFFLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0), TimeTool.getNowTime(true)});
}

@ -43,6 +43,9 @@ public class MesAssemblyShowContext implements Serializable {
@ApiParam("装配件条码确认方式")
private Integer matchType;
@ApiParam("扫描规则")
public String matchRule;
@ApiParam("装配零件状态")
private String assemblyStatusName;

@ -53,7 +53,7 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon
this.partNo = prodRuleContext.getOutPartNo();
if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.isRepeat)) this.isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
if (StringUtils.isEmpty(this.isRepeat) || this.isRepeat.compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0) this.isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();

@ -143,7 +143,7 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
this.sourceId = workOrderAssembly.getId();
}
if (null != workOrderAssembly) {
if (null != productionAssembly) {
this.id = productionAssembly.getId();
this.createDatetime = productionAssembly.getCreateDatetime();
this.createUser = productionAssembly.getCreateUser();

@ -631,5 +631,7 @@ public class MesPcnExtConstWords {
public static final int DATA_MATRIX_CODE_HEIGHT = 80;
// dataMatrix 形式的客户条码
public static final String CUST_SN_DATA_MATRIX = "custSnDataMatrix";
public static final String CUST_SN_DATA_MATRIX_BASE64 = "custSnDataMatrixBase64";
// 工单序号
public static final String WORK_ORDER_SEQ = "workOrderSeq";
}

Loading…
Cancel
Save