Просмотр исходного кода

添加显示协议的内部机构名称
处理车险非车的导出模板

hxl13994548489 2 лет назад
Родитель
Сommit
7d8e5ccd5c

+ 1 - 3
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -1,9 +1,7 @@
 package com.ydtech.modules.fnc.dao;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ydtech.modules.fnc.entity.InsPlySettleDetail;
+import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.fnc.vo.InsPlySettleVo;
 import org.apache.ibatis.annotations.Mapper;

+ 69 - 32
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -2,11 +2,8 @@ package com.ydtech.modules.fnc.service.impl;
 
 import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.text.StrBuilder;
-import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fasterxml.jackson.core.JsonProcessingException;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.pagehelper.PageHelper;
@@ -17,16 +14,13 @@ import com.ydtech.exception.SystemException;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
-import com.ydtech.modules.fnc.entity.*;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
+import com.ydtech.modules.fnc.entity.*;
 import com.ydtech.modules.fnc.service.*;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
 import com.ydtech.modules.ins.model.vo.res.*;
-import com.ydtech.modules.inv.model.InvChannelsExternalBillsDetails;
 import com.ydtech.modules.inv.model.dto.*;
-import com.ydtech.modules.inv.model.excel.InvDisburseExcel;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsOrders;
@@ -42,11 +36,9 @@ import com.ydtech.utils.SnowFlakeUtil;
 import com.ydtech.utils.StringOperations;
 import com.ydtech.utils.excel.ExcelEasypoiUtils;
 import com.ydtech.utils.excel.ExcelStyleUtil;
-import com.ydtech.utils.excel.ExcelUtils2;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.formula.functions.Now;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -55,11 +47,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.multipart.MultipartFile;
-import redis.clients.jedis.params.Params;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.awt.image.BandedSampleModel;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -70,9 +60,6 @@ import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.YearMonth;
 import java.util.*;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -1001,14 +988,34 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         params =this.saveParams(insPlyIncomeVo,params);
         List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
 
-        ExportParams exportParams = new ExportParams("保险跟单明细导出", null, ExcelType.HSSF);
-        exportParams.setStyle(ExcelStyleUtil.class);
-        List<BxOtherDetailsExcel> resultList = new ArrayList<>();
-        for (InsPlyIncome item :insPlyIncomes){
-            BxOtherDetailsExcel bxOtherDetailsExcel = new BxOtherDetailsExcel();
-            BeanUtils.copyProperties(item, bxOtherDetailsExcel);
-            resultList.add(bxOtherDetailsExcel);
+        String filePathName ="";
+        List<BxOtherDetailsNorExcel> resultNoList=new ArrayList<>();
+        List<BxOtherDetailsExcel> resultList=new ArrayList<>();
+        //判断是否是非车  1 是非车
+        if("1".equals(insPlyIncomeVo.getIsNotCar())){
+            filePathName="非车跟单明细导出";
+            ExportParams exportParams = new ExportParams("非车跟单明细", null, ExcelType.HSSF);
+            exportParams.setStyle(ExcelStyleUtil.class);
+            for (InsPlyIncome item :insPlyIncomes){
+                BxOtherDetailsNorExcel bxOtherDetailsNorExcel = new BxOtherDetailsNorExcel();
+                LocalDateTime signDate = item.getSignDate();
+                BeanUtils.copyProperties(item, bxOtherDetailsNorExcel);
+                bxOtherDetailsNorExcel.setSigndate(signDate);
+                resultNoList.add(bxOtherDetailsNorExcel);
+            }
+        }else{
+            filePathName="车险跟单明细导出";
+            ExportParams exportParams = new ExportParams("车险跟单明细", null, ExcelType.HSSF);
+            exportParams.setStyle(ExcelStyleUtil.class);
+            for (InsPlyIncome item :insPlyIncomes){
+                BxOtherDetailsExcel bxOtherDetailsExcel = new BxOtherDetailsExcel();
+                LocalDateTime signDate = item.getSignDate();
+                BeanUtils.copyProperties(item, bxOtherDetailsExcel);
+                bxOtherDetailsExcel.setSigndate(signDate);
+                resultList.add(bxOtherDetailsExcel);
+            }
         }
+
         String uploadPath = this.uploadPath + "/excel/";
         Path path = Paths.get(uploadPath);
         if (!Files.exists(path)) {
@@ -1018,7 +1025,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 e.printStackTrace();
             }
         }
