This commit is contained in:
zds
2022-11-07 14:56:04 +08:00
parent 5c198c2e6c
commit c815ad9bee

View File

@@ -348,6 +348,7 @@ public class FormulaServiceImpl implements FormulaService {
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject getform(Map json) {
WQLObject MD_ME_ProductMaterialExt = WQLObject.getWQLObject("MD_ME_ProducMaterialExt");
String formula_id = (String) json.get("formula_id");
JSONObject Formula = WQL.getWO("QPF_FORMULA01").addParam("flag","2")
.addParam("formula_id",formula_id)
@@ -356,6 +357,14 @@ public class FormulaServiceImpl implements FormulaService {
if(Formula == null ){
throw new BadRequestException("当前配方信息查询失败!");
}
JSONObject material = MD_ME_ProductMaterialExt.query("material_id ='"+Formula.getString("material_id")+"'").uniqueResult(0);
if(material == null ){
throw new BadRequestException("当前成品查询不到成品物料扩展信息!");
}
if (StrUtil.isEmpty(Formula.getString("c_balance"))) {
Formula.put("c_balance",material.getString("c_balance"));
}
JSONArray dtl = WQL.getWO("QPF_INITFORMULA01")
.addParam("workorder_id",Formula.getString("workorder_id"))
.addParam("material_id",Formula.getString("material_id"))
@@ -477,6 +486,7 @@ public class FormulaServiceImpl implements FormulaService {
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject getView(Map json) {
WQLObject MD_ME_ProductMaterialExt = WQLObject.getWQLObject("MD_ME_ProducMaterialExt");
String formula_id = (String) json.get("formula_id");
JSONObject Formula = WQL.getWO("QPF_FORMULA01").addParam("flag","2")
.addParam("formula_id",formula_id)
@@ -485,6 +495,14 @@ public class FormulaServiceImpl implements FormulaService {
if(Formula == null ){
throw new BadRequestException("当前配方信息查询失败!");
}
JSONObject material = MD_ME_ProductMaterialExt.query("material_id ='"+Formula.getString("material_id")+"'").uniqueResult(0);
if(material == null ){
throw new BadRequestException("当前成品查询不到成品物料扩展信息!");
}
if (StrUtil.isEmpty(Formula.getString("c_balance"))) {
Formula.put("c_balance",material.getString("c_balance"));
}
JSONArray dtl = WQL.getWO("QPF_INITFORMULA01")
.addParam("workorder_id",Formula.getString("workorder_id"))
.addParam("material_id",Formula.getString("material_id"))