|
|
@@ -1,7 +1,6 @@
|
|
|
package com.ydtech.modules.order.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
@@ -28,7 +27,6 @@ import com.ydtech.modules.admin.constants.ManagementSource;
|
|
|
import com.ydtech.modules.admin.constants.RoleConstants;
|
|
|
import com.ydtech.modules.admin.dao.*;
|
|
|
import com.ydtech.modules.admin.model.*;
|
|
|
-import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
|
|
|
import com.ydtech.modules.admin.model.po.SysUserIsDial;
|
|
|
import com.ydtech.modules.admin.service.*;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
@@ -41,27 +39,27 @@ import com.ydtech.modules.fnc.entity.InsFeeAudit;
|
|
|
import com.ydtech.modules.fnc.service.InsFeeAuditService;
|
|
|
import com.ydtech.modules.ins.model.InsOrdersExcel;
|
|
|
import com.ydtech.modules.ins.model.InsOrdersExcelVo;
|
|
|
-import com.ydtech.modules.ins.model.vo.*;
|
|
|
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
|
|
|
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
|
+import com.ydtech.modules.ins.model.vo.QuoteKindRespVo;
|
|
|
+import com.ydtech.modules.ins.model.vo.RiskInfoVo;
|
|
|
import com.ydtech.modules.ins.model.ya.CarModelDTO;
|
|
|
import com.ydtech.modules.ins.model.ya.ExtendInfoDto;
|
|
|
import com.ydtech.modules.ins.model.ya.ResponseDataC2;
|
|
|
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.OrderEntryStatus;
|
|
|
import com.ydtech.modules.order.constants.OrderLinkTypeConstants;
|
|
|
import com.ydtech.modules.order.dao.InsOrdersMapper;
|
|
|
import com.ydtech.modules.order.entity.*;
|
|
|
import com.ydtech.modules.order.entity.crawler.response.CrawlerVerifyPaymentResponse;
|
|
|
import com.ydtech.modules.order.entity.dto.*;
|
|
|
import com.ydtech.modules.order.entity.vo.*;
|
|
|
-import com.ydtech.modules.order.entity.vo.OrderVo;
|
|
|
import com.ydtech.modules.order.entity.vo.bohai.BoHaiQuoteAccidentVo;
|
|
|
import com.ydtech.modules.order.entity.vo.guoren.GuoRenQuoteVo;
|
|
|
import com.ydtech.modules.order.entity.vo.guoren.GuorenAccidentalDrivingVo;
|
|
|
import com.ydtech.modules.order.entity.vo.telemarketing.TelemarketingAuditOrderQueryVo;
|
|
|
import com.ydtech.modules.order.entity.vo.ya.YaExtendInfoDto;
|
|
|
-import com.ydtech.modules.order.entity.vo.yangguang.YgNonVehicleProductsVo;
|
|
|
import com.ydtech.modules.order.entity.vo.yangguang.YgQuoteAccidentVo;
|
|
|
import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
|
|
|
import com.ydtech.modules.order.service.*;
|
|
|
@@ -81,7 +79,6 @@ import com.ydtech.modules.scheme.entity.vo.RuleFilterVo;
|
|
|
import com.ydtech.modules.scheme.service.PtlSchemeRulesService;
|
|
|
import com.ydtech.utils.SnowFlakeUtil;
|
|
|
import com.ydtech.utils.idgen.IdGenerate;
|
|
|
-import io.swagger.annotations.ApiModelProperty;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.InvalidPropertyException;
|
|
|
@@ -2494,20 +2491,36 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
|
|
|
String quoteStartDateStr = orderQueryVo.getQuoteStartDateStr();
|
|
|
String quoteEndDateStr = orderQueryVo.getQuoteEndDateStr();
|
|
|
- if ((StringUtils.isEmpty(signStartDateStr) || StringUtils.isEmpty(signEndDateStr)) || (StringUtils.isEmpty(quoteStartDateStr) || StringUtils.isEmpty(quoteEndDateStr))) {
|
|
|
- throw new SystemException("1.导出数据时,签单时间 或者 录单时间必填;2.选择的签单时间 或 录单时间 (开始日期-结束日期)>30天,导出时,按结束时间往前+30天的数据做导出");
|
|
|
- }
|
|
|
|
|
|
final int day = 30;
|
|
|
- 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("3".equals(orderQueryVo.getOrderStatus())){
|
|
|
+ if((StringUtils.isEmpty(signStartDateStr) || StringUtils.isEmpty(signEndDateStr))) {
|
|
|
+ throw new SystemException("导出已承保数据时,1.签单时间必填;2.选择的签单时间(开始日期-结束日期)>30天,导出时,按结束时间往前+30天的数据做导出");
|
|
|
+ }
|
|
|
+ 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));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
switch (orderLinkTypeConstants) {
|
|
|
case ORDER_LINK_TYPE_CONSTANTS_1:
|
|
|
agentUserIds = sysUserService.getUserIdsByLeaderId(orderQueryVo.getUserId());
|
|
|
@@ -2522,11 +2535,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
break;
|
|
|
case ORDER_LINK_TYPE_CONSTANTS_3:
|
|
|
//查询用户关联的协议
|
|
|
- List<SysUserLinkPtlAgreementDto> ptlAgreementListByUserIds =
|
|
|
- sysUserLinkPtlAgreementMapper.findPtlAgreementListByUserId(orderQueryVo.getUserId());
|
|
|
- if (ptlAgreementListByUserIds != null && !ptlAgreementListByUserIds.isEmpty()) {
|
|
|
- agreeIds = ptlAgreementListByUserIds.stream().map(sysUserLinkPtlAgreementDto -> sysUserLinkPtlAgreementDto.getPtlAgreement().getId()).collect(Collectors.toList());
|
|
|
- }
|
|
|
+ //List<SysUserLinkPtlAgreementDto> ptlAgreementListByUserIds =
|
|
|
+ // sysUserLinkPtlAgreementMapper.findPtlAgreementListByUserId(orderQueryVo.getUserId());
|
|
|
+ // if (ptlAgreementListByUserIds != null && !ptlAgreementListByUserIds.isEmpty()) {
|
|
|
+ // agreeIds = ptlAgreementListByUserIds.stream().map(sysUserLinkPtlAgreementDto -> sysUserLinkPtlAgreementDto.getPtlAgreement().getId()).collect(Collectors.toList());
|
|
|
+ // }
|
|
|
+ // add by hxl 2025-01-08 注释关联的协议维护太频繁改为关联保险公司
|
|
|
+ agreeIds = sysUserLinkCompanyMapper.findCompanyListByUserId(orderQueryVo.getUserId());
|
|
|
break;
|
|
|
case ORDER_LINK_TYPE_CONSTANTS_4:
|
|
|
agentUserIds = sysUserService.getTelemarketingPersonnelData();
|