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

tags/yfai-pcn-ext-v2.3
臧学普 6 months ago
commit 5df4a7dc80

@ -20,4 +20,7 @@ public interface IMesShippingSnUniqueService {
@ApiOperation("新增唯一性校验")
void insertMesShippingSnUnique(String organizeCode, String productSn,String shippingCode,String userName);
@ApiOperation("唯一性校验")
MesShippingSnUnique getMesShippingSnUnique(String organizeCode, String productSn,String shippingCode,String userName);
}

@ -61,14 +61,15 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
//【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, false);
// 搜集待装配或者解绑的数据
workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o &&
(o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 || o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0))).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
// 搜集待装配或者解绑的数据
List<MesWorkOrderAssembly> unBindList = workOrderAssemblyList.stream().filter(o -> (null != o &&
(o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 ||
o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0))).collect(Collectors.toList());
//获取排序FILE文件URL
Map<Long, String> fileMap = getFileMap(prodRuleContext.getOrganizeCode(), filterSortFileIdList(workOrderAssemblyList));
Map<Long, String> fileMap = getFileMap(prodRuleContext.getOrganizeCode(), filterSortFileIdList(unBindList));
List<MesProductionAssemblySortContext> productionAssemblySortContextList = new ArrayList<>();
@ -89,11 +90,12 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
//【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, true);
// 搜集非已装配的数据
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;
// 搜集非已装配的数据
List<MesWorkOrderAssembly> unBindList = workOrderAssemblyList.stream().filter(o -> (null != o &&
o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
//获取装配件绑定记录
Map<Long, List<MesProductionAssembly>> productionAssemblyMap = groupProductionAssembly(getProductionAssemblySortList(prodRuleContext.getOrganizeCode(), prodRuleContext.getProductSn()));

@ -50,4 +50,14 @@ public class MesShippingSnUniqueServiceImpl implements IMesShippingSnUniqueServi
ConvertBean.serviceModelInitialize(mesShippingSnUnique,userName);
mesShippingSnUniqueRepository.insert(mesShippingSnUnique);
}
@Override
public MesShippingSnUnique getMesShippingSnUnique(String organizeCode, String productSn, String shippingCode,String userName) {
MesShippingSnUnique mesShippingSnUnique = new MesShippingSnUnique();
mesShippingSnUnique.setOrganizeCode(organizeCode);
mesShippingSnUnique.setProductSn(productSn);
mesShippingSnUnique.setShippingCode(shippingCode);
ConvertBean.serviceModelInitialize(mesShippingSnUnique,userName);
return mesShippingSnUnique;
}
}

