Ver Fonte

Merge remote-tracking branch 'origin/test' into test

hxl13994548489 há 2 anos atrás
pai
commit
3aef369ba2
20 ficheiros alterados com 495 adições e 35 exclusões
  1. 5 1
      src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java
  2. 3 0
      src/main/java/com/ydtech/modules/fnc/dto/PlatformSettlementRecordDto.java
  3. 2 0
      src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java
  4. 37 15
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  5. 3 0
      src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java
  6. 27 9
      src/main/java/com/ydtech/modules/order/controller/ExcelExportController.java
  7. 7 0
      src/main/java/com/ydtech/modules/order/dao/InsOrdersMapper.java
  8. 3 1
      src/main/java/com/ydtech/modules/order/entity/api/zijin/constants/enums/FileTypeEnum.java
  9. 17 0
      src/main/java/com/ydtech/modules/order/entity/vo/AuditExportQueryVo.java
  10. 160 0
      src/main/java/com/ydtech/modules/order/entity/vo/AuditExportVo.java
  11. 8 3
      src/main/java/com/ydtech/modules/order/service/ExcelExportService.java
  12. 29 3
      src/main/java/com/ydtech/modules/order/service/impl/ExcelExportServiceImpl.java
  13. 6 0
      src/main/java/com/ydtech/modules/protocol/controller/PtlAgreementController.java
  14. 2 0
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementService.java
  15. 14 0
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java
  16. 26 3
      src/main/java/com/ydtech/utils/ExcelUtils.java
  17. 78 0
      src/main/java/com/ydtech/utils/OrderUtils.java
  18. 14 0
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  19. 54 0
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml
  20. BIN
      src/main/resources/template/finance_audit_detail.xlsx

+ 5 - 1
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -449,7 +449,11 @@ public class InsPlyIncomeController extends BaseController {
     public HttpResult<InsPlyIncome> ptInsert(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
         return insPlyIncomeService.ptInsert(insPlyIncomeVo);
     }
-
+    @PutMapping("/batchPinBalanceNew")
+    @ApiModelProperty(value = "平台批量结算")
+    public HttpResult<Object> batchPinBalanceNew(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return insPlyIncomeService.batchPinBalanceNew(insPlyIncomeVo);
+    }
 }
 
 

+ 3 - 0
src/main/java/com/ydtech/modules/fnc/dto/PlatformSettlementRecordDto.java

@@ -22,4 +22,7 @@ public class PlatformSettlementRecordDto implements Serializable {
 
     @ApiModelProperty(value = "进账金额")
     private BigDecimal settlementAmount;
+
+    @ApiModelProperty(value = "凭证")
+    private String imageUrl;
 }

+ 2 - 0
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -155,4 +155,6 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
 
     void updateNoHand(InsPlyIncomeVo insPlyIncomeVo);
 
+    HttpResult<Object> batchPinBalanceNew(InsPlyIncomeVo insPlyIncomeVo);
+
 }

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

@@ -787,6 +787,7 @@ handlingProportion,
         BigDecimal totalOtherAmount = BigDecimal.ZERO;
         HashMap<String, Object> resultHashMap = new HashMap<>();
         HashSet<String> partnerCompaniesIdSet = new HashSet<>();
+        List<String> ids = new ArrayList<>();
         LocalDateTime now = LocalDateTime.now();
         String  reason ="";
         ArrayList<HashMap<String, Object>> resultNoSelect = new ArrayList<>();
@@ -830,23 +831,23 @@ handlingProportion,
                             reason="非车应收比例错误!";
                         }
                     }
-                    if (insPlyIncome.getAllFeeValue() != null && insPlyIncome.getAllFeeValue().compareTo(BigDecimal.ZERO) != 0) {
-                        totalAmount = totalAmount.add(insPlyIncome.getAllFeeValue());  //总金额
-                    }
-                    if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
-                        totalHandingAmount = totalHandingAmount.add(insPlyIncome.getCommissionFeevalue());  //总手续费
-                    }
-                    if (insPlyIncome.getOtherFeevalue() != null && insPlyIncome.getOtherFeevalue().compareTo(BigDecimal.ZERO) != 0) {
-                        totalOtherAmount = totalOtherAmount.add(insPlyIncome.getOtherFeevalue());   //总跟单费
-                    }
-                        insPlyIncome.setSettlementUserId(BaseController.getUser().getId());
-                        insPlyIncome.setSettlementTime(now);
-                        insPlyIncome.setHandlingFeesStatus("1");
-                        baseMapper.updateById(insPlyIncome);
                     //判断是否是相同保司机构
                     partnerCompaniesIdSet.add(insPlyIncome.getPartnerCompaniesId());
