cuixinpeng 2 лет назад
Родитель
Сommit
2148a297b8

+ 11 - 3
src/main/java/com/ydtech/modules/fnc/dao/InsPlySettleMapper.java

@@ -1,11 +1,13 @@
 package com.ydtech.modules.fnc.dao;
 
-import com.ydtech.modules.fnc.entity.InsPlyIncome;
-import com.ydtech.modules.fnc.entity.InsPlySettle;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ydtech.modules.fnc.entity.InsPlySettle;
 import com.ydtech.modules.fnc.vo.InsPlySettleVo;
+import com.ydtech.modules.report.model.vo.InsPlySettleReportReqVo;
+import com.ydtech.modules.report.model.vo.InsPlySettleReportResVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
@@ -57,4 +59,10 @@ public interface InsPlySettleMapper extends BaseMapper<InsPlySettle> {
     )
     InsPlySettle selectBySettleno(String settleno);
 
+    Page<InsPlySettleReportResVo> getInsPlySettleReport(@Param("page") Page page, @Param("reportReqVo") InsPlySettleReportReqVo insPlySettleReportReqVo);
+
+    List<InsPlySettleReportResVo> getInsPlySettleReport(@Param("reportReqVo")InsPlySettleReportReqVo insPlySettleReportReqVo);
+
+    Long getInsPlySettleReportCount(@Param("reportReqVo") InsPlySettleReportReqVo insPlySettleReportReqVo);
+
 }

+ 9 - 8
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlySettleServiceImpl.java

@@ -31,6 +31,7 @@ import com.ydtech.modules.report.model.vo.InsPlySettleReportResVo;
 import com.ydtech.utils.DateUtil;
 import com.ydtech.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -53,6 +54,8 @@ import java.util.List;
 @Service
 public class InsPlySettleServiceImpl extends ServiceImpl<InsPlySettleMapper, InsPlySettle> implements InsPlySettleService {
 
+    @Value("${upload.file.path}")
+    private String uploadFilePath;
     @Autowired
     private InsPlySettleDetailMapper insPlySettleDetailMapper;
     @Autowired
@@ -206,24 +209,22 @@ public class InsPlySettleServiceImpl extends ServiceImpl<InsPlySettleMapper, Ins
     }
     @Override
     public BasePageResult<InsPlySettleReportResVo> getInsPlySettleReport( InsPlySettleReportReqVo insPlySettleReportReqVo) {
-       /* Page<InsOrders> page = new Page<>(insPlySettleReportReqVo.getPageNum(), insPlySettleReportReqVo.getPageSize());
+        Page<InsOrders> page = new Page<>(insPlySettleReportReqVo.getPageNum(), insPlySettleReportReqVo.getPageSize());
         page.setSearchCount(false).setOptimizeCountSql(false);//关闭count查询
-        Page<InsPlySettleReportResVo> policyInsuranceReportResVoPage = baseMapper.getPolicyInsuranceReport(page,
+        Page<InsPlySettleReportResVo> policyInsuranceReportResVoPage = baseMapper.getInsPlySettleReport(page,
                 insPlySettleReportReqVo);
-        Long total = baseMapper.getPolicyInsuranceReportCount(insPlySettleReportReqVo);
+        Long total = baseMapper.getInsPlySettleReportCount(insPlySettleReportReqVo);
         policyInsuranceReportResVoPage.setTotal(total);
         return new BasePageResult<>(insPlySettleReportReqVo.getPageNum(), insPlySettleReportReqVo.getPageSize(),
                 policyInsuranceReportResVoPage.getTotal(), policyInsuranceReportResVoPage.getPages()
-                , policyInsuranceReportResVoPage.getRecords());*/
-        return null;
+                , policyInsuranceReportResVoPage.getRecords());
     }
 
     @Override
     public HttpResult<String> exportInsPlySettleReport(InsPlySettleReportReqVo insPlySettleReportReqVo) {
-        /*List<InsPlySettleReportResVo> policyInsuranceReportResVoPage = baseMapper.getPolicyInsuranceReport(insPlySettleReportReqVo);
+        List<InsPlySettleReportResVo> policyInsuranceReportResVoPage = baseMapper.getInsPlySettleReport(insPlySettleReportReqVo);
         String s = EasyExcelUtils.downExcel(uploadFilePath, PolicyInsuranceReportResVo.class, policyInsuranceReportResVoPage);
-        return HttpResult.ok("", s);*/
-        return null;
+        return HttpResult.ok("", s);
     }
 
 }

