Browse Source

新生报名统计

大数据与最优化研究所 1 year ago
parent
commit
ccaeb2ddac

+ 9 - 0
src/main/java/com/xjrsoft/module/student/service/impl/PbCseFeeobjupdateServiceImpl.java

@@ -15,6 +15,7 @@ import lombok.AllArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.time.LocalDate;
@@ -156,6 +157,7 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
             feeobjupdateMPJLambdaWrapper
                     .selectAs(PbCseFeeitem2::getShortname, PbVXssfdetail::getFeeitemname)
                     .selectAs(PbCseFeeobjupdate::getPersonalid, PbVXssfdetail::getPersonalid)
+                    .selectAs(PbVXssfdetail::getMny, PbVXssfdetail::getMny)
                     .leftJoin(PbVXssfdetail.class, PbVXssfdetail::getPersonalid, PbCseFeeobjupdate::getPersonalid)
                     .leftJoin(PbCseFeeitem2.class, PbCseFeeitem2::getFeeitemname, PbVXssfdetail::getFeeitemname)
                     .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
@@ -165,6 +167,10 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
 
             //收费项目情况统计
             Map<String, Long> pbVXssfdetailMap = pbVXssfdetails.stream().collect(Collectors.groupingBy(PbVXssfdetail::getFeeitemname, Collectors.counting()));
+            Map<String, BigDecimal>  pbVXssfdetailSumMap = pbVXssfdetails.stream()
+                    .collect(Collectors.groupingBy(PbVXssfdetail::getFeeitemname,
+                            Collectors.mapping(PbVXssfdetail::getMny, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
+
             List<ChargingSituationVo> chargingSituationVoRes = new ArrayList<>();
             DecimalFormat df = new DecimalFormat("#.##");
             for (Map.Entry<String, Long> entry : pbVXssfdetailMap.entrySet()) {
@@ -178,6 +184,9 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
                         setUnpaid(result.getRegistrationPopulation() - entry.getValue());
                         setRateOfPayment(df.format((double)entry.getValue()/result.getRegistrationPopulation()*100) + "%");
                     }
+                    if(pbVXssfdetailSumMap.get(entry.getKey()) != null){
+                        setRecordedmoney(pbVXssfdetailSumMap.get(entry.getKey()).setScale(2, RoundingMode.DOWN));
+                    }
                 }});
             }
             result.setChargingSituationVoList(chargingSituationVoRes);

+ 7 - 0
src/main/java/com/xjrsoft/module/student/vo/ChargingSituationVo.java

@@ -3,6 +3,8 @@ package com.xjrsoft.module.student.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 @Data
 public class ChargingSituationVo {
 
@@ -26,4 +28,9 @@ public class ChargingSituationVo {
      */
     @ApiModelProperty("未缴纳")
     private Long unpaid;
+    /**
+     * 入账金额
+     */
+    @ApiModelProperty("入账金额")
+    private BigDecimal recordedmoney;
 }