Commit a721ff14 authored by 李灿灿's avatar 李灿灿

Merge branch 'feature-licancan' into 'develop'

商险操作记录

See merge request fangxinjiang/yifu!36
parents c423d005 18631baf
...@@ -7,6 +7,42 @@ package com.yifu.cloud.plus.v1.yifu.insurances.constants; ...@@ -7,6 +7,42 @@ package com.yifu.cloud.plus.v1.yifu.insurances.constants;
*/ */
public class InsurancesConstants { public class InsurancesConstants {
/**
* 新增
*/
public static final String ADD = "新增";
/**
* 批增
*/
public static final String BATCH = "批增";
/**
* 替换
*/
public static final String REPLACE = "替换";
/**
* 删除
*/
public static final String DELETE = "删除";
/**
* 编辑
*/
public static final String EDIT = "编辑";
/**
* 导出办理
*/
public static final String EXPORT = "导出办理";
/**
* 投保退回
*/
public static final String ROLLBACK = "投保退回";
/**
* 办理成功
*/
public static final String SUCCESSFUL = "办理成功";
/**
* 登记保单保费
*/
public static final String REGISTERED = "登记保单保费";
/** /**
* 新增投保成功 * 新增投保成功
*/ */
......
...@@ -63,9 +63,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -63,9 +63,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private ArchivesDaprUtil archivesDaprUtil; private ArchivesDaprUtil archivesDaprUtil;
@Resource @Resource
private TInsuranceSettleService tInsuranceSettleService; private TInsuranceSettleService tInsuranceSettleService;
@Resource @Resource
private TInsuranceSettleService insuranceSettleService; private TInsuranceOperateService tInsuranceOperateService;
/***********************商险办理********************************/ /***********************商险办理********************************/
...@@ -165,7 +164,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -165,7 +164,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
this.saveBatch(detailList); this.saveBatch(detailList);
} }
//todo 操作记录 //操作记录
addOperate(detailList,user,InsurancesConstants.ADD);
return R.ok(listResult,InsurancesConstants.ADD_SUCCESS); return R.ok(listResult,InsurancesConstants.ADD_SUCCESS);
} }
...@@ -191,8 +191,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -191,8 +191,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceBatchParam> listResult = map.get("listResult"); List<InsuranceBatchParam> listResult = map.get("listResult");
//保存到数据库中的结果 //保存到数据库中的结果
List<InsuranceBatchParam> listSuccess = map.get("listSuccess"); List<InsuranceBatchParam> listSuccess = map.get("listSuccess");
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){ if (CollectionUtils.isNotEmpty(listSuccess)){
List<TInsuranceDetail> detailList = new ArrayList<>();
for (InsuranceBatchParam success : listSuccess) { for (InsuranceBatchParam success : listSuccess) {
TInsuranceDetail detail = new TInsuranceDetail(); TInsuranceDetail detail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(success,detail); BeanCopyUtils.copyProperties(success,detail);
...@@ -206,7 +206,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -206,7 +206,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
this.saveBatch(detailList); this.saveBatch(detailList);
} }
//todo 操作记录 //操作记录
addOperate(detailList,user,InsurancesConstants.BATCH);
return R.ok(listResult,InsurancesConstants.BATCH_SUCCESS); return R.ok(listResult,InsurancesConstants.BATCH_SUCCESS);
} }
...@@ -232,6 +233,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -232,6 +233,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceReplaceParam> listResult = map.get("listResult"); List<InsuranceReplaceParam> listResult = map.get("listResult");
//保存到数据库中的结果 //保存到数据库中的结果
List<InsuranceReplaceParam> listSuccess = map.get("listSuccess"); List<InsuranceReplaceParam> listSuccess = map.get("listSuccess");
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){ if (CollectionUtils.isNotEmpty(listSuccess)){
for (InsuranceReplaceParam success : listSuccess) { for (InsuranceReplaceParam success : listSuccess) {
//替换 //替换
...@@ -280,9 +282,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -280,9 +282,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replace.setCreateTime(LocalDateTime.now()); replace.setCreateTime(LocalDateTime.now());
tInsuranceReplaceService.save(replace); tInsuranceReplaceService.save(replace);
} }
detailList.add(newDetail);
} }
} }
//todo 操作记录 //操作记录
addOperate(detailList,user,InsurancesConstants.REPLACE);
return R.ok(listResult,InsurancesConstants.REPLACE_SUCCESS); return R.ok(listResult,InsurancesConstants.REPLACE_SUCCESS);
} }
...@@ -295,6 +299,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -295,6 +299,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public R<String> deleteInsurance(String id) { public R<String> deleteInsurance(String id) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
TInsuranceDetail byId = this.getById(id); TInsuranceDetail byId = this.getById(id);
if (null == byId){ if (null == byId){
return R.failed(InsurancesConstants.DATA_IS_NOT_EXIST); return R.failed(InsurancesConstants.DATA_IS_NOT_EXIST);
...@@ -304,6 +312,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -304,6 +312,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
byId.setDeleteFlag(CommonConstants.ONE_INT); byId.setDeleteFlag(CommonConstants.ONE_INT);
this.updateById(byId); this.updateById(byId);
//操作记录
addOperate(Arrays.asList(byId),user,InsurancesConstants.DELETE);
return R.ok(InsurancesConstants.OPERATE_SUCCESS); return R.ok(InsurancesConstants.OPERATE_SUCCESS);
} }
...@@ -400,6 +410,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -400,6 +410,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else { }else {
return R.failed(InsurancesConstants.EDIT_NOT_ALLOW); return R.failed(InsurancesConstants.EDIT_NOT_ALLOW);
} }
//操作记录
addOperate(Arrays.asList(byId),user,InsurancesConstants.EDIT);
return R.ok(InsurancesConstants.OPERATE_SUCCESS); return R.ok(InsurancesConstants.OPERATE_SUCCESS);
} }
...@@ -474,6 +486,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -474,6 +486,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isNotEmpty(detailList)){ if (CollectionUtils.isNotEmpty(detailList)){
this.saveOrUpdateBatch(detailList); this.saveOrUpdateBatch(detailList);
} }
//操作记录
addOperate(detailList,user,InsurancesConstants.EXPORT);
} }
return insuranceExportList; return insuranceExportList;
} }
...@@ -506,6 +520,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -506,6 +520,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//更新 //更新
this.saveOrUpdateBatch(detailList); this.saveOrUpdateBatch(detailList);
} }
//操作记录
addOperate(detailList,user,InsurancesConstants.ROLLBACK);
return R.ok(errorList,InsurancesConstants.OPERATE_SUCCESS); return R.ok(errorList,InsurancesConstants.OPERATE_SUCCESS);
} }
...@@ -542,6 +558,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -542,6 +558,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.saveOrUpdateBatch(detailList); this.saveOrUpdateBatch(detailList);
//todo 根据结算类型推送ekp //todo 根据结算类型推送ekp
} }
//操作记录
addOperate(detailList,user,InsurancesConstants.SUCCESSFUL);
return R.ok(errorList, InsurancesConstants.OPERATE_SUCCESS); return R.ok(errorList, InsurancesConstants.OPERATE_SUCCESS);
} }
...@@ -566,6 +584,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -566,6 +584,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceRegisterParam> listResult = map.get("listResult"); List<InsuranceRegisterParam> listResult = map.get("listResult");
//保存到数据库中的结果 //保存到数据库中的结果
List<InsuranceRegisterParam> listSuccess = map.get("listSuccess"); List<InsuranceRegisterParam> listSuccess = map.get("listSuccess");
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){ if (CollectionUtils.isNotEmpty(listSuccess)){
for (InsuranceRegisterParam success : listSuccess) { for (InsuranceRegisterParam success : listSuccess) {
//登记保单保费 //登记保单保费
...@@ -589,9 +608,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -589,9 +608,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// todo 根据结算类型判断推送ekp // todo 根据结算类型判断推送ekp
} }
detailList.add(detail);
} }
} }
//todo 操作记录 //操作记录
addOperate(detailList,user,InsurancesConstants.REGISTERED);
return R.ok(listResult,InsurancesConstants.OPERATE_SUCCESS); return R.ok(listResult,InsurancesConstants.OPERATE_SUCCESS);
} }
...@@ -1316,6 +1337,35 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1316,6 +1337,35 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return String.valueOf(RedisUtil.redis.opsForValue().get(CacheConstants.AREA_VALUE + areaString)); return String.valueOf(RedisUtil.redis.opsForValue().get(CacheConstants.AREA_VALUE + areaString));
} }
/**
* 操作记录
*
* @author licancan
* @param detailList 商险明细集合
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(List<TInsuranceDetail> detailList,YifuUser user,String operateDesc){
if (CollectionUtils.isNotEmpty(detailList)){
try {
List<TInsuranceOperate> operateList = new ArrayList<>();
for (TInsuranceDetail detail : detailList) {
TInsuranceOperate operate = new TInsuranceOperate();
operate.setInsuranceDetailId(detail.getId());
operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now());
operateList.add(operate);
}
tInsuranceOperateService.saveBatch(operateList);
}catch (Exception e){
e.getStackTrace();
}
}
}
/***********************减员办理********************************/ /***********************减员办理********************************/
/** /**
* 减员导入校验 * 减员导入校验
...@@ -1792,7 +1842,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1792,7 +1842,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//查询结算状态 //查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId()); insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = insuranceSettleService.getOne(insuranceSettleQuery); TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为已结算时,不能变更结算月 //当前结算状态为已结算时,不能变更结算月
if (CommonConstants.FOUR_STRING.equals(insuranceSettle.getSettleHandleStatus())){ if (CommonConstants.FOUR_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR); param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR);
......
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