-        String fileName = EasyExcelUtils.downExcel(uploadPath, "保险跟单明细导出", BxOtherDetailsExcel.class, resultList);
+        String fileName="";
+        if("1".equals(insPlyIncomeVo.getIsNotCar())){
+            fileName = EasyExcelUtils.downExcel(uploadPath, filePathName, BxSettlementFeesExcel.class, resultNoList);
+        }else{
+            fileName = EasyExcelUtils.downExcel(uploadPath, filePathName, BxSettlementFeesExcel.class, resultList);
+        }
         return HttpResult.ok("",uploadUrl + "excel/" + fileName);
     }
 
@@ -1710,15 +1722,34 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         params =this.saveParams(insPlyIncomeVo,params);
         List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
 
-        ExportParams exportParams = new ExportParams("保险手续费", null, ExcelType.HSSF);
-        exportParams.setStyle(ExcelStyleUtil.class);
-        List<BxSettlementFeesExcel> resultList = new ArrayList<>();
-        for (InsPlyIncome item :insPlyIncomes){
-            BxSettlementFeesExcel bxSettlementFeesExcel = new BxSettlementFeesExcel();
-            LocalDateTime signDate = item.getSignDate();
-            BeanUtils.copyProperties(item, bxSettlementFeesExcel);
-            resultList.add(bxSettlementFeesExcel);
+        String filePathName ="";
+        List<BxSettlementFeesNorExcel> resultNoList=new ArrayList<>();
+        List<BxSettlementFeesExcel> resultList=new ArrayList<>();
+        //判断是否是非车  1 是非车
+        if("1".equals(insPlyIncomeVo.getIsNotCar())){
+            filePathName="非车手续费导出";
+            ExportParams exportParams = new ExportParams("非车手续费", null, ExcelType.HSSF);
+            exportParams.setStyle(ExcelStyleUtil.class);
+            for (InsPlyIncome item :insPlyIncomes){
+                BxSettlementFeesNorExcel bxSettlementFeesNorExcel = new BxSettlementFeesNorExcel();
+                LocalDateTime signDate = item.getSignDate();
+                BeanUtils.copyProperties(item, bxSettlementFeesNorExcel);
+                bxSettlementFeesNorExcel.setSigndate(signDate);
+                resultNoList.add(bxSettlementFeesNorExcel);
+            }
+        }else{
+            filePathName="车险手续费导出";
+            ExportParams exportParams = new ExportParams("车险手续费", null, ExcelType.HSSF);
+            exportParams.setStyle(ExcelStyleUtil.class);
+            for (InsPlyIncome item :insPlyIncomes){
+                BxSettlementFeesExcel bxSettlementFeesExcel = new BxSettlementFeesExcel();
+                LocalDateTime signDate = item.getSignDate();
+                BeanUtils.copyProperties(item, bxSettlementFeesExcel);
+                bxSettlementFeesExcel.setSigndate(signDate);
+                resultList.add(bxSettlementFeesExcel);
+            }
         }
+
         String uploadPath = this.uploadPath + "/excel/";
         Path path = Paths.get(uploadPath);
         if (!Files.exists(path)) {
@@ -1728,7 +1759,13 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 e.printStackTrace();
             }
         }
-        String fileName = EasyExcelUtils.downExcel(uploadPath, "保险手续费导出", BxSettlementFeesExcel.class, resultList);
+        String fileName="";
+        if("1".equals(insPlyIncomeVo.getIsNotCar())){
+            fileName = EasyExcelUtils.downExcel(uploadPath, filePathName, BxSettlementFeesExcel.class, resultNoList);
+        }else{
+            fileName = EasyExcelUtils.downExcel(uploadPath, filePathName, BxSettlementFeesExcel.class, resultList);
+        }
+
         return HttpResult.ok("",uploadUrl + "excel/" + fileName);
     }
 

+ 53 - 30
src/main/java/com/ydtech/modules/ins/model/vo/res/BxOtherDetailsExcel.java

