瀏覽代碼

凭证调试 操作类

wangjun 1 月之前
父節點
當前提交
d1d842eec5

+ 7 - 11
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/form/VoucherListPlugin.java

@@ -14,18 +14,14 @@ public class VoucherListPlugin extends AbstractListPlugin implements Plugin {
 
     public void itemClick(ItemClickEvent evt) {
         super.itemClick(evt);
-        switch (evt.getItemKey()) {
-            case "nckd_sap":
-                BillList billList = (BillList)this.getView().getControl("entries");
-                this.getView().showTipNotification("test", 2500);
-                ListSelectedRowCollection selectedRows = billList.getSelectedRows();
-                if (selectedRows == null || selectedRows.isEmpty()) {
-                    this.getView().showTipNotification("没选中数据!", 2500);
-                    return;
-                }
-                break;
+        if("nckd_sap".equalsIgnoreCase(evt.getItemKey() )) {
+            //获取单据体控件
+            ListSelectedRowCollection selectedRows = ((IListView) this.getView()).getSelectedRows();
+            if (selectedRows == null || selectedRows.isEmpty()) {
+                this.getView().showTipNotification("没选中数据!", 2500);
+                return;
+            }
         }
-
     }
 
 }

+ 16 - 5
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/operate/SynVoucherSapOpPlugin.java

@@ -22,11 +22,22 @@ public class SynVoucherSapOpPlugin extends AbstractOperationServicePlugIn implem
             return entityx.getLong("id");
         }).collect(Collectors.toList());
 
-        SynSapFIServiceImpl synSapService = new SynSapFIServiceImpl();
+        if(billids != null || billids.size() > 0) {
+            SynSapFIServiceImpl synSapService = new SynSapFIServiceImpl();
+            Map<String, String> result=synSapService.synVoucherForSap(billids);
 
-        Map<String, String> result=synSapService.synVoucherForSap(billids);
-        System.out.println(result.get("msg"));
-        this.getOperationResult().setSuccess(false); // 操作失败
-        this.operationResult.setMessage(result.get("msg"));
+            if(result.get("code").equals("200")){
+                this.operationResult.setShowMessage(true);
+                this.operationResult.setSuccess(true);
+                this.operationResult.setMessage(result.get("msg"));
+            }else{
+                this.operationResult.addErrorInfo(new ValidationErrorInfo("", null,
+                        0, 0, "同步失败", "billtitle", result.get("msg"), ErrorLevel.Error));
+            }
+        }else{
+            this.operationResult.setShowMessage(true);
+            this.operationResult.setSuccess(false);
+            this.operationResult.setMessage("没选中数据!");
+        }
     }
 }