Browse Source

1.增加影像查看功能

tanya 3 weeks ago
parent
commit
3560be398c

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

@@ -86,8 +86,13 @@ public interface HandInReceiveTicketConstant {
          */
          */
         String NCKD_VIEW_ELECRECEIPT = "nckd_view_elecreceipt";
         String NCKD_VIEW_ELECRECEIPT = "nckd_view_elecreceipt";
 
 
+        /**
+         * 刷新
+         */
         String NCKD_REFRESH = "nckd_refresh";
         String NCKD_REFRESH = "nckd_refresh";
 
 
+        String NCKD_IMAGEPREVIEW = "nckd_imagepreview";
+
 
 
     }
     }
 
 

+ 10 - 12
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/common/util/ErFindRelationBillUtils.java

@@ -22,21 +22,19 @@ public class ErFindRelationBillUtils {
      */
      */
     public static Map<String ,Set<Object>> getRelationBelowBillMap(String billId,String billType){
     public static Map<String ,Set<Object>> getRelationBelowBillMap(String billId,String billType){
         Map<String ,Set<Object>> relationBillMap = new HashMap<>();
         Map<String ,Set<Object>> relationBillMap = new HashMap<>();
-        if(BillTypeConstants.ER_DAILYREIMBURSEBILL.equals(billType)){
-            // 查询付款处理
-            Set<Object> casPaybillSet = getBotpRelationId(billType, BillTypeConstants.CAS_PAYBILL, Long.parseLong(billId), true);
+        // 查询付款处理
+        Set<Object> casPaybillSet = getBotpRelationId(billType, BillTypeConstants.CAS_PAYBILL, Long.parseLong(billId), true);
 
 
-            if(CollectionUtils.isNotEmpty(casPaybillSet)){
-                relationBillMap.put(BillTypeConstants.CAS_PAYBILL,casPaybillSet);
+        if(CollectionUtils.isNotEmpty(casPaybillSet)){
+            relationBillMap.put(BillTypeConstants.CAS_PAYBILL,casPaybillSet);
 
 
-                // 凭证
-                Set<Long> voucherSet = DapVoucherUtil.getBuildVch(casPaybillSet, BillTypeConstants.CAS_PAYBILL);
-                relationBillMap.put(BillTypeConstants.GL_VOUCHER,voucherSet.stream().map(r->(Object)r).collect(Collectors.toSet()));
+            // 凭证
+            Set<Long> voucherSet = DapVoucherUtil.getBuildVch(casPaybillSet, BillTypeConstants.CAS_PAYBILL);
+            relationBillMap.put(BillTypeConstants.GL_VOUCHER,voucherSet.stream().map(r->(Object)r).collect(Collectors.toSet()));
 
 
-                //电子回单
-                Set<Object> casPayBillElecReceipt = getCasPayBillElecReceipt(casPaybillSet);
-                relationBillMap.put(BillTypeConstants.BEI_ELECRECEIPT,casPayBillElecReceipt);
-            }
+            //电子回单
+            Set<Object> casPayBillElecReceipt = getCasPayBillElecReceipt(casPaybillSet);
+            relationBillMap.put(BillTypeConstants.BEI_ELECRECEIPT,casPayBillElecReceipt);
         }
         }
 
 
         return relationBillMap;
         return relationBillMap;

+ 9 - 27
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/common/util/PrintPdfUtil.java

@@ -1,44 +1,27 @@
 package nckd.jimin.jyyy.fi.common.util;
 package nckd.jimin.jyyy.fi.common.util;
 
 
-import kd.bos.context.RequestContext;
-import kd.bos.dataentity.entity.DynamicObject;
-import kd.bos.entity.api.ApiResult;
-import kd.bos.fileservice.FileItem;
-import kd.bos.fileservice.FileService;
-import kd.bos.fileservice.FileServiceFactory;
-import kd.bos.fileservice.extension.FileServiceExt;
+import kd.bos.dataentity.resource.ResManager;
+import kd.bos.exception.KDBizException;
 import kd.bos.logging.Log;
 import kd.bos.logging.Log;
 import kd.bos.logging.LogFactory;
 import kd.bos.logging.LogFactory;
-import kd.bos.orm.query.QCP;
-import kd.bos.orm.query.QFilter;
+import kd.bos.print.api.PrintContext;
 import kd.bos.print.api.PrintTask;
 import kd.bos.print.api.PrintTask;
 import kd.bos.print.api.PrintWork;
 import kd.bos.print.api.PrintWork;
 import kd.bos.print.core.service.PrtAttach;
 import kd.bos.print.core.service.PrtAttach;
+import kd.bos.print.core.service.PrtAttach.AttachDetail;
 import kd.bos.print.service.BosPrintServiceHelper;
 import kd.bos.print.service.BosPrintServiceHelper;
-import kd.bos.servicehelper.AttDto;
-import kd.bos.servicehelper.AttachmentServiceHelper;
-import kd.bos.servicehelper.BusinessDataServiceHelper;
 import kd.bos.servicehelper.print.NotePrintService;
 import kd.bos.servicehelper.print.NotePrintService;
 import kd.bos.session.EncreptSessionUtils;
 import kd.bos.session.EncreptSessionUtils;
 import kd.bos.url.UrlService;
 import kd.bos.url.UrlService;
-import kd.bos.util.FileNameUtils;
-import org.apache.commons.codec.binary.Base64;
+import kd.bos.util.ExceptionUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.IOUtils;
 
 
-import java.io.*;
-import java.net.URLEncoder;
-import java.util.*;
-
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.io.FilenameUtils;
-import kd.bos.dataentity.resource.ResManager;
-import kd.bos.exception.KDBizException;
-import kd.bos.print.api.PrintContext;
-import kd.bos.print.core.service.PrtAttach.AttachDetail;
-import kd.bos.util.ExceptionUtils;
 public class PrintPdfUtil {
 public class PrintPdfUtil {
     private static Log logger = LogFactory.getLog(PrintPdfUtil.class);
     private static Log logger = LogFactory.getLog(PrintPdfUtil.class);
 
 
@@ -174,5 +157,4 @@ public class PrintPdfUtil {
         } catch (Exception e) {
         } catch (Exception e) {
         }
         }
     }
     }
-
 }
 }

