Parcourir la source

fix: 缺失净值导出

chenjianhua il y a 7 mois
Parent
commit
e36764009c

+ 0 - 1
service-base/src/main/java/com/simuwang/base/common/util/ExcelUtil.java

@@ -286,7 +286,6 @@ public class ExcelUtil {
         if (wb == null) {
             wb = new HSSFWorkbook();
         }
-
         try {
             // 第二步,在workbook中添加一个sheet,对应Excel文件中的sheet
             HSSFSheet sheet = wb.createSheet(sheetName);

+ 1 - 1
service-base/src/main/java/com/simuwang/base/mapper/DeletionInfoMapper.java

@@ -35,7 +35,7 @@ public interface DeletionInfoMapper {
 
     void updateRemark(@Param("fundId") String fundId, @Param("deletionType") Integer deletionType,@Param("deletionDate") String deletionDate, @Param("remark")String remark);
 
-    List<FundDeletionInfoDO> selectFundDeletionInfoVOList(@Param("fundIdList") List<String> fundIdList);
+    List<FundDeletionInfoDO> selectFundDeletionInfoVOList(@Param("fundId") String fundId,@Param("deletionType") Integer deletionType);
 
     DeletionInfoDO getDeletionInfoDO(DeletionInfoDO deletionInfoDO);
 

+ 22 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/DeletionDownParam.java

@@ -0,0 +1,22 @@
+package com.simuwang.base.pojo.dto;
+
+import lombok.Data;
+
+/**
+ * FileName: DeletionDownParam
+ * Author:   chenjianhua
+ * Date:     2024/9/20 20:30
+ * Description: ${DESCRIPTION}
+ */
+@Data
+public class DeletionDownParam {
+    /**
+     * 基金ID
+     */
+    private String fundId;
+    /**
+     * 缺失类型
+     */
+    private Integer deletionType;
+
+}

+ 3 - 2
service-base/src/main/java/com/simuwang/base/pojo/vo/FundIdListVO.java

@@ -1,5 +1,6 @@
 package com.simuwang.base.pojo.vo;
 
+import com.simuwang.base.pojo.dto.DeletionDownParam;
 import lombok.Data;
 
 import java.util.List;
@@ -11,9 +12,9 @@ import java.util.List;
  * Description: ${DESCRIPTION}
  */
 @Data
-public class FundIdListVO {
+public class FundDeletionListVO {
     /**
      * 基金ID列表
      */
-    private List<String> fundIdList;
+    private List<DeletionDownParam> deletionDownParamList;
 }

+ 5 - 5
service-base/src/main/resources/mapper/DeletionInfoMapper.xml

@@ -198,11 +198,11 @@
             parameterType="java.util.List">
         select id,fund_id,deletion_type,deletion_date,remark,isvalid,creatorid,updaterid,createtime,updatetime
         from PPW_EMAIL.deletion_info where isvalid=1 and remark is null
-        <if test="fundIdList.size() > 0">
-            and fund_id in
-            <foreach collection="fundIdList" index="index" item="fundId" separator="," open="(" close=")">
-                #{fundId}
-            </foreach>
+        <if test="fundId != null and fundId !=''">
+            and fund_id = #{fundId}
+        </if>
+        <if test="deletionType != null">
+            and deletion_type=#{deletionType}
         </if>
     </select>
     <select id="getDeletionInfoDO" resultType="com.simuwang.base.pojo.dos.DeletionInfoDO"

+ 4 - 4
service-manage/src/main/java/com/simuwang/manage/api/deletion/DeletionController.java

@@ -86,12 +86,12 @@ public class DeletionController {
 
     /**
      * 下载数据缺失
-     * @param fundIdListVO
+     * @param fundDeletionListVO
      * @return
      */
     @PostMapping("/download-fund-deletion")
-    public void downloadFundDeletion(@RequestBody FundIdListVO fundIdListVO, HttpServletResponse response, HttpServletRequest request){
-        List<ExcelDeletionInfoDTO> fundDeletionInfoVOList = deletionService.selectFundDeletionInfoVOList(fundIdListVO);
+    public void downloadFundDeletion(@RequestBody FundDeletionListVO fundDeletionListVO, HttpServletResponse response, HttpServletRequest request){
+        List<ExcelDeletionInfoDTO> fundDeletionInfoVOList = deletionService.selectFundDeletionInfoVOList(fundDeletionListVO);
         Map<String,List<List<String>>> values = new HashMap<>();
         List<String> head = new ArrayList<>();
         head.add("基金ID");
@@ -115,7 +115,7 @@ public class DeletionController {
         values.put(sheetName,dataList);
         HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook(sheetName,head,values,null);
         try {
-            response.setContentType("application/octet-stream");
+            response.setContentType("application/vnd.ms-excel; charset=UTF-8");
             response.addHeader("Content-Disposition", "attachment;filename=" + EncodeUtil.encodeUTF8("缺失明细.xls"));
             ServletOutputStream outputStream = response.getOutputStream();
             wb.write(outputStream);

+ 2 - 2
service-manage/src/main/java/com/simuwang/manage/service/DeletionService.java

@@ -6,8 +6,8 @@ import com.simuwang.base.pojo.dto.query.DeletionPageQuery;
 import com.simuwang.base.pojo.dto.query.FundDeletionPageQuery;
 import com.simuwang.base.pojo.vo.DeletionInfoVO;
 import com.simuwang.base.pojo.vo.FundDeletionInfoVO;
+import com.simuwang.base.pojo.vo.FundDeletionListVO;
 import com.simuwang.base.pojo.vo.FundDeletionRemarkVO;
-import com.simuwang.base.pojo.vo.FundIdListVO;
 
 import java.util.List;
 
@@ -26,5 +26,5 @@ public interface DeletionService {
 
     void saveBatchDeletionRemark(FundDeletionRemarkVO fundDeletionRemarkVO);
 
-    List<ExcelDeletionInfoDTO> selectFundDeletionInfoVOList(FundIdListVO fundIdListVO);
+    List<ExcelDeletionInfoDTO> selectFundDeletionInfoVOList(FundDeletionListVO fundDeletionListVO);
 }

+ 15 - 12
service-manage/src/main/java/com/simuwang/manage/service/impl/DeletionServiceImpl.java

@@ -8,6 +8,7 @@ import com.simuwang.base.mapper.DeletionInfoMapper;
 import com.simuwang.base.mapper.FundInfoMapper;
 import com.simuwang.base.pojo.dos.DeletionInfoDO;
 import com.simuwang.base.pojo.dos.FundDeletionInfoDO;
+import com.simuwang.base.pojo.dto.DeletionDownParam;
 import com.simuwang.base.pojo.dto.ExcelDeletionInfoDTO;
 import com.simuwang.base.pojo.dto.query.DeletionPageQuery;
 import com.simuwang.base.pojo.dto.query.FundDeletionPageQuery;
@@ -72,19 +73,21 @@ public class DeletionServiceImpl implements DeletionService {
     }
 
     @Override
-    public List<ExcelDeletionInfoDTO> selectFundDeletionInfoVOList(FundIdListVO fundIdListVO) {
+    public List<ExcelDeletionInfoDTO> selectFundDeletionInfoVOList(FundDeletionListVO fundDeletionListVO) {
         List<ExcelDeletionInfoDTO> result = new ArrayList<>();
-        List<String> fundIdList = fundIdListVO.getFundIdList();
-        List<FundDeletionInfoDO> deletionInfoDOList = deletionInfoMapper.selectFundDeletionInfoVOList(fundIdList);
-        for(FundDeletionInfoDO infoDO : deletionInfoDOList){
-            ExcelDeletionInfoDTO dto = new ExcelDeletionInfoDTO();
-            dto.setFundName(fundInfoMapper.getFundNameByFundId(infoDO.getFundId()));
-            dto.setCompanyName(fundInfoMapper.getCompanyNameByFundId(infoDO.getFundId()));
-            dto.setDeletionType(DeletionType.getDeletionTypeByCode(infoDO.getDeletionType()).getInfo());
-            dto.setDeletionDate(infoDO.getDeletionDate());
-            dto.setRemark(infoDO.getRemark());
-            dto.setFundId(infoDO.getFundId());
-            result.add(dto);
+        List<DeletionDownParam> deletionDownParamList = fundDeletionListVO.getDeletionDownParamList();
+        for(DeletionDownParam deletionDownParam : deletionDownParamList){
+            List<FundDeletionInfoDO> deletionInfoDOList = deletionInfoMapper.selectFundDeletionInfoVOList(deletionDownParam.getFundId(),deletionDownParam.getDeletionType());
+            for(FundDeletionInfoDO infoDO : deletionInfoDOList){
+                ExcelDeletionInfoDTO dto = new ExcelDeletionInfoDTO();
+                dto.setFundName(fundInfoMapper.getFundNameByFundId(infoDO.getFundId()));
+                dto.setCompanyName(fundInfoMapper.getCompanyNameByFundId(infoDO.getFundId()));
+                dto.setDeletionType(DeletionType.getDeletionTypeByCode(infoDO.getDeletionType()).getInfo());
+                dto.setDeletionDate(infoDO.getDeletionDate());
+                dto.setRemark(infoDO.getRemark());
+                dto.setFundId(infoDO.getFundId());
+                result.add(dto);
+            }
         }
         return result;
     }