Browse Source

1.打印配置增加打印顺序比录校验
2.增加查询单据范围
3.修改交票、收票状态校验逻辑

tanya 3 weeks ago
parent
commit
26aab8cf78

+ 20 - 0
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/common/constant/BillTypeConstants.java

@@ -14,5 +14,25 @@ public interface BillTypeConstants {
 
     String BEI_ELECRECEIPT = "bei_elecreceipt";
 
+    /**
+     * 费用报销单
+     */
     String ER_DAILYREIMBURSEBILL = "er_dailyreimbursebill";
+    /**
+     * 对公报销单
+     */
+    String ER_PUBLICREIMBURSEBILL = "er_publicreimbursebill";
+    /**
+     * 差旅报销单
+     */
+    String ER_TRIPREIMBURSEBILL = "er_tripreimbursebill";
+    /**
+     * er_checkingpaybill
+     */
+    String ER_CHECKINGPAYBILL = "er_checkingpaybill";
+
+    /**
+     * 预付单
+     */
+    String ER_PREPAYBILL = "er_prepaybill";
 }

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

@@ -31,7 +31,7 @@ public interface ErReimBurseBillConstant extends BillConstant{
      */
     String KEY_NCKD_TRACKING_NUMBER = "nckd_tracking_number";
 
-    String KEY_COSTCOMPANY = "costcompany";
+    String KEY_COMPANY = "company";
 
     interface OPERATE{
         /**

+ 3 - 0
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/common/constant/HandInReceiveTicketConstant.java

@@ -86,6 +86,9 @@ public interface HandInReceiveTicketConstant {
          */
         String NCKD_VIEW_ELECRECEIPT = "nckd_view_elecreceipt";
 
+        String NCKD_REFRESH = "nckd_refresh";
+
+
     }
 
     interface METEDATAFLAG{

+ 7 - 12
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/common/util/ReceiveTicketUtils.java

@@ -103,7 +103,7 @@ public class ReceiveTicketUtils {
         if(pkTplMap.containsKey(billId)){
             Set<MatcherTpl> matcherTpls = pkTplMap.get(billId);
             if(matcherTpls.size() > 1){
-                throw new KDBizException(String.format(ResManager.loadKDString("单据存在多条打印模板,请在模板条件中维护。","","")));
+                throw new KDBizException("单据存在多条打印模板,请在模板条件中维护。");
             }
             return matcherTpls.iterator().next().getTplId();
         }
@@ -137,11 +137,11 @@ public class ReceiveTicketUtils {
                 .filter(r -> StringUtils.equals(formId, r.getString(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_BILLTYPE)))
                 .collect(Collectors.toList());
         if(CollectionUtils.isEmpty(billEntryList)){
-            throw new KDBizException(ResManager.loadKDString("请先在打印配置中维护单据信息。","",""));
+            throw new KDBizException("请先在打印配置中维护单据信息。");
         }
 
         if(billEntryList.size() > 1){
-            throw new KDBizException(ResManager.loadKDString("打印配置中单据存在多条配置。","",""));
+            throw new KDBizException("打印配置中单据存在多条配置。");
         }
 
         Map<String, Set<Object>> relationBelowBillMap = ErFindRelationBillUtils.getRelationBelowBillMap(billId.toString(), formId);
@@ -158,8 +158,6 @@ public class ReceiveTicketUtils {
                     mergePrintList.add(new MergePrintEntity(BillTypeConstants.GL_VOUCHER,printTemplateId, Collections.singletonList(voucherId),billConfigEntry.getInt(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_VOUCHERORDER)));
                 }
             }
-            String printTemplateId = getPrintTemplateId(null, BillTypeConstants.GL_VOUCHER, "2215223801854038016");
-            mergePrintList.add(new MergePrintEntity(BillTypeConstants.GL_VOUCHER,printTemplateId, Collections.singletonList("2215223801854038016"),billConfigEntry.getInt(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_VOUCHERORDER)));
         }
         if(billConfigEntry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_ISPTRECEIPT)){
             if(relationBelowBillMap.containsKey(BillTypeConstants.BEI_ELECRECEIPT)){
@@ -167,9 +165,6 @@ public class ReceiveTicketUtils {
                 // 电子回单特殊处理,直接打印附件
                 mergePrintList.add(new MergePrintEntity(BillTypeConstants.BEI_ELECRECEIPT,null, elecReceipt.stream().collect(Collectors.toList()),billConfigEntry.getInt(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_RECEIPTORDER)));
             }
-
-            //mergePrintList.add(new MergePrintEntity(FormTypeConstants.BEI_ELECRECEIPT,null, Collections.singletonList("2203746550692187136"),billConfigEntry.getInt(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_RECEIPTORDER)));
-
         }
         return mergePrintList;
     }
@@ -185,7 +180,7 @@ public class ReceiveTicketUtils {
         if(CollectionUtils.isNotEmpty(companyConfigCol)){
 
             if(companyConfigCol.size() > 1){
-                throw new KDBizException(ResManager.loadKDString("公司存在多条打印配置,请维护数据后再操作。","",""));
+                throw new KDBizException("公司存在多条打印配置,请维护数据后再操作。");
             }
             return BusinessDataServiceHelper.loadSingle(companyConfigCol.get(0).get(ErPrintSetConstant.ID),ErPrintSetConstant.ENTITYID);
         }else{
@@ -193,7 +188,7 @@ public class ReceiveTicketUtils {
                     QFilter.isNull(ErPrintSetConstant.KEY_NCKD_ORG).toArray());
             if(CollectionUtils.isNotEmpty(groupConfig)){
                 if(groupConfig.size() > 1){
-                    throw new KDBizException(ResManager.loadKDString("存在多条全集团配置,请维护数据后再操作。","",""));
+                    throw new KDBizException("存在多条全集团配置,请维护数据后再操作。");
                 }
                 return BusinessDataServiceHelper.loadSingle(groupConfig.get(0).get(ErPrintSetConstant.ID),ErPrintSetConstant.ENTITYID);
             }
@@ -209,7 +204,7 @@ public class ReceiveTicketUtils {
     public static byte[] getElecReceiptPrintUrl(Object receiptId){
         List<Map<String, Object>> attachments = AttachmentServiceHelper.getAttachments(BillTypeConstants.BEI_ELECRECEIPT, receiptId, "attachmentpanel");
         if(attachments.size() > 1){
-            throw new KDBizException(ResManager.loadKDString("电子回单文件存在多个,请修复数据后再打印。","",""));
+            throw new KDBizException("电子回单文件存在多个,请修复数据后再打印。");
         }
         Object relativeUrl = attachments.get(0).get("relativeUrl");
         if (StringUtils.isNotBlank(relativeUrl)) {
@@ -220,7 +215,7 @@ public class ReceiveTicketUtils {
                 return getBytes(inputStream,outputStream);
             }catch (Exception e){
                 logger.error("getElecReceiptPrintUrl_getBytes_error",e);
-                throw new KDBizException(ResManager.loadKDString("获取电子回单文件异常:","","") + e.getMessage());
+                throw new KDBizException("获取电子回单文件异常:" + e.getMessage());
             }
         }
         return null;

+ 67 - 37
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/form/HandInReceiveTicketPlugin.java

@@ -18,8 +18,14 @@ import kd.bos.form.FormShowParameter;
 import kd.bos.form.ShowType;
 import kd.bos.form.control.EntryGrid;
 import kd.bos.form.control.Toolbar;
-import kd.bos.form.control.events.*;
-import kd.bos.form.events.*;
+import kd.bos.form.control.events.BeforeItemClickEvent;
+import kd.bos.form.control.events.ItemClickEvent;
+import kd.bos.form.control.events.RowClickEvent;
+import kd.bos.form.control.events.RowClickEventListener;
+import kd.bos.form.events.AfterDoOperationEventArgs;
+import kd.bos.form.events.BeforeDoOperationEventArgs;
+import kd.bos.form.events.ClosedCallBackEvent;
+import kd.bos.form.events.PreOpenFormEventArgs;
 import kd.bos.form.operate.FormOperate;
 import kd.bos.form.plugin.AbstractFormPlugin;
 import kd.bos.list.ListShowParameter;
@@ -31,9 +37,9 @@ import kd.bos.servicehelper.operation.OperationServiceHelper;
 import kd.bos.servicehelper.operation.SaveServiceHelper;
 import kd.bos.servicehelper.permission.PermissionServiceHelper;
 import kd.bos.util.CollectionUtils;
+import nckd.jimin.jyyy.fi.common.constant.BillTypeConstants;
 import nckd.jimin.jyyy.fi.common.constant.ErPrintUserConstant;
 import nckd.jimin.jyyy.fi.common.constant.ErReimBurseBillConstant;
-import nckd.jimin.jyyy.fi.common.constant.BillTypeConstants;
 import nckd.jimin.jyyy.fi.common.constant.HandInReceiveTicketConstant;
 import nckd.jimin.jyyy.fi.common.entity.MergePrintEntity;
 import nckd.jimin.jyyy.fi.common.util.ErFindRelationBillUtils;
@@ -71,13 +77,13 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
 
         if(CollectionUtils.isEmpty(scanTypeCol)){
             e.setCancel(true);
-            e.setCancelMessage(ResManager.loadKDString("请先配置用户登记后再操作。","",""));
+            e.setCancelMessage("请先配置用户登记后再操作。");
             return;
         }
 
         if(scanTypeCol.size() > 1){
             e.setCancel(true);
-            e.setCancelMessage(ResManager.loadKDString("用户登记存在多条有效数据,请处理后再操作。","",""));
+            e.setCancelMessage("用户登记存在多条有效数据,请处理后再操作。");
             return;
         }
     }
@@ -108,20 +114,33 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
         if(findNumberOp.isPresent()){
             return;
         }
-        String selector = String.join(",",ErReimBurseBillConstant.ID,ErReimBurseBillConstant.KEY_BILLNO,ErReimBurseBillConstant.KEY_COSTCOMPANY,
-                ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON,ErReimBurseBillConstant.KEY_NCKD_RECEIPT_PERSON);
-        // 查询费用报销单
-        DynamicObject reimBurseBill = BusinessDataServiceHelper.loadSingle(ErReimBurseBillConstant.ENTITYID,selector,
-                new QFilter(ErReimBurseBillConstant.KEY_BILLNO, QCP.equals, scanNumber).toArray());
-        if(reimBurseBill != null){
-            addScanBillEntry(reimBurseBill.getString(ErReimBurseBillConstant.KEY_BILLNO),getReceiptStatus(reimBurseBill),
-                    reimBurseBill.get(ErReimBurseBillConstant.ID), ErReimBurseBillConstant.ENTITYID,
-                    reimBurseBill.getDynamicObject(ErReimBurseBillConstant.KEY_COSTCOMPANY).getPkValue());
-            return;
+
+        String[] findBillArray = new String[]{BillTypeConstants.ER_PUBLICREIMBURSEBILL,BillTypeConstants.ER_DAILYREIMBURSEBILL,
+                BillTypeConstants.ER_TRIPREIMBURSEBILL,BillTypeConstants.ER_CHECKINGPAYBILL,BillTypeConstants.ER_PREPAYBILL};
+        for(String billType : findBillArray){
+            Boolean isFind = loadBillInfo(billType, scanNumber);
+            if(isFind){
+                return;
+            }
         }
 
     }
 
+    protected Boolean loadBillInfo(String billlType , String billNo){
+        String selector = String.join(",",ErReimBurseBillConstant.ID,ErReimBurseBillConstant.KEY_BILLNO,ErReimBurseBillConstant.KEY_COMPANY,
+                ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON,ErReimBurseBillConstant.KEY_NCKD_RECEIPT_PERSON);
+        DynamicObject tripReimBurseBill = BusinessDataServiceHelper.loadSingle(billlType,selector,
+                new QFilter(ErReimBurseBillConstant.KEY_BILLNO, QCP.equals, billNo).toArray());
+        if(tripReimBurseBill != null){
+            addScanBillEntry(tripReimBurseBill.getString(ErReimBurseBillConstant.KEY_BILLNO),getReceiptStatus(tripReimBurseBill),
+                    tripReimBurseBill.get(ErReimBurseBillConstant.ID), billlType,
+                    tripReimBurseBill.getDynamicObject(ErReimBurseBillConstant.KEY_COMPANY).getPkValue());
+            return true;
+        }
+        return false;
+    }
+
+
     protected String getReceiptStatus(DynamicObject billInfo){
         // 未交票
         if(billInfo.getDynamicObject(ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON) == null){
@@ -165,6 +184,17 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
     public void beforeItemClick(BeforeItemClickEvent evt) {
         super.beforeItemClick(evt);
         String itemKey = evt.getItemKey();
+
+        if(HandInReceiveTicketConstant.OPERATE.NCKD_MAIL.equals(itemKey) || HandInReceiveTicketConstant.OPERATE.NCKD_CANCELMAIN.equals(itemKey)
+            || HandInReceiveTicketConstant.OPERATE.NCKD_VIEW_VOUCHER.equals(itemKey) || HandInReceiveTicketConstant.OPERATE.NCKD_VIEW_ELECRECEIPT.equals(itemKey)){
+            String checkMsg = checkSelectSingle();
+            if(!StringUtils.isEmpty(checkMsg)) {
+                getView().showTipNotification(checkMsg);
+                evt.setCancel(true);
+                return;
+            }
+        }
+
         switch (itemKey){
             case HandInReceiveTicketConstant.OPERATE.NCKD_MAIL:
                 beforeMail(evt);
@@ -176,12 +206,6 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
     }
 
     protected void beforeMail(BeforeItemClickEvent evt){
-        String checkMsg = checkSelectSingle();
-        if(!StringUtils.isEmpty(checkMsg)) {
-            getView().showTipNotification(checkMsg);
-            evt.setCancel(true);
-            return;
-        }
 
         DynamicObject selectRow = getSelectRows().get(0);
         // 快递编号为空
@@ -189,23 +213,17 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
                 selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_FORMID), ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER);
 
         if(!StringUtils.isEmpty(billInfo.getString(ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER))){
-            getView().showTipNotification(ResManager.loadKDString("单据快递单号不为空,请先进行退邮操作。","",""));
+            getView().showTipNotification("不允许重复邮寄。");
             evt.setCancel(true);
             return;
         }
     }
     protected void beforeCancleMail(BeforeItemClickEvent evt){
-        String checkMsg = checkSelectSingle();
-        if(!StringUtils.isEmpty(checkMsg)) {
-            getView().showTipNotification(checkMsg);
-            evt.setCancel(true);
-            return;
-        }
         // 快递编号为空
         DynamicObject billInfo = getSelectBillInfo(ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER);
 
         if(StringUtils.isEmpty(billInfo.getString(ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER))){
-            getView().showTipNotification(ResManager.loadKDString("单据没有进行邮寄操作。","",""));
+            getView().showTipNotification("单据没有进行邮寄操作。");
             evt.setCancel(true);
             return;
         }
@@ -231,6 +249,8 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
                 break;
             case HandInReceiveTicketConstant.OPERATE.NCKD_VIEW_ELECRECEIPT:
                 doViewElecReceipt();
+            case HandInReceiveTicketConstant.OPERATE.NCKD_REFRESH:
+                doRefresh();
                 break;
         }
     }
@@ -274,10 +294,10 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
                     this.getView().showForm(showParameter);
                 }
             }else{
-                this.getView().showTipNotification(ResManager.loadKDString("单据没有关联的凭证。", "TraceVoucher_2", "bos-ext-fi", new Object[0]));
+                this.getView().showTipNotification(ResManager.loadKDString("单据没有关联的凭证。", "TraceVoucher_2", "bos-ext-fi"));
             }
         }else{
-            this.getView().showTipNotification(ResManager.loadKDString("单据没有关联的凭证。", "TraceVoucher_2", "bos-ext-fi", new Object[0]));
+            this.getView().showTipNotification(ResManager.loadKDString("单据没有关联的凭证。", "TraceVoucher_2", "bos-ext-fi"));
         }
     }
 
