Browse Source

Merge remote-tracking branch 'origin/dev1.0' into dev1.0

liutao 8 months ago
parent
commit
dd6f0c2f2f

+ 7 - 2
src/main/java/com/sunxung/factoring/service/project/impl/BusinessProcessingTaskServiceImpl.java

@@ -202,6 +202,7 @@ public class BusinessProcessingTaskServiceImpl implements BusinessProcessingTask
 
     @Override
     public GridPage<BusinessProcessingTaskVo> findMyPendingList(SearchBusinessProcessingTask search) {
+
         if (null == search || StringUtil.isEmpty(search.getSimpleClassName())) {
             throw new ValidatorException(CodeUtil.FAIL, "列表分页条件不能为空!");
         }
@@ -355,8 +356,12 @@ public class BusinessProcessingTaskServiceImpl implements BusinessProcessingTask
                     if (processingLog.getTaskName().equals("法务审核") || processingLog.getTaskName().equals("单价变更审核")) {
                         taskVo.setAssigneeName("法务专员");
                     } else {
-                        Long userId = assigneeService.getIdByBusiness(processingLog.getBusnessKey(), ConstantUtil.ACCEPTANCE_SHEET, ConstantUtil.ASSIGNEE_PROJECT_MANAGER);
-                        taskVo.setAssigneeName(userService.get(userId).getName());
+                         if(taskVo.getAssignee()!=null){
+                             taskVo.setAssigneeName(taskVo.getAssignee().getName());
+                         }else{
+                             Long userId = assigneeService.getIdByBusiness(processingLog.getBusnessKey(), ConstantUtil.ACCEPTANCE_SHEET, ConstantUtil.ASSIGNEE_PROJECT_MANAGER);
+                             taskVo.setAssigneeName(userService.get(userId).getName());
+                         }
                     }
                 }
             }

+ 1 - 1
src/main/java/com/sunxung/factoring/service/settlement/SettlementManagementService.java

