shenjingwei 2 месяцев назад
Родитель
Сommit
9e8cdebed1

+ 4 - 3
src/custom/service/GetBasicDataFromU8.java

@@ -82,7 +82,7 @@ public class GetBasicDataFromU8 extends ServiceController {
                     plmItem.setValue("unitid", unitMap.get(cComUnitName).get(0).getLong("unitid"));
                     plmItem.setValue("skucontrol", bSerial);
                     plmItem.setValue("changeby", "U8");
-                    plmItem.setValue("WMSUPLOADFLAG", 2);
+                    plmItem.setValue("wmsuploadflag", 2);
                     plmItem.setWhere("siteid", "MD").setWhere("itemno", cInvCode);
                     plmItem.update();
                 } else {
@@ -90,10 +90,11 @@ public class GetBasicDataFromU8 extends ServiceController {
                     plmItem.setValue("itemno", cInvCode);
                     plmItem.setValue("itemname", cInvName);
                     plmItem.setValue("model", cInvStd);
+                    plmItem.setValue("status", "新建");
                     plmItem.setValue("unitid", unitMap.get(cComUnitName).get(0).getLong("unitid"));
                     plmItem.setValue("skucontrol", bSerial);
                     plmItem.setValue("createby", "U8");
-                    plmItem.setValue("WMSUPLOADFLAG", 2);
+                    plmItem.setValue("wmsuploadflag", 2);
                     plmItem.setValue("siteid", "MD");
                     plmItem.insert();
                 }
@@ -133,7 +134,7 @@ public class GetBasicDataFromU8 extends ServiceController {
                     InsertSQL sku = SQLFactory.createInsertSQL(dbConnect, "sa_itemsku");
                     sku.setValue("itemid", itemMap.get(cInvCode).get(0).getLong("itemid"));
                     sku.setValue("sku", cInvSN);
-                    sku.setValue("status", "");
+                    sku.setValue("status", "新建");
                     sku.setValue("createby", "U8");
                     sku.setValue("siteid", "MD");
                     sku.setValue("WMSUPLOADFLAG", 2);

+ 6 - 6
src/custom/service/GetStockBillFromU8.java

@@ -56,21 +56,21 @@ public class GetStockBillFromU8 extends ServiceController {
 
                     if (drpbillList.contains(ccode)) {
                         //已存在审核状态的单据,则直接判定成功
-                        YUNl_DB.runSqlUpdate("update RdRecord set status=1  where ID ='" + id + "' and billtype='10'");
+                        YUNl_DB.runSqlUpdate("update RdRecord set status=1  where ID =" + id + " and billtype='10'");
                         logger.info("入库单{}已存在,将中间表状态改为1", ccode);
                         continue;
                     }
                     String ddate = getDate_Str(cInvCodeRow.getDate("ddate"));
                     if (dbConnect.runSqlQuery("select * from st_period where isclose=0 and begdate<='" + ddate + "' and enddate>='" + ddate + "'").isEmpty()) {
                         //会计期间不存在,直接判定失败
-                        YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=10,failreason='找不到有效的会计期间' where ID ='" + id + " and billtype='10' ");
+                        YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=10,failreason='找不到有效的会计期间' where ID =" + id + " and billtype='10' ");
                         logger.info("入库单{}单据日期{}所在会计期间不存在", ccode, ddate);
                         continue;
                     }
                     String cwhcode = cInvCodeRow.getString("cwhcode");
                     if (stockRowsMap.get(cwhcode).isEmpty()) {
                         //仓库不存在,失败次数+1
-                        YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='仓库不存在' where ID ='" + id + " and billtype='10' ");
+                        YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='仓库不存在' where ID =" + id + " and billtype='10' ");
                         logger.info("入库单{}仓库{}不存在", ccode, cwhcode);
                         continue;
                     }
@@ -80,7 +80,7 @@ public class GetStockBillFromU8 extends ServiceController {
                         String cinvcode = u8billmxRow.getString("cinvcode");
                         if (itemRowsMap.get(cinvcode).isEmpty()) {
                             //商品编号不存在,失败次数+1
-                            YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='商品不存在' where ID ='" + id + " and billtype='10' ");
+                            YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='商品不存在' where ID =" + id + " and billtype='10' ");
                             logger.info("入库单{}商品{}不存在", ccode, cinvcode);
                             continue foreachbill;
                         }
@@ -174,11 +174,11 @@ public class GetStockBillFromU8 extends ServiceController {
                         dbConnect.runSqlUpdate("delete from st_stockbill where st_stockbillid=" + st_stockbillid);
                         dbConnect.runSqlUpdate("delete from st_stockbill_items where st_stockbillid=" + st_stockbillid);
                         dbConnect.runSqlUpdate("delete from st_stockbill_items_sku where st_stockbillid=" + st_stockbillid);
-                        YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='" + e.getMessage() + "' where ID ='" + id + " and billtype='10' ");
+                        YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='" + e.getMessage() + "' where ID =" + id + " and billtype='10' ");
                         logger.info("产品入库单{}审核失败", ccode);
                     }
                 } catch (Exception e) {
-                    YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='" + e.getMessage() + "' where ID ='" + id + " and billtype='10' ");
+                    YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='" + e.getMessage() + "' where ID =" + id + " and billtype='10' ");
                     logger.info("产品入库单ID{}同步失败", cInvCodeRow.toJsonObject());
                 }
             }