-                    objectObjectHashMap.put("reason",reason);
-                    resultNoSelect.add(objectObjectHashMap);  // 添加未匹配的车牌号
+                    if(StringUtils.isNotEmpty(reason)){
+                        objectObjectHashMap.put("reason",reason);
+                        resultNoSelect.add(objectObjectHashMap);  // 添加未匹配的车牌号
+                    }else {
+                        ids.add(insPlyIncome.getId());
+                        if (insPlyIncome.getAllFeeValue() != null && insPlyIncome.getAllFeeValue().compareTo(BigDecimal.ZERO) != 0) {
+                            totalAmount = totalAmount.add(insPlyIncome.getAllFeeValue());  //总金额
+                        }
+                        if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
+                            totalHandingAmount = totalHandingAmount.add(insPlyIncome.getCommissionFeevalue());  //总手续费
+                        }
+                        if (insPlyIncome.getOtherFeevalue() != null && insPlyIncome.getOtherFeevalue().compareTo(BigDecimal.ZERO) != 0) {
+                            totalOtherAmount = totalOtherAmount.add(insPlyIncome.getOtherFeevalue());   //总跟单费
+                        }
+                    }
                 } else {
                     objectObjectHashMap.put("reason","未查询车辆");
                     resultNoSelect.add(objectObjectHashMap);  // 添加未匹配的车牌号
@@ -859,6 +860,7 @@ handlingProportion,
             resultHashMap.put("totalHandingAmount", totalHandingAmount);
             resultHashMap.put("totalOtherAmount", totalOtherAmount);
             resultHashMap.put("resultList", resultNoSelect);
+            resultHashMap.put("settIdList",ids);
             return resultHashMap;
         } catch (IOException e) {
             throw new SystemException("导入失败!");
@@ -1240,6 +1242,26 @@ handlingProportion,
         this.saveLog(insPlyIncomeVo);
     }
 