@@ -122,7 +122,7 @@ public interface SettlementManagementService {
      * @param res
      * @return
      */
-    ResponseEntity<Object> downloadReport(Long settlementBasicInfoId, HttpServletResponse res);
+    void downloadReport(Long settlementBasicInfoId, HttpServletResponse res);
 
     void doSignCallBackByQuery(String contractId, String[] fdds);
 

+ 1 - 1
src/main/java/com/sunxung/factoring/service/settlement/impl/SettlementBasicInfoServiceImpl.java

@@ -98,7 +98,7 @@ public class SettlementBasicInfoServiceImpl extends ServiceImpl<SettlementBasicI
         if (settlementBasicInfo.getStatus() != null && settlementBasicInfo.getStatus().getCode().equals(ProjectInitiationStatusDict.ChildEnum.COMPLETED.getCode())){
             //状态已签署 下载签署文件
             //上游签署文件
-            List<FileStorage> upstreamSignedFile = sysAttachmentRefService.getFiles(AttachmentDto.builder()
+            List<FileStorage> upstreamSignedFile = sysAttachmentRefService.getCfiles(AttachmentDto.builder()
                     .setChildEnum(FileModuleDict.ChildEnum.SETTLEMENT_UPSTREAM_SIGNED_FILE).setEntityId(id).build());
             settlementAllFiles.add(upstreamSignedFile.get(0));
         }else {

+ 2 - 3
src/main/java/com/sunxung/factoring/service/settlement/impl/SettlementManagementServiceImpl.java

@@ -646,10 +646,9 @@ public class SettlementManagementServiceImpl implements SettlementManagementServ
     }
 
     @Override
-    public ResponseEntity<Object> downloadReport(Long settlementBasicInfoId, HttpServletResponse res) {
+    public void downloadReport(Long settlementBasicInfoId, HttpServletResponse res) {
         List<FileStorageDO> fileStorageDOList = fileService.findByBusinessId(settlementBasicInfoId, FileModuleDict.ChildEnum.SETTLEMENT_CONTRACT_REPORT.getCode());
-
-        return fileService.downloadFile(fileStorageDOList.get(0).getId());
+        fileService.downloadFile(fileStorageDOList.get(0).getId(),res);
     }
 
     @Override

+ 1 - 1
src/main/java/com/sunxung/factoring/service/sys/FileService.java

@@ -29,5 +29,5 @@ public interface FileService extends IService<FileStorageDO> {
      */
     void delete(Long id);
 
-    ResponseEntity<Object> downloadFile(Long id);
+    ResponseEntity<Object> downloadFile(Long id,HttpServletResponse res);
 }

+ 23 - 25
src/main/java/com/sunxung/factoring/service/sys/impl/FileServiceImpl.java

@@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
+import java.net.URLEncoder;
 import java.util.List;
 
 @Service
@@ -208,37 +209,34 @@ public class FileServiceImpl extends ServiceImpl<FileStorageDAO,FileStorageDO> i
     }
 
     @Override
-    public ResponseEntity<Object> downloadFile(Long id) {
+    public ResponseEntity<Object> downloadFile(Long id,HttpServletResponse res) {
         FileStorageDO fileStorage = this.getById(id);
         if (fileStorage != null) {
             String fileName = fileStorage.getOriginalName();
-            String fileNameEncodeStr = "null";
-            try {
-                fileNameEncodeStr = java.net.URLEncoder.encode(fileName, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                fileNameEncodeStr = "";
-            }
             String path = fileStorage.getAbsolutePath();
             File file = new File(path);
-
             try {
-                InputStreamResource resource = new InputStreamResource(new FileInputStream(file));
-
-                HttpHeaders headers = new HttpHeaders();
-//                headers.add("Content-Disposition", "attachment; filename=" + fileNameEncodeStr);
-//                headers.add("Cache-Control", "no-cache,no-store,must-revalidate");
-                headers.add("Content-Disposition", "attachment;filename=" + fileNameEncodeStr);
-                headers.add("Access-Control-Expose-Headers", "Content-Disposition");
-                headers.add("Pragma", "no-cache");
-                headers.add("Expires", "0");
-
-                ResponseEntity<Object> responseEntity = ResponseEntity.ok()
-                        .headers(headers)
-                        .contentLength(file.length())
-                        .contentType(MediaType.APPLICATION_OCTET_STREAM)
-                        .body(resource);
-                return responseEntity;
-            } catch (FileNotFoundException e) {
+                if (file.exists()) {
+                    fileName = new String(fileName.getBytes("UTF-8"));
+                    String basePath = file.getAbsolutePath();
+                    InputStream in = new FileInputStream(new File(basePath));
+                    fileName = URLEncoder.encode(fileName, "UTF-8");
+//                res.setHeader("content-disposition", "attachment;filename=" + fileName);
+//                res.setHeader("Content-Type", "application/vnd.ms-exce");
+                    res.setHeader("Content-Disposition", "attachment;filename=" + fileName);
+                    res.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
+                    OutputStream out = res.getOutputStream();
+                    byte[] b = new byte[1024];
+                    int len = -1;
+                    while ((len = in.read(b)) != -1) {
+                        out.write(b, 0, len);
+                        out.flush();
+                    }
+                    // 关闭
+                    in.close();
+                    out.close();
+                }
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }

+ 2 - 2
src/main/java/com/sunxung/factoring/web/settlement/SettlementController.java

@@ -368,8 +368,8 @@ public class SettlementController {
     @RequestMapping("download/report")
     @ResponseBody
     @OperationLog(operationModule = "结算单",operationType = OperationTypeEnum.OTHER,description = "下载结算单出证")
-    public ResponseEntity<Object> downloadReport(Long id, HttpServletResponse res) {
-        return settlementManagementService.downloadReport(id, res);
+    public void downloadReport(Long id, HttpServletResponse res) {
+         settlementManagementService.downloadReport(id, res);
     }
 
     /**

+ 1 - 1
src/main/java/com/sunxung/factoring/web/sys/FileStorageController.java

@@ -62,7 +62,7 @@ public class FileStorageController {
             // String doMain = "http://127.0.0.1:" + port + "/";
             System.out.println(httpImgPath);
             rs.put("state", "SUCCESS");// UEDITOR的规则:不为SUCCESS则显示state的内容
-            rs.put("url", getPrefix(req) + "/" + httpImgPath); // 能访问到你现在图片的路径
+            rs.put("url", getPrefix(req) + httpImgPath); // 能访问到你现在图片的路径
             rs.put("title", "111");
             rs.put("original", "222");
         } catch (Exception e) {

+ 16 - 0
src/main/resources/data/update/v1.0/liujia.sql

@@ -1181,6 +1181,22 @@ CREATE TABLE `electronic_person_info` (
         PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='个人电子签信息表';
 
+-- 合同管理-合同签署确认表
+DROP TABLE IF EXISTS `contract_sign_confirm`;
+CREATE TABLE `contract_sign_confirm` (
+        `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+        `contract_info_id` bigint(20) unsigned DEFAULT '0' COMMENT '合同基础ID',
+        `assignee_id` bigint(20) unsigned DEFAULT '0' COMMENT '处理人ID',
+        `visible` tinyint(3) unsigned DEFAULT '0' COMMENT '是否显示,默认0表示否',
+        `conclusion` varchar(50) DEFAULT '' COMMENT '结论',
+        `remark` varchar(3000) DEFAULT '' COMMENT '备注',
+        `user_create` varchar(50) DEFAULT '' COMMENT '创建人',
+        `user_modified` varchar(50) DEFAULT '' COMMENT '修改人',
+        `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+        `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+        PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='合同签署确认表';
+
 
 -- 分账管理-基本信息表
 DROP TABLE IF EXISTS `ledger_account_basic_info`;