优化
This commit is contained in:
@@ -348,6 +348,7 @@ public class FormulaServiceImpl implements FormulaService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JSONObject getform(Map json) {
|
public JSONObject getform(Map json) {
|
||||||
|
WQLObject MD_ME_ProductMaterialExt = WQLObject.getWQLObject("MD_ME_ProducMaterialExt");
|
||||||
String formula_id = (String) json.get("formula_id");
|
String formula_id = (String) json.get("formula_id");
|
||||||
JSONObject Formula = WQL.getWO("QPF_FORMULA01").addParam("flag","2")
|
JSONObject Formula = WQL.getWO("QPF_FORMULA01").addParam("flag","2")
|
||||||
.addParam("formula_id",formula_id)
|
.addParam("formula_id",formula_id)
|
||||||
@@ -356,6 +357,14 @@ public class FormulaServiceImpl implements FormulaService {
|
|||||||
if(Formula == null ){
|
if(Formula == null ){
|
||||||
throw new BadRequestException("当前配方信息查询失败!");
|
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")
|
JSONArray dtl = WQL.getWO("QPF_INITFORMULA01")
|
||||||
.addParam("workorder_id",Formula.getString("workorder_id"))
|
.addParam("workorder_id",Formula.getString("workorder_id"))
|
||||||
.addParam("material_id",Formula.getString("material_id"))
|
.addParam("material_id",Formula.getString("material_id"))
|
||||||
@@ -477,6 +486,7 @@ public class FormulaServiceImpl implements FormulaService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JSONObject getView(Map json) {
|
public JSONObject getView(Map json) {
|
||||||
|
WQLObject MD_ME_ProductMaterialExt = WQLObject.getWQLObject("MD_ME_ProducMaterialExt");
|
||||||
String formula_id = (String) json.get("formula_id");
|
String formula_id = (String) json.get("formula_id");
|
||||||
JSONObject Formula = WQL.getWO("QPF_FORMULA01").addParam("flag","2")
|
JSONObject Formula = WQL.getWO("QPF_FORMULA01").addParam("flag","2")
|
||||||
.addParam("formula_id",formula_id)
|
.addParam("formula_id",formula_id)
|
||||||
@@ -485,6 +495,14 @@ public class FormulaServiceImpl implements FormulaService {
|
|||||||
if(Formula == null ){
|
if(Formula == null ){
|
||||||
throw new BadRequestException("当前配方信息查询失败!");
|
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")
|
JSONArray dtl = WQL.getWO("QPF_INITFORMULA01")
|
||||||
.addParam("workorder_id",Formula.getString("workorder_id"))
|
.addParam("workorder_id",Formula.getString("workorder_id"))
|
||||||
.addParam("material_id",Formula.getString("material_id"))
|
.addParam("material_id",Formula.getString("material_id"))
|
||||||
|
|||||||
Reference in New Issue
Block a user