瀏覽代碼

附件上传修改

wangqiang 1 年之前
父節點
當前提交
6e3f9dd652

+ 1 - 1
jeeplus-api/jeeplus-public-modules-api/src/main/java/com/jeeplus/sys/factory/WorkAttachmentApiFallbackFactory.java

@@ -53,7 +53,7 @@ public class WorkAttachmentApiFallbackFactory implements FallbackFactory <IWorkA
             }
 
             @Override
-            public void saveOrUpdateFileListFlag(List<WorkAttachmentInfoDTO> fileList, String attachmentId, String attachmentFlag,String currentToken) {
+            public void saveOrUpdateFileListFlag(Map<String, String> map) {
 
             }
 

+ 2 - 7
jeeplus-api/jeeplus-public-modules-api/src/main/java/com/jeeplus/sys/feign/IWorkAttachmentApi.java

@@ -54,15 +54,10 @@ public interface IWorkAttachmentApi {
 
     /**
      * 保存/修改附件
-     * @param fileList
-     * @param attachmentId
-     * @param attachmentFlag
+     * @param map
      */
     @RequestMapping(value = "/oss/file/saveOrUpdateFileListFlag", method = RequestMethod.POST)
-    void saveOrUpdateFileListFlag(@RequestParam(value = "fileList")List<WorkAttachmentInfoDTO> fileList,
-                                  @RequestParam(value = "attachmentId")String attachmentId,
-                                  @RequestParam(value = "attachmentFlag")String attachmentFlag,
-                                  @RequestParam(value = "currentToken")String currentToken);
+    void saveOrUpdateFileListFlag(@RequestBody Map<String ,String > map);
 
     /**
      * 保存附件信息

+ 1 - 1
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProjectListMapper.xml

@@ -51,7 +51,7 @@
            <if test="dto.clientName != null and dto.clientName != ''">
                AND a.client_name LIKE CONCAT ('%', #{dto.clientName}, '%')
            </if>
-            ORDER BY a.create_by_id DESC
+            ORDER BY a.create_time DESC
    </select>
 
     <update id="updateStatusById">

+ 29 - 5
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/service/ProjectListService.java

@@ -280,11 +280,35 @@ public class ProjectListService {
         }
         String currentToken = TokenProvider.getCurrentToken();
         if (ObjectUtil.isNotEmpty(programArchiveDto)) {
-            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(programArchiveDto.getReportFileList(),programArchive.getId(),"report",currentToken);
-            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(programArchiveDto.getDetailFileList(),programArchive.getId(),"detail",currentToken);
-            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(programArchiveDto.getExplainFileList(),programArchive.getId(),"explain",currentToken);
-            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(programArchiveDto.getPapersFileList(),programArchive.getId(),"papers",currentToken);
-            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(programArchiveDto.getOtherFileList(),programArchive.getId(),"other",currentToken);
+            Map<String,String> map = new HashMap<>();
+            String fileList = JSON.toJSONString((programArchiveDto.getReportFileList()));
+            String attachmentId = programArchive.getId();
+            String attachmentFlag = "report";
+            map.put("fileList",fileList);
+            map.put("attachmentId",attachmentId);
+            map.put("attachmentFlag",attachmentFlag);
+            map.put("currentToken", TokenProvider.getCurrentToken ( ));
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(map);
+            fileList = JSON.toJSONString((programArchiveDto.getDetailFileList()));
+            attachmentFlag = "detail";
+            map.put("fileList",fileList);
+            map.put("attachmentFlag",attachmentFlag);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(map);
+            fileList = JSON.toJSONString((programArchiveDto.getExplainFileList()));
+            attachmentFlag = "explain";
+            map.put("fileList",fileList);
+            map.put("attachmentFlag",attachmentFlag);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(map);
+            fileList = JSON.toJSONString((programArchiveDto.getPapersFileList()));
+            attachmentFlag = "papers";
+            map.put("fileList",fileList);
+            map.put("attachmentFlag",attachmentFlag);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(map);
+            fileList = JSON.toJSONString((programArchiveDto.getOtherFileList()));
+            attachmentFlag = "other";
+            map.put("fileList",fileList);
+            map.put("attachmentFlag",attachmentFlag);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileListFlag(map);
         }
         return programArchive.getId();
     }

+ 1 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/workClientInfo/mapper/xml/WorkClientInfoMapper.xml

@@ -91,6 +91,7 @@
 			a.client_type,
 			a.credit_rank,
 			b.`name` AS area_id,
+			b.`name` AS areaName,
 			a.zip_code,
 			a.fax,
 			a.tax_id,

+ 4 - 3
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/workContract/service/WorkContractService.java

@@ -149,9 +149,10 @@ public class WorkContractService {
         info.setUpdateTime(new Date());
         workContractInfoMapper.updateById(info);
         List<WorkAttachmentInfo> list = workContractInfoDto.getWorkAttachmentList();
-        if (CollectionUtil.isNotEmpty(list)) {
-            updateFiles(list, userDTO, workContractInfoDto.getId());
-        }
+//        if (CollectionUtil.isNotEmpty(list)) {
+//            updateFiles(list, userDTO, workContractInfoDto.getId());
+//        }
+        updateFiles(list, userDTO, workContractInfoDto.getId());
         return workContractInfoDto.getId();
     }
 

+ 8 - 4
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/oss/controller/OssFileController.java

@@ -279,10 +279,14 @@ public class OssFileController {
         ossService.saveOrUpdateFileList(fileList,attachmentId,attachmentFlag,currentToken);
     }
 
-    @GetMapping("/saveOrUpdateFileListFlag")
-    @ApiOperation(value = "根据attachmentId删除附件")
-    public void saveOrUpdateFileListFlag(List<WorkAttachmentInfoDTO> fileList, String attachmentId, String attachmentFlag) {
-        ossService.saveOrUpdateFileListFlag(fileList,attachmentId,attachmentFlag);
+    @RequestMapping(value = "saveOrUpdateFileListFlag", method = RequestMethod.POST)
+    public void saveOrUpdateFileListFlag(@RequestBody Map<String ,String > map) {
+        String fileListInfo = map.get("fileList");
+        String attachmentId = map.get("attachmentId");
+        String attachmentFlag = map.get("attachmentFlag");
+        String currentToken = map.get("currentToken");
+        List<WorkAttachmentInfoDTO> fileList = JSON.parseObject(fileListInfo, new TypeReference<List<WorkAttachmentInfoDTO>>() {});
+        ossService.saveOrUpdateFileListFlag(fileList,attachmentId,attachmentFlag,currentToken);
     }
 
 

+ 1 - 1
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/oss/feign/WorkAttachmentApiImpl.java

@@ -50,7 +50,7 @@ public class WorkAttachmentApiImpl implements IWorkAttachmentApi {
     }
 
     @Override
-    public void saveOrUpdateFileListFlag(List<WorkAttachmentInfoDTO> fileList, String attachmentId, String attachmentFlag,String currentToken) {
+    public void saveOrUpdateFileListFlag(Map<String, String> map) {
 
     }
 

+ 4 - 4
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/oss/service/OssService.java

@@ -365,12 +365,12 @@ public class OssService extends ServiceImpl<OssServiceMapper, WorkAttachment> {
      * @param attachmentId 附件的attachmentId
      * @param attachmentFlag 附件的attachmentFlag
      */
-    public void saveOrUpdateFileListFlag(List<WorkAttachmentInfoDTO> fileList, String attachmentId, String attachmentFlag){
+    public void saveOrUpdateFileListFlag(List<WorkAttachmentInfoDTO> fileList, String attachmentId, String attachmentFlag,String currentToken){
 
-        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
-        String bearerToken = authentication.getCredentials().toString();
+//        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
+//        String bearerToken = authentication.getCredentials().toString();
 
-        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken (bearerToken);
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken (currentToken);
         if (CollectionUtil.isNotEmpty(fileList)) {
             List<String> ids = fileList.stream().filter(item -> {
                 if (StringUtils.isNotBlank(item.getId())) {