فهرست منبع

评估项目导出调整以及兴光会计盖章文件不展示处理

user5 2 سال پیش
والد
کامیت
cf166e18a6

+ 2 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java

@@ -324,7 +324,7 @@ public class CwProjectReportSignatureCallBackController {
                     workattachment.setUrl(filepath);
                     workattachment.setType(substring);
                     workattachment.setAttachmentName(newFileName);
-                    workattachment.setAttachmentFlag("cw_project_report_file");
+                    workattachment.setAttachmentFlag("cw_project_report_file_signature");
                     workattachment.setFileSize(String.valueOf(f.length()));
                     workattachment.setAttachmentId(projectReportData.getId());
                     workattachment.setAttachmentType("");
@@ -334,7 +334,7 @@ public class CwProjectReportSignatureCallBackController {
                     workattachment.setUpdateDate(new Date());
                     //先查询数据库中是否已经对数据进行保存
                     //若未保存,则进行保存,否则直接跳过
-                    List<WorkAttachment> byAttachmentIdAndUrl = ossServiceMapper.getByAttachmentIdAndUrl(workattachment);
+                    List<WorkAttachment> byAttachmentIdAndUrl = ossServiceMapper.getByAttachmentIdAndUrlAndAttachmentFlag(workattachment);
                     if(byAttachmentIdAndUrl.size() == 0){
                         ossServiceMapper.insert(workattachment);
 

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/mapper/OssServiceMapper.java

@@ -26,5 +26,5 @@ public interface OssServiceMapper extends BaseMapper<WorkAttachment> {
      * @param workAttachment
      * @return
      */
-    List<WorkAttachment> getByAttachmentIdAndUrl(WorkAttachment workAttachment);
+    List<WorkAttachment> getByAttachmentIdAndUrlAndAttachmentFlag(WorkAttachment workAttachment);
 }

+ 4 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/mapper/xml/OssServiceMapper.xml

@@ -74,7 +74,7 @@
             )
     </insert>
 
-    <select id="getByAttachmentIdAndUrl" resultType="com.jeeplus.test.oss.domain.WorkAttachment">
+    <select id="getByAttachmentIdAndUrlAndAttachmentFlag" resultType="com.jeeplus.test.oss.domain.WorkAttachment">
         SELECT a.id, a.url, a.type, a.attachment_id, a.attachment_name, a.attachment_flag,
         a.module_type, a.attachment_type, a.file_size, a.sort, a.description,
         a.create_date, a.create_by as "create_by.id", su.name as "createBy.name" , a.update_date, a.update_by as "updateBy.id", a.del_flag
@@ -88,6 +88,9 @@
              <if test="attachmentName != null and attachmentName != ''">
                  and a.attachment_name = #{attachmentName}
              </if>
+             <if test="attachmentFlag != null and attachmentFlag != ''">
+                 and a.attachment_flag = #{attachmentFlag}
+             </if>
          </where>
     </select>
 </mapper>

+ 28 - 16
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/controller/ProjectListController.java

@@ -6,6 +6,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
+import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.test.finance.invoice.service.dto.FinanceInvoiceDTO;
 import com.jeeplus.test.utils.FreemarkerUtil;
 import freemarker.template.Configuration;
 import freemarker.template.Template;
@@ -33,9 +37,11 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 @Api(tags ="项目列表管理")
 @RestController
@@ -244,27 +250,33 @@ public class ProjectListController {
         return ResponseEntity.ok (list);
     }
 
-    /**
-     * 导出
-     *
-     * @param response
-     * @throws Exception
-     */
-    @GetMapping("/exportFile")
-    @ApiOperation(value = "导出")
-    public void exportFileUploadList(ProgramProjectListInfo info,String tabType, HttpServletResponse response) throws Exception{
-        List<ExportFileDto> infos = projectListService.exportList(info,tabType);
-        String title = "项目登记列表信息";
-        String sheetName = "项目登记列表信息";
-        if("2022".equals(tabType)){
-            title = "2022年" + title;
-            sheetName = "2022年" + sheetName;
+
+    @ApiLog(value = "导出项目信息", type = LogTypeEnum.EXPORT)
+    @GetMapping("exportFile")
+    @ApiOperation(value = "导出项目信息")
+    public void exportFile(ProgramProjectListInfo info, Page <ProgramProjectListInfo> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename();
+        String sheetName = options.getSheetName();
+        List<ProgramProjectListInfo> result = new ArrayList<>();
+        if ( ExportMode.current.equals ( options.getMode() ) ) {
+            result = projectListService.list (page,info,"1").getRecords();
+        } else if (ExportMode.selected.equals ( options.getMode() )) {
+            result = projectListService.list (page,info,"1").getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = projectListService.list (page,info,"1").getRecords();
         }
-        EasyPoiUtil.exportExcel(infos, title,  sheetName, ExportFileDto.class, "", response );
+        List<ExportFileDto> exportFileDtos = projectListService.exportList(result);
+        EasyPoiUtil.exportExcel ( exportFileDtos, sheetName,  sheetName, ExportFileDto.class, fileName, response );
+
     }
 
 
 
+
     /**
      * 根据项目id生成报告号
      * @param id

+ 1 - 18
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/service/ProjectListService.java

@@ -690,25 +690,8 @@ public class ProjectListService {
         return pageList;
     }
 
-    public List<ExportFileDto> exportList(ProgramProjectListInfo info, String tabType) throws Exception{
-        QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
-        wrapper.eq("a.del_flag", "0");
-        wrapper.eq("a.tab_type", tabType);
-        if (info.getCreateDates() != null) {
-            wrapper.between("a.create_date", info.getCreateDates()[0], info.getCreateDates()[1]);
-        }
-        List<ProgramProjectListInfo> infoList = projectListMapper.findInfoList(wrapper);
+    public List<ExportFileDto> exportList(List<ProgramProjectListInfo> infoList){
         List<ExportFileDto> list = projectListMapper.findList(infoList);
-        List<DictValueDTO> dictDTOList = DictUtils.getDictDTOList("program_registered_type");
-        for (ExportFileDto projectInfo: list) {
-            for (DictValueDTO dictInfo: dictDTOList) {
-                if (StrUtil.isNotBlank(projectInfo.getProgramType())){
-                    if (projectInfo.getProgramType().equals(dictInfo.getValue())){
-                        projectInfo.setProgramType(dictInfo.getLabel());
-                    }
-                }
-            }
-        }
         return list;
     }
 

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/service/dto/ExportFileDto.java

@@ -51,7 +51,7 @@ public class ExportFileDto {
     /**
      * 项目类型(归档表)
      */
-    @Excel(name = "项目类型", width = 20, orderNum = "8")
+    @Excel(name = "项目类型", width = 20, orderNum = "8",dict = "program_registered_type")
     private String programType;
 
     /**