|
@@ -9,6 +9,7 @@ import com.rongwei.bsentity.domain.*;
|
|
|
import com.rongwei.bsentity.vo.CancelProcessOperationVo;
|
|
|
import com.rongwei.bsentity.vo.CommonUpdateProductionStatusReq;
|
|
|
import com.rongwei.commonservice.service.RedisService;
|
|
|
+import com.rongwei.rwadmincommon.system.domain.SysDictDo;
|
|
|
import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
@@ -559,6 +560,8 @@ public class ReportCheckServiceImpl implements ReportCheckService {
|
|
|
apsWorkInProgressInventoryDos, currentReportOutputs, TO_BE_PUT_INTO_STORAGE, PASS);
|
|
|
}
|
|
|
}
|
|
|
+ //新增需求---更新该报工记录所有输出物料批次号对应在制品
|
|
|
+ updateWorkInProgressInventoryDetail(apsWorkInProgressInventoryDos,currentReportOutputs,currentProcessOperationDo.getIfblankprocess());
|
|
|
}
|
|
|
log.info("开始更新在制品和工序作业输出物料信息");
|
|
|
// 保存在制品
|
|
@@ -1136,4 +1139,70 @@ public class ReportCheckServiceImpl implements ReportCheckService {
|
|
|
processOperationDo.setOutputqualifiednum(processOperationDo.getOutputqualifiednum() + 1);
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新该报工记录所有输出物料批次号对应的在制品
|
|
|
+ * @param workInProgressInventoryDos
|
|
|
+ * @param apsReportOutputDos
|
|
|
+ * @param ifblankprocess
|
|
|
+ */
|
|
|
+ private void updateWorkInProgressInventoryDetail(List<ApsWorkInProgressInventoryDo> workInProgressInventoryDos, List<ApsReportOutputDo> apsReportOutputDos, String ifblankprocess) {
|
|
|
+ //如果工序作业是否坯料工序=是,则坯料描述(坯料)=实际输出物料
|
|
|
+ //料卷描述(在制品)=实际输出物料
|
|
|
+ //检验等级=输出物料的检验等级
|
|
|
+ //是否合格=输出物料的是否合格
|
|
|
+ //检验备注=该输出物料的“主要缺陷:{主要缺陷逗号拼接};次要缺陷:{次要缺陷逗号拼接};+{检验备注}
|
|
|
+ List<SysDictDo> defectTypes = apsReportOutputService.getQualityDefectsDictsByType();
|
|
|
+ apsReportOutputDos.forEach(apsReportOutputDo -> {
|
|
|
+ workInProgressInventoryDos.stream()
|
|
|
+ .filter(inventory -> apsReportOutputDo.getOutputnumber().equals(inventory.getBatchnumber()))
|
|
|
+ .collect(Collectors.toList()).forEach(data -> {
|
|
|
+ if ("是".equals(ifblankprocess)){
|
|
|
+ data.setBlankname(apsReportOutputDo.getOutputdesc());
|
|
|
+ }
|
|
|
+ data.setWorkinprocess(apsReportOutputDo.getOutputdesc());
|
|
|
+ data.setInspectionlevel(apsReportOutputDo.getInsepctionlevel());
|
|
|
+ data.setIsqualified(apsReportOutputDo.getQualified());
|
|
|
+ String formatMajor = handleDefect(apsReportOutputDo.getMajor(),defectTypes);
|
|
|
+ String formatMinor = handleDefect(apsReportOutputDo.getMinor(),defectTypes);
|
|
|
+ if (StringUtils.isNotBlank(formatMajor)&&StringUtils.isNotBlank(formatMinor)){
|
|
|
+ data.setRemark("主要缺陷:"+formatMajor+";次要缺陷:"+formatMinor+";"+apsReportOutputDo.getCheckremark());
|
|
|
+ }else {
|
|
|
+ if (StringUtils.isNotBlank(formatMajor)){
|
|
|
+ data.setRemark("主要缺陷:"+formatMajor+";"+apsReportOutputDo.getCheckremark());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(formatMinor)){
|
|
|
+ data.setRemark("次要缺陷:"+formatMinor+";"+apsReportOutputDo.getCheckremark());
|
|
|
+ }
|
|
|
+ data.setRemark(apsReportOutputDo.getCheckremark());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理主要缺陷/次要缺陷字典值显示为逗号分隔的文本
|
|
|
+ * @param defect
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String handleDefect(String defect,List<SysDictDo> dictDos) {
|
|
|
+ String result = "";
|
|
|
+ if (StringUtils.isNotBlank(defect)){
|
|
|
+ List<String> dictNameList = new ArrayList<>();
|
|
|
+ String[] valuesToLookup = defect.split(",");
|
|
|
+ for (SysDictDo sysDictDo : dictDos) {
|
|
|
+ for (String value : valuesToLookup) {
|
|
|
+ if (sysDictDo.getId().equals(value.trim())) {
|
|
|
+ dictNameList.add(sysDictDo.getName());
|
|
|
+ // 一旦找到匹配的值,就不需要再检查该字典项的其他值了
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!dictNameList.isEmpty()){
|
|
|
+ result = String.join(",",dictNameList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|