+ 15 - 6
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/common/util/ReceiveTicketUtils.java

@@ -107,7 +107,8 @@ public class ReceiveTicketUtils {
             }
             }
             return matcherTpls.iterator().next().getTplId();
             return matcherTpls.iterator().next().getTplId();
         }
         }
-        return null;
+
+        throw new KDBizException("单据没有匹配的打印模板。");
     }
     }
 
 
 
 
@@ -130,7 +131,9 @@ public class ReceiveTicketUtils {
         List<MergePrintEntity> mergePrintList = new ArrayList<>();
         List<MergePrintEntity> mergePrintList = new ArrayList<>();
         // 查询公司为空的打印配置
         // 查询公司为空的打印配置
         DynamicObject printSetConfig = getPrintSetConfig(companyId);
         DynamicObject printSetConfig = getPrintSetConfig(companyId);
-
+        if(printSetConfig == null){
+            throw new KDBizException("未找到公司配置的打印配置信息。");
+        }
         // 查询单据对应的分录
         // 查询单据对应的分录
         DynamicObjectCollection billEntryCol = printSetConfig.getDynamicObjectCollection(ErPrintSetConstant.BillPtSetEntry.ENTITYID);
         DynamicObjectCollection billEntryCol = printSetConfig.getDynamicObjectCollection(ErPrintSetConstant.BillPtSetEntry.ENTITYID);
         List<DynamicObject> billEntryList = billEntryCol.stream()
         List<DynamicObject> billEntryList = billEntryCol.stream()
@@ -175,8 +178,11 @@ public class ReceiveTicketUtils {
      * @return
      * @return
      */
      */
     public static DynamicObject getPrintSetConfig(Object companyId){
     public static DynamicObject getPrintSetConfig(Object companyId){
-        DynamicObjectCollection companyConfigCol = QueryServiceHelper.query(ErPrintSetConstant.ENTITYID, ErPrintSetConstant.ID,
-                new QFilter(ErPrintSetConstant.KEY_NCKD_ORG, QCP.equals, companyId).toArray());
+        DynamicObjectCollection companyConfigCol = QueryServiceHelper.query(ErPrintSetConstant.ENTITYID, ErPrintSetConstant.ID, new QFilter[]{
+                new QFilter(ErPrintSetConstant.KEY_NCKD_ORG, QCP.equals, companyId),
+                new QFilter(ErPrintSetConstant.KEY_STATUS, QCP.equals, "C"),
+                new QFilter(ErPrintSetConstant.KEY_ENABLE, QCP.equals, Boolean.TRUE)
+        });
         if(CollectionUtils.isNotEmpty(companyConfigCol)){
         if(CollectionUtils.isNotEmpty(companyConfigCol)){
 
 
             if(companyConfigCol.size() > 1){
             if(companyConfigCol.size() > 1){
@@ -184,8 +190,11 @@ public class ReceiveTicketUtils {
             }
             }
             return BusinessDataServiceHelper.loadSingle(companyConfigCol.get(0).get(ErPrintSetConstant.ID),ErPrintSetConstant.ENTITYID);
             return BusinessDataServiceHelper.loadSingle(companyConfigCol.get(0).get(ErPrintSetConstant.ID),ErPrintSetConstant.ENTITYID);
         }else{
         }else{
-            DynamicObjectCollection groupConfig = QueryServiceHelper.query(ErPrintSetConstant.ENTITYID, ErPrintSetConstant.ID,
-                    QFilter.isNull(ErPrintSetConstant.KEY_NCKD_ORG).toArray());
+            DynamicObjectCollection groupConfig = QueryServiceHelper.query(ErPrintSetConstant.ENTITYID, ErPrintSetConstant.ID,new QFilter[]{
+                    QFilter.isNull(ErPrintSetConstant.KEY_NCKD_ORG).or(new QFilter(ErPrintSetConstant.KEY_NCKD_ORG,QCP.equals,0L)),
+                    new QFilter(ErPrintSetConstant.KEY_STATUS, QCP.equals, "C"),
+                    new QFilter(ErPrintSetConstant.KEY_ENABLE, QCP.equals, Boolean.TRUE)
+            });
             if(CollectionUtils.isNotEmpty(groupConfig)){
             if(CollectionUtils.isNotEmpty(groupConfig)){
                 if(groupConfig.size() > 1){
                 if(groupConfig.size() > 1){
                     throw new KDBizException("存在多条全集团配置,请维护数据后再操作。");
                     throw new KDBizException("存在多条全集团配置,请维护数据后再操作。");

+ 112 - 2
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/form/HandInReceiveTicketPlugin.java

@@ -4,6 +4,8 @@ import com.kingdee.util.StringUtils;
 import kd.bos.algo.DataSet;
 import kd.bos.algo.DataSet;
 import kd.bos.bill.BillShowParameter;
 import kd.bos.bill.BillShowParameter;
 import kd.bos.bill.OperationStatus;
 import kd.bos.bill.OperationStatus;
+import kd.bos.cache.CacheFactory;
+import kd.bos.cache.TempFileCache;
 import kd.bos.context.RequestContext;
 import kd.bos.context.RequestContext;
 import kd.bos.dataentity.OperateOption;
 import kd.bos.dataentity.OperateOption;
 import kd.bos.dataentity.entity.DynamicObject;
 import kd.bos.dataentity.entity.DynamicObject;
@@ -28,14 +30,22 @@ import kd.bos.form.events.ClosedCallBackEvent;
 import kd.bos.form.events.PreOpenFormEventArgs;
 import kd.bos.form.events.PreOpenFormEventArgs;
 import kd.bos.form.operate.FormOperate;
 import kd.bos.form.operate.FormOperate;
 import kd.bos.form.plugin.AbstractFormPlugin;
 import kd.bos.form.plugin.AbstractFormPlugin;
+import kd.bos.image.pojo.ImageSysInfo;
+import kd.bos.image.pojo.ViewImageVo;
+import kd.bos.imageplatform.util.SSCImageUtils;
 import kd.bos.list.ListShowParameter;
 import kd.bos.list.ListShowParameter;
+import kd.bos.logging.Log;
+import kd.bos.logging.LogFactory;
 import kd.bos.orm.query.QCP;
 import kd.bos.orm.query.QCP;
 import kd.bos.orm.query.QFilter;
 import kd.bos.orm.query.QFilter;
 import kd.bos.servicehelper.BusinessDataServiceHelper;
 import kd.bos.servicehelper.BusinessDataServiceHelper;
+import kd.bos.servicehelper.PrintServiceHelper;
 import kd.bos.servicehelper.QueryServiceHelper;
 import kd.bos.servicehelper.QueryServiceHelper;
+import kd.bos.servicehelper.image.ImageServiceNewHelper;
 import kd.bos.servicehelper.operation.OperationServiceHelper;
 import kd.bos.servicehelper.operation.OperationServiceHelper;
 import kd.bos.servicehelper.operation.SaveServiceHelper;
 import kd.bos.servicehelper.operation.SaveServiceHelper;
 import kd.bos.servicehelper.permission.PermissionServiceHelper;
 import kd.bos.servicehelper.permission.PermissionServiceHelper;
+import kd.bos.url.UrlService;
 import kd.bos.util.CollectionUtils;
 import kd.bos.util.CollectionUtils;
 import nckd.jimin.jyyy.fi.common.constant.BillTypeConstants;
 import nckd.jimin.jyyy.fi.common.constant.BillTypeConstants;
 import nckd.jimin.jyyy.fi.common.constant.ErPrintUserConstant;
 import nckd.jimin.jyyy.fi.common.constant.ErPrintUserConstant;
@@ -45,11 +55,15 @@ import nckd.jimin.jyyy.fi.common.entity.MergePrintEntity;
 import nckd.jimin.jyyy.fi.common.util.ErFindRelationBillUtils;
 import nckd.jimin.jyyy.fi.common.util.ErFindRelationBillUtils;
 import nckd.jimin.jyyy.fi.common.util.ReceiveTicketUtils;
 import nckd.jimin.jyyy.fi.common.util.ReceiveTicketUtils;
 
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements RowClickEventListener {
 public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements RowClickEventListener {
 
 
+    private static Log log = LogFactory.getLog(HandInReceiveTicketPlugin.class);
+
     private static final String CLOSECALLBACK_MAIL = "closecallback_mail";
     private static final String CLOSECALLBACK_MAIL = "closecallback_mail";
 
 
     @Override
     @Override
@@ -186,7 +200,8 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
         String itemKey = evt.getItemKey();
         String itemKey = evt.getItemKey();
 
 
         if(HandInReceiveTicketConstant.OPERATE.NCKD_MAIL.equals(itemKey) || HandInReceiveTicketConstant.OPERATE.NCKD_CANCELMAIN.equals(itemKey)
         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)){
+            || HandInReceiveTicketConstant.OPERATE.NCKD_VIEW_VOUCHER.equals(itemKey) || HandInReceiveTicketConstant.OPERATE.NCKD_VIEW_ELECRECEIPT.equals(itemKey)
+            || HandInReceiveTicketConstant.OPERATE.NCKD_IMAGEPREVIEW.equals(itemKey)){
             String checkMsg = checkSelectSingle();
             String checkMsg = checkSelectSingle();
             if(!StringUtils.isEmpty(checkMsg)) {
             if(!StringUtils.isEmpty(checkMsg)) {
                 getView().showTipNotification(checkMsg);
                 getView().showTipNotification(checkMsg);
@@ -202,6 +217,9 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
             case HandInReceiveTicketConstant.OPERATE.NCKD_CANCELMAIN:
             case HandInReceiveTicketConstant.OPERATE.NCKD_CANCELMAIN:
                 beforeCancleMail(evt);
                 beforeCancleMail(evt);
                 break;
                 break;
+            case HandInReceiveTicketConstant.OPERATE.NCKD_IMAGEPREVIEW:
+                beforeImagePreview(evt);
+                break;
         }
         }
     }
     }
 
 
@@ -230,6 +248,11 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
 
 
     }
     }
 
 
+    protected void beforeImagePreview(BeforeItemClickEvent evt){
+        // 进行权限校验
+
+    }
+
 
 
     @Override
     @Override
     public void itemClick(ItemClickEvent evt) {
     public void itemClick(ItemClickEvent evt) {
@@ -252,7 +275,52 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
             case HandInReceiveTicketConstant.OPERATE.NCKD_REFRESH:
             case HandInReceiveTicketConstant.OPERATE.NCKD_REFRESH:
                 doRefresh();
                 doRefresh();
                 break;
                 break;
+            case HandInReceiveTicketConstant.OPERATE.NCKD_IMAGEPREVIEW:
+                doImagePreview();
+                break;
+        }
+    }
+
+    protected void doImagePreview(){
+        String userID = String.valueOf(RequestContext.get().getUserId());
+        String userName = String.valueOf(RequestContext.get().getUserName());
+
+        ImageSysInfo enableImageSysInfo = null;
+        DynamicObject selectBillInfo = getSelectBillInfo(String.join(",",ErReimBurseBillConstant.ID,ErReimBurseBillConstant.KEY_NUMBER));
+        String billType = selectBillInfo.getDataEntityType().getName();
+        try {
+            enableImageSysInfo = SSCImageUtils.getEnableImageSysInfo();
+        } catch (Exception e) {
+            log.error("获取影像系统异常:" + e.getMessage());
+        }
+        String imageSys;
+        if (enableImageSysInfo == null) {
+            imageSys = ResManager.loadKDString("无启用的影像系统配置,请联系系统管理员。", "ImageReview_0", "bos-image-formplugin", new Object[0]);
+            getView().showTipNotification(imageSys);
+            return;
+        }
+
+        imageSys = enableImageSysInfo.getNumber();
+        log.info("获取到的imagesys:{}" , imageSys);
+        ViewImageVo viewImageVo = new ViewImageVo();
+        viewImageVo.setBillId(selectBillInfo.getString(ErReimBurseBillConstant.ID));
+        viewImageVo.setUserId(userID);
+        viewImageVo.setUserName(userName);
+        viewImageVo.setMobile(false);
+        viewImageVo.setBilltype(billType);
+        viewImageVo.setImageSys(imageSys);
+        viewImageVo = ImageServiceNewHelper.viewPhoto(viewImageVo);
+        if (viewImageVo.getUrl() == null) {
+            getView().showTipNotification(viewImageVo.getMessage());
+            return;
+        }
+        String url = viewImageVo.getUrl();
+        String message = viewImageVo.getMessage();
+        if (kd.bos.util.StringUtils.isNotEmpty(message)) {
+            getView().showMessage(message);
+            return;
         }
         }
+        getView().openUrl(url);
     }
     }
 
 
     protected void doViewVouhcer(){
     protected void doViewVouhcer(){
@@ -302,9 +370,39 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
     }
     }
 
 
     protected void doViewElecReceipt(){
     protected void doViewElecReceipt(){
+        DynamicObject selectRow = getSelectRows().get(0);
+
+        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("");
+            return;
+        }
+        List<byte[]> mergeArray = new ArrayList<>();
+        Set<Object> elecReceiptIdSet = relationBelowBillMap.get(BillTypeConstants.BEI_ELECRECEIPT);
+        for(Object elecReceiptId : elecReceiptIdSet){
+            byte[] bytes = ReceiveTicketUtils.getElecReceiptPrintUrl(elecReceiptId);
+            mergeArray.add(bytes);
+        }
 
 
+        byte[] bytes = PrintServiceHelper.mergeMultiPdf(mergeArray);//拼接文件流
+
+        String fileName = String.format("单据%s电子回单文件文件预览");
+        TempFileCache tfc = CacheFactory.getCommonCacheFactory().getTempFileCache();
+        // 设置临时文件有效时间
+        String tempUrl = tfc.saveAsFullUrl(fileName + ".pdf", bytes, 60 * 60 * 2);//文件流生成临时文件
+        String url = null;
+        try {
+            url = URLEncoder.encode(tempUrl, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        String previewurl = UrlService.getAttachmentPreviewUrl(url);
+        getView().openUrl(previewurl);
     }
     }
 
 
+
+
     protected void doRefresh(){
     protected void doRefresh(){
 
 
         int entryRowCount = getModel().getEntryRowCount(HandInReceiveTicketConstant.SCANBILLENTRY.ENTITYID);
         int entryRowCount = getModel().getEntryRowCount(HandInReceiveTicketConstant.SCANBILLENTRY.ENTITYID);
@@ -356,10 +454,21 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
                     args.setCancel(true);
                     args.setCancel(true);
                     return;
                     return;
                 }
                 }
+                beforeDoPrint(args);
                 break;
                 break;
         }
         }
     }
     }
 
 
+    protected void beforeDoPrint(BeforeDoOperationEventArgs args){
+        DynamicObject billInfo = getSelectBillInfo(ErReimBurseBillConstant.KEY_BILLSTATUS);
+        List<String> status = Arrays.asList("E", "F", "G");
+        if(!status.contains(billInfo.getString(ErReimBurseBillConstant.KEY_BILLSTATUS))){
+            getView().showTipNotification(String.format("单据%s打印失败:只有审核通过、等待付款、已付款状态的单据允许打印。",billInfo.getString(ErReimBurseBillConstant.KEY_BILLNO)));
+            args.setCancel(true);
+            return;
+        }
+    }
+
     @Override
     @Override
     public void afterDoOperation(AfterDoOperationEventArgs args) {
     public void afterDoOperation(AfterDoOperationEventArgs args) {
         super.afterDoOperation(args);
         super.afterDoOperation(args);
@@ -426,10 +535,11 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
         String billId = selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_BILLID);
         String billId = selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_BILLID);
 
 
         // 通过打印配置获取单据打印信息
         // 通过打印配置获取单据打印信息
-        List<MergePrintEntity> printPdfConfig = ReceiveTicketUtils.getPrintPdfConfig(formId,billId,companyId);
+        List<MergePrintEntity> printPdfConfig = ReceiveTicketUtils.getPrintPdfConfig(formId,Long.valueOf(billId),companyId);
         String printFileName = String.format("%s报销信息打印",selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_NUMBER));
         String printFileName = String.format("%s报销信息打印",selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_NUMBER));
         String downloadUrl = ReceiveTicketUtils.mergePrintPdf(getView(), printPdfConfig, printFileName);
         String downloadUrl = ReceiveTicketUtils.mergePrintPdf(getView(), printPdfConfig, printFileName);
         getView().download(downloadUrl);
         getView().download(downloadUrl);
+        getView().showSuccessNotification("打印成功。");
     }
     }
 
 
     protected void reloadEntryRow(int[] indexArray){
     protected void reloadEntryRow(int[] indexArray){

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

@@ -38,13 +38,13 @@ public class ErPrintSetOp extends AbstractOperationServicePlugIn {
                     for(DynamicObject entry : entryCol){
                     for(DynamicObject entry : entryCol){
                         if(entry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_ISPTCOVER)
                         if(entry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_ISPTCOVER)
                                 && entry.getLong(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_COVERORDER) == 0L){
                                 && entry.getLong(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_COVERORDER) == 0L){
-                            this.addErrorMessage(data, String.format("%s行单据封面顺序不允许为空。",entry.getString("seq")));
+                            this.addErrorMessage(data, String.format("%s行单据封面顺序不允许为空。",entry.getString("seq")));
                         }
                         }
-                        if(entry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_VOUCHERORDER)
+                        if(entry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_ISPTVOUCHER)
                                 && entry.getLong(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_VOUCHERORDER) == 0L){
                                 && entry.getLong(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_VOUCHERORDER) == 0L){
                             this.addErrorMessage(data, String.format("第%s行凭证打印顺序不允许为空。",entry.getString("seq")));
                             this.addErrorMessage(data, String.format("第%s行凭证打印顺序不允许为空。",entry.getString("seq")));
                         }
                         }
-                        if(entry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_RECEIPTORDER)
+                        if(entry.getBoolean(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_ISPTRECEIPT)
                                 && entry.getLong(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_RECEIPTORDER) == 0L){
                                 && entry.getLong(ErPrintSetConstant.BillPtSetEntry.KEY_NCKD_RECEIPTORDER) == 0L){
                             this.addErrorMessage(data, String.format("第%s行电子回单顺序不允许为空。",entry.getString("seq")));
                             this.addErrorMessage(data, String.format("第%s行电子回单顺序不允许为空。",entry.getString("seq")));
                         }
                         }

