|
|
@@ -86,15 +86,21 @@ public class GetStockBillFromU8 extends ServiceController {
|
|
|
logger.info("入库单{}商品{}不存在", ccode, cinvcode);
|
|
|
continue foreachbill;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+ boolean isred = u8billmxRows.min("iquantity").longValue() < 0;
|
|
|
+
|
|
|
Rows u8billmxCodeRows = u8billmxCodeRowsMap.get(id);
|
|
|
- ArrayList<String> skuArrayList = SQLFactory.createQuerySQL(dbConnect, "sa_itemsku", "sku").setWhere("sku", u8billmxCodeRows.toArrayList("cinvsn")).setWhere("ifnull(stockid,0)=0").query().toArrayList("sku");
|
|
|
+ ArrayList<String> skuArrayList = SQLFactory.createQuerySQL(dbConnect, "sa_itemsku", "sku").setWhere("sku", u8billmxCodeRows.toArrayList("cinvsn")).setWhere(isred ? "ifnull(stockid,0)>0" : "ifnull(stockid,0)=0").query().toArrayList("sku");
|
|
|
for (Row codeRow : u8billmxCodeRows) {
|
|
|
String cinvsn = codeRow.getString("cinvsn");
|
|
|
if (!skuArrayList.contains(cinvsn)) {
|
|
|
- YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='序列号不存在,或所在仓库不为空' where ID =" + id + " and billtype='10' ");
|
|
|
- logger.info("入库单{}序列号{}不存在,或所在仓库不为空", ccode, cinvsn);
|
|
|
+ if (isred) {
|
|
|
+ YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='序列号不存在,或所在仓库为空' where ID =" + id + " and billtype='10' ");
|
|
|
+ logger.info("入库单{}序列号{}不存在,或所在仓库为空", ccode, cinvsn);
|
|
|
+ } else {
|
|
|
+ YUNl_DB.runSqlUpdate("update RdRecord set ErrTimes=isnull(ErrTimes,0)+1,failreason='序列号不存在,或所在仓库不为空' where ID =" + id + " and billtype='10' ");
|
|
|
+ logger.info("入库单{}序列号{}不存在,或所在仓库不为空", ccode, cinvsn);
|
|
|
+ }
|
|
|
continue foreachbill;
|
|
|
}
|
|
|
}
|