代码更新

This commit is contained in:
2022-08-31 16:57:25 +08:00
parent 66633e0657
commit 19827808ab

View File

@@ -165,6 +165,7 @@ public class MaterialParametersServiceImpl implements MaterialParametersService
String material_type_id = MapUtil.getStr(map, "material_type_id"); String material_type_id = MapUtil.getStr(map, "material_type_id");
boolean is_bcp = materialbaseService.isAlongMaterType(MaterOptTypeEnum.BCP.getCode(), null, 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_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) { if (is_bcp) {
//半成品 //半成品
@@ -200,12 +201,14 @@ public class MaterialParametersServiceImpl implements MaterialParametersService
jsonProduc.put("liquid_rate", map.get("liquid_rate")); jsonProduc.put("liquid_rate", map.get("liquid_rate"));
jsonProduc.put("standard_mark", map.get("standard_mark")); jsonProduc.put("standard_mark", map.get("standard_mark"));
// 更新产品工序工艺参数表 中球磨时间 // 更新产品工序工艺参数表 中球磨时间
JSONObject jsonWork = wrokTab.query("material_id = '" + material_id + "' and para_code = 'QM008'").uniqueResult(0); if (!is_rf) {
if (ObjectUtil.isNotEmpty(jsonWork)) { JSONObject jsonWork = wrokTab.query("material_id = '" + material_id + "' and para_code = 'QM008'").uniqueResult(0);
jsonWork.put("value", map.get("qm_time")); if (ObjectUtil.isNotEmpty(jsonWork)) {
wrokTab.update(jsonWork); jsonWork.put("value", map.get("qm_time"));
} else { wrokTab.update(jsonWork);
throw new BadRequestException("请先前往产品工艺参数设置页面设置球磨时间"); } else {
throw new BadRequestException("请先前往产品工艺参数设置页面设置球磨时间");
}
} }
producTab.insert(jsonProduc); producTab.insert(jsonProduc);
} else { } else {
@@ -231,12 +234,14 @@ public class MaterialParametersServiceImpl implements MaterialParametersService
json.put("liquid_rate", map.get("liquid_rate")); json.put("liquid_rate", map.get("liquid_rate"));
json.put("standard_mark", map.get("standard_mark")); json.put("standard_mark", map.get("standard_mark"));
// 更新产品工序工艺参数表 中球磨时间 // 更新产品工序工艺参数表 中球磨时间
JSONObject jsonWork = wrokTab.query("material_id = '" + material_id + "' and para_code = 'QM008'").uniqueResult(0); if (!is_rf) {
if (ObjectUtil.isNotEmpty(jsonWork)) { JSONObject jsonWork = wrokTab.query("material_id = '" + material_id + "' and para_code = 'QM008'").uniqueResult(0);
jsonWork.put("value", map.get("qm_time")); if (ObjectUtil.isNotEmpty(jsonWork)) {
wrokTab.update(jsonWork); jsonWork.put("value", map.get("qm_time"));
} else { wrokTab.update(jsonWork);
throw new BadRequestException("请先前往产品工艺参数设置页面设置球磨时间"); } else {
throw new BadRequestException("请先前往产品工艺参数设置页面设置球磨时间");
}
} }
producTab.update(json); producTab.update(json);
} }