Jelajahi Sumber

Merge branch 'test' into helixiao-dev

helixiao 1 tahun lalu
induk
melakukan
0eb49fff5c
41 mengubah file dengan 530 tambahan dan 102 penghapusan
  1. 3 3
      src/main/java/com/ydtech/modules/admin/model/dto/PayableAmountExcel.java
  2. 3 0
      src/main/java/com/ydtech/modules/admin/model/dto/QuotationDetailsExcel.java
  3. 1 1
      src/main/java/com/ydtech/modules/admin/service/impl/ProfitAnalysisServiceImpl.java
  4. 8 8
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java
  5. 10 0
      src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java
  6. 12 0
      src/main/java/com/ydtech/modules/console/dto/BigOrderUploadDto.java
  7. 8 0
      src/main/java/com/ydtech/modules/fnc/dao/InsExcelTaskAsyncMapper.java
  8. 3 0
      src/main/java/com/ydtech/modules/fnc/dto/InsExcelTaskDto.java
  9. 7 0
      src/main/java/com/ydtech/modules/fnc/service/InsExcelTaskAsyncService.java
  10. 19 0
      src/main/java/com/ydtech/modules/fnc/service/impl/InsExcelTaskAsyncServiceImpl.java
  11. 1 1
      src/main/java/com/ydtech/modules/fnc/service/impl/InsuranceHandlingSettlementMonthServiceImpl.java
  12. 45 0
      src/main/java/com/ydtech/modules/fnc/timer/InsExcelTaskAsyncTimer.java
  13. 6 0
      src/main/java/com/ydtech/modules/ins/model/yc/ruote/response/VhlResponse.java
  14. 16 1
      src/main/java/com/ydtech/modules/order/controller/QrCodeController.java
  15. 0 1
      src/main/java/com/ydtech/modules/order/controller/QuoteController.java
  16. 38 0
      src/main/java/com/ydtech/modules/order/dao/InsAreaCompanyInfoMapper.java
  17. 15 0
      src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java
  18. 7 0
      src/main/java/com/ydtech/modules/order/entity/InsAreaCompanyAccidentalDriving.java
  19. 81 0
      src/main/java/com/ydtech/modules/order/entity/InsAreaCompanyInfo.java
  20. 4 4
      src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java
  21. 1 1
      src/main/java/com/ydtech/modules/order/service/InsOrdersService.java
  22. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/BoHaiOrderApiServiceImpl.java
  23. 11 3
      src/main/java/com/ydtech/modules/order/service/impl/ChengTaiOrderApiServiceImpl.java
  24. 8 1
      src/main/java/com/ydtech/modules/order/service/impl/DaJiaOrderServiceImpl.java
  25. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java
  26. 8 1
      src/main/java/com/ydtech/modules/order/service/impl/HuaTaiOrderApiServiceImpl.java
  27. 25 2
      src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java
  28. 9 3
      src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java
  29. 86 22
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  30. 19 11
      src/main/java/com/ydtech/modules/order/service/impl/YangGuangOrderApiServiceImpl.java
  31. 12 4
      src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java
  32. 7 0
      src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java
  33. 10 3
      src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java
  34. 1 2
      src/main/resources/mapper/modules/admin/CompanyDataReport.xml
  35. 0 1
      src/main/resources/mapper/modules/admin/DeptBalanceMapper.xml
  36. 4 3
      src/main/resources/mapper/modules/console/ProfitAnalysisMapper.xml
  37. 5 1
      src/main/resources/mapper/modules/console/UpLoadOrderMapper.xml
  38. 16 6
      src/main/resources/mapper/modules/fnc/InsExcelTaskAsyncMapper.xml
  39. 2 3
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  40. 13 10
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  41. 4 4
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml

+ 3 - 3
src/main/java/com/ydtech/modules/admin/model/dto/PayableAmountExcel.java

