From 267b59ee2b72eb69691462166d6a56eb47494d7d Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Sat, 5 Nov 2022 18:54:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/PdmWorkTaskServiceImpl.java | 19 ++++- .../service/impl/AutoformulaServiceImpl.java | 71 +++++++++++-------- .../impl/DeviceBigScreenServiceImpl.java | 12 +++- .../nl/wms/st/vehicle/task/ProductTask.java | 10 ++- .../src/views/wms/pf/formula/ViewDialog.vue | 4 +- 5 files changed, 77 insertions(+), 39 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/pda/pdm/service/impl/PdmWorkTaskServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/pda/pdm/service/impl/PdmWorkTaskServiceImpl.java index dc65deac..bcd05bb0 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/pda/pdm/service/impl/PdmWorkTaskServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/pda/pdm/service/impl/PdmWorkTaskServiceImpl.java @@ -606,6 +606,7 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService { if (ObjectUtil.isEmpty(jsonObject)) { throw new PdaRequestException("传入参数不能为空!"); } + JSONObject jo = JSONObject.parseObject(JSON.toJSONString(jsonObject)); String device_code = jo.getString("device_code"); @@ -628,7 +629,11 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService { if (StrUtil.isEmpty(button_name)) { throw new PdaRequestException("缺少必要参数!"); } - + WQLObject md_pb_storagevehicleinfo = WQLObject.getWQLObject("md_pb_storagevehicleinfo"); + JSONObject storagevehicle = md_pb_storagevehicleinfo.query("is_delete='0' and is_used='1' and storagevehicle_code='"+storagevehicle_code+"'").uniqueResult(0); + if(storagevehicle == null){ + throw new PdaRequestException("该载具不存在或者未启用:"+storagevehicle_code); + } //判断该设备是否属于球磨设备 JSONObject device = WQLObject.getWQLObject("em_bi_deviceinfo").query("device_code = '" + device_code + "' AND workprocedure_code = 'GX002'").uniqueResult(0); if (ObjectUtil.isEmpty(device)) { @@ -834,7 +839,11 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService { if (StrUtil.isEmpty(storagevehicle_code)) { throw new PdaRequestException("料浆大桶不能为空!"); } - + WQLObject md_pb_storagevehicleinfo = WQLObject.getWQLObject("md_pb_storagevehicleinfo"); + JSONObject storagevehicle = md_pb_storagevehicleinfo.query("is_delete='0' and is_used='1' and storagevehicle_code='"+storagevehicle_code+"'").uniqueResult(0); + if(storagevehicle == null){ + throw new PdaRequestException("该载具不存在或者未启用:"+storagevehicle_code); + } JSONObject work_task = WQLObject.getWQLObject("PDM_BI_WorkTask").query("worktask_id = '" + worktask_id + "'").uniqueResult(0); //判断该设备是否属于球磨设备 @@ -959,7 +968,11 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService { if (StrUtil.isEmpty(button_name)) { throw new PdaRequestException("缺少必要参数!"); } - + WQLObject md_pb_storagevehicleinfo = WQLObject.getWQLObject("md_pb_storagevehicleinfo"); + JSONObject storagevehicle = md_pb_storagevehicleinfo.query("is_delete='0' and is_used='1' and storagevehicle_code='"+storagevehicle_code+"'").uniqueResult(0); + if(storagevehicle == null){ + throw new PdaRequestException("该载具不存在或者未启用:"+storagevehicle_code); + } //判断该设备是否属于喷雾设备 JSONObject device = WQLObject.getWQLObject("em_bi_deviceinfo").query("device_code = '" + device_code + "' AND workprocedure_code = 'GX003'").uniqueResult(0); if (ObjectUtil.isEmpty(device)) { diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/AutoformulaServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/AutoformulaServiceImpl.java index 0ed7cda5..e4a04832 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/AutoformulaServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pf/service/impl/AutoformulaServiceImpl.java @@ -143,17 +143,31 @@ public class AutoformulaServiceImpl implements AutoformulaService { .process().getResultJSONArray(0); for(int j=0;j= sum_ivt_qty){ jo.put("can_qty",sum_ivt_qty); }else{ jo.put("can_qty",can_qty); } + //纯粉系数 + jo.put("net_rate",net_rate); ivts.add(jo); } } @@ -164,6 +178,7 @@ public class AutoformulaServiceImpl implements AutoformulaService { for(int i=0;i=waste_limit_down_weight){//软废库存足够 JSONObject ret = this.autoCalculationBy01_ruanfei(json); @@ -1660,17 +1665,33 @@ public class AutoformulaServiceImpl implements AutoformulaService { double add_rate = MaterialSet.getDouble("add_rate"); for(int j=0;j= sum_ivt_qty){ jo.put("can_qty",sum_ivt_qty); }else{ jo.put("can_qty",can_qty); } + //纯粉系数 + jo.put("net_rate",net_rate); + //含碳比 + jo.put("is_tan",ProductMaterialExt.getString("c_balance")); ivts.add(jo); } } @@ -1683,22 +1704,11 @@ public class AutoformulaServiceImpl implements AutoformulaService { if(ivt.getDouble("can_qty")<=0 || ivt.getDouble("can_qty")<0.01){ continue; } - String ivt_material_id = ivt.getString("material_id"); - JSONObject ProductMaterialExt = MD_ME_ProductMaterialExt.query("material_id='"+ivt_material_id+"'").uniqueResult(0); - if(ProductMaterialExt ==null){ - throw new BadRequestException("软废"+ivt.getString("material_code")+" "+ivt.getString("material_name")+"未配置成品物料扩展信息!"); - } - double net_rate = ProductMaterialExt.getDouble("net_rate"); - if(net_rate==0){ - throw new BadRequestException("软废"+ivt.getString("material_code")+" "+ivt.getString("material_name")+"未配置纯粉系数!"); - } - double ivt_qty = ivt.getDouble("can_qty")*net_rate/100.0; + double net_rate = ivt.getDouble("net_rate"); + double ivt_qty = ivt.getDouble("can_qty")*(net_rate/100.0); + ivt_qty = NumberUtil.round(ivt_qty,3).doubleValue(); //Rp*纯粉系数 ivt.put("net_rate_qty",ivt_qty); - //纯粉系数 - ivt.put("net_rate",net_rate); - //含碳比 - ivt.put("is_tan",ProductMaterialExt.getString("c_balance")); ivts_new.add(ivt); rf_ivts = rf_ivts + ivt_qty; } @@ -1710,9 +1720,8 @@ public class AutoformulaServiceImpl implements AutoformulaService { double rf_net_total_weight = 0; for(int i=0;i map = new HashMap<>(); map.put("lock_type", "09"); diff --git a/mes/qd/src/views/wms/pf/formula/ViewDialog.vue b/mes/qd/src/views/wms/pf/formula/ViewDialog.vue index 5e8c0fa1..fdbf0b31 100644 --- a/mes/qd/src/views/wms/pf/formula/ViewDialog.vue +++ b/mes/qd/src/views/wms/pf/formula/ViewDialog.vue @@ -199,7 +199,7 @@ > - + @@ -264,7 +264,7 @@ > - +