1 rok pred
rodič
commit
3ba1057a69

+ 4 - 0
platform-dao/src/main/java/com/platform/dao/vo/report/AllPreparationReportVO.java

@@ -7,6 +7,7 @@ import lombok.Data;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -33,6 +34,9 @@ public class AllPreparationReportVO implements Serializable {
     @Excel(name = "次数", orderNum = "3")
     private Integer num;
 
+    @Excel(name = "费用汇总", orderNum = "4")
+    private BigDecimal totalFee;
+
     /**
      * 明细列表
      */

+ 10 - 0
platform-rest/src/main/java/com/platform/rest/controller/preparation/PreparationController.java

@@ -22,6 +22,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.util.ArrayList;
 import java.util.List;
@@ -242,9 +243,18 @@ public class PreparationController {
         break;
       }
     }
+
     if (preparationVOS.size() == 0){
       throw new BusinessException("系统出错,请联系管理员!");
     }
+    BigDecimal totalFee = new BigDecimal(0);
+    for (PreparationVO vo:preparationVOS){
+      totalFee = totalFee.add(vo.getFee());
+    }
+    PreparationVO preparationVO = new PreparationVO();
+    preparationVO.setFee(totalFee);
+    preparationVO.setId("费用汇总");
+    preparationVOS.add(preparationVO);
     ExcelUtil.exportResponseDict(response, ExportPreparationVO.class, BeanConverterUtil.copyListProperties(preparationVOS, ExportPreparationVO.class), "筹建报表统计导出");
   }
 

+ 6 - 1
platform-service/src/main/java/com/platform/service/preparation/impl/PreparationServiceImpl.java

@@ -183,6 +183,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
         List<AllPreparationReportVO> result = new ArrayList<AllPreparationReportVO>();
 
         for (Map<String, LocalDateTime> map : monthStartAndEndList) {
+            BigDecimal totalFee = new BigDecimal(0);
             int i = 0;
             AllPreparationReportVO vo = new AllPreparationReportVO();
             List<PreparationVO> detailList = new ArrayList<PreparationVO>();
@@ -192,10 +193,14 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
                 if (preparationVO.getApplyTime().isAfter(map.get("searchStartTimeMonth")) && preparationVO.getApplyTime().isBefore(map.get("searchEndTimeMonth"))) {
                     i++;
                     // 维修专业
-
+                    if (preparationVO.getFee()==null){
+                        preparationVO.setFee(new BigDecimal(0));
+                    }
                     detailList.add(preparationVO);
+                    totalFee = totalFee.add(preparationVO.getFee()==null?new BigDecimal(0):preparationVO.getFee());
                 }
             }
+            vo.setTotalFee(totalFee);
             vo.setNum(i);
             vo.setDetailList(detailList);
             result.add(vo);