@@ -49,15 +49,15 @@ public class PayableAmountExcel {
 
     @ApiModelProperty("交强保单号")
     @ExcelProperty("交强保单号")
-    private String jqapplyno;
+    private String jqpolicyno;
 
     @ApiModelProperty("商业保单号")
     @ExcelProperty("商业保单号")
-    private String syapplyno;
+    private String sypolicyno;
 
     @ApiModelProperty("非车保单号")
     @ExcelProperty("非车保单号")
-    private String jyapplyno;
+    private String jypolicyno;
 
     @ApiModelProperty("交强保费")
     @ExcelProperty("交强保费")

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

@@ -68,6 +68,9 @@ public class QuotationDetailsExcel {
     @ExcelProperty(value = "维护人",index = 19)
     private String leaderName;
 
+    @ExcelProperty(value = "大订单号",index = 20)
+    private String bigOrderno;
+
     @ExcelIgnore
     private String auditstatus;
 

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

@@ -464,7 +464,7 @@ public class ProfitAnalysisServiceImpl implements ProfitAnalysisService {
         auditExportList.forEach(item->{
             //获取驾意险保单号
             if(item.getCrossInsurance() != null) {
-                item.setJyapplyno(OrderUtils.getJyPolicyNo(item.getCompanyId(), item.getApiType(), item.getCrossInsurance(), item.getIsExternal()));
+                item.setJypolicyno(OrderUtils.getJyPolicyNo(item.getCompanyId(), item.getApiType(), item.getCrossInsurance(), item.getIsExternal()));
             }
             //处理补录订单
             if(item.getIsExternal().equals("0")){

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

@@ -3097,24 +3097,24 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         String identity = sysUser.getIdentity();
         String identityTime = sysUser.getIdentityTime();
         String mobile = sysUser.getMobile();
-        sysUser.setIdentity("");
-        sysUser.setIdentityTime(null);
-        sysUser.setMobile("");
+        sysUser.setIdentity(identity+"-zc");
+        //sysUser.setIdentityTime(null);
+        sysUser.setMobile(mobile+"-zc");
         if(StringUtils.isBlank(transferUserVo.getDeptId())){
-           throw new SystemException("转部门不能为空!");
+           throw new SystemException("转部门不能为空!");
         }
         if(transferUserVo.getDeptId().equals("9")){
-            throw new SystemException("转部门不能为总部!");
+            throw new SystemException("转部门不能为总部!");
         }
         if(transferUserVo.getDeptId().equals(sysUser.getDeptId())){
-            throw new SystemException("转部门和用户当前部门一致,请重新选择");
+            throw new SystemException("转部门和用户当前部门一致,请重新选择");
         }
         SysDept dept = sysDeptMapper.selectById(transferUserVo.getDeptId());
         if(dept.getDeptType()!=null && ("C".equals(dept.getDeptType()) || "M".equals(dept.getDeptType()))) {
-           throw new SystemException("转部门为子公司或者门店,请重新选择");
+           throw new SystemException("转部门为子公司或者门店,请重新选择");
         }
         if(dept.getManagementSource()!=null && ("1".equals(dept.getManagementSource()) || "2".equals(dept.getManagementSource()) || "3".equals(dept.getManagementSource()))){
-            throw new SystemException("转部门类型不能为渠道、电销、个代,请重新选择");
+            throw new SystemException("转部门类型不能为渠道、电销、个代,请重新选择");
         }
         if(sysUser.getType()!=null && sysUser.getType()!=0){
             throw new SystemException("非后线人员不能转出");

+ 10 - 0
src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java

@@ -526,6 +526,16 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
         HashMap<String, String> dateMapByType = getDateMapByTypeNew(taskStatisticsVo.getDays(), taskStatisticsVo.getBeginDate(), taskStatisticsVo.getEndDate());
         taskStatisticsVo.setBeginDate(dateMapByType.get("startDate"));
         taskStatisticsVo.setEndDate(dateMapByType.get("endDate"));
+
+        if(StringUtils.isNotEmpty(taskStatisticsVo.getTaskType()) && "1".equals(taskStatisticsVo.getTaskType())){
+            taskStatisticsVo.setBeginDate(null);
+            taskStatisticsVo.setEndDate(null);
+            taskStatisticsVo.setSigningTimeStart(dateMapByType.get("startDate"));
+            taskStatisticsVo.setSigningTimeEnd(dateMapByType.get("endDate"));
+        }else {
+            taskStatisticsVo.setBeginDate(dateMapByType.get("startDate"));
+            taskStatisticsVo.setEndDate(dateMapByType.get("endDate"));
+        }
         IPage<TaskStatisticsDto> list = this.insAreaCompanyMapper.queryPageElectric(page,taskStatisticsVo);
         if (list != null && !list.getRecords().isEmpty()) {
             List<TaskStatisticsDto> records = list.getRecords();

+ 12 - 0
src/main/java/com/ydtech/modules/console/dto/BigOrderUploadDto.java

@@ -61,4 +61,16 @@ public class BigOrderUploadDto implements Serializable {
     @ApiModelProperty(value = "承保公司")
     @ExcelProperty(value = "承保公司",index = 9)
     private  String  companyName;
+
+    @ApiModelProperty(value = "业务员名称")
+    @ExcelProperty(value = "业务员名称",index = 10)
+    private  String  userName;
+
+    @ApiModelProperty(value = "业务员工号")
+    @ExcelProperty(value = "业务员工号",index = 11)
+    private  String  userId;
+
+    @ApiModelProperty(value = "维护人")
+    @ExcelProperty(value = "维护人",index = 12)
+    private  String  leaderName;
 }

+ 8 - 0
src/main/java/com/ydtech/modules/fnc/dao/InsExcelTaskAsyncMapper.java

@@ -7,9 +7,17 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 @Mapper
 public interface InsExcelTaskAsyncMapper  extends  BaseMapper<InsExcelTaskEntity>{
 
     Page<InsExcelTaskEntity> queryPage(@Param("vo") InsExcelTaskDto insExcelTaskDto,@Param("page") Page<InsExcelTaskEntity> page);
 
+    /**
+     *
+     * @param nowTime
+     * @return  查询任务集合
+     */
+    List<InsExcelTaskEntity> selectAllList(InsExcelTaskDto insExcelTaskDto);
 }

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

@@ -38,4 +38,7 @@ public class InsExcelTaskDto {
     @ApiModelProperty("页数")
     private int pageSize;
 
+    @ApiModelProperty("当前时间")
+    private String nowTime;
+
 }

+ 7 - 0
src/main/java/com/ydtech/modules/fnc/service/InsExcelTaskAsyncService.java

@@ -22,4 +22,11 @@ public interface InsExcelTaskAsyncService   extends IService<InsExcelTaskEntity>
      * @return 任务分页
      */
     BasePageResult<InsExcelTaskEntity> queryPage(InsExcelTaskDto insExcelTaskDto);
+    /**
+     *  @version
+     *  @author: whp
+     *  @Description: 任务中心的数据保留7天,7天后删除任务中心数据以及任务中心列表。
+     */
+    void batchDelete(String nowTime);
+
 }

+ 19 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/InsExcelTaskAsyncServiceImpl.java

@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.io.File;
@@ -208,4 +209,22 @@ public class InsExcelTaskAsyncServiceImpl extends ServiceImpl<InsExcelTaskAsyncM
         return new BasePageResult<>(insExcelTaskDto.getPageNum(), page.getSize(), resultPage.getTotal(), page.getPages(),
                 resultPage.getRecords());
     }
+    /**
+     *  @version
+     *  @author: whp
+     *  @Description: 任务中心的数据保留7天,7天后删除任务中心数据以及任务中心列表。
+     */
+    @Override
+    @Transactional
+    public void batchDelete(String nowTime) {
+        InsExcelTaskDto insExcelTaskDto = new InsExcelTaskDto();
+        insExcelTaskDto.setNowTime(nowTime);
+//      如果与当前时间差大于等于7则删除
+        List<InsExcelTaskEntity> list = baseMapper.selectAllList(insExcelTaskDto);
+        List<String> idList = list.stream()
+                .map(InsExcelTaskEntity::getId)
+                .filter(id -> id!= null)
+                .collect(Collectors.toList());
+        this.removeByIds(idList);
+    }
 }

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

@@ -58,7 +58,7 @@ public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<Ins
                 if (item.getTotalAmount() != null && item.getTotalAmount().compareTo(BigDecimal.ZERO) < 0) {
                     String formattedDateString = formatDateMinusOneMonth(item.getIncomeSigningTime());
                     if (StringUtils.isNotEmpty(formattedDateString)) {
-                        InsuranceHandlingSettlementMonthDto insuranceHandlingSettlementMonthDto = latestByTaskId.get(formattedDateString);
+                        InsuranceHandlingSettlementMonthDto insuranceHandlingSettlementMonthDto = latestByTaskId.get(item.getIncomeSigningTime());
                         insuranceHandlingSettlementMonthDto.setTotalAmount(insuranceHandlingSettlementMonthDto.getTotalAmount().add(item.getTotalAmount()));
                         latestByTaskId.remove(item.getIncomeSigningTime());
                         latestByTaskId.put(formattedDateString, insuranceHandlingSettlementMonthDto);

+ 45 - 0
src/main/java/com/ydtech/modules/fnc/timer/InsExcelTaskAsyncTimer.java

@@ -0,0 +1,45 @@
+package com.ydtech.modules.fnc.timer;
+
+import com.ydtech.modules.fnc.service.InsExcelTaskAsyncService;
+import com.ydtech.utils.DateUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 控制台导出任务 添加定时任务
+ */
+
+@Slf4j
+@Component
+public class InsExcelTaskAsyncTimer {
+
+    @Autowired
+    private InsExcelTaskAsyncService insExcelTaskAsyncService;
+
+
+    /**
+     *  @version
+     *  @author: whp
+     *  @Description: 任务中心的数据保留7天,7天后删除任务中心数据以及任务中心列表。
+     */
+    @Scheduled(cron = "0 0 0 * * *")
+    private void updateOrderDateNoon() {
+        //如果合同得失效日期有值如果过今天 超过失效日期则改为合同失效
+        log.info("定时删除控制台任务导出数据,启动时间:{}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+        String nowTime = DateUtil.getDateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");
+
+        try {
+            insExcelTaskAsyncService.batchDelete(nowTime);
+            log.info("定时删除控制台任务导出数据");
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("定时删除控制台任务导出数据失败:{}", e.getMessage());
+        }
+    }
+
+}

+ 6 - 0
src/main/java/com/ydtech/modules/ins/model/yc/ruote/response/VhlResponse.java

@@ -425,5 +425,11 @@ public class VhlResponse {
     @JacksonXmlProperty(localName = "CChdUbiData")
     private String CChdUbiData;
 
+    /**
+     * 睿控评分
+     */
+    @JacksonXmlProperty(localName = "CRkScore")
+    private String CRkScore;
+
 
 }

+ 16 - 1
src/main/java/com/ydtech/modules/order/controller/QrCodeController.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.order.controller;
 
 import cn.dev33.satoken.annotation.SaIgnore;
 import cn.hutool.core.collection.CollUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.constants.UserConstants;
@@ -11,7 +12,9 @@ import com.ydtech.modules.admin.service.SysQRCodeRelationService;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.inv.utils.LocalDateTimeUtils;
+import com.ydtech.modules.order.dao.InsAreaCompanyInfoMapper;
 import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsAreaCompanyInfo;
 import com.ydtech.modules.order.entity.InsOrderQrCode;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.vo.QrCodeVo;
@@ -80,17 +83,29 @@ public class QrCodeController {
     @Autowired
     private EsmInsCompanyService esmInsCompanyService;
 
+    @Autowired
+    private InsAreaCompanyInfoMapper insAreaCompanyInfoMapper;
+
     @GetMapping(value = "/getQrCode")
     @ApiOperation(value = "获取二维码")
     public ModelAndView getQrCode(String areaCompanyId) {
         InsOrderQrCode insOrderQrCode = insOrderQrCodeService.getOneOrSave(areaCompanyId);
+
         InsAreaCompany insAreaCompany = insAreaCompanyService.getById(areaCompanyId);
         Integer qrCodeType = sysQRCodeRelationService.getQRCodeType(insAreaCompany.getApiType(), insAreaCompany.getCompanyId(),
                 insAreaCompany.getInscompany());
         ModelAndView modelAndView = new ModelAndView(new MappingJackson2JsonView());
         if (!Objects.isNull(insOrderQrCode)) {
             InsOrders insOrders = insOrdersService.getById(insOrderQrCode.getOrderno());
-
+            //替换子订单的车辆人员信息
+            InsAreaCompanyInfo insAreaCompanyInfo = insAreaCompanyInfoMapper.selectOne(new LambdaQueryWrapper<InsAreaCompanyInfo>()
+                    .eq(InsAreaCompanyInfo::getSubOrderNo, areaCompanyId));
+            if(!Objects.isNull(insAreaCompanyInfo)){
+                insOrders.setCarinfo(JSON.parseObject(insAreaCompanyInfo.getCarInfo()));
+                insOrders.setOwnerinfo(JSON.parseObject(insAreaCompanyInfo.getOwnerInfo()));
+                insOrders.setApplyinfo(JSON.parseObject(insAreaCompanyInfo.getApplyInfo()));
+                insOrders.setInsureinfo(JSON.parseObject(insAreaCompanyInfo.getInsureInfo()));
+            }
             QrCodeVo qrCodeVo = new QrCodeVo();
             String qrCodeUrl = qrCodeGenAddress + "?areaCompanyId=" + areaCompanyId;
             qrCodeVo.setQrCodeUrl(qrCodeUrl);

+ 0 - 1
src/main/java/com/ydtech/modules/order/controller/QuoteController.java

@@ -261,7 +261,6 @@ public class QuoteController extends BaseController {
                 ygQuoteAccidentVo.setQuantityCasualty(jsonObject.getString("quantity"));
                 List<YgQuoteAccidentVo> javaObjectList = new ArrayList<>();
                 javaObjectList.add(ygQuoteAccidentVo);
-
                 quoteVo1.setAccidentalDrivingVo(javaObjectList);
             } else {
                 quoteVo1.setAccidentalDrivingVo(new ArrayList<>());

+ 38 - 0
src/main/java/com/ydtech/modules/order/dao/InsAreaCompanyInfoMapper.java

@@ -0,0 +1,38 @@
+package com.ydtech.modules.order.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ydtech.modules.admin.model.dto.*;
+import com.ydtech.modules.admin.model.report.company.*;
+import com.ydtech.modules.admin.model.report.opetationData.BusinessDataDto;
+import com.ydtech.modules.admin.model.report.opetationData.BusinessDataQueryDto;
+import com.ydtech.modules.admin.model.report.opetationData.QuotationCountDataDto;
+import com.ydtech.modules.admin.model.report.opetationData.QuotationCountQueryDto;
+import com.ydtech.modules.admin.model.vo.*;
+import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsAreaCompanyInfo;
+import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
+import com.ydtech.modules.order.entity.dto.SubOrderCountDTO;
+import com.ydtech.modules.order.entity.vo.OrderQueryVo;
+import com.ydtech.modules.order.entity.vo.RejectPageQueryVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @author Administrator
+ * @description 针对表【ins_area_company(报价渠道)】的数据库操作Mapper
+ * @createDate 2023-01-31 15:51:19
+ * @Entity generator.domain.InsAreaCompany
+ */
+public interface InsAreaCompanyInfoMapper extends BaseMapper<InsAreaCompanyInfo> {
+
+}
+
+
+
+

+ 15 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -606,6 +606,21 @@ public class InsAreaCompany implements Serializable {
     @TableField(exist = false)
     private String recorder;
 
+    /**
+     * 添加车辆 人员信息 25-01-18
+     */
+    @TableField(exist = false)
+    private String carInfo;
+
+    @TableField(exist = false)
+    private String ownerInfo;
+
+    @TableField(exist = false)
+    private String applyInfo;
+
+    @TableField(exist = false)
+    private String insureInfo;
+
     public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
         this.id = IdGenerate.nextId();
         this.orderno = quoteRespVo.getOrderno();

+ 7 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompanyAccidentalDriving.java

@@ -111,6 +111,13 @@ public class InsAreaCompanyAccidentalDriving implements Serializable {
             this.setRideRiskCode(jsonObject.getString("planCode"));
             this.setQuantity(1);
             this.setCompanyId(t.getCompanyId());
+        }else if(t.getCompanyId().equals("ZMBX1000000")){
+            //中煤财险
+            JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo()));
+            this.setRideRiskName(jsonObject.getString("rideRiskName"));
+            this.setRideRiskCode(jsonObject.getString("rideRiskCode"));
+            this.setQuantity(jsonObject.getInteger("quantity"));
+            this.setCompanyId(t.getCompanyId());
         }
     }
 }

+ 81 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompanyInfo.java

@@ -0,0 +1,81 @@
+package com.ydtech.modules.order.entity;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
+import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+import com.ydtech.utils.StringUtils;
+import com.ydtech.utils.idgen.IdGenerate;
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 报价渠道
+ *
+ * @TableName ins_area_company
+ */
+@TableName(value = "ins_area_company_info", autoResultMap = true)
+@Data
+@ApiModel(value = "报价信息管理")
+@NoArgsConstructor
+@AllArgsConstructor
+public class InsAreaCompanyInfo implements Serializable {
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = -6827009009645748787L;
+    /**
+     * 主键
+     */
+    @TableId(value = "sub_order_no")
+    private String subOrderNo;
+    /**
+     * 车辆信息
+     */
+    @TableField(value = "car_info")
+    private String carInfo;
+    /**
+     * 车主信息
+     */;
+    @TableField(value = "owner_info")
+    private String ownerInfo;
+    /**
+     * 投保人信息
+     */;
+
+    @TableField(value = "apply_info")
+    private String applyInfo;
+    /**
+     * 被保人信息
+     */
+    @TableField(value = "insure_info")
+    private String insureInfo;
+
+
+    /**
+     * 获取子订单的车辆 人员信息
+     * @param insAreaCompany
+     * @return
+     */
+    public InsAreaCompanyInfo(InsAreaCompany insAreaCompany) {
+        this.setSubOrderNo(insAreaCompany.getId());
+        this.setCarInfo(insAreaCompany.getCarInfo());
+        this.setOwnerInfo(insAreaCompany.getOwnerInfo());
+        this.setApplyInfo(insAreaCompany.getApplyInfo());
+        this.setInsureInfo(insAreaCompany.getInsureInfo());
+    }
+}
+

+ 4 - 4
src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java

@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springframework.util.ObjectUtils;
 
+import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import javax.validation.constraints.NotEmpty;
 import java.time.LocalDate;
@@ -25,7 +26,6 @@ public class OrderQueryVo {
     private String orderNo;
 
 
-
     @ApiModelProperty(value = "订单状态")
     private String orderStatus;
 
@@ -45,9 +45,9 @@ public class OrderQueryVo {
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private LocalDate endDate;
 
-    @ApiModelProperty(value = "每页数")
-    //@Min(value = 20, message = "页数最小为20")
-    //@Max(value = 100, message = "页数最大为100")
+    @ApiModelProperty(value = "每页数据大小")
+    @Min(value = 20, message = "页数最小为20")
+    @Max(value = 100, message = "页数最大为100")
     private int pageSize;
 
     @ApiModelProperty(value = "页数")

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

@@ -287,7 +287,7 @@ public interface InsOrdersService extends IService<InsOrders> {
      * 生成失败订单数据
      * @return
      */
-    String responseFailedOrder(BaseQuoteVo quoteVo, PtlAgreementAttribution ptlAgreementAttribution, InsOrders insOrder, String errorMessage, InsOrderStatusEnum statusEnum);
+    String responseFailedOrder(BaseQuoteVo quoteVo, BaseQuoteInfoVo quoteInfoVo, PtlAgreementAttribution ptlAgreementAttribution, InsOrders insOrder, String errorMessage, InsOrderStatusEnum statusEnum);
 
     String responseFailedOrder(String subOrderNo,BaseQuoteVo quoteVo, PtlAgreementAttribution ptlAgreementAttribution, InsOrders insOrder, String errorMessage, InsOrderStatusEnum statusEnum);
 

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

@@ -294,7 +294,7 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
             if(responseMsg.contains("重复投保")){
                 insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
             }
-            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, byId, responseMsg, insOrderStatusEnum);
+            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, byId, responseMsg, insOrderStatusEnum);
 
             //存储报价记录
             quoteRecords.forEach(item->{

+ 11 - 3
src/main/java/com/ydtech/modules/order/service/impl/ChengTaiOrderApiServiceImpl.java

@@ -147,7 +147,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
             {
                 insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
             }
-            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, insurePremiumResponse.getMessage(), insOrderStatusEnum);
+            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, order, insurePremiumResponse.getMessage(), insOrderStatusEnum);
             SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                     QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
             sysQuoteRecords.add(sysQuoteRecord);
@@ -180,7 +180,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
 
         // 设置核心报价车型
         quoteRespVo.setCoreModels(carModelListDTO.toCoreModelsVo());
-        HttpResult<QuoteRespVo> quoteRespVoHttpResult = responseOrder(insurePremiumResponse, quoteRespVo, ptlAgreementAttribution, insurePremiumResponse.getOrderId());
+        HttpResult<QuoteRespVo> quoteRespVoHttpResult = responseOrder(insurePremiumResponse, quoteRespVo, ptlAgreementAttribution, insurePremiumResponse.getOrderId(),quoteInfoVo);
         SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                 QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
         sysQuoteRecords.add(sysQuoteRecord);
@@ -397,9 +397,17 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
         });
     }
 
-    private HttpResult<QuoteRespVo> responseOrder(InsurePremiumResponse insurePremiumResponse, QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution, String orderId) {
+    private HttpResult<QuoteRespVo> responseOrder(InsurePremiumResponse insurePremiumResponse, QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution, String orderId,
+                                                  BaseQuoteInfoVo quoteInfoVo) {
         // 保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
+
+        // 子订单的车辆 人员信息存储
+        insAreaCompany.setCarInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getCarInfo())));
+        insAreaCompany.setOwnerInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getOwnerInfo())));
+        insAreaCompany.setApplyInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getPolicyHolderInfo())));
+        insAreaCompany.setInsureInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getInsuredPersonInfo())));
+
         // 协议id
         insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(insurePremiumResponse)));
         insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());

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

