Explorar el Código

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

lyh hace 1 año
padre
commit
010ea29bf3
Se han modificado 58 ficheros con 1473 adiciones y 568 borrados
  1. 1 0
      src/main/java/com/ydtech/components/TokenInterceptor.java
  2. 26 1
      src/main/java/com/ydtech/modules/admin/controller/SysUserAccountController.java
  3. 22 0
      src/main/java/com/ydtech/modules/admin/controller/quoteCount/QuoteCountController.java
  4. 7 0
      src/main/java/com/ydtech/modules/admin/dao/DeptBalanceMapper.java
  5. 6 0
      src/main/java/com/ydtech/modules/admin/dao/SysPremiumDetailsMapper.java
  6. 17 3
      src/main/java/com/ydtech/modules/admin/dao/SysUserAccountMapper.java
  7. 71 0
      src/main/java/com/ydtech/modules/admin/model/dto/QuotationDetailsExcel.java
  8. 5 0
      src/main/java/com/ydtech/modules/admin/model/dto/ReceivableExcel.java
  9. 6 1
      src/main/java/com/ydtech/modules/admin/model/po/SysUserAccount.java
  10. 3 0
      src/main/java/com/ydtech/modules/admin/model/vo/SysUserAccountVo.java
  11. 6 0
      src/main/java/com/ydtech/modules/admin/service/CompanyDataReportService.java
  12. 3 3
      src/main/java/com/ydtech/modules/admin/service/SysAreaService.java
  13. 18 1
      src/main/java/com/ydtech/modules/admin/service/SysUserAccountService.java
  14. 72 0
      src/main/java/com/ydtech/modules/admin/service/impl/CompanyDataReportServiceImpl.java
  15. 74 18
      src/main/java/com/ydtech/modules/admin/service/impl/DeptBalanceServiceImpl.java
  16. 6 3
      src/main/java/com/ydtech/modules/admin/service/impl/ProfitAnalysisServiceImpl.java
  17. 5 2
      src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyLeaderServiceImpl.java
  18. 16 5
      src/main/java/com/ydtech/modules/admin/service/impl/SysAreaServiceImpl.java
  19. 9 7
      src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java
  20. 41 3
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java
  21. 7 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java
  22. 1 1
      src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java
  23. 13 2
      src/main/java/com/ydtech/modules/fnc/service/impl/InsFeeAuditServiceImpl.java
  24. 7 1
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  25. 16 1
      src/main/java/com/ydtech/modules/ins/model/vo/CustomerInfoVo.java
  26. 3 3
      src/main/java/com/ydtech/modules/order/components/bohai/BoHaiRequestApiComponent.java
  27. 0 1
      src/main/java/com/ydtech/modules/order/components/dajia/DaJiaRequestApiComponents.java
  28. 82 29
      src/main/java/com/ydtech/modules/order/components/huatai/HuiTaiUploadImageComponents.java
  29. 5 0
      src/main/java/com/ydtech/modules/order/dao/InsAreaCompanyMapper.java
  30. 2 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/CertType.java
  31. 4 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/DocumentClass.java
  32. 85 37
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleConfirmationReqeust.java
  33. 134 76
      src/main/java/com/ydtech/modules/order/entity/api/dajia/request/ODR1008Request.java
  34. 26 9
      src/main/java/com/ydtech/modules/order/entity/api/dajia/request/ODR1010Request.java
  35. 5 1
      src/main/java/com/ydtech/modules/order/entity/api/huatai/constants/ImageTypeCode.java
  36. 41 13
      src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiQuotedPriceRequest.java
  37. 33 70
      src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSaveFileIdxRequest.java
  38. 88 4
      src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSubmitRequest.java
  39. 85 194
      src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiImageInitParamResponse.java
  40. 45 13
      src/main/java/com/ydtech/modules/order/entity/api/zhongmei/request/QuotedPriceRequest.java
  41. 5 1
      src/main/java/com/ydtech/modules/order/entity/api/zijin/constants/enums/FileTypeEnum.java
  42. 97 9
      src/main/java/com/ydtech/modules/order/entity/api/zijin/request/CalculatePremiumRequest.java
  43. 6 0
      src/main/java/com/ydtech/modules/order/service/InsOrdersService.java
  44. 36 8
      src/main/java/com/ydtech/modules/order/service/impl/BoHaiOrderApiServiceImpl.java
  45. 23 12
      src/main/java/com/ydtech/modules/order/service/impl/DaJiaOrderServiceImpl.java
  46. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/HuaTaiOrderApiServiceImpl.java
  47. 6 3
      src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java
  48. 5 5
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  49. 6 6
      src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java
  50. 1 1
      src/main/resources/application-prod.yml
  51. 1 1
      src/main/resources/application-test.yml
  52. 30 1
      src/main/resources/mapper/modules/admin/DeptBalanceMapper.xml
  53. 21 0
      src/main/resources/mapper/modules/admin/SysPremiumDetailsMapper.xml
  54. 66 11
      src/main/resources/mapper/modules/admin/SysUserAccountMapper.xml
  55. 1 0
      src/main/resources/mapper/modules/admin/SysUserMapper.xml
  56. 1 1
      src/main/resources/mapper/modules/console/WithdrawalTaskMapper.xml
  57. 3 2
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  58. 68 2
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

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

@@ -88,6 +88,7 @@ public class TokenInterceptor {
 
         // 平安相关屏蔽地址
         notMatchList.add("/order/pingAnApi/getApplyVerifyCodeAndRecoverApplyVerifyCode");
+        notMatchList.add("/sysUserAccount/queryCount");
         notMatchList.add("/order/pingAnApi/recoverApplyVerifyCode");
         notMatchList.add("/order/pingAnApi/payReturn");
 

+ 26 - 1
src/main/java/com/ydtech/modules/admin/controller/SysUserAccountController.java

@@ -1,10 +1,10 @@
 package com.ydtech.modules.admin.controller;
 
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.po.SysUserAccount;
+import com.ydtech.modules.admin.model.po.SysUserBankCard;
 import com.ydtech.modules.admin.model.vo.MyIncomeAndExpensesNewPageVo;
 import com.ydtech.modules.admin.model.vo.SubOrder;
 import com.ydtech.modules.admin.model.vo.SysUserAccountVo;
@@ -312,4 +312,29 @@ public class SysUserAccountController extends BaseController {
         MySumAmountDto amountDto = sysUserAccountService.findMyAmount(mySumAmountQueryDto);
         return HttpResult.ok(amountDto);
     }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:14
+     *  @Description: 查询用户的提现总金额去除电销组员的金额(电销组员通过逻辑累加到组长上了)
+     */
+    @GetMapping("/queryCount")
+    @ApiOperation(value = "查询所有的账户的数据金额")
+    public HttpResult<BigDecimal> queryCount() {
+         BigDecimal bigDecimal = sysUserAccountService.queryCount();
+        return HttpResult.ok("success", bigDecimal);
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:15
+     *  @Description:  查询用户的银行卡信息
+     */
+    @GetMapping("/queryCardListByUserId")
+    @ApiOperation(value = "查询用户的银行卡信息")
+    public HttpResult<List> queryCardListByUserId(String userId) {
+        List<SysUserBankCard> cardList = sysUserAccountService.queryCardListByUserId(userId);
+        return HttpResult.ok("success", cardList);
+    }
 }

+ 22 - 0
src/main/java/com/ydtech/modules/admin/controller/quoteCount/QuoteCountController.java

@@ -57,4 +57,26 @@ public class QuoteCountController {
             return HttpResult.error("查询错误"+e.getMessage());
         }
     }
+
+    /**
+     * @description:   控制台-小定单报价明细
+     * @author: whp
+     **/
+    @PostMapping("/quotationDetailsExcel")
+    @ApiOperation(value = "控制台-小定单报价明细")
+    public HttpResult quotationDetailsExcel(@RequestBody CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto, HttpServletRequest httpServerRequest) {
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                companyQutationCountDataQueryDto.setDeptIds(kztGetDeptUtilsDto.getIds());
+            } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                companyQutationCountDataQueryDto.setUserIds(kztGetDeptUtilsDto.getIds());
+            }
+        }
+        return this.companyDataReportService.quotationDetailsExcel(companyQutationCountDataQueryDto);
+    }
+
+
+
 }

+ 7 - 0
src/main/java/com/ydtech/modules/admin/dao/DeptBalanceMapper.java

