Przeglądaj źródła

提交财务应收数据
平安接口对接
屏蔽接口
添加短信验证的跳转h5配置

hxl13994548489 2 lat temu
rodzic
commit
22a836e6f1

+ 5 - 0
src/main/java/com/ydtech/components/TokenInterceptor.java

@@ -82,6 +82,11 @@ public class TokenInterceptor {
         notMatchList.add("/wxWork/verifyBind");
         notMatchList.add("/wxWork/bind");
 
+        // 平安相关屏蔽地址
+        notMatchList.add("/order/pingAnApi/getApplyVerifyCodeAndRecoverApplyVerifyCode");
+        notMatchList.add("/order/pingAnApi/recoverApplyVerifyCode");
+        notMatchList.add("/order/pingAnApi/payReturn");
+
         return new SaInterceptor(handler -> {
             // 指定一条 match 规则
             SaRouter

+ 2 - 2
src/main/java/com/ydtech/config/properties/PingAnApiConfigurationProperties.java

@@ -59,7 +59,7 @@ public class PingAnApiConfigurationProperties {
     private  String  sk;
 
     /***
-     * 文件上传前缀
+     * 短信验证页面
      */
-    private String fileUrl;
+    private String signatureUrl;
 }

+ 70 - 0
src/main/java/com/ydtech/modules/admin/controller/financialReceivables/FinancialReceivablesController.java

@@ -0,0 +1,70 @@
+package com.ydtech.modules.admin.controller.financialReceivables;
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllVo;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
+import com.ydtech.modules.fnc.service.InsPlyIncomeService;
+import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/7/31 15:33
+ *  @Description: 财务应收
+ */
+@Api(tags = "财务应收")
+@RequestMapping("/financialReceivables")
+@RestController
+public class FinancialReceivablesController {
+
+
+    @Autowired
+    private InsPlyIncomeService insPlyIncomeService;
+
+   /**
+    *  @version
+    *  @author: hxl
+    *  @Date: 2024/8/1 9:20
+    *  @Description:  获取平台(私有协议 、平台)
+    */
+    @PostMapping("/queryDateByType")
+    @ApiModelProperty(value = "获取平台私有数据列表")
+    public HttpResult<FinancialReceivablesAllVo> queryDateByType(@RequestBody FinancialReceivablesQueryVo financialReceivablesQueryVo) {
+        return HttpResult.ok(insPlyIncomeService.queryDateByType(financialReceivablesQueryVo));
+    }
+
+    /**
+     *
+     * @param insPlyIncomeVo
+     * @return  返回私有 平台  应收 已收  未收
+     */
+    @PostMapping("/totalReceivables")
+    @ApiModelProperty(value = "平台 私有 应收未收 金额")
+    public HttpResult<ArrayList<Map<String,Object>>> totalReceivables(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return insPlyIncomeService.totalReceivables(insPlyIncomeVo);
+    }
+
+    /**
+     *
+     * @param insPlyIncomeVo
+     * @return  返回私有   1   到 12  月   应收 已收
+     */
+    @PostMapping("/monthTotalReceivables")
+    @ApiModelProperty(value = "私有平台 已收未收金额")
+    public HttpResult<List<HashMap<String,Object>>> monthTotalReceivables(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return insPlyIncomeService.monthTotalReceivables(insPlyIncomeVo);
+    }
+
+}

+ 42 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesAllVo.java

@@ -0,0 +1,42 @@
+package com.ydtech.modules.admin.model.report.financialReceivables;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2024/8/1 9:20
+ *  @Description:   应收出参
+ */
+@Data
+@ApiModel("应收查询参数")
+public class FinancialReceivablesAllVo {
+
+    @ApiModelProperty("平台应收金额")
+    private  String  ptSumAmount;
+
+    @ApiModelProperty("私有应收金额")
+    private  String  sySumAmount;
+
+    @ApiModelProperty("年份")
+    private  String  year;
+
+    @ApiModelProperty("数据列表")
+    private List<FinancialReceivablesVo> list =new ArrayList<>();
+
+    public FinancialReceivablesAllVo() {
+    }
+
+    public FinancialReceivablesAllVo(String sySumAmount,String  ptSumAmount, String year, List<FinancialReceivablesVo> list) {
+        this.sySumAmount = sySumAmount;
+        this.ptSumAmount = ptSumAmount;
+        this.year = year;
+        this.list = list;
+    }
+}

+ 29 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesQueryVo.java

@@ -0,0 +1,29 @@
+package com.ydtech.modules.admin.model.report.financialReceivables;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2024/8/1 9:20
+ *  @Description:   应收出参
+ */
+@Data
+@ApiModel("应收查询参数")
+public class FinancialReceivablesQueryVo {
+
+    @ApiModelProperty("年份")
+    private  String  year;
+
+    @ApiModelProperty("类型 1.平台  2.私有  默认是1 必传")
+    private String  type;
+
+    @ApiModelProperty("前台不需要传递后台使用")
+    private String beginDate;
+
+    @ApiModelProperty("前台不需要传递后台使用")
+    private String endDate;
+}

+ 36 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesVo.java

@@ -0,0 +1,36 @@
+package com.ydtech.modules.admin.model.report.financialReceivables;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2024/8/1 9:20
+ *  @Description:   应收出参
+ */
+@Data
+@ApiModel("应收查询参数")
+public class FinancialReceivablesVo {
+
+    @ApiModelProperty("年份")
+    private  String  yearAndMonth;
+
+    @ApiModelProperty("应收")
+    private String  commissionFeevalue;
+
+    @ApiModelProperty("已收")
+    private String  noInvoicCommissionFeevalue;
+
+    @ApiModelProperty("未收")
+    private String  readyCommissionFeevalue;
+
+    @ApiModelProperty("开票未结算")
+    private String  settlementAmount;
+
+    @ApiModelProperty("未开票金额")
+    private String  noSettlementAmount;
+
+}

+ 17 - 0
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -1,6 +1,8 @@
 package com.ydtech.modules.fnc.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesVo;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisQueryDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
@@ -11,6 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
+import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
 
@@ -155,4 +158,18 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
      *  @Description: 查询数据
      */
     List<ProfitAnalysisDto> queryPage( @Param("vo") ProfitAnalysisQueryDto profitAnalysisQueryDto);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/1 12:09
+     *  @Description:  查询应收总数据
+     */
+    BigDecimal queryDateByTypeSumAmount(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/1 12:16
+     *  @Description:  查询应收列表数据 1-12月
+     */
+    List<FinancialReceivablesVo> queryDateByType(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
 }

+ 9 - 1
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -2,6 +2,8 @@ package com.ydtech.modules.fnc.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllVo;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsAreaCompany;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
@@ -177,5 +179,11 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     void bxImportOtherConfirm(InsPlyIncomeVo insPlyIncomeVo);
 
     void noBxImportOtherConfirm(InsPlyIncomeVo insPlyIncomeVo);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/1 9:27
+     *  @Description:  获取平台、私有协议数据
+     */
+    FinancialReceivablesAllVo queryDateByType(FinancialReceivablesQueryVo financialReceivablesQueryVo);
 }

+ 67 - 37
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -4,7 +4,6 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
@@ -13,6 +12,10 @@ import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.constants.enums.dict.agreement.ProductsType;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllVo;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesVo;
+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.service.EsmInsCompanyService;
@@ -47,7 +50,6 @@ import com.ydtech.utils.excel.ExcelStyleUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -61,18 +63,15 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.YearMonth;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -290,8 +289,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(), insAreaCompany.getJqpolicyno(),
                 insAreaCompany.getSypolicyno(), null, null, null, null, order.getProductid(), insAreaCompany.getPayDate(),
-          insAreaCompany.getSigningTime(), insAreaCompany.getCompanyId(), null, insFeeOrderNew.getAgreementId(), order.getLicenseno(),
-           insAreaCompany.getTaxamount(),
+                insAreaCompany.getSigningTime(), insAreaCompany.getCompanyId(), null, insFeeOrderNew.getAgreementId(), order.getLicenseno(),
+                insAreaCompany.getTaxamount(),
                 allNoTaxPremium, null, otherProportion, null, otherAmount, otherAmount, null, null, LocalDateTime.now(), null, null, null, "0"
                 , "0", "0", "1");
         //add by hxl  2024-07-31  修改插入结算表中险种信息错误的bug  将大订单中的险种信息改为小订单的险种信息
@@ -327,17 +326,17 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     private void saveInsuranceProcedures(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
 //        保险手续费
         BigDecimal handlingAmount = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsPremiums(),
-         insFeeOrderNew.getSySuperviseCostsPremiums(), null);
+                insFeeOrderNew.getSySuperviseCostsPremiums(), null);
         BigDecimal handlingProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(),
                 insFeeOrderNew.getSySuperviseCostsProportion(), null);
         BigDecimal allNoTaxPremium = this.calculateTotal(insFeeOrderNew.getJqNoTaxPremium(), insFeeOrderNew.getSyNoTaxPremium(), null);
         //不含税保费
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(), insAreaCompany.getJqpolicyno(),
-         insAreaCompany.getSypolicyno(), null, null, null, null, order.getProductid(), insAreaCompany.getPayDate(),
-          insAreaCompany.getSigningTime(), insAreaCompany.getCompanyId(), null, insFeeOrderNew.getAgreementId(), order.getLicenseno(),
-           insAreaCompany.getTaxamount()
+                insAreaCompany.getSypolicyno(), null, null, null, null, order.getProductid(), insAreaCompany.getPayDate(),
+                insAreaCompany.getSigningTime(), insAreaCompany.getCompanyId(), null, insFeeOrderNew.getAgreementId(), order.getLicenseno(),
+                insAreaCompany.getTaxamount()
                 , allNoTaxPremium, handlingProportion, null, handlingAmount, null, handlingAmount, null, null, LocalDateTime.now(), null,
