Przeglądaj źródła

非税审核生成并保存缴费通知单

xy 6 dni temu
rodzic
commit
eec25cc1d3

+ 17 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/taskordernontaxrecord/TaskOrderNonTaxRecordServiceImpl.java

@@ -423,6 +423,16 @@ public class TaskOrderNonTaxRecordServiceImpl extends ServiceImpl<TaskOrderNonTa
         if (status == BpmTaskStatusEnum.APPROVE.getStatus().intValue()) {
             String payNoticeNo = financialSystemService.getPayNoticeNo();
             updateObj.setPaymentInstructionNo(payNoticeNo);
+            try {
+                //生成缴费通知书
+                ByteArrayOutputStream outputStream = this.getRecordOutputStream(id);
+                if (outputStream != null){
+                    String attachmentPath = fileApi.createFile(outputStream.toByteArray());
+                    updateObj.setNoticePdfUrl(attachmentPath);
+                }
+            } catch (Exception e) {
+                log.error("e:{}", e.getMessage());
+            }
         }
         taskOrderNonTaxRecordMapper.updateById(updateObj);
 
@@ -556,6 +566,13 @@ public class TaskOrderNonTaxRecordServiceImpl extends ServiceImpl<TaskOrderNonTa
             throw new ServiceException(902, "未找到非税记录表单模板");
         }
 
+        if (taskOrderNonTaxRecordDO.getNoticePdfUrl() != null){
+            byte[] bytes = fileApi.getFileByPath(taskOrderNonTaxRecordDO.getNoticePdfUrl()).getCheckedData();
+            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+            byteArrayOutputStream.write(bytes);
+            return byteArrayOutputStream;
+        }
+
         TaskOrderNonTaxReportDO reportDO = taskOrderNonTaxReportMapper.selectOne(new LambdaQueryWrapperX<TaskOrderNonTaxReportDO>()
                 .eq(TaskOrderNonTaxReportDO::getNonTaxRecordId, taskOrderNonTaxRecordDO.getId()), false);
         String instanceId = "";