@@ -304,7 +304,7 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
                 if(odr1009Response.getResult().getJqAppStatusMessage().toString().contains("重复投保")) {
                     orderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
                 }
-                String subOrderNo = insOrdersService.responseFailedOrder(t, ptlAgreementAttribution, insOrders, errorMessage, orderStatusEnum);
+                String subOrderNo = insOrdersService.responseFailedOrder(t,quoteInfoVo, ptlAgreementAttribution, insOrders, errorMessage, orderStatusEnum);
 
                 if (Message.M0003.getCode().equals(odr1009Response.getStatus())) {
                     return HttpResult.error("报价失败,原因:" + odr1009Response.getMessage());
@@ -432,6 +432,13 @@ public class DaJiaOrderServiceImpl implements DaJiaOrderService {
     public HttpResult<QuoteRespVo> responseOrder(ODR1009Response odr1009Response, QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution, String orderId, BaseQuoteInfoVo quoteInfoVo, String busiId, NVHLODR1001Response nvhlodr1001Response, InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving) {
         // 保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
+
+        // 子订单的车辆 人员信息存储
+        insAreaCompany.setCarInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getCarInfo())));
+        insAreaCompany.setOwnerInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getOwnerInfo())));
+        insAreaCompany.setApplyInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getPolicyHolderInfo())));
+        insAreaCompany.setInsureInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getInsuredPersonInfo())));
+
         // 协议id
         //子订单id
         String companyId = IdGenerate.nextId();

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