- null, null, "0", "0", "0", "0");
+                null, null, "0", "0", "0", "0");
         BigDecimal allTaxPremium = this.calculateTotal(insFeeOrderNew.getJqPremium(), insFeeOrderNew.getSyPremium(), null);
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
         insPlyIncome.setSyPremium(insFeeOrderNew.getSyPremium());
@@ -426,31 +425,31 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
     private void savePinTai(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
         BigDecimal handlingAmount = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsPremiums(),
-         insFeeOrderNew.getSySuperviseCostsPremiums(), insFeeOrderNew.getNoSuperviseCostsPremiums());  //手续费
+                insFeeOrderNew.getSySuperviseCostsPremiums(), insFeeOrderNew.getNoSuperviseCostsPremiums());  //手续费
         BigDecimal handlingProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(),
-         insFeeOrderNew.getSySuperviseCostsProportion(), insFeeOrderNew.getNoSuperviseCostsProportion());//手续费比例
+                insFeeOrderNew.getSySuperviseCostsProportion(), insFeeOrderNew.getNoSuperviseCostsProportion());//手续费比例
         BigDecimal otherAmount = this.calculateTotal(insFeeOrderNew.getJqOtherCostsPremiums(), insFeeOrderNew.getSyOtherCostsPremiums(),
-         insFeeOrderNew.getNoOtherCostsPremiums());//跟单费
+                insFeeOrderNew.getNoOtherCostsPremiums());//跟单费
         BigDecimal otherProportion = this.calculateTotal(insFeeOrderNew.getSyOtherCostsProportion(),
-         insFeeOrderNew.getJqOtherCostsProportion(), insFeeOrderNew.getNoOtherCostsProportion()); //跟单费比例
+                insFeeOrderNew.getJqOtherCostsProportion(), insFeeOrderNew.getNoOtherCostsProportion()); //跟单费比例
 //      不含税保费
         BigDecimal allNoTaxPremium = this.calculateTotal(insFeeOrderNew.getJqNoTaxPremium(), insFeeOrderNew.getSyNoTaxPremium(),
-         insFeeOrderNew.getNoNoTaxPremium());
+                insFeeOrderNew.getNoNoTaxPremium());
         BigDecimal allAmount = this.calculateTotal(otherAmount, handlingAmount, null);
         BigDecimal jqReceivableProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(),
