Преглед изворни кода

1.修改控制台渠道数据和掌柜数据一致
2.平台结算添加平台结算情况数据页面以及详情

hxl13994548489 пре 1 година
родитељ
комит
685b1578d2

+ 31 - 0
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -2,18 +2,23 @@ package com.ydtech.modules.fnc.controller;
 
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
 import com.ydtech.modules.fnc.service.ImportAsyncService;
 import com.ydtech.modules.fnc.service.InsPlyIncomeService;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
+import com.ydtech.modules.fnc.vo.InsPlyIncomePTVo;
+import com.ydtech.modules.fnc.vo.InsPlyIncomeQueryPTVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.inv.model.dto.InsBxNoPlyIncomeExcelDto;
 import com.ydtech.modules.inv.model.dto.InsBxOtherExcelDto;
 import com.ydtech.modules.inv.model.dto.InsBxPlyIncomeExcelDto;
 import com.ydtech.modules.inv.model.dto.InsNoBxOtherExcelDto;
 import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.utils.SnowFlakeUtil;
 import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.excel.ExcelEasypoiUtils;
@@ -510,6 +515,32 @@ public class InsPlyIncomeController extends BaseController {
     public HttpResult<List<InsPlyIncome>> createData(@RequestBody InsPlyIncomeIdsVo insPlyIncomeIdsVo) {
         return insPlyIncomeService.createData(insPlyIncomeIdsVo);
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 9:51
+     *  @Description:  平台结算情况接口
+     */
+    @PostMapping("/totalPTAmount")
+    @ApiOperation(value = "平台结算情况接口")
+    public HttpResult<List<InsPlyIncomePTDto>> totalPTAmount(@RequestBody InsPlyIncomePTVo insPlyIncomeVo) {
+        List<InsPlyIncomePTDto> result = insPlyIncomeService.totalPTAmount(insPlyIncomeVo);
+        return HttpResult.ok(result);
+    }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 10:53
+     *  @Description: 通过结算人查询数据
+     */
+    @PostMapping("/findListByDockingPerson")
+    @ApiOperation(value = "平台结算情况接口详情")
+    public HttpResult<List<InsPlyIncomePTCompanyDto>> findListByDockingPerson(@RequestBody InsPlyIncomeQueryPTVo insPlyIncomeVo) {
+        List<InsPlyIncomePTCompanyDto> result = insPlyIncomeService.findListByDockingPerson(insPlyIncomeVo);
+        return HttpResult.ok(result);
+    }
+
 }
 
 

+ 18 - 4
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -1,15 +1,16 @@
 package com.ydtech.modules.fnc.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.report.financialReceivables.*;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisQueryDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTDto;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
-import com.ydtech.modules.fnc.vo.InsPlySettleVo;
-import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import com.ydtech.modules.fnc.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -203,5 +204,18 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
     Collection<? extends FinancialReceivablesVo> queryDateByTypePt( @Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
 
     List<FinancialReceivablesMonthVo> getPatherId( @Param("vo")  FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 9:59
+     *  @Description:  平台结算情况
+     */
+    List<InsPlyIncomePTDto> totalPTAmount(@Param("vo")  InsPlyIncomePTVo insPlyIncomeVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 11:04
+     *  @Description: 通过对接人查询数据
+     */
+    List<InsPlyIncomePTCompanyDto>  findListByDockingPerson(@Param("vo")  InsPlyIncomeQueryPTVo insPlyIncomeVo);
 }

+ 36 - 0
src/main/java/com/ydtech/modules/fnc/dto/InsPlyIncomePTCompanyDto.java

@@ -0,0 +1,36 @@
+package com.ydtech.modules.fnc.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/9/20 9:53
+ *  @Description: 平台结算情况列表数据
+ */
+@Data
+@ApiModel("平台结算情况列表数据")
+public class InsPlyIncomePTCompanyDto implements Serializable {
+
+
+
+    @ApiModelProperty("保险公司名称")
+    private String companyName;
+
+    @ApiModelProperty("合作公司名称")
+    private String partnerCompaniesName;
+
+    @ApiModelProperty(value = "应收金额")
+    private String sumAmount;
+
+    @ApiModelProperty(value = "已收金额")
+    private String ysAmount;
+
+    @ApiModelProperty(value = "未收金额")
+    private String wsAmount;
+}

+ 32 - 0
src/main/java/com/ydtech/modules/fnc/dto/InsPlyIncomePTDto.java

@@ -0,0 +1,32 @@
+package com.ydtech.modules.fnc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import java.io.Serializable;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/9/20 9:53
+ *  @Description: 平台结算情况列表数据
+ */
+@Data
+@ApiModel("平台结算情况列表数据")
+public class InsPlyIncomePTDto implements Serializable {
+
+
+    @ApiModelProperty("对接人")
+    private String dockingPerson;
+
+    @ApiModelProperty(value = "应收金额")
+    private String sumAmount;
+
+    @ApiModelProperty(value = "已收金额")
+    private String ysAmount;
+
+    @ApiModelProperty(value = "未收金额")
+    private String wsAmount;
+}

+ 17 - 4
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -6,14 +6,14 @@ import com.ydtech.modules.admin.model.report.financialReceivables.FinancialRecei
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryMonthVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTDto;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsAreaCompany;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
-import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import com.ydtech.modules.fnc.vo.*;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
@@ -215,5 +215,18 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult<List<InsPlyIncome>> createData(InsPlyIncomeIdsVo insPlyIncomeIdsVo);
 
     List<InsuranceHandlingSettlementMonthDto> getInvociAmount(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 9:57
+     *  @Description:  平台结算情况统计
+     */
+    List<InsPlyIncomePTDto> totalPTAmount(InsPlyIncomePTVo insPlyIncomeVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 11:00
+     *  @Description: 通过对接人查询结算数据
+     */
+    List<InsPlyIncomePTCompanyDto> findListByDockingPerson(InsPlyIncomeQueryPTVo insPlyIncomeVo);
 }

+ 28 - 7
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alipay.api.domain.VehicleIovData;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
@@ -18,17 +19,17 @@ import com.ydtech.modules.admin.model.report.financialReceivables.*;
 import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
+import com.ydtech.modules.esm.model.EsmInsPackage;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.fnc.dao.FncInsAreaCompanyMapper;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTDto;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.*;
 import com.ydtech.modules.fnc.service.*;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
-import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
-import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
+import com.ydtech.modules.fnc.vo.*;
 import com.ydtech.modules.ins.model.vo.res.*;
 import com.ydtech.modules.inv.model.dto.*;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
@@ -3121,9 +3122,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
      */
     @Override
     public List<PlatformSettlementRecordDto> platformSettlementRecord(InsPlyIncomeVo insPlyIncomeVo) {
-        if(insPlyIncomeVo.getPartnerCompaniesId()==null || "".equals(insPlyIncomeVo.getPartnerCompaniesId())){
-            throw new SystemException("合作公司编码(partnerCompaniesId)不能为空");
-        }
+      //  if(insPlyIncomeVo.getPartnerCompaniesId()==null || "".equals(insPlyIncomeVo.getPartnerCompaniesId())){
+       //     throw new SystemException("合作公司编码(partnerCompaniesId)不能为空");
+      //  }
         if(insPlyIncomeVo.getHandlingFeesStatus()==null || "".equals(insPlyIncomeVo.getHandlingFeesStatus())){
             throw new SystemException("结算状态 0 未结算 1已结算(handlingFeesStatus)不能为空");
         }
@@ -3626,4 +3627,24 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
         return baseMapper.getInvociAmount(insuranceHandlingSettlementMonthVo);
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 9:58
+     *  @Description:  平台结算情况统计
+     */
+    @Override
+    public List<InsPlyIncomePTDto> totalPTAmount(InsPlyIncomePTVo insPlyIncomeVo) {
+        return baseMapper.totalPTAmount(insPlyIncomeVo);
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 11:01
+     *  @Description:  通过结算人查询保险公司结算数据
+     */
+    @Override
+    public List<InsPlyIncomePTCompanyDto> findListByDockingPerson(InsPlyIncomeQueryPTVo insPlyIncomeVo) {
+        return  baseMapper.findListByDockingPerson(insPlyIncomeVo);
+    }
 }

+ 35 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomePTVo.java

@@ -0,0 +1,35 @@
+package com.ydtech.modules.fnc.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ydtech.modules.fnc.entity.InsPlyIncome;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.List;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/9/20 9:53
+ *  @Description: 平台结算情况查询vo
+ */
+@Data
+@ApiModel("平台结算情况查询vo")
+public class InsPlyIncomePTVo implements Serializable {
+
+
+    @ApiModelProperty("对接人")
+    private String dockingPerson;
+
+    @ApiModelProperty(value = "开始时间")
+    private String beginDate;
+
+    @ApiModelProperty(value = "结束时间")
+    private String endDate;
+}

+ 31 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeQueryPTVo.java

@@ -0,0 +1,31 @@
+package com.ydtech.modules.fnc.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import java.io.Serializable;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/9/20 9:53
+ *  @Description: 平台结算情况查询vo
+ */
+@Data
+@ApiModel("平台结算情况详情查询vo")
+public class InsPlyIncomeQueryPTVo implements Serializable {
+
+
+    @ApiModelProperty("对接人")
+    private String dockingPerson;
+
+
+    @ApiModelProperty(value = "每页页数")
+    private int pageSize;
+
+    @ApiModelProperty(value = "页数")
+    @Min(value = 1, message = "页数最小为1")
+    private int pageNum=1;
+}

+ 3 - 0
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -1365,6 +1365,9 @@
                 <when  test='vo.managementSource == "2"'>
                    and (sur.role_id = 20  or  sur.role_id = 21)
                 </when>
+                <when  test='vo.managementSource == "1"'>
+                    and (sur.role_id = 19  or  sur.role_id = 21)
+                </when>
                 <otherwise>
                 </otherwise>
             </choose>

+ 48 - 0
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -3153,4 +3153,52 @@
         eic.namesimple,
         sa.area_cname
     </select>
+
+    <select id="totalPTAmount" resultType="com.ydtech.modules.fnc.dto.InsPlyIncomePTDto">
+        SELECT
+            pa.docking_person AS "dockingPerson",
+            sum( a.all_fee_value ) AS "sumAmount",
+            sum(case when a.handling_fees_status =1 then a.all_fee_value else 0 end) ysAmount,
+            sum( a.all_fee_value ) - sum(case when a.handling_fees_status =1 then a.all_fee_value else 0 end) wsAmount
+        FROM
+            ins_ply_income a
+            LEFT JOIN esm_ins_company ec ON ec.id = a.company_id
+            LEFT JOIN ptl_agreement pa ON pa.id = a.agreement_id
+        <where>
+            pa.agreement_type = 1
+            <if test="vo.dockingPerson !=null  and  vo.dockingPerson  !=''">
+                and pa.docking_person =#{vo.dockingPerson}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  date(a.signdate)  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+        GROUP BY
+        pa.docking_person,
+        a.handling_fees_status
+        order by  sum( a.all_fee_value ) - sum(case when a.handling_fees_status =1 then a.all_fee_value else 0 end) desc
+    </select>
+
+    <select id="findListByDockingPerson" resultType="com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto">
+        select
+            a.company_name AS "companyName",
+            a.partner_companies_name AS "partnerCompaniesName",
+            sum( a.all_fee_value ) AS "sumAmount",
+            sum( CASE WHEN a.handling_fees_status = 1 THEN a.all_fee_value ELSE 0 END ) ysAmount,
+            sum( a.all_fee_value ) - sum( CASE WHEN a.handling_fees_status = 1 THEN a.all_fee_value ELSE 0 END ) wsAmount
+        from ins_ply_income a
+        LEFT JOIN ptl_agreement pa on pa.id= a.agreement_id
+        <where>
+            pa.agreement_type = 1
+            <if test="vo.dockingPerson !=null  and  vo.dockingPerson  !=''">
+                and pa.docking_person =#{vo.dockingPerson}
+            </if>
+        </where>
+        GROUP BY
+        a.company_name,
+        a.partner_companies_name,
+        pa.docking_person,
+        a.handling_fees_status
+        order by  sum( a.all_fee_value ) - sum(case when a.handling_fees_status =1 then a.all_fee_value else 0 end) desc
+    </select>
 </mapper>