+    @Override
+    public HttpResult<Object> batchPinBalanceNew(InsPlyIncomeVo insPlyIncomeVo) {
+        LocalDateTime now = LocalDateTime.now();
+        if(!CollectionUtils.isEmpty(insPlyIncomeVo.getSettIdList())){
+            for (String  id : insPlyIncomeVo.getSettIdList()){
+                InsPlyIncome insPlyIncome = baseMapper.getById(id);
+                if("1".equals(insPlyIncome.getHandlingFeesStatus())){
+                    throw new SystemException("有已结算数据");
+                }
+                insPlyIncome.setSettlementImageId(insPlyIncomeVo.getSettlementImageId());
+                insPlyIncome.setSettlementUserId(BaseController.getUser().getId());
+                insPlyIncome.setSettlementTime(now);
+                insPlyIncome.setId(id);
+                insPlyIncome.setHandlingFeesStatus("1");
+                baseMapper.updateById(insPlyIncome);
+            }
+        }
+        return HttpResult.ok();
+    }
+
     /**
      * @param insPlyIncomeVo
      * @param insPlyIncome   重新计算金额  通过比例

+ 3 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java

@@ -391,4 +391,7 @@ public class InsPlyIncomeVo implements Serializable {
     @ApiModelProperty(value = "结算日期")
     private String settlementDate;
 
+    @ApiModelProperty(value = "平台导入结算IdList")
+    private List<String> settIdList;
+
 }

+ 27 - 9
src/main/java/com/ydtech/modules/order/controller/ExcelExportController.java

@@ -38,16 +38,16 @@ public class ExcelExportController extends BaseController {
 
     @PostMapping("/carBusinessDetailExcelExport")
     @ApiOperation("车险业务明细表导出")
-    public HttpResult<QuoteRespVo> carBusinessDetail(@RequestBody CarBusinessDetailQueryVo carBusinessDetailQueryVo) {
+    public HttpResult<Object> carBusinessDetail(@RequestBody CarBusinessDetailQueryVo carBusinessDetailQueryVo) {
         List<CarBusinessDetailVo> carBusinessDetailList = excelExportService.getCarBusinessDetailList(getUserId(), carBusinessDetailQueryVo);
-        ExcelUtils<CarBusinessDetailVo> excelUtils = new ExcelUtils<CarBusinessDetailVo>();
+        ExcelUtils<CarBusinessDetailVo> excelUtils = new ExcelUtils<>(CarBusinessDetailVo.class);
         //读取模版文件
-        String templatePath = ResourceLoader.class.getClassLoader().getResource("template/car_business_detail.xlsx").getPath();
+//        String templatePath = ResourceLoader.class.getClassLoader().getResource("template/car_business_detail.xlsx").getPath();
         String fileName = "车险业务明细" + System.currentTimeMillis() + ".xlsx";
         String saveFilePath = uploadPath+"//" + EXCEL_PATH + fileName;
         String resultPath = UPLOAD_PATH + fileName;
         String sheetName = "车险业务明细表";
-        if(excelUtils.writeExcel(templatePath,saveFilePath,sheetName, CarBusinessDetailVo.class,carBusinessDetailList)){
+        if(excelUtils.writeExcel(saveFilePath,sheetName, carBusinessDetailList)){
             return HttpResult.ok(resultPath);
         }else{
             return HttpResult.error("导出车险业务明细表失败");
@@ -55,21 +55,39 @@ public class ExcelExportController extends BaseController {
     }
 
     @PostMapping("/revenueExpenditureDetailExcelExport")
-    @ApiModelProperty("收支明细表导出")
-    public HttpResult<QuoteRespVo> revenueExpenditureDetailExcelExport(@RequestBody CarBusinessDetailQueryVo carBusinessDetailQueryVo) {
+    @ApiOperation("收支明细表导出")
+    public HttpResult<Object> revenueExpenditureDetailExcelExport(@RequestBody CarBusinessDetailQueryVo carBusinessDetailQueryVo) {
         List<RevenueExpenditureDetailVo> revenueExpenditureDetailList = excelExportService.getRevenueExpenditureDetailList(getUserId(), carBusinessDetailQueryVo);
-        ExcelUtils<RevenueExpenditureDetailVo> excelUtils = new ExcelUtils<RevenueExpenditureDetailVo>();
+        ExcelUtils<RevenueExpenditureDetailVo> excelUtils = new ExcelUtils<>(RevenueExpenditureDetailVo.class);
         //读取模版文件
-        String templatePath = ResourceLoader.class.getClassLoader().getResource("template/revenue_expenditure_detail.xlsx").getPath();
+//        String templatePath = ResourceLoader.class.getClassLoader().getResource("template/revenue_expenditure_detail.xlsx").getPath();
         String fileName = "收支明细表" + System.currentTimeMillis() + ".xlsx";
         String saveFilePath = uploadPath+"//" + EXCEL_PATH + fileName;
         String resultPath = UPLOAD_PATH + fileName;
         String sheetName = "收支明细表";
-        if(excelUtils.writeExcel(templatePath,saveFilePath,sheetName, RevenueExpenditureDetailVo.class,revenueExpenditureDetailList)){
+        if(excelUtils.writeExcel(saveFilePath,sheetName, revenueExpenditureDetailList)){
             return HttpResult.ok(resultPath);
         }else{
             return HttpResult.error("导出收支明细表失败");
         }
     }
 
+    @PostMapping("/financeAuditDetailExcelExport")
+    @ApiOperation("财务审核明细导出")
+    public HttpResult<Object> financeAuditDetailExcelExport(@RequestBody AuditExportQueryVo auditExportQueryVo){
+        List<AuditExportVo> auditExportList = excelExportService.getAuditExportList(auditExportQueryVo);
+        ExcelUtils<AuditExportVo> excelUtils = new ExcelUtils<>(AuditExportVo.class);
+        //读取模版文件
+//        String templatePath = ResourceLoader.class.getClassLoader().getResource("template/finance_audit_detail.xlsx").getPath();
+        String fileName = "财务审核明细表" + System.currentTimeMillis() + ".xlsx";
+        String saveFilePath = uploadPath+"//" + EXCEL_PATH + fileName;
+        String resultPath = UPLOAD_PATH + fileName;
+        String sheetName = "财务审核明细表";
+        if(excelUtils.writeExcel(saveFilePath,sheetName, auditExportList)){
+            return HttpResult.ok(resultPath);
+        }else{
+            return HttpResult.error("导出财务审核明细表失败");
+        }
+    }
+
 }

+ 7 - 0
src/main/java/com/ydtech/modules/order/dao/InsOrdersMapper.java

@@ -106,4 +106,11 @@ public interface InsOrdersMapper extends BaseMapper<InsOrders> {
      */
     List<RevenueExpenditureDetailVo> getRevenueExpenditureDetailList(@Param("userId") String userId,@Param("param") CarBusinessDetailQueryVo carBusinessDetailQueryVo);
 