-         insFeeOrderNew.getJqOtherCostsProportion(), null);// 交强应收 比例
+                insFeeOrderNew.getJqOtherCostsProportion(), null);// 交强应收 比例
         BigDecimal syReceivableProportion = this.calculateTotal(insFeeOrderNew.getSySuperviseCostsProportion(),
-         insFeeOrderNew.getSyOtherCostsProportion(), null);//商业应收比例
+                insFeeOrderNew.getSyOtherCostsProportion(), null);//商业应收比例
         BigDecimal noReceivableProportion = this.calculateTotal(insFeeOrderNew.getNoSuperviseCostsProportion(),
-         insFeeOrderNew.getNoOtherCostsProportion(), null);
+                insFeeOrderNew.getNoOtherCostsProportion(), null);
 
         String noPolicyno = this.setNoPolicyno(insAreaCompany);
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(), insAreaCompany.getJqpolicyno(),
-         insAreaCompany.getSypolicyno(),
+                insAreaCompany.getSypolicyno(),
                 noPolicyno, null, null, null, order.getProductid(), insAreaCompany.getPayDate(), insAreaCompany.getSigningTime(),
-                 insAreaCompany.getCompanyId(),
+                insAreaCompany.getCompanyId(),
                 null, insFeeOrderNew.getAgreementId(), order.getLicenseno(), insAreaCompany.getTaxamount(), allNoTaxPremium,
