From 607d1e76e515fd3a2c6ddbf0f86b35992a2adf2b Mon Sep 17 00:00:00 2001 From: gongbaoxiong <751575283@qq.com> Date: Mon, 19 Jan 2026 16:32:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/jkgl/server/MesServiceManager.java | 70 ++++++++++--------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/src/com/wxzd/wms/jkgl/server/MesServiceManager.java b/src/com/wxzd/wms/jkgl/server/MesServiceManager.java index 89b331d..7be1b0f 100644 --- a/src/com/wxzd/wms/jkgl/server/MesServiceManager.java +++ b/src/com/wxzd/wms/jkgl/server/MesServiceManager.java @@ -96,11 +96,11 @@ public class MesServiceManager extends AbstractServiceManager { if (serviceName.equals("/insertRkd")) { String sqlInsertRkd = DB.prepareInsertStmt("cprkd", "ysdh,ysrq,lx,yhm,djbh,ckbh,sflz,scsj,txm"); String sqlInsertRkdMx = DB.prepareInsertStmt("cprkdmx", - "mxbh,ysdh,cpbh,cpmc,lpxx,ddbh,zlzt,txm,ly,rksl,yapsl,cpgg1,cpgg2,cpgg3,jldw,scrq,bz,scdw"); + "mxbh,ysdh,cpbh,cpmc,lpxx,ddbh,zlzt,txm,ly,rksl,yapsl,cpgg1,cpgg2,cpgg3,jldw,scrq,bz,scdw,bhgcl"); String sqlInsertRkZl = DB.prepareInsertStmt("cprkzl", - "jlh,mxbh,ckmc,sl,zt,scsj,tpbh,pzbh,czr,lpxx,piz,maoz,gydw,zlzt,txm,cpbh,scrq,zlbh,tpcrk,modulecode,assetcode,producetime"); + "jlh,mxbh,ckmc,sl,zt,scsj,tpbh,pzbh,czr,lpxx,piz,maoz,gydw,zlzt,txm,cpbh,scrq,zlbh,tpcrk,modulecode,assetcode,producetime,bhgcl"); String materialsqlInsertRkZl = DB.prepareInsertStmt("cprkzl", - "jlh,mxbh,ckmc,sl,zt,scsj,BoxNo,pzbh,czr,lpxx,piz,maoz,gydw,zlzt,txm,cpbh,scrq,zlbh,tpcrk,modulecode,assetcode,producetime"); + "jlh,mxbh,ckmc,sl,zt,scsj,BoxNo,pzbh,czr,lpxx,piz,maoz,gydw,zlzt,txm,cpbh,scrq,zlbh,tpcrk,modulecode,assetcode,producetime,bhgcl"); List sqls = new ArrayList(); List values = new ArrayList(); JSONObject responseMes = new JSONObject(); @@ -112,8 +112,8 @@ public class MesServiceManager extends AbstractServiceManager { String yhm = jo.getString("UserName"); String djlx = jo.getString("MesType"); String txm = jo.getString("ConsignNum"); - - + + if (!"1001".equals(djlx) && !"1002".equals(djlx) && !"1003".equals(djlx) && !"1005".equals(djlx)) { pw.write(getOut("insertRkd", 1, "无效的单据类型", djbh, args)); return; @@ -138,7 +138,7 @@ public class MesServiceManager extends AbstractServiceManager { for (int i = 0; i < items.size(); i++) { JSONObject ja = (JSONObject) items.get(i); String cpbh = ja.getString("Code"); - + //ConsignNum 销售单号 if(ServerUtil.isNull(txm) && cpbh.startsWith("2")){ txm = ja.getString("ModuleCode"); @@ -147,7 +147,7 @@ public class MesServiceManager extends AbstractServiceManager { sqls.add(sqlInsertRkd); values.add(new Object[] { ysdh, getTime(), djlx, yhm, djbh, "LTCK", 1, getDate(), txm }); } - + Map map = db.getSingleRow("select cpmc,cpgg1,jldw from cpxx where cpbh=?", new Object[] { cpbh }); String cpmc = (String) map.get("cpmc"); String jldw = (String) map.get("jldw"); @@ -176,15 +176,16 @@ public class MesServiceManager extends AbstractServiceManager { String ProductionTime = ja.getString("ProductionTime"); String gydw = ja.getString("PackType"); String zlzt = ja.getString("CodeState"); + String bhgcl = ja.getString("Bhgcl"); if ("1".equals(db.getSingleField("select dqz from sys_config where id_pzx='if.MESZLZT' ", null))) { zlzt = "0"; } - + Integer qty = ja.getInteger("Qty"); Object mxbh = SerialNumber.getSerialNumber("cprkmxbh"); sqls.add(sqlInsertRkdMx); values.add(new Object[] { mxbh, ysdh, cpbh, cpmc, lpxx, newlpxx, zlzt, txm, 0, qty, 0, null, null, - null, jldw, getDate(), null, null }); + null, jldw, getDate(), null, null,bhgcl}); Integer jlh = ServerUtil.nextInstNo(db, 1); @@ -192,13 +193,13 @@ public class MesServiceManager extends AbstractServiceManager { sqls.add(materialsqlInsertRkZl); values.add(new Object[] { jlh, mxbh, "LTCK", qty, 0, getTime(), tpbh, ysdh, "合盘入库", lpxx, newlpxx, boxno, gydw, zlzt, null, cpbh, getDate(), zlbh, null, ModuleCode, AssetCode, - ProductionTime }); + ProductionTime,bhgcl}); } else { sqls.add(sqlInsertRkZl); values.add(new Object[] { jlh, mxbh, "LTCK", qty, 0, getTime(), tpbh, ysdh, yhm, lpxx, newlpxx, boxno, gydw, zlzt, txm, cpbh, getDate(), zlbh, address, ModuleCode, AssetCode, - ProductionTime }); + ProductionTime,bhgcl}); } } @@ -221,7 +222,7 @@ public class MesServiceManager extends AbstractServiceManager { String sqlInsertCkd = DB.prepareInsertStmt("ckd", "ckdh,shrq,zt,cklx,yhm,djbh,ckbh,sflz,shsj,限定出库口"); String sqlInsertCkdMx = DB.prepareInsertStmt("ckdmx", - "mxbh,ckdh,cpbh,lpxx,gydw,zlzt,txm,shsl,yapsl,cpmc,cpgg1,cpgg2,cpgg3,jldw,scdw,modulecode,assetcode,producetime"); + "mxbh,ckdh,cpbh,lpxx,gydw,zlzt,txm,shsl,yapsl,cpmc,cpgg1,cpgg2,cpgg3,jldw,scdw,modulecode,assetcode,producetime,bhgcl"); ArrayList oprObjArrayszs = new ArrayList(); List sqls = new ArrayList(); List values = new ArrayList(); @@ -283,6 +284,7 @@ public class MesServiceManager extends AbstractServiceManager { String gydw = ja.getString("PackType"); String zlzt = ja.getString("CodeState"); + String bhgcl= ja.getString("Bhgcl"); String qty = ja.getInteger("Qty").toString(); if (!"0".equals(qty)) { String kczs = (String) db.getSingleField( @@ -325,6 +327,7 @@ public class MesServiceManager extends AbstractServiceManager { lpxx = onecpxx.get("lpxx"); gydw = onecpxx.get("gydw"); zlzt = onecpxx.get("zlzt"); + bhgcl = onecpxx.get("bhgcl"); txm = onecpxx.get("txm"); cpmc = onecpxx.get("cpmc"); jldw = onecpxx.get("jldw"); @@ -332,7 +335,7 @@ public class MesServiceManager extends AbstractServiceManager { sqls.add(sqlInsertCkdMx); Object mxbh = SerialNumber.getSerialNumber("cpckmxbh"); values.add(new Object[] { mxbh, ckdh, cpbh, lpxx, gydw, zlzt, txm, qty, 0, cpmc, null, - null, null, jldw, null, ModuleCode, AssetCode, ProductionTime }); + null, null, jldw, null, ModuleCode, AssetCode, ProductionTime,bhgcl}); // 添加需要分配库位的单据明细 oprObjArrayszs.add(new Object[] { ckdh, mxbh, kcjlh, "zd" }); } @@ -343,7 +346,7 @@ public class MesServiceManager extends AbstractServiceManager { sqls.add(sqlInsertCkdMx); values.add(new Object[] { mxbh, ckdh, cpbh, lpxx, gydw, zlzt, txm, qty, 0, cpmc, null, null, - null, jldw, null, ModuleCode, AssetCode, ProductionTime }); + null, jldw, null, ModuleCode, AssetCode, ProductionTime,bhgcl}); // 添加需要分配库位的单据明细 oprObjArrayszs.add(new Object[] { ckdh, mxbh, null, "zd" }); } @@ -529,8 +532,8 @@ public class MesServiceManager extends AbstractServiceManager { meslw.debug(String.format("updateCksl 反馈MES:%s", returnjo)); } else if (serviceName.equals("/updateQCStatus")) { - String sqlUpdateCpkcxx1 = "update cpkcxx set zlzt=? where cpbh =? and txm is null or txm=? "; - String sqlUpdateCpkcxx2 = "update cpkcxx set zlzt=? where cpbh =? and lpxx =? and txm is null or txm=?"; + String sqlUpdateCpkcxx1 = "update cpkcxx set zlzt=?,bhgcl=? where cpbh =? and txm is null or txm=? "; + String sqlUpdateCpkcxx2 = "update cpkcxx set zlzt=?,bhgcl=? where cpbh =? and lpxx =? and txm is null or txm=?"; String sqlUpdateKwjbxx = "update kwjbxx set zlzt=? where kwbh =? "; List sqls = new ArrayList(); List values = new ArrayList(); @@ -545,6 +548,7 @@ public class MesServiceManager extends AbstractServiceManager { String cpbh = ja.getString("Code"); String lpxx = ja.getString("Lpxx"); String zlzt = ja.getString("CodeState"); + String bhgcl = ja.getString("Bhgcl"); if (!db.hasAnyData("select 2 from cpxx where cpbh=? ", new Object[] { cpbh })) { pw.write(getOut("updateQCStatus", 1, "WMS系统无此产品编号:" + cpbh, djbh, args)); return; @@ -559,18 +563,18 @@ public class MesServiceManager extends AbstractServiceManager { if (list_mx != null && list_mx.size() > 0) { for (int k = 0; k < list_mx.size(); k++) { Map map = list_mx.get(k); - db.preparedUpdate("update cprkdmx set zlzt=? where mxbh=?", - new Object[] { zlzt, map.get("mxbh") }, true); + db.preparedUpdate("update cprkdmx set zlzt=?,bhgcl=? where mxbh=?", + new Object[] { zlzt,bhgcl, map.get("mxbh") }, true); if (db.hasAnyData("select 2 from cprkzl where mxbh=?", map.get("mxbh"))) { - db.preparedUpdate("update cprkzl set zlzt=? where mxbh=?", - new Object[] { zlzt, map.get("mxbh") }, true); + db.preparedUpdate("update cprkzl set zlzt=?,bhgcl=? where mxbh=?", + new Object[] { zlzt,bhgcl,map.get("mxbh") }, true); } } } if (db.hasAnyData("select 2 from cpkcxx where cpbh =? and lpxx =? ", new Object[] { cpbh, lpxx })) { - sqls.add("update cpkcxx set zlzt=? where cpbh =? and lpxx=? "); - values.add(new Object[] { zlzt, cpbh, lpxx }); + sqls.add("update cpkcxx set zlzt=?,bhgcl=? where cpbh =? and lpxx=? "); + values.add(new Object[] { zlzt,bhgcl,cpbh, lpxx }); List list = db.getMappedRowsData("select kwbh from cpkcxx where cpbh=? and lpxx=? ", new Object[] { cpbh, lpxx }); for (int j = 0; i < list.size(); i++) { @@ -589,18 +593,18 @@ public class MesServiceManager extends AbstractServiceManager { if (list_mx != null && list_mx.size() > 0) { for (int k = 0; k < list_mx.size(); k++) { Map map = list_mx.get(k); - db.preparedUpdate("update cprkdmx set zlzt=? where mxbh=?", - new Object[] { zlzt, map.get("mxbh") }, true); + db.preparedUpdate("update cprkdmx set zlzt=?,bhgcl=? where mxbh=?", + new Object[] { zlzt,bhgcl,map.get("mxbh") }, true); if (db.hasAnyData("select 2 from cprkzl where mxbh=?", map.get("mxbh"))) { - db.preparedUpdate("update cprkzl set zlzt=? where mxbh=?", - new Object[] { zlzt, map.get("mxbh") }, true); + db.preparedUpdate("update cprkzl set zlzt=?,bhgcl=? where mxbh=?", + new Object[] { zlzt,bhgcl,map.get("mxbh") }, true); } } } if (db.hasAnyData("select 2 from cpkcxx where cpbh =? and lpxx =? and txm =? ", new Object[] { cpbh, lpxx, txm })) { - sqls.add("update cpkcxx set zlzt=? where cpbh =? and lpxx =? and txm=?"); - values.add(new Object[] { zlzt, cpbh, lpxx, txm }); + sqls.add("update cpkcxx set zlzt=?,bhgcl=? where cpbh =? and lpxx =? and txm=?"); + values.add(new Object[] { zlzt,bhgcl,cpbh, lpxx, txm }); List list = db.getMappedRowsData("select kwbh from cpkcxx where cpbh=? and lpxx=? ", new Object[] { cpbh, lpxx }); for (int j = 0; i < list.size(); i++) { @@ -651,7 +655,7 @@ public class MesServiceManager extends AbstractServiceManager { } else { String kwbh = (String) db.getSingleField("select top 1 kwbh from cpkcxx where kwbh in" - + " ('L21-09-1','L21-10-1','L21-11-1','L21-20-1','L21-21-1','L21-21-1') " + "and cpbh = ?", + + " ('L21-09-1','L21-10-1','L21-11-1','L21-20-1','L21-21-1','L21-21-1') " + "and cpbh = ?", new Object[] { cpbh }); if (kwbh.length() > 0) { @@ -662,7 +666,7 @@ public class MesServiceManager extends AbstractServiceManager { if (arg == 1) { if (db.hasAnyData("select 2 from wxzd_sbztxx where sbzt = 2 and sbid= '2235' ", null) && db.hasAnyData("select 2 from wxzd_sbztxx where sbzt = 2 and sbid= 'JXS1' ", - null)) { + null)) { EndPoint = "2235"; } else { arg = arg + 1; @@ -670,7 +674,7 @@ public class MesServiceManager extends AbstractServiceManager { } else if (arg == 2) { if (db.hasAnyData("select 2 from wxzd_sbztxx where sbzt = 2 and sbid= '2236' ", null) && db.hasAnyData("select 2 from wxzd_sbztxx where sbzt = 2 and sbid= 'JXS1' ", - null)) { + null)) { EndPoint = "2236"; } else { arg = arg + 1; @@ -678,7 +682,7 @@ public class MesServiceManager extends AbstractServiceManager { } else if (arg == 3) { if (db.hasAnyData("select 2 from wxzd_sbztxx where sbzt = 2 and sbid= '2270' ", null) && db.hasAnyData("select 2 from wxzd_sbztxx where sbzt = 2 and sbid= 'JXS2' ", - null)) { + null)) { EndPoint = "2270"; } else { arg = arg + 1; @@ -686,7 +690,7 @@ public class MesServiceManager extends AbstractServiceManager { } else if (arg == 4) { if (db.hasAnyData("select 2 from wxzd_sbztxx where sbzt = 2 and sbid= '2271' ", null) && db.hasAnyData("select 2 from wxzd_sbztxx where sbzt = 2 and sbid= 'JXS2' ", - null)) { + null)) { EndPoint = "2270"; } else { arg = arg + 1;