Browse Source

【冲红发票获取-异常发票不再二次获取】

wuyx 2 years ago
parent
commit
e049527502

+ 4 - 1
src/main/java/com/uas/eis/service/Impl/ERPServiceImpl.java

@@ -565,7 +565,10 @@ public class ERPServiceImpl implements ERPService {
                 elM.put("taxnum",m.get("taxnum"));
                 elM.put("io_id",ioid);
                 elM.put("io_code",m.get("io_code"));
-                getElecInvoices(elM);
+                Map<String,Object> r = getElecInvoices(elM);
+                if(StringUtil.hasText(r.get("errMsg"))){
+                    baseDao.execute("update elecinvoice set EI_EXCEPTIONMESSAGE='"+r.get("errCode")+": "+r.get("errMsg")+"' where EI_INVOICETYPE = '1' and ei_redapplyid is not null and EI_RELATIVEREFNO is null and ei_ioid = "+ioid);
+                }
             }
         }
         if(errmsg.length()>0){

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

@@ -219,8 +219,8 @@ public class ElecInvoiceTask {
                         "select io_id,io_Code " +
                         "from Invoiceorder where exists (Select 1 from ElecInvoice " +
                         //有红字确认单 但是没有获取到发票号的
-                        "   where ei_ioid = io_id and nvl(EI_INVOICETYPE,'1') = '1' and ei_redapplyid is not null and EI_RELATIVEREFNO is null and nvl(EI_BILLSTATUS,' ') in (' ','01','02','03') " +
-//                        " and io_code = 'SZ23070006' " +
+                        "   where ei_ioid = io_id and EI_EXCEPTIONMESSAGE is null and nvl(EI_INVOICETYPE,'1') = '1' and ei_redapplyid is not null and EI_RELATIVEREFNO is null and nvl(EI_BILLSTATUS,' ') in (' ','01','02','03') " +
+//                        " and io_code = 'SZ23070033' " +
                         ")) where rownum <= 100");
                 logger.info("ElecI-DownLoad: master: {} size: {} ",master,ioList.getResultList().size());
                 while (ioList.next()){