@@ -285,6 +305,16 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
 
     }
 
+    protected void doRefresh(){
+
+        int entryRowCount = getModel().getEntryRowCount(HandInReceiveTicketConstant.SCANBILLENTRY.ENTITYID);
+        int[] allRow = new int[entryRowCount];
+        for(int i = 0 ; i< entryRowCount ; i++){
+            allRow[i] = i ;
+        }
+        reloadEntryRow(allRow);
+    }
+
     protected void doMail(){
 
         FormShowParameter parameter = new FormShowParameter();
@@ -299,7 +329,7 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
         DynamicObject billInfo = getSelectBillInfo(String.join(",",ErReimBurseBillConstant.KEY_BILLNO,ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER));
         billInfo.set(ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER,null);
         SaveServiceHelper.save(new DynamicObject[]{ billInfo });
-        getView().showSuccessNotification(String.format(ResManager.loadKDString("单据%1$s退邮成功。","",""),billInfo.getString(ErReimBurseBillConstant.KEY_BILLNO)));
+        getView().showSuccessNotification("退邮成功。");
     }
 
 
@@ -381,10 +411,10 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
     protected String checkSelectSingle(){
         List<DynamicObject> selectRows = getSelectRows();
         if(selectRows.size() == 0){
-            return ResManager.loadKDString("请选择要执行的数据。","","");
+            return "请选择要执行的数据。";
         }
         if(selectRows.size() > 1){
-            return ResManager.loadKDString("请选择一条数据进行操作。","","");
+            return "仅允许选择一条数据进行操作。";
         }
         return "";
     }