@@ -1,71 +1,94 @@
 package com.ydtech.modules.ins.model.vo.res;
 
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ydtech.modules.inv.utils.excel.DateTimeConverter;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.time.LocalDateTime;
 
 @Data
 public class BxOtherDetailsExcel {
 
-    @ApiModelProperty("子订单号")
-    @ExcelProperty( "子订单号")
-    private String orderno;
+    @ApiModelProperty("签单日期")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @ExcelProperty(value = "签单日期",index = 0, converter = DateTimeConverter.class)
+    private LocalDateTime signdate;
+
+
+    @ApiModelProperty("车牌号")
+    @ExcelProperty(value = "车牌号",index = 1)
+    private String licenseno;
+
+    @ApiModelProperty("被保险人")
+    @ExcelProperty(value = "被保险人",index = 2)
+    private String userName;
+
+
+    @ApiModelProperty("险种")
+    @ExcelProperty(value = "险种",index = 3)
+    private String riskcode;
 
     @ApiModelProperty("保险公司名称")
-    @ExcelProperty( "保险公司名称")
+    @ExcelProperty(value = "保险公司名称",index = 4)
     private String companyName;
 
-    @ApiModelProperty("合作公司名称")
-    @ExcelProperty( "合作公司名称")
+    @ApiModelProperty("保司机构")
+    @ExcelProperty(value = "保司机构",index = 5)
     private String partnerCompaniesName;
 
+
     @ApiModelProperty("交强保单号")
-    @ExcelProperty( "交强保单号")
+    @ExcelProperty(value = "交强保单号",index = 6)
     private String policyno;
 
+
     @ApiModelProperty("商业保单号")
-    @ExcelProperty( "商业保单号")
+    @ExcelProperty(value = "商业保单号",index = 7)
     private String syPolicyno;
 
     @ApiModelProperty("交强保费")
-    @ExcelProperty( "交强保费")
+    @ExcelProperty(value = "交强保费",index = 8)
     private BigDecimal jqPremium;
 
-    @ApiModelProperty("商业保费")
-    @ExcelProperty( "商业保费")
-    private BigDecimal syPremium;
 
     @ApiModelProperty("交强不含税保费")
-    @ExcelProperty( "交强不含税保费")
+    @ExcelProperty(value = "交强不含税保费",index = 9)
     private BigDecimal jqNoTaxPremium;
 
-    @ApiModelProperty("商业不含税保费")
-    @ExcelProperty( "商业不含税保费")
-    private BigDecimal syNoTaxPremium;
+    @ApiModelProperty("车船税")
+    @ExcelProperty(value = "车船税",index = 10)
+    private BigDecimal taxamount;
 
-    @ApiModelProperty("跟单费金额")
-    @ExcelProperty( "跟单费金额")
-    private BigDecimal otherFeevalue;
+    @ApiModelProperty("商业保费")
+    @ExcelProperty(value = "商业保费",index = 11)
+    private BigDecimal syPremium;
 
-    @ApiModelProperty("跟单费比例")
-    @ExcelProperty( "跟单费比例")
-    private BigDecimal otherFeerate;
+    @ApiModelProperty("商业不含税保费")
+    @ExcelProperty(value = "商业不含税保费",index = 12)
+    private BigDecimal syNoTaxPremium;
 
-    @ApiModelProperty("交强跟单比例")
-    @ExcelProperty( "交强跟单比例")
+    @ApiModelProperty("交强跟单比例")
+    @ExcelProperty(value = "交强跟单比例",index = 13)
     private BigDecimal jqOtherCostsProportion;
 
-    @ApiModelProperty("商业跟单比例")
-    @ExcelProperty( "商业跟单比例")
+
+    @ApiModelProperty("商业跟单费比例")
+    @ExcelProperty(value = "商业跟单费比例",index = 14)
     private BigDecimal syOtherCostsProportion;
 
-    @ApiModelProperty("交强跟单金额")
-    @ExcelProperty( "交强跟单金额")
+    @ApiModelProperty("交强跟单金额")
+    @ExcelProperty(value = "交强跟单金额",index = 15)
     private BigDecimal jqOtherCostsPremium;
 
-    @ApiModelProperty("商业跟单金额")
-    @ExcelProperty( "商业跟单金额")
+    @ApiModelProperty("商业跟单金额")
+    @ExcelProperty(value = "商业跟单金额",index = 16)
     private BigDecimal syOtherCostsPremium;
+
+    @ApiModelProperty("跟单费金额")
+    @ExcelProperty(value = "跟单费金额",index = 17)
+    private BigDecimal otherFeevalue;
+
 }

+ 62 - 0
src/main/java/com/ydtech/modules/ins/model/vo/res/BxOtherDetailsNorExcel.java