@ -97,6 +97,9 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
@Autowired
private IMesShippingSnUniqueService mesShippingSnUniqueService;
@Autowired
private MesShippingSnUniqueRepository mesShippingSnUniqueRepository;
@Override
public MesSortShippingCheckModel doShippingOrderNoQuery(MesShippingOrderManagement shippingOrderManagement) {
//校验发运单
@ -138,8 +141,11 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
if (!Objects.isNull(model.getIsPass()) && Objects.equals(MesPcnExtConstWords.ONE, model.getIsPass())) {
skipShippingDetails(model, model.getUserInfo(), orderManagement);
//扫描条码
} else{
model = ((IMesShippingScanStrategyService) SpringContextsUtil.getBean(MesExtEnumUtil.SHIPPING_GROUP_CONFIRM_PART_TYPE.valueOfServiceImpl(Integer.parseInt(shippingGroup.getConfirmPartType())))).doScan(model,orderManagement,shippingGroup);
} else {
if (StringUtils.isEmpty(shippingGroup.getConfirmPartType())) {
MesPcnException.throwMesBusiException("零件发运组【%s】扫描确认方式未维护请检查数据");
}
model = ((IMesShippingScanStrategyService) SpringContextsUtil.getBean(MesExtEnumUtil.SHIPPING_GROUP_CONFIRM_PART_TYPE.valueOfServiceImpl(Integer.parseInt(shippingGroup.getConfirmPartType())))).doScan(model, orderManagement, shippingGroup);
}
model.setDetailList(model.getDetailList());
//当前发运单全部扫描完成 并且不需要扫位置码
@ -466,22 +472,21 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
List<MesProduceSn> produceSnList = new ArrayList<>();
List<MesWorkOrder> mesWorkOrderList = new ArrayList<>();
List<MesShippingSnUnique> mesShippingSnUniqueList = new ArrayList<>();
for (MesShippingOrderManagementDetail detail : orderManagementDetailList) {
//根据扫描的条码查询条码是否存在
packBean = DdlPackBean.getDdlPackBean(organizeCode);
if (Objects.equals(orderManagement.getIsEnableMemory(), MesCommonConstant.TRUE_INTEGER)) {
DdlPreparedPack.getStringEqualPack(detail.getBarcode(), "custSn", packBean);
} else {
if (!Objects.equals(orderManagement.getIsEnableMemory(), MesCommonConstant.TRUE_INTEGER)){
List<MesShippingOrderManagementDetail> mesShippingOrderManagementDetails = custInfoSeqMap.get(detail.getId());
MesShippingOrderManagementDetail managementDetail = mesShippingOrderManagementDetails.get(0);
detail.setRemark(managementDetail.getRemark());
detail.setStatus(managementDetail.getStatus());
detail.setBarcode(managementDetail.getBarcode());
detail.setVisualOrderNo(managementDetail.getVisualOrderNo());
DdlPreparedPack.getStringEqualPack(detail.getBarcode(), "custSn", packBean);
}
//更新条码信息,更新目视单信息
if(!StringUtils.isEmpty(detail.getBarcode()) && !Objects.equals(orderManagement.getIsEnableMemory(), MesCommonConstant.TRUE_INTEGER)){
packBean.setWhereAppend(packBean.getWhereAppend() + " and (model.productSn = '"+detail.getBarcode()+"' or model.custSn = '"+detail.getBarcode()+"'");
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean);
MesProduceSn produceSn = produceSnRepository.getByProperty(packBean);
if(!Objects.isNull(produceSn)){
@ -491,7 +496,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
produceSnList.add(produceSn);
} else {
//记录唯一性校验表
mesShippingSnUniqueService.insertMesShippingSnUnique(organizeCode, detail.getBarcode(), orderManagement.getShippingCode(), userInfo);
mesShippingSnUniqueList.add(mesShippingSnUniqueService.getMesShippingSnUnique(organizeCode, detail.getBarcode(), orderManagement.getShippingCode(), userInfo));
}
//更新工单
if(!StringUtils.isEmpty(detail.getVisualOrderNo())){
@ -516,6 +521,10 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
detail.setActualQty(MesPcnExtConstWords.ONE);
ConvertBean.serviceModelUpdate(detail, userInfo);
}
//保存唯一性表
if(!CollectionUtils.isEmpty(mesShippingSnUniqueList)){
mesShippingSnUniqueRepository.saveAll(mesShippingSnUniqueList);
}
//更新条码
if(!CollectionUtils.isEmpty(produceSnList)){
produceSnRepository.saveAll(produceSnList);

@ -218,7 +218,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
//封装匹配当前设备的装配件信息
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getAssemblyDataContext(workCenter), isNeedShowMatchRule, topRowInfo);
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getSortAssemblyDataContext(), isNeedShowMatchRule, topRowInfo);
if (CollectionUtils.isEmpty(assemblyShowContextList)) continue;
//装配件清单列表标题
@ -252,12 +252,12 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
}
//封装匹配当前设备的装配件信息
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList, Boolean isNeedShowMatchRule, String topRowInfo) {
if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null;
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblySortContext> productionAssemblySortContextList, Boolean isNeedShowMatchRule, String topRowInfo) {
if (CollectionUtils.isEmpty(productionAssemblySortContextList)) return null;
List<MesAssemblyShowContext> assemblyShowContextList = new ArrayList<>();
for (MesProductionAssemblyContext item : productionAssemblyContextList) {
//不显示且不扫描/仅目视的不显示出来
if (null == item || MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNoShow(item.getMatchType())) continue;
for (MesProductionAssemblySortContext item : productionAssemblySortContextList) {
//不显示且不扫描/仅目视的不显示出来, 已经存在于DB的不显示出来
if (null == item || item.getIsExistDb().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0 || MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNoShow(item.getMatchType())) continue;
assemblyShowContextList.add(assemblyShowContext(item, isNeedShowMatchRule, topRowInfo));
}

@ -234,8 +234,8 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
@Override
public String getRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, String repeatKey) {
String repeatAssemblySnJson = getFsmBusiData(organizeCode, getRepeatAssemblySnContextKey(organizeCode, workCenterCode, workCellCode), repeatKey);
MesProductionAssemblyContext productionAssemblyContext = !StringUtils.isEmpty(repeatAssemblySnJson) ? JSONObject.parseObject(repeatAssemblySnJson, MesProductionAssemblyContext.class) : null;
return null != productionAssemblyContext ? productionAssemblyContext.getAssemblySn() : null;
//MesProductionAssemblyContext productionAssemblyContext = !StringUtils.isEmpty(repeatAssemblySnJson) ? JSONObject.parseObject(repeatAssemblySnJson, MesProductionAssemblyContext.class) : null;
return repeatAssemblySnJson;
}
//根据设备代码获取可复用条码的个数

@ -133,6 +133,9 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
@ApiParam(name = "是否保存到DB")
private Integer isSaveDb = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
@ApiParam(name = "是否已经存在于DB")
private Integer isExistDb = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
public MesProductionAssemblySortContext() {}
//前道工位
@ -149,10 +152,19 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 0 ||
this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();
this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0) {
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();
}
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType))
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) == 0 ||
this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_40.getValue()) == 0) {
this.fileIsFinished().isSaveDb().setIsExistDb(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
}
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 &&
!MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType)) {
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();
}
return this;
}
@ -183,6 +195,8 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 0 ||
this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) == 0) this.isSaveDb().setIsExistDb(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType))
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();

Loading…
Cancel
Save