-handlingProportion,
+                handlingProportion,
                 otherProportion, handlingAmount, otherAmount, allAmount, null, null, LocalDateTime.now(), null, null, null, "0", "0", "0", "0");
         insPlyIncome.setJqReceivableProportion(jqReceivableProportion);
         insPlyIncome.setSyReceivableProportion(syReceivableProportion);
@@ -568,7 +567,7 @@ handlingProportion,
             }
             if (StringUtils.isNotEmpty(insPlyIncomeVo.getId())) {
                 SettlementDocumentaryFeesEntity settlementDocumentaryFeesEntity =
-                 settlementDocumentaryFeesService.getById(insPlyIncomeVo.getId());
+                        settlementDocumentaryFeesService.getById(insPlyIncomeVo.getId());
 //                通过任务id查询 明细
                 String taskId = settlementDocumentaryFeesEntity.getTaskId();
                 List<String> incomeIds = incomeTaskRelationshipService.getByTaskId(taskId);
@@ -582,7 +581,7 @@ handlingProportion,
 
             pageHelper = new PageInfo(list);
             BasePageResult<InsPlyIncome> pageResult = new BasePageResult<InsPlyIncome>(insPlyIncomeVo.getPageNum(),
-             insPlyIncomeVo.getPageSize(), pageHelper.getTotal(), pageHelper.getPages(), list);
+                    insPlyIncomeVo.getPageSize(), pageHelper.getTotal(), pageHelper.getPages(), list);
             return HttpResult.ok(pageResult);
         } catch (Exception e) {
             e.printStackTrace();
@@ -800,7 +799,7 @@ handlingProportion,
             List<InsPlyIncome> list = this.baseMapper.NonSettlementQuery(params);
             pageHelper = new PageInfo(list);
             BasePageResult<InsPlyIncome> pageResult = new BasePageResult<InsPlyIncome>(insPlyIncomeVo.getPageNum(),
-             insPlyIncomeVo.getPageSize(), pageHelper.getTotal(), pageHelper.getPages(), list);
+                    insPlyIncomeVo.getPageSize(), pageHelper.getTotal(), pageHelper.getPages(), list);
             return HttpResult.ok(pageResult);
         } catch (Exception e) {
             e.printStackTrace();
@@ -1334,7 +1333,7 @@ handlingProportion,
             BigDecimal noPremium = initializationBigdecimal(insPlyIncomeVo.getNoPremium()); //非车保费
             //手续费比例
             insPlyIncome.setCommissionFeerate(this.calculateTotal(jqSuperviseCostsProportion, sySuperviseCostsProportion,
-             noSuperviseCostsProportion));  //手续费比例 = 商业手续费比例 +  交强手续费比例 + 非车手续费比例
+                    noSuperviseCostsProportion));  //手续费比例 = 商业手续费比例 +  交强手续费比例 + 非车手续费比例
             if (jqSuperviseCostsProportion != null && jqPremium != null) {
                 insPlyIncome.setJqSuperviseCostsPremiums(algorithmAmount(jqPremium, jqSuperviseCostsProportion));  //交强手续费
                 insPlyIncome.setJqSuperviseCostsProportion(jqSuperviseCostsProportion);
@@ -1622,9 +1621,9 @@ handlingProportion,
                 }
             } else {
 //                因为跟单没有关联表 也无法关联到开票表所以只能按照 条件去进行判断
-               if(StringUtils.isNotEmpty( insPlyIncome.getSettleOtherStatus())  && "1".equals( insPlyIncome.getSettleOtherStatus())){
-                   throw new SystemException("已经对账不能进行删除");
-               }
+                if(StringUtils.isNotEmpty( insPlyIncome.getSettleOtherStatus())  && "1".equals( insPlyIncome.getSettleOtherStatus())){
+                    throw new SystemException("已经对账不能进行删除");
+                }
             }
         }
 