@@ -293,7 +293,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
                 insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
             }
             PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(quoteVo.getAgreementId());
-            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, resp.getResultMsg(), insOrderStatusEnum);
+            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,yaQuoteInfoVo, ptlAgreementAttribution, order, resp.getResultMsg(), insOrderStatusEnum);
             SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(yaQuoteInfoVo.getUserid(),quoteVo.getCompanyId(),yaQuoteInfoVo.getCarInfo().getLicenseNo(),
                     QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
             sysQuoteRecords.add(sysQuoteRecord);

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

@@ -164,7 +164,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
         if (!"0".equals(quotedPriceResponse.getHead().getReturnCode())) {
             log.error(quotedPriceResponse.getHead().getReturnMessage());
             InsOrders order = insOrdersService.getById(quoteInfo.getOrderNo());
-            String subOrderNo = insOrdersService.responseFailedOrder(zmQuoteVo,ptlAgreementAttribution, order,quotedPriceResponse.getHead().getReturnMessage(),InsOrderStatusEnum.QUOTE_FAILED);
+            String subOrderNo = insOrdersService.responseFailedOrder(zmQuoteVo, quoteInfo, ptlAgreementAttribution, order,quotedPriceResponse.getHead().getReturnMessage(),InsOrderStatusEnum.QUOTE_FAILED);
             SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(quoteInfo.getUserid(),zmQuoteVo.getCompanyId() ,quoteInfo.getCarInfo().getLicenseNo(),
                     QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
             sysQuoteRecords.add(sysQuoteRecord);
@@ -636,6 +636,13 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
                                                   PtlAgreementAttribution ptlAgreementAttribution, BaseQuoteInfoVo quoteInfo) {
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
+
+        // 子订单的车辆 人员信息存储
+        insAreaCompany.setCarInfo(JSON.toJSONString(JSON.toJSONString(quoteInfo.getCarInfo())));
+        insAreaCompany.setOwnerInfo(JSON.toJSONString(JSON.toJSONString(quoteInfo.getOwnerInfo())));
+        insAreaCompany.setApplyInfo(JSON.toJSONString(JSON.toJSONString(quoteInfo.getPolicyHolderInfo())));
+        insAreaCompany.setInsureInfo(JSON.toJSONString(JSON.toJSONString(quoteInfo.getInsuredPersonInfo())));
+
         //华泰没有总订单号,使用自定义订单号
         String orderNo = IdGenerate.nextId();
         insAreaCompany.setId(orderNo);

+ 25 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -27,6 +27,7 @@ import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.message.constants.MessageTypeConstants;
 import com.ydtech.modules.message.service.MessageSecretaryService;
 import com.ydtech.modules.order.constants.OrderFeeAuditHistroy;
+import com.ydtech.modules.order.dao.InsAreaCompanyInfoMapper;
 import com.ydtech.modules.order.dao.InsAreaCompanyMapper;
 import com.ydtech.modules.order.dao.InsOrdersMapper;
 import com.ydtech.modules.order.entity.*;
@@ -111,6 +112,9 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
     @Autowired
     private SysUserService sysUserService;
 
+    @Autowired
+    private InsAreaCompanyInfoMapper insAreaCompanyInfoMapper;
+
     public InsAreaCompanyServiceImpl(@Lazy InsOrdersService insOrdersService, InsOrdersTrackService insOrdersTrackService, SysDeptService sysDeptService) {
         this.insOrdersService = insOrdersService;
         this.insOrdersTrackService = insOrdersTrackService;
@@ -179,6 +183,7 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
     }
 
     @Override
+    @Transactional
     public String insertCompanyAndOrders(InsAreaCompany insAreaCompany, InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving) {
         //add by hxl   解决部分数据更新不了险种信息
         insAreaCompany = updateEntityPruductAndPruductid(insAreaCompany);
@@ -189,7 +194,12 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
                 insAreaCompany.getSyStartDate(), insAreaCompany.getSyEndDate(), insAreaCompany);
         String subOrderNo = IdGenerate.nextId();
         insAreaCompany.setId(subOrderNo);
+
         baseMapper.insert(insAreaCompany);
+
+        //保存 车辆人员信息
+        InsAreaCompanyInfo insAreaCompanyInfo = new InsAreaCompanyInfo(insAreaCompany);
+        insAreaCompanyInfoMapper.insert(insAreaCompanyInfo);
         //保存驾意险信息
 
         final InsAreaCompany finalInsAreaCompany = insAreaCompany;
@@ -210,14 +220,17 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
     public String insertCompanyAndOrders(String subOrderNo, InsAreaCompany insAreaCompany, InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving) {
         insAreaCompany = updateEntityPruductAndPruductid(insAreaCompany);
 
-
         //更新主订单的投保时间
         insOrdersService.updateOrderStartingInsruanceTime(insAreaCompany.getOrderno(), insAreaCompany.getJqStartDate(), insAreaCompany.getJqEndDate(),
                 insAreaCompany.getSyStartDate(), insAreaCompany.getSyEndDate(), insAreaCompany);
         insAreaCompany.setId(subOrderNo);
         baseMapper.insert(insAreaCompany);
-        //保存驾意险信息
 
+        //保存 车辆人员信息
+        InsAreaCompanyInfo insAreaCompanyInfo = new InsAreaCompanyInfo(insAreaCompany);
+        insAreaCompanyInfoMapper.insert(insAreaCompanyInfo);
+
+        //保存驾意险信息
         final InsAreaCompany finalInsAreaCompany = insAreaCompany;
         Optional.ofNullable(insAreaCompanyAccidentalDriving)
                 .filter(x -> StringUtils.isNotEmpty(x.getRideRiskName()) && !ObjectUtils.isEmpty(x.getQuantity()))
@@ -243,6 +256,11 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
                 insAreaCompany.getSyStartDate(), insAreaCompany.getSyEndDate(), insAreaCompany);
 
         baseMapper.insert(insAreaCompany);
+
+        //保存 车辆人员信息
+        InsAreaCompanyInfo insAreaCompanyInfo = new InsAreaCompanyInfo(insAreaCompany);
+        insAreaCompanyInfoMapper.insert(insAreaCompanyInfo);
+
         //保存驾意险信息
         InsAreaCompany finalInsAreaCompany = insAreaCompany;
         insAreaCompanyAccidentalDriving.forEach(item -> {
@@ -261,6 +279,11 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
     public void insertCompanyAndOrders(InsAreaCompany insAreaCompany) {
         //add by hxl   解决部分数据更新不了险种信息
         insAreaCompany = updateEntityPruductAndPruductid(insAreaCompany);
+
+        //存储 车辆  人员信息
+        InsAreaCompanyInfo insAreaCompanyInfo = new InsAreaCompanyInfo(insAreaCompany);
+        insAreaCompanyInfoMapper.insert(insAreaCompanyInfo);
+
         baseMapper.insert(insAreaCompany);
         insOrdersTrackService.addingTrajectories(insAreaCompany);
         insOrdersService.updateByOrderStatus(insAreaCompany);

+ 9 - 3
src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java

@@ -157,7 +157,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             if(response.getMessage().contains("重复投保")){
                 insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
             }
-            String subOrderNo = insOrdersService.responseFailedOrder(t, ptlAgreementAttribution, order, response.getMessage(), insOrderStatusEnum);
+            String subOrderNo = insOrdersService.responseFailedOrder(t,quoteInfoVo, ptlAgreementAttribution, order, response.getMessage(), insOrderStatusEnum);
             if(!Objects.isNull(response.getOther().getMaxQuoteNum())) {
                 int quoteNum = maxQuoteNum - Integer.parseInt(response.getOther().getMaxQuoteNum());
                 for (int i = 0; i < quoteNum; i++) {
@@ -203,7 +203,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         }
 
         //处理订单信息
-        QuoteRespVo responseVo = responseOrder(response, quoteRespVo, ptlAgreementAttribution, insAreaCompanyAccidentalDriving);
+        QuoteRespVo responseVo = responseOrder(response, quoteRespVo, ptlAgreementAttribution, insAreaCompanyAccidentalDriving,quoteInfoVo);
         if(!Objects.isNull(response.getOther().getMaxQuoteNum())) {
             int quoteNum = maxQuoteNum - Integer.parseInt(response.getOther().getMaxQuoteNum());
             for (int i = 0; i < quoteNum; i++) {
@@ -501,9 +501,15 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
 
     private QuoteRespVo responseOrder(CrawlerQuoteResponse response, QuoteRespVo quoteRespVo,
                                       PtlAgreementAttribution ptlAgreementAttribution,
-                                      InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving) {
+                                      InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving,
+                                      BaseQuoteInfoVo quoteInfoVo) {
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
+//在修改中
+        insAreaCompany.setCarInfo(JSON.toJSONString(quoteInfoVo.getCarInfo()));
+        insAreaCompany.setOwnerInfo(JSON.toJSONString(quoteInfoVo.getOwnerInfo()));
+        insAreaCompany.setApplyInfo(JSON.toJSONString(quoteInfoVo.getPolicyHolderInfo()));
+        insAreaCompany.setInsureInfo(JSON.toJSONString(quoteInfoVo.getInsuredPersonInfo()));
 
         insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(quoteRespVo.getTaxArrears())));
 

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

@@ -50,6 +50,7 @@ import com.ydtech.modules.inv.utils.EasyExcelUtils;
 import com.ydtech.modules.order.constants.BusinessConstant;
 import com.ydtech.modules.order.constants.JqInsuranceType;
 import com.ydtech.modules.order.constants.OrderLinkTypeConstants;
+import com.ydtech.modules.order.dao.InsAreaCompanyInfoMapper;
 import com.ydtech.modules.order.dao.InsOrdersMapper;
 import com.ydtech.modules.order.entity.*;
 import com.ydtech.modules.order.entity.crawler.response.CrawlerVerifyPaymentResponse;
@@ -205,6 +206,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     @Resource
     private  SysUserLinkCompanyMapper sysUserLinkCompanyMapper;
 
+    @Autowired
+    private InsAreaCompanyInfoMapper insAreaCompanyInfoMapper;
+
 
     public InsOrdersServiceImpl(OrderComponents orderComponents, SysUserService sysUserService,
                                 SysUserRoleService sysUserRoleService,
@@ -673,7 +677,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         page.setSearchCount(false).setOptimizeCountSql(false);//关闭count查询
         boolean adminFalg = false;
         //修改逻辑   add by  hxl   修改查询当前登陆人的订单   admin 可以查看所有
-        if ("admin".equals(orderQueryVo.getUserId())) {
+        String userId = BaseController.getUserId();
+        if ("admin".equals(userId)) {
             adminFalg = true;
         }
         /**
@@ -890,6 +895,15 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     @Override
     public HttpResult<OrderVo> getByCompanyId(@NotBlank(message = "子订单不能为空") String companyId, String userId) {
         OrderVo orderAndAreaCompany = baseMapper.getOrderAndAreaCompany(companyId);
+        //查询子订单的数据是否存在
+        InsAreaCompanyInfo insAreaCompanyInfo = insAreaCompanyInfoMapper.selectOne(new LambdaQueryWrapper<InsAreaCompanyInfo>()
+                .eq(InsAreaCompanyInfo::getSubOrderNo, companyId));
+        if(!Objects.isNull(insAreaCompanyInfo)){
+            orderAndAreaCompany.setCarinfo(JSON.parseObject(insAreaCompanyInfo.getCarInfo()));
+            orderAndAreaCompany.setOwnerinfo(JSON.parseObject(insAreaCompanyInfo.getOwnerInfo()));
+            orderAndAreaCompany.setApplyinfo(JSON.parseObject(insAreaCompanyInfo.getApplyInfo()));
+            orderAndAreaCompany.setInsureinfo(JSON.parseObject(insAreaCompanyInfo.getInsureInfo()));
+        }
         //团队归属信息
         List<SysArea> sysAreas = sysDeptService.getListQueryBelongArea(orderAndAreaCompany.getDeptid());
         SysDept sysUserDept = sysDeptService.getById(orderAndAreaCompany.getDeptid());
@@ -1535,7 +1549,23 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     @Override
     public BasePageResult<InsOrders> queryPageOrderByLinkType(OrderQueryVo orderQueryVo, int type) {
         //添加收回按钮的操作
-
+        //优化查询效率   add by hxl  2025-01-25
+        if(StringUtils.isNotBlank(orderQueryVo.getQuoteStartDateStr()) && StringUtils.isNotBlank(orderQueryVo.getQuoteEndDateStr())){
+            if(orderQueryVo.getQuoteStartDateStr().length()==10){
+                orderQueryVo.setQuoteStartDateStr(orderQueryVo.getQuoteStartDateStr()+" 00:00:00");
+            }
+            if(orderQueryVo.getQuoteEndDateStr().length()==10){
+                orderQueryVo.setQuoteEndDateStr(orderQueryVo.getQuoteEndDateStr()+" 23:59:59");
+            }
+        }
+        if(StringUtils.isNotBlank(orderQueryVo.getSignStartDateStr()) && StringUtils.isNotBlank(orderQueryVo.getSignEndDateStr())){
+            if(orderQueryVo.getSignStartDateStr().length()==10){
+                orderQueryVo.setSignStartDateStr(orderQueryVo.getSignStartDateStr()+" 00:00:00");
+            }
+            if(orderQueryVo.getSignEndDateStr().length()==10){
+                orderQueryVo.setSignEndDateStr(orderQueryVo.getSignEndDateStr()+" 23:59:59");
+            }
+        }
         Boolean flag = false;
         Page<InsOrders> page = new Page<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize());
         page.setSearchCount(false).setOptimizeCountSql(false);//关闭count查询
@@ -2335,7 +2365,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     }
 
     @Override
-    public String responseFailedOrder(BaseQuoteVo quoteVo, PtlAgreementAttribution ptlAgreementAttribution, InsOrders insOrder, String errorMessage, InsOrderStatusEnum statusEnum) {
+    public String responseFailedOrder(BaseQuoteVo quoteVo,BaseQuoteInfoVo baseQuoteInfoVo, PtlAgreementAttribution ptlAgreementAttribution, InsOrders insOrder, String errorMessage, InsOrderStatusEnum statusEnum) {
 
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany();
@@ -2353,6 +2383,11 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         insAreaCompany.setSyStartDate(insOrder.getSystartdate());
         insAreaCompany.setSyEndDate(insOrder.getSyenddate());
 
+        insAreaCompany.setCarInfo(JSON.toJSONString(baseQuoteInfoVo.getCarInfo()));
+        insAreaCompany.setOwnerInfo(JSON.toJSONString(baseQuoteInfoVo.getOwnerInfo()));
+        insAreaCompany.setApplyInfo(JSON.toJSONString(baseQuoteInfoVo.getPolicyHolderInfo()));
+        insAreaCompany.setInsureInfo(JSON.toJSONString(baseQuoteInfoVo.getInsuredPersonInfo()));
+
         if (CollUtil.isEmpty(quoteVo.getRisks())) {
             insAreaCompany.setRiskinfo(new JSONArray());
         } else {
@@ -2491,36 +2526,52 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
         String quoteStartDateStr = orderQueryVo.getQuoteStartDateStr();
         String quoteEndDateStr = orderQueryVo.getQuoteEndDateStr();
-
         final int day = 30;
         if("3".equals(orderQueryVo.getOrderStatus())){
-            if((StringUtils.isEmpty(signStartDateStr) || StringUtils.isEmpty(signEndDateStr))) {
+            if ((StringUtils.isEmpty(signStartDateStr) || StringUtils.isEmpty(signEndDateStr)) && StringUtils.isEmpty(quoteStartDateStr)) {
                 throw new SystemException("导出已承保数据时,1.签单时间必填;2.选择的签单时间(开始日期-结束日期)>30天,导出时,按结束时间往前+30天的数据做导出");
+            }else if ((StringUtils.isEmpty(quoteStartDateStr) || StringUtils.isEmpty(quoteEndDateStr))  &&  StringUtils.isEmpty(signStartDateStr) ){
+                throw new SystemException("导出已承保数据时,1.录单时间必填;2.选择的录单时间(开始日期-结束日期)>30天,导出时,按结束时间往前+30天的数据做导出");
+            }
+            if(StringUtils.isNotEmpty(signStartDateStr)){
+              String time =this.getTimeDate(signStartDateStr,signEndDateStr,day);
+              if(StringUtils.isNotEmpty(time)){
+                  orderQueryVo.setSignStartDateStr(time);
+              }
             }
-            DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-            LocalDate startDate = LocalDate.parse(signStartDateStr, pattern);
-            LocalDate endDate = LocalDate.parse(signEndDateStr, pattern);
-            long between = ChronoUnit.DAYS.between(startDate, endDate);
-            if (between > day) {
-                LocalDate localDate = endDate.minusDays(day);
-                orderQueryVo.setSignStartDateStr(localDate.format(pattern));
+            if(StringUtils.isNotEmpty(quoteStartDateStr)){
+                String time =this.getTimeDate(quoteStartDateStr,quoteEndDateStr,day);
+                if(StringUtils.isNotEmpty(time)){
+                    orderQueryVo.setQuoteStartDateStr(time);
+                }
             }
+
+//            DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+//            LocalDate startDate = LocalDate.parse(signStartDateStr, pattern);
+//            LocalDate endDate = LocalDate.parse(signEndDateStr, pattern);
+//            long between = ChronoUnit.DAYS.between(startDate, endDate);
+//            if (between > day) {
+//                LocalDate localDate = endDate.minusDays(day);
+//                orderQueryVo.setSignStartDateStr(localDate.format(pattern));
+//            }
         }else{
             if((StringUtils.isEmpty(quoteStartDateStr) || StringUtils.isEmpty(quoteEndDateStr))) {
                 throw new SystemException("导出非已承保数据时,1.录单时间必填;2.选择的录单时间(开始日期-结束日期)>30天,导出时,按结束时间往前+30天的数据做导出");
             }
-            DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-            LocalDate startDate = LocalDate.parse(quoteStartDateStr, pattern);
-            LocalDate endDate = LocalDate.parse(quoteEndDateStr, pattern);
-            long between = ChronoUnit.DAYS.between(startDate, endDate);
-            if (between > day) {
-                LocalDate localDate = endDate.minusDays(day);
-                orderQueryVo.setQuoteStartDateStr(localDate.format(pattern));
+
+            String time = this.getTimeDate(quoteStartDateStr, quoteEndDateStr, day);
+            if (StringUtils.isNotEmpty(time)) {
+                orderQueryVo.setQuoteStartDateStr(time);
             }
+//            DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+//            LocalDate startDate = LocalDate.parse(quoteStartDateStr, pattern);
+//            LocalDate endDate = LocalDate.parse(quoteEndDateStr, pattern);
+//            long between = ChronoUnit.DAYS.between(startDate, endDate);
+//            if (between > day) {
+//                LocalDate localDate = endDate.minusDays(day);
+//                orderQueryVo.setQuoteStartDateStr(localDate.format(pattern));
+//            }
         }
-
-
-
         switch (orderLinkTypeConstants) {
             case ORDER_LINK_TYPE_CONSTANTS_1:
                 agentUserIds = sysUserService.getUserIdsByLeaderId(orderQueryVo.getUserId());
@@ -2558,5 +2609,18 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         throw new SystemException("文件导出失败");
     }
 
+    private String getTimeDate(String startDateStr, String endDateStr, int day) {
+        DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        LocalDate startDate = LocalDate.parse(startDateStr, pattern);
+        LocalDate endDate = LocalDate.parse(endDateStr, pattern);
+        long between = ChronoUnit.DAYS.between(startDate, endDate);
+        if (between > day) {
+            LocalDate localDate = endDate.minusDays(day);
+            return localDate.format(pattern);
+        } else {
+            return null;
+        }
+    }
+
 
 }

+ 19 - 11
src/main/java/com/ydtech/modules/order/service/impl/YangGuangOrderApiServiceImpl.java

@@ -191,7 +191,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                             if (yangGuangAccuracyCalculateResponse1.getErrorMessage().contains("重复投保")) {
                             insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
                             }
-                            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse1.getErrorMessage(), insOrderStatusEnum);
+                            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse1.getErrorMessage(), insOrderStatusEnum);
                             SysQuoteRecord sysQuoteRecord2 = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                                     QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
                             sysQuoteRecords.add(sysQuoteRecord2);
@@ -211,7 +211,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                         // 设置核心报价车型
                         quoteRespVo.setCoreModels(carModelList1.toCoreModelsVo());
                         HttpResult<QuoteRespVo> quoteRespVoHttpResult = responseOrder(yangGuangAccuracyCalculateResponse1, quoteRespVo, ptlAgreementAttribution, quoteInfoVo.getOrderNo(),
-                                quoteVo.getAccidentalDrivingVo());
+                                quoteVo.getAccidentalDrivingVo(),quoteInfoVo);
 
                         SysQuoteRecord sysQuoteRecord3 = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                                 QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
@@ -229,7 +229,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                         if (yangGuangAccuracyCalculateResponseRe.getErrorMessage().contains("重复投保")) {
                             insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
                         }
-                        String subOrderNo = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse.getErrorMessage(), insOrderStatusEnum);
+                        String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse.getErrorMessage(), insOrderStatusEnum);
                         SysQuoteRecord sysQuoteRecord2 = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                                 QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
                         sysQuoteRecords.add(sysQuoteRecord2);
@@ -252,7 +252,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                         if (yangGuangAccuracyCalculateResponseRe.getErrorMessage().contains("重复投保")) {
                         insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
                         }
-                        String subOrderNo = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponseRe.getErrorMessage(), insOrderStatusEnum);
+                        String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponseRe.getErrorMessage(), insOrderStatusEnum);
                         SysQuoteRecord sysQuoteRecord2 = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                                 QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
                         sysQuoteRecords.add(sysQuoteRecord2);
@@ -272,7 +272,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                 // 设置核心报价车型
                 quoteRespVo.setCoreModels(carModelList1.toCoreModelsVo());
                 return responseOrder(yangGuangAccuracyCalculateResponseRe, quoteRespVo, ptlAgreementAttribution, quoteInfoVo.getOrderNo(),
-                        quoteVo.getAccidentalDrivingVo());
+                        quoteVo.getAccidentalDrivingVo(),quoteInfoVo);
             }
         }
         // 单商 交三 交商 需要获取车辆actualValue 进行二次报价
@@ -291,7 +291,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                     if (yangGuangAccuracyCalculateResponse1.getErrorMessage().contains("重复投保")) {
                         insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
                     }
-                    String s = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse1.getErrorMessage(), insOrderStatusEnum);
+                    String s = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse1.getErrorMessage(), insOrderStatusEnum);
                     SysQuoteRecord sysQuoteRecord2 = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                             QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
                     sysQuoteRecords.add(sysQuoteRecord2);
@@ -312,7 +312,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                 // 设置核心报价车型
                 quoteRespVo.setCoreModels(carModelList1.toCoreModelsVo());
                 HttpResult<QuoteRespVo> quoteRespVoHttpResult = responseOrder(yangGuangAccuracyCalculateResponse1, quoteRespVo, ptlAgreementAttribution, quoteInfoVo.getOrderNo(),
-                        quoteVo.getAccidentalDrivingVo());
+                        quoteVo.getAccidentalDrivingVo(),quoteInfoVo);
                 SysQuoteRecord sysQuoteRecord3 = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                         QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
                 sysQuoteRecords.add(sysQuoteRecord3);
@@ -329,7 +329,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                 if (yangGuangAccuracyCalculateResponse.getErrorMessage().contains("重复投保")) {
                     insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
                 }
-                String s = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse.getErrorMessage(), insOrderStatusEnum);
+                String s = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse.getErrorMessage(), insOrderStatusEnum);
                 SysQuoteRecord sysQuoteRecord2 = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                         QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
                 sysQuoteRecords.add(sysQuoteRecord2);
@@ -353,7 +353,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                 if (yangGuangAccuracyCalculateResponse.getErrorMessage().contains("重复投保")) {
                     insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
                 }
-                String s = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse.getErrorMessage(), insOrderStatusEnum);
+                String s = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, order, yangGuangAccuracyCalculateResponse.getErrorMessage(), insOrderStatusEnum);
                 SysQuoteRecord sysQuoteRecord2 = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                         QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
                 sysQuoteRecords.add(sysQuoteRecord2);
@@ -373,7 +373,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
             // 设置核心报价车型
             quoteRespVo.setCoreModels(carModelList1.toCoreModelsVo());
             HttpResult<QuoteRespVo> quoteRespVoHttpResult = responseOrder(yangGuangAccuracyCalculateResponse, quoteRespVo, ptlAgreementAttribution, quoteInfoVo.getOrderNo(),
-                    quoteVo.getAccidentalDrivingVo());
+                    quoteVo.getAccidentalDrivingVo(),quoteInfoVo);
             SysQuoteRecord sysQuoteRecord3 = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                     QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
             sysQuoteRecords.add(sysQuoteRecord3);
@@ -970,9 +970,17 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                                                  QuoteRespVo quoteRespVo,
                                                  PtlAgreementAttribution ptlAgreementAttribution,
                                                  String orderId,
-                                                 List<YgQuoteAccidentVo> accidentalDrivingVo) {
+                                                 List<YgQuoteAccidentVo> accidentalDrivingVo,
+                                                 BaseQuoteInfoVo quoteInfoVo) {
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
+
+        // 子订单的车辆 人员信息存储
+        insAreaCompany.setCarInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getCarInfo())));
+        insAreaCompany.setOwnerInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getOwnerInfo())));
+        insAreaCompany.setApplyInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getPolicyHolderInfo())));
+        insAreaCompany.setInsureInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getInsuredPersonInfo())));
+
         //协议id
         insAreaCompany.setOrderno(orderId);
         insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(yangGuangAccuracyCalculateResponse)));

+ 12 - 4
src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -101,6 +101,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.math.BigInteger;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
@@ -490,7 +491,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
         List<SysQuoteRecord> sysQuoteRecords = new ArrayList<>();
 
-        BigDecimal negotiatedPrice = null; // 协商价
+        BigDecimal negotiatedPrice = BigDecimal.ZERO; // 协商价
         //接口调用前提条件:
         //旧车,0326/0364, 10座以下非营业个人客车业务”才调该接口查询协商价浮动比例
         //协商价 = 折旧价*返回的协商价浮动比例
@@ -550,7 +551,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
             }
 
             PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(quoteVo.getAgreementId());
-            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,ptlAgreementAttribution, order,rr.getHead().getErrorMessage(),insOrderStatusEnum);
+            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,yaQuoteInfoVo,ptlAgreementAttribution, order,rr.getHead().getErrorMessage(),insOrderStatusEnum);
             SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(yaQuoteInfoVo.getUserid(),quoteVo.getCompanyId(),yaQuoteInfoVo.getCarInfo().getLicenseNo(),
                     QuoteNumberConstant.QuoteAction.QUOTE_FAILED.getCode().toString(),QuoteNumberConstant.QuoteResult.FAIL.getCode().toString());
             sysQuoteRecords.add(sysQuoteRecord);
@@ -567,7 +568,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
         QuoteRespVo quoteRespVo = YcBuildData.buildQuoteRespVo(order, rr, yaQuoteInfoVo);
         //8 生成订单
-        InsAreaCompany iac = responseOrder(order, quoteRespVo, rr, quoteVo);
+        InsAreaCompany iac = responseOrder(order, quoteRespVo, rr, quoteVo,yaQuoteInfoVo);
 
         SysQuoteRecord sysQuoteRecord = new SysQuoteRecord(yaQuoteInfoVo.getUserid(),quoteVo.getCompanyId(),yaQuoteInfoVo.getCarInfo().getLicenseNo(),
                 QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
@@ -1276,6 +1277,8 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         redisKey.append(accidentalDrivingVo.getCompanyCode());
         redisKey.append(accidentalDrivingVo.getSeatNum());
         redisKey.append(accidentalDrivingVo.getCode());
+        redisKey.append(accidentalDrivingVo.getCUsageCde());
+        redisKey.append(accidentalDrivingVo.getCProdNo());
 
         //查询redis
         if (!Objects.isNull(redisTemplate.opsForValue().get(redisKey.toString()))) {
@@ -1428,7 +1431,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
      * @author: lig
      * @date: 2023年02月16日 0016
      */
-    private InsAreaCompany responseOrder(InsOrders insOrder, QuoteRespVo quoteRespVo, RuoteResponse responseData, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
+    private InsAreaCompany responseOrder(InsOrders insOrder, QuoteRespVo quoteRespVo, RuoteResponse responseData, BaseQuoteVo<AccidentalDrivingVo> quoteVo,BaseQuoteInfoVo quoteInfoVo) {
 
         //交强保费 含税
         double jqPremium = StringUtils.toDouble(responseData.getBase().getNBefTaxPrmJQ()) + StringUtils.toDouble(responseData.getBase().getNAppTaxAmtJQ());
@@ -1469,6 +1472,11 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         insAreaCompany.setSyStartDate(responseData.getBase().getTInsrncBgnTmSY());
         insAreaCompany.setSyEndDate(responseData.getBase().getTInsrncEndTmSY());
 
+        insAreaCompany.setCarInfo(JSON.toJSONString(quoteInfoVo.getCarInfo()));
+        insAreaCompany.setOwnerInfo(JSON.toJSONString(quoteInfoVo.getOwnerInfo()));
+        insAreaCompany.setApplyInfo(JSON.toJSONString(quoteInfoVo.getPolicyHolderInfo()));
+        insAreaCompany.setInsureInfo(JSON.toJSONString(quoteInfoVo.getInsuredPersonInfo()));
+
         if (CollUtil.isEmpty(quoteRespVo.getRiskList())) {
             insAreaCompany.setRiskinfo(new JSONArray());
         } else {

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

@@ -638,6 +638,13 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
         insAreaCompany.setId(quotedPriceResponse.getBusinessNo());
         insAreaCompany.setInsOrderNo(quotedPriceResponse.getBusinessNo());
+
+        // 子订单的车辆 人员信息存储
+        insAreaCompany.setCarInfo(JSON.toJSONString(JSON.toJSONString(quoteInfo.getCarInfo())));
+        insAreaCompany.setOwnerInfo(JSON.toJSONString(JSON.toJSONString(quoteInfo.getOwnerInfo())));
+        insAreaCompany.setApplyInfo(JSON.toJSONString(JSON.toJSONString(quoteInfo.getPolicyHolderInfo())));
+        insAreaCompany.setInsureInfo(JSON.toJSONString(JSON.toJSONString(quoteInfo.getInsuredPersonInfo())));
+
         // 车船税
         double prePayTax = quotedPriceResponse.getTaxinfo() != null ? quotedPriceResponse.getTaxinfo().getPrePayTax() : 0;
         double delayPayTax = quotedPriceResponse.getTaxinfo() != null ? quotedPriceResponse.getTaxinfo().getDelayPayTax() : 0;

+ 10 - 3
src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java

@@ -169,7 +169,7 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
             {
                 insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
             }
-            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo, ptlAgreementAttribution, order, calculatePremiumResponse.getRtnMsg(), insOrderStatusEnum);
+            String subOrderNo = insOrdersService.responseFailedOrder(quoteVo,quoteInfoVo, ptlAgreementAttribution, order, calculatePremiumResponse.getRtnMsg(), insOrderStatusEnum);
             SysQuoteRecord deplSysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                     QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
             sysQuoteRecords.add(deplSysQuoteRecord);
@@ -193,7 +193,7 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
         // 设置核心报价车型
         quoteRespVo.setCoreModels(vehicleModelInfosDTO.toCoreModelsVo());
         HttpResult<QuoteRespVo> quoteRespVoHttpResult = responseOrder(calculatePremiumResponse, quoteRespVo, ptlAgreementAttribution, calculatePremiumRequest.getOrderId(),
-                calculatePremiumRequest.getOrderNo(), quoteVo.getAccidentalDrivingVo());
+                calculatePremiumRequest.getOrderNo(), quoteVo.getAccidentalDrivingVo(),quoteInfoVo);
         SysQuoteRecord deplSysQuoteRecord = new SysQuoteRecord(quoteInfoVo.getUserid(),quoteVo.getCompanyId(),quoteInfoVo.getCarInfo().getLicenseNo(),
                 QuoteNumberConstant.QuoteAction.QUOTE_SUCCESS.getCode().toString(),QuoteNumberConstant.QuoteResult.SUCCESS.getCode().toString());
         sysQuoteRecords.add(deplSysQuoteRecord);
@@ -635,7 +635,7 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
 
     public HttpResult<QuoteRespVo> responseOrder(CalculatePremiumResponse calculatePremiumResponse, QuoteRespVo quoteRespVo,
                                                  PtlAgreementAttribution ptlAgreementAttribution, String orderId, String orderNo,
-                                                 List<ZjQuoteAccidentVo> accidentalDrivingVo) {
+                                                 List<ZjQuoteAccidentVo> accidentalDrivingVo,BaseQuoteInfoVo quoteInfoVo) {
         // 保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
         // 协议id
@@ -643,6 +643,13 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
         insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(calculatePremiumResponse)));
         insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
         insAreaCompany.setInsOrderNo(orderId);
+
+        // 子订单的车辆 人员信息存储
+        insAreaCompany.setCarInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getCarInfo())));
+        insAreaCompany.setOwnerInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getOwnerInfo())));
+        insAreaCompany.setApplyInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getPolicyHolderInfo())));
+        insAreaCompany.setInsureInfo(JSON.toJSONString(JSON.toJSONString(quoteInfoVo.getInsuredPersonInfo())));
+
         // 车船税
         CalculatePremiumResponse.CarShipTaxDTO carShipTax = calculatePremiumResponse.getCarShipTax();
         TaxArrears taxArrears = new TaxArrears("往年欠税", Double.parseDouble(carShipTax.getPreviousPay()),

+ 1 - 2
src/main/resources/mapper/modules/admin/CompanyDataReport.xml

@@ -128,8 +128,7 @@
         left join ins_orders io on io.orderno = iac.orderno
         LEFT JOIN sys_user su on io.userid=su.id
             <where>
-                io.orderstatus = '3'
-                and iac.orderstatus = '3'
+                 iac.orderstatus = '3'
                 and io.licenseno is not null
                 <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
                     AND io.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}

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

@@ -28,7 +28,6 @@
         LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno
         WHERE
         iac.orderstatus = '3'
-        AND io.orderstatus = '3'
         GROUP BY
         io.deptid
         ) b ON b.deptId = sd.id