@@ -0,0 +1,62 @@
+package com.ydtech.modules.ins.model.vo.res;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ydtech.modules.inv.utils.excel.DateTimeConverter;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+public class BxOtherDetailsNorExcel {
+
+    @ApiModelProperty("签单日期")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @ExcelProperty(value = "签单日期",index = 0, converter = DateTimeConverter.class)
+    private LocalDateTime signdate;
+
+
+    @ApiModelProperty("车牌号")
+    @ExcelProperty(value = "车牌号",index = 1)
+    private String licenseno;
+
+    @ApiModelProperty("被保险人")
+    @ExcelProperty(value = "被保险人",index = 2)
+    private String userName;
+
+
+    @ApiModelProperty("保险公司名称")
+    @ExcelProperty(value = "保险公司名称",index = 3)
+    private String companyName;
+
+    @ApiModelProperty("保司机构")
+    @ExcelProperty(value = "保司机构",index = 4)
+    private String partnerCompaniesName;
+
+
+    @ApiModelProperty("非车保单号")
+    @ExcelProperty(value = "非车保单号",index = 5)
+    private String noPolicyno;
+
+
+    @ApiModelProperty("非车保费")
+    @ExcelProperty(value = "非车保费",index = 6)
+    private BigDecimal noPremium;
+
+    @ApiModelProperty("非车不含税保费")
+    @ExcelProperty(value = "非车不含税保费",index = 7)
+    private BigDecimal noNoTaxPremium;
+    /**
+     *  非车跟单比例
+     */
+    @ApiModelProperty("跟单费比例")
+    @ExcelProperty(value = "跟单费比例",index = 8)
+    private BigDecimal noOtherCostsProportion;
+
+    @ApiModelProperty("跟单费金额")
+    @ExcelProperty(value = "跟单费金额",index = 9)
+    private BigDecimal noOtherCostsPremium;
+
+}

+ 42 - 74
src/main/java/com/ydtech/modules/ins/model/vo/res/BxSettlementFeesExcel.java

@@ -1,132 +1,100 @@
 package com.ydtech.modules.ins.model.vo.res;
 
-import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.alibaba.excel.annotation.ExcelProperty;
-import com.alibaba.excel.annotation.write.style.ContentStyle;
-import com.alibaba.excel.enums.poi.BorderStyleEnum;
-import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
-import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
+import com.ydtech.modules.inv.utils.excel.DateTimeConverter;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
-import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.util.Date;
-
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/6/12 17:11
+ *  @Description: 车险手续费导出
+ */
 @Data
 public class BxSettlementFeesExcel implements Serializable {
-    @ApiModelProperty("子订单号")
-    @ExcelProperty( "子订单号")
-    private String orderno;
 
     @ApiModelProperty("签单日期")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @ExcelProperty( "签单日期")
-    private Date signDate;
+    @ExcelProperty(value = "签单日期",index = 0, converter = DateTimeConverter.class)
+    private LocalDateTime signdate;
 
 
     @ApiModelProperty("车牌号")
-    @ExcelProperty( "车牌号")
+    @ExcelProperty(value = "车牌号",index = 1)
     private String licenseno;
 
     @ApiModelProperty("被保险人")
-    @ExcelProperty( "被保险人")
+    @ExcelProperty(value = "被保险人",index = 2)
     private String userName;
 
 
     @ApiModelProperty("险种")
-    @ExcelProperty( "险种")
+    @ExcelProperty(value = "险种",index = 3)
     private String riskcode;
 
-    @ApiModelProperty("保司机构")
-    @ExcelProperty( "保司机构")
-    private String partnerCompaniesName;
-
     @ApiModelProperty("保险公司名称")
-    @ExcelProperty( "保险公司名称")
+    @ExcelProperty(value = "保险公司名称",index = 4)
     private String companyName;
 
-    @ApiModelProperty("协议号")
-    @ExcelProperty( "协议号")
-    private String agreementId;
+    @ApiModelProperty("保司机构")
+    @ExcelProperty(value = "保司机构",index = 5)
+    private String partnerCompaniesName;
+
 
     @ApiModelProperty("交强保单号")
-    @ExcelProperty( "交强保单号")
+    @ExcelProperty(value = "交强保单号",index = 6)
     private String policyno;
 
 
     @ApiModelProperty("商业保单号")
-    @ExcelProperty( "商业保单号")
+    @ExcelProperty(value = "商业保单号",index = 7)
     private String syPolicyno;
 
     @ApiModelProperty("交强险保费")
-    @ExcelProperty( "交强险保费")
+    @ExcelProperty(value = "交强险保费",index = 8)
     private BigDecimal jqPremium;
+
+
+    @ApiModelProperty("交强不含税保费")
+    @ExcelProperty(value = "交强不含税保费",index = 9)
+    private BigDecimal jqNoTaxPremium;
+
     @ApiModelProperty("车船税")
-    @ExcelProperty( "车船税")
+    @ExcelProperty(value = "车船税",index = 10)
     private BigDecimal taxamount;
 
-    @ApiModelProperty("商业险保费")
-    @ExcelProperty( "商业险保费")
+    @ApiModelProperty("商业保费")
+    @ExcelProperty(value = "商业保费",index = 11)
     private BigDecimal syPremium;
 
-
-    @ApiModelProperty("手续费比例")
-    @ExcelProperty( "手续费比例")
-    private BigDecimal commissionFeerate;
+    @ApiModelProperty("商业不含税保费")
+    @ExcelProperty(value = "商业不含税保费",index = 12)
+    private BigDecimal syNoTaxPremium;
 
 
     @ApiModelProperty("交强手续费比例")
-    @ExcelProperty( "交强手续费比例")
+    @ExcelProperty(value = "交强手续费比例",index = 13)
     private BigDecimal jqSuperviseCostsProportion;
 
-
-
     @ApiModelProperty("商业手续费比例")
-    @ExcelProperty( "商业手续费比例")
+    @ExcelProperty(value = "商业手续费比例",index = 14)
     private BigDecimal sySuperviseCostsProportion;
 
+    @ApiModelProperty("交强手续费金额")
+    @ExcelProperty(value = "交强手续费金额",index = 15)
+    private BigDecimal jqSuperviseCostsPremiums;
+
+    @ApiModelProperty("商业手续费金额")
+    @ExcelProperty(value = "商业手续费金额",index = 16)
+    private BigDecimal sySuperviseCostsPremiums;
 
     @ApiModelProperty("手续费金额")
-    @ExcelProperty( "手续费金额")
+    @ExcelProperty(value = "手续费金额",index = 17)
     private BigDecimal commissionFeevalue;
 
-
-
-    @ApiModelProperty("应收金额")
-    @ExcelProperty( "应收金额")
-    private BigDecimal receivableAmount;
-
-
-    @ExcelProperty( "创建日期")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @ApiModelProperty(value = "创建日期")
-    private Date createTime;
-
-
-    @ExcelProperty( "结算日期")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @ApiModelProperty(value = "结算日期")
-    private Date settlementTime;
-
-
-    @ApiModelProperty("结算人")
-    @ExcelProperty( "结算人")
-    private String settlementUserName;
-
-
-    @ApiModelProperty("结算人")
-    @ExcelProperty( "结算人")
-    private String updateUserName;
-
-
-    @ApiModelProperty("手续费结算状态  1 为已结算  2 已经结算")
-    @ExcelProperty( "手续费结算状态")
-    private String handlingFeesStatus;
-
 }