@@ -1697,7 +1696,7 @@ handlingProportion,
         pageHelper = new PageInfo(list);
 
         return HttpResult.ok(new BasePageResult<>(insPlyIncomeVo.getPageNum(), insPlyIncomeVo.getPageSize(), pageHelper.getTotal(),
-         pageHelper.getPages(), list));
+                pageHelper.getPages(), list));
     }
 
     /**
@@ -1727,7 +1726,7 @@ handlingProportion,
         params.put("id", insPlyIncomeVo.getId());
         params.put("handlingFeesStatus", "1");
         SettlementDocumentaryFeesEntity parentSettlementDocumentaryFeesEntity =
-         settlementDocumentaryFeesService.getByParentSettlementAmount(params);
+                settlementDocumentaryFeesService.getByParentSettlementAmount(params);
 
         if (ObjectUtils.isNotEmpty(parentSettlementDocumentaryFeesEntity)) { // 多次结算
             BigDecimal totalAmount = parentSettlementDocumentaryFeesEntity.getTotalAmount();
@@ -2014,7 +2013,7 @@ handlingProportion,
 
 //         表内总金额
         SettlementDocumentaryFeesEntity byIdSettlementDocumentaryFeesEntity =
-         settlementDocumentaryFeesService.getById(insPlyIncomeVo.getId());
+                settlementDocumentaryFeesService.getById(insPlyIncomeVo.getId());
         BigDecimal invoicAmount = byIdSettlementDocumentaryFeesEntity.getTotalAmount();
 
 
@@ -2026,7 +2025,7 @@ handlingProportion,
         params.put("id", insPlyIncomeVo.getId());
         params.put("handlingFeesStatus", "0");
         SettlementDocumentaryFeesEntity parentSettlementDocumentaryFeesEntity =
-         settlementDocumentaryFeesService.getByParentSettlementAmount(params);
+                settlementDocumentaryFeesService.getByParentSettlementAmount(params);
 
         if (ObjectUtils.isNotEmpty(parentSettlementDocumentaryFeesEntity)) { // 多次结算
             BigDecimal totalAmount = parentSettlementDocumentaryFeesEntity.getTotalAmount();
@@ -3007,6 +3006,7 @@ handlingProportion,
         }
     }
 
+
     @Override
     public void batchUpdateVoucher(InsPlyIncomeVo insPlyIncomeVo) {
         String s = insPlyIncomeVo.getSelectIds().get(0);
@@ -3048,7 +3048,7 @@ handlingProportion,
     @Override
     public List<PlatformSettlementRecordDto> platformSettlementRecord(InsPlyIncomeVo insPlyIncomeVo) {
         if(insPlyIncomeVo.getPartnerCompaniesId()==null || "".equals(insPlyIncomeVo.getPartnerCompaniesId())){
-           throw new SystemException("合作公司编码(partnerCompaniesId)不能为空");
+            throw new SystemException("合作公司编码(partnerCompaniesId)不能为空");
         }
         if(insPlyIncomeVo.getHandlingFeesStatus()==null || "".equals(insPlyIncomeVo.getHandlingFeesStatus())){
             throw new SystemException("结算状态 0 未结算 1已结算(handlingFeesStatus)不能为空");
@@ -3272,6 +3272,36 @@ handlingProportion,
         }
         return HttpResult.ok();
     }
-
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/1 9:28
+     *  @Description:  查询平台、私有数据
+     */
+    @Override
+    public FinancialReceivablesAllVo queryDateByType(FinancialReceivablesQueryVo financialReceivablesQueryVo) {
+        //检查参数
+        if(StringUtils.isBlank(financialReceivablesQueryVo.getType())){
+            throw new SystemException("应收类型不能为空,1为平台2为私有,默认传1");
+        }
+        int year =0;
+        if(StringUtils.isBlank(financialReceivablesQueryVo.getYear())){
+            Calendar cale = Calendar.getInstance();
+            year = cale.get(Calendar.YEAR);
+        }else{
+            year = Integer.parseInt(financialReceivablesQueryVo.getYear());
+        }
+        financialReceivablesQueryVo.setBeginDate(SliceUpDateUtil.getYearBeginDateStr(year)+" 00:00:00");
+        financialReceivablesQueryVo.setBeginDate(SliceUpDateUtil.getYearEndDateStr(year)+" 23:59:59");
+        financialReceivablesQueryVo.setType("1");
+        //总应收
+        BigDecimal ptSumAmount =  baseMapper.queryDateByTypeSumAmount(financialReceivablesQueryVo);
+        financialReceivablesQueryVo.setType("2");
+        //总应收
+        BigDecimal sySumAmount =  baseMapper.queryDateByTypeSumAmount(financialReceivablesQueryVo);
+
+        List<FinancialReceivablesVo> list  =  baseMapper.queryDateByType(financialReceivablesQueryVo);
+
+        return new FinancialReceivablesAllVo(ptSumAmount.toString(),sySumAmount.toString(),year+"",list);
+    }
 }