+ 4 - 3
src/main/resources/mapper/modules/console/ProfitAnalysisMapper.xml

@@ -401,8 +401,8 @@
         io.ins_company,
         io.product,
         eic.namesimple,
-        iac.jqapplyno,
-        iac.syapplyno,
+        iac.jqpolicyno,
+        iac.sypolicyno,
         iac.cross_insurance,
         iac.jqpremium,
         iac.sypremium,
@@ -443,13 +443,14 @@
             ifa.auditstatus = '1'
             AND
             iac.orderstatus = 3
-            AND io.orderstatus = '3'
             <if test="vo.year !=null  and  vo.year !=''">
                 and DATE_FORMAT( iac.signing_time, '%Y') =#{vo.year}
             </if>
             GROUP BY
             io.orderno,
             iac.api_type,
+            iac.jqpolicyno,
+            iac.sypolicyno,
             iac.cross_insurance,
             iac.signing_time,
             eic.namesimple,

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

@@ -16,10 +16,14 @@
         REPLACE ( JSON_EXTRACT( io.carinfo, '$.modelcname' ), '"', '' ) AS "modelName",
         ifnull( iac.id, '' ) AS subOrderNo,
         ifnull( iac.orderstatus, '' ) AS subOrderStatus,
-        ifnull( eic.NAME, '' ) AS companyName
+        ifnull( eic.NAME, '' ) AS companyName,
+        io.userid  AS "userId",
+        su.NAME  AS "userName",
+        iac.leader_name  AS "leaderName"
         FROM
         ins_orders io
         LEFT JOIN ins_area_company iac ON io.orderno = iac.orderno
