代码更新

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");
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);
}