This commit is contained in:
2026-01-19 16:32:29 +08:00
parent 20924e08dd
commit 607d1e76e5

View File

@@ -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();
@@ -176,6 +176,7 @@ 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";
}
@@ -184,7 +185,7 @@ public class MesServiceManager extends AbstractServiceManager {
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, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 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,<2C>޶<EFBFBD><DEB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
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});
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>ϸ
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});
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>ϸ
oprObjArrayszs.add(new Object[] { ckdh, mxbh, null, "zd" });
}
@@ -529,8 +532,8 @@ public class MesServiceManager extends AbstractServiceManager {
meslw.debug(String.format("updateCksl <20><><EFBFBD><EFBFBD>MES<45><53>%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ϵͳ<EFBFBD>޴˲<EFBFBD>Ʒ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:" + 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<Map> 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<Map> list = db.getMappedRowsData("select kwbh from cpkcxx where cpbh=? and lpxx=? ",
new Object[] { cpbh, lpxx });
for (int j = 0; i < list.size(); i++) {