Browse Source

【传音对接】【库存数据汇总调整】

wub 1 month ago
parent
commit
530d6974e6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/main/java/com/uas/eis/task/syncProductStockCYTask.java

+ 4 - 2
src/main/java/com/uas/eis/task/syncProductStockCYTask.java

@@ -43,8 +43,10 @@ public class syncProductStockCYTask {
     public void syncProductStock() {
         logger.info("sendProd-Begin:master {} ids {}");
         try {
-            SqlRowList docMsg = baseDao.queryForRowSet(" select pr_id,to_char(sysdate,'yyyy-mm-dd') ba_date,ba_remain,tspr_eightcode,pr_code,tspr_ninecode,tspr_description,ba_code from product left join batch on pr_code=ba_prodcode left join transsionproduct on pr_code=tspr_uasprcode " +
-                    " where tspr_enable=-1 and pr_statuscode='AUDITED' and ba_whcode='BSD056' and ba_remain>0");
+            SqlRowList docMsg = baseDao.queryForRowSet(" select pr_id,to_char(sysdate,'yyyy-mm-dd') ba_date,ba_remain,tspr_eightcode,pr_code,tspr_ninecode,tspr_description,ba_code from product left join " +
+                    " (select ba_prodcode,sum(ba_remain) ba_remain,max(ba_code) ba_code from batch where ba_remain>0 and ba_whcode='BSD056' group by ba_prodcode) " +
+                    " on pr_code=ba_prodcode left join transsionproduct on pr_code=tspr_uasprcode " +
+                    "                     where tspr_enable=-1 and pr_statuscode='AUDITED' and ba_remain>0 ");
             SqlRowList rs2 = baseDao.queryForRowSet("select TO_CHAR(SYSDATE,'HH24') v_hour,TO_CHAR(SYSDATE,'MI') v_mi from dual");
             String V_HOUR = rs2.getGeneralString("v_hour");
             String V_MI = rs2.getGeneralString("v_mi");