From 19827808ab33a7ab2257c3925c4162491adcd941 Mon Sep 17 00:00:00 2001 From: liuxy Date: Wed, 31 Aug 2022 16:57:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MaterialParametersServiceImpl.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/MaterialParametersServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/MaterialParametersServiceImpl.java index ba13a276..2adf3a68 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/MaterialParametersServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/MaterialParametersServiceImpl.java @@ -165,6 +165,7 @@ public class MaterialParametersServiceImpl implements MaterialParametersService String material_type_id = MapUtil.getStr(map, "material_type_id"); boolean is_bcp = materialbaseService.isAlongMaterType(MaterOptTypeEnum.BCP.getCode(), null, material_type_id); boolean is_yfl = materialbaseService.isAlongMaterType(MaterOptTypeEnum.YL_AND_FL.getCode(), null, material_type_id); + boolean is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), null, material_type_id); if (is_bcp) { //半成品 @@ -200,12 +201,14 @@ public class MaterialParametersServiceImpl implements MaterialParametersService jsonProduc.put("liquid_rate", map.get("liquid_rate")); jsonProduc.put("standard_mark", map.get("standard_mark")); // 更新产品工序工艺参数表 中球磨时间 - JSONObject jsonWork = wrokTab.query("material_id = '" + material_id + "' and para_code = 'QM008'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(jsonWork)) { - jsonWork.put("value", map.get("qm_time")); - wrokTab.update(jsonWork); - } else { - throw new BadRequestException("请先前往产品工艺参数设置页面设置球磨时间"); + if (!is_rf) { + JSONObject jsonWork = wrokTab.query("material_id = '" + material_id + "' and para_code = 'QM008'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(jsonWork)) { + jsonWork.put("value", map.get("qm_time")); + wrokTab.update(jsonWork); + } else { + throw new BadRequestException("请先前往产品工艺参数设置页面设置球磨时间"); + } } producTab.insert(jsonProduc); } else { @@ -231,12 +234,14 @@ public class MaterialParametersServiceImpl implements MaterialParametersService json.put("liquid_rate", map.get("liquid_rate")); json.put("standard_mark", map.get("standard_mark")); // 更新产品工序工艺参数表 中球磨时间 - JSONObject jsonWork = wrokTab.query("material_id = '" + material_id + "' and para_code = 'QM008'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(jsonWork)) { - jsonWork.put("value", map.get("qm_time")); - wrokTab.update(jsonWork); - } else { - throw new BadRequestException("请先前往产品工艺参数设置页面设置球磨时间"); + if (!is_rf) { + JSONObject jsonWork = wrokTab.query("material_id = '" + material_id + "' and para_code = 'QM008'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(jsonWork)) { + jsonWork.put("value", map.get("qm_time")); + wrokTab.update(jsonWork); + } else { + throw new BadRequestException("请先前往产品工艺参数设置页面设置球磨时间"); + } } producTab.update(json); }