+        left join sys_user su  on su.id =io.userid
         LEFT JOIN esm_ins_company eic ON iac.company_id = eic.id
         <where>
             ( iac.del_flag = '1' OR io.del_flag IS NULL OR io.del_flag = 1 )

+ 16 - 6
src/main/resources/mapper/modules/fnc/InsExcelTaskAsyncMapper.xml

@@ -2,10 +2,20 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ydtech.modules.fnc.dao.InsExcelTaskAsyncMapper">
 
-        <select id="queryPage" resultType="com.ydtech.modules.fnc.entity.InsExcelTaskEntity">
-            select iet.*,su.name  as "userName"
-            from ins_excel_task iet
-            left join sys_user su  on su.id = iet.user_id
-            order by create_time desc
-        </select>
+    <select id="queryPage" resultType="com.ydtech.modules.fnc.entity.InsExcelTaskEntity">
+        select iet.*, su.name as "userName"
+        from ins_excel_task iet
+                 left join sys_user su on su.id = iet.user_id
+        order by create_time desc
+    </select>
+
+
+    <select id="selectAllList" resultType="com.ydtech.modules.fnc.entity.InsExcelTaskEntity">
+        select * from ins_excel_task iet
+        <where>
+            <if test="nowTime !=null and nowTime!='' ">
+                TIMESTAMPDIFF(DAY, iet.create_time, #{nowTime})> 7;
+            </if>
+        </where>
+    </select>
 </mapper>

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

@@ -2959,7 +2959,6 @@
                 <where>
                     ifa.auditstatus = '1'
                     AND iac.orderstatus = '3'
-                    AND io.orderstatus = '3'
                 </where>
                 GROUP BY
                     DATE_FORMAT( iac.signing_time, '%Y-%m' )
@@ -3169,7 +3168,7 @@
                       </if>
                   </where>
               GROUP BY DATE_FORMAT(a.signdate, '%Y-%m')) a