@@ -51,4 +51,11 @@ public interface DeptBalanceMapper {
      *  @Description: 查询电销组长的收入
      */
     BigDecimal getDxWalletAgentAmount(@Param("ids") List<String> userList, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+    /**
+     *
+     * @param deptBalanceVo
+     * @return  获取钱包总收入
+     */
+    HashMap<String, BigDecimal> getIncomeIndication(DeptBalanceVo deptBalanceVo);
 }

+ 6 - 0
src/main/java/com/ydtech/modules/admin/dao/SysPremiumDetailsMapper.java

@@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.SysPremiumDetails;
 import com.ydtech.modules.admin.model.dto.AgencyUserInsAreaDto;
 import com.ydtech.modules.admin.model.dto.CommissionInfoDto;
+import com.ydtech.modules.admin.model.dto.DeptBalanceDto;
 import com.ydtech.modules.admin.model.vo.AgencyUserInsAreaVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -23,4 +26,7 @@ public interface SysPremiumDetailsMapper extends BaseMapper<SysPremiumDetails> {
     List<Map<String, Object>> queryInfoPage(@Param("userId") String userId,  @Param("dto") CommissionInfoDto commissionInfoDto);
 
     Page<Map<String, Object>> queryInfoPages(Page page,  @Param("dto") CommissionInfoDto commissionInfoDto);
+
+    HashMap<String, BigDecimal> getTotalAmount(DeptBalanceDto itemLeader);
+
 }

+ 17 - 3
src/main/java/com/ydtech/modules/admin/dao/SysUserAccountMapper.java

@@ -3,9 +3,8 @@ package com.ydtech.modules.admin.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.po.SysUserAccount;
+import com.ydtech.modules.admin.model.po.SysUserBankCard;
 import com.ydtech.modules.admin.model.vo.SysUserAccountVo;
-import com.ydtech.modules.order.entity.InsOrders;
-import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
 import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
@@ -21,7 +20,7 @@ public interface SysUserAccountMapper extends BaseMapper<SysUserAccount> {
 
     Page<SysUserAccount> queryPageOrder(SysUserAccountVo sysUserAccountVo,@Param("page") Page page);
 
-    Page<SysUserAccount> queryPageOrder1(@Param("sysUserAccountVo") SysUserAccountVo sysUserAccountVo,@Param("page") Page page);
+    Page<SysUserAccount> queryPageOrder1(@Param("page") Page page,@Param("sysUserAccountVo") SysUserAccountVo sysUserAccountVo);
 
     SysUserAccount getById(String userId);
     /**
@@ -31,6 +30,21 @@ public interface SysUserAccountMapper extends BaseMapper<SysUserAccount> {
      *  @Description: 查询组长下的组员信息账户总金额
      */
     BigDecimal getGroupById(@Param("userId") String userId);
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:19
+     *  @Description:  查询账户列表
+     */
+    List<SysUserAccount> queryCount();
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:28
+     *  @Description:  通过用户id查询银行卡信息
+     */
+    List<SysUserBankCard> queryCardListByUserId(@Param("userId") String userId);
 }
 
 

+ 71 - 0
src/main/java/com/ydtech/modules/admin/model/dto/QuotationDetailsExcel.java

@@ -0,0 +1,71 @@
+package com.ydtech.modules.admin.model.dto;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+@Data
+public class QuotationDetailsExcel {
+    @ExcelProperty(value = "订单号",index = 0)
+    private String orderno;
+
+    @ExcelProperty(value = "协议编码",index = 1)
+    private String agreementId;
+
+
+    @ExcelProperty(value = "订单状态",index = 2)
+    private String orderstatus;
+
+    @ExcelProperty(value = "保险公司编号",index = 3)
+    private String companyId;
+
+
+    @ExcelProperty(value = "合作公司编号",index = 4)
+    private String partnerCompaniesId;
+
+    @ExcelProperty(value = "合作公司名称",index = 5)
+    private String partnerCompaniesName;
+
+    @ExcelProperty(value = "保险名称",index = 6)
+    private String inscompany;
+
+    @ExcelProperty(value = "交强保单号",index = 7)
+    private String jqpolicyno;
+
+    @ExcelProperty(value = "商业保单号",index = 8)
+    private String sypolicyno;
+
+    @ExcelProperty(value = "总保费",index = 9)
+    private String sumpremium;
+
+    @ExcelProperty(value = "交强险费用",index = 10)
+    private String jqpremium;
+
+    @ExcelProperty(value = "商业险费用",index = 11)
+    private String sypremium;
+
+    @ExcelProperty(value = "驾意险费用",index = 12)
+    private String jypremium;
+
+    @ExcelProperty(value = "录单日期",index = 13)
+    private String createtime;
+
+    @ExcelProperty(value = "签单日期",index = 14)
+    private String signingTime;
+
+    @ExcelProperty(value = "是否是人工审核",index = 15)
+    private String auditType;
+
+    @ExcelProperty(value = "机构来源",index = 16)
+    private String managementSource;
+
+    @ExcelProperty(value = "用户名称",index = 17)
+    private String userName;
+
+    @ExcelProperty(value = "车牌号",index = 18)
+    private String licenseno;
+
+    @ExcelIgnore
+    private String auditstatus;
+
+}

+ 5 - 0
src/main/java/com/ydtech/modules/admin/model/dto/ReceivableExcel.java

@@ -58,6 +58,11 @@ public class ReceivableExcel {
     private String otherFeevalue;
 
 
+    @ExcelProperty(value = "维护人",index = 17)
+    private String leaderName;
+
+
+
 
 
 

+ 6 - 1
src/main/java/com/ydtech/modules/admin/model/po/SysUserAccount.java

@@ -8,6 +8,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -118,7 +119,7 @@ public class SysUserAccount implements Serializable {
 
     @ApiModelProperty(value = "所属账户下的卡")
     @TableField(exist = false)
-    List<SysUserBankCard> sysUserAccountCardList;
+    List<SysUserBankCard> sysUserAccountCardList =new ArrayList<SysUserBankCard>();
 
     // add by  hxl   2024-06-18  添加账号总金额
     /**
@@ -149,4 +150,8 @@ public class SysUserAccount implements Serializable {
     private  String  managementSource;
     @TableField(exist = false)
     private  String  roleId;
+
+    @TableField(exist = false)
+    private  String  id;
+
 }

+ 3 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysUserAccountVo.java

@@ -18,6 +18,9 @@ import java.util.List;
 @ApiModel("查询Vo")
 public class SysUserAccountVo {
 
+    @ApiModelProperty(value = "前端唯一key")
+    private String id;
+
     @ApiModelProperty(value = "用户id")
     private String userId;
 

+ 6 - 0
src/main/java/com/ydtech/modules/admin/service/CompanyDataReportService.java

@@ -51,6 +51,12 @@ public interface CompanyDataReportService {
      **/
     HttpResult largeOrdersExcel(OrdersDataVo ordersDataVo);
 
+    /**
+     * @description:   控制台-小定单报价明细
+     * @author: whp
+     **/
+    HttpResult quotationDetailsExcel(CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto);
+
 }
 
 

+ 3 - 3
src/main/java/com/ydtech/modules/admin/service/SysAreaService.java

@@ -39,7 +39,7 @@ public interface SysAreaService extends IService<SysArea> {
      * @param address 地址
      * @return
      */
-    PersonAreaVo queryByAddress(String address, String idcard);
+    PersonAreaVo queryByAddress(String address, String idcard,String leaderIdcard);
 
     /**
      * 使用永诚提供地省市区 地址身份证号 获取省市区
@@ -50,7 +50,7 @@ public interface SysAreaService extends IService<SysArea> {
      */
     @DynamicName(tableName = "ins_yongcheng_area")
     default PersonAreaVo queryByAddressYc(String address, String idcard) {
-        return queryByAddress(address, idcard);
+        return queryByAddress(address, idcard,"");
     }
 
     /**
@@ -62,7 +62,7 @@ public interface SysAreaService extends IService<SysArea> {
      */
     @DynamicName(tableName = "ins_bohai_area")
     default PersonAreaVo queryByAddressBoHai(String address, String idcard) {
-        return queryByAddress(address, idcard);
+        return queryByAddress(address, idcard,"");
     }
 
 

+ 18 - 1
src/main/java/com/ydtech/modules/admin/service/SysUserAccountService.java

@@ -1,10 +1,10 @@
 package com.ydtech.modules.admin.service;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.po.SysUserAccount;
+import com.ydtech.modules.admin.model.po.SysUserBankCard;
 import com.ydtech.modules.admin.model.vo.MyIncomeAndExpensesNewPageVo;
 import com.ydtech.modules.admin.model.vo.SubOrder;
 import com.ydtech.modules.admin.model.vo.SysUserAccountVo;
@@ -133,4 +133,21 @@ public interface SysUserAccountService extends IService<SysUserAccount> {
      *  @Description: 查询我的账户页面总金额
      */
     MySumAmountDto findMyAmount(MySumAmountQueryDto mySumAmountQueryDto);
+
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:18
+     *  @Description:  查询提现总金额
+     */
+    public BigDecimal queryCount();
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:17
+     *  @Description:  通过用户id查询银行卡信息
+     */
+    List<SysUserBankCard> queryCardListByUserId(String userId);
 }

+ 72 - 0
src/main/java/com/ydtech/modules/admin/service/impl/CompanyDataReportServiceImpl.java

@@ -7,6 +7,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.dao.CompanyDataReportMapper;
 import com.ydtech.modules.admin.model.dto.OrdersDataExcel;
+import com.ydtech.modules.admin.model.dto.QuotationDetailsExcel;
+import com.ydtech.modules.admin.model.dto.ReceivableExcel;
 import com.ydtech.modules.admin.model.dto.TaskStatisticsExcel;
 import com.ydtech.modules.admin.model.report.company.*;
 import com.ydtech.modules.admin.model.report.opetationData.QuotationCountDataDto;
@@ -269,6 +271,76 @@ public class CompanyDataReportServiceImpl implements CompanyDataReportService {
         return HttpResult.ok("", uploadUrl + "excel/" + fileName);
     }
 
+
+    /**
+     * @description:   控制台-小定单报价明细
+     * @author: whp
+     **/
+    @Override
+    public HttpResult quotationDetailsExcel(CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto) {
+        HashMap<String, String> dateMapByType = getDateMapByType(companyQutationCountDataQueryDto.getDateType(), companyQutationCountDataQueryDto.getBeginDate(), companyQutationCountDataQueryDto.getEndDate());
+        companyQutationCountDataQueryDto.setBeginDate(dateMapByType.get("startDate"));
+        companyQutationCountDataQueryDto.setEndDate(dateMapByType.get("endDate"));
+        List<QuotationDetailsExcel> resultSubOrder = insAreaCompanyMapper.quotationDetailsExcel(companyQutationCountDataQueryDto);
+        this.saveTranslate(resultSubOrder);
+        String uploadPath = this.uploadPath + "/excel/";
+        Path path = Paths.get(uploadPath);
+        if (!Files.exists(path)) {
+            try {
+                Files.createDirectories(path);
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        String fileName = EasyExcelUtils.downExcel(uploadPath, "小定单明细", QuotationDetailsExcel.class, resultSubOrder);
+        return HttpResult.ok("", uploadUrl + "excel/" + fileName);
+    }
+
+    private void saveTranslate(List<QuotationDetailsExcel> resultSubOrder) {
+
+        for (QuotationDetailsExcel quotationDetailsExcel : resultSubOrder) {
+            String managementSource = quotationDetailsExcel.getManagementSource();
+            if(StringUtils.isNotEmpty(quotationDetailsExcel.getManagementSource())){
+                if("1".equals(quotationDetailsExcel.getManagementSource())){
+                    quotationDetailsExcel.setManagementSource("渠道");
+                }
+                if("2".equals(quotationDetailsExcel.getManagementSource())){
+                    quotationDetailsExcel.setManagementSource("代理人");
+                }
+                if("3".equals(quotationDetailsExcel.getManagementSource())){
+                    quotationDetailsExcel.setManagementSource("电销");
+                }
+            }
+
+            if (StringUtils.isNotEmpty(quotationDetailsExcel.getAuditType()) && StringUtils.isNotEmpty(quotationDetailsExcel.getAuditstatus())) {
+                if("1".equals(quotationDetailsExcel.getAuditType()) && "1".equals(quotationDetailsExcel.getAuditstatus()) && "3".equals(quotationDetailsExcel.getOrderstatus())){
+                    quotationDetailsExcel.setAuditType("人工审核");
+                }else {
+                    quotationDetailsExcel.setAuditType("自动审核");
+                }
+            }
+
+            if(StringUtils.isNotEmpty(quotationDetailsExcel.getOrderstatus())){
+                if("0".equals(quotationDetailsExcel.getOrderstatus())){
+                    quotationDetailsExcel.setOrderstatus("报价完成");
+                }
+                if("1".equals(quotationDetailsExcel.getOrderstatus())){
+                    quotationDetailsExcel.setOrderstatus("待核保");
+                }
+                if("2".equals(quotationDetailsExcel.getOrderstatus())){
+                    quotationDetailsExcel.setOrderstatus("已核保待缴费");
+                }
+                if("3".equals(quotationDetailsExcel.getOrderstatus())){
+                    quotationDetailsExcel.setOrderstatus("已承保");
+                }
+                if("10".equals(quotationDetailsExcel.getOrderstatus())){
+                    quotationDetailsExcel.setOrderstatus("报价失败");
+                }
+            }
+
+        }
+
+    }
 }
 
 

+ 74 - 18
src/main/java/com/ydtech/modules/admin/service/impl/DeptBalanceServiceImpl.java

@@ -21,6 +21,7 @@ import com.ydtech.modules.esm.dao.EsmUserReferrerMapper;
 import com.ydtech.modules.esm.model.EsmUserReferrer;
 import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
+import com.ydtech.utils.BigDecimalUtils;
 import com.ydtech.utils.StringUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -105,10 +106,11 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                     itemLeader.setBeginDate(deptBalanceVo.getBeginDate());
                     itemLeader.setEndDate(deptBalanceVo.getEndDate());
 
-                    SysPartnerAccount sysPartnerAccount =sysPartnerAccountMapper.getByDeptBalanceDto(itemLeader);
-                    if (sysPartnerAccount != null) {
-                        BigDecimal sumPremium = sysPartnerAccount.getSumPremium();
-                        BigDecimal extractFee = sysPartnerAccount.getExtractFee();
+                    HashMap<String,BigDecimal>totalAmountMap =sysPremiumDetailsMapper.getTotalAmount(itemLeader);
+//                    SysPartnerAccount sysPartnerAccount =sysPartnerAccountMapper.getByDeptBalanceDto(itemLeader);
+                    if (totalAmountMap != null) {
+                        BigDecimal sumPremium = totalAmountMap.get("totalAmount");
+                        BigDecimal extractFee = totalAmountMap.get("extractFeeAmount");
                         itemLeader.setTotalIncome(sumPremium);
                         itemLeader.setDeptManagementFee(extractFee);
 
@@ -164,6 +166,8 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                 String userId = item.getUserId();
                 item.setLoginUserId(userId);
                 SysPartnerAccount sysPartnerAccount = sysPartnerAccountMapper.selectOne(new LambdaQueryWrapper<SysPartnerAccount>()
+                        .between(StringUtils.isNotEmpty(deptBalanceVo.getBeginDate()) && StringUtils.isNotEmpty(deptBalanceVo.getEndDate()),
+                                SysPartnerAccount::getCreateTime, deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate())
                         .eq(SysPartnerAccount::getUserId, item.getUserId()));
                 if(ObjectUtils.isNotEmpty(sysPartnerAccount)){
                     if(sysPartnerAccount.getSumPremium() !=null ){
@@ -213,6 +217,36 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                         .eq(SysRelationPerson::getType, 1));
                 item.setIndirectStudio(indirectStudioList.size());
 
+
+                List<String> userIds1 = getUserIds(sysRelationPersonList2);
+                BigDecimal sumPremium1 = BigDecimal.ZERO;
+                BigDecimal extractFee1 = BigDecimal.ZERO;
+                if (CollectionUtil.isNotEmpty(userIds1)) {
+                    for (String id : userIds1) {
+                        //费用
+                        List<SysPremiumDetails> sysPremiumDetail = sysPremiumDetailsMapper.selectList(new LambdaQueryWrapper<SysPremiumDetails>()
+                                .eq(SysPremiumDetails::getUserId, userId)
+                                .eq(SysPremiumDetails::getIssuerId,id)
+                                .between(StringUtils.isNotEmpty(deptBalanceVo.getBeginDate()) && StringUtils.isNotEmpty(deptBalanceVo.getEndDate()),
+                                        SysPremiumDetails::getCreateTime, deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate())
+                                .eq(SysPremiumDetails::getStatus, 1)
+                                .eq(deptBalanceVo.getIndustrySector() != null, SysPremiumDetails::getIndustrySector, deptBalanceVo.getIndustrySector()));
+
+                        if (CollectionUtil.isNotEmpty(sysPremiumDetail)) {
+                            Map<String, List<SysPremiumDetails>> map = sysPremiumDetail.stream().sorted(Comparator.comparing(SysPremiumDetails::getId))
+                                    .collect(Collectors.groupingBy(SysPremiumDetails::getCompanyId));
+                            for (String s : map.keySet()) {
+                                List<SysPremiumDetails> sysPremiumDetails1 = map.get(s);
+                                sumPremium1 = sumPremium1.add(sysPremiumDetails1.get(0).getSumpremium());
+                            }
+
+//                                sumPremium1 = sumPremium1.add(sysPremiumDetail.get(0).getSumpremium());
+                            extractFee1 = extractFee1.add(sysPremiumDetail.stream().map(SysPremiumDetails::getExtractFee).reduce(BigDecimal.ZERO, BigDecimal::add));
+                        }
+                    }
+                }
+                item.setTotalIncome(sumPremium1);
+                item.setCommission(extractFee1);
                 if (sysRelationPersonList2.size() > 0) {
                     List<String> ids = sysRelationPersonList2.stream().map(SysRelationPerson::getAgencyLeaderId).collect(Collectors.toList());
                     List<SysAgencyLeader> leaderList = sysAgencyLeaderMapper.selectList(new LambdaQueryWrapper<SysAgencyLeader>()
@@ -355,21 +389,30 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                     }
 
                     //如果是电销组长,将组员的数据算进来
-                        mySumAmountQueryDto.setGroupFlag(true);
-                        List<String> userList = sysUserService.getGroupByUserId(userId);
-                        //sumAmount= deptBalanceMapper.getDxWalletAgentAmount(userList,deptBalanceVo.getBeginDate(),deptBalanceVo.getEndDate());
-                        SysUserAccount sysUserAccountEntity = sysUserAccountService.getById(record.getUserId());
-                        // 已提现金额   查询历史表中的审核状态为3的数据
-                        ytxAmount = insFeeOrderNewService.findMyAmountYTXmountByDates(record.getUserId(), "3",true,deptBalanceVo.getBeginDate(),deptBalanceVo.getEndDate());
-                        // 提现中
-                        sxAmount = insFeeOrderNewService.findMyAmountYTXmountByDates(record.getUserId(), "2",true,deptBalanceVo.getBeginDate(),deptBalanceVo.getEndDate());
-                        // 可提现
-                        wtxAmount= (sysUserAccountEntity==null || sysUserAccountEntity.getSumAmount()==null)?BigDecimal.ZERO:sysUserAccountEntity.getSumAmount();
-                        //总的 =  已提现金额+  可提现金额 +  提现中
-                        sumAmount = wtxAmount.add(sxAmount).add(ytxAmount);
+                    mySumAmountQueryDto.setGroupFlag(true);
+                    List<String> userList = sysUserService.getGroupByUserId(userId);
+                    //sumAmount= deptBalanceMapper.getDxWalletAgentAmount(userList,deptBalanceVo.getBeginDate(),deptBalanceVo.getEndDate());
+                    SysUserAccount sysUserAccountEntity = sysUserAccountService.getById(record.getUserId());
+                    // 已提现金额   查询历史表中的审核状态为3的数据
+                    ytxAmount = insFeeOrderNewService.findMyAmountYTXmountByDates(record.getUserId(), "3",true,deptBalanceVo.getBeginDate(),deptBalanceVo.getEndDate());
+                    // 提现中
+                    sxAmount = insFeeOrderNewService.findMyAmountYTXmountByDates(record.getUserId(), "2",true,deptBalanceVo.getBeginDate(),deptBalanceVo.getEndDate());
+                    // 可提现
+                    wtxAmount= (sysUserAccountEntity==null || sysUserAccountEntity.getSumAmount()==null)?BigDecimal.ZERO:sysUserAccountEntity.getSumAmount();
+
+                    deptBalanceVo.setUserId(record.getUserId());
+                    HashMap<String, BigDecimal> incomeIndication = deptBalanceMapper.getIncomeIndication(deptBalanceVo);
+
+                    if(incomeIndication!=null){
+                        record.setTotalIncome(incomeIndication.get("totalAmount"));
+                    }else {
+                        record.setTotalIncome(BigDecimal.ZERO);
+                    }
+                    //总的 =  已提现金额+  可提现金额 +  提现中
+                    sumAmount = wtxAmount.add(sxAmount).add(ytxAmount);
                     record.setWithdrawn(ytxAmount);
                     record.setNotWithdrawn(wtxAmount);
-                    record.setTotalIncome(sumAmount);
+//                    record.setTotalIncome(sumAmount);
                     record.setWithdrawingAmount(sxAmount);
                 }
             }
@@ -394,9 +437,22 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                     ssKTAmount = sysUserAccountEntity.getSumAmount()==null?BigDecimal.ZERO: sysUserAccountEntity.getSumAmount();
                 }
                 BigDecimal sumAmount=ysTXAmount.add(ssKTAmount).add(txzTXAmount);
+
+                //2025-1-8  需求 总收入 = 当天审核订单收入   收支明细
+                deptBalanceVo.setUserId(record.getUserId());
+                HashMap<String, BigDecimal> incomeIndication = deptBalanceMapper.getIncomeIndication(deptBalanceVo);
                 record.setWithdrawn(ysTXAmount);
                 record.setNotWithdrawn(ssKTAmount);
-                record.setTotalIncome(sumAmount);
+                if(incomeIndication!=null){
+                        record.setTotalIncome(incomeIndication.get("totalAmount"));
+//                    if(deptBalanceVo.getManagementSource().equals("2")){
+//                        record.setTotalIncome(incomeIndication.get("totalAmount"));
+//                    }else {
+//                        record.setTotalIncome(BigDecimalUtils.nullToZero(incomeIndication.get("totalAmount")).divide(new BigDecimal(10)));
+//                    }
+                }else {
+                    record.setTotalIncome(BigDecimal.ZERO);
+                }
                 record.setWithdrawingAmount(txzTXAmount);
             }
         }

+ 6 - 3
src/main/java/com/ydtech/modules/admin/service/impl/ProfitAnalysisServiceImpl.java

@@ -83,9 +83,12 @@ public class ProfitAnalysisServiceImpl implements ProfitAnalysisService {
      */
     @Override
     public List<ProfitAnalysisDto> getProfitAnalysisQueryList(ProfitAnalysisQueryDto profitAnalysisQueryDto) {
-        HashMap<String, String> dateMapByType = getDateMapByType(profitAnalysisQueryDto.getDateType(), profitAnalysisQueryDto.getYear());
-        profitAnalysisQueryDto.setBeginDate(dateMapByType.get("startDate"));
-        profitAnalysisQueryDto.setEndDate(dateMapByType.get("endDate"));
+        if(StringUtils.isNotEmpty(profitAnalysisQueryDto.getDateType())){
+            profitAnalysisQueryDto.setYear(null);
+            HashMap<String, String> dateMapByType = getDateMapByType(profitAnalysisQueryDto.getDateType(), profitAnalysisQueryDto.getYear());
+            profitAnalysisQueryDto.setBeginDate(dateMapByType.get("startDate"));
+            profitAnalysisQueryDto.setEndDate(dateMapByType.get("endDate"));
+        }
         List<ProfitAnalysisDto> profitAnalysisQueryList = insPlyIncomeMapper.getProfitAnalysisQueryList(profitAnalysisQueryDto);
         if(!profitAnalysisQueryList.isEmpty()){
             for (ProfitAnalysisDto profitAnalysisDto : profitAnalysisQueryList) {

+ 5 - 2
src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyLeaderServiceImpl.java

@@ -22,6 +22,7 @@ import com.ydtech.modules.order.dao.InsOrdersMapper;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.utils.ObjectUtil;
 import com.ydtech.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
@@ -417,7 +418,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
         Page<SysAgencyLeader> insOrdersPage = page(page, wrapper);
         List<SysAgencyLeader> records = insOrdersPage.getRecords();
         List<SysAgencyLeaderVo> sysAgencyLeaderVos = BeanUtil.copyToList(records, SysAgencyLeaderVo.class);
-        if (sysAgencyLeaderVos.size() > 0) {
+        if (!sysAgencyLeaderVos.isEmpty()) {
             for (SysAgencyLeaderVo sysAgencyLeaderVo : sysAgencyLeaderVos) {
                 SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>().eq(SysDept::getId, sysAgencyLeaderVo.getDeptId()).eq(SysDept::getDelFlag, 0));
                 if (sysDept != null) {
@@ -425,7 +426,9 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                     sysAgencyLeaderVo.setDeptName(sysDept.getName());
                 }
                 SysUser sysUser = sysUserMapper.selectById(sysAgencyLeaderVo.getUserId());
-                sysAgencyLeaderVo.setUserName(sysUser.getName());
+                if(!Objects.isNull(sysUser)) {
+                    sysAgencyLeaderVo.setUserName(sysUser.getName());
+                }
             }
         }
 

+ 16 - 5
src/main/java/com/ydtech/modules/admin/service/impl/SysAreaServiceImpl.java

@@ -53,14 +53,19 @@ public class SysAreaServiceImpl extends ServiceImpl<SysAreaMapper, SysArea>
 
     //查询所有的上级
     @Override
-    public PersonAreaVo queryByAddress(String address, String idcard) {
+    public PersonAreaVo queryByAddress(String address, String idcard, String leaderIdcard) {
         PersonAreaVo personAreaVo = new PersonAreaVo();
         //获取县级全部区划数据
         List<SysArea> sysAreaVos = this.queryByLevel(3);
         //被保人 赛选出的地址条件
         List<SysArea> collect = sysAreaVos.stream().filter(item -> address.contains(item.getAreaCname())).collect(Collectors.toList());
         //截取身份证的省级代码
-        String provincesCode = idcard.substring(0, 3);
+        String provincesCode;
+        if (idcard != null) {
+            provincesCode = idcard.substring(0, 3);
+        } else {
+            provincesCode = leaderIdcard.substring(0, 3);
+        }
         //获取省级的区划
         if (!collect.isEmpty()) {
             List<SysArea> provincesArea = collect.stream()
@@ -92,10 +97,16 @@ public class SysAreaServiceImpl extends ServiceImpl<SysAreaMapper, SysArea>
                 return personAreaVo;
             }
         }
+        if (idcard != null) {
+            personAreaVo.setProvinceCode(idcard.substring(0, 2) + "0000");
+            personAreaVo.setCityCode(idcard.substring(0, 4) + "00");
+            personAreaVo.setCountyCode(idcard.substring(0, 6));
+        } else {
+            personAreaVo.setProvinceCode(leaderIdcard.substring(0, 2) + "0000");
+            personAreaVo.setCityCode(leaderIdcard.substring(0, 4) + "00");
+            personAreaVo.setCountyCode(leaderIdcard.substring(0, 6));
+        }
 
-        personAreaVo.setProvinceCode(idcard.substring(0, 2) + "0000");
-        personAreaVo.setCityCode(idcard.substring(0, 4) + "00");
-        personAreaVo.setCountyCode(idcard.substring(0, 6));
 
         return personAreaVo;
     }

+ 9 - 7
src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java

@@ -131,15 +131,17 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
 
         List<SysUserPartner> sysUserPartners = BeanUtil.copyToList(records, SysUserPartner.class);
 
-        if (sysUserPartners.size() > 0) {
+        if (!sysUserPartners.isEmpty()) {
             for (SysUserPartner user : sysUserPartners) {
                 SysUser sysUser1 = sysUserMapper.selectById(user.getUserId());
-                user.setUserName(sysUser1.getName());
-                user.setDeptId(sysUser1.getDeptId());
-                SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
-                        .eq(SysDept::getId, sysUser1.getDeptId()).eq(SysDept::getDelFlag, 0));
-                user.setParentId(sysDept.getParentId());
-                user.setDeptName(sysDept.getName());
+                if(!Objects.isNull(sysUser1)) {
+                    user.setUserName(sysUser1.getName());
+                    user.setDeptId(sysUser1.getDeptId());
+                    SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
+                            .eq(SysDept::getId, sysUser1.getDeptId()).eq(SysDept::getDelFlag, 0));
+                    user.setParentId(sysDept.getParentId());
+                    user.setDeptName(sysDept.getName());
+                }
                 SysPartner sysPartner = sysPartnerMapper.selectOne(new LambdaQueryWrapper<SysPartner>()
                         .eq(SysPartner::getUserId, user.getUserId()));
                 if (sysPartner != null) {

+ 41 - 3
src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java

@@ -251,7 +251,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
     @Override
     public BasePageResult<SysUserAccount> queryByVo1(SysUserAccountVo sysUserAccountVo) {
         Page<SysUserAccount> page = new Page<>(sysUserAccountVo.getPageNum(), sysUserAccountVo.getPageSize());
-        Page<SysUserAccount> sysUserAccountHistoryPage = baseMapper.queryPageOrder1(sysUserAccountVo,page);
+        Page<SysUserAccount> sysUserAccountHistoryPage = baseMapper.queryPageOrder1(page,sysUserAccountVo);
         if(sysUserAccountHistoryPage!=null){
             List<SysUserAccount> records = sysUserAccountHistoryPage.getRecords();
             List<SysUserAccount> newRecords = new ArrayList<>();
@@ -284,7 +284,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             }
             sysUserAccountHistoryPage.setRecords(newRecords);
         }
-        return new BasePageResult<>(sysUserAccountVo.getPageNum(), page.getSize(), sysUserAccountHistoryPage.getTotal(), page.getPages(),
+        return new BasePageResult<>(sysUserAccountVo.getPageNum(), sysUserAccountVo.getPageSize(), sysUserAccountHistoryPage.getTotal(), page.getPages(),
                 sysUserAccountHistoryPage.getRecords());
     }
 
@@ -1664,6 +1664,44 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             }
         }
     }
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:27
+     *  @Description:  查询提现的总金额
+     */
+    @Override
+    public BigDecimal queryCount() {;
+        List<SysUserAccount> list = baseMapper.queryCount();
+        BigDecimal sumYsTXAmount =BigDecimal.ZERO;
+        if(list!=null && !list.isEmpty()){
+            for(SysUserAccount  sysUserAccount :list){
+                MySumAmountQueryDto mySumAmountQueryDto =new MySumAmountQueryDto();
+                mySumAmountQueryDto.setUserId(sysUserAccount.getUserId());
+                //出单员是19 且是渠道的话,给渠道团队长
+                if ("21".equals(sysUserAccount.getRoleId()) && "1".equals(sysUserAccount.getManagementSource())) {
+                    mySumAmountQueryDto.setDeptId(sysUserAccount.getDeptId());
+                }
+                //如果是电销组长,将组员的数据算进来
+                if ("72".equals(sysUserAccount.getRoleId()) && "3".equals(sysUserAccount.getManagementSource())) {
+                    mySumAmountQueryDto.setGroupFlag(true);
+                }
+                // 可提现
+                BigDecimal ssKTAmount = sysUserAccount.getSumAmount()==null?BigDecimal.ZERO:sysUserAccount.getSumAmount();
+                sumYsTXAmount =sumYsTXAmount.add(ssKTAmount);
+            }
+        }
+        return   sumYsTXAmount;
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2025/1/6 18:28
+     *  @Description:  通过用户id查询银行卡信息
+     */
+    @Override
+    public List<SysUserBankCard> queryCardListByUserId(String userId) {
+        return baseMapper.queryCardListByUserId(userId);
+    }
 
 }

+ 7 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java

@@ -1369,6 +1369,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     public HttpResult updateUserInfo(String userId, SysUser2Vo sysUserVo) {
         SysUser sysUser = sysUserVo.getSysUser();
         int beStatus = sysUser.getStatus();
+        //查找数据库是否存在相同的身份证
+        if(sysUserMapper.selectCount(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getIdentity, sysUserVo.getSysUser().getIdentity())
+                .ne(SysUser::getId,sysUserVo.getSysUser().getId())) > 0){
+            return HttpResult.error("已存在身份证号,无法修改");
+        }
+
         //如果审核驳回则 重新修改为 审核状态
         if (sysUserVo.getSysUser().getStatus().equals(UserWorkStatus.UWS_3.getCode())) {
             sysUserVo.getSysUser().setStatus(UserWorkStatus.UWS_2.getCode());

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

@@ -628,7 +628,7 @@ public class InsPlyIncomeController extends BaseController {
      * @param insPlyIncomeVo
      */
     @PostMapping("/correctData")
-    @ApiOperation(value = "批量保险非车修改比例确认")
+    @ApiOperation(value = "纠正数据")
     public HttpResult<Object> correctData(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
         insPlyIncomeService.correctData(insPlyIncomeVo);
         return HttpResult.ok();

+ 13 - 2
src/main/java/com/ydtech/modules/fnc/service/impl/InsFeeAuditServiceImpl.java

@@ -37,6 +37,7 @@ import com.ydtech.modules.lg.service.PushLgDataServerService;
 import com.ydtech.modules.order.dao.InsOrdersMapper;
 import com.ydtech.modules.order.entity.InsFeeOrder;
 import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
@@ -137,6 +138,8 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
     private PushLgDataServerService dataServerService;
 
     private ExecutorService executorService= Executors.newCachedThreadPool();
+    @Autowired
+    private InsOrdersService insOrdersService;
 
 
     public InsFeeAuditServiceImpl(FncInsAreaCompanyMapper insAreaCompanyMapper, InsOrdersMapper insOrdersMapper,
@@ -178,7 +181,6 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
 
             //InsOrders order = insOrdersMapper.selectById(orderNo);
             InsAreaCompany insAreaCompany = insAreaCompanyMapper.selectById(insFeeAudit.getInsOrderNo());
-
             //获取该订单的费用
             InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getOne(new LambdaQueryWrapper<InsFeeOrderNew>()
                     .eq(InsFeeOrderNew::getInsOrderNo, insFeeAudit.getInsOrderNo()));
@@ -335,12 +337,21 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
                 }
                 sysChannelCostService.updateBatchById(costList);
             }
+
             //先把钱加到总账户,再修改抽层状态
             List<SysPremiumDetails> sysPremiumDetails = sysPremiumDetailsMapper.selectList(new LambdaQueryWrapper<SysPremiumDetails>()
                     .eq(SysPremiumDetails::getCompanyId,insAreaCompany.getId())
                     .eq(SysPremiumDetails::getType,2)
                     .eq(SysPremiumDetails::getStatus,0));
-            if (sysPremiumDetails.size()>0) {
+
+            if (sysPremiumDetails.isEmpty() && order.getIsExternal() == 1) {
+                //已承保记录保费数据
+                com.ydtech.modules.order.entity.InsAreaCompany insAreaCompany1 = new com.ydtech.modules.order.entity.InsAreaCompany();
+                BeanUtils.copyProperties(insAreaCompany, insAreaCompany1);
+                insOrdersService.saveFeeInfo(insAreaCompany1);
+            }
+
+            if (!sysPremiumDetails.isEmpty()) {
 
                 Map<String, List<SysPremiumDetails>> listMap = sysPremiumDetails.stream().sorted(Comparator.comparing(SysPremiumDetails::getId))
                         .collect(Collectors.groupingBy(SysPremiumDetails::getUserId));

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

@@ -1946,6 +1946,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
      */
 
     @Override
+
     public List<InsPlyIncome> totalBxAmount(InsPlyIncomeVo insPlyIncomeVo) {
         HashMap<String, Object> params = new HashMap<>();
         params = this.saveParams(insPlyIncomeVo, params);
@@ -2610,10 +2611,15 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         InsPlyIncome totalledAmount = baseMapper.ptTotalAmount(params);  //总金额
         return totalledAmount;
     }
-
+// -> 2024
     @Override
     public HttpResult<List<HashMap<String, Object>>> otherTimeDetail(InsPlyIncomeVo insPlyIncomeVo) {
         HashMap<String, Object> params = new HashMap<>();
+        if(StringUtils.isNotEmpty(insPlyIncomeVo.getYeartsStart())){
+            params.put("year", insPlyIncomeVo.getYeartsStart());
+            params.put("yearAdd", String.valueOf((Integer.valueOf(insPlyIncomeVo.getYeartsStart())+1)));
+
+        }
         this.saveParams(insPlyIncomeVo, params);
         List<HashMap<String, Object>> resultMap = baseMapper.otherTimeDetail(params);
 

+ 16 - 1
src/main/java/com/ydtech/modules/ins/model/vo/CustomerInfoVo.java

@@ -86,6 +86,15 @@ public class CustomerInfoVo {
     @ApiModelProperty(value = "县")
     private String county;
 
+    @ApiModelProperty(value = "省名称")
+    private String provinceName;
+
+    @ApiModelProperty(value = "市名称")
+    private String cityName;
+
+    @ApiModelProperty(value = "县名称")
+    private String countyName;
+
     @ApiModelProperty(value = "车主类型(0:法人 1:个人(中国籍) 2: 个人(非中国籍))")
     private String property;
 
@@ -94,9 +103,15 @@ public class CustomerInfoVo {
     @ApiModelProperty(value = "经营范围")
     private String scope;
 
-    @ApiModelProperty(value = "联系人")
+    @ApiModelProperty(value = "人")
     private String legalPerson;
 
+    @ApiModelProperty(value = "法人身份证号")
+    private String leaderIdentifyNumber;
+
+    @ApiModelProperty(value = "法人身份证止期")
+    private String leaderOtherEffectiveDate;
+
 
     public boolean contrastInfo(CustomerInfoVo customerInfoVo) {
         if (!ObjectUtils.nullSafeEquals(this.name, customerInfoVo.getName())) {

+ 3 - 3
src/main/java/com/ydtech/modules/order/components/bohai/BoHaiRequestApiComponent.java

@@ -87,7 +87,7 @@ public class BoHaiRequestApiComponent {
                                                                                             String sysSourceCode,
                                                                                             RequestType requestType) throws Exception {
         S response = post(q, url, tClass, sysSourceCode, requestType);
-        verificationResponseCode(response.getResponseCode(), response.getResponseMsg());
+        verificationResponseCode(response.getResponseCode(), response.getResponseMsg(),requestType);
         return response;
     }
 
@@ -234,8 +234,8 @@ public class BoHaiRequestApiComponent {
      * @param responseCode 响应code
      * @param responseMsg  响应内容
      */
-    private void verificationResponseCode(String responseCode, String responseMsg) {
-        if (ResponseCode.R_Z00004.getCode().equals(responseCode)) {
+    private void verificationResponseCode(String responseCode, String responseMsg,RequestType requestType) {
+        if (ResponseCode.R_Z00004.getCode().equals(responseCode) && !requestType.getCode().equals(RequestType.Z00008.getCode())) {
             throw new SystemException(responseMsg);
         }
     }

+ 0 - 1
src/main/java/com/ydtech/modules/order/components/dajia/DaJiaRequestApiComponents.java

@@ -57,7 +57,6 @@ public class DaJiaRequestApiComponents {
      */
     private <Q, S> S post(Q q, TradeCode tradeCode, Class<S> tClass) throws Exception {
 
-//        String url = apiComponents.getUrl() + tradeCode.getCode() + "/inf.dd";
         String url = apiComponents.getUrl() + tradeCode.getCode();
 
         HttpHeaders httpHeaders = new HttpHeaders();

+ 82 - 29
src/main/java/com/ydtech/modules/order/components/huatai/HuiTaiUploadImageComponents.java

@@ -10,16 +10,19 @@ import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.core.io.ByteArrayResource;
 import org.springframework.http.*;
 import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 import org.springframework.web.client.RestTemplate;
 
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
+import java.io.*;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.MessageDigest;
 import java.util.*;
 
 
@@ -35,9 +38,9 @@ import java.util.*;
 public class HuiTaiUploadImageComponents {
 
     private final RestTemplate restTemplate;
-    private static final String INIT_PARAM = "/h5img/app/ImgManager/initParam.cmd?t=";
-    private static final String FILE_UPLOAD = "/h5img/fileupload";
-    private static final String SAVE_FILE_IDX = "/h5img/app/ImgManager/saveFileIdx.cmd";
+    private static final String INIT_PARAM = "/h5img/app/ImgManager/initParam.cdo?t=";
+    private static final String FILE_UPLOAD = "/h5img/app/ImgFileUpload/upload.do";
+    private static final String SAVE_FILE_IDX = "/h5img/app/ImgManager/saveFileIdx.cdo";
 
     private final InsImagesUploadCacheComponents insImagesUploadCacheComponents;
 
@@ -66,7 +69,7 @@ public class HuiTaiUploadImageComponents {
         }
 
         HuaTaiImageInitParamResponse initParamResponse = initParam(domain, token);
-        List<HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO> childrenDTO = initParamResponse.getChildrenDTO();
+        List<HuaTaiImageInitParamResponse.TypeTreeNodeVoDTO.ChildrenDTO> childrenDTO = initParamResponse.getChildrenDTO();
         // 使用map 存储上传类型和图片
         Map<String, String> map = new HashMap<>();
         for (InsUploadImagesDto insUploadImagesDto : insUploadImagesDtos) {
@@ -79,10 +82,11 @@ public class HuiTaiUploadImageComponents {
                 boolean contains = Arrays.asList(fileTypeEnum.getImagesType()).contains(imageType);
                 if (contains) {
                     try {
-                        HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO childrenDTO1 =
+                        HuaTaiImageInitParamResponse.TypeTreeNodeVoDTO.ChildrenDTO childrenDTO1 =
                                 HuaTaiImageInitParamResponse.filteringTypeCode(childrenDTO, fileTypeEnum.getCode());
-                        FileuploadResult fileupload = fileupload(domain, token, initParamResponse, insUploadImagesDto.getFilePath(), file);
-                        saveFileIdx(domain, token, initParamResponse, fileupload, fileName, childrenDTO1);
+                        FileuploadResult fileupload = fileupload(domain, token, childrenDTO1, insUploadImagesDto.getFilePath(), file, initParamResponse.getStorageType());
+                        String imgId = insUploadImagesDto.getId();
+                        saveFileIdx(domain, token, initParamResponse, fileupload, fileName, childrenDTO1, imgId);
                         map.put(insUploadImagesDto.getImageType(), insUploadImagesDto.getImageId());
                     } catch (Exception e) {
                         insImagesUploadCacheComponents.setUploadImageCache(companyId, map);
@@ -106,11 +110,12 @@ public class HuiTaiUploadImageComponents {
      * @return
      */
     private HuaTaiImageInitParamResponse initParam(String domain, String token) {
-        HttpHeaders httpHeaders = new HttpHeaders();
         // token
-        httpHeaders.set("Cookie", "token=" + token);
-        String initParamUrl = domain + INIT_PARAM + System.currentTimeMillis();
-        HttpEntity<Object> httpEntity = new HttpEntity<>(null, httpHeaders);
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+        httpHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
+        String initParamUrl = domain + INIT_PARAM + System.currentTimeMillis() + "&token=" + token;
+        HttpEntity<Map<String, Object>> httpEntity = new HttpEntity<>(new HashMap<>(), httpHeaders);
         ResponseEntity<HuaTaiImageInitParamResponse> response = restTemplate.exchange(initParamUrl, HttpMethod.GET, httpEntity,
                 HuaTaiImageInitParamResponse.class);
         return response.getBody();
@@ -121,27 +126,48 @@ public class HuiTaiUploadImageComponents {
      *
      * @return 文件路劲
      */
-    private FileuploadResult fileupload(String domain, String token, HuaTaiImageInitParamResponse initParamResponse, String path,
-                                        String fileName) {
+    private FileuploadResult fileupload(String domain, String token, HuaTaiImageInitParamResponse.TypeTreeNodeVoDTO.ChildrenDTO childrenDTO, String path,
+                                        String fileName, String storageType) throws Exception {
         File file = new File(path);
+        String md5Hash = getMD5Hash(path);
         byte[] bytes = file2byte(file);
         double v = (double) bytes.length / 1024;
+        String uuidImagesName = UUID.nameUUIDFromBytes(bytes).toString();
+        // 请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+        ByteArrayResource byteArrayResource = new ByteArrayResource(bytes) {
+            @Override
+            public String getFilename() {
+                return fileName;
+            }
+        };
+        HttpHeaders httpHeadersFile = new HttpHeaders();
+        httpHeadersFile.setContentType(MediaType.IMAGE_JPEG);
+        body.set("file", new HttpEntity<>(byteArrayResource, httpHeadersFile));
+        body.set("token", token);
+        body.set("bussModule", childrenDTO.getBussType());
+        body.set("bussNo", childrenDTO.getBussNo());
+        body.set("fileName", fileName);
+        body.set("saveFileName", null);
+        body.set("bucket", childrenDTO.getBucket());
+        body.set("storageType", storageType);
+
+        // 请求头
         HttpHeaders httpHeaders = new HttpHeaders();
-        httpHeaders.setAccept(Collections.singletonList(MediaType.MULTIPART_FORM_DATA));
-        httpHeaders.set("Bucket", initParamResponse.getStorageType());
-        httpHeaders.set("Bussmodule", initParamResponse.getBussType());
-        httpHeaders.set("Bussno", initParamResponse.getBussNo());
-
+        httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA);
+        httpHeaders.set("Bucket", storageType);
+        httpHeaders.set("Bussmodule", childrenDTO.getBussType());
+        httpHeaders.set("Bussno", childrenDTO.getBussNo());
         // token
         httpHeaders.set("Token", token);
         // 文件名称
         httpHeaders.set("Filename", fileName);
-        httpHeaders.setContentType(MediaType.IMAGE_JPEG);
-        HttpEntity<byte[]> httpEntity = new HttpEntity<>(bytes, httpHeaders);
-
+        // 文件名称
+        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<>(body, httpHeaders);
         String fileuploadUrl = domain + FILE_UPLOAD;
         ResponseEntity<String> response = restTemplate.postForEntity(fileuploadUrl, httpEntity, String.class);
-        return new FileuploadResult(response.getBody(), v);
+        String imageUrl = response.getBody().replace("\"", "");
+        return new FileuploadResult(imageUrl, v, uuidImagesName, md5Hash);
     }
 
 
@@ -155,13 +181,14 @@ public class HuiTaiUploadImageComponents {
      */
     private void saveFileIdx(String domain, String token, HuaTaiImageInitParamResponse response, FileuploadResult fileupload,
                              String fileName,
-                             HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO childrenDTO) {
+                             HuaTaiImageInitParamResponse.TypeTreeNodeVoDTO.ChildrenDTO childrenDTO,
+                             String imgId) {
+
         HuaTaiSaveFileIdxRequest huaTaiSaveFileIdxRequest = new HuaTaiSaveFileIdxRequest(token, response, fileupload, fileName,
-                childrenDTO);
+                childrenDTO, imgId);
         huaTaiSaveFileIdxRequest.getFileIdxVo().setImgId(System.currentTimeMillis());
         HttpHeaders httpHeaders = new HttpHeaders();
         httpHeaders.setContentType(MediaType.APPLICATION_JSON);
-        httpHeaders.set("Cookie", "token=" + token);
         HttpEntity<HuaTaiSaveFileIdxRequest> httpEntity = new HttpEntity<>(huaTaiSaveFileIdxRequest, httpHeaders);
         String saveFileIdxUrl = domain + SAVE_FILE_IDX;
         restTemplate.postForEntity(saveFileIdxUrl, httpEntity, String.class);
@@ -176,6 +203,9 @@ public class HuiTaiUploadImageComponents {
 
         private double fileSize;
 
+        private String uuidImagesName;
+
+        private String md5Hash;
     }
 
 
@@ -218,6 +248,29 @@ public class HuiTaiUploadImageComponents {
         }
     }
 
+    public static String getMD5Hash(String imageFilePath) throws Exception {
+        InputStream fis = Files.newInputStream(Paths.get(imageFilePath));
+        byte[] buffer = new byte[1024];
+        MessageDigest complete = MessageDigest.getInstance("MD5");
+        int numRead;
+
+        do {
+            numRead = fis.read(buffer);
+            if (numRead > 0) {
+                complete.update(buffer, 0, numRead);
+            }
+        } while (numRead != -1);
+
+        fis.close();
+        byte[] b = complete.digest();
+
+        StringBuilder result = new StringBuilder();
+        for (int i = 0; i < b.length; i++) {
+            result.append(Integer.toString((b[i] & 0xff) + 0x100, 16).substring(1));
+        }
+        return result.toString();
+    }
+
 }
 
 

+ 5 - 0
src/main/java/com/ydtech/modules/order/dao/InsAreaCompanyMapper.java

@@ -428,6 +428,11 @@ public interface InsAreaCompanyMapper extends BaseMapper<InsAreaCompany> {
      */
     List<TaskStatisticsDto> getBusinessDataList(@Param("vo") TaskStatisticsVo taskStatisticsVo);
 
+    /**
+     * @description:   控制台-小定单报价明细
+     * @author: whp
+     **/
+    List<QuotationDetailsExcel> quotationDetailsExcel(@Param("vo") CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto);
 
 }
 

+ 2 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/CertType.java

@@ -15,7 +15,8 @@ import lombok.Getter;
 @Getter
 public enum CertType {
 
-    CT_111("111", "居民身份证");
+    CT_111("111", "居民身份证"),
+    CT_10("10", "统一社会信用代码");
 
     private final String code;
 

+ 4 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/constants/DocumentClass.java

@@ -34,12 +34,15 @@ public enum DocumentClass {
 
     C02("C02", "车主身份证正面", "Z00300", "Z001042"),
     D02("D02", "车主身份证反面", "Z00300", "Z001042"),
+    Y02("Y02", "车主营业执照", "Z00300", "Z00119"),
 
     C03("C03", "投保人身份证正面", "Z00100", "Z001042"),
     D03("D03", "投保人身份证反面", "Z00100", "Z001042"),
+    Y03("Y03", "投保人营业执照", "Z00100", "Z00119"),
 
     C04("C04", "被保人身份证正面", "Z00200", "Z001042"),
-    D04("D04", "被保人身份证反面", "Z00200", "Z001042");
+    D04("D04", "被保人身份证反面", "Z00200", "Z001042"),
+    Y04("Y04", "被保人营业执照", "Z00200", "Z00119");
 
 
     private final String code;

+ 85 - 37
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleConfirmationReqeust.java

@@ -239,7 +239,12 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
             VehicleKind vehicleKindEnum = VehicleKind.valueOf("VK_" + carInfo.getCimodelclass());
             this.effectDate = effectDate;
             this.vehicleKind = vehicleKindEnum.getCode();
-            this.vehicleAffNature = VehicleAffNature.VAN_1.getCode();
+            if (StringUtils.isBlank(carInfo.getProperty()) || "1".equals(carInfo.getProperty())) {
+                this.vehicleAffNature = VehicleAffNature.VAN_1.getCode();
+            }else{
+                this.vehicleAffNature = VehicleAffNature.VAN_3.getCode();
+            }
+
             // 车辆使用性质
             VehicleUsage vehicleUsageEnum = VehicleUsage.valueOf("VU_" + carInfo.getCarnature());
             this.vehicleUsage = vehicleUsageEnum.getCode();
@@ -330,22 +335,35 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
         private String birthday;
 
         public CarOwnerDTO(CustomerInfoVo ownerInfo, PersonAreaVo ownerInfoArea) {
-            this.certType = CertType.CT_111.getCode();
+            if(StringUtils.isBlank(ownerInfo.getProperty()) || !"0".equals(ownerInfo.getProperty())) {
+                this.certType = CertType.CT_111.getCode();
+                this.certNo = ownerInfo.getIdentifyNumber();
+                this.customerType = CustomerType.CT_2.getCode();
+                this.provCode = ownerInfoArea.getProvinceCode();
+                this.provName = ownerInfoArea.getProvinceName();
+                this.cityCode = ownerInfoArea.getCityCode();
+                this.cityName = ownerInfoArea.getCityName();
+                this.distCode = ownerInfoArea.getCountyCode();
+                this.distName = ownerInfoArea.getCountyName();
+                this.birthday = IDCardUtils.GetBirthday(ownerInfo.getIdentifyNumber());
+            } else {
+                this.certType = CertType.CT_10.getCode();
+                this.certNo = ownerInfo.getOrganizationCode();
+                this.customerType = CustomerType.CT_5.getCode();
+                this.provCode = ownerInfo.getProvince();
+                this.provName = ownerInfo.getProvinceName();
+                this.cityCode = ownerInfo.getCity();
+                this.cityName = ownerInfo.getCityName();
+                this.distCode = ownerInfo.getCounty();
+                this.distName = ownerInfo.getCountyName();
+            }
+
             this.ownerName = ownerInfo.getName();
-            this.certNo = ownerInfo.getIdentifyNumber();
             this.address = ownerInfo.getAddr();
             this.phoneNumber = ownerInfo.getMobile();
-            this.customerType = CustomerType.CT_2.getCode();
             this.email = ownerInfo.getEmail();
             this.certiType = ownerInfo.getIdentifyValidEndDate().contains("9999") ? "1" : "0";
             this.residentialAddress = ownerInfo.getAddr();
-            this.provCode = ownerInfoArea.getProvinceCode();
-            this.provName = ownerInfoArea.getProvinceName();
-            this.cityCode = ownerInfoArea.getCityCode();
-            this.cityName = ownerInfoArea.getCityName();
-            this.distCode = ownerInfoArea.getCountyCode();
-            this.distName = ownerInfoArea.getCountyName();
-            this.birthday = IDCardUtils.GetBirthday(ownerInfo.getIdentifyNumber());
         }
     }
 
@@ -442,13 +460,36 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
         private String birthday;
 
         public HolderDTO(CustomerInfoVo policyHolderInfo, PersonAreaVo policyHolderArea) {
-            // 通用参数
-            this.certType = CertType.CT_111.getCode();
+
+            if(StringUtils.isBlank(policyHolderInfo.getProperty()) || !"0".equals(policyHolderInfo.getProperty())) {
+                // 通用参数
+                this.certType = CertType.CT_111.getCode();
+                this.certNo = policyHolderInfo.getIdentifyNumber();
+                this.customerType = CustomerType.CT_2.getCode();
+                // 省市县
+                this.provCode = policyHolderArea.getProvinceCode();
+                this.provName = policyHolderArea.getProvinceName();
+                this.cityCode = policyHolderArea.getCityCode();
+                this.cityName = policyHolderArea.getCityName();
+                this.distCode = policyHolderArea.getCountyCode();
+                this.distName = policyHolderArea.getCountyName();
+                this.birthday = IDCardUtils.GetBirthday(policyHolderInfo.getIdentifyNumber());
+            }else {
+                // 通用参数
+                this.certType = CertType.CT_10.getCode();
+                this.certNo = policyHolderInfo.getOrganizationCode();
+                this.customerType = CustomerType.CT_5.getCode();
+                // 省市县
+                this.provCode = policyHolderInfo.getProvince();
+                this.provName = policyHolderInfo.getProvinceName();
+                this.cityCode = policyHolderInfo.getCity();
+                this.cityName = policyHolderInfo.getCityName();
+                this.distCode = policyHolderInfo.getCounty();
+                this.distName = policyHolderInfo.getCountyName();
+            }
             this.holderName = policyHolderInfo.getName();
-            this.certNo = policyHolderInfo.getIdentifyNumber();
             this.address = policyHolderInfo.getAddr();
             this.phoneNumber = policyHolderInfo.getMobile();
-            this.customerType = CustomerType.CT_2.getCode();
             this.email = policyHolderInfo.getEmail();
             this.certiType = policyHolderInfo.getIdentifyValidEndDate().contains("9999") ? "1" : "0";
 
@@ -457,16 +498,8 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
             this.bizFormatType = FormatType.FT_1.getCode();
             this.forceFormatType = FormatType.FT_1.getCode();
 
-            // 省市县
-            this.provCode = policyHolderArea.getProvinceCode();
-            this.provName = policyHolderArea.getProvinceName();
-            this.cityCode = policyHolderArea.getCityCode();
-            this.cityName = policyHolderArea.getCityName();
-            this.distCode = policyHolderArea.getCountyCode();
-            this.distName = policyHolderArea.getCountyName();
-
             this.residentialAddress = policyHolderInfo.getAddr();
-            this.birthday = IDCardUtils.GetBirthday(policyHolderInfo.getIdentifyNumber());
+
         }
     }
 
@@ -549,25 +582,40 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
         private String birthday;
 
         public InsurederDTO(CustomerInfoVo insuredPersonInfo, PersonAreaVo insuredPersonArea) {
-            // 通用参数
-            this.certType = CertType.CT_111.getCode();
+
+            if(StringUtils.isBlank(insuredPersonInfo.getProperty()) || !"0".equals(insuredPersonInfo.getProperty())) {
+                // 通用参数
+                this.certType = CertType.CT_111.getCode();
+                this.certNo = insuredPersonInfo.getIdentifyNumber();
+                this.customerType = CustomerType.CT_2.getCode();
+                // 省市县
+                this.provCode = insuredPersonArea.getProvinceCode();
+                this.provName = insuredPersonArea.getProvinceName();
+                this.cityCode = insuredPersonArea.getCityCode();
+                this.cityName = insuredPersonArea.getCityName();
+                this.distCode = insuredPersonArea.getCountyCode();
+                this.distName = insuredPersonArea.getCountyName();
+                this.birthday = IDCardUtils.GetBirthday(insuredPersonInfo.getIdentifyNumber());
+            }else {
+                // 通用参数
+                this.certType = CertType.CT_10.getCode();
+                this.certNo = insuredPersonInfo.getOrganizationCode();
+                this.customerType = CustomerType.CT_5.getCode();
+                // 省市县
+                this.provCode = insuredPersonInfo.getProvince();
+                this.provName = insuredPersonInfo.getProvinceName();
+                this.cityCode = insuredPersonInfo.getCity();
+                this.cityName = insuredPersonInfo.getCityName();
+                this.distCode = insuredPersonInfo.getCounty();
+                this.distName = insuredPersonInfo.getCountyName();
+            }
             this.insuredName = insuredPersonInfo.getName();
-            this.certNo = insuredPersonInfo.getIdentifyNumber();
             this.address = insuredPersonInfo.getAddr();
             this.phoneNumber = insuredPersonInfo.getMobile();
-            this.customerType = CustomerType.CT_2.getCode();
+
             this.email = insuredPersonInfo.getEmail();
             this.certiType = insuredPersonInfo.getIdentifyValidEndDate().contains("9999") ? "1" : "0";
             this.residentialAddress = insuredPersonInfo.getAddr();
-            // 省市县
-            this.provCode = insuredPersonArea.getProvinceCode();
-            this.provName = insuredPersonArea.getProvinceName();
-            this.cityCode = insuredPersonArea.getCityCode();
-            this.cityName = insuredPersonArea.getCityName();
-            this.distCode = insuredPersonArea.getCountyCode();
-            this.distName = insuredPersonArea.getCountyName();
-            this.birthday = IDCardUtils.GetBirthday(insuredPersonInfo.getIdentifyNumber());
-
         }
 
     }

+ 134 - 76
src/main/java/com/ydtech/modules/order/entity/api/dajia/request/ODR1008Request.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.constants.enums.dict.insurance.VehicleType;
 import com.ydtech.modules.admin.model.vo.PersonAreaVo;
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.order.entity.api.dajia.DaJiaBaseRequest;
 import com.ydtech.modules.order.entity.api.dajia.DaJiaConfigureParameters;
@@ -11,6 +12,7 @@ import com.ydtech.modules.order.entity.api.dajia.constants.*;
 import com.ydtech.modules.order.entity.api.dajia.response.ODR2009Response;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.CoreModelsVo;
+import com.ydtech.utils.StringUtils;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -143,6 +145,9 @@ public class ODR1008Request extends DaJiaBaseRequest {
             private Integer applicantWorkDpt;
             @JsonProperty("applicantZipCde")
             private String applicantZipCde;
+            @JsonProperty("applicantTel")
+            private String applicantTel;
+
         }
 
         @NoArgsConstructor
@@ -269,6 +274,8 @@ public class ODR1008Request extends DaJiaBaseRequest {
             private Integer insuredWorkDpt;
             @JsonProperty("insuredZipCde")
             private String insuredZipCde;
+            @JsonProperty("insuredTel")
+            private String insuredTel;
         }
 
         @NoArgsConstructor
@@ -462,39 +469,54 @@ public class ODR1008Request extends DaJiaBaseRequest {
     //设置车主信息
     public void setVehicleOwnerInfo(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo OwnerPersonArea) {
         BodyDTO.VehicleOwnerInfoDTO vehicleOwnerInfoDTO = new BodyDTO.VehicleOwnerInfoDTO();
-        //设置证件号码
-        vehicleOwnerInfoDTO.setVehicleOwnerCCertfCde(quoteInfoVo.getOwnerInfo().getIdentifyNumber());
-        //设置证件类型
-        vehicleOwnerInfoDTO.setVehicleOwnerCCertfCls("01");
-
+        CustomerInfoVo ownerInfo = quoteInfoVo.getOwnerInfo();
+        if(StringUtils.isBlank(ownerInfo.getProperty()) || !"0".equals(ownerInfo.getProperty())) {
+            //设置证件号码
+            vehicleOwnerInfoDTO.setVehicleOwnerCCertfCde(ownerInfo.getIdentifyNumber());
+            //设置证件类型
+            vehicleOwnerInfoDTO.setVehicleOwnerCCertfCls("01");
+            //车主类型
+            vehicleOwnerInfoDTO.setVehicleOwnerCOwnerCls(COwnerCls.CLS1.getCode());
+            //车主性别
+            vehicleOwnerInfoDTO.setVehicleOwnerCSex(getSexFromIdCardNumber(quoteInfoVo.getOwnerInfo().getIdentifyNumber()));
+            //身份证号获取出生日期
+            vehicleOwnerInfoDTO.setVehicleOwnerTBirthday(getBirthdateFromIDCardNumber(quoteInfoVo.getOwnerInfo().getIdentifyNumber()));
+            vehicleOwnerInfoDTO.setVehicleOwnerProvince(OwnerPersonArea.getProvinceCode());
+            vehicleOwnerInfoDTO.setVehicleOwnerCity(OwnerPersonArea.getCityCode());
+            vehicleOwnerInfoDTO.setVehicleOwnerCounty(OwnerPersonArea.getCountyCode());
+        }else{
+            //设置证件号码
+            vehicleOwnerInfoDTO.setVehicleOwnerCCertfCde(ownerInfo.getOrganizationCode());
+            //设置证件类型
+            vehicleOwnerInfoDTO.setVehicleOwnerCCertfCls("04");
+            //车主类型
+            vehicleOwnerInfoDTO.setVehicleOwnerCOwnerCls(COwnerCls.CLS3.getCode());
+
+            vehicleOwnerInfoDTO.setVehicleOwnerProvince(ownerInfo.getProvince());
+            vehicleOwnerInfoDTO.setVehicleOwnerCity(ownerInfo.getCity());
+            vehicleOwnerInfoDTO.setVehicleOwnerCounty(ownerInfo.getCounty());
+        }
         //新能源测试使用
 //        vehicleOwnerInfoDTO.setVehicleOwnerCCertfCde("E88888888");
 //        vehicleOwnerInfoDTO.setVehicleOwnerCCertfCls("02");
-
         //通讯地址
-        vehicleOwnerInfoDTO.setVehicleOwnerCClntAddr(quoteInfoVo.getOwnerInfo().getAddr());
+        vehicleOwnerInfoDTO.setVehicleOwnerCClntAddr(ownerInfo.getAddr());
         //手机号
-        vehicleOwnerInfoDTO.setVehicleOwnerCContactTel(quoteInfoVo.getOwnerInfo().getMobile());
+        vehicleOwnerInfoDTO.setVehicleOwnerCContactTel(ownerInfo.getMobile());
         //邮箱号
-        vehicleOwnerInfoDTO.setVehicleOwnerCEmail(quoteInfoVo.getOwnerInfo().getEmail());
+        vehicleOwnerInfoDTO.setVehicleOwnerCEmail(ownerInfo.getEmail());
         //手机号
-        vehicleOwnerInfoDTO.setVehicleOwnerCMobile(quoteInfoVo.getOwnerInfo().getMobile());
+        vehicleOwnerInfoDTO.setVehicleOwnerCMobile(ownerInfo.getMobile());
         //车主姓名
-        vehicleOwnerInfoDTO.setVehicleOwnerCOwnerNme(quoteInfoVo.getOwnerInfo().getName());
-        //车主类型
-        vehicleOwnerInfoDTO.setVehicleOwnerCOwnerCls(COwnerCls.CLS1.getCode());
+        vehicleOwnerInfoDTO.setVehicleOwnerCOwnerNme(ownerInfo.getName());
+
         //邮编
         vehicleOwnerInfoDTO.setVehicleOwnerCZipCde("030024");
-        //车主出生日期
-        vehicleOwnerInfoDTO.setVehicleOwnerTBirthday(getBirthdateFromIDCardNumber(quoteInfoVo.getOwnerInfo().getIdentifyNumber()));
-        //车主性别
-        vehicleOwnerInfoDTO.setVehicleOwnerCSex(getSexFromIdCardNumber(quoteInfoVo.getOwnerInfo().getIdentifyNumber()));
-        //身份证号获取出生日期
-        vehicleOwnerInfoDTO.setVehicleOwnerTBirthday(getBirthdateFromIDCardNumber(quoteInfoVo.getOwnerInfo().getIdentifyNumber()));
+
 //        //证件有效日期
 //        vehicleOwnerInfoDTO.setVehicleOwnerTEffectiveDate(quoteInfoVo.getOwnerInfo().getIdentifyValidDate());
         //证件失效日期
-        vehicleOwnerInfoDTO.setVehicleOwnerTExpiredDate(quoteInfoVo.getOwnerInfo().getIdentifyValidEndDate());
+        vehicleOwnerInfoDTO.setVehicleOwnerTExpiredDate(ownerInfo.getIdentifyValidEndDate());
         //国家
         vehicleOwnerInfoDTO.setVehicleOwnerCNation(1);
         //国籍
@@ -502,18 +524,16 @@ public class ODR1008Request extends DaJiaBaseRequest {
         //单位性质 默认为9 其他
         vehicleOwnerInfoDTO.setVehicleOwnerCWorkdptKind(9);
 
-        vehicleOwnerInfoDTO.setVehicleOwnerProvince(OwnerPersonArea.getProvinceCode());
-        vehicleOwnerInfoDTO.setVehicleOwnerCity(OwnerPersonArea.getCityCode());
-        vehicleOwnerInfoDTO.setVehicleOwnerCounty(OwnerPersonArea.getCountyCode());
+
         int index = -1;
         if (OwnerPersonArea.getCountyName() != null) {
-            index = quoteInfoVo.getOwnerInfo().getAddr().indexOf(OwnerPersonArea.getCountyName());
+            index = ownerInfo.getAddr().indexOf(OwnerPersonArea.getCountyName());
         }
 
         if (index > -1) {
-            vehicleOwnerInfoDTO.setVehicleOwnerSuffixAddr(quoteInfoVo.getOwnerInfo().getAddr().substring(index + OwnerPersonArea.getCountyName().length()));
+            vehicleOwnerInfoDTO.setVehicleOwnerSuffixAddr(ownerInfo.getAddr().substring(index + OwnerPersonArea.getCountyName().length()));
         } else {
-            vehicleOwnerInfoDTO.setVehicleOwnerSuffixAddr(quoteInfoVo.getOwnerInfo().getAddr());
+            vehicleOwnerInfoDTO.setVehicleOwnerSuffixAddr(ownerInfo.getAddr());
         }
         this.body.setVehicleOwnerInfo(vehicleOwnerInfoDTO);
     }
@@ -521,49 +541,69 @@ public class ODR1008Request extends DaJiaBaseRequest {
     //设置投保人信息
     public void setApplicantInfo(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo policyHolderPersonArea) {
         BodyDTO.ApplicantInfoDTO applicantInfoDTO = new BodyDTO.ApplicantInfoDTO();
-        //设置证件号码
-        applicantInfoDTO.setApplicantCCertfCde(quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber());
-        //设置证件类型
-        applicantInfoDTO.setApplicantCCertfCls("01");
+
+        CustomerInfoVo policyHolderInfo = quoteInfoVo.getPolicyHolderInfo();
+        if(StringUtils.isBlank(policyHolderInfo.getProperty()) || !"0".equals(policyHolderInfo.getProperty())) {
+            //设置证件号码
+            applicantInfoDTO.setApplicantCCertfCde(policyHolderInfo.getIdentifyNumber());
+            //设置证件类型
+            applicantInfoDTO.setApplicantCCertfCls("01");
+            //客户类型
+            applicantInfoDTO.setApplicantClntMrk(COwnerCls.CLS1.getCode());
+            //投保人出生日期
+            applicantInfoDTO.setApplicantTBirthday(getBirthdateFromIDCardNumber(policyHolderInfo.getIdentifyNumber()));
+            //投保人性别
+            applicantInfoDTO.setApplicantSex(getSexFromIdCardNumber(policyHolderInfo.getIdentifyNumber()));
+            //省市县
+            applicantInfoDTO.setApplicantProvince(policyHolderPersonArea.getProvinceCode());
+            applicantInfoDTO.setApplicantCity(policyHolderPersonArea.getCityCode());
+            applicantInfoDTO.setApplicantCounty(policyHolderPersonArea.getCountyCode());
+        }else{
+            //设置证件号码
+            applicantInfoDTO.setApplicantCCertfCde(policyHolderInfo.getOrganizationCode());
+            //设置证件类型
+            applicantInfoDTO.setApplicantCCertfCls("04");
+            //客户类型
+            applicantInfoDTO.setApplicantClntMrk(COwnerCls.CLS3.getCode());
+            //省市县
+            applicantInfoDTO.setApplicantProvince(policyHolderInfo.getProvince());
+            applicantInfoDTO.setApplicantCity(policyHolderInfo.getCity());
+            applicantInfoDTO.setApplicantCounty(policyHolderInfo.getCounty());
+            applicantInfoDTO.setApplicantTel(policyHolderInfo.getTel());
+        }
+
         //新能源测试使用
 //        applicantInfoDTO.setApplicantCCertfCde("E88888888");
 //        applicantInfoDTO.setApplicantCCertfCls("02");
-        //客户类型
-        applicantInfoDTO.setApplicantClntMrk(1);
+
         //通讯地址
-        applicantInfoDTO.setApplicantClntAddr(quoteInfoVo.getPolicyHolderInfo().getAddr());
+        applicantInfoDTO.setApplicantClntAddr(policyHolderInfo.getAddr());
         //手机号
-        applicantInfoDTO.setApplicantMobile(quoteInfoVo.getPolicyHolderInfo().getMobile());
+        applicantInfoDTO.setApplicantMobile(policyHolderInfo.getMobile());
         //邮箱号
-        applicantInfoDTO.setApplicantEmail(quoteInfoVo.getPolicyHolderInfo().getEmail());
+        applicantInfoDTO.setApplicantEmail(policyHolderInfo.getEmail());
         //投保人姓名
-        applicantInfoDTO.setApplicantNme(quoteInfoVo.getPolicyHolderInfo().getName());
-        //投保人出生日期
-        applicantInfoDTO.setApplicantTBirthday(getBirthdateFromIDCardNumber(quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber()));
+        applicantInfoDTO.setApplicantNme(policyHolderInfo.getName());
+
         //邮编
 //        vehicleOwnerInfoDTO.setVehicleOwnerCZipCde(quoteInfoVo.getOwnerInfo().get)
-        //投保人性别
-        applicantInfoDTO.setApplicantSex(getSexFromIdCardNumber(quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber()));
         //证件生效日期
-        applicantInfoDTO.setApplicantTEffectiveDate(quoteInfoVo.getPolicyHolderInfo().getIdentifyValidDate());
+        applicantInfoDTO.setApplicantTEffectiveDate(policyHolderInfo.getIdentifyValidDate());
         //证件失效日期
-        applicantInfoDTO.setApplicantTExpiredDate(quoteInfoVo.getOwnerInfo().getIdentifyValidEndDate());
+        applicantInfoDTO.setApplicantTExpiredDate(policyHolderInfo.getIdentifyValidEndDate());
         //证件上地址
-        applicantInfoDTO.setApplicantHomeAddr(quoteInfoVo.getPolicyHolderInfo().getAddr());
+        applicantInfoDTO.setApplicantHomeAddr(policyHolderInfo.getAddr());
         //国籍
 //        applicantInfoDTO.set(1);
-        //省市县
-        applicantInfoDTO.setApplicantProvince(policyHolderPersonArea.getProvinceCode());
-        applicantInfoDTO.setApplicantCity(policyHolderPersonArea.getCityCode());
-        applicantInfoDTO.setApplicantCounty(policyHolderPersonArea.getCountyCode());
+
         int index = -1;
         if (policyHolderPersonArea.getCountyName() != null) {
-            index = quoteInfoVo.getOwnerInfo().getAddr().indexOf(policyHolderPersonArea.getCountyName());
+            index = policyHolderInfo.getAddr().indexOf(policyHolderPersonArea.getCountyName());
         }
         if (index > -1) {
-            applicantInfoDTO.setApplicantSuffixAddr(quoteInfoVo.getOwnerInfo().getAddr().substring(index + policyHolderPersonArea.getCountyName().length()));
+            applicantInfoDTO.setApplicantSuffixAddr(policyHolderInfo.getAddr().substring(index + policyHolderPersonArea.getCountyName().length()));
         } else {
-            applicantInfoDTO.setApplicantSuffixAddr(quoteInfoVo.getOwnerInfo().getAddr());
+            applicantInfoDTO.setApplicantSuffixAddr(policyHolderInfo.getAddr());
         }
 //        applicantInfoDTO.setApplicantZipCde("030024");
         this.body.setApplicantInfo(applicantInfoDTO);
@@ -572,48 +612,66 @@ public class ODR1008Request extends DaJiaBaseRequest {
     //设置被保人信息
     public void setInsuredInfo(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo insuredPersonArea) {
         BodyDTO.InsuredInfoDTO insuredInfoDTO = new BodyDTO.InsuredInfoDTO();
-        //设置证件号码
-        insuredInfoDTO.setInsuredCertfCde(quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber());
-        //设置证件类型
-        insuredInfoDTO.setInsuredCertfCls("01");
+        CustomerInfoVo insuredPersonInfo = quoteInfoVo.getInsuredPersonInfo();
+        if(StringUtils.isBlank(insuredPersonInfo.getProperty()) || !"0".equals(insuredPersonInfo.getProperty())) {
+            //设置证件号码
+            insuredInfoDTO.setInsuredCertfCde(insuredPersonInfo.getIdentifyNumber());
+            //设置证件类型
+            insuredInfoDTO.setInsuredCertfCls("01");
+            //客户类型
+            insuredInfoDTO.setInsuredClntMrk(COwnerCls.CLS1.getCode());
+            //被保人出生日期
+            insuredInfoDTO.setInsuredTBirthday(getBirthdateFromIDCardNumber(insuredPersonInfo.getIdentifyNumber()));
+            //被保人性别
+            insuredInfoDTO.setInsuredSex(getSexFromIdCardNumber(insuredPersonInfo.getIdentifyNumber()));
+            //省市县
+            insuredInfoDTO.setInsuredProvince(insuredPersonArea.getProvinceCode());
+            insuredInfoDTO.setInsuredCity(insuredPersonArea.getCityCode());
+            insuredInfoDTO.setInsuredCounty(insuredPersonArea.getCountyCode());
+        }else{
+            //设置证件号码
+            insuredInfoDTO.setInsuredCertfCde(insuredPersonInfo.getOrganizationCode());
+            //设置证件类型
+            insuredInfoDTO.setInsuredCertfCls("04");
+            //客户类型
+            insuredInfoDTO.setInsuredClntMrk(COwnerCls.CLS3.getCode());
+            //省市县
+            insuredInfoDTO.setInsuredProvince(insuredPersonInfo.getProvince());
+            insuredInfoDTO.setInsuredCity(insuredPersonInfo.getCity());
+            insuredInfoDTO.setInsuredCounty(insuredPersonInfo.getCounty());
+            insuredInfoDTO.setInsuredTel(insuredPersonInfo.getTel());
+        }
+
         //新能源测试使用
 //        insuredInfoDTO.setInsuredCertfCde("E88888888");
 //        insuredInfoDTO.setInsuredCertfCls("02");
-        //客户类型
-        insuredInfoDTO.setInsuredClntMrk(1);
+
         //通讯地址
-        insuredInfoDTO.setInsuredClntAddr(quoteInfoVo.getInsuredPersonInfo().getAddr());
+        insuredInfoDTO.setInsuredClntAddr(insuredPersonInfo.getAddr());
         //证件上地址
-        insuredInfoDTO.setInsuredHomeAddr(quoteInfoVo.getInsuredPersonInfo().getAddr());
+        insuredInfoDTO.setInsuredHomeAddr(insuredPersonInfo.getAddr());
         //居住地址
-        insuredInfoDTO.setInsuredResidAddr(quoteInfoVo.getInsuredPersonInfo().getAddr());
+        insuredInfoDTO.setInsuredResidAddr(insuredPersonInfo.getAddr());
         //手机号
-        insuredInfoDTO.setInsuredMobile(quoteInfoVo.getInsuredPersonInfo().getMobile());
+        insuredInfoDTO.setInsuredMobile(insuredPersonInfo.getMobile());
         //邮箱号
-        insuredInfoDTO.setInsuredEmail(quoteInfoVo.getInsuredPersonInfo().getEmail());
+        insuredInfoDTO.setInsuredEmail(insuredPersonInfo.getEmail());
         //被保人姓名
-        insuredInfoDTO.setInsuredNme(quoteInfoVo.getInsuredPersonInfo().getName());
-        //被保人出生日期
-        insuredInfoDTO.setInsuredTBirthday(getBirthdateFromIDCardNumber(quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber()));
-        //被保人性别
-        insuredInfoDTO.setInsuredSex(getSexFromIdCardNumber(quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber()));
+        insuredInfoDTO.setInsuredNme(insuredPersonInfo.getName());
         //身份证生效日期
-        insuredInfoDTO.setInsuredTEffectiveDate(quoteInfoVo.getInsuredPersonInfo().getIdentifyValidDate());
+        insuredInfoDTO.setInsuredTEffectiveDate(insuredPersonInfo.getIdentifyValidDate());
         //身份证失效日期
-        insuredInfoDTO.setInsuredTExpiredDate(quoteInfoVo.getInsuredPersonInfo().getIdentifyValidEndDate());
-        //省市县
-        insuredInfoDTO.setInsuredProvince(insuredPersonArea.getProvinceCode());
-        insuredInfoDTO.setInsuredCity(insuredPersonArea.getCityCode());
-        insuredInfoDTO.setInsuredCounty(insuredPersonArea.getCountyCode());
-        insuredInfoDTO.setInsuredSuffixAddr(quoteInfoVo.getInsuredPersonInfo().getAddr());
+        insuredInfoDTO.setInsuredTExpiredDate(insuredPersonInfo.getIdentifyValidEndDate());
+
+        insuredInfoDTO.setInsuredSuffixAddr(insuredPersonInfo.getAddr());
         int index = -1;
         if (insuredPersonArea.getCountyName() != null) {
-            index = quoteInfoVo.getOwnerInfo().getAddr().indexOf(insuredPersonArea.getCountyName());
+            index = insuredPersonInfo.getAddr().indexOf(insuredPersonArea.getCountyName());
         }
         if (index > -1) {
-            insuredInfoDTO.setInsuredSuffixAddr(quoteInfoVo.getOwnerInfo().getAddr().substring(index + insuredPersonArea.getCountyName().length()));
+            insuredInfoDTO.setInsuredSuffixAddr(insuredPersonInfo.getAddr().substring(index + insuredPersonArea.getCountyName().length()));
         } else {
-            insuredInfoDTO.setInsuredSuffixAddr(quoteInfoVo.getOwnerInfo().getAddr());
+            insuredInfoDTO.setInsuredSuffixAddr(insuredPersonInfo.getAddr());
         }
         //邮编
 //        insuredInfoDTO.setInsuredZipCde("030024");

+ 26 - 9
src/main/java/com/ydtech/modules/order/entity/api/dajia/request/ODR1010Request.java

@@ -1,11 +1,13 @@
 package com.ydtech.modules.order.entity.api.dajia.request;
 
+import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.api.dajia.DaJiaBaseRequest;
 import com.ydtech.modules.order.entity.api.dajia.DaJiaConfigureParameters;
 import com.ydtech.modules.order.entity.api.dajia.constants.ServiceCode;
 import com.ydtech.modules.order.entity.api.dajia.response.ODR1009Response;
+import com.ydtech.utils.StringUtils;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -189,7 +191,7 @@ public class ODR1010Request extends DaJiaBaseRequest {
         //操作员姓名
         body.businessInfo.setBusiOprNme(daJiaConfigureParameters.getOperatorName());
         //业务来源
-        body.businessInfo.setBusiBsnsTyp(19002);
+        body.businessInfo.setBusiBsnsTyp(Integer.parseInt(daJiaConfigureParameters.getBusinessSource()));
         //业务员代码
         body.businessInfo.setBusiSlsCde(daJiaConfigureParameters.getSalespersonCode());
         //推荐人代码
@@ -232,18 +234,33 @@ public class ODR1010Request extends DaJiaBaseRequest {
 
         //车架号
         body.checkInfo.setVehicleFrmNo(insOrders.getFrameno());
+        JSONObject applyInfo = insOrders.getApplyinfo();
+        JSONObject insureInfo = insOrders.getInsureinfo();
+        String applyProperty = applyInfo.getString("property");
+        String insureProperty = insureInfo.getString("property");
         //投保人名称
-        body.checkInfo.setApplicantNme(insOrders.getApplyinfo().getString("name"));
-        //投保人证件号码
-        body.checkInfo.setApplicantCCertfCde(insOrders.getApplyinfo().getString("identifyNumber"));
+        body.checkInfo.setApplicantNme(applyInfo.getString("name"));
+        if(StringUtils.isBlank(applyProperty) || !"0".equals(applyProperty)){
+            //投保人证件号码
+            body.checkInfo.setApplicantCCertfCde(applyInfo.getString("identifyNumber"));
+        }else{
+            //投保人证件号码
+            body.checkInfo.setApplicantCCertfCde(applyInfo.getString("organizationCode"));
+        }
         //投保人手机号
-        body.checkInfo.setApplicantMobile(insOrders.getApplyinfo().getString("mobile"));
+        body.checkInfo.setApplicantMobile(applyInfo.getString("mobile"));
+
         //被保人名称
-        body.checkInfo.setInsuredNme(insOrders.getInsureinfo().getString("name"));
-        //被保人证件号码
-        body.checkInfo.setInsuredCertfCde(insOrders.getInsureinfo().getString("identifyNumber"));
+        body.checkInfo.setInsuredNme(insureInfo.getString("name"));
+        if(StringUtils.isBlank(insureProperty) || !"0".equals(insureProperty)){
+            //被保人证件号码
+            body.checkInfo.setInsuredCertfCde(insureInfo.getString("identifyNumber"));
+        }else{
+            //被保人证件号码
+            body.checkInfo.setInsuredCertfCde(insureInfo.getString("organizationCode"));
+        }
         //被保人手机号
-        body.checkInfo.setInsuredMobile(insOrders.getInsureinfo().getString("mobile"));
+        body.checkInfo.setInsuredMobile(insureInfo.getString("mobile"));
 
     }
 

+ 5 - 1
src/main/java/com/ydtech/modules/order/entity/api/huatai/constants/ImageTypeCode.java

@@ -39,7 +39,11 @@ public enum ImageTypeCode {
             InsuranceImageEnum.C02.getCode(),
             InsuranceImageEnum.D02.getCode(),
     }),
-    I_1001("1001", "组织机构代码证", new String[]{}),
+    I_1001("1001", "组织机构代码证", new String[]{
+            InsuranceImageEnum.Y02.getCode(),
+            InsuranceImageEnum.Y03.getCode(),
+            InsuranceImageEnum.Y04.getCode(),
+    }),
     I_1999("1999", "其他", new String[]{}),
     I_3001("3001", "行驶证", new String[]{
             InsuranceImageEnum.C01.getCode(),

+ 41 - 13
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiQuotedPriceRequest.java

@@ -352,7 +352,17 @@ public class HuaTaiQuotedPriceRequest extends HuaTaiBaseRequest {
                     this.motorTypeCode = motorTypeCode1.getCode();
 
                     this.plateType = "02";
-                    this.property = "04";
+                    switch (carInfoVo.getProperty()) {
+                        case "1":  //个人
+                            this.property = "04";
+                            break;
+                        case "2":  // 一般企业
+                            this.property = "03";
+                            break;
+                        case "3":  //机关
+                            this.property = "01";
+                            break;
+                    }
                     this.colorCode = null;
                     this.carCheckStatus = "2";
                     this.vehicleCondition = "0";
@@ -774,19 +784,37 @@ public class HuaTaiQuotedPriceRequest extends HuaTaiBaseRequest {
         private String carInsuredRelation;
 
         public CustomerDto(CustomerInfoVo customerInfoVo, String role) {
-            this.name = customerInfoVo.getName();
-            this.identifyType = "01";
-            this.identifyNumber = customerInfoVo.getIdentifyNumber();
-            this.mobile = customerInfoVo.getMobile();
-            this.type = "1";
-            this.role = role;
-            int randomNum = new Random().nextInt(HuaTaiBaseCode.getOccupation().size());
-            this.occupationCode = HuaTaiBaseCode.getOccupation().get(randomNum);//后续需要根据接口维护返参到表里
-            this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
-            this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
-            if ("2".equals(role)) {
-                this.carInsuredRelation = "1";
+            if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("1")) {
+                this.name = customerInfoVo.getName();
+                this.identifyType = "01";
+                this.identifyNumber = customerInfoVo.getIdentifyNumber();
+                this.mobile = customerInfoVo.getMobile();
+                this.type = "1";
+                this.role = role;
+                int randomNum = new Random().nextInt(HuaTaiBaseCode.getOccupation().size());
+                this.occupationCode = HuaTaiBaseCode.getOccupation().get(randomNum);//后续需要根据接口维护返参到表里
+                this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
+                this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
+                if ("2".equals(role)) {
+                    this.carInsuredRelation = "1";
+                }
+            } else if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("0")){
+                this.name = customerInfoVo.getName();
+                this.identifyType = "99";
+                this.organizeCode = customerInfoVo.getOrganizationCode();
+                this.mobile = customerInfoVo.getMobile();
+                this.type = "2";
+                this.role = role;
+                int randomNum = new Random().nextInt(HuaTaiBaseCode.getOccupation().size());
+                this.occupationCode = HuaTaiBaseCode.getOccupation().get(randomNum);//后续需要根据接口维护返参到表里
+                this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
+                this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
+                this.transactorName = customerInfoVo.getLegalPerson();
+                if ("2".equals(role)) {
+                    this.carInsuredRelation = "1";
+                }
             }
+
         }
 
         public List<CustomerDto> getCustomers(CustomerInfoVo ownerInfo, CustomerInfoVo policyHolderInfo, CustomerInfoVo insuredPersonInfo) {

+ 33 - 70
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSaveFileIdxRequest.java

@@ -3,151 +3,116 @@ package com.ydtech.modules.order.entity.api.huatai.request;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.modules.order.components.huatai.HuiTaiUploadImageComponents;
 import com.ydtech.modules.order.entity.api.huatai.response.HuaTaiImageInitParamResponse;
+import com.ydtech.utils.SnowFlakeUtil;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
+@NoArgsConstructor
 @Data
 public class HuaTaiSaveFileIdxRequest {
 
     @JsonProperty("token")
     private String token;
-
     @JsonProperty("fileIdxVo")
     private FileIdxVoDTO fileIdxVo;
+    @JsonProperty("validFlag")
+    private Integer validFlag;
 
     public HuaTaiSaveFileIdxRequest(String token, HuaTaiImageInitParamResponse response, HuiTaiUploadImageComponents.FileuploadResult fileupload, String fileName,
-                                    HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO childrenDTO) {
+                                    HuaTaiImageInitParamResponse.TypeTreeNodeVoDTO.ChildrenDTO childrenDTO, String imgId) {
         this.token = token;
-        this.fileIdxVo = new FileIdxVoDTO(response, fileupload, fileName, childrenDTO);
+        this.fileIdxVo = new FileIdxVoDTO(response, fileupload, fileName, childrenDTO, imgId);
+        this.validFlag = 1;
     }
 
+    @NoArgsConstructor
     @Data
     public static class FileIdxVoDTO {
-
         @JsonProperty("rotate")
         private Integer rotate;
-
         @JsonProperty("rotateStart")
         private Integer rotateStart;
-
         @JsonProperty("optionFlag")
         private Integer optionFlag;
-
         @JsonProperty("imgId")
         private Long imgId;
-
         @JsonProperty("createTime")
         private Long createTime;
-
         @JsonProperty("createUser")
         private String createUser;
-
         @JsonProperty("createUserName")
         private String createUserName;
-
-        @JsonProperty("appSource")
-        private String appSource;
-
         @JsonProperty("docId")
-        private Integer docId;
-
+        private Long docId;
         @JsonProperty("bussNo")
         private String bussNo;
-
         @JsonProperty("bussType")
         private String bussType;
-
         @JsonProperty("bussTypeName")
         private String bussTypeName;
-
         @JsonProperty("riskCode")
         private String riskCode;
-
         @JsonProperty("riskCodeName")
         private String riskCodeName;
-
         @JsonProperty("comCode")
         private String comCode;
-
-        @JsonProperty("comName")
-        private String comName;
-
-        @JsonProperty("bussDate")
-        private String bussDate;
-
         @JsonProperty("validFlag")
         private Integer validFlag;
-
         @JsonProperty("uploadNode")
         private String uploadNode;
-
         @JsonProperty("appendPath")
         private String appendPath;
-
         @JsonProperty("editable")
         private Boolean editable;
-
         @JsonProperty("deletable")
         private Boolean deletable;
-
         @JsonProperty("voType")
         private String voType;
-
         @JsonProperty("archType")
         private String archType;
-
+        @JsonProperty("region")
+        private String region;
         @JsonProperty("picFileFlag")
         private Integer picFileFlag;
-
         @JsonProperty("fileSize")
         private Double fileSize;
-
         @JsonProperty("fileSizeFormat")
         private String fileSizeFormat;
-
         @JsonProperty("fileOrgName")
         private String fileOrgName;
-
         @JsonProperty("fileTitle")
         private String fileTitle;
-
         @JsonProperty("fileName")
         private String fileName;
-
+        @JsonProperty("saveType")
+        private String saveType;
+        @JsonProperty("fileHashCode")
+        private String fileHashCode;
         @JsonProperty("typePath")
         private String typePath;
-
         @JsonProperty("typePathName")
         private String typePathName;
-
         @JsonProperty("typeName")
         private String typeName;
-
+        @JsonProperty("dstKey")
+        private String dstKey;
         @JsonProperty("picMaxSize")
         private Integer picMaxSize;
-
         @JsonProperty("picQuality")
         private Integer picQuality;
-
         @JsonProperty("error")
         private Integer error;
-
-        @JsonProperty("checked")
-        private Boolean checked;
-
         @JsonProperty("uploadStatus")
         private Integer uploadStatus;
-
         @JsonProperty("showIdx")
         private Integer showIdx;
-
         @JsonProperty("uploadTime")
         private Integer uploadTime;
-
         @JsonProperty("storageType")
         private String storageType;
 
         public FileIdxVoDTO(HuaTaiImageInitParamResponse response, HuiTaiUploadImageComponents.FileuploadResult fileupload, String fileName,
-                            HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO childrenDTO) {
+                            HuaTaiImageInitParamResponse.TypeTreeNodeVoDTO.ChildrenDTO childrenDTO, String imgId) {
             this.rotate = 0;
             this.rotateStart = 0;
             this.optionFlag = 2;
@@ -156,47 +121,45 @@ public class HuaTaiSaveFileIdxRequest {
             // 初始化的时候获取参数
             this.createUser = response.getOptUserId();
             this.createUserName = response.getOptUserName();
-            this.appSource = response.getAppSource();
-            this.docId = response.getDocId();
-            this.bussNo = response.getBussNo();
-            this.bussType = response.getBussType();
-            this.bussTypeName = response.getBussTypeName();
-            this.riskCode = response.getRiskCode();
-            this.riskCodeName = response.getRiskCodeName();
+            this.docId = childrenDTO.getDocId();
+            this.bussNo = childrenDTO.getBussNo();
+            this.bussType = childrenDTO.getBussType();
+            this.bussTypeName = childrenDTO.getBussTypeName();
+            this.riskCode = childrenDTO.getRiskCode();
+            this.riskCodeName = childrenDTO.getRiskCodeName();
             this.comCode = response.getComCode();
-            this.comName = response.getComName();
-            this.bussDate = response.getBussDate();
             this.validFlag = 1;
             this.uploadNode = response.getUploadNode();
             this.appendPath = fileupload.getFilePath().substring(0,fileupload.getFilePath().lastIndexOf("/")+1);
             this.editable = true;
             this.deletable = true;
             this.voType = "C";
-            this.archType = response.getArchType();
+            this.archType = childrenDTO.getArchType();
 
             this.picFileFlag = 1;
             this.fileSize = fileupload.getFileSize();
             this.fileSizeFormat = String.format("%.2f", fileupload.getFileSize()) + "KB";
 
-            String uuidLower = HuiTaiUploadImageComponents.getUUIDLower();
+            String uuidLower = fileupload.getUuidImagesName();
             String substring = fileName.substring(fileName.lastIndexOf("."));
-
-            this.fileTitle = uuidLower;
+            this.fileTitle = fileupload.getUuidImagesName();
             this.fileOrgName = uuidLower + substring;
-
+            this.imgId = SnowFlakeUtil.getSnowFlakeId();
+            this.fileHashCode = fileupload.getMd5Hash();
             this.fileName = fileupload.getFilePath().substring(fileupload.getFilePath().lastIndexOf("/")+1);;
-
             this.typePath = childrenDTO.getTypePath();
             this.typePathName = childrenDTO.getTypePathName();
             this.typeName = childrenDTO.getLabel();
             this.picMaxSize = childrenDTO.getPicMaxSize();
             this.picQuality = childrenDTO.getPicQuality();
-
             this.error = 0;
             this.uploadStatus = 3;
             this.showIdx = 30;
             this.uploadTime = 154;
             this.storageType = response.getStorageType();
+            this.region = response.getRegion();
+            this.saveType = "U";
+            this.dstKey = "UW_CAR";
         }
 
     }

+ 88 - 4
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSubmitRequest.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.order.entity.api.huatai.request;
 
 import com.alibaba.fastjson.annotation.JSONField;
 import com.ydtech.constants.enums.InsuranceRisk;
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
@@ -18,10 +19,12 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
 
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -69,6 +72,10 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
         @JSONField(name = "saleInfo")
         private SaleInfoDto saleInfo;
 
+        //  投保车辆信息
+        @JSONField(name = "insuredObject")
+        private InsuredObjectDto insuredObject;
+
         public BusinessDataDto(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany,
                                HuaTaiConfigureParameters huaTaiConfigureParameters, List<InsHuataiContributingVo> engageList) {
             List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
@@ -85,7 +92,8 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
             this.customer = new CustomerDto().getCustomers(ownerInfo, policyHolderInfo, insuredPersonInfo, huaTaiConfigureParameters);
             //销售信息
             this.saleInfo = new SaleInfoDto(huaTaiConfigureParameters);
-
+            // 投保车辆信息
+            this.insuredObject = new InsuredObjectDto(yaQuoteInfoVo.getCarInfo());
         }
     }
 
@@ -192,6 +200,7 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
                 this.expiryDate = insAreaCompany.getSyEndDate();
             }
             this.riskCode = InsuranceTypeCorrespondence.getHuaTaiRisk().get(riskInfoVo.getRiskCode());
+            this.remark = "自核通过";
         }
     }
 
@@ -261,6 +270,9 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
         //Y	手机号码
         @JSONField(name = "mobile")
         private String mobile;
+        // CY 单位电话(机构客户出单必传)
+        @JSONField(name = "unitPhoneNumber")
+        private String unitPhoneNumber;
         //Y	证件有效起期(格式:YYYY-MM-DD HH24:MI:SS)
         @JSONField(name = "identifyValidDate")
         private String identifyValidDate;
@@ -402,12 +414,43 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
 
 
         public CustomerDto(CustomerInfoVo customerInfoVo, String role, HuaTaiConfigureParameters huaTaiConfigureParameters) {
-            this.identifyNumber = customerInfoVo.getIdentifyNumber();
-            this.identifyType = "01";
+            if (customerInfoVo.getProperty() != null && "0".equals(customerInfoVo.getProperty())) {
+                this.organizeCode = customerInfoVo.getOrganizationCode();
+                this.identifyType = "99";
+                this.type = "2";
+                this.businessSource = "L749";
+                this.equityStructure = "3";
+                this.businessDetail = customerInfoVo.getScope();
+                this.leaderName = customerInfoVo.getLegalPerson();
+                this.leaderOtherIdentifyType = "01";
+                this.leaderOtherEffectiveDate = customerInfoVo.getLeaderOtherEffectiveDate();
+                this.leaderOtherIdentifyNumber = customerInfoVo.getLeaderIdentifyNumber();
+                this.leaderIdentifyNumber = customerInfoVo.getLeaderIdentifyNumber();
+                this.nationalityCode = customerInfoVo.getProvince().substring(0, 4);
+                this.registCurrency = "CNY";
+                this.registFund = customerInfoVo.getRegisteredCapital();
+                this.revenueCode = customerInfoVo.getOrganizationCode();
+                this.supportDocuName = customerInfoVo.getName();
+                this.supportDocuNumber = customerInfoVo.getOrganizationCode();
+                this.supportDocuValidDate = customerInfoVo.getIdentifyValidEndDate();
+                this.transactorName = customerInfoVo.getLegalPerson();
+                this.transactorIdentifyType = "01";
+                this.transactorIdentifyCode = customerInfoVo.getLeaderIdentifyNumber();
+                this.transactorMobile = customerInfoVo.getMobile();
+                this.transactorExpiryDate = customerInfoVo.getLeaderOtherEffectiveDate();
+                this.unitPhoneNumber = customerInfoVo.getMobile();
+            }
+            if (customerInfoVo.getProperty() != null && "1".equals(customerInfoVo.getProperty())) {
+                this.identifyNumber = customerInfoVo.getIdentifyNumber();
+                this.identifyType = "01";
+                this.type = "1";
+            }
+            this.province = huaTaiConfigureParameters.getProvince();
+            this.city = huaTaiConfigureParameters.getCity();
+            this.district = huaTaiConfigureParameters.getDistrict();
             this.name = customerInfoVo.getName();
             this.mobile = customerInfoVo.getMobile();
             this.role = role;
-            this.type = "1";
             this.occupationCode = "20114";//后续需要根据接口维护返参到表里
             this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
             this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
@@ -438,6 +481,47 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest {
 
     }
 
+    @NoArgsConstructor
+    @Data
+    public static class InsuredObjectDto implements Serializable {
+        @JSONField(name = "policyCar")
+        private PolicyCarDto policyCar;
+
+        public InsuredObjectDto(CarInfoVo carInfoVo) {
+            this.policyCar = new PolicyCarDto(carInfoVo);
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class PolicyCarDto implements Serializable {
+
+            // Y 验车状态(1-未验车;2-免验车;4-已验车)
+            @JSONField(name = "CarCheckStatus")
+            private String carCheckStatus;
+
+            // CY  验车人(已验车必传)
+            @JSONField(name = "CarChecker")
+            private String carChecker;
+
+            // CY  验车时间(已验车必传)(格式:YYYY-MM-DD HH24:MI:SS)
+            @JSONField(name = "CarCheckTime")
+            private DateTime carCheckTime;
+
+            // CY 验车记录(已验车必传)
+            @JSONField(name = "CarCheckRecord")
+            private String carCheckRecord;
+
+            // N 车况(0-好;1-中;2-差)
+            @JSONField(name = "VehicleCondition")
+            private String vehicleCondition;
+
+            public PolicyCarDto(CarInfoVo carInfoVo) {
+                this.carCheckStatus = "2";
+                this.vehicleCondition = "0";
+            }
+        }
+    }
+
 
     @AllArgsConstructor
     @NoArgsConstructor

+ 85 - 194
src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiImageInitParamResponse.java

@@ -14,126 +14,95 @@ public class HuaTaiImageInitParamResponse {
 
     @JsonProperty("accessKeyVo")
     private AccessKeyVoDTO accessKeyVo;
-
+    @JsonProperty("addTagPower")
+    private Integer addTagPower;
     @JsonProperty("appSource")
     private String appSource;
-
-    @JsonProperty("archType")
-    private String archType;
-
-    @JsonProperty("arriveNotify")
-    private Integer arriveNotify;
-
-    @JsonProperty("bucket")
-    private String bucket;
-
-    @JsonProperty("bussDate")
-    private String bussDate;
-
-    @JsonProperty("bussNo")
-    private String bussNo;
-
-    @JsonProperty("bussType")
-    private String bussType;
-
-    @JsonProperty("bussTypeName")
-    private String bussTypeName;
-
     @JsonProperty("comCode")
     private String comCode;
-
-    @JsonProperty("comName")
-    private String comName;
-
-    @JsonProperty("docId")
-    private Integer docId;
-
     @JsonProperty("documentFile")
     private String documentFile;
-
-    @JsonProperty("dstKey")
-    private String dstKey;
-
-    @JsonProperty("extendInfo")
-    private Object extendInfo;
-
+    @JsonProperty("downloadPower")
+    private Integer downloadPower;
+    @JsonProperty("fileServerUrl")
+    private String fileServerUrl;
+    @JsonProperty("firstBussNo")
+    private String firstBussNo;
+    @JsonProperty("firstBussType")
+    private String firstBussType;
+    @JsonProperty("firstRiskCode")
+    private String firstRiskCode;
+    @JsonProperty("imgRoot")
+    private String imgRoot;
     @JsonProperty("imgVersion")
     private String imgVersion;
-
     @JsonProperty("initTime")
     private Long initTime;
-
+    @JsonProperty("itemCodeMap")
+    private ItemCodeMapDTO itemCodeMap;
     @JsonProperty("maxFileSize")
     private Integer maxFileSize;
-
     @JsonProperty("maxShowIdx")
     private Double maxShowIdx;
-
     @JsonProperty("maxUnUploadNum")
     private Integer maxUnUploadNum;
-
     @JsonProperty("mediaFile")
     private String mediaFile;
-
     @JsonProperty("netType")
     private String netType;
-
     @JsonProperty("optUserId")
     private String optUserId;
-
     @JsonProperty("optUserName")
     private String optUserName;
-
+    @JsonProperty("othMainVos")
+    private List<?> othMainVos;
     @JsonProperty("pictureFile")
     private String pictureFile;
-
-    @JsonProperty("riskCode")
-    private String riskCode;
-
-    @JsonProperty("riskCodeName")
-    private String riskCodeName;
-
+    @JsonProperty("region")
+    private String region;
     @JsonProperty("showDelete")
     private Integer showDelete;
-
-    @JsonProperty("showImgType")
-    private Object showImgType;
-
+    @JsonProperty("showImgTag")
+    private Integer showImgTag;
+    @JsonProperty("showSusTag")
+    private Integer showSusTag;
+    @JsonProperty("showUpload")
+    private Integer showUpload;
+    @JsonProperty("showUserImg")
+    private Integer showUserImg;
     @JsonProperty("storageType")
     private String storageType;
-
     @JsonProperty("supportFileTypes")
     private String supportFileTypes;
-
+    @JsonProperty("tagVos")
+    private List<?> tagVos;
     @JsonProperty("token")
     private String token;
-
-    @JsonProperty("typeSelectVos")
-    private List<TypeSelectVosDTO> typeSelectVos;
-
     @JsonProperty("typeTreeNodeVo")
     private TypeTreeNodeVoDTO typeTreeNodeVo;
-
     @JsonProperty("typeTreeNodeVos")
-    private Object typeTreeNodeVos;
-
+    private List<?> typeTreeNodeVos;
     @JsonProperty("uploadNode")
     private String uploadNode;
 
     @JsonProperty("uploadedFileList")
-    private List<String> uploadedFileList;
-
-    @JsonProperty("viewShowType")
-    private String viewShowType;
-
+    private List<?> uploadedFileList;
     @JsonProperty("viewType")
     private String viewType;
 
-    public List<TypeSelectVosDTO.ChildrenDTO> getChildrenDTO() {
-        return this.getTypeSelectVos().stream().map(TypeSelectVosDTO::getChildren).flatMap(List::stream).collect(Collectors.toList());
+    @JsonProperty("uploadNodeMap")
+    private UploadNodeMapDTO uploadNodeMapDTO;
+
+    public List<TypeTreeNodeVoDTO.ChildrenDTO> getChildrenDTO() {
+        return this.getTypeTreeNodeVo().getChildren()
+                .stream()
+                .map(TypeTreeNodeVoDTO.ChildrenDTO::getChildren)
+                .filter(children -> children != null && !children.isEmpty())
+                .flatMap(List::stream)
+                .collect(Collectors.toList());
     }
 
-    public static TypeSelectVosDTO.ChildrenDTO filteringTypeCode(List<TypeSelectVosDTO.ChildrenDTO> list, String typeCode){
+    public static TypeTreeNodeVoDTO.ChildrenDTO filteringTypeCode(List<TypeTreeNodeVoDTO.ChildrenDTO> list, String typeCode) {
         return list.stream().filter(x -> x.getTypeCode().equals(typeCode)).collect(Collectors.toList()).get(0);
     }
 
@@ -144,127 +113,22 @@ public class HuaTaiImageInitParamResponse {
         private String accessKeyId;
         @JsonProperty("accessKeySecret")
         private String accessKeySecret;
-        @JsonProperty("endpoint")
-        private Object endpoint;
-        @JsonProperty("ossRegion")
-        private String ossRegion;
-        @JsonProperty("token")
-        private String token;
     }
 
     @NoArgsConstructor
     @Data
-    public static class TypeTreeNodeVoDTO {
-        @JsonProperty("acceptDragDrop")
-        private Integer acceptDragDrop;
-        @JsonProperty("archType")
-        private String archType;
-        @JsonProperty("bussNo")
-        private String bussNo;
-        @JsonProperty("bussType")
-        private String bussType;
-        @JsonProperty("bussTypeName")
-        private String bussTypeName;
-        @JsonProperty("children")
-        private List<ChildrenDTO> children;
-        @JsonProperty("count")
-        private Integer count;
-        @JsonProperty("docId")
-        private Integer docId;
-        @JsonProperty("docMaxSize")
-        private Integer docMaxSize;
-        @JsonProperty("label")
-        private String label;
-        @JsonProperty("limitSumCount")
-        private Integer limitSumCount;
-        @JsonProperty("lockFlag")
-        private Integer lockFlag;
-        @JsonProperty("medMaxSize")
-        private Integer medMaxSize;
-        @JsonProperty("nodeType")
-        private String nodeType;
-        @JsonProperty("parentTypeCode")
-        private Object parentTypeCode;
-        @JsonProperty("picMaxSize")
-        private Integer picMaxSize;
-        @JsonProperty("picQuality")
-        private Integer picQuality;
-        @JsonProperty("readable")
-        private Integer readable;
-        @JsonProperty("riskCode")
-        private String riskCode;
-        @JsonProperty("riskCodeName")
-        private String riskCodeName;
-        @JsonProperty("typeCode")
-        private String typeCode;
-        @JsonProperty("typePath")
-        private Object typePath;
-        @JsonProperty("typePathName")
-        private Object typePathName;
-        @JsonProperty("writable")
-        private Integer writable;
-
-        @NoArgsConstructor
-        @Data
-        public static class ChildrenDTO {
-            @JsonProperty("acceptDragDrop")
-            private Integer acceptDragDrop;
-            @JsonProperty("archType")
-            private Object archType;
-            @JsonProperty("bussNo")
-            private Object bussNo;
-            @JsonProperty("bussType")
-            private Object bussType;
-            @JsonProperty("bussTypeName")
-            private Object bussTypeName;
-            @JsonProperty("children")
-            private Object children;
-            @JsonProperty("count")
-            private Integer count;
-            @JsonProperty("docId")
-            private Object docId;
-            @JsonProperty("docMaxSize")
-            private Integer docMaxSize;
-            @JsonProperty("label")
-            private String label;
-            @JsonProperty("limitSumCount")
-            private Integer limitSumCount;
-            @JsonProperty("lockFlag")
-            private Integer lockFlag;
-            @JsonProperty("medMaxSize")
-            private Integer medMaxSize;
-            @JsonProperty("nodeType")
-            private String nodeType;
-            @JsonProperty("parentTypeCode")
-            private String parentTypeCode;
-            @JsonProperty("picMaxSize")
-            private Integer picMaxSize;
-            @JsonProperty("picQuality")
-            private Integer picQuality;
-            @JsonProperty("readable")
-            private Integer readable;
-            @JsonProperty("riskCode")
-            private Object riskCode;
-            @JsonProperty("riskCodeName")
-            private Object riskCodeName;
-            @JsonProperty("typeCode")
-            private String typeCode;
-            @JsonProperty("typePath")
-            private Object typePath;
-            @JsonProperty("typePathName")
-            private Object typePathName;
-            @JsonProperty("writable")
-            private Integer writable;
-        }
+    public static class ItemCodeMapDTO {
     }
 
     @NoArgsConstructor
     @Data
-    public static class TypeSelectVosDTO {
+    public static class TypeTreeNodeVoDTO {
         @JsonProperty("acceptDragDrop")
         private Integer acceptDragDrop;
         @JsonProperty("archType")
         private String archType;
+        @JsonProperty("bucket")
+        private String bucket;
         @JsonProperty("bussNo")
         private String bussNo;
         @JsonProperty("bussType")
@@ -276,11 +140,17 @@ public class HuaTaiImageInitParamResponse {
         @JsonProperty("count")
         private Integer count;
         @JsonProperty("docId")
-        private Integer docId;
+        private Long docId;
         @JsonProperty("docMaxSize")
         private Integer docMaxSize;
+        @JsonProperty("dstKey")
+        private String dstKey;
         @JsonProperty("label")
         private String label;
+        @JsonProperty("labelEn")
+        private String labelEn;
+        @JsonProperty("limitMinCount")
+        private Integer limitMinCount;
         @JsonProperty("limitSumCount")
         private Integer limitSumCount;
         @JsonProperty("lockFlag")
@@ -289,24 +159,20 @@ public class HuaTaiImageInitParamResponse {
         private Integer medMaxSize;
         @JsonProperty("nodeType")
         private String nodeType;
-        @JsonProperty("parentTypeCode")
-        private String parentTypeCode;
         @JsonProperty("picMaxSize")
         private Integer picMaxSize;
         @JsonProperty("picQuality")
         private Integer picQuality;
         @JsonProperty("readable")
         private Integer readable;
+        @JsonProperty("renameByTypeName")
+        private String renameByTypeName;
         @JsonProperty("riskCode")
         private String riskCode;
         @JsonProperty("riskCodeName")
         private String riskCodeName;
         @JsonProperty("typeCode")
         private String typeCode;
-        @JsonProperty("typePath")
-        private String typePath;
-        @JsonProperty("typePathName")
-        private String typePathName;
         @JsonProperty("writable")
         private Integer writable;
 
@@ -317,22 +183,28 @@ public class HuaTaiImageInitParamResponse {
             private Integer acceptDragDrop;
             @JsonProperty("archType")
             private String archType;
+            @JsonProperty("bucket")
+            private String bucket;
             @JsonProperty("bussNo")
             private String bussNo;
             @JsonProperty("bussType")
             private String bussType;
             @JsonProperty("bussTypeName")
             private String bussTypeName;
-            @JsonProperty("children")
-            private Object children;
             @JsonProperty("count")
             private Integer count;
             @JsonProperty("docId")
-            private Integer docId;
+            private Long docId;
             @JsonProperty("docMaxSize")
             private Integer docMaxSize;
+            @JsonProperty("dstKey")
+            private String dstKey;
             @JsonProperty("label")
             private String label;
+            @JsonProperty("labelEn")
+            private String labelEn;
+            @JsonProperty("limitMinCount")
+            private Integer limitMinCount;
             @JsonProperty("limitSumCount")
             private Integer limitSumCount;
             @JsonProperty("lockFlag")
@@ -341,6 +213,8 @@ public class HuaTaiImageInitParamResponse {
             private Integer medMaxSize;
             @JsonProperty("nodeType")
             private String nodeType;
+            @JsonProperty("parenTypeVo")
+            private ParenTypeVoDTO parenTypeVo;
             @JsonProperty("parentTypeCode")
             private String parentTypeCode;
             @JsonProperty("picMaxSize")
@@ -349,6 +223,8 @@ public class HuaTaiImageInitParamResponse {
             private Integer picQuality;
             @JsonProperty("readable")
             private Integer readable;
+            @JsonProperty("renameByTypeName")
+            private String renameByTypeName;
             @JsonProperty("riskCode")
             private String riskCode;
             @JsonProperty("riskCodeName")
@@ -361,6 +237,21 @@ public class HuaTaiImageInitParamResponse {
             private String typePathName;
             @JsonProperty("writable")
             private Integer writable;
+            @JsonProperty("children")
+            private List<ChildrenDTO> children;
+
+            @NoArgsConstructor
+            @Data
+            public static class ParenTypeVoDTO {
+            }
+
+
         }
+
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class UploadNodeMapDTO {
     }
-}
+}

+ 45 - 13
src/main/java/com/ydtech/modules/order/entity/api/zhongmei/request/QuotedPriceRequest.java

@@ -167,7 +167,9 @@ public class QuotedPriceRequest extends BaseRequest {
                 this.province = zmConfigureParameters.getProvince();
                 this.city = zmConfigureParameters.getCity();
                 this.district = zmConfigureParameters.getDistrict();
-                this.accountUser = zmConfigureParameters.getAccountUser();
+                if (zmConfigureParameters.getAccountUser() != null) {
+                    this.accountUser = zmConfigureParameters.getAccountUser();
+                }
             }
 
         }
@@ -530,19 +532,49 @@ public class QuotedPriceRequest extends BaseRequest {
         @JsonProperty("identifyValidEndDate")
         private String identifyValidEndDate;
 
+        // 注册日期(法人必传)
+        @JsonProperty("regisDate")
+        private String regisDate;
+
+        // 营业执照单位全称
+        @JsonProperty("businessLicense")
+        private String businessLicense;
+
+        // 纳税人识别号或社会信用代码
+        @JsonProperty("taxperNumber")
+        private String taxperNumber;
+
         public CustomerDTO(CustomerInfoVo customerInfoVo, String role) {
-            this.name = customerInfoVo.getName();
-            this.identifyType = "01";
-            this.identifyNumber = customerInfoVo.getIdentifyNumber();
-            this.addr = customerInfoVo.getAddr();
-            this.mobile = customerInfoVo.getMobile();
-            this.emailPolicy = customerInfoVo.getEmail();
-            this.type = "1";
-            this.role = role;
-            this.invocieType = "026";
-            this.jobRisk = "1";
-            this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
-            this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
+            if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("1")) {
+                this.name = customerInfoVo.getName();
+                this.type = "1";
+                this.identifyType = "01";
+                this.identifyNumber = customerInfoVo.getIdentifyNumber();
+                this.role = role;
+                this.mobile = customerInfoVo.getMobile();
+                this.addr = customerInfoVo.getAddr();
+                this.emailPolicy = customerInfoVo.getEmail();
+                this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
+                this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
+                this.invocieType = "026";
+                this.jobRisk = "1";
+            }else if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("0")) {
+                this.name = customerInfoVo.getName();
+                this.type = "2";
+                this.identifyType = "4";
+                this.role = role;
+                this.identifyNumber = customerInfoVo.getOrganizationCode();
+                this.mobile = customerInfoVo.getMobile();
+                this.addr = customerInfoVo.getAddr();
+                this.emailPolicy = customerInfoVo.getEmail();
+                this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
+                this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
+                this.invocieType = "026";
+                this.regisDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
+                this.businessLicense = customerInfoVo.getName();
+                this.taxperNumber = customerInfoVo.getOrganizationCode();
+            }
+
         }
 
         public List<CustomerDTO> getCustomers(CustomerInfoVo ownerInfo, CustomerInfoVo policyHolderInfo, CustomerInfoVo insuredPersonInfo) {

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

@@ -15,7 +15,11 @@ public enum FileTypeEnum {
 
     FT_1("1", "验车照片", new String[]{"C05"}),
     FT_2("2", "其他车辆证件", new String[]{}),
-    FT_3("3", "其他客户证件", new String[]{}),
+    FT_3("3", "其他客户证件",  new String[]{
+            InsuranceImageEnum.Y02.getCode(),
+            InsuranceImageEnum.Y03.getCode(),
+            InsuranceImageEnum.Y04.getCode(),
+    }),
     FT_4("4", "车辆购置证明", new String[]{
             InsuranceImageEnum.GC00.getCode()
     }),

+ 97 - 9
src/main/java/com/ydtech/modules/order/entity/api/zijin/request/CalculatePremiumRequest.java

@@ -406,12 +406,19 @@ public class CalculatePremiumRequest implements Serializable {
         private String vehicleOwnerNature;
 
         public CarOwnerInfoDTO(CustomerInfoVo customerInfoVo) {
+            if(StringUtils.isBlank(customerInfoVo.getProperty()) || !"0".equals(customerInfoVo.getProperty())) {
+                this.ownerIdentifyNumber = customerInfoVo.getIdentifyNumber();
+                this.ownerIdentifyType = "01";
+                this.vehicleOwnerNature = "1";
+            }else{
+                this.ownerIdentifyNumber = customerInfoVo.getOrganizationCode();
+                this.ownerIdentifyType = "73";
+                this.vehicleOwnerNature = "3";
+            }
             this.carOwner = customerInfoVo.getName();
             this.mobile = customerInfoVo.getMobile();
             this.ownerAddress = customerInfoVo.getAddr();
-            this.ownerIdentifyNumber = customerInfoVo.getIdentifyNumber();
-            this.ownerIdentifyType = "01";
-            this.vehicleOwnerNature = "1";
+
         }
 
     }
@@ -1071,19 +1078,100 @@ public class CalculatePremiumRequest implements Serializable {
         @JsonProperty("validDate")
         private String validDate;
 
+        /**
+         * 授权人姓名 说明:投保人为法人时必传
+         */
+        @JsonProperty("certigierName")
+        private String certigierName;
+
+        /**
+         * 授权人证件类型	说明:投保人为法人时必传;
+         */
+        @JsonProperty("certigierType")
+        private String certigierType;
+
+        /**
+         * 授权人证件号码	说明:投保人为法人时必传;
+         */
+        @JsonProperty("certigierNumber")
+        private String certigierNumber;
+
+        /**
+         * 授权人证件号码有效期	说明:投保人为法人时必传;
+         */
+        @JsonProperty("certigierNumValidDate")
+        private String certigierNumValidDate;
+
+        /**
+         * 负责人姓名	说明:投保人为法人时必传;
+         */
+        @JsonProperty("chiefName")
+        private String chiefName;
+
+        /**
+         * 负责人证件类型	说明:投保人为法人时必传;
+         */
+        @JsonProperty("chiefType")
+        private String chiefType;
+
+        /**
+         * 负责人证件号码	说明:投保人为法人时必传;
+         */
+        @JsonProperty("chiefNumber")
+        private String chiefNumber;
+
+        /**
+         * 负责人证件号码有效期	说明:投保人为法人时必传;
+         */
+        @JsonProperty("chiefNumValidDate")
+        private String chiefNumValidDate;
+
+        /**
+         * 民族
+         */
+        @JsonProperty("nation")
+        private String nation;
+
+        /**
+         * 客户性质为单位时,单位性质必传
+         */
+        @JsonProperty("businessSort")
+        private String businessSort;
+
+
+
         public InsuredListDTO(CustomerInfoVo policyHolderInfo, String insuredFlag) {
             this.occupation = "030199";
             this.address = policyHolderInfo.getAddr();
-            this.identifyNumber = policyHolderInfo.getIdentifyNumber();
-            this.identifyType = "01";
+
+            if(StringUtils.isBlank(policyHolderInfo.getProperty()) || !"0".equals(policyHolderInfo.getProperty())) {
+                this.identifyNumber = policyHolderInfo.getIdentifyNumber();
+                this.identifyType = "01";
+                this.insuredNature = "3";
+                this.insuredType = "1";
+                int gender = IdcardUtil.getGenderByIdCard(policyHolderInfo.getIdentifyNumber());
+                this.sex = gender == 1 ? "1" : "2";
+            }else{
+                this.businessSort = "900";
+                this.businessSort = "900";
+                this.identifyNumber = policyHolderInfo.getOrganizationCode();
+                this.identifyType = "73";
+                this.insuredNature = "4";
+                this.insuredType = "2";
+                this.sex = "9";
+                this.certigierName = policyHolderInfo.getLegalPerson();
+                this.certigierType = "01";
+                this.certigierNumber = policyHolderInfo.getLeaderIdentifyNumber();
+                this.certigierNumValidDate = policyHolderInfo.getLeaderOtherEffectiveDate();
+                this.chiefName = policyHolderInfo.getLegalPerson();
+                this.chiefType = "01";
+                this.chiefNumber = policyHolderInfo.getLeaderIdentifyNumber();
+                this.chiefNumValidDate = policyHolderInfo.getLeaderOtherEffectiveDate();
+            }
             this.insuredFlag = insuredFlag;
             this.insuredName = policyHolderInfo.getName();
-            this.insuredNature = "3";
-            this.insuredType = "1";
             this.longAddress = policyHolderInfo.getAddr();
             this.mobile = policyHolderInfo.getMobile();
-            int gender = IdcardUtil.getGenderByIdCard(policyHolderInfo.getIdentifyNumber());
-            this.sex = gender == 1 ? "1" : "2";
             this.validDate = policyHolderInfo.getIdentifyValidEndDate();
         }
 

+ 6 - 0
src/main/java/com/ydtech/modules/order/service/InsOrdersService.java

@@ -54,6 +54,12 @@ public interface InsOrdersService extends IService<InsOrders> {
      */
     void updateByOrderStatus(InsAreaCompany insAreaCompany);
 
+    /**
+     * 合伙人插入钱逻辑
+     * @param insAreaCompany
+     */
+    void saveFeeInfo(InsAreaCompany insAreaCompany);
+
     /**
      * 判断订单是否存在
      *

+ 36 - 8
src/main/java/com/ydtech/modules/order/service/impl/BoHaiOrderApiServiceImpl.java

@@ -403,14 +403,26 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
         // 3 车辆确认接口
         // 车主信息
         CustomerInfoVo ownerInfo = quoteInfoVo.getOwnerInfo();
-        PersonAreaVo ownerInfoArea = sysAreaService.queryByAddressBoHai(ownerInfo.getAddr(), ownerInfo.getIdentifyNumber());
+
+        PersonAreaVo ownerInfoArea = new PersonAreaVo();
+        if (StringUtils.isBlank(ownerInfo.getProperty()) || !"0".equals(ownerInfo.getProperty())) {
+            ownerInfoArea = sysAreaService.queryByAddressBoHai(ownerInfo.getAddr(), ownerInfo.getIdentifyNumber());
+        }
+
         // 被保人信息
         CustomerInfoVo insuredPersonInfo = quoteInfoVo.getInsuredPersonInfo();
-        PersonAreaVo insuredPersonArea = sysAreaService.queryByAddressBoHai(insuredPersonInfo.getAddr(), ownerInfo.getIdentifyNumber());
+        PersonAreaVo insuredPersonArea = new PersonAreaVo();
+        if (StringUtils.isBlank(insuredPersonInfo.getProperty()) || !"0".equals(insuredPersonInfo.getProperty())) {
+            insuredPersonArea = sysAreaService.queryByAddressBoHai(insuredPersonInfo.getAddr(), ownerInfo.getIdentifyNumber());
+        }
         // 投保人信息
         CustomerInfoVo policyHolderInfo = quoteInfoVo.getPolicyHolderInfo();
-        PersonAreaVo policyHolderArea = sysAreaService.queryByAddressBoHai(policyHolderInfo.getAddr(),
-                policyHolderInfo.getIdentifyNumber());
+        PersonAreaVo policyHolderArea = new PersonAreaVo();
+        if (StringUtils.isBlank(policyHolderInfo.getProperty()) || !"0".equals(policyHolderInfo.getProperty())) {
+            policyHolderArea = sysAreaService.queryByAddressBoHai(policyHolderInfo.getAddr(),
+                    policyHolderInfo.getIdentifyNumber());
+        }
+
         VehicleConfirmationReqeust vehicleConfirmationReqeust = new VehicleConfirmationReqeust(parameters, quoteInfoVo, vehicleModelsDTO,
                 orderNo, ownerInfoArea, insuredPersonArea, policyHolderArea);
         VehicleConfirmationResponse vehicleConfirmationResponse = boHaiRequestApiComponent.vehicleConfirmation(vehicleConfirmationReqeust
@@ -491,9 +503,22 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
             insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
             // 支付请求
             PaymentRequest paymentRequest = new PaymentRequest(parameters, insAreaCompany.getId(), insAreaCompany.getInsOrderNo());
-            PaymentResponse paymentResponse = boHaiRequestApiComponent.payment(paymentRequest, parameters.getSysSourceCode());
-            String payUrl = paymentResponse.getData().getPayUrl();
-            insAreaCompany.setPaymentLink(payUrl);
+            int whileNum = 5;
+            PaymentResponse paymentResponse = null;
+            while(whileNum > 1){
+                Thread.sleep(3000);
+                paymentResponse = boHaiRequestApiComponent.payment(paymentRequest, parameters.getSysSourceCode());
+                if(paymentResponse.getResponseCode().equals(ResponseCode.R_Z00001.getCode())) {
+                    String payUrl = paymentResponse.getData().getPayUrl();
+                    insAreaCompany.setPaymentLink(payUrl);
+                    break;
+                }
+                whileNum--;
+            }
+            if(!paymentResponse.getResponseCode().equals(ResponseCode.R_Z00001.getCode())){
+                throw new SystemException(paymentResponse.getResponseMsg());
+            }
+
             insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
             return HttpResult.ok("核保通过");
         } else if (i == 2) {
@@ -562,8 +587,11 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
     public HttpResult<Object> getOrderDetail(String subOrderNo) throws Exception {
         InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(subOrderNo);
         List<StatusDocumentsResponse.DataDTO.DocumentListDTO> documentList = getDocumentListDTO(insAreaCompany);
+        documentList = documentList.stream().filter(x -> !x.getInsuranceType().equals("2")).collect(Collectors.toList());
         List<StatusDocumentsResponse.DataDTO.DocumentListDTO> documentListDTOS =
-                documentList.stream().filter(x -> ResultCode.RC_B5.getCode().equals(x.getStatus())).collect(Collectors.toList());
+                documentList.stream()
+                        .filter(x -> !x.getInsuranceType().equals("2"))
+                        .filter(x -> ResultCode.RC_B5.getCode().equals(x.getStatus())).collect(Collectors.toList());
 
         if (documentListDTOS.size() == documentList.size()) {
             for (StatusDocumentsResponse.DataDTO.DocumentListDTO documentListDTO : documentListDTOS) {

+ 23 - 12
src/main/java/com/ydtech/modules/order/service/impl/DaJiaOrderServiceImpl.java

@@ -44,6 +44,7 @@ import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.utils.CalculateUtils;
 import com.ydtech.utils.DateTimeUtil;
+import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.baidu.FileUtil;
 import com.ydtech.utils.idgen.IdGenerate;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -185,20 +186,30 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
             configureParametersComponents.toEntity(daJiaConfigureParameters, t.getAgreementId());
             PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(t.getAgreementId());
 
-            //车主区划信息
-            PersonAreaVo ownerPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getOwnerInfo().getAddr(), quoteInfoVo.getOwnerInfo().getIdentifyNumber());
+            CustomerInfoVo ownerInfo = quoteInfoVo.getOwnerInfo();
+            CustomerInfoVo policyHolderInfo = quoteInfoVo.getPolicyHolderInfo();
+            CustomerInfoVo insuredPersonInfo = quoteInfoVo.getInsuredPersonInfo();
 
-            //投保人区划信息
-            PersonAreaVo policyHolderPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getPolicyHolderInfo().getAddr(), quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber());
-            PersonAreaVo insuredPersonArea;
-            //投保人等于被保人
-            if (quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber().equals(quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber())) {
-                insuredPersonArea = policyHolderPersonArea;
-            } else {
-                //被保人区划信息
-                insuredPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getInsuredPersonInfo().getAddr(), quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber());
+            PersonAreaVo ownerPersonArea = new PersonAreaVo();
+            PersonAreaVo policyHolderPersonArea = new PersonAreaVo();
+            PersonAreaVo insuredPersonArea = new PersonAreaVo();
+            if (StringUtils.isBlank(ownerInfo.getProperty()) || !"0".equals(ownerInfo.getProperty())) {
+                //车主区划信息
+                ownerPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getOwnerInfo().getAddr(), quoteInfoVo.getOwnerInfo().getIdentifyNumber(),null);
+            }
+            if (StringUtils.isBlank(policyHolderInfo.getProperty()) || !"0".equals(policyHolderInfo.getProperty())) {
+                //投保人区划信息
+                policyHolderPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getPolicyHolderInfo().getAddr(), quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber(),null);
+            }
+            if (StringUtils.isBlank(insuredPersonInfo.getProperty()) || !"0".equals(insuredPersonInfo.getProperty())) {
+                //投保人等于被保人
+                if (quoteInfoVo.getPolicyHolderInfo().getIdentifyNumber().equals(quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber())) {
+                    insuredPersonArea = policyHolderPersonArea;
+                } else {
+                    //被保人区划信息
+                    insuredPersonArea = sysAreaService.queryByAddress(quoteInfoVo.getInsuredPersonInfo().getAddr(), quoteInfoVo.getInsuredPersonInfo().getIdentifyNumber(),null);
+                }
             }
-
             // 1.获取业务订单号接口
             String orderNo = getOrderNo(daJiaConfigureParameters);
             //生成业务id  1008 1010 接口使用

+ 1 - 1
src/main/java/com/ydtech/modules/order/service/impl/HuaTaiOrderApiServiceImpl.java

@@ -214,7 +214,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
 
         //查找车主的区划信息
         PersonAreaVo ownerPersonArea = sysAreaService.queryByAddress(yaQuoteInfoVo.getOwnerInfo().getAddr(),
-                yaQuoteInfoVo.getOwnerInfo().getIdentifyNumber());
+                yaQuoteInfoVo.getOwnerInfo().getIdentifyNumber(),yaQuoteInfoVo.getOwnerInfo().getLeaderIdentifyNumber());
         huaTaiConfigureParameters.setCity(ownerPersonArea.getCityCode());
         huaTaiConfigureParameters.setProvince(ownerPersonArea.getProvinceCode());
         huaTaiConfigureParameters.setDistrict(ownerPersonArea.getCountyCode());

+ 6 - 3
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -1146,9 +1146,12 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
      */
     @Override
     public void updateDeleteFalg(String id) {
-        UpdateWrapper<InsAreaCompany> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.set("del_flag", 0).eq("id", id);
-        update(updateWrapper);
+        //修改为真删
+        int i = baseMapper.deleteById(id);
+//        UpdateWrapper<InsAreaCompany> updateWrapper = new UpdateWrapper<>();
+//        updateWrapper.set("del_flag", 0).eq("id", id);
+//        update(updateWrapper);
+
     }
 
     @Override

+ 5 - 5
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -262,7 +262,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             String id = insAreaCompany.getId();
             if (StringUtils.isNotEmpty(id)) {
                 List<SysPremiumDetails> sysPremiumDetails = sysPremiumDetailsMapper.selectList(new LambdaQueryWrapper<SysPremiumDetails>().eq(SysPremiumDetails::getCompanyId, id));
-                if ( sysPremiumDetails.size() == 0) {
+                if (sysPremiumDetails.isEmpty()) {
                     //已承保记录保费数据
                     saveFeeInfo(insAreaCompany);
                 }
@@ -281,7 +281,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
     }
 
-    private void saveFeeInfo(InsAreaCompany insAreaCompany) {
+    @Override
+    public void saveFeeInfo(InsAreaCompany insAreaCompany) {
         InsOrders insOrders = getById(insAreaCompany.getOrderno());
         String userId = insOrders.getUserid();
         try {
@@ -2411,9 +2412,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         if (externalOrder == null) {
             throw new SystemException("未找到暂存订单");
         }
-        //设置删除标识
-        externalOrder.setDelFlag("1");
-        return baseMapper.updateById(externalOrder) > 0;
+        //真删除
+        return baseMapper.deleteById(externalOrder.getOrderno()) > 0;
     }
 
     /**

+ 6 - 6
src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java

@@ -273,7 +273,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
 
     @Override
     public HttpResult<Object> audit(String companyId) {
-        InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(companyId);
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
         // 1. 协议id获取配置实体
         ZmConfigureParameters zmConfigureParameters = configureParametersComponents.toEntity(ZmConfigureParameters.class,
                 insAreaCompany.getAgreementId());
@@ -282,7 +282,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         JSONObject ownerinfo = insOrders.getApplyinfo();
         CustomerInfoVo customerInfoVo = ownerinfo.toJavaObject(CustomerInfoVo.class);
         // 2. 提交核保
-        SubmitResponse response = submitForUnderwriting(insAreaCompany.getId(), insOrders.getFrameno(), customerInfoVo,
+        SubmitResponse response = submitForUnderwriting(insAreaCompany.getInsOrderNo(), insOrders.getFrameno(), customerInfoVo,
                 zmConfigureParameters);
         // 3. 人工核保
         if (SubmitStatus.S_3.getCode().equals(response.getSubmitStatus())) {
@@ -313,14 +313,14 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
 
     @Override
     public HttpResult<Object> submitImage(String companyId) {
-        InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(companyId);
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
         // 1. 协议id获取配置实体
         ZmConfigureParameters zmConfigureParameters = configureParametersComponents.toEntity(ZmConfigureParameters.class,
                 insAreaCompany.getAgreementId());
 
         InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
         // 2. 投保单号(总)
-        String insOrderNo = insAreaCompany.getId();
+        String insOrderNo = insAreaCompany.getInsOrderNo();
 
         List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insOrders.getOrderno(), insAreaCompany.getId());
 
@@ -393,7 +393,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
 
     @Override
     public HttpResult<Object> paymentEnquiry(String companyId) {
-        InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(companyId);
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
 
         // 1. 协议id获取配置实体
         ZmConfigureParameters zmConfigureParameters = configureParametersComponents.toEntity(ZmConfigureParameters.class,
@@ -661,7 +661,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
 
     @Override
     public HttpResult<Object> auditStatusQuery(String companyId) {
-        InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(companyId);
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
         // 1. 协议id获取配置实体
         ZmConfigureParameters zmConfigureParameters = configureParametersComponents.toEntity(ZmConfigureParameters.class,
                 insAreaCompany.getAgreementId());

+ 1 - 1
src/main/resources/application-prod.yml

@@ -375,7 +375,7 @@ qrcode:
 #大家财险api
 dajia:
   api:
-    url: https://ics.djbx.com/sip-agent/simpleRequest/
+    url: https://open-ics.djbx.com/dip-agent/agent/invokeForVchicle/api/
     encryptKey: "By92YPLvG89XyFqv"
 
 

+ 1 - 1
src/main/resources/application-test.yml

@@ -435,7 +435,7 @@ huatai:
 #大家财险api
 dajia:
   api:
-    url: https://ics-test.djbx.com/sip-agent/simpleRequest/
+    url: https://uatagent-ics.djbx.com/dip-agent/agent/invokeForVchicle/api/
     encryptKey: "qwertyuiopasdfgh"
 
 # api url

+ 30 - 1
src/main/resources/mapper/modules/admin/DeptBalanceMapper.xml

@@ -184,7 +184,7 @@
              and   io.userid =#{userId}
             </if>
             <if test="beginDate !=null and beginDate != '' and endDate !=null and endDate != ''">
-                AND  iac.signing_time  BETWEEN  #{beginDate}  AND  #{endDate}
+                AND  DATE_FORMAT( iac.createtime, '%Y-%m-%d')  BETWEEN DATE_FORMAT( #{beginDate}, '%Y-%m-%d')    AND   DATE_FORMAT( #{endDate}, '%Y-%m-%d')
             </if>
         </where>
     </select>
@@ -207,4 +207,33 @@
             </if>
         </where>
     </select>
+
+    <select id="getIncomeIndication" resultType="java.util.HashMap">
+        select ifnull(sum(a.amount) ,0) as "totalAmount"
+        from (
+        SELECT
+        his.amount as "amount"
+        FROM
+        sys_user_account_history his
+        LEFT JOIN ins_area_company ins ON his.suborder = ins.id
+        LEFT JOIN ins_orders o ON o.orderno = ins.orderno
+        left join sys_amount_auditing saa on saa.id =his.auditiing_id
+        left join sys_user su on su.id =his.user_id
+        WHERE
+        his.property !=1
+        and his.property !=2
+        AND his.documentary = '2'
+        <if test="beginDate !=null and beginDate != '' and endDate !=null and endDate != '' ">
+            AND date(his.create_time) BETWEEN #{beginDate} AND #{endDate}
+        </if>
+        <if test="userId !=null and userId!=''">
+            AND his.user_id  IN ( SELECT id FROM sys_user WHERE manager_id = #{userId} OR id= #{userId} )
+        </if>
+
+        <if test="phoneNumber !=null and phoneNumber !=''">
+            and su.mobile =#{phoneNumber}
+        </if>
+        order by his.create_time desc
+        ) a
+    </select>
 </mapper>

+ 21 - 0
src/main/resources/mapper/modules/admin/SysPremiumDetailsMapper.xml

@@ -49,6 +49,25 @@
     <sql id="setGroupConcatMaxLen">
         SET SESSION group_concat_max_len = 100000;
     </sql>
+    <select id="getTotalAmount" resultType="java.util.HashMap">
+        SELECT
+        sum(a.sumpremium) as "totalAmount",
+        sum(a.extract_fee) as "extractFeeAmount"
+        from
+        sys_premium_details a
+        <where>
+            a.status ='1'
+            <if test="beginDate !=null and beginDate != '' and endDate !=null and endDate != ''">
+                AND DATE_FORMAT( a.create_time, '%Y-%m-%d') BETWEEN DATE_FORMAT( #{beginDate}, '%Y-%m-%d') AND
+                DATE_FORMAT( #{endDate}, '%Y-%m-%d')
+            </if>
+            <if test="userId !=null  and  userId !=''">
+                and a.user_id = #{userId}
+            </if>
+        </where>
+
+
+    </select>
     <select id="queryInfoPage" resultType="java.util.Map">
         <include refid="setGroupConcatMaxLen"/>
         SELECT
@@ -97,6 +116,8 @@
             company_id ASC
         LIMIT #{dto.pageSize} OFFSET #{dto.pageNum};
     </select>
+
+    
     <select id="queryInfoPages" resultType="java.util.Map">
         SELECT
         company_id as companyId,

+ 66 - 11
src/main/resources/mapper/modules/admin/SysUserAccountMapper.xml

@@ -5,6 +5,7 @@
 <mapper namespace="com.ydtech.modules.admin.dao.SysUserAccountMapper">
 
     <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.SysUserAccount">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
             <id property="userId" column="user_id" jdbcType="VARCHAR"/>
             <result property="handlingFee" column="handling_fee" jdbcType="DECIMAL"/>
             <result property="documentary" column="documentary" jdbcType="DECIMAL"/>
@@ -28,8 +29,8 @@
             <result property="sumAmountPayment" column="sum_amount_payment" jdbcType="DECIMAL"/>
             <result property="managementSource" column="managementSource" jdbcType="VARCHAR"/>
             <result property="roleId" column="roleId" jdbcType="VARCHAR"/>
-        <collection property="sysUserAccountCardList" ofType="com.ydtech.modules.admin.model.po.SysUserBankCard"
-                    resultMap="sysUserAccountCardList"/>
+       <!-- <collection property="sysUserAccountCardList" ofType="com.ydtech.modules.admin.model.po.SysUserBankCard"
+                    resultMap="sysUserAccountCardList"/> -->
     </resultMap>
 
     <resultMap id="sysUserAccountCardList" type="com.ydtech.modules.admin.model.po.SysUserBankCard">
@@ -109,6 +110,7 @@
 
     <select id="queryPageOrder1"  resultMap="BaseResultMap">
         select
+        a.user_id as id,
         a.user_id,
         a.handling_fee,
         a.documentary,
@@ -126,13 +128,6 @@
         b.dept_id  as  deptId,
         b.name  as  name,
         sd.name  as  deptName,
-        c.id,
-        c.bank_number,
-        c.bank_account,
-        c.bank_address,
-        c.del_flag,
-        c.audit_status,
-        c.real_user_name,
         a.sum_amount,
         a.sum_amount_withdrawal,
         a.sum_amount_account,
@@ -143,10 +138,8 @@
         sys_user_account a
         left join sys_user b on a.user_id = b.id
         left join sys_dept sd on sd.id = b.dept_id
-        left join sys_user_bank_card c on c.user_id = a.user_id
         left join sys_user_role role on role.user_id = a.user_id
         <where>
-            1=1
             <if test="sysUserAccountVo.userId != null and sysUserAccountVo.userId != ''">
                 and a.user_id = #{sysUserAccountVo.userId}
             </if>
@@ -171,4 +164,66 @@
     </select>
 
 
+    <select id="queryCount"  resultMap="BaseResultMap">
+        select
+        a.user_id,
+        a.handling_fee,
+        a.documentary,
+        a.promotion,
+        a.create_time,
+        a.handling_amount_withdrawal,
+        a.handling_amount_account,
+        a.handling_amount_payment,
+        a.documentary_amount_withdrawal,
+        a.documentary_amount_account,
+        a.documentary_amount_payment,
+        a.promotion_amount_withdrawal,
+        a.promotion_amount_account,
+        a.promotion_amount_payment,
+        b.dept_id  as  deptId,
+        b.name  as  name,
+        sd.name  as  deptName,
+        sd.management_source  as managementSource,
+        role.role_id  as  roleId
+        from
+        sys_user_account a
+        left join sys_user b on a.user_id = b.id
+        left join sys_dept sd on sd.id = b.dept_id
+        left join sys_user_role role on role.user_id = a.user_id
+        <where>
+            a.user_id   not  in (
+            SELECT
+            su.id AS userId
+            FROM
+            sys_user su
+            LEFT JOIN sys_user_info info ON info.id = su.id
+            LEFT JOIN sys_dept sd ON su.dept_id = sd.id
+            LEFT JOIN sys_dept psd ON psd.id = sd.parent_id
+            LEFT JOIN sys_user_role t3 ON su.id = t3.user_id
+            LEFT JOIN sys_role t4 ON t3.role_id = t4.id
+            AND sd.del_flag = '0'
+            WHERE
+            su.dept_id LIKE concat( '%', '99', '%' )
+            AND t3.role_id IN ( 3 )
+            AND sd.management_source = 3
+            ORDER BY
+            su.create_time DESC
+            )
+        </where>
+    </select>
+
+
+    <select id="queryCardListByUserId"  resultMap="sysUserAccountCardList">
+        select
+            c.id,
+            c.bank_number,
+            c.bank_account,
+            c.bank_address,
+            c.del_flag,
+            c.audit_status,
+            c.real_user_name
+        from
+            sys_user_bank_card c
+        where  c.user_id =#{userId}
+    </select>
 </mapper>

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

@@ -1387,6 +1387,7 @@
         <where>
             info.id is not null
             and su.id NOT LIKE '%M%'
+            AND ( su.type != '1' and  su.type != '2' )
             <if test="vo.provinceId != null and vo.provinceId != ''">
                 and sd.id like concat('%',#{vo.provinceId},'%')
             </if>

+ 1 - 1
src/main/resources/mapper/modules/console/WithdrawalTaskMapper.xml

@@ -55,7 +55,7 @@
     <select id="countWithdrawal" resultType="java.util.HashMap">
         select
               IFNULL(sum(a.amount),0) as "allWithdrawalAmount",
-              IFNULL(count(CASE WHEN a.auditing_status = 2 THEN  1  END),0)  +  IFNULL(count(CASE WHEN a.auditing_status = 3 THEN  1  END),0) as "allWithdrawalNumber",
+              IFNULL(count(a.id),0)  as "allWithdrawalNumber",
               IFNULL(sum( CASE WHEN a.auditing_status = 2 THEN  IFNULL(a.amount,0)  END ),0)  AS notWithdrawalAmount,
               IFNULL(sum( CASE WHEN a.auditing_status = 3 THEN  IFNULL(a.amount,0)  END ),0)  AS withdrawalAmount,
               IFNULL(count(CASE WHEN a.auditing_status = 2 THEN  1  END),0) as "notAllWithdrawalNumber",

+ 3 - 2
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -1794,7 +1794,7 @@
                FROM ins_ply_income a
                    LEFT JOIN ptl_agreement pa ON a.agreement_id = pa.id
                <where>
-                   YEAR(a.signdate) BETWEEN YEAR(CURDATE()) AND YEAR(CURDATE()) + 1
+                   YEAR(a.signdate) BETWEEN #{year} AND #{yearAdd}
                    <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>
@@ -1943,7 +1943,8 @@
               SUM(CASE WHEN a.settlement_status = '1' THEN IFNULL(a.settlement_amount, 0) ELSE 0 END) AS invoicCommissionFeevalue
           FROM settlement_documentary_fees a
           <where>
-              YEAR(a.signing_time) BETWEEN YEAR(CURDATE()) AND YEAR(CURDATE()) + 1
+              YEAR(a.signing_time) BETWEEN #{year} AND #{yearAdd}
+
               <if test="isNotCar !=null  and  isNotCar  !=''">
                   and a.is_not_car =#{isNotCar}
               </if>

+ 68 - 2
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -896,6 +896,7 @@
         LEFT JOIN ins_fee_audit ifa  on ifa.ins_order_no =iac.id
         WHERE
         agree.id IS NOT NULL
+        and  ( io.del_flag is null   or   io.del_flag ='1')
         <if test="vo.companyId  != null  and  vo.companyId!='' ">
             AND agree.insurance_company_id = #{vo.companyId}
         </if>
@@ -934,6 +935,72 @@
         order  by a.parterCompanyId
     </select>
 
+
+    <select id="quotationDetailsExcel" resultType="com.ydtech.modules.admin.model.dto.QuotationDetailsExcel">
+        select
+            iac.orderno as "orderno",
+            iac.agreement_id as "agreementId",
+            iac.orderstatus as "orderstatus",
+            iac.company_id as "companyId",
+            agree.partner_companies_id as "partnerCompaniesId",
+            ins.namesimple as "partnerCompaniesName",
+            agree.insurance_company as "inscompany",
+            iac.jqpolicyno as "jqpolicyno",
+            iac.sypolicyno as "sypolicyno",
+            iac.sumpremium as "sumpremium",
+            iac.jqpremium as "jqpremium",
+            iac.sypremium as "sypremium",
+            iac.jypremium as "jypremium",
+            iac.createtime as "createtime",
+            iac.signing_time as "signingTime",
+            sd.management_source as "managementSource",
+            agree.audit_type as "auditType",
+            ifa.auditstatus  as "auditstatus",
+            io.licenseno  as "licenseno",
+            su1.name  as "userName"
+            from ins_area_company iac
+            LEFT JOIN ptl_agreement agree ON iac.agreement_id = agree.id
+            LEFT JOIN ins_orders io ON iac.orderno = io.orderno
+            LEFT JOIN sys_user su1  on  su1.id=io.userid
+            LEFT JOIN sys_dept sd ON sd.id = io.deptid
+            LEFT JOIN ins_fee_audit ifa on ifa.ins_order_no = iac.id
+            LEFT JOIN esm_ins_company ins ON agree.partner_companies_id = ins.id
+        <where>
+            agree.id IS NOT NULL
+            and  ( io.del_flag is null   or   io.del_flag ='1')
+            <if test="vo.companyId  != null  and  vo.companyId!='' ">
+                AND agree.insurance_company_id = #{vo.companyId}
+            </if>
+            <if test="vo.parterCompanyId  != null  and  vo.parterCompanyId!='' ">
+                AND agree.partner_companies_id = #{vo.parterCompanyId}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND iac.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+            <if test="vo.managementSource  != null  and  vo.managementSource!=''">
+                AND sd.management_source =#{vo.managementSource}
+            </if>
+            <if test="vo.userId  != null  and vo.userId !=''">
+                AND  io.userid  =#{vo.userId}
+            </if>
+            <if test="vo.deptId  != null  and vo.deptId !=''">
+                AND  io.deptId  like concat('%',#{vo.deptId},'%')
+            </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND sd.id  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
     <select id="getInsAreaCompanyError"
             resultType="com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto">
         SELECT
@@ -1548,8 +1615,7 @@
         COUNT( CASE WHEN iot.order_status =  '1' THEN 1 END  )   as  "auditOrder"
         FROM
         (
-        select iot.suborder,iot.order_status from `ins_orders_track` iot
-        GROUP BY iot.suborder ,iot.order_status
+        select DISTINCT iot.suborder,iot.order_status from `ins_orders_track` iot
         ) iot
         LEFT JOIN ins_area_company iac ON iac.id = iot.suborder
         left join ins_orders io on io.orderno = iac.orderno