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

tags/yfai-pcn-ext-v2.3
jun 8 months ago
commit 4440d368a0

@ -130,17 +130,29 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
productionRecord.setEquipmentName(cellEquipContext.getEquipmentName()); productionRecord.setEquipmentName(cellEquipContext.getEquipmentName());
if (workCenter.getCenterType().compareTo(MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue()) == 0) { if (workCenter.getCenterType().compareTo(MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue()) == 0) {
//非排序
productionRecord.setReportType((null != prodRuleContext && !StringUtils.isEmpty(prodRuleContext.getReportType())) ? prodRuleContext.getReportType() : MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue()); productionRecord.setReportType((null != prodRuleContext && !StringUtils.isEmpty(prodRuleContext.getReportType())) ? prodRuleContext.getReportType() : MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue());
if (productionRecord.getReportType().compareTo(MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue()) != 0) productionRecord.setReportPartNo(productionPsOutContext.getPartNo()); if (productionRecord.getReportType().compareTo(MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue()) != 0) productionRecord.setReportPartNo(productionPsOutContext.getPartNo());
productionRecord.setReportStatus(productionRecord.getReportType().compareTo(MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue()) != 0 ? MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue() : MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue()); productionRecord.setReportStatus(productionRecord.getReportType().compareTo(MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue()) != 0 ? MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue() : MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue());
if (productionRecord.getReportStatus().compareTo(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue()) == 0 && isSamePart(productionPsInContext, productionPsOutContext) &&
checkPsIsReported(reqBean.getOrganizeCode(), productionPsOutContext.getProductSn(), productionPsOutContext.getPartNo())) productionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue());
} else { } else {
//排序的汇报基于工单装配件,加工记录默认不汇报 //排序
productionRecord.setReportType(MesExtEnumUtil.NOSORT_REPORT_TYPE.NO_REPORT.getValue()); List<MesProductionAssemblySortContext> productionAssemblySortContextList = prodRuleContext.getSortAssemblyDataContext();
Optional<MesProductionAssemblySortContext> optional = CollectionUtils.isEmpty(productionAssemblySortContextList) ? null :
productionAssemblySortContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getReportType()) && o.getReportType().compareTo(MesExtEnumUtil.MES_REPORT_TYPE.NO_REPORT.getValue()) != 0)).findFirst();
if (null == optional || !optional.isPresent()) {
productionRecord.setReportType(MesExtEnumUtil.MES_REPORT_TYPE.NO_REPORT.getValue());
productionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue()); productionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue());
} else {
productionRecord.setReportType(optional.get().getReportType());
productionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue());
productionRecord.setReportPartNo(!StringUtils.isEmpty(optional.get().getReportPartNo()) ? optional.get().getReportPartNo() : productionRecord.getPartNo());
}
} }
//非排序与排序 相同验证: 判断是否已经存在汇报状态的加工记录
if (productionRecord.getReportStatus().compareTo(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue()) == 0 && isSamePart(productionPsInContext, productionPsOutContext) &&
checkPsIsReported(reqBean.getOrganizeCode(), productionPsOutContext.getProductSn(), productionPsOutContext.getPartNo())) productionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue());
productionRecord.setModuleStatisticsStatus(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); productionRecord.setModuleStatisticsStatus(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
productionRecord.setAreaCode(reqBean.getAreaCode()); productionRecord.setAreaCode(reqBean.getAreaCode());

Loading…
Cancel
Save