+    /**
+     * 获取财务审核明细列表
+     * @param auditExportQueryVo
+     * @return
+     */
+    List<AuditExportVo> getAuditExportList(@Param("param") AuditExportQueryVo auditExportQueryVo);
+
 }

+ 3 - 1
src/main/java/com/ydtech/modules/order/entity/api/zijin/constants/enums/FileTypeEnum.java

@@ -24,7 +24,9 @@ public enum FileTypeEnum {
     FT_7("7", "单证", new String[]{}),
     FT_8("8", "申请书", new String[]{}),
     FT_9("9", "其他", new String[]{}),
-    FT_19("19", "实名缴费证明", new String[]{}),
+    FT_19("19", "实名缴费证明", new String[]{
+            InsuranceImageEnum.GX00.getCode(),
+    }),
     FT_51("51", "银行卡", new String[]{}),
     FT_52("52", "驾驶证", new String[]{}),
     FT_53("53", "身份证", new String[]{

+ 17 - 0
src/main/java/com/ydtech/modules/order/entity/vo/AuditExportQueryVo.java

@@ -0,0 +1,17 @@
+package com.ydtech.modules.order.entity.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class AuditExportQueryVo {
+
+    @ApiModelProperty("签单日期起始时间")
+    private String signStartDate;
+
+    @ApiModelProperty("签单日期终止时间")
+    private String signEndDate;
+
+    @ApiModelProperty("审核状态")
+    private String audit;
+}

+ 160 - 0
src/main/java/com/ydtech/modules/order/entity/vo/AuditExportVo.java

@@ -0,0 +1,160 @@
+package com.ydtech.modules.order.entity.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.ydtech.modules.nai.httpvo.excel.Excel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 审核导出表 Vo
+ */
+@Data
+public class AuditExportVo {
+
+    @ApiModelProperty("保险公司id")
+    @ExcelIgnore
+    private String companyId;
+
+    @ApiModelProperty("接口类型")
+    @ExcelIgnore
+    private String apiType;
+
+    @ApiModelProperty("驾意json字符串")
+    @ExcelIgnore
+    private String crossInsurance;
+
+    @ApiModelProperty("渠道")
+    @ExcelProperty("渠道")
+    private String username;
+
+    @ApiModelProperty("出单日期")
+    @ExcelProperty("出单日期")
+    private String signingTime;
+
+    @ApiModelProperty("车牌号")
+    @ExcelProperty("车牌号")
+    private String licenseno;
+
+    @ApiModelProperty("被保险人")
+    @ExcelProperty("被保险人")
+    private String applyname;
+
+    @ApiModelProperty("承保公司")
+    @ExcelProperty("承保公司")
+    private String insCompany;
+
+    @ApiModelProperty("险种")
+    @ExcelProperty("险种")
+    private String product;
+
+    @ApiModelProperty("合作公司")
+    @ExcelProperty("合作公司")
+    private String namesimple;
+
+    @ApiModelProperty("交强保单号")
+    @ExcelProperty("交强保单号")
+    private String jqapplyno;
+
+    @ApiModelProperty("商业保单号")
+    @ExcelProperty("商业保单号")
+    private String syapplyno;
+
+    @ApiModelProperty("非车保单号")
+    @ExcelProperty("非车保单号")
+    private String jyapplyno;
+
+    @ApiModelProperty("交强保费")
+    @ExcelProperty("交强保费")
+    private String jqpremium;
+
+    @ApiModelProperty("车船税")
+    @ExcelProperty("车船税")
+    private String taxamount;
+
+    @ApiModelProperty("商业保费")
+    @ExcelProperty("商业保费")
+    private String sypremium;
+
+    @ApiModelProperty("非车保费")
+    @ExcelProperty("非车保费")
+    private String jypremium;
+
+    @ApiModelProperty("交强出口比例")
+    @ExcelProperty("交强出口比例")
+    private String jqExportProportion;
+
+    @ApiModelProperty("商业出口比例")
+    @ExcelProperty("商业出口比例")
+    private String syExportProportion;
+
+    @ApiModelProperty("非车出口比例")
+    @ExcelProperty("非车出口比例")
+    private String noExportProportion;
+
+    @ApiModelProperty("结算金额")
+    @ExcelProperty("结算金额")
+    private String settlement;
+
+    @ApiModelProperty("交强入口")
+    @ExcelProperty("交强入口")
+    private String jqEntranceProportion;
+
+    @ApiModelProperty("商业入口")
+    @ExcelProperty("商业入口")
+    private String syEntranceProportion;
+
+    @ApiModelProperty("非车入口")
+    @ExcelProperty("非车入口")
+    private String noEntranceProportion;
+
+    @ApiModelProperty("应收金额")
+    @ExcelProperty("应收金额")
+    private String receivable;
+
+    @ApiModelProperty("一级机构管理费")
+    @ExcelProperty("一级机构管理费")
+    private String deptPremiumsLevel1;
+
+    @ApiModelProperty("二级机构管理费")
+    @ExcelProperty("二级机构管理费")
+    private String deptPremiumsLevel2;
+
+    @ApiModelProperty("三级机构管理费")
+    @ExcelProperty("三级机构管理费")
+    private String deptPremiumsLevel3;
+
+    @ApiModelProperty("四级机构管理费")
+    @ExcelProperty("四级机构管理费")
+    private String deptPremiumsLevel4;
+
+    @ApiModelProperty("五级机构管理费")
+    @ExcelProperty("五级机构管理费")
+    private String deptPremiumsLevel5;
+
+    @ApiModelProperty("一级分销金额")
+    @ExcelProperty("一级分销金额")
+    private String firstDetailPremiums;
+
+    @ApiModelProperty("二级分销金额")
+    @ExcelProperty("二级分销金额")
+    private String secondDetailPremiums;
+
+    @ApiModelProperty("三级分销金额")
+    @ExcelProperty("三级分销金额")
+    private String thirdDetailPremiums;
+
+    @ApiModelProperty("交强利润差值")
+    @ExcelProperty("交强利润差值")
+    private String jqProfitMarginPremiums;
+
+    @ApiModelProperty("商业利润差值")
+    @ExcelProperty("商业利润差值")
+    private String syProfitMarginPremiums;
+
+    @ApiModelProperty("非车利润差值")
+    @ExcelProperty("非车利润差值")
+    private String noProfitMarginPremiums;
+
+
+}

+ 8 - 3
src/main/java/com/ydtech/modules/order/service/ExcelExportService.java

@@ -1,8 +1,6 @@
 package com.ydtech.modules.order.service;
 
-import com.ydtech.modules.order.entity.vo.CarBusinessDetailQueryVo;
-import com.ydtech.modules.order.entity.vo.CarBusinessDetailVo;
-import com.ydtech.modules.order.entity.vo.RevenueExpenditureDetailVo;
+import com.ydtech.modules.order.entity.vo.*;
 
 import java.util.List;
 
@@ -23,4 +21,11 @@ public interface ExcelExportService {
      * @return
      */
     List<RevenueExpenditureDetailVo> getRevenueExpenditureDetailList(String userId,CarBusinessDetailQueryVo carBusinessDetailQueryVo);
+
+    /**
+     * 获取财务审核明细列表
+     * @param auditExportQueryVo
+     * @return
+     */
+    List<AuditExportVo>  getAuditExportList(AuditExportQueryVo auditExportQueryVo);
 }

+ 29 - 3
src/main/java/com/ydtech/modules/order/service/impl/ExcelExportServiceImpl.java

@@ -3,12 +3,12 @@ package com.ydtech.modules.order.service.impl;
 import com.ydtech.constants.enums.dict.BusinessPropertyEnum;
 import com.ydtech.constants.enums.dict.BusinessSegmentsEnum;
 import com.ydtech.constants.enums.dict.BusinessSegmentsSZEnum;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.order.dao.InsOrdersMapper;
-import com.ydtech.modules.order.entity.vo.CarBusinessDetailQueryVo;
-import com.ydtech.modules.order.entity.vo.CarBusinessDetailVo;
-import com.ydtech.modules.order.entity.vo.RevenueExpenditureDetailVo;
+import com.ydtech.modules.order.entity.vo.*;
 import com.ydtech.modules.order.service.ExcelExportService;
 import com.ydtech.modules.order.service.InsOrdersService;
+import com.ydtech.utils.OrderUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -42,6 +42,12 @@ public class ExcelExportServiceImpl implements ExcelExportService {
         return carBusinessDetailList;
     }
 
+    /**
+     * 收支明细表导出
+     * @param userId
+     * @param carBusinessDetailQueryVo
+     * @return
+     */
     @Override
     public List<RevenueExpenditureDetailVo> getRevenueExpenditureDetailList(String userId, CarBusinessDetailQueryVo carBusinessDetailQueryVo) {
         if(carBusinessDetailQueryVo.getSignStartDate() == null || carBusinessDetailQueryVo.getSignEndDate() == null) {
@@ -64,4 +70,24 @@ public class ExcelExportServiceImpl implements ExcelExportService {
         return revenueExpenditureDetailList;
     }
 
+    /**
+     * 获取财务审核明细列表
+     * @param auditExportQueryVo
+     * @return
+     */
+    @Override
+    public List<AuditExportVo> getAuditExportList(AuditExportQueryVo auditExportQueryVo) {
+        if(auditExportQueryVo.getSignStartDate() == null || auditExportQueryVo.getSignEndDate() == null){
+            throw new SystemException("请选择签单的查询时间");
+        }
+        List<AuditExportVo> auditExportList = insOrdersMapper.getAuditExportList(auditExportQueryVo);
+        auditExportList.forEach(item->{
+            //获取驾意险保单号
+            if(item.getCrossInsurance() != null) {
+                item.setJyapplyno(OrderUtils.getJyPolicyNo(item.getCompanyId(), item.getApiType(), item.getCrossInsurance()));
+            }
+        });
+        return auditExportList;
+    }
+
 }

+ 6 - 0
src/main/java/com/ydtech/modules/protocol/controller/PtlAgreementController.java

@@ -67,6 +67,12 @@ public class PtlAgreementController extends BaseController {
         return HttpResult.ok(buildPageResponse(pageResultHttpResult));
     }
 
+    @GetMapping("getAllAgreement")
+    @ApiOperation("获取所有协议")
+    public HttpResult<List<PtlAgreement>>  getAllAgreement(){
+        return HttpResult.ok(ptlAgreementService.getAllAgreement());
+    }
+
     @PostMapping("/list")
     @ApiOperation("根据保险公司查询协议列表")
     public HttpResult<List<PtlAgreement>> list(@RequestBody PtlAgreementPageVo ptlAgreementPageVo) {

+ 2 - 0
src/main/java/com/ydtech/modules/protocol/service/PtlAgreementService.java

@@ -239,4 +239,6 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
 
     List<PtlAgreementInsCompanyDto> getExternalAgreement();
 
+    List<PtlAgreement> getAllAgreement();
+
 }

+ 14 - 0
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -852,5 +852,19 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         return result;
     }
 
+    @Override
+    public List<PtlAgreement> getAllAgreement() {
+        LocalDateTime now = LocalDateTime.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String currentTime = now.format(formatter);
+
+        List<PtlAgreement> ptlAgreements = baseMapper.selectList(new LambdaQueryWrapper<PtlAgreement>()                // 协议起期
+                .le(PtlAgreement::getStartDate, currentTime)
+                // 协议止期
+                .ge(PtlAgreement::getEndDate, currentTime)
+                .eq(PtlAgreement::getValidStatus, "1"));
+        return ptlAgreements;
+    }
+
 
 }

+ 26 - 3
src/main/java/com/ydtech/utils/ExcelUtils.java

@@ -3,24 +3,47 @@ package com.ydtech.utils;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.write.metadata.WriteSheet;
 
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
 import java.util.List;
 
 /**
  * excel操作类  使用 easyexcel类库
  */
 public class ExcelUtils<T> {
+    private final Class<T> clazz;
+
+    public ExcelUtils(Class<T> clazz) {
+        this.clazz = clazz;
+    }
+
 
     /**
      * 写入到Xls文件中
      * @param templatePath  模板路径
      * @param saveFileName  保存的文件名称
      * @param sheetName     sheet名称
-     * @param cls           写入得数据实体类
      * @param data          数据
      */
-    public boolean writeExcel(String templatePath,String saveFileName, String sheetName, Class cls, List<T> data){
+    public boolean writeExcel(String templatePath,String saveFileName, String sheetName, List<T> data){
+        try {
+            EasyExcel.write(saveFileName, clazz).withTemplate(templatePath).sheet(sheetName).doWrite(data);
+            return true;
+        }catch(Exception e){
+            return false;
+        }
+    }
+
+    /**
+     * 写入到Xls文件中
+     * @param saveFileName  保存的文件名称
+     * @param sheetName     sheet名称
+     * @param data          数据
+     * @return
+     */
+    public boolean writeExcel(String saveFileName, String sheetName,List<T> data) {
         try {
-            EasyExcel.write(saveFileName, cls).withTemplate(templatePath).sheet(sheetName).doWrite(data);
+            EasyExcel.write(saveFileName, clazz).sheet(sheetName).doWrite(data);
             return true;
         }catch(Exception e){
             return false;

+ 78 - 0
src/main/java/com/ydtech/utils/OrderUtils.java

@@ -0,0 +1,78 @@
+package com.ydtech.utils;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ydtech.constants.InsuranceEnum;
+import com.ydtech.modules.order.entity.api.dajia.response.NVHLODR1001Response;
+import com.ydtech.modules.order.entity.api.zhongmei.response.SubmitResponse;
+import com.ydtech.modules.order.entity.crawler.response.CrawlerVerifyPaymentResponse;
+import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
+import com.ydtech.modules.protocol.entity.constants.PtlApiType;
+import org.apache.commons.lang3.ObjectUtils;
+
+import java.util.List;
+
+/**
+ * 订单相关工具类
+ */
+public class OrderUtils {
+
+    /**
+     * 获取驾意险保单号
+     * @param companyId         保险公司id
+     * @param apiType           api类型
+     * @param crossInsurance    驾意险json字符串
+     * @return
+     */
+    public static String getJyPolicyNo(String companyId, String apiType, String crossInsurance){
+        //校验驾意险json字符串
+        if(crossInsurance == null || crossInsurance.equals("")){
+            return "";
+        }
+
+        JSONArray crossInsuranceJson = JSONArray.parseArray(crossInsurance);
+
+        if(crossInsuranceJson.size() > 0) {
+            //爬虫
+            if (!ObjectUtils.isEmpty(apiType)) {
+                if (PtlApiType.PTL_API_2.getCode() == Integer.parseInt(apiType)) {
+                    List<CrawlerVerifyPaymentResponse.DrivingInsurancesDTO> drivingInsurancesDTOS = crossInsuranceJson.toJavaList(CrawlerVerifyPaymentResponse.DrivingInsurancesDTO.class);
+                    return drivingInsurancesDTOS.get(0).getApplication();
+                }
+            }
+
+
+            // 永诚
+            if (companyId.contains(InsuranceEnum.AICS.getCode())) {
+                List<DrivingInsuranceDto> javaList = crossInsuranceJson.toJavaList(DrivingInsuranceDto.class);
+                return javaList.get(0).getPolicyNumber();
+            }
+
+            // 大家
+            if (companyId.contains(InsuranceEnum.DJPC.getCode())) {
+                List<NVHLODR1001Response.policyInfosDTO> javaList = crossInsuranceJson.toJavaList(NVHLODR1001Response.policyInfosDTO.class);
+                return javaList.get(0).getPlyNo();
+            }
+
+            // 国任
+            if (companyId.contains(InsuranceEnum.XDCX.getCode())) {
+                List<DrivingInsuranceDto> javaList = crossInsuranceJson.toJavaList(DrivingInsuranceDto.class);
+                return javaList.get(0).getPolicyNumber();
+            }
+
+            // 中煤
+            if (companyId.contains(InsuranceEnum.ZMBX.getCode())) {
+                List<SubmitResponse.AccidentNo> javaList = crossInsuranceJson.toJavaList(SubmitResponse.AccidentNo.class);
+                return javaList.get(0).getRideProposalNo();
+            }
+
+            // 紫金
+            if (companyId.contains(InsuranceEnum.ZKIC.getCode())) {
+                List<DrivingInsuranceDto> javaList = crossInsuranceJson.toJavaList(DrivingInsuranceDto.class);
+                return javaList.get(0).getPolicyNumber();
+            }
+        }
+
+        return "";
+    }
+}

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

@@ -188,6 +188,18 @@
             <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
                 and a.handling_fees_status =#{handlingFeesStatus}
             </if>
+            <if test="jqReceivableProportion !=null  and  jqReceivableProportion  !=''">
+                and a.jq_receivable_proportion =#{jqReceivableProportion}
+            </if>
+
+            <if test="syReceivableProportion !=null  and  syReceivableProportion  !=''">
+                and a.sy_receivable_proportion =#{syReceivableProportion}
+            </if>
+            <if test="noReceivableProportion !=null  and  noReceivableProportion  !=''">
+                and a.no_receivable_proportion =#{noReceivableProportion}
+            </if>
+
+
 
             <if test="id !=null  and  id  !=''">
                 and a.id =#{id}
@@ -1732,10 +1744,12 @@
     <select id="platformSettlementRecord" resultType="com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto">
         SELECT
             DATE_FORMAT(a.settlement_time, '%Y-%m-%d %H:%i:%s') as "settlementTime",
+            MAX(upf.url) as "imageUrl",
             sum(a.commission_feevalue + a.other_feevalue) AS "settlementAmount"
         FROM
             ins_ply_income a
             LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id
+            LEFT  JOIN   ins_upload_files  upf   on  a.settlement_image_id=upf.id
         <where>
             pa.agreement_type ='1'
             <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">

+ 54 - 0
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -1359,4 +1359,58 @@
           AND
             sua.create_time BETWEEN #{param.signStartDate} and #{param.signEndDate}
     </select>
+
+    <select id="getAuditExportList" resultType="com.ydtech.modules.order.entity.vo.AuditExportVo">
+        SELECT
+            io.company_id,
+            iac.api_type,
+            iac.cross_insurance,
+            io.username,
+            iac.signing_time,
+            io.licenseno,
+            JSON_UNQUOTE(json_extract(io.applyinfo, '$.name')) as applyname,
+            io.ins_company,
+            io.product,
+            eic.namesimple,
+            iac.jqapplyno,
+            iac.syapplyno,
+            iac.cross_insurance,
+            iac.jqpremium,
+            iac.sypremium,
+            iac.jypremium,
+            iac.taxamount,
+            ifo.jq_costs_export_proportion + ifo.jq_export_other_costs_proportion AS jq_export_proportion,
+            ifo.sy_costs_export_proportion+ifo.sy_export_other_costs_proportion as sy_export_proportion,
+            ifo.no_costs_export_proportion+ifo.no_export_other_costs_proportion as no_export_proportion,
+            ifo.jq_export_supervise_costs_premiums + ifo.sy_export_supervise_costs_premiums + ifo.no_export_supervise_costs_premiums + ifo.jq_export_other_costs_premiums + ifo.sy_export_other_costs_premiums + ifo.no_export_other_costs_premiums as settlement,
+            ifo.jq_supervise_costs_proportion + ifo.jq_other_costs_proportion as jq_entrance_proportion,
+            ifo.sy_supervise_costs_proportion + ifo.sy_other_costs_proportion as sy_entrance_proportion,
+            ifo.no_supervise_costs_proportion + ifo.no_other_costs_proportion as no_entrance_proportion,
+            ifo.jq_supervise_costs_premiums + ifo.jq_other_costs_premiums + ifo.sy_supervise_costs_premiums + ifo.sy_other_costs_premiums + ifo.no_supervise_costs_premiums + ifo.no_other_costs_premiums as receivable,
+            ifo.jq_dept_premiums_level_1 + ifo.sy_dept_premiums_level_1 + ifo.no_dept_premiums_level_1 as dept_premiums_level_1,
+            ifo.jq_dept_premiums_level_2 + ifo.sy_dept_premiums_level_2 + ifo.no_dept_premiums_level_2 as dept_premiums_level_2,
+            ifo.jq_dept_premiums_level_3 + ifo.sy_dept_premiums_level_3 + ifo.no_dept_premiums_level_3 as dept_premiums_level_3,
+            ifo.jq_dept_premiums_level_4 + ifo.sy_dept_premiums_level_4 + ifo.no_dept_premiums_level_4 as dept_premiums_level_4,
+            ifo.jq_dept_premiums_level_5 + ifo.sy_dept_premiums_level_5 + ifo.no_dept_premiums_level_5 as dept_premiums_level_5,
+            ifo.first_detail_premiums,
+            ifo.second_detail_premiums,
+            ifo.third_detail_premiums,
+            ifo.jq_profit_margin_premiums,
+            ifo.sy_profit_margin_premiums,
+            ifo.no_profit_margin_premiums
+        FROM
+            ins_fee_order_new ifo
+                LEFT JOIN ins_fee_audit ifa ON ifo.ins_order_no = ifa.ins_order_no
+                left join ins_area_company iac on  ifa.ins_order_no = iac.id
+                left join ins_orders io on iac.orderno = io.orderno
+                left join ptl_agreement pa on iac.agreement_id =  pa.id
+                left join esm_ins_company eic on pa.partner_companies_id =  eic.id
+        WHERE
+            iac.signing_time between #{param.signStartDate} and #{param.signEndDate}
+        <if test="param.audit != null and param.audit != ''">
+            AND
+            ifa.auditstatus = #{param.audit}
+        </if>
+
+    </select>
 </mapper>

BIN
src/main/resources/template/finance_audit_detail.xlsx