+ 69 - 0
src/main/java/com/ydtech/modules/ins/model/vo/res/BxSettlementFeesNorExcel.java

@@ -0,0 +1,69 @@
+package com.ydtech.modules.ins.model.vo.res;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ydtech.modules.inv.utils.excel.DateTimeConverter;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/6/12 17:11
+ *  @Description: 非险手续费导出
+ */
+@Data
+public class BxSettlementFeesNorExcel implements Serializable {
+
+    @ApiModelProperty("签单日期")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @ExcelProperty(value = "签单日期",index = 0, converter = DateTimeConverter.class)
+    private LocalDateTime signdate;
+
+
+    @ApiModelProperty("车牌号")
+    @ExcelProperty(value = "车牌号",index = 1)
+    private String licenseno;
+
+    @ApiModelProperty("被保险人")
+    @ExcelProperty(value = "被保险人",index = 2)
+    private String userName;
+
+
+    @ApiModelProperty("保险公司名称")
+    @ExcelProperty(value = "保险公司名称",index = 3)
+    private String companyName;
+
+    @ApiModelProperty("保司机构")
+    @ExcelProperty(value = "保司机构",index = 4)
+    private String partnerCompaniesName;
+
+
+    @ApiModelProperty("非车保单号")
+    @ExcelProperty(value = "非车保单号",index = 5)
+    private String noPolicyno;
+
+
+    @ApiModelProperty("非车保费")
+    @ExcelProperty(value = "非车保费",index = 6)
+    private BigDecimal noPremium;
+
+    @ApiModelProperty("非车不含税保费")
+    @ExcelProperty(value = "非车不含税保费",index = 7)
+    private BigDecimal noNoTaxPremium;
+
+
+    @ApiModelProperty("手续费比例")
+    @ExcelProperty(value = "手续费比例",index = 8)
+    private BigDecimal noSuperviseCostsProportion;
+
+    @ApiModelProperty("手续费金额")
+    @ExcelProperty(value = "手续费金额",index = 9)
+    private BigDecimal noSuperviseCostsPremiums;
+
+
+}

+ 61 - 0
src/main/java/com/ydtech/modules/inv/utils/excel/DateTimeConverter.java

