Browse Source

【泛微对接】【新增银行登记接口调整录入人字段】

wub 1 tuần trước cách đây
mục cha
commit
7da0c84701
1 tập tin đã thay đổi với 24 bổ sung1 xóa
  1. 24 1
      src/main/java/com/uas/eis/task/ProductTask.java

+ 24 - 1
src/main/java/com/uas/eis/task/ProductTask.java

@@ -92,7 +92,7 @@ public class ProductTask {
         }
     }
 
-    @Scheduled(cron = "0 0 12 * * ?")
+    @Scheduled(cron = "0 0 23 * * ?")
     public void syncUpdateProducts() {
         SqlRowList rs = baseDao.queryForRowSet("select * from (select distinct pis_prodcode from productInfoSync where trunc(pis_date)=trunc(sysdate) and pis_updatedate is null and PIS_ERROR is null) left join product on pis_prodcode=pr_code where nvl(pr_statuscode,' ')='AUDITED' and nvl(pr_sfjszy_user,' ')<>'是' and upper(nvl(pr_brand,' ')) <> 'EASYDETEK' order by pr_id");
         while (rs.next()){
@@ -113,6 +113,29 @@ public class ProductTask {
             }
         }
     }
+
+    @Scheduled(cron = "0 0 1-6 * * ?")
+    public void syncUpdateProductsAgain() {
+        SqlRowList rs = baseDao.queryForRowSet("select * from (select distinct pis_prodcode from productInfoSync where trunc(pis_date)=trunc(sysdate)-1 and pis_updatedate is null and PIS_ERROR is null) left join product on pis_prodcode=pr_code where nvl(pr_statuscode,' ')='AUDITED' and nvl(pr_sfjszy_user,' ')<>'是' and upper(nvl(pr_brand,' ')) <> 'EASYDETEK' order by pr_id");
+        while (rs.next()){
+            Product product = setProduct(rs);
+            try {
+                BaseResult baseResult = productManager.updateGoods(product);
+                int errorCode = baseResult.getErrorCode();
+                if(errorCode == 0){
+                    baseDao.execute("update productInfoSync set pis_updatestatus='已更新',pis_updatedate=sysdate where pis_prodcode='"+rs.getGeneralString("pis_prodcode")+"' and trunc(pis_date)=trunc(sysdate) and pis_updatedate is null");
+                }else{
+                    baseDao.execute("update productInfoSync set pis_error='"+baseResult.getErrorMessage()+"' where pis_prodcode='"+rs.getGeneralString("pis_prodcode")+"' and trunc(pis_date)=trunc(sysdate) and pis_updatedate is null");
+                    logger.info("异常信息:"+baseResult.getErrorMessage());
+                }
+            }catch (Exception e){
+                baseDao.execute("update productInfoSync set pis_error='"+e.getMessage()+"' where pis_prodcode='"+rs.getGeneralString("pis_prodcode")+"' and trunc(pis_date)=trunc(sysdate) and pis_updatedate is null");
+                logger.info("异常信息:"+e.getMessage());
+                e.printStackTrace();
+            }
+        }
+    }
+
     //是否寄售专用 由否改为是时定时报废CRM对应的物料
     @Scheduled(cron = "0 30 23 * * ?")
     public void syncUpdateProductsOnSFJSZY() {