Commit f6762d71 authored by huyuchen's avatar huyuchen

huych-商险自动化逻辑调整

parent 17033469
...@@ -124,6 +124,12 @@ public class InsuranceAddParam implements Serializable { ...@@ -124,6 +124,12 @@ public class InsuranceAddParam implements Serializable {
@Schema(description = "商险待购买id") @Schema(description = "商险待购买id")
private String insurancePreId; private String insurancePreId;
/**
* 前端客服姓名
*/
@Schema(description = "前端客服姓名")
private String customerUserName;
/***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/ /***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/
/** /**
* 结算类型 (1、单独结算 2、合并结算-和工资一起结算) * 结算类型 (1、单独结算 2、合并结算-和工资一起结算)
......
...@@ -151,4 +151,9 @@ public class InsuranceAutoParam implements Serializable { ...@@ -151,4 +151,9 @@ public class InsuranceAutoParam implements Serializable {
@Schema(description = "商险待购买id") @Schema(description = "商险待购买id")
private String insurancePreId; private String insurancePreId;
/**
* 前端客服姓名
*/
@Schema(description = "前端客服姓名")
private String customerUserName;
} }
...@@ -119,6 +119,12 @@ public class InsuranceBatchParam implements Serializable { ...@@ -119,6 +119,12 @@ public class InsuranceBatchParam implements Serializable {
@Schema(description = "商险待购买id") @Schema(description = "商险待购买id")
private String insurancePreId; private String insurancePreId;
/**
* 前端客服姓名
*/
@Schema(description = "前端客服姓名")
private String customerUserName;
/***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/ /***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/
/** /**
* 结算类型 (1、单独结算 2、合并结算-和工资一起结算) * 结算类型 (1、单独结算 2、合并结算-和工资一起结算)
......
...@@ -107,6 +107,12 @@ public class InsuranceReplaceParam implements Serializable { ...@@ -107,6 +107,12 @@ public class InsuranceReplaceParam implements Serializable {
@Schema(description = "商险待购买id") @Schema(description = "商险待购买id")
private String insurancePreId; private String insurancePreId;
/**
* 前端客服姓名
*/
@Schema(description = "前端客服姓名")
private String customerUserName;
/** /**
* 数据传递对象 * 数据传递对象
*/ */
......
...@@ -207,6 +207,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -207,6 +207,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setPost(insurancePre.getPosition()); addParam.setPost(insurancePre.getPosition());
addParam.setRemark(CommonConstants.EMPTY_STRING); addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId()); addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
addParamList.add(addParam); addParamList.add(addParam);
} }
if (CommonConstants.THREE_INT == insurancePre.getBuyType()) { if (CommonConstants.THREE_INT == insurancePre.getBuyType()) {
...@@ -224,6 +225,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -224,6 +225,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setPost(insurancePre.getPosition()); addParam.setPost(insurancePre.getPosition());
addParam.setRemark(CommonConstants.EMPTY_STRING); addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId()); addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
batchAddParamList.add(addParam); batchAddParamList.add(addParam);
} }
if (CommonConstants.FOUR_INT == insurancePre.getBuyType()) { if (CommonConstants.FOUR_INT == insurancePre.getBuyType()) {
...@@ -242,6 +244,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -242,6 +244,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setReplaceEmpIdcardNo(insurancePre.getEmpIdcard()); addParam.setReplaceEmpIdcardNo(insurancePre.getEmpIdcard());
addParam.setRemark(CommonConstants.EMPTY_STRING); addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId()); addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
replaceAddParamList.add(addParam); replaceAddParamList.add(addParam);
} }
} }
...@@ -488,6 +491,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -488,6 +491,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setRemark(addParam.getRemark()); autoParam.setRemark(addParam.getRemark());
autoParam.setErrorMessage(addParam.getErrorMessage()); autoParam.setErrorMessage(addParam.getErrorMessage());
autoParam.setInsurancePreId(addParam.getInsurancePreId()); autoParam.setInsurancePreId(addParam.getInsurancePreId());
autoParam.setCustomerUserName(addParam.getCustomerUserName());
return autoParam; return autoParam;
} }
...@@ -508,6 +512,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -508,6 +512,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setRemark(batchParam.getRemark()); autoParam.setRemark(batchParam.getRemark());
autoParam.setErrorMessage(batchParam.getErrorMessage()); autoParam.setErrorMessage(batchParam.getErrorMessage());
autoParam.setInsurancePreId(batchParam.getInsurancePreId()); autoParam.setInsurancePreId(batchParam.getInsurancePreId());
autoParam.setCustomerUserName(batchParam.getCustomerUserName());
return autoParam; return autoParam;
} }
...@@ -528,6 +533,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -528,6 +533,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setReplaceEmpIdcardNo(replaceParam.getReplaceEmpIdcardNo()); autoParam.setReplaceEmpIdcardNo(replaceParam.getReplaceEmpIdcardNo());
autoParam.setErrorMessage(replaceParam.getErrorMessage()); autoParam.setErrorMessage(replaceParam.getErrorMessage());
autoParam.setInsurancePreId(replaceParam.getInsurancePreId()); autoParam.setInsurancePreId(replaceParam.getInsurancePreId());
autoParam.setCustomerUserName(replaceParam.getCustomerUserName());
return autoParam; return autoParam;
} }
......
...@@ -373,7 +373,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -373,7 +373,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setActualPremium(new BigDecimal("0.00")); detail.setActualPremium(new BigDecimal("0.00"));
detail.setEstimatePremium(new BigDecimal("0.00")); detail.setEstimatePremium(new BigDecimal("0.00"));
detail.setCreateBy(null == user ? "1" : user.getId()); detail.setCreateBy(null == user ? "1" : user.getId());
detail.setCreateName(null == user ? "自动化派单" : user.getNickname()); detail.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname());
detailList.add(detail); detailList.add(detail);
sourceIdCardList.add(detail.getEmpIdcardNo()); sourceIdCardList.add(detail.getEmpIdcardNo());
baseMapper.insert(detail); baseMapper.insert(detail);
...@@ -446,7 +446,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -446,7 +446,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setActualPremium(new BigDecimal("0.00")); detail.setActualPremium(new BigDecimal("0.00"));
detail.setEstimatePremium(new BigDecimal("0.00")); detail.setEstimatePremium(new BigDecimal("0.00"));
detail.setCreateBy(null == user ? "1" : user.getId()); detail.setCreateBy(null == user ? "1" : user.getId());
detail.setCreateName(null == user ? "自动化派单" : user.getNickname()); detail.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname());
detailList.add(detail); detailList.add(detail);
sourceIdCardList.add(detail.getEmpIdcardNo()); sourceIdCardList.add(detail.getEmpIdcardNo());
replaceIdList.add(detail.getId()); replaceIdList.add(detail.getId());
...@@ -557,7 +557,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -557,7 +557,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//创建时间是新数据插入时间 //创建时间是新数据插入时间
newDetail.setCreateTime(LocalDateTime.now()); newDetail.setCreateTime(LocalDateTime.now());
newDetail.setCreateBy(null == user ? "1" : user.getId()); newDetail.setCreateBy(null == user ? "1" : user.getId());
newDetail.setCreateName(null == user ? "自动化派单" : user.getNickname()); newDetail.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname());
//替换不参与结算 //替换不参与结算
newDetail.setDefaultSettleId(null); newDetail.setDefaultSettleId(null);
//替换不继承备注 20250331 fxj 替换模板新增备注字段不用清空 //替换不继承备注 20250331 fxj 替换模板新增备注字段不用清空
...@@ -585,7 +585,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -585,7 +585,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replace.setReplaceStatus(CommonConstants.ONE_INT); replace.setReplaceStatus(CommonConstants.ONE_INT);
replace.setReplaceTime(LocalDateTime.now()); replace.setReplaceTime(LocalDateTime.now());
replace.setCreateBy(null == user ? "1" : user.getId()); replace.setCreateBy(null == user ? "1" : user.getId());
replace.setCreateName(null == user ? "自动化派单" : user.getNickname()); replace.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname());
replace.setCreateTime(LocalDateTime.now()); replace.setCreateTime(LocalDateTime.now());
tInsuranceReplaceService.save(replace); tInsuranceReplaceService.save(replace);
updateEmployeeInsurancePre(success.getInsurancePreId(),newDetail,CommonConstants.THREE_STRING); updateEmployeeInsurancePre(success.getInsurancePreId(),newDetail,CommonConstants.THREE_STRING);
...@@ -2671,7 +2671,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2671,7 +2671,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link Map<String, List<InsuranceAddParam>>} * @return {@link Map<String, List<InsuranceAddParam>>}
*/ */
private Map<String,List<InsuranceAddParam>> addInsuranceCheck(List<InsuranceAddParam> paramList,YifuUser user){ private Map<String,List<InsuranceAddParam>> addInsuranceCheck(List<InsuranceAddParam> paramList,YifuUser user){
List<String> deptNoList = getDeptNoList(null == user ? "1" : user.getId()); //1.9.11超管无需校验项目权限
List<String> deptNoList = new ArrayList<>();
if (Common.isNotNull(user)) {
deptNoList = getDeptNoList(user.getId());
}
Map<String,List<InsuranceAddParam>> map = new HashMap<>(); Map<String,List<InsuranceAddParam>> map = new HashMap<>();
List<InsuranceAddParam> listResult = new ArrayList<>(); List<InsuranceAddParam> listResult = new ArrayList<>();
List<InsuranceAddParam> listSuccess = new ArrayList<>(); List<InsuranceAddParam> listSuccess = new ArrayList<>();
...@@ -2886,15 +2890,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2886,15 +2890,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
//校验当前项目是否在权限范围内 //校验当前项目是否在权限范围内
if(CollectionUtils.isEmpty(deptNoList)){ //1.9.11超管无需校验项目权限
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST); if (Common.isEmpty(param.getCustomerUserName()) && Common.isNotNull(user)) {
listResult.add(param); if (CollectionUtils.isEmpty(deptNoList)) {
continue; param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
} listResult.add(param);
if(!deptNoList.stream().anyMatch(u ->u.equals(param.getDeptNo()))){ continue;
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST); }
listResult.add(param); if (!deptNoList.stream().anyMatch(u -> u.equals(param.getDeptNo()))) {
continue; param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
} }
//省市区域校验是否正确并设置对应id //省市区域校验是否正确并设置对应id
String redisProvinceName = getRedisAreaValue(param.getInsuranceProvinceName()); String redisProvinceName = getRedisAreaValue(param.getInsuranceProvinceName());
...@@ -3058,7 +3065,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3058,7 +3065,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link Map< String, List< InsuranceBatchParam>>} * @return {@link Map< String, List< InsuranceBatchParam>>}
*/ */
private Map<String,List<InsuranceBatchParam>> batchInsuranceCheck(List<InsuranceBatchParam> paramList,YifuUser user){ private Map<String,List<InsuranceBatchParam>> batchInsuranceCheck(List<InsuranceBatchParam> paramList,YifuUser user){
List<String> deptNoList = getDeptNoList(null == user ? "1" : user.getId()); //1.9.11超管无需校验项目权限
List<String> deptNoList = new ArrayList<>();
if (Common.isNotNull(user)) {
deptNoList = getDeptNoList(user.getId());
}
Map<String,List<InsuranceBatchParam>> map = new HashMap<>(); Map<String,List<InsuranceBatchParam>> map = new HashMap<>();
List<InsuranceBatchParam> listResult = new ArrayList<>(); List<InsuranceBatchParam> listResult = new ArrayList<>();
List<InsuranceBatchParam> listSuccess = new ArrayList<>(); List<InsuranceBatchParam> listSuccess = new ArrayList<>();
...@@ -3234,15 +3245,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3234,15 +3245,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
//校验当前项目是否在权限范围内 //校验当前项目是否在权限范围内
if(CollectionUtils.isEmpty(deptNoList)){ //1.9.11超管无需校验项目权限
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST); if (Common.isEmpty(param.getCustomerUserName()) && Common.isNotNull(user)) {
listResult.add(param); if (CollectionUtils.isEmpty(deptNoList)) {
continue; param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
} listResult.add(param);
if(!deptNoList.stream().anyMatch(u ->u.equals(param.getDeptNo()))){ continue;
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST); }
listResult.add(param); if (!deptNoList.stream().anyMatch(u -> u.equals(param.getDeptNo()))) {
continue; param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
} }
//省市区域校验是否正确并设置对应id //省市区域校验是否正确并设置对应id
String redisProvinceName = getRedisAreaValue(param.getInsuranceProvinceName()); String redisProvinceName = getRedisAreaValue(param.getInsuranceProvinceName());
...@@ -3444,7 +3458,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3444,7 +3458,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link Map< String, List<InsuranceReplaceParam>>} * @return {@link Map< String, List<InsuranceReplaceParam>>}
*/ */
private Map<String,List<InsuranceReplaceParam>> replaceInsuranceCheck(List<InsuranceReplaceParam> paramList,YifuUser user){ private Map<String,List<InsuranceReplaceParam>> replaceInsuranceCheck(List<InsuranceReplaceParam> paramList,YifuUser user){
List<String> deptNoList = getDeptNoList(null == user ? "1" : user.getId()); //1.9.11超管无需校验项目权限
List<String> deptNoList = new ArrayList<>();
if (Common.isNotNull(user)) {
deptNoList = getDeptNoList(user.getId());
}
Map<String,List<InsuranceReplaceParam>> map = new HashMap<>(); Map<String,List<InsuranceReplaceParam>> map = new HashMap<>();
List<InsuranceReplaceParam> listResult = new ArrayList<>(); List<InsuranceReplaceParam> listResult = new ArrayList<>();
List<InsuranceReplaceParam> listSuccess = new ArrayList<>(); List<InsuranceReplaceParam> listSuccess = new ArrayList<>();
...@@ -3707,21 +3725,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3707,21 +3725,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
}else { }else {
//校验当前项目是否在权限范围内 //校验当前项目是否在权限范围内
if(CollectionUtils.isEmpty(deptNoList)){ //1.9.11超管无需校验项目权限
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST); if (Common.isEmpty(param.getCustomerUserName()) && Common.isNotNull(user)) {
listResult.add(param); if (CollectionUtils.isEmpty(deptNoList)) {
continue; param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
} listResult.add(param);
if(deptNoList.stream().noneMatch(u ->u.equals(param.getDeptNo()))){ continue;
param.setErrorMessage(InsurancesConstants.OLD_DEPT_NO_NOT_IN_DEPT_LIST); }
listResult.add(param); if (deptNoList.stream().noneMatch(u -> u.equals(param.getDeptNo()))) {
continue; param.setErrorMessage(InsurancesConstants.OLD_DEPT_NO_NOT_IN_DEPT_LIST);
} listResult.add(param);
//校验当前项目是否在权限范围内 continue;
if(deptNoList.stream().noneMatch(u ->u.equals(param.getReplaceDeptNo()))){ }
param.setErrorMessage(InsurancesConstants.NEW_DEPT_NO_NOT_IN_DEPT_LIST); //校验当前项目是否在权限范围内
listResult.add(param); if (deptNoList.stream().noneMatch(u -> u.equals(param.getReplaceDeptNo()))) {
continue; param.setErrorMessage(InsurancesConstants.NEW_DEPT_NO_NOT_IN_DEPT_LIST);
listResult.add(param);
continue;
}
} }
// 投保状态 待投保 不能替换 // 投保状态 待投保 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.ONE_INT){ if (detail.getBuyHandleStatus() == CommonConstants.ONE_INT){
...@@ -4343,8 +4364,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4343,8 +4364,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
operate.setCreateBy(user.getId()); operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname()); operate.setCreateName(user.getNickname());
}else { }else {
operate.setCreateBy("1"); operate.setCreateBy(detail.getCreateBy());
operate.setCreateName("自动化派单"); operate.setCreateName(detail.getCreateName());
} }
operate.setCreateTime(LocalDateTime.now()); operate.setCreateTime(LocalDateTime.now());
operateList.add(operate); operateList.add(operate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment