Merge branch 'master' of http://121.40.234.130:8899/root/wuHanXinRui
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
# whxr_mes1
|
# whxr_mes1
|
||||||
|
123
|
||||||
|
|||||||
@@ -736,6 +736,7 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
void updatePcsn(JSONObject from){
|
void updatePcsn(JSONObject from){
|
||||||
String pcsn = from.getString("pcsn");
|
String pcsn = from.getString("pcsn");
|
||||||
String material_id = from.getString("material_id");
|
String material_id = from.getString("material_id");
|
||||||
|
|||||||
@@ -469,6 +469,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
for(int i=0;i<bomdlts.size();i++){
|
for(int i=0;i<bomdlts.size();i++){
|
||||||
JSONObject bomdlt = bomdlts.getJSONObject(i);
|
JSONObject bomdlt = bomdlts.getJSONObject(i);
|
||||||
double nedd_qty = new_qty*bomdlt.getDouble("standard_rate")/100.0;
|
double nedd_qty = new_qty*bomdlt.getDouble("standard_rate")/100.0;
|
||||||
|
nedd_qty = NumberUtil.round(nedd_qty,3).doubleValue();
|
||||||
bomdlt.put("need_qty",nedd_qty);
|
bomdlt.put("need_qty",nedd_qty);
|
||||||
String material_type_id = bomdlt.getString("material_type_id");
|
String material_type_id = bomdlt.getString("material_type_id");
|
||||||
//如果该物料是碳化钨
|
//如果该物料是碳化钨
|
||||||
@@ -507,7 +508,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
bom_material.put("is_need_move","1");
|
bom_material.put("is_need_move","1");
|
||||||
bom_material.put("is_need_manage","1");
|
bom_material.put("is_need_manage","1");
|
||||||
bom_material.put("need_sum_qty",new_qty*bomdlt.getDouble("standard_rate")/100.0);
|
bom_material.put("need_sum_qty",new_qty*bomdlt.getDouble("standard_rate")/100.0);
|
||||||
double bom_ivt_qty = bom_material.getDouble("sum_ivt_qty");
|
double bom_ivt_qty = NumberUtil.roundDown(bom_material.getDouble("sum_ivt_qty"),3).doubleValue();
|
||||||
if(bom_ivt_qty>=nedd_qty){
|
if(bom_ivt_qty>=nedd_qty){
|
||||||
bom_material.put("bom_ivt_qty",nedd_qty);
|
bom_material.put("bom_ivt_qty",nedd_qty);
|
||||||
//如果该物料是碳化钨
|
//如果该物料是碳化钨
|
||||||
@@ -689,6 +690,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
//设X21p减=0,解方程
|
//设X21p减=0,解方程
|
||||||
if(flag){
|
if(flag){
|
||||||
// X22p减 =产品碳平衡*(X11p+X12p+X21p+X22p)-总碳/(1- X22碳含量)
|
// 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);
|
double C = ((c_balance/100.0)*CT1_weight-CT1)/(1-X22/100.0);
|
||||||
if(C<0){
|
if(C<0){
|
||||||
flag = false;
|
flag = false;
|
||||||
@@ -773,6 +776,9 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
if(!flag){
|
if(!flag){
|
||||||
//设X22p减=X22p,解方程
|
//设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碳含量)
|
||||||
|
|
||||||
|
//
|
||||||
|
//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);
|
double X21_jian = ((c_balance/100.0)*CT1_weight - (CT1-X22c) - X22p)/(1-X21/100.0);
|
||||||
if(X21_jian<0){
|
if(X21_jian<0){
|
||||||
throw new BadRequestException("碳化钨减掉结果为负数,当前配粉无解!");
|
throw new BadRequestException("碳化钨减掉结果为负数,当前配粉无解!");
|
||||||
@@ -1294,6 +1300,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
for(int i=0;i<ivts_new.size();i++){
|
for(int i=0;i<ivts_new.size();i++){
|
||||||
JSONObject ivt_new = ivts_new.getJSONObject(i);
|
JSONObject ivt_new = ivts_new.getJSONObject(i);
|
||||||
double ivt_qty = ivt_new.getDouble("sum_ivt_qty");
|
double ivt_qty = ivt_new.getDouble("sum_ivt_qty");
|
||||||
|
ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue();
|
||||||
double formula_qty = 0;
|
double formula_qty = 0;
|
||||||
double rf_up = rf_left_weight.doubleValue()/(material_net_rate/100.0);
|
double rf_up = rf_left_weight.doubleValue()/(material_net_rate/100.0);
|
||||||
if(ivt_qty<rf_up){
|
if(ivt_qty<rf_up){
|
||||||
@@ -1348,6 +1355,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
for(int i=0;i<bomdlts.size();i++){
|
for(int i=0;i<bomdlts.size();i++){
|
||||||
JSONObject bomdlt = bomdlts.getJSONObject(i);
|
JSONObject bomdlt = bomdlts.getJSONObject(i);
|
||||||
double nedd_qty = new_qty*bomdlt.getDouble("standard_rate")/100.0;
|
double nedd_qty = new_qty*bomdlt.getDouble("standard_rate")/100.0;
|
||||||
|
nedd_qty = NumberUtil.round(nedd_qty,3).doubleValue();
|
||||||
bomdlt.put("need_qty",nedd_qty);
|
bomdlt.put("need_qty",nedd_qty);
|
||||||
String material_type_id = bomdlt.getString("material_type_id");
|
String material_type_id = bomdlt.getString("material_type_id");
|
||||||
//如果该物料是碳化钨
|
//如果该物料是碳化钨
|
||||||
@@ -1379,6 +1387,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
double bom_ivt_qty = bom_material.getDouble("sum_ivt_qty");
|
double bom_ivt_qty = bom_material.getDouble("sum_ivt_qty");
|
||||||
|
bom_ivt_qty = NumberUtil.roundDown(bom_ivt_qty,3).doubleValue();
|
||||||
//设置物料类型为物料
|
//设置物料类型为物料
|
||||||
bom_material.put("stockrecord_id",IdUtil.getSnowflake(1, 1).nextId()+"");
|
bom_material.put("stockrecord_id",IdUtil.getSnowflake(1, 1).nextId()+"");
|
||||||
bom_material.put("material_type","01");
|
bom_material.put("material_type","01");
|
||||||
@@ -2525,7 +2534,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
for(int i=0;i<ivts_new.size();i++){
|
for(int i=0;i<ivts_new.size();i++){
|
||||||
JSONObject ivt_new = ivts_new.getJSONObject(i);
|
JSONObject ivt_new = ivts_new.getJSONObject(i);
|
||||||
double ivt_qty = ivt_new.getDouble("sum_ivt_qty");
|
double ivt_qty = ivt_new.getDouble("sum_ivt_qty");
|
||||||
if(ivt_new.getDouble("sum_ivt_qty") <=0){
|
ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue();
|
||||||
|
if(ivt_qty <=0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//软废纯粉系数
|
//软废纯粉系数
|
||||||
@@ -2563,6 +2573,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
if(bomdlts_need_map.containsKey(fi_bomdtl_material_id)){
|
if(bomdlts_need_map.containsKey(fi_bomdtl_material_id)){
|
||||||
JSONObject bomdlt = bomdlts_need_map.get(fi_bomdtl_material_id);
|
JSONObject bomdlt = bomdlts_need_map.get(fi_bomdtl_material_id);
|
||||||
double left_qty = bomdlt.getDouble("left_qty");
|
double left_qty = bomdlt.getDouble("left_qty");
|
||||||
|
left_qty = NumberUtil.round(left_qty,3).doubleValue();
|
||||||
if(left_qty==0){
|
if(left_qty==0){
|
||||||
continue outer;
|
continue outer;
|
||||||
}
|
}
|
||||||
@@ -2585,6 +2596,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
//更新产品所需物料的所需重量
|
//更新产品所需物料的所需重量
|
||||||
JSONObject bomdlt = bomdlts_need_map.get(fi_bomdtl_material_id);
|
JSONObject bomdlt = bomdlts_need_map.get(fi_bomdtl_material_id);
|
||||||
double left_qty = bomdlt.getDouble("left_qty");
|
double left_qty = bomdlt.getDouble("left_qty");
|
||||||
|
left_qty = NumberUtil.round(left_qty,3).doubleValue();
|
||||||
if(left_qty<now_qty){
|
if(left_qty<now_qty){
|
||||||
left_qty = 0;
|
left_qty = 0;
|
||||||
bomdlt.put("left_qty",left_qty);
|
bomdlt.put("left_qty",left_qty);
|
||||||
@@ -2612,6 +2624,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
bomdlts_need_map.forEach((key,bomdlt)->{
|
bomdlts_need_map.forEach((key,bomdlt)->{
|
||||||
String bomdtl_material_id = bomdlt.getString("material_id");
|
String bomdtl_material_id = bomdlt.getString("material_id");
|
||||||
double left_qty = bomdlt.getDouble("left_qty");
|
double left_qty = bomdlt.getDouble("left_qty");
|
||||||
|
left_qty = NumberUtil.round(left_qty,3).doubleValue();
|
||||||
String is_need_move = bomdlt.getString("is_need_move");
|
String is_need_move = bomdlt.getString("is_need_move");
|
||||||
//获取Y1、X1、X2….剩余>0的物料
|
//获取Y1、X1、X2….剩余>0的物料
|
||||||
if(left_qty>0){
|
if(left_qty>0){
|
||||||
@@ -2643,7 +2656,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
double ivt_qty = now_ivt.getDouble("sum_ivt_qty");
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
if(left_qty<ivt_qty){
|
if(left_qty<ivt_qty){
|
||||||
@@ -3522,6 +3536,7 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
}else if(bomdlts_plan.getString("is_flag").equals("-1")){
|
}else if(bomdlts_plan.getString("is_flag").equals("-1")){
|
||||||
String bomdtl_material_id = bomdlts_plan.getString("material_id");
|
String bomdtl_material_id = bomdlts_plan.getString("material_id");
|
||||||
double left_qty = bomdlts_plan.getDouble("formula_qty");
|
double left_qty = bomdlts_plan.getDouble("formula_qty");
|
||||||
|
left_qty = NumberUtil.round(left_qty,3).doubleValue();
|
||||||
String is_need_move = bomdlts_plan.getString("is_need_move");
|
String is_need_move = bomdlts_plan.getString("is_need_move");
|
||||||
String prior_level = bomdlts_plan.getString("prior_level");
|
String prior_level = bomdlts_plan.getString("prior_level");
|
||||||
if (StrUtil.isEmpty(prior_level)) {
|
if (StrUtil.isEmpty(prior_level)) {
|
||||||
@@ -3550,7 +3565,8 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
double ivt_qty = now_ivt.getDouble("sum_ivt_qty");
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
if(left_qty<ivt_qty){
|
if(left_qty<ivt_qty){
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
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: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:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:whxr}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
# password: ${DB_PWD:Root.123456}
|
password: ${DB_PWD:P@ssw0rd}
|
||||||
# username: ${DB_USER:root}
|
# username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:root}
|
# password: ${DB_PWD:root}
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
# 最小连接数
|
# 最小连接数
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ export default {
|
|||||||
if (rows[i].order_status < '40' || rows.length !== 1) {
|
if (rows[i].order_status < '40' || rows.length !== 1) {
|
||||||
this.print1_flag = true
|
this.print1_flag = true
|
||||||
}
|
}
|
||||||
if (rows[i].status < '30' || rows.length !== 1 || "GX003,GX004,GX009,GX010,GX011".indexOf(rows[i].workprocedure_code)===-1) {
|
if (rows.length !== 1 || "GX003,GX004,GX009,GX010,GX011".indexOf(rows[i].workprocedure_code)===-1) {
|
||||||
this.print2_flag = true
|
this.print2_flag = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user