+ 71 - 0
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/operate/validator/ReimBurseBillReceiveTicketValidator.java

@@ -0,0 +1,71 @@
+package nckd.jimin.jyyy.fi.plugin.operate.validator;
+
+import kd.bos.context.RequestContext;
+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.validate.AbstractValidator;
+import kd.bos.orm.query.QCP;
+import kd.bos.orm.query.QFilter;
+import kd.bos.servicehelper.QueryServiceHelper;
+import kd.bos.util.StringUtils;
+import nckd.jimin.jyyy.fi.common.constant.ErPrintUserConstant;
+import nckd.jimin.jyyy.fi.common.constant.ErReimBurseBillConstant;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class ReimBurseBillReceiveTicketValidator extends AbstractValidator {
+    @Override
+    public void validate() {
+        ExtendedDataEntity[] dataEntities = getDataEntities();
+        String operateKey = getOperateKey();
+        switch (operateKey){
+            case ErReimBurseBillConstant.OPERATE.HANDIN_TICKET:
+                Arrays.stream(dataEntities).forEach(r -> checkHandinTicket(r));
+                break;
+            case ErReimBurseBillConstant.OPERATE.RECEIVE_TICKET:
+                Arrays.stream(dataEntities).forEach(r -> checkReceiptTicket(r));
+                break;
+        }
+
+    }
+
+    protected void checkHandinTicket(ExtendedDataEntity dataEntity){
+        // 单据状态为已审核
+        DynamicObject billInfo = dataEntity.getDataEntity();
+        List<String> status = Arrays.asList("E", "F", "G");
+        if(!status.contains(billInfo.getString(ErReimBurseBillConstant.KEY_BILLSTATUS))){
+            this.addErrorMessage(dataEntity, String.format("单据%s交票失败:只有审核通过、等待付款、已付款状态的单据允许交票。",billInfo.getString(ErReimBurseBillConstant.KEY_BILLNO)));
+            return;
+        }
+
+        //收票人为空
+        if(StringUtils.isNotEmpty(billInfo.getString(ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON))){
+            this.addErrorMessage(dataEntity, String.format("单据%s交票失败:不允许重复交票。",billInfo.getString(ErReimBurseBillConstant.KEY_BILLNO)));
+            return;
+        }
+    }
+    protected void checkReceiptTicket(ExtendedDataEntity dataEntity){
+        DynamicObject billInfo = dataEntity.getDataEntity();
+
+        // 收票人不能为空
+        if(StringUtils.isEmpty(billInfo.getString(ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON))){
+            this.addErrorMessage(dataEntity, String.format("单据%s收票失败:请先完成交票功能",billInfo.getString(ErReimBurseBillConstant.KEY_BILLNO)));
+            return;
+        }
+
+        if(StringUtils.isNotEmpty(billInfo.getString(ErReimBurseBillConstant.KEY_NCKD_RECEIPT_PERSON))){
+            this.addErrorMessage(dataEntity, String.format("单据%s收票失败:单据不允许重复收票。",billInfo.getString(ErReimBurseBillConstant.KEY_BILLNO)));
+            return;
+        }
+
+        List<String> status = Arrays.asList("E", "F", "G");
+        if(!status.contains(billInfo.getString(ErReimBurseBillConstant.KEY_BILLSTATUS))){
+            this.addErrorMessage(dataEntity, String.format("单据%s收票失败:只有审核通过、等待付款、已付款状态的单据允许收票。",billInfo.getString(ErReimBurseBillConstant.KEY_BILLNO)));
+            return;
+        }
+
+    }
+}