|
@@ -23,6 +23,7 @@ import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.admin.constants.RoleConstants;
|
|
import com.ydtech.modules.admin.constants.RoleConstants;
|
|
|
import com.ydtech.modules.admin.dao.SysUserLinkAreaMapper;
|
|
import com.ydtech.modules.admin.dao.SysUserLinkAreaMapper;
|
|
|
import com.ydtech.modules.admin.dao.SysUserLinkPtlAgreementMapper;
|
|
import com.ydtech.modules.admin.dao.SysUserLinkPtlAgreementMapper;
|
|
|
|
|
+import com.ydtech.modules.admin.dao.SysUserMapper;
|
|
|
import com.ydtech.modules.admin.model.*;
|
|
import com.ydtech.modules.admin.model.*;
|
|
|
import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
|
|
import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
|
|
|
import com.ydtech.modules.admin.model.po.SysUserIsDial;
|
|
import com.ydtech.modules.admin.model.po.SysUserIsDial;
|
|
@@ -33,6 +34,7 @@ import com.ydtech.modules.esm.service.EsmUserReferrerService;
|
|
|
import com.ydtech.modules.fee.service.CostsCalcService;
|
|
import com.ydtech.modules.fee.service.CostsCalcService;
|
|
|
import com.ydtech.modules.fee.service.impl.FeeRuleSchemeServiceImpl;
|
|
import com.ydtech.modules.fee.service.impl.FeeRuleSchemeServiceImpl;
|
|
|
import com.ydtech.modules.fnc.entity.InsFeeAudit;
|
|
import com.ydtech.modules.fnc.entity.InsFeeAudit;
|
|
|
|
|
+import com.ydtech.modules.fnc.service.InsFeeAuditHistoryService;
|
|
|
import com.ydtech.modules.fnc.service.InsFeeAuditService;
|
|
import com.ydtech.modules.fnc.service.InsFeeAuditService;
|
|
|
import com.ydtech.modules.ins.dao.InsFileMapper;
|
|
import com.ydtech.modules.ins.dao.InsFileMapper;
|
|
|
import com.ydtech.modules.ins.model.InsOrdersExcel;
|
|
import com.ydtech.modules.ins.model.InsOrdersExcel;
|
|
@@ -84,6 +86,7 @@ import org.springframework.util.ObjectUtils;
|
|
|
import javax.validation.constraints.NotBlank;
|
|
import javax.validation.constraints.NotBlank;
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.time.Instant;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
import java.time.temporal.ChronoUnit;
|
|
@@ -258,7 +261,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @param user 当前登录人
|
|
|
|
|
|
|
+ * @param user 当前登录人
|
|
|
* @param quoteInfoVo 报价信息
|
|
* @param quoteInfoVo 报价信息
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -312,19 +315,30 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
if (daikeFlag) {//当时代客录单业务时,才需要赋值该字段
|
|
if (daikeFlag) {//当时代客录单业务时,才需要赋值该字段
|
|
|
insOrders.setOperatorid(userId);//赋值代客录单操作人为登录人
|
|
insOrders.setOperatorid(userId);//赋值代客录单操作人为登录人
|
|
|
}
|
|
}
|
|
|
- // 录入订单状态
|
|
|
|
|
- insOrders.setUpEntryStatus(daikeFlag);
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
if (isCdy) {//赋值出单员 操作人为登录人
|
|
if (isCdy) {//赋值出单员 操作人为登录人
|
|
|
insOrders.setOperatorid(userId);
|
|
insOrders.setOperatorid(userId);
|
|
|
}
|
|
}
|
|
|
InsOrders insOrders1 = baseMapper.selectById(quoteInfoVo.getOrderNo());
|
|
InsOrders insOrders1 = baseMapper.selectById(quoteInfoVo.getOrderNo());
|
|
|
|
|
|
|
|
- //需要赋值代录单人ID
|
|
|
|
|
|
|
+ // 代课录单操作
|
|
|
|
|
+ Integer entryStatus = Optional.ofNullable(insOrders1)
|
|
|
|
|
+ .map(InsOrders::getEntryStatus)
|
|
|
|
|
+ .orElse(null);
|
|
|
|
|
+
|
|
|
|
|
+ if (ObjectUtils.isEmpty(entryStatus)) {
|
|
|
|
|
+ insOrders.setUpEntryStatus(daikeFlag);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ insOrders.setEntryStatus(insOrders1.getEntryStatus());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ //需要赋值代录单人ID
|
|
|
if (ObjectUtils.isEmpty(insOrders1)) {
|
|
if (ObjectUtils.isEmpty(insOrders1)) {
|
|
|
|
|
+ // 录入订单状态
|
|
|
insOrders1 = insOrders;
|
|
insOrders1 = insOrders;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
String licenseNo = quoteInfoVo.getCarInfo().getLicenseNo();
|
|
String licenseNo = quoteInfoVo.getCarInfo().getLicenseNo();
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(licenseNo) && !licenseNo.equals(insOrders1.getLicenseno())) {
|
|
if (StringUtils.isNotEmpty(licenseNo) && !licenseNo.equals(insOrders1.getLicenseno())) {
|
|
@@ -339,7 +353,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
// 将报价号返回
|
|
// 将报价号返回
|
|
|
long l = new SnowFlakeUtil().nextId();
|
|
long l = new SnowFlakeUtil().nextId();
|
|
|
insOrders.setQuoteno(String.valueOf(l));
|
|
insOrders.setQuoteno(String.valueOf(l));
|
|
|
- boolean save = this.saveAndTrajectories( sysUser, insOrders);
|
|
|
|
|
|
|
+ boolean save = this.saveAndTrajectories(sysUser, insOrders);
|
|
|
if (!save) {
|
|
if (!save) {
|
|
|
throw new SystemException("订单生成失败");
|
|
throw new SystemException("订单生成失败");
|
|
|
}
|
|
}
|
|
@@ -394,15 +408,15 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
SysUserRole userRole = sysUserRoleService.selectByUserId(orderQueryVo.getUserId());
|
|
SysUserRole userRole = sysUserRoleService.selectByUserId(orderQueryVo.getUserId());
|
|
|
SysUser user = sysUserService.getById(orderQueryVo.getUserId());
|
|
SysUser user = sysUserService.getById(orderQueryVo.getUserId());
|
|
|
SysDept dept = sysDeptService.getById(user.getDeptId());
|
|
SysDept dept = sysDeptService.getById(user.getDeptId());
|
|
|
- String deptId="";
|
|
|
|
|
- boolean isCdy =false;
|
|
|
|
|
|
|
+ String deptId = "";
|
|
|
|
|
+ boolean isCdy = false;
|
|
|
//机构类型为1 角色id=21是渠道团队长
|
|
//机构类型为1 角色id=21是渠道团队长
|
|
|
- if(dept!=null && "1".equals(dept.getManagementSource()) && userRole!=null && userRole.getRoleId()==21){
|
|
|
|
|
- deptId=dept.getId();
|
|
|
|
|
|
|
+ if (dept != null && "1".equals(dept.getManagementSource()) && userRole != null && userRole.getRoleId() == 21) {
|
|
|
|
|
+ deptId = dept.getId();
|
|
|
isCdy = true;
|
|
isCdy = true;
|
|
|
}
|
|
}
|
|
|
- Page<InsOrders> orderVoPage = baseMapper.queryPageOrder(page, orderQueryVo, adminFalg, isCdy,deptId);
|
|
|
|
|
- Long total = baseMapper.queryPageOrderCount(orderQueryVo, adminFalg, isCdy,deptId);
|
|
|
|
|
|
|
+ Page<InsOrders> orderVoPage = baseMapper.queryPageOrder(page, orderQueryVo, adminFalg, isCdy, deptId);
|
|
|
|
|
+ Long total = baseMapper.queryPageOrderCount(orderQueryVo, adminFalg, isCdy, deptId);
|
|
|
orderVoPage.setTotal(total);
|
|
orderVoPage.setTotal(total);
|
|
|
return new BasePageResult<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize(), orderVoPage.getTotal(),
|
|
return new BasePageResult<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize(), orderVoPage.getTotal(),
|
|
|
orderVoPage.getPages()
|
|
orderVoPage.getPages()
|
|
@@ -752,9 +766,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
if (insAreaCompanyList.size() > 0 && insOrders.getIsExternal() == 1) {
|
|
if (insAreaCompanyList.size() > 0 && insOrders.getIsExternal() == 1) {
|
|
|
insAreaCompanyExternalFee = insAreaCompanyExternalFeeService.getById(insAreaCompanyList.get(0).getId());
|
|
insAreaCompanyExternalFee = insAreaCompanyExternalFeeService.getById(insAreaCompanyList.get(0).getId());
|
|
|
insOrdersEditingVo.setSigningTime(insAreaCompanyList.get(0).getSigningTime());
|
|
insOrdersEditingVo.setSigningTime(insAreaCompanyList.get(0).getSigningTime());
|
|
|
- insOrdersEditingVo.setJqpremium(insAreaCompanyList.get(0).getJqpremium().compareTo(BigDecimal.ZERO)==0?"":insAreaCompanyList.get(0).getJqpremium() .toString());
|
|
|
|
|
- insOrdersEditingVo.setSypremium(insAreaCompanyList.get(0).getSypremium().compareTo(BigDecimal.ZERO)==0?"":insAreaCompanyList.get(0).getSypremium().toString());
|
|
|
|
|
- insOrdersEditingVo.setJypremium(insAreaCompanyList.get(0).getJypremium().compareTo(BigDecimal.ZERO)==0?"":insAreaCompanyList.get(0).getJypremium().toString());
|
|
|
|
|
|
|
+ insOrdersEditingVo.setJqpremium(insAreaCompanyList.get(0).getJqpremium().compareTo(BigDecimal.ZERO) == 0 ? "" : insAreaCompanyList.get(0).getJqpremium().toString());
|
|
|
|
|
+ insOrdersEditingVo.setSypremium(insAreaCompanyList.get(0).getSypremium().compareTo(BigDecimal.ZERO) == 0 ? "" : insAreaCompanyList.get(0).getSypremium().toString());
|
|
|
|
|
+ insOrdersEditingVo.setJypremium(insAreaCompanyList.get(0).getJypremium().compareTo(BigDecimal.ZERO) == 0 ? "" : insAreaCompanyList.get(0).getJypremium().toString());
|
|
|
insOrdersEditingVo.setTaxamount(insAreaCompanyList.get(0).getTaxamount().toString());
|
|
insOrdersEditingVo.setTaxamount(insAreaCompanyList.get(0).getTaxamount().toString());
|
|
|
insOrdersEditingVo.setJqpolicyno(insAreaCompanyList.get(0).getJqpolicyno());
|
|
insOrdersEditingVo.setJqpolicyno(insAreaCompanyList.get(0).getJqpolicyno());
|
|
|
insOrdersEditingVo.setSypolicyno(insAreaCompanyList.get(0).getSypolicyno());
|
|
insOrdersEditingVo.setSypolicyno(insAreaCompanyList.get(0).getSypolicyno());
|
|
@@ -765,8 +779,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
//设置签单时间和非车保单号
|
|
//设置签单时间和非车保单号
|
|
|
insOrdersEditingVo.setSignDate(insAreaCompanyList.get(0).getSigningTime());
|
|
insOrdersEditingVo.setSignDate(insAreaCompanyList.get(0).getSigningTime());
|
|
|
JSONArray crossInsurance = insAreaCompanyList.get(0).getCrossInsurance();
|
|
JSONArray crossInsurance = insAreaCompanyList.get(0).getCrossInsurance();
|
|
|
- String application ="";
|
|
|
|
|
- if(crossInsurance!=null && crossInsurance.size() > 0) {
|
|
|
|
|
|
|
+ String application = "";
|
|
|
|
|
+ if (crossInsurance != null && crossInsurance.size() > 0) {
|
|
|
application = crossInsurance.getJSONObject(0).getString("application");
|
|
application = crossInsurance.getJSONObject(0).getString("application");
|
|
|
}
|
|
}
|
|
|
insOrdersEditingVo.setJypolicyno(application);
|
|
insOrdersEditingVo.setJypolicyno(application);
|
|
@@ -853,13 +867,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
- if(insAreaCompanyEditingDtos!=null && insAreaCompanyEditingDtos.size()>0){
|
|
|
|
|
|
|
+ if (insAreaCompanyEditingDtos != null && insAreaCompanyEditingDtos.size() > 0) {
|
|
|
//根据出单员判断 编辑查看
|
|
//根据出单员判断 编辑查看
|
|
|
//add by hxl 添加出单员不能查看优惠的限制 2024-07-16
|
|
//add by hxl 添加出单员不能查看优惠的限制 2024-07-16
|
|
|
String userId = new BaseController().getUserId();
|
|
String userId = new BaseController().getUserId();
|
|
|
SysUserRole sysUserRole = sysUserRoleService.selectByUserId(userId);
|
|
SysUserRole sysUserRole = sysUserRoleService.selectByUserId(userId);
|
|
|
- if(sysUserRole!=null && sysUserRole.getRoleId()==19){
|
|
|
|
|
- insAreaCompanyEditingDtos.forEach(item ->{
|
|
|
|
|
|
|
+ if (sysUserRole != null && sysUserRole.getRoleId() == 19) {
|
|
|
|
|
+ insAreaCompanyEditingDtos.forEach(item -> {
|
|
|
item.setJqExportFee(null);
|
|
item.setJqExportFee(null);
|
|
|
item.setSyExportFee(null);
|
|
item.setSyExportFee(null);
|
|
|
item.setNoExportFee(null);
|
|
item.setNoExportFee(null);
|
|
@@ -931,7 +945,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**user
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * user
|
|
|
|
|
+ *
|
|
|
* @version
|
|
* @version
|
|
|
* @author: hxl
|
|
* @author: hxl
|
|
|
* @Date: 2024/4/17 15:38
|
|
* @Date: 2024/4/17 15:38
|
|
@@ -1382,24 +1398,24 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
LocalDateTime currentTime = LocalDateTime.now();
|
|
LocalDateTime currentTime = LocalDateTime.now();
|
|
|
LocalDateTime oneYearAgo = currentTime.plus(1, ChronoUnit.YEARS);
|
|
LocalDateTime oneYearAgo = currentTime.plus(1, ChronoUnit.YEARS);
|
|
|
DateTimeFormatter datePat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter datePat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- if (orderExpirationQueryVo.getJqEnable() &&( StringUtils.isEmpty(orderExpirationQueryVo.getJqStartDate()) ||
|
|
|
|
|
|
|
+ if (orderExpirationQueryVo.getJqEnable() && (StringUtils.isEmpty(orderExpirationQueryVo.getJqStartDate()) ||
|
|
|
StringUtils.isEmpty(orderExpirationQueryVo.getJqEndDate()))) {
|
|
StringUtils.isEmpty(orderExpirationQueryVo.getJqEndDate()))) {
|
|
|
- throw new InvalidPropertyException(getClass(),"jqStartDate/jqEndDate","请输入交强查询起止日期!");
|
|
|
|
|
|
|
+ throw new InvalidPropertyException(getClass(), "jqStartDate/jqEndDate", "请输入交强查询起止日期!");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!orderExpirationQueryVo.getJqEnable()){
|
|
|
|
|
- orderExpirationQueryVo.setJqStartDate(currentTime.format(datePat) );
|
|
|
|
|
- orderExpirationQueryVo.setJqEndDate(oneYearAgo.format(datePat) );
|
|
|
|
|
|
|
+ if (!orderExpirationQueryVo.getJqEnable()) {
|
|
|
|
|
+ orderExpirationQueryVo.setJqStartDate(currentTime.format(datePat));
|
|
|
|
|
+ orderExpirationQueryVo.setJqEndDate(oneYearAgo.format(datePat));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (orderExpirationQueryVo.getSyEnable() &&(StringUtils.isEmpty(orderExpirationQueryVo.getSyStartDate()) ||
|
|
|
|
|
- StringUtils.isEmpty(orderExpirationQueryVo.getSyEndDate() ))) {
|
|
|
|
|
- throw new InvalidPropertyException(getClass(),"syStartDate/syEndDate","请输入商业查询起止日期!");
|
|
|
|
|
|
|
+ if (orderExpirationQueryVo.getSyEnable() && (StringUtils.isEmpty(orderExpirationQueryVo.getSyStartDate()) ||
|
|
|
|
|
+ StringUtils.isEmpty(orderExpirationQueryVo.getSyEndDate()))) {
|
|
|
|
|
+ throw new InvalidPropertyException(getClass(), "syStartDate/syEndDate", "请输入商业查询起止日期!");
|
|
|
}
|
|
}
|
|
|
- if (!orderExpirationQueryVo.getSyEnable()){
|
|
|
|
|
|
|
+ if (!orderExpirationQueryVo.getSyEnable()) {
|
|
|
orderExpirationQueryVo.setSyStartDate(currentTime.format(datePat));
|
|
orderExpirationQueryVo.setSyStartDate(currentTime.format(datePat));
|
|
|
- orderExpirationQueryVo.setSyEndDate(oneYearAgo.format(datePat) );
|
|
|
|
|
|
|
+ orderExpirationQueryVo.setSyEndDate(oneYearAgo.format(datePat));
|
|
|
}
|
|
}
|
|
|
Page<OrderExpirationVo> expirationInsure = baseMapper.getExpirationInsure(page, orderExpirationQueryVo);
|
|
Page<OrderExpirationVo> expirationInsure = baseMapper.getExpirationInsure(page, orderExpirationQueryVo);
|
|
|
List<OrderExpirationVo> records = expirationInsure.getRecords();
|
|
List<OrderExpirationVo> records = expirationInsure.getRecords();
|
|
@@ -1487,7 +1503,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
}
|
|
}
|
|
|
Set<BigDecimal> set = new HashSet<BigDecimal>(yhhbjList);
|
|
Set<BigDecimal> set = new HashSet<BigDecimal>(yhhbjList);
|
|
|
//判断是否相等
|
|
//判断是否相等
|
|
|
- if (set.size()>1) {
|
|
|
|
|
|
|
+ if (set.size() > 1) {
|
|
|
//最优惠公司
|
|
//最优惠公司
|
|
|
int index = getCompanyNameByMinAmount(yhhbjList);
|
|
int index = getCompanyNameByMinAmount(yhhbjList);
|
|
|
companyName = companyAllList.get(index);
|
|
companyName = companyAllList.get(index);
|