Browse Source

1.列表增加查看影像功能
2.打开单据布局界面

tanya 2 tuần trước cách đây
mục cha
commit
583c231781

+ 5 - 0
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/common/constant/ErReimBurseBillConstant.java

@@ -33,6 +33,11 @@ public interface ErReimBurseBillConstant extends BillConstant{
 
     String KEY_COMPANY = "company";
 
+    /**
+     * 页面样式ID,打开单据时展示的布局
+     */
+    String KEY_NCKD_PAGEID = "nckd_pageid";
+
     interface OPERATE{
         /**
          * 交票操作

+ 32 - 4
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/form/HandInReceiveTicketPlugin.java

@@ -12,6 +12,8 @@ import kd.bos.dataentity.entity.DynamicObject;
 import kd.bos.dataentity.entity.DynamicObjectCollection;
 import kd.bos.dataentity.metadata.IDataEntityProperty;
 import kd.bos.dataentity.resource.ResManager;
+import kd.bos.entity.EntityMetadataCache;
+import kd.bos.entity.MainEntityType;
 import kd.bos.entity.datamodel.events.PropertyChangedArgs;
 import kd.bos.entity.operate.result.OperationResult;
 import kd.bos.ext.fi.ai.DapBuildVoucherCommonUtil;
@@ -44,6 +46,7 @@ import kd.bos.servicehelper.QueryServiceHelper;
 import kd.bos.servicehelper.image.ImageServiceNewHelper;
 import kd.bos.servicehelper.operation.OperationServiceHelper;
 import kd.bos.servicehelper.operation.SaveServiceHelper;
+import kd.bos.servicehelper.org.OrgViewType;
 import kd.bos.servicehelper.permission.PermissionServiceHelper;
 import kd.bos.url.UrlService;
 import kd.bos.util.CollectionUtils;
@@ -249,8 +252,17 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
     }
 
     protected void beforeImagePreview(BeforeItemClickEvent evt){
+        Long currUserId = RequestContext.get().getCurrUserId();
+        DynamicObject billInfo = getSelectBillInfo(ErReimBurseBillConstant.KEY_COMPANY);
+        Long orgId = billInfo.getDynamicObject(ErReimBurseBillConstant.KEY_COMPANY).getLong(ErReimBurseBillConstant.ID);
+        DynamicObject permitem = QueryServiceHelper.queryOne("perm_permitem", "id,number", new QFilter("number", QCP.equals, "QXX0097").toArray());
         // 进行权限校验
-
+        int checkPermission = PermissionServiceHelper.checkPermission(currUserId, orgId, OrgViewType.Admin, "er", billInfo.getDataEntityType().getName(), permitem.getString("id"));
+        if(checkPermission == 0){
+            getView().showTipNotification("没有查看影像的权限。");
+            evt.setCancel(true);
+            return;
+        }
     }
 
 
@@ -272,6 +284,7 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
                 break;
             case HandInReceiveTicketConstant.OPERATE.NCKD_VIEW_ELECRECEIPT:
                 doViewElecReceipt();
+                break;
             case HandInReceiveTicketConstant.OPERATE.NCKD_REFRESH:
                 doRefresh();
                 break;
@@ -374,8 +387,9 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
 
         Map<String, Set<Object>> relationBelowBillMap = ErFindRelationBillUtils.getRelationBelowBillMap(selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_BILLID),
                 selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_FORMID));
-        if(!relationBelowBillMap.containsKey(BillTypeConstants.BEI_ELECRECEIPT) || CollectionUtils.isEmpty(relationBelowBillMap.get(BillTypeConstants.BEI_ELECRECEIPT))){
-            getView().showTipNotification("");
+        if(!relationBelowBillMap.containsKey(BillTypeConstants.BEI_ELECRECEIPT)
+                || CollectionUtils.isEmpty(relationBelowBillMap.get(BillTypeConstants.BEI_ELECRECEIPT))){
+            getView().showTipNotification("没有匹配的电子回单信息。");
             return;
         }
         List<byte[]> mergeArray = new ArrayList<>();
@@ -505,11 +519,25 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
         if(StringUtils.equals(entryKey,HandInReceiveTicketConstant.SCANBILLENTRY.ENTITYID)){
             // 获取单据信息
             DynamicObject billEntry = getModel().getEntryRowEntity(HandInReceiveTicketConstant.SCANBILLENTRY.ENTITYID, row);
+            String formId = billEntry.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_FORMID);
+            String billId = billEntry.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_BILLID);
+            MainEntityType entityType = EntityMetadataCache.getDataEntityType(formId);
+            String targetFormId = formId;
+            // 单据存在样式字段,则从单据上取,不存在则直接打开
+            if(entityType.getProperties().containsKey(ErReimBurseBillConstant.KEY_NCKD_PAGEID)){
+                DynamicObject queryBill = QueryServiceHelper.queryOne(formId, ErReimBurseBillConstant.KEY_NCKD_PAGEID,
+                        new QFilter(ErReimBurseBillConstant.ID, QCP.equals, Long.valueOf(billId)).toArray());
+                if(!StringUtils.isEmpty(queryBill.getString(ErReimBurseBillConstant.KEY_NCKD_PAGEID))){
+                    targetFormId = queryBill.getString(ErReimBurseBillConstant.KEY_NCKD_PAGEID);
+                }
+            }
+
             BillShowParameter parameter = new BillShowParameter();
-            parameter.setFormId(billEntry.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_FORMID));
+            parameter.setFormId(targetFormId);
             parameter.setStatus(OperationStatus.VIEW);
             parameter.getOpenStyle().setShowType(ShowType.InContainer);
             parameter.getOpenStyle().setTargetKey(HandInReceiveTicketConstant.METEDATAFLAG.NCKD_FLEX_TARGETBILL);
+            parameter.setPkId(billId);
             getView().showForm(parameter);
         }
     }