Sfoglia il codice sorgente

业务处理单问题处理/发票助手改造

徐昊 10 mesi fa
parent
commit
4d5fbdbb56

+ 20 - 19
src/main/java/fi/rim/fromPlugin/FpzsMainEXPlugin.java

@@ -88,6 +88,7 @@ import kd.imc.rim.common.constant.FpzsConstant;
 import kd.imc.rim.common.constant.InputInvoiceTypeEnum;
 import kd.imc.rim.common.helper.ExcelHelper;
 import kd.imc.rim.common.helper.ImcSaveServiceHelper;
+import kd.imc.rim.common.invoice.collector.ScannerServiceEx;
 import kd.imc.rim.common.invoice.collector.ScannerService;
 import kd.imc.rim.common.invoice.fpzs.FpzsAwsService;
 import kd.imc.rim.common.invoice.fpzs.FpzsMainService;
@@ -380,7 +381,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
         this.getView().setVisible(Boolean.FALSE, new String[]{"attach_panel"});
         this.progressBarVisible(false, (String[])null);
         CustomControl scannerControl = (CustomControl)this.getControl("custom_scanner");
-        ScannerService.init(scannerControl, this.getView().getPageId());
+        ScannerServiceEx.init(scannerControl, this.getView().getPageId());
         JSONObject customParam = FpzsMainService.cacheCustomParam(this);
         String billType = customParam.getString("billType");
         if (StringUtils.isEmpty(billType)) {
@@ -467,7 +468,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
         }
 
         if ("scanner_fail".equals(eventName)) {
-            if (ScannerService.scannerFail(this, eventArgs)) {
+            if (ScannerServiceEx.scannerFail(this, eventArgs)) {
                 this.scannerProcess("uploadFinish","");
             }
         } else {
@@ -489,8 +490,8 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
                     if (!"operate_attach_scanner".equals(description)) {
                         url = this.getView().getPageId();
                         businessParam = FpzsMainService.getBusinessParam(url, CollectTypeEnum.PC_SCANNER.getCode());
-                        businessParam.put("uploadIndex", ScannerService.getUploadIndex(data));
-                        ScannerService.recognitionInvoice("fpzs", this.getView().getPageId(), name, cache, businessParam, FpzsMainService.getCustomParam(this));
+                        businessParam.put("uploadIndex", ScannerServiceEx.getUploadIndex(data));
+                        ScannerServiceEx.recognitionInvoice("fpzs", this.getView().getPageId(), name, cache, businessParam, FpzsMainService.getCustomParam(this));
                     } else {
                         url = null;
 
@@ -550,7 +551,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
                     }
                 }
             } else if ("scanner_uploadFinish".equals(e.getEventName())) {
-                if (!ScannerService.uploadFinish(eventArgs)) {
+                if (!ScannerServiceEx.uploadFinish(eventArgs)) {
                     String operateType = this.getView().getPageCache().get("operate_type");
                     logger.info("扫描仪上传结束:" + operateType);
                     if (!"operate_attach_scanner".equals(operateType)) {
@@ -600,8 +601,8 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
                         String pageId = this.getView().getPageId();
                         logger.info("uploadfile_upload{},{}", pageId, RequestContext.get().getTraceId());
                         businessParam = FpzsMainService.getBusinessParam(pageId, CollectTypeEnum.PC_UPLOAD.getCode());
-                        businessParam.put("uploadIndex", ScannerService.getUploadIndex(json));
-                        ScannerService.recognitionInvoice("fpzs", this.getView().getPageId(), url, name, businessParam, FpzsMainService.getCustomParam(this));
+                        businessParam.put("uploadIndex", ScannerServiceEx.getUploadIndex(json));
+                        ScannerServiceEx.recognitionInvoice("fpzs", this.getView().getPageId(), url, name, businessParam, FpzsMainService.getCustomParam(this));
                         traceId = RequestContext.get().getTraceId();
                         if (this.traceMap == null || this.traceMap.get(traceId) == null) {
                             this.scannerProcess("upload",FileType);
@@ -697,8 +698,8 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
                                     String status;
                                     do {
                                         if(!"pdf".equals(FileType) && !"jpg".equals(FileType) && !"png".equals(FileType)){
-                                        if (!it2.hasNext()) {
-                                            if (!retryArray.isEmpty()) {
+                                            if (!it2.hasNext()) {
+                                                if (!retryArray.isEmpty()) {
 //                                                Map<String, Object> customParams = new HashMap(4);
 //                                                customParams.put("retryArray", retryArray);
 //                                                invoiceInfo = FpzsMainService.getBusinessParam(pageId, CollectTypeEnum.PC_UPLOAD.getCode());
@@ -706,12 +707,12 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
 //                                                FormShowParameter showParameter = this.newPage("rim_inv_recognition_retry", customParams, "retryCallback");
 //                                                showParameter.setCaption("识别失败重试列表");
 //                                                this.getView().showForm(showParameter);
+                                                }
+                                                break label537;
                                             }
-                                            break label537;
-                                        }
                                         }
-                                              url = (String)it2.next();
-                                           status = result.getString(url);
+                                        url = (String)it2.next();
+                                        status = result.getString(url);
                                     } while(!"fail".equals(status));
 
                                     attachJson = new JSONObject();
@@ -747,7 +748,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
                         }
 
                         JSONObject data = FpzsMainService.getInvoiceDataCache(pageId);
-                            FpzsMainService.updateInvoiceGrid(this, data);
+                        FpzsMainService.updateInvoiceGrid(this, data);
                         this.updateInvoiceCard(data);
                         Map<String, String> attIdSerialMap = Maps.newLinkedHashMap();
                         Iterator var54 = data.entrySet().iterator();
@@ -1000,16 +1001,16 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
             String title;
             if (allowOverseaUpload && tab.equalsIgnoreCase("tab_oversea")) {
                 title = "";
-                ScannerService.initUpload(uploadControl, true, title);
+                ScannerServiceEx.initUpload(uploadControl, true, title);
             } else if (!allowOverseaUpload && tab.equalsIgnoreCase("tab_oversea")) {
-                ScannerService.removeUpload(uploadControl);
+                ScannerServiceEx.removeUpload(uploadControl);
             }
 
             if (allowInvoiceUpload && tab.equalsIgnoreCase("tab_invoice")) {
                 title = "";
-                ScannerService.initUpload(uploadControl, true, title);
+                ScannerServiceEx.initUpload(uploadControl, true, title);
             } else if (!allowInvoiceUpload && tab.equalsIgnoreCase("tab_invoice")) {
-                ScannerService.removeUpload(uploadControl);
+                ScannerServiceEx.removeUpload(uploadControl);
             }
         }
 
@@ -1150,7 +1151,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
         String callBackId = messageBoxClosedEvent.getCallBackId();
         if ("downJsScanner".equals(callBackId)) {
             if (MessageBoxResult.Yes.equals(messageBoxClosedEvent.getResult())) {
-                ScannerService.downJsScanner(this);
+                ScannerServiceEx.downJsScanner(this);
             }
         } else if ("del_attach".equals(callBackId)) {
             if (MessageBoxResult.Yes.equals(messageBoxClosedEvent.getResult())) {

+ 1 - 1
src/main/java/kd/imc/rim/common/helper/RecognitionCheckHelperEx.java

@@ -157,7 +157,7 @@ public class RecognitionCheckHelperEx {
                             exceptionDecr = true;
                             threadCount = CacheHelper.inc("recogThread", countTimeOut);
                             logger.info("识别线程数量{}", threadCount);
-                            recognitionResult = RecognitionFactory.getRecognitionService(recognitionImplStr).recognitionInvoice(recognitionParam);
+                            recognitionResult = RecognitionFactory.getRecognitionService(HANGXINCHECKSERIVCESTR).recognitionInvoice(recognitionParam);
                             threadCount = CacheHelper.decr("recogThread", countTimeOut);
                             exceptionDecr = false;
                         }

+ 1 - 1
src/main/java/kd/imc/rim/common/invoice/collector/ScannerServiceEx.java

@@ -26,7 +26,7 @@ import org.apache.commons.lang3.StringUtils;
 
 public class ScannerServiceEx {
     private static final int threadNum = 5;
-    private static ThreadPool checkThreadPool = ThreadPools.newFixedThreadPool("scanner_check_pool", 5);
+    private static ThreadPool checkThreadPool = ThreadPools.newFixedThreadPool("scanner_check_pool_Ex", 5);
     private static final Log LOGGER = LogFactory.getLog(ScannerServiceEx.class);
     public static final String operate_invoice = "invoice";
     public static final String operate_attach = "attach";