+ 14 - 6
src/main/java/com/ydtech/modules/order/controller/PingAnOrderApiController.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.order.controller;
 
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.order.aop.QuoteVerification;
 import com.ydtech.modules.order.components.InsOrdersComponents;
@@ -14,15 +15,13 @@ import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
 import com.ydtech.modules.order.entity.vo.SpecialAuditVo;
 import com.ydtech.modules.order.entity.vo.bohai.ProductDetailsQueryVo;
-import com.ydtech.modules.order.entity.vo.pingan.InsDrivingIntentionInsuranceSonVo;
-import com.ydtech.modules.order.entity.vo.pingan.PingAnQuoteVo;
-import com.ydtech.modules.order.entity.vo.pingan.RenewalConfirmVo;
-import com.ydtech.modules.order.entity.vo.pingan.StorefrontQueryVo;
+import com.ydtech.modules.order.entity.vo.pingan.*;
 import com.ydtech.modules.order.service.PingAnOrderApiService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -144,7 +143,16 @@ public class PingAnOrderApiController {
      */
     @PostMapping("/recoverApplyVerifyCode")
     @ApiOperation(value = "5短信回收阅读状态")
-    public HttpResult<Object> recoverApplyVerifyCode(String companyId,String msgCode) throws Exception {
+    public HttpResult<Object> recoverApplyVerifyCode(@RequestBody RecoverApplyVerifyCodeVo recoverApplyVerifyCodeVo) throws Exception {
+
+        String companyId = recoverApplyVerifyCodeVo.getCompanyId();
+        String msgCode = recoverApplyVerifyCodeVo.getMsgCode();
+        if(StringUtils.isBlank(companyId)){
+            throw new SystemException("子订单id不能为空!!");
+        }
+        if(StringUtils.isBlank(msgCode)){
+            throw new SystemException("短信验证码不能为空!!");
+        }
         return this.pingAnOrderApiService.recoverApplyVerifyCode(companyId,msgCode);
     }
     /**
@@ -166,7 +174,7 @@ public class PingAnOrderApiController {
      */
     @PostMapping("/payReturn")
     @ApiOperation(value = "7支付回调-更新承保状态")
-    public HttpResult<Object> payReturn(PayReturnRequest payReturnRequest) throws Exception {
+    public HttpResult<Object> payReturn(@RequestBody PayReturnRequest payReturnRequest) throws Exception {
         return this.pingAnOrderApiService.payReturn(payReturnRequest);
     }
     /**

+ 20 - 0
src/main/java/com/ydtech/modules/order/entity/vo/pingan/RecoverApplyVerifyCodeVo.java

@@ -0,0 +1,20 @@
+package com.ydtech.modules.order.entity.vo.pingan;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/8/1 15:53
+ *  @Description:
+ */
+@Data
+@ApiModel(value = "短线验证对象")
+public class RecoverApplyVerifyCodeVo {
+
+     private  String  companyId;
+
+
+     private String msgCode;
+}

+ 28 - 21
src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java

@@ -84,7 +84,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
     private final PingAnApiConfigurationProperties properties;
 
     private final InsUploadFilesService insUploadFilesService;
-    
+
 
 
 
@@ -277,7 +277,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
                                                   SearchPAVehicleListResponse.ModelsDto modelsDto,String userId,
                                                   PinganApiLog pinganApiLog,
                                                   CarConfirmResponse carConfirmResponse
-                                                  ) {
+    ) {
 
         PingAnQuoteRespVo quoteRespVo = new PingAnQuoteRespVo();
         CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
@@ -390,7 +390,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
                                                  String userId,
                                                  PinganApiLog pinganApiLog,
                                                  CarConfirmResponse carConfirmResponse
-                                                 ) {
+    ) {
         // 保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
         //平安业务id
@@ -595,13 +595,13 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
                                 jqflag = true;
                             }
                         }
-                        if ("单交".equals(insAreaCompany.getProduct()) && !jqflag) {
-                            insAreaCompany.setJqpolicyno(bizApplyNo);
-                        } else if (("交三".equals(insAreaCompany.getProduct()) || "交商".equals(insAreaCompany.getProduct())) && !jqflag && !sqflag) {
-                            insAreaCompany.setJqpolicyno(bizApplyNo);
-                            insAreaCompany.setSypolicyno(forceApplyNo);
-                        } else if (("单商".equals(insAreaCompany.getProduct()) || "单三".equals(insAreaCompany.getProduct())) && !sqflag) {
-                            insAreaCompany.setSypolicyno(forceApplyNo);
+                        if ("单交".equals(insAreaCompany.getProduct()) && jqflag) {
+                            insAreaCompany.setJqapplyno(forceApplyNo);
+                        } else if (("交三".equals(insAreaCompany.getProduct()) || "交商".equals(insAreaCompany.getProduct())) && jqflag && sqflag) {
+                            insAreaCompany.setJqpolicyno(forceApplyNo);
+                            insAreaCompany.setSyapplyno(bizApplyNo);
+                        } else if (("单商".equals(insAreaCompany.getProduct()) || "单三".equals(insAreaCompany.getProduct())) && sqflag) {
+                            insAreaCompany.setSyapplyno(bizApplyNo);
                         }
                         //说明核保成功,更新大订单和小订单的状态为1  更新为已核保待缴费
                         insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
@@ -1194,10 +1194,14 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         // 通过 协议id获取配置实体
         PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
                 ptlAgreementAttribution);
-        String bizApplyNo = insAreaCompany.getJqpolicyno();
-        String forceApplyNo = insAreaCompany.getSypolicyno();
-        SignEleApplyRequest signEleApplyRequest = new SignEleApplyRequest(parameters.getUserId(), bizApplyNo, forceApplyNo, String.valueOf(System.currentTimeMillis()), "GET", null);
+        String  forceApplyNo = insAreaCompany.getJqapplyno();
+        String bizApplyNo= insAreaCompany.getSyapplyno();
+
+        String signatureUrl = properties.getSignatureUrl();
+        signatureUrl=signatureUrl+"?companyId=" +companyId;
+        SignEleApplyRequest signEleApplyRequest = new SignEleApplyRequest(parameters.getUserId(), bizApplyNo, forceApplyNo, String.valueOf(System.currentTimeMillis()), "GET", signatureUrl);
         SignEleApplyResponse signEleApplyResponse = null;
+
         PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
         try {
             signEleApplyResponse = pinganRequestApiComponents.signEleApply(signEleApplyRequest,pinganApiLog);
@@ -1223,8 +1227,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         // 通过 协议id获取配置实体
         PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
                 ptlAgreementAttribution);
-        String forceApplyNo = insAreaCompany.getJqpolicyno();
-        String  bizApplyNo= insAreaCompany.getSypolicyno();
+        String forceApplyNo = insAreaCompany.getJqapplyno();
+        String  bizApplyNo= insAreaCompany.getSyapplyno();
         ApplyVerifyCodeRequest applyVerifyCodeRequest = new ApplyVerifyCodeRequest(parameters.getUserId(), bizApplyNo, forceApplyNo);
         ApplyVerifyCodeResponse applyVerifyCodeResponse = null;
         PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
@@ -1249,8 +1253,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         // 通过 协议id获取配置实体
         PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
                 ptlAgreementAttribution);
