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;
*/
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
private ArchivesDaprUtil archivesDaprUtil;
@Resource
private TInsuranceSettleService tInsuranceSettleService;
@Resource
private TInsuranceSettleService insuranceSettleService;
private TInsuranceOperateService tInsuranceOperateService;
/***********************商险办理********************************/
......@@ -165,7 +164,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
this.saveBatch(detailList);
}
//todo 操作记录
//操作记录
addOperate(detailList,user,InsurancesConstants.ADD);
return R.ok(listResult,InsurancesConstants.ADD_SUCCESS);
}
......@@ -191,8 +191,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceBatchParam> listResult = map.get("listResult");
//保存到数据库中的结果
List<InsuranceBatchParam> listSuccess = map.get("listSuccess");
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
List<TInsuranceDetail> detailList = new ArrayList<>();
for (InsuranceBatchParam success : listSuccess) {
TInsuranceDetail detail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(success,detail);
......@@ -206,7 +206,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
this.saveBatch(detailList);
}
//todo 操作记录
//操作记录
addOperate(detailList,user,InsurancesConstants.BATCH);
return R.ok(listResult,InsurancesConstants.BATCH_SUCCESS);
}
......@@ -232,6 +233,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceReplaceParam> listResult = map.get("listResult");
//保存到数据库中的结果
List<InsuranceReplaceParam> listSuccess = map.get("listSuccess");
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
for (InsuranceReplaceParam success : listSuccess) {
//替换
......@@ -280,9 +282,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replace.setCreateTime(LocalDateTime.now());
tInsuranceReplaceService.save(replace);
}
detailList.add(newDetail);
}
}
//todo 操作记录
//操作记录
addOperate(detailList,user,InsurancesConstants.REPLACE);
return R.ok(listResult,InsurancesConstants.REPLACE_SUCCESS);
}
......@@ -295,6 +299,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
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);
if (null == byId){
return R.failed(InsurancesConstants.DATA_IS_NOT_EXIST);
......@@ -304,6 +312,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
byId.setDeleteFlag(CommonConstants.ONE_INT);
this.updateById(byId);
//操作记录
addOperate(Arrays.asList(byId),user,InsurancesConstants.DELETE);
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -400,6 +410,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else {
return R.failed(InsurancesConstants.EDIT_NOT_ALLOW);
}
//操作记录
addOperate(Arrays.asList(byId),user,InsurancesConstants.EDIT);
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -474,6 +486,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isNotEmpty(detailList)){
this.saveOrUpdateBatch(detailList);
}
//操作记录
addOperate(detailList,user,InsurancesConstants.EXPORT);
}
return insuranceExportList;
}
......@@ -506,6 +520,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//更新
this.saveOrUpdateBatch(detailList);
}
//操作记录
addOperate(detailList,user,InsurancesConstants.ROLLBACK);
return R.ok(errorList,InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -542,6 +558,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.saveOrUpdateBatch(detailList);
//todo 根据结算类型推送ekp
}
//操作记录
addOperate(detailList,user,InsurancesConstants.SUCCESSFUL);
return R.ok(errorList, InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -566,6 +584,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceRegisterParam> listResult = map.get("listResult");
//保存到数据库中的结果
List<InsuranceRegisterParam> listSuccess = map.get("listSuccess");
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
for (InsuranceRegisterParam success : listSuccess) {
//登记保单保费
......@@ -589,9 +608,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// todo 根据结算类型判断推送ekp
}
detailList.add(detail);
}
}
//todo 操作记录
//操作记录
addOperate(detailList,user,InsurancesConstants.REGISTERED);
return R.ok(listResult,InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -1316,6 +1337,35 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
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
//查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = insuranceSettleService.getOne(insuranceSettleQuery);
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为已结算时,不能变更结算月
if (CommonConstants.FOUR_STRING.equals(insuranceSettle.getSettleHandleStatus())){
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