-                 left join (SELECT sum(a.commission_feevalue) + sum(a.other_feevalue) AS "notInvoicAmount",
+                 left join (SELECT ifnull(sum(a.commission_feevalue),0) + ifnull(sum(a.other_feevalue),0) AS "notInvoicAmount",
                                    DATE_FORMAT(a.signdate, '%Y-%m')                   as "signingTime"
                             FROM ins_ply_income a
                                      LEFT JOIN ptl_agreement pa ON pa.id = a.agreement_id
@@ -3181,7 +3180,7 @@
                                 </if>
                             </where>
                             GROUP BY DATE_FORMAT(a.signdate, '%Y-%m')) b on a.signingTime = b.signingTime
-                 left join (SELECT sum(a.commission_feevalue) + sum(a.other_feevalue) AS "settAmount",
+                 left join (SELECT ifnull(sum(a.commission_feevalue),0) + ifnull(sum(a.other_feevalue),0) AS "settAmount",
                                    DATE_FORMAT(a.signdate, '%Y-%m')                   as "signingTime"
                             FROM ins_ply_income a
                                      LEFT JOIN ptl_agreement pa ON pa.id = a.agreement_id

+ 13 - 10
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -942,8 +942,9 @@
     <select id="quotationDetailsExcel" resultType="com.ydtech.modules.admin.model.dto.QuotationDetailsExcel">
         select
             iac.id as "orderno",
+            io.orderno as "bigOrderno",
             iac.agreement_id as "agreementId",
-            iot.order_status as "orderstatus",
+            iac.orderstatus as "orderstatus",
             iac.company_id as "companyId",
             agree.partner_companies_id as "partnerCompaniesId",
             ins.namesimple as "partnerCompaniesName",
@@ -963,11 +964,7 @@
             su1.name  as "userName",
             su1.leader_name  as "leaderName"
             from
-            (
-            select iot.suborder,iot.order_status from `ins_orders_track` iot
-            GROUP BY iot.suborder ,iot.order_status
-            ) iot
-            left join ins_area_company  iac ON iac.id = iot.suborder
+            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
@@ -1286,6 +1283,11 @@
             <if test="taskStatisticsVo.provinceId != null and taskStatisticsVo.provinceId != ''">
                 and io.deptid like "${taskStatisticsVo.provinceId}%"
             </if>
+
+            <if test="taskStatisticsVo.signingTimeStart !=null and taskStatisticsVo.signingTimeStart != '' and taskStatisticsVo.signingTimeEnd !=null and taskStatisticsVo.signingTimeEnd != ''">
+                AND   DATE_FORMAT( iac.signing_time, '%Y-%m-%d')   BETWEEN  DATE_FORMAT( #{taskStatisticsVo.signingTimeStart}, '%Y-%m-%d') AND  DATE_FORMAT( #{taskStatisticsVo.signingTimeEnd}, '%Y-%m-%d')
+            </if>
+
             <if test="taskStatisticsVo.cityId != null and taskStatisticsVo.cityId != ''">
                 and io.deptid like "${taskStatisticsVo.cityId}%"
             </if>
@@ -1381,6 +1383,9 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="taskStatisticsVo.signingTimeStart !=null and taskStatisticsVo.signingTimeStart != '' and taskStatisticsVo.signingTimeEnd !=null and taskStatisticsVo.signingTimeEnd != ''">
+                AND   DATE_FORMAT( iac.signing_time, '%Y-%m-%d')   BETWEEN  DATE_FORMAT( #{taskStatisticsVo.signingTimeStart}, '%Y-%m-%d') AND  DATE_FORMAT( #{taskStatisticsVo.signingTimeEnd}, '%Y-%m-%d')
+            </if>
 
             <if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
                 AND   DATE_FORMAT( io.createtime, '%Y-%m-%d')   BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
@@ -1863,7 +1868,7 @@
             1=1
             and iac.id = ifa.ins_order_no
             AND iac.orderstatus = 3
-            AND ifa.audituser != '自动审核'
+            and (iac.del_flag = '1' or io.del_flag IS NULL or io.del_flag = 1)
             AND (ifa.auditstatus ='1' or ifa.auditstatus ='0')
             <if test="taskStatisticsVo.reviewer !=null  and  taskStatisticsVo.reviewer !=''">
                 and su.name =#{taskStatisticsVo.reviewer}
@@ -3162,9 +3167,7 @@
         from ins_area_company iac
         left join ins_orders io on io.orderno = iac.orderno
         <where>
-            1=1
-            and  iac.orderstatus ='3'
-            and io.orderstatus ='3'
+            iac.orderstatus ='3'
             <if test="vo.licenseno !=null  and vo.licenseno!=''">
                 AND io.licenseno =#{vo.licenseno}
             </if>

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

@@ -1034,7 +1034,7 @@
                 and REPLACE(JSON_EXTRACT(io.applyinfo, '$.name'),'"','') = #{orderQueryVo.insuredName}
             </if>
             <if test="orderQueryVo.quoteStartDateStr != null and orderQueryVo.quoteEndDateStr != null">
-                and  DATE_FORMAT(iac.createtime, '%Y-%m-%d') between #{orderQueryVo.quoteStartDateStr} AND #{orderQueryVo.quoteEndDateStr}
+                and  iac.createtime >= #{orderQueryVo.quoteStartDateStr} AND  iac.createtime <![CDATA[ <= ]]> #{orderQueryVo.quoteEndDateStr}
             </if>
             <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
                 and iac.company_id = #{orderQueryVo.companyId}
@@ -1097,7 +1097,7 @@
                 </when>
             </choose>
             <if test="orderQueryVo.signStartDateStr != null and orderQueryVo.signEndDateStr != null">
-                and  DATE_FORMAT(iac.signing_time, '%Y-%m-%d') between #{orderQueryVo.signStartDateStr} AND #{orderQueryVo.signEndDateStr}
+                and  iac.signing_time >= #{orderQueryVo.signStartDateStr} AND  iac.signing_time <![CDATA[ <= ]]> #{orderQueryVo.signEndDateStr}
             </if>
             <if test="orderQueryVo.entryStatus != null and orderQueryVo.entryStatus != ''">
                 and io.entry_status = #{orderQueryVo.entryStatus }
@@ -1197,7 +1197,7 @@
                 and REPLACE(JSON_EXTRACT(io.applyinfo, '$.name'),'"','') = #{orderQueryVo.insuredName}
             </if>
             <if test="orderQueryVo.quoteStartDateStr != null and orderQueryVo.quoteEndDateStr != null">
-                and DATE_FORMAT(iac.createtime, '%Y-%m-%d') between #{orderQueryVo.quoteStartDateStr} AND #{orderQueryVo.quoteEndDateStr}
+                and iac.createtime >= #{orderQueryVo.quoteStartDateStr} AND iac.createtime  <![CDATA[ <= ]]> #{orderQueryVo.quoteEndDateStr}
             </if>
             <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
                 and iac.company_id = #{orderQueryVo.companyId}
@@ -1260,7 +1260,7 @@
                 </when>
             </choose>
             <if test="orderQueryVo.signStartDateStr != null and orderQueryVo.signEndDateStr != null">
-                and  DATE_FORMAT(iac.signing_time, '%Y-%m-%d') between #{orderQueryVo.signStartDateStr} AND #{orderQueryVo.signEndDateStr}
+                and  iac.signing_time >= #{orderQueryVo.signStartDateStr} AND   iac.signing_time <![CDATA[ <= ]]> #{orderQueryVo.signEndDateStr}
             </if>
             <if test="orderQueryVo.entryStatus != null and orderQueryVo.entryStatus != ''">
                 and io.entry_status = #{orderQueryVo.entryStatus }