Browse Source

【英唐电子发票】【启用定时任务,调整定时任务频率】

wuyx 2 years ago
parent
commit
cb93287d8e

+ 1 - 1
src/main/java/com/uas/eis/UasEisApplication.java

@@ -11,7 +11,7 @@ import com.uas.eis.core.support.TokenPropertiesListener;
 
 @SpringBootApplication
 @EnableCaching
-/*@EnableScheduling*/
+@EnableScheduling
 @Import({DynamicDataSourceRegister.class})
 public class UasEisApplication {
 	public static void main(String[] args) {

+ 3 - 3
src/main/java/com/uas/eis/task/ElecInvoiceTask.java

@@ -63,7 +63,7 @@ public class ElecInvoiceTask {
      *          {"status":"0000","message":"调用成功","data":[{"sellerTaxNo":"339901999999199","orderNo":"1134068619401396224","rushRedState":"0","invoiceType":1,"invoiceState":1,"invoiceLine":"b","exceptionMessage":"ukey版签章无下载码","sid":"23072713481601034933"}]}
      * //7:无需开票,此状态可以不用管
      * */
-    @Scheduled(cron = "0 0/30 * * * ?")
+    @Scheduled(cron = "0 0/5 * * * ?")
     public void elecInvoiceDownLoad(){
         List<Object[]> obsList=baseDao.getFieldsDatasByCondition("YITOA_DATACENTER.dock_invoice_config",new String[]{"appKey","appSecret","token","taxnum","username"},"1=1");
         if(!CollectionUtil.isEmpty(obsList)){
@@ -88,8 +88,8 @@ public class ElecInvoiceTask {
                 }
                 logger.info("ElecInvoice-DownLoad: master: {} Begin ",master);
                 SpObserver.putSp(master);
-                SqlRowList ioList = baseDao.queryForRowSet("select io_id,io_code from "+master+".invoiceOrder left join "+master+".customer on io_cucode=cu_code " +
-                        " where io_status = '已审核' and nvl(IO_DOCKSTATUS,' ') = '对接成功' and (IO_INVOICESTATUS = 6 or (IO_INVOICESTATUS = 2 and io_refno is null))");
+                SqlRowList ioList = baseDao.queryForRowSet("select io_id,io_code from(select io_id,io_code from "+master+".invoiceOrder left join "+master+".customer on io_cucode=cu_code " +
+                        " where io_status = '已审核' and nvl(IO_DOCKSTATUS,' ') = '对接成功' and (IO_INVOICESTATUS = 6 or (IO_INVOICESTATUS = 2 and io_refno is null)) order by io_id desc) where rownum <= 100");
                 logger.info("ElecInvoice-DownLoad: master: {} size: {} ",master,ioList.getResultList().size());
                 while (ioList.next()){
                     erpService.getElecInvoices(appKey,appSecret,token,taxnum,ioList.getGeneralInt("io_id"),ioList.getGeneralString("io_code"));

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

@@ -30,7 +30,7 @@ public class InvoiceOrderTask {
      *      //6:部分待处理 表示订单部分转了开票申请,此状态需要定时获取
      * 		//7:无需开票,此状态可以不用管,此状态需要定时获取
      * */
-    @Scheduled(cron = "0 0/10 * * * ?")
+    @Scheduled(cron = "0 0/5 * * * ?")
     public void InvoiceOrderStateUpdate(){
         List<Object[]> obsList=baseDao.getFieldsDatasByCondition("YITOA_DATACENTER.dock_invoice_config",new String[]{"appKey","appSecret","token","taxnum","username"},"1=1");
         if(!CollectionUtil.isEmpty(obsList)){

+ 1 - 1
src/main/resources/application-prod.yml

@@ -4,7 +4,7 @@ spring:
         driverClassName: oracle.jdbc.OracleDriver
         username: YITOA_DATACENTER
         password: select!#%*(
-        url: jdbc:oracle:thin:@10.1.81.208:11756:orcl
+        url: jdbc:oracle:thin:@10.10.10.103:1521:orcl
         initialSize: 1
         maxActive: 3
         maxWait: 30000