@@ -0,0 +1,61 @@
+package com.ydtech.modules.inv.utils.excel;
+
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.converters.WriteConverterContext;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.data.ReadCellData;
+import com.alibaba.excel.metadata.data.WriteCellData;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * LocalDate转换类
+ * @author
+ * @create
+ */
+public class DateTimeConverter implements Converter<LocalDateTime> {
+    private static  final String PATTERN_YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
+ 
+ 
+    @Override
+    public Class<LocalDateTime> supportJavaTypeKey() {
+        return LocalDateTime.class;
+    }
+ 
+    /**
+     * easyExcel导出数据类型转换
+     * @param cellData
+     * @param contentProperty
+     * @param globalConfiguration
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public LocalDateTime convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        String value = cellData.getStringValue();
+
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern(PATTERN_YYYY_MM_DD_HH_MM_SS);
+        LocalDateTime localDate = LocalDateTime.parse(value, formatter);
+        return localDate;
+    }
+ 
+    /**
+     * easyExcel导入Date数据类型转换
+     * @param context
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public WriteCellData<String> convertToExcelData(WriteConverterContext<LocalDateTime> context) throws Exception {
+        LocalDateTime date = context.getValue();
+        if (date == null) {
+            return null;
+        }
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(PATTERN_YYYY_MM_DD_HH_MM_SS);
+        String dateString = date.format(dateTimeFormatter);
+        return new WriteCellData<>(dateString);
+    }
+ 
+}

+ 146 - 145
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -156,173 +156,174 @@
     </sql>
 
     <select id="queryNew"  resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
-            select
-                pa.agreement_name  as "agreementName",
-                pa.agreement_type  as "agreementType",
-                pa.docking_person  as "dockingPerson",
-                upf.url as "imageUrl",
-                su.name  as "userName",
-                <include refid="income_com"/>
-                from  ins_ply_income a
-                LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id
-                LEFT  JOIN  sys_user   su  on su.id=a.user_id
-                LEFT  JOIN   ins_upload_files  upf   on  a.settlement_image_id=upf.id
-                LEFT  JOIN   esm_ins_company  eic   on  eic.id=a.partner_companies_id
-            <where>
-                <if test="startDate !=null  and  startDate!='' and  endDate !=null and endDate !=''">
-                    and DATE_FORMAT( a.signdate, '%Y-%m-%d')  between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
-                </if>
-                <if test="agreementType !=null  and  agreementType  !=''">
-                    and pa.agreement_type =#{agreementType}
-                </if>
-
-                <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
-                    and a.signdate   between #{signDateStart} and #{signDateEnd}
-                </if>
+        select
+        pa.agreement_name  as "agreementName",
+        pa.agreement_type  as "agreementType",
+        pa.docking_person  as "dockingPerson",
+        upf.url as "imageUrl",
+        su.name  as "userName",
+        b.name as "deptName",
+        <include refid="income_com"/>
+        from  ins_ply_income a
+        LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id
+        LEFT  JOIN  sys_user   su  on su.id=a.user_id
+        LEFT  JOIN   ins_upload_files  upf   on  a.settlement_image_id=upf.id
+        LEFT  JOIN   esm_ins_company  eic   on  eic.id=a.partner_companies_id
+        LEFT  JOIN   sys_dept b on pa.dept_id=b.id
+        <where>
+            <if test="startDate !=null  and  startDate!='' and  endDate !=null and endDate !=''">
+                and DATE_FORMAT( a.signdate, '%Y-%m-%d')  between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
+            </if>
+            <if test="agreementType !=null  and  agreementType  !=''">
+                and pa.agreement_type =#{agreementType}
+            </if>
 
-                <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
-                    and a.handling_fees_status =#{handlingFeesStatus}
-                </if>
+            <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                and a.signdate   between #{signDateStart} and #{signDateEnd}
+            </if>
 
-                <if test="allPartnerCompaniesId !=null  and  allPartnerCompaniesId  !=''">
-                    AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
-                </if>
+            <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                and a.handling_fees_status =#{handlingFeesStatus}
+            </if>
 
-               <if test="provincePartnerCompaniesId !=null  and  provincePartnerCompaniesId  !=''">
-                    and eic.parent_id =#{provincePartnerCompaniesId}
-                </if>
+            <if test="allPartnerCompaniesId !=null  and  allPartnerCompaniesId  !=''">
+                AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
+            </if>
 
-                <if test="dockingPerson !=null  and  dockingPerson  !=''">
-                    and  pa.docking_person  =#{dockingPerson}
-                </if>
+            <if test="provincePartnerCompaniesId !=null  and  provincePartnerCompaniesId  !=''">
+                and eic.parent_id =#{provincePartnerCompaniesId}
+            </if>
 
-                <if test="provinceId != null and provinceId != ''">
-                    and a.dept_id LIKE CONCAT(#{provinceId}, '%')
-                </if>
+            <if test="dockingPerson !=null  and  dockingPerson  !=''">
+                and  pa.docking_person  =#{dockingPerson}
+            </if>
 
-                <if test="cityId != null and cityId != ''">
-                    and a.dept_id LIKE CONCAT(#{cityId}, '%')
-                </if>
+            <if test="provinceId != null and provinceId != ''">
+                and pa.dept_id  LIKE CONCAT(#{provinceId}, '%')
+            </if>
 
-                <if test="countyId != null and countyId != ''">
-                    and a.dept_id  LIKE CONCAT(#{countyId}, '%')
-                </if>
-               <if test="taskId != null and taskId != ''">
-                    and a.task_id = #{taskId}
-                </if>
-                <if test="orderno !=null  and  orderno  !=''">
-                    and a.orderno =#{orderno}
-                </if>
-                <if test="companyName !=null  and  companyName  !=''">
-                    and a.company_id =#{companyName}
-                </if>
+            <if test="cityId != null and cityId != ''">
+                and pa.dept_id  LIKE CONCAT(#{cityId}, '%')
+            </if>
 
-                <if test="policyno !=null  and  policyno  !=''">
-                    and a.policyno =#{policyno}
-                </if>
-                <if test="documentaryFeesStatus !=null  and  documentaryFeesStatus  !=''">
-                    and a.documentary_fees_status =#{documentaryFeesStatus}
-                </if>
+            <if test="countyId != null and countyId != ''">
+                and pa.dept_id   LIKE CONCAT(#{countyId}, '%')
+            </if>
+            <if test="taskId != null and taskId != ''">
+                and a.task_id = #{taskId}
+            </if>
+            <if test="orderno !=null  and  orderno  !=''">
+                and a.orderno =#{orderno}
+            </if>
+            <if test="companyName !=null  and  companyName  !=''">
+                and a.company_id =#{companyName}
+            </if>
 
-                <if test="isNotCar !=null  and  isNotCar  !=''">
-                    and a.is_not_car =#{isNotCar}
-                </if>
+            <if test="policyno !=null  and  policyno  !=''">
+                and a.policyno =#{policyno}
+            </if>
+            <if test="documentaryFeesStatus !=null  and  documentaryFeesStatus  !=''">
+                and a.documentary_fees_status =#{documentaryFeesStatus}
+            </if>
 
-                <if test="deptId !=null  and  deptId  !=''">
-                    and pa.dept_id =#{deptId}
-                </if>
+            <if test="isNotCar !=null  and  isNotCar  !=''">
+                and a.is_not_car =#{isNotCar}
+            </if>
 
+            <if test="deptId !=null  and  deptId  !=''">
+                and pa.dept_id =#{deptId}
+            </if>
 
-                <if test="ids != null and ids != '' and ids.length > 0">
-                    and a.id in
-                    <foreach collection="ids" item="item" open="(" separator="," close=")">
-                        #{item}
-                    </foreach>
-                </if>
-               <if test="incomeIds != null and incomeIds != '' and incomeIds.size() > 0">
-                    and a.id in
-                    <foreach collection="incomeIds" item="item" open="(" separator="," close=")">
-                        #{item}
-                    </foreach>
-                </if>
 
-                <if test="selectIds != null and selectIds != '' and selectIds.size() > 0">
-                    and a.id in
-                    <foreach collection="selectIds" item="item" open="(" separator="," close=")">
-                        #{item}
-                    </foreach>
-                </if>
+            <if test="ids != null and ids != '' and ids.length > 0">
+                and a.id in
+                <foreach collection="ids" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="incomeIds != null and incomeIds != '' and incomeIds.size() > 0">
+                and a.id in
+                <foreach collection="incomeIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
 
-                <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
-                    and a.partner_companies_id in
-                    <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
-                        #{item}
-                    </foreach>
-                </if>
+            <if test="selectIds != null and selectIds != '' and selectIds.size() > 0">
+                and a.id in
+                <foreach collection="selectIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
 
-                <if test="isOther !=null  and  isOther  !=''">
-                    and a.is_not_documentary   =#{isOther}
-                </if>
-                <if test="licenseno != null and licenseno != ''">
-                    and a.licenseno  =#{licenseno}
-                </if>
-                <if test="syPolicyno != null and syPolicyno != ''">
-                    and a.sy_policyno  =#{syPolicyno}
-                </if>
+            <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
+                and a.partner_companies_id in
+                <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
 
-                <if test="noPolicyno != null and noPolicyno != ''">
-                    and a.no_policyno =#{noPolicyno}
-                </if>
-                <if test="signdate !=null  and  signdate  !=''">
-                    AND  a.signdate =#{signdate}
-                </if>
-                <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
-                    AND a.partner_companies_id =#{partnerCompaniesId}
-                </if>
+            <if test="isOther !=null  and  isOther  !=''">
+                and a.is_not_documentary   =#{isOther}
+            </if>
+            <if test="licenseno != null and licenseno != ''">
+                and a.licenseno  =#{licenseno}
+            </if>
+            <if test="syPolicyno != null and syPolicyno != ''">
+                and a.sy_policyno  =#{syPolicyno}
+            </if>
 
-                <if test="partnerCompaniesName !=null  and  partnerCompaniesName  !=''">
-                  AND   a.partner_companies_name =#{partnerCompaniesName}
-                </if>
+            <if test="noPolicyno != null and noPolicyno != ''">
+                and a.no_policyno =#{noPolicyno}
+            </if>
+            <if test="signdate !=null  and  signdate  !=''">
+                AND  a.signdate =#{signdate}
+            </if>
+            <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                AND a.partner_companies_id =#{partnerCompaniesId}
+            </if>
 
-                <if test="createTime !=null  and  createTime  !=''">
-                    AND  a.create_time =#{createTime}
-                </if>
-                <if test="settlementTime !=null  and  settlementTime  !=''">
-                    AND a.settlement_time =#{settlementTime}
-                </if>
+            <if test="partnerCompaniesName !=null  and  partnerCompaniesName  !=''">
+                AND   a.partner_companies_name =#{partnerCompaniesName}
+            </if>
 
-                <if test="userId !=null  and  userId  !=''">
-                    and a.userId   =#{userId}
-                </if>
-                <if test="companyId !=null  and  companyId  !=''">
-                    and a.company_id   =#{companyId}
-                </if>
-                <if test="riskcode !=null  and  riskcode  !=''">
-                    and a.riskcode   =#{riskcode}
-                </if>
-                <if test="year !=null  and  year  !=''">
-                    AND YEAR(a.signdate) =#{year}
-                </if>
-                <if test="month !=null  and  month !=''">
-                    AND month(a.signdate) =#{month}
-                </if>
-                <if test="day !=null  and  day !=''">
-                    AND day(a.signdate) =#{day}
-                </if>
-                <if test="insuredName !=null  and  insuredName !=''">
-                  AND  a.insured_name =#{insuredName}
-                </if>
-                <if test="jqStartDate  !=null  and  jqStartDate  != ''  and  jqEndDate   != null  and  jqEndDate   !=''">
-                    AND DATE(a.jq_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
+            <if test="createTime !=null  and  createTime  !=''">
+                AND  a.create_time =#{createTime}
+            </if>
+            <if test="settlementTime !=null  and  settlementTime  !=''">
+                AND a.settlement_time =#{settlementTime}
+            </if>
 
-                </if>
-                <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
-                    AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
+            <if test="userId !=null  and  userId  !=''">
+                and a.userId   =#{userId}
+            </if>
+            <if test="companyId !=null  and  companyId  !=''">
+                and a.company_id   =#{companyId}
+            </if>
+            <if test="riskcode !=null  and  riskcode  !=''">
+                and a.riskcode   =#{riskcode}
+            </if>
+            <if test="year !=null  and  year  !=''">
+                AND YEAR(a.signdate) =#{year}
+            </if>
+            <if test="month !=null  and  month !=''">
+                AND month(a.signdate) =#{month}
+            </if>
+            <if test="day !=null  and  day !=''">
+                AND day(a.signdate) =#{day}
+            </if>
+            <if test="insuredName !=null  and  insuredName !=''">
+                AND  a.insured_name =#{insuredName}
+            </if>
+            <if test="jqStartDate  !=null  and  jqStartDate  != ''  and  jqEndDate   != null  and  jqEndDate   !=''">
+                AND DATE(a.jq_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
 
-                </if>
+            </if>
+            <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
+                AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
 
-            </where>
-            ORDER  BY  a.create_time  desc
+            </if>
+        </where>
+        ORDER  BY  a.create_time  desc
 
     </select>
     <select id="getEntityById"  resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">