Browse Source

轮询上传结案送货提醒优化:1、上传结案单据判断发货提醒单B2Bid是否存在,不存在发货提醒未上传到B2B,不用上传;2、更新发货提醒结案上传状态采用B2B更新完成后返回的ERPid去关联更新

hejq 7 years ago
parent
commit
4ac734ce62

+ 5 - 5
src/main/java/com/uas/erp/schedular/b2b/task/PurchaseNotifyTask.java

@@ -116,14 +116,14 @@ public class PurchaseNotifyTask extends AbstractTask {
 
     @TaskMapping(title = "上传结案送货提醒", fixedDelay = 60000)
     public void uploadPurchaseNotifyEnd() {
-        List<PurchaseNotify> notifies = jdbcTemplate.queryForBeanList("select * from (select purchasenotify.pn_id,ve_uu from purchasenotify left join purchase on pn_ordercode=pu_code left join vendor on pu_vendcode=ve_code where PN_SENDSTATUS='待上传' and pn_statuscode='CANCELED' and pu_sendstatus='已上传' and nvl(pu_ordertype,' ')<>'B2C' and ve_uu is not null and nvl(ve_b2benable,0)=1 order by pn_indate) where rownum<=400",
+        List<PurchaseNotify> notifies = jdbcTemplate.queryForBeanList("select * from (select purchasenotify.pn_id,ve_uu from purchasenotify left join purchase on pn_ordercode=pu_code left join vendor on pu_vendcode=ve_code where PN_SENDSTATUS='待上传' and pn_statuscode='CANCELED' and pu_sendstatus='已上传' and nvl(pu_ordertype,' ')<>'B2C' and pn_b2bid is not null and ve_uu is not null and nvl(ve_b2benable,0)=1 order by pn_indate) where rownum<=400",
                 PurchaseNotify.class);
         if (!CollectionUtils.isEmpty(notifies)) {
             ContextHolder.setDataSize(notifies.size());
-            post("/erp/purchase/notice/end", dataWrap(notifies));
-            // 修改状态
-            String idStr = CollectionUtil.getKeyString(notifies);
-            jdbcTemplate.execute("update PurchaseNotify set PN_SENDSTATUS='已上传' where pn_id in(" + idStr + ")");
+            List<String> idList = postForList("/erp/purchase/notice/end", String.class, dataWrap(notifies));
+            if (!CollectionUtils.isEmpty(idList)) {
+                jdbcTemplate.execute("update PurchaseNotify set PN_SENDSTATUS='已上传' where pn_id in(" + idList.get(0) + ")");
+            }
         }
     }