@@ -397,8 +427,8 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
 
         // 通过打印配置获取单据打印信息
         List<MergePrintEntity> printPdfConfig = ReceiveTicketUtils.getPrintPdfConfig(formId,billId,companyId);
-
-        String downloadUrl = ReceiveTicketUtils.mergePrintPdf(getView(), printPdfConfig, "报销单附件打印.pdf");
+        String printFileName = String.format("%s报销信息打印",selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_NUMBER));
+        String downloadUrl = ReceiveTicketUtils.mergePrintPdf(getView(), printPdfConfig, printFileName);
         getView().download(downloadUrl);
     }
 
@@ -453,7 +483,7 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
 
         // 全部成功弹出消息提示,否则弹出操作提示框
         if(opResult.isSuccess()){
-            getView().showSuccessNotification(String.format(ResManager.loadKDString("执行【%1$s】操作成功!","",""),operateName));
+            getView().showSuccessNotification(String.format("执行【%1$s】操作成功!",operateName));
         }else{
             getView().showOperationResult(opResult);
         }

+ 57 - 0
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/operate/ErPrintSetOp.java

@@ -0,0 +1,57 @@
+package nckd.jimin.jyyy.fi.plugin.operate;
+
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.entity.DynamicObjectCollection;
+import kd.bos.dataentity.resource.ResManager;
+import kd.bos.entity.ExtendedDataEntity;
+import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
+import kd.bos.entity.plugin.AddValidatorsEventArgs;
+import kd.bos.entity.plugin.PreparePropertysEventArgs;
+import kd.bos.entity.validate.AbstractValidator;
+import nckd.jimin.jyyy.fi.common.constant.ErPrintSetConstant;
+
+public class ErPrintSetOp extends AbstractOperationServicePlugIn {
+
+    @Override
+    public void onPreparePropertys(PreparePropertysEventArgs e) {
+        super.onPreparePropertys(e);
+        e.getFieldKeys().add(ErPrintSetConstant.BillPtSetEntry.ENTITYID);
+        e.getFieldKeys().add("seq");
+        e.getFieldKeys().add(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_ISPTCOVER);
+        e.getFieldKeys().add(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_COVERORDER);
+        e.getFieldKeys().add(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_ISPTVOUCHER);
+        e.getFieldKeys().add(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_VOUCHERORDER);
+        e.getFieldKeys().add(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_ISPTRECEIPT);
+        e.getFieldKeys().add(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_RECEIPTORDER);
+    }
+
+    @Override
+    public void onAddValidators(AddValidatorsEventArgs e) {
+        super.onAddValidators(e);
+        e.getValidators().add(new AbstractValidator() {
+            @Override
+            public void validate() {
+                ExtendedDataEntity[] dataEntities = getDataEntities();
+                for(ExtendedDataEntity data : dataEntities){
+                    DynamicObject dataEntity = data.getDataEntity();
+                    DynamicObjectCollection entryCol = dataEntity.getDynamicObjectCollection(ErPrintSetConstant.BillPtSetEntry.ENTITYID);
+                    for(DynamicObject entry : entryCol){
+                        if(entry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_ISPTCOVER)
+                                && entry.getLong(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_COVERORDER) == 0L){
+                            this.addErrorMessage(data, String.format("%s行单据封面顺序不允许为空。",entry.getString("seq")));
+                        }
+                        if(entry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_VOUCHERORDER)
+                                && entry.getLong(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_VOUCHERORDER) == 0L){
+                            this.addErrorMessage(data, String.format("第%s行凭证打印顺序不允许为空。",entry.getString("seq")));
+                        }
+                        if(entry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_RECEIPTORDER)
+                                && entry.getLong(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_RECEIPTORDER) == 0L){
+                            this.addErrorMessage(data, String.format("第%s行电子回单顺序不允许为空。",entry.getString("seq")));
+                        }
+                    }
+                }
+            }
+        });
+    }
+
+}

