From fa17793d69d59eda9384dc42579e58ce8c009da6 Mon Sep 17 00:00:00 2001 From: ldj_willow Date: Thu, 7 Jul 2022 18:12:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mes/hd/README.md | 2 +- .../src/main/resources/config/application-dev.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mes/hd/README.md b/mes/hd/README.md index e1d47d5b..1345712e 100644 --- a/mes/hd/README.md +++ b/mes/hd/README.md @@ -1,2 +1,2 @@ # whxr_mes1 - +123 diff --git a/mes/hd/nladmin-system/src/main/resources/config/application-dev.yml b/mes/hd/nladmin-system/src/main/resources/config/application-dev.yml index f791bdcb..c0c80be0 100644 --- a/mes/hd/nladmin-system/src/main/resources/config/application-dev.yml +++ b/mes/hd/nladmin-system/src/main/resources/config/application-dev.yml @@ -19,12 +19,12 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:whxr_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - #url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:whxr_mes_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true +# url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:whxr_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:whxr}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} - # password: ${DB_PWD:Root.123456} + password: ${DB_PWD:P@ssw0rd} # username: ${DB_USER:root} - password: ${DB_PWD:root} +# password: ${DB_PWD:root} # 初始连接数 initial-size: 5 # 最小连接数 From 12484acb0dc0976e41b683d60927f5faf31dfdd8 Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Fri, 8 Jul 2022 10:57:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/wms/pdm/service/impl/WorkOrderServiceImpl.java | 1 + .../org/nl/wms/pf/service/impl/AutoformulaServiceImpl.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkOrderServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkOrderServiceImpl.java index 9a83ad3c..e3333c96 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkOrderServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkOrderServiceImpl.java @@ -736,6 +736,7 @@ public class WorkOrderServiceImpl implements WorkOrdereService { return ret; } + @Transactional(rollbackFor = Exception.class) void updatePcsn(JSONObject from){ String pcsn = from.getString("pcsn"); String material_id = from.getString("material_id"); 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 77a16b97..5691ec38 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 @@ -689,6 +689,8 @@ public class AutoformulaServiceImpl implements AutoformulaService { //设X21p减=0,解方程 if(flag){ // X22p减 =产品碳平衡*(X11p+X12p+X21p+X22p)-总碳/(1- X22碳含量) + //C=X22p减 + //X22p减=产品碳平衡*(X11p+X12p+X21p+X22p)+ X22p减*X22碳含量-CT1 double C = ((c_balance/100.0)*CT1_weight-CT1)/(1-X22/100.0); if(C<0){ flag = false; @@ -773,6 +775,9 @@ public class AutoformulaServiceImpl implements AutoformulaService { if(!flag){ //设X22p减=X22p,解方程 //X21p减*=产品碳平衡*(X11p+X12p+X21p+X22p)-(X11p* X11碳含量+X12p* X12碳含量+(X21p)* X21碳含量)-X22p/(1- X21碳含量) + + // + //X21p减=[产品碳平衡*(X11p+X12p+X21p+X22p)-( X11p* X11碳含量+X12p* X12碳含量+X21p* X21碳含量+X22p)]/ (1-X21碳含量) double X21_jian = ((c_balance/100.0)*CT1_weight - (CT1-X22c) - X22p)/(1-X21/100.0); if(X21_jian<0){ throw new BadRequestException("碳化钨减掉结果为负数,当前配粉无解!"); From b9ce4e74fab7a87ef18306f112b72191b4687b38 Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Fri, 8 Jul 2022 14:40:41 +0800 Subject: [PATCH 3/3] =?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/AutoformulaServiceImpl.java | 19 +++++++++++++++---- .../views/wms/pdm/produce/worktask/index.vue | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) 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 5691ec38..30f5cb81 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 @@ -469,6 +469,7 @@ public class AutoformulaServiceImpl implements AutoformulaService { for(int i=0;i=nedd_qty){ bom_material.put("bom_ivt_qty",nedd_qty); //如果该物料是碳化钨 @@ -1299,6 +1300,7 @@ public class AutoformulaServiceImpl implements AutoformulaService { for(int i=0;i{ String bomdtl_material_id = bomdlt.getString("material_id"); double left_qty = bomdlt.getDouble("left_qty"); + left_qty = NumberUtil.round(left_qty,3).doubleValue(); String is_need_move = bomdlt.getString("is_need_move"); //获取Y1、X1、X2….剩余>0的物料 if(left_qty>0){ @@ -2648,7 +2656,8 @@ public class AutoformulaServiceImpl implements AutoformulaService { continue; } double ivt_qty = now_ivt.getDouble("sum_ivt_qty"); - if(now_ivt.getDouble("sum_ivt_qty") <=0){ + ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue(); + if(ivt_qty <=0){ continue; } if(left_qty