|
|
@@ -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());
|
|
|
}
|
|
|
}
|