+ 9 - 0
src/main/java/com/ydtech/modules/report/model/vo/InsPlySettleReportReqVo.java

@@ -5,6 +5,7 @@ import lombok.Data;
 
 import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
+import java.time.LocalDateTime;
 
 /**
  * @Author: CXP
@@ -13,6 +14,14 @@ import javax.validation.constraints.Min;
 @Data
 public class InsPlySettleReportReqVo {
 
+    @ApiModelProperty("保险公司")
+    private String companyId;
+
+    @ApiModelProperty("状态")
+    private String status;
+
+    @ApiModelProperty("结算单生成时间")
+    private LocalDateTime createTime;
 
     @ApiModelProperty(value = "每页页数")
     @Min(value = 20, message = "页数最小为20")

+ 1 - 24
src/main/java/com/ydtech/modules/report/model/vo/InsPlySettleReportResVo.java

@@ -14,17 +14,12 @@ import java.time.LocalDateTime;
 @Data
 public class InsPlySettleReportResVo {
 
-    @ApiModelProperty("结算单号")
-    private String settleno;
-
     @ApiModelProperty("保险公司")
     private String companyId;
+
     @ApiModelProperty("保险公司名称")
     private String companyName;
 
-    @ApiModelProperty("结算月份")
-    private String settleMonth;
-
     @ApiModelProperty("结算批次")
     private String settleBatch;
 
@@ -37,24 +32,6 @@ public class InsPlySettleReportResVo {
     @ApiModelProperty("总费用")
     private BigDecimal allFeeValue;
 
-    @ApiModelProperty("总费用核销金额")
-    private BigDecimal hxamount;
-    @ApiModelProperty("手续费核销金额")
-    private BigDecimal commissionHxamount;
-    @ApiModelProperty("其他费核销金额")
-    private BigDecimal otherHxamount;
-
-    @ApiModelProperty("机构")
-    private String deptId;
-    @ApiModelProperty("机构名称")
-    private String deptName;
-
-    @ApiModelProperty("结算单生成时间")
-    private LocalDateTime createTime;
-
-    @ApiModelProperty("生成操作人")
-    private String operator;
-
     @ApiModelProperty("状态")
     private String status;
 }

+ 44 - 0
src/main/resources/mapper/modules/fnc/InsPlySettleMapper.xml

@@ -19,4 +19,48 @@
         <result column="status" property="status" />
     </resultMap>
 
+    <resultMap id="SettleReportDataMap" type="com.ydtech.modules.report.model.vo.InsPlySettleReportResVo">
+        <result property="companyName" column="company_name" jdbcType="VARCHAR"/>
+        <result property="settleMonth" column="settle_month" jdbcType="VARCHAR"/>
+        <result property="commissionFeevalue" column="commission_feevalue" jdbcType="DECIMAL"/>
+        <result property="otherFeevalue" column="other_feevalue" jdbcType="DECIMAL"/>
+        <result property="allFeeValue" column="all_fee_value" jdbcType="DECIMAL"/>
+        <result property="status" column="status" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <select id="getInsPlySettleReport"  resultMap="SettleReportDataMap">
+
+        SELECT
+        ''company_name,
+        ''settle_month,
+        ''status,
+        SUM(p.`commission_feevalue`) commission_feevalue,
+        SUM(p.`other_feevalue`) other_feevalue,
+        SUM(p.`all_fee_value`) all_fee_value
+        FROM
+        ins_ply_settle p WHERE 1=1
+        <if test="reportReqVo.companyId != null and reportReqVo.companyId != ''">
+            and p.company_id = #{reportReqVo.companyId}
+        </if>
+        GROUP BY p.`company_id`
+    </select>
+    <select id="getInsPlySettleReportCount" resultType="Long">
+        select
+        count(1)
+        from (
+        SELECT
+        ''company_name,
+        ''settle_month,
+        ''status,
+        SUM(p.`commission_feevalue`) commission_feevalue,
+        SUM(p.`other_feevalue`) other_feevalue,
+        SUM(p.`all_fee_value`) all_fee_value
+        FROM
+        ins_ply_settle p WHERE 1=1
+        <if test="reportReqVo.companyId != null and reportReqVo.companyId != ''">
+            and p.company_id = #{reportReqVo.companyId}
+        </if>
+        GROUP BY p.`company_id`
+        ) as s
+    </select>
 </mapper>