-        String bizApplyNo = insAreaCompany.getJqpolicyno();
-        String forceApplyNo = insAreaCompany.getSypolicyno();
+        String forceApplyNo= insAreaCompany.getJqapplyno();
+        String  bizApplyNo = insAreaCompany.getSyapplyno();
         RecoverApplyVerifyCodeRequest recoverApplyVerifyCodeRequest = new RecoverApplyVerifyCodeRequest(parameters.getUserId(), bizApplyNo, forceApplyNo,issueCode,null);
         RecoverApplyVerifyCodeResponse recoverApplyVerifyCodeResponse = null;
         PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
@@ -1259,7 +1263,11 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         } catch (Exception e) {
             throw new SystemException(e.getMessage());
         }
-        return HttpResult.ok(recoverApplyVerifyCodeResponse);
+        if (recoverApplyVerifyCodeResponse != null && "0".equals(recoverApplyVerifyCodeResponse.getResultCode())) {
+            return createNotice(companyId);
+        }else{
+            throw new SystemException(recoverApplyVerifyCodeResponse.getResultMessage());
+        }
     }
     /**
      *  @version
@@ -1275,8 +1283,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         // 通过 协议id获取配置实体
         PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
                 ptlAgreementAttribution);
-        String bizApplyNo = insAreaCompany.getJqpolicyno();
-        String forceApplyNo = insAreaCompany.getSypolicyno();
+        String forceApplyNo= insAreaCompany.getJqapplyno();
+        String  bizApplyNo = insAreaCompany.getSyapplyno();
         //生成通知单号
         ArrayList<String>  noticelist =new ArrayList<String>();
         if (StringUtils.isNotBlank(bizApplyNo)) {
@@ -1317,7 +1325,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
             return HttpResult.error("二维码支付接口报错");
         }
         insAreaCompany.setPaymentLink(payUrl);
-
         return HttpResult.ok(payUrl);
     }
     /**

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

@@ -2440,5 +2440,75 @@
 
     </select>
 
+    <select id="queryDateByTypeSumAmount" resultType="java.math.BigDecimal">
+        SELECT
+          SUM(IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ))
+        FROM
+        ins_ply_income a
+        LEFT JOIN
+        ptl_agreement pa ON pa.id = a.agreement_id
+        <where>
+            <if test="vo.type !=null  and  vo.type  !=''">
+                and pa.agreement_type =#{vo.type}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+    </select>
+
+    <select id="queryDateByType"
+            resultType="com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesVo">
+        select
+        a.years as yearAndMonth,
+        a.commissionFeevalue as commissionFeevalue,
+        a.noInvoicCommissionFeevalue as noInvoicCommissionFeevalue,
+        a.readyCommissionFeevalue  as readyCommissionFeevalue,
+        b.settlementAmount as settlementAmount,
+        b.noSettlementAmount as noSettlementAmount
+        from (
+        SELECT
+        DATE_FORMAT( a.create_time, '%Y-%m' ) as years,
+        SUM(IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 )) AS commissionFeevalue,
+        SUM(CASE WHEN a.handling_fees_status = '0' THEN IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ) ELSE 0 END ) AS noInvoicCommissionFeevalue,
+        SUM(CASE WHEN a.handling_fees_status = '1' THEN IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ) ELSE 0 END) AS readyCommissionFeevalue
+        FROM
+        ins_ply_income a
+        LEFT JOIN
+        ptl_agreement pa ON pa.id = a.agreement_id
+        <where>
+            1=1
+            <if test="vo.type !=null  and  vo.type  !=''">
+                and pa.agreement_type =#{vo.type}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  a.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+        a.create_time  BETWEEN '2024-01-01 00:00:00' AND '2024-12-31 23:59:59'
+        GROUP BY
+        DATE_FORMAT( a.create_time, '%Y-%m' )
+
+        )  a   left join
+        (
+        SELECT
+        DATE_FORMAT( a.create_time, '%Y-%m' ) as years,
+        SUM(IFNULL(a.settlement_amount ,0 )) as  settlementAmount,
+        SUM(IFNULL(a.total_amount ,0 ) -IFNULL(a.settlement_amount ,0 ) ) AS noSettlementAmount
+        FROM
+        settlement_documentary_fees_2024_06_30 a
+        <where>
+            a.settlement_status=2
+            <if test="vo.type !=null  and  vo.type  !=''">
+                and  a.agreement_type =#{vo.type}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  a.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+        GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' )
+        )  b  on a.years =b.years
+    </select>
+
 
 </mapper>