+ 62 - 0
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/operate/ReimBurseBillReceiveTicketOp.java

@@ -0,0 +1,62 @@
+package nckd.jimin.jyyy.fi.plugin.operate;
+
+import kd.bos.context.RequestContext;
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
+import kd.bos.entity.plugin.AddValidatorsEventArgs;
+import kd.bos.entity.plugin.PreparePropertysEventArgs;
+import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
+import kd.bos.servicehelper.BusinessDataServiceHelper;
+import kd.bos.servicehelper.operation.SaveServiceHelper;
+import nckd.jimin.jyyy.fi.common.constant.ErReimBurseBillConstant;
+import nckd.jimin.jyyy.fi.plugin.operate.validator.ReimBurseBillReceiveTicketValidator;
+
+import java.util.Arrays;
+import java.util.Date;
+
+public class ReimBurseBillReceiveTicketOp extends AbstractOperationServicePlugIn {
+
+    @Override
+    public void onPreparePropertys(PreparePropertysEventArgs e) {
+        super.onPreparePropertys(e);
+        e.getFieldKeys().add(ErReimBurseBillConstant.KEY_BILLSTATUS);
+        e.getFieldKeys().add(ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON);
+        e.getFieldKeys().add(ErReimBurseBillConstant.KEY_NCKD_HANDIN_DATE);
+        e.getFieldKeys().add(ErReimBurseBillConstant.KEY_NCKD_RECEIPT_PERSON);
+        e.getFieldKeys().add(ErReimBurseBillConstant.KEY_NCKD_RECEIPT_DATE);
+    }
+
+    @Override
+    public void onAddValidators(AddValidatorsEventArgs e) {
+        super.onAddValidators(e);
+        e.getValidators().add(new ReimBurseBillReceiveTicketValidator());
+    }
+
+    @Override
+    public void beginOperationTransaction(BeginOperationTransactionArgs e) {
+        super.beginOperationTransaction(e);
+        String operationKey = e.getOperationKey();
+        DynamicObject[] dataEntities = e.getDataEntities();
+        String billtype = this.billEntityType.getName();
+        Arrays.stream(dataEntities).forEach(bill -> doHandInReceiptTicket(bill.getPkValue(),billtype,operationKey));
+    }
+
+    protected void doHandInReceiptTicket(Object billId , String billType,String operationKey){
+
+        DynamicObject billInfo = BusinessDataServiceHelper.loadSingle(billId, billType, String.join(",", ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON,
+                ErReimBurseBillConstant.KEY_NCKD_HANDIN_DATE, ErReimBurseBillConstant.KEY_NCKD_RECEIPT_PERSON, ErReimBurseBillConstant.KEY_NCKD_RECEIPT_DATE));
+        long currUserId = RequestContext.get().getCurrUserId();
+        Date now = new Date();
+        if(operationKey.equals(ErReimBurseBillConstant.OPERATE.HANDIN_TICKET)){
+            billInfo.set(ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON,currUserId);
+            billInfo.set(ErReimBurseBillConstant.KEY_NCKD_HANDIN_DATE,now);
+        }
+
+        if(operationKey.equals(ErReimBurseBillConstant.OPERATE.RECEIVE_TICKET)){
+            billInfo.set(ErReimBurseBillConstant.KEY_NCKD_RECEIPT_PERSON,currUserId);
+            billInfo.set(ErReimBurseBillConstant.KEY_NCKD_RECEIPT_DATE,now);
+        }
+        SaveServiceHelper.save(new DynamicObject[]{ billInfo });
+    }
+
+}