|
@@ -169,6 +169,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
|
|
|
private static final String ERROR_INVOICE_LIST = "error";
|
|
|
private static final String IMPORT_INVOICE_LIST = "import";
|
|
|
private static final String format = "###,##0.00";
|
|
|
+ public static String FileType = "";
|
|
|
|
|
|
public FpzsMainEXPlugin() {
|
|
|
}
|
|
@@ -467,7 +468,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
|
|
|
|
|
|
if ("scanner_fail".equals(eventName)) {
|
|
|
if (ScannerService.scannerFail(this, eventArgs)) {
|
|
|
- this.scannerProcess("uploadFinish");
|
|
|
+ this.scannerProcess("uploadFinish","");
|
|
|
}
|
|
|
} else {
|
|
|
JSONObject json;
|
|
@@ -553,7 +554,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
|
|
|
String operateType = this.getView().getPageCache().get("operate_type");
|
|
|
logger.info("扫描仪上传结束:" + operateType);
|
|
|
if (!"operate_attach_scanner".equals(operateType)) {
|
|
|
- this.scannerProcess("uploadFinish");
|
|
|
+ this.scannerProcess("uploadFinish","");
|
|
|
}
|
|
|
}
|
|
|
} else if ("datagrid_deleteRow".equals(e.getEventName())) {
|
|
@@ -573,11 +574,25 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
|
|
|
this.showAttachUpload();
|
|
|
}
|
|
|
} else if ("dialog".equals(eventName)) {
|
|
|
- this.scannerProcess("dialog");
|
|
|
+ this.scannerProcess("dialog",FileType);
|
|
|
} else if ("uploadfile_upload".equals(eventName)) {
|
|
|
json = JSON.parseObject(eventArgs);
|
|
|
type = json.getString("status");
|
|
|
name = json.getString("name");
|
|
|
+ boolean pdf = name.contains("pdf");
|
|
|
+ boolean jpg = name.contains("jpg");
|
|
|
+ boolean jpeg = name.contains("jpeg");
|
|
|
+ boolean png = name.contains("png");
|
|
|
+ String FileType="";
|
|
|
+ if(pdf){
|
|
|
+ FileType="pdf";
|
|
|
+ } else if (jpg){
|
|
|
+ FileType="jpg";
|
|
|
+ }else if (jpeg){
|
|
|
+ FileType="jpeg";
|
|
|
+ }else if (png){
|
|
|
+ FileType="png";
|
|
|
+ }
|
|
|
cache = json.getString("errcode");
|
|
|
description = json.getString("description");
|
|
|
if ("success".equals(type) && !"40002".equals(cache)) {
|
|
@@ -589,7 +604,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
|
|
|
ScannerService.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");
|
|
|
+ this.scannerProcess("upload",FileType);
|
|
|
}
|
|
|
|
|
|
if (this.traceMap == null) {
|
|
@@ -623,6 +638,241 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void scannerProcess(String type,String FileType) {
|
|
|
+ String pageId = this.getView().getPageId();
|
|
|
+ logger.info("scannerProcess-{}-{} coming", pageId, type);
|
|
|
+ DLock lock = DLock.create("scannerProcess" + pageId, "刷新卡片锁");
|
|
|
+ Throwable var4 = null;
|
|
|
+
|
|
|
+ try {
|
|
|
+ int times = 0;
|
|
|
+ String dialogId = "scanner";
|
|
|
+
|
|
|
+ while(times < 30) {
|
|
|
+ ++times;
|
|
|
+ if (lock.tryLock(500L)) {
|
|
|
+ times = 100;
|
|
|
+ JSONObject result = RecognitionCheckTask.queryCacheFile(pageId);
|
|
|
+ logger.info("scannerProcess-{}:{}", pageId, result);
|
|
|
+ boolean var41 = false;
|
|
|
+
|
|
|
+ try {
|
|
|
+ var41 = true;
|
|
|
+ CustomControl customcontrol = (CustomControl)this.getControl("progressBar_customcontrol");
|
|
|
+ DialogService service = new DialogService(customcontrol);
|
|
|
+ Set<String> urlSet = result.keySet();
|
|
|
+ Iterator<String> it = urlSet.iterator();
|
|
|
+ int waiting = 0;
|
|
|
+ int fail = 0;
|
|
|
+
|
|
|
+ String repeatFlag;
|
|
|
+ while(it.hasNext()) {
|
|
|
+ String url = (String)it.next();
|
|
|
+ repeatFlag = result.getString(url);
|
|
|
+ if ("waiting".equals(repeatFlag)) {
|
|
|
+ ++waiting;
|
|
|
+ } else if ("fail".equals(repeatFlag)) {
|
|
|
+ ++fail;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int total = result.size();
|
|
|
+ logger.info("scannerProcess-{} waiting:{},fail:{},total:{}", new Object[]{pageId, waiting, fail, total});
|
|
|
+ JSONArray retryArray;
|
|
|
+ JSONObject attachJson;
|
|
|
+ JSONObject invoiceInfo;
|
|
|
+ if ("dialog".equals(type) && (total == 0 || waiting == 0)) {
|
|
|
+ if (total > 0) {
|
|
|
+ RecognitionCheckTask.clearCacheFile(pageId);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fail > 0) {
|
|
|
+ Set<String> urlSet2 = result.keySet();
|
|
|
+ Iterator<String> it2 = urlSet2.iterator();
|
|
|
+ retryArray = new JSONArray();
|
|
|
+
|
|
|
+ label537:
|
|
|
+ while(true) {
|
|
|
+ String url;
|
|
|
+ String status;
|
|
|
+ do {
|
|
|
+ if(!"pdf".equals(FileType) && !"jpg".equals(FileType) && !"png".equals(FileType)){
|
|
|
+ if (!it2.hasNext()) {
|
|
|
+ if (!retryArray.isEmpty()) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ break label537;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ url = (String)it2.next();
|
|
|
+ status = result.getString(url);
|
|
|
+ } while(!"fail".equals(status));
|
|
|
+
|
|
|
+ attachJson = new JSONObject();
|
|
|
+ attachJson.put("fileUrl", url);
|
|
|
+ attachJson.put("fileName", url.substring(url.lastIndexOf(47) + 1, url.length()));
|
|
|
+ JSONObject cause = RecognitionCheckTask.queryCacheCause(pageId);
|
|
|
+ if (cause != null && StringUtils.isNotEmpty(cause.getString(url))) {
|
|
|
+ attachJson.put("failDescription", cause.getString(url));
|
|
|
+ } else {
|
|
|
+ attachJson.put("failDescription", "处理失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ retryArray.add(attachJson);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (total > 0 && fail > 0) {
|
|
|
+
|
|
|
+ } else if (total > 0) {
|
|
|
+ this.getView().showSuccessNotification(String.format("上传%s个文件,处理成功%s个", total, total, 10000));
|
|
|
+ }
|
|
|
+
|
|
|
+ service.hide();
|
|
|
+ repeatFlag = this.getView().getPageId() + "scannerProcessRepeat";
|
|
|
+ String scannerProcessRepeat = CacheHelper.get(repeatFlag);
|
|
|
+ if (StringUtils.isNotEmpty(scannerProcessRepeat) && "true".equals(scannerProcessRepeat)) {
|
|
|
+ this.getView().showSuccessNotification("发票已存在列表");
|
|
|
+ CacheHelper.remove(repeatFlag);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String[] content = new String[]{"待处理文件剩余" + waiting + "个", "正在处理中(" + (total - waiting) + "/" + total + ")"};
|
|
|
+ service.show(dialogId, content, 1000);
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONObject data = FpzsMainService.getInvoiceDataCache(pageId);
|
|
|
+ FpzsMainService.updateInvoiceGrid(this, data);
|
|
|
+ this.updateInvoiceCard(data);
|
|
|
+ Map<String, String> attIdSerialMap = Maps.newLinkedHashMap();
|
|
|
+ Iterator var54 = data.entrySet().iterator();
|
|
|
+
|
|
|
+ label569:
|
|
|
+ while(true) {
|
|
|
+ List attachList;
|
|
|
+ do {
|
|
|
+ do {
|
|
|
+ if (!var54.hasNext()) {
|
|
|
+ retryArray = FpzsMainService.getAttachDataCache(pageId);
|
|
|
+ if (retryArray.size() != 0) {
|
|
|
+ this.getModel().deleteEntryData("attach_grid_entry");
|
|
|
+ this.getModel().deleteEntryData("attach_card_entry");
|
|
|
+ Iterator var57 = retryArray.iterator();
|
|
|
+
|
|
|
+ while(var57.hasNext()) {
|
|
|
+ Object attach = var57.next();
|
|
|
+ attachJson = (JSONObject)attach;
|
|
|
+ String id = attachJson.getString("id");
|
|
|
+ this.handleAttachCategory(attachJson);
|
|
|
+ Iterator var64 = attIdSerialMap.entrySet().iterator();
|
|
|
+
|
|
|
+ while(var64.hasNext()) {
|
|
|
+ Map.Entry<String, String> entry = (Map.Entry)var64.next();
|
|
|
+ if (id.equals(entry.getKey())) {
|
|
|
+ attachJson.put("serial_no", entry.getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int row = this.getModel().createNewEntryRow("attach_grid_entry");
|
|
|
+ this.getModel().setValue("attachid", attachJson.get("id"), row);
|
|
|
+ this.getModel().setValue("attach_category_grid", attachJson.get("attach_category"), row);
|
|
|
+ this.getModel().setValue("attach_name", attachJson.get("attach_name"), row);
|
|
|
+ this.getModel().setValue("serial_no3", attachJson.get("serial_no"), row);
|
|
|
+ this.getModel().setValue("attach_type", attachJson.get("attach_type"), row);
|
|
|
+ this.getModel().setValue("upload_date", attachJson.getDate("create_time"), row);
|
|
|
+ this.getModel().setValue("attach_remark", attachJson.get("remark"), row);
|
|
|
+ this.getModel().setValue("attach_path", attachJson.get("attach_url"), row);
|
|
|
+ this.getModel().setValue("file_extension", attachJson.get("file_extension"), row);
|
|
|
+ this.getModel().setValue("attach_no", attachJson.get("attach_no"), row);
|
|
|
+ int attachGridIndex = this.getModel().createNewEntryRow("attach_card_entry");
|
|
|
+ String simplify_name = attachJson.getString("simplify_name");
|
|
|
+ DynamicObject attachObject;
|
|
|
+ if (StringUtils.isEmpty(simplify_name)) {
|
|
|
+ attachObject = BusinessDataServiceHelper.loadSingle(attachJson.getLong("attach_category"), "bdm_attach_type");
|
|
|
+ simplify_name = attachObject.getString("simplify_name");
|
|
|
+ }
|
|
|
+
|
|
|
+ this.getModel().setValue("attach_category", simplify_name, attachGridIndex);
|
|
|
+ this.getModel().setValue("attach_name_grid", attachJson.get("attach_name"), attachGridIndex);
|
|
|
+ attachObject = BusinessDataServiceHelper.newDynamicObject("rim_attach");
|
|
|
+ attachObject = DynamicObjectUtil.jsonToDynamicObject(attachJson, attachObject);
|
|
|
+ String imageUrl = this.getAttachSnapshotUrl(attachObject);
|
|
|
+ this.getModel().setValue("attach_image_grid", imageUrl, attachGridIndex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.showFlex();
|
|
|
+ var41 = false;
|
|
|
+ break label569;
|
|
|
+ }
|
|
|
+
|
|
|
+ Map.Entry<String, Object> entry = (Map.Entry)var54.next();
|
|
|
+ invoiceInfo = (JSONObject)entry.getValue();
|
|
|
+ attachList = (List)invoiceInfo.get("attachList");
|
|
|
+ } while(attachList == null);
|
|
|
+ } while(attachList.size() == 0);
|
|
|
+
|
|
|
+ Iterator var62 = attachList.iterator();
|
|
|
+
|
|
|
+ while(var62.hasNext()) {
|
|
|
+ Map<String, Object> attachInfo = (Map)var62.next();
|
|
|
+ String id = (String)attachInfo.get("id");
|
|
|
+ attIdSerialMap.put(id, invoiceInfo.getString("serialNo"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } finally {
|
|
|
+ if (var41) {
|
|
|
+ String failResultDataStr = CacheHelper.get(this.getView().getPageId().concat("failResult"));
|
|
|
+ if (StringUtils.isNotBlank(failResultDataStr)) {
|
|
|
+ FormShowParameter failedListForm = new FormShowParameter();
|
|
|
+ failedListForm.setFormId("rim_inv_import_fail");
|
|
|
+ failedListForm.setCustomParam("invoiceFailedList", failResultDataStr);
|
|
|
+ failedListForm.getOpenStyle().setShowType(ShowType.Modal);
|
|
|
+ this.getView().showForm(failedListForm);
|
|
|
+ CacheHelper.remove(this.getView().getPageId().concat("failResult"));
|
|
|
+ }
|
|
|
+
|
|
|
+ lock.unlock();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String failResultDataStr = CacheHelper.get(this.getView().getPageId().concat("failResult"));
|
|
|
+ if (StringUtils.isNotBlank(failResultDataStr)) {
|
|
|
+ FormShowParameter failedListForm = new FormShowParameter();
|
|
|
+ failedListForm.setFormId("rim_inv_import_fail");
|
|
|
+ failedListForm.setCustomParam("invoiceFailedList", failResultDataStr);
|
|
|
+ failedListForm.getOpenStyle().setShowType(ShowType.Modal);
|
|
|
+ this.getView().showForm(failedListForm);
|
|
|
+ CacheHelper.remove(this.getView().getPageId().concat("failResult"));
|
|
|
+ }
|
|
|
+
|
|
|
+ lock.unlock();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Throwable var44) {
|
|
|
+ var4 = var44;
|
|
|
+ throw var44;
|
|
|
+ } finally {
|
|
|
+ if (lock != null) {
|
|
|
+ if (var4 != null) {
|
|
|
+ try {
|
|
|
+ lock.close();
|
|
|
+ } catch (Throwable var42) {
|
|
|
+ var4.addSuppressed(var42);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ lock.close();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
private void dealWebSoceketMsag(String eventArgs) {
|
|
|
logger.info("onMessage:{}", eventArgs);
|
|
|
JSONObject result = null;
|
|
@@ -2669,240 +2919,7 @@ public class FpzsMainEXPlugin extends LicenseFormPlugin implements RowClickEvent
|
|
|
return "customcontrol_" + type;
|
|
|
}
|
|
|
|
|
|
- private void scannerProcess(String type) {
|
|
|
- String pageId = this.getView().getPageId();
|
|
|
- logger.info("scannerProcess-{}-{} coming", pageId, type);
|
|
|
- DLock lock = DLock.create("scannerProcess" + pageId, "刷新卡片锁");
|
|
|
- Throwable var4 = null;
|
|
|
-
|
|
|
- try {
|
|
|
- int times = 0;
|
|
|
- String dialogId = "scanner";
|
|
|
-
|
|
|
- while(times < 30) {
|
|
|
- ++times;
|
|
|
- if (lock.tryLock(500L)) {
|
|
|
- times = 100;
|
|
|
- JSONObject result = RecognitionCheckTask.queryCacheFile(pageId);
|
|
|
- logger.info("scannerProcess-{}:{}", pageId, result);
|
|
|
- boolean var41 = false;
|
|
|
-
|
|
|
- try {
|
|
|
- var41 = true;
|
|
|
- CustomControl customcontrol = (CustomControl)this.getControl("progressBar_customcontrol");
|
|
|
- DialogService service = new DialogService(customcontrol);
|
|
|
- Set<String> urlSet = result.keySet();
|
|
|
- Iterator<String> it = urlSet.iterator();
|
|
|
- int waiting = 0;
|
|
|
- int fail = 0;
|
|
|
-
|
|
|
- String repeatFlag;
|
|
|
- while(it.hasNext()) {
|
|
|
- String url = (String)it.next();
|
|
|
- repeatFlag = result.getString(url);
|
|
|
- if ("waiting".equals(repeatFlag)) {
|
|
|
- ++waiting;
|
|
|
- } else if ("fail".equals(repeatFlag)) {
|
|
|
- ++fail;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- int total = result.size();
|
|
|
- logger.info("scannerProcess-{} waiting:{},fail:{},total:{}", new Object[]{pageId, waiting, fail, total});
|
|
|
- JSONArray retryArray;
|
|
|
- JSONObject attachJson;
|
|
|
- JSONObject invoiceInfo;
|
|
|
- if ("dialog".equals(type) && (total == 0 || waiting == 0)) {
|
|
|
- if (total > 0) {
|
|
|
- RecognitionCheckTask.clearCacheFile(pageId);
|
|
|
- }
|
|
|
-
|
|
|
- if (fail > 0) {
|
|
|
- Set<String> urlSet2 = result.keySet();
|
|
|
- Iterator<String> it2 = urlSet2.iterator();
|
|
|
- retryArray = new JSONArray();
|
|
|
-
|
|
|
- label537:
|
|
|
- while(true) {
|
|
|
- String url;
|
|
|
- String status;
|
|
|
- do {
|
|
|
- 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());
|
|
|
- customParams.put("businessParam", invoiceInfo);
|
|
|
- FormShowParameter showParameter = this.newPage("rim_inv_recognition_retry", customParams, "retryCallback");
|
|
|
- showParameter.setCaption("识别失败重试列表");
|
|
|
- this.getView().showForm(showParameter);
|
|
|
- }
|
|
|
- break label537;
|
|
|
- }
|
|
|
-
|
|
|
- url = (String)it2.next();
|
|
|
- status = result.getString(url);
|
|
|
- } while(!"fail".equals(status));
|
|
|
-
|
|
|
- attachJson = new JSONObject();
|
|
|
- attachJson.put("fileUrl", url);
|
|
|
- attachJson.put("fileName", url.substring(url.lastIndexOf(47) + 1, url.length()));
|
|
|
- JSONObject cause = RecognitionCheckTask.queryCacheCause(pageId);
|
|
|
- if (cause != null && StringUtils.isNotEmpty(cause.getString(url))) {
|
|
|
- attachJson.put("failDescription", cause.getString(url));
|
|
|
- } else {
|
|
|
- attachJson.put("failDescription", "处理失败");
|
|
|
- }
|
|
|
-
|
|
|
- retryArray.add(attachJson);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (total > 0 && fail > 0) {
|
|
|
- this.getView().showTipNotification(String.format("上传%s个文件,处理失败%s个", total, fail), 10000);
|
|
|
- } else if (total > 0) {
|
|
|
- this.getView().showSuccessNotification(String.format("上传%s个文件,处理成功%s个", total, total, 10000));
|
|
|
- }
|
|
|
-
|
|
|
- service.hide();
|
|
|
- repeatFlag = this.getView().getPageId() + "scannerProcessRepeat";
|
|
|
- String scannerProcessRepeat = CacheHelper.get(repeatFlag);
|
|
|
- if (StringUtils.isNotEmpty(scannerProcessRepeat) && "true".equals(scannerProcessRepeat)) {
|
|
|
- this.getView().showSuccessNotification("发票已存在列表");
|
|
|
- CacheHelper.remove(repeatFlag);
|
|
|
- }
|
|
|
- } else {
|
|
|
- String[] content = new String[]{"待处理文件剩余" + waiting + "个", "正在处理中(" + (total - waiting) + "/" + total + ")"};
|
|
|
- service.show(dialogId, content, 1000);
|
|
|
- }
|
|
|
-
|
|
|
- JSONObject data = FpzsMainService.getInvoiceDataCache(pageId);
|
|
|
- FpzsMainService.updateInvoiceGrid(this, data);
|
|
|
- this.updateInvoiceCard(data);
|
|
|
- Map<String, String> attIdSerialMap = Maps.newLinkedHashMap();
|
|
|
- Iterator var54 = data.entrySet().iterator();
|
|
|
-
|
|
|
- label569:
|
|
|
- while(true) {
|
|
|
- List attachList;
|
|
|
- do {
|
|
|
- do {
|
|
|
- if (!var54.hasNext()) {
|
|
|
- retryArray = FpzsMainService.getAttachDataCache(pageId);
|
|
|
- if (retryArray.size() != 0) {
|
|
|
- this.getModel().deleteEntryData("attach_grid_entry");
|
|
|
- this.getModel().deleteEntryData("attach_card_entry");
|
|
|
- Iterator var57 = retryArray.iterator();
|
|
|
-
|
|
|
- while(var57.hasNext()) {
|
|
|
- Object attach = var57.next();
|
|
|
- attachJson = (JSONObject)attach;
|
|
|
- String id = attachJson.getString("id");
|
|
|
- this.handleAttachCategory(attachJson);
|
|
|
- Iterator var64 = attIdSerialMap.entrySet().iterator();
|
|
|
-
|
|
|
- while(var64.hasNext()) {
|
|
|
- Map.Entry<String, String> entry = (Map.Entry)var64.next();
|
|
|
- if (id.equals(entry.getKey())) {
|
|
|
- attachJson.put("serial_no", entry.getValue());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- int row = this.getModel().createNewEntryRow("attach_grid_entry");
|
|
|
- this.getModel().setValue("attachid", attachJson.get("id"), row);
|
|
|
- this.getModel().setValue("attach_category_grid", attachJson.get("attach_category"), row);
|
|
|
- this.getModel().setValue("attach_name", attachJson.get("attach_name"), row);
|
|
|
- this.getModel().setValue("serial_no3", attachJson.get("serial_no"), row);
|
|
|
- this.getModel().setValue("attach_type", attachJson.get("attach_type"), row);
|
|
|
- this.getModel().setValue("upload_date", attachJson.getDate("create_time"), row);
|
|
|
- this.getModel().setValue("attach_remark", attachJson.get("remark"), row);
|
|
|
- this.getModel().setValue("attach_path", attachJson.get("attach_url"), row);
|
|
|
- this.getModel().setValue("file_extension", attachJson.get("file_extension"), row);
|
|
|
- this.getModel().setValue("attach_no", attachJson.get("attach_no"), row);
|
|
|
- int attachGridIndex = this.getModel().createNewEntryRow("attach_card_entry");
|
|
|
- String simplify_name = attachJson.getString("simplify_name");
|
|
|
- DynamicObject attachObject;
|
|
|
- if (StringUtils.isEmpty(simplify_name)) {
|
|
|
- attachObject = BusinessDataServiceHelper.loadSingle(attachJson.getLong("attach_category"), "bdm_attach_type");
|
|
|
- simplify_name = attachObject.getString("simplify_name");
|
|
|
- }
|
|
|
-
|
|
|
- this.getModel().setValue("attach_category", simplify_name, attachGridIndex);
|
|
|
- this.getModel().setValue("attach_name_grid", attachJson.get("attach_name"), attachGridIndex);
|
|
|
- attachObject = BusinessDataServiceHelper.newDynamicObject("rim_attach");
|
|
|
- attachObject = DynamicObjectUtil.jsonToDynamicObject(attachJson, attachObject);
|
|
|
- String imageUrl = this.getAttachSnapshotUrl(attachObject);
|
|
|
- this.getModel().setValue("attach_image_grid", imageUrl, attachGridIndex);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- this.showFlex();
|
|
|
- var41 = false;
|
|
|
- break label569;
|
|
|
- }
|
|
|
-
|
|
|
- Map.Entry<String, Object> entry = (Map.Entry)var54.next();
|
|
|
- invoiceInfo = (JSONObject)entry.getValue();
|
|
|
- attachList = (List)invoiceInfo.get("attachList");
|
|
|
- } while(attachList == null);
|
|
|
- } while(attachList.size() == 0);
|
|
|
|
|
|
- Iterator var62 = attachList.iterator();
|
|
|
-
|
|
|
- while(var62.hasNext()) {
|
|
|
- Map<String, Object> attachInfo = (Map)var62.next();
|
|
|
- String id = (String)attachInfo.get("id");
|
|
|
- attIdSerialMap.put(id, invoiceInfo.getString("serialNo"));
|
|
|
- }
|
|
|
- }
|
|
|
- } finally {
|
|
|
- if (var41) {
|
|
|
- String failResultDataStr = CacheHelper.get(this.getView().getPageId().concat("failResult"));
|
|
|
- if (StringUtils.isNotBlank(failResultDataStr)) {
|
|
|
- FormShowParameter failedListForm = new FormShowParameter();
|
|
|
- failedListForm.setFormId("rim_inv_import_fail");
|
|
|
- failedListForm.setCustomParam("invoiceFailedList", failResultDataStr);
|
|
|
- failedListForm.getOpenStyle().setShowType(ShowType.Modal);
|
|
|
- this.getView().showForm(failedListForm);
|
|
|
- CacheHelper.remove(this.getView().getPageId().concat("failResult"));
|
|
|
- }
|
|
|
-
|
|
|
- lock.unlock();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- String failResultDataStr = CacheHelper.get(this.getView().getPageId().concat("failResult"));
|
|
|
- if (StringUtils.isNotBlank(failResultDataStr)) {
|
|
|
- FormShowParameter failedListForm = new FormShowParameter();
|
|
|
- failedListForm.setFormId("rim_inv_import_fail");
|
|
|
- failedListForm.setCustomParam("invoiceFailedList", failResultDataStr);
|
|
|
- failedListForm.getOpenStyle().setShowType(ShowType.Modal);
|
|
|
- this.getView().showForm(failedListForm);
|
|
|
- CacheHelper.remove(this.getView().getPageId().concat("failResult"));
|
|
|
- }
|
|
|
-
|
|
|
- lock.unlock();
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (Throwable var44) {
|
|
|
- var4 = var44;
|
|
|
- throw var44;
|
|
|
- } finally {
|
|
|
- if (lock != null) {
|
|
|
- if (var4 != null) {
|
|
|
- try {
|
|
|
- lock.close();
|
|
|
- } catch (Throwable var42) {
|
|
|
- var4.addSuppressed(var42);
|
|
|
- }
|
|
|
- } else {
|
|
|
- lock.close();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
private void saveInvoiceDataCache(String cache) {
|
|
|
FpzsMainService.setInvoiceDataCache(this.getView().getPageId(), cache);
|