Commit 58e98afc authored by 李灿灿's avatar 李灿灿

商险退回和办理成功接口

parent f16d14ba
......@@ -154,6 +154,32 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.getInsuranceExportList(param));
}
/**
* 投保退回
*
* @author licancan
* @param idList
* @return {@link R<String>}
*/
@Operation(summary = "投保退回", description = "投保退回")
@PostMapping("/rollBackInsurance")
public R<String> rollBackInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){
return tInsuranceDetailService.rollBackInsurance(idList);
}
/**
* 办理成功
*
* @author licancan
* @param idList
* @return {@link R<String>}
*/
@Operation(summary = "办理成功", description = "办理成功")
@PostMapping("/successfulInsurance")
public R<String> successfulInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){
return tInsuranceDetailService.successfulInsurance(idList);
}
/***********************减员办理********************************/
/**
* 导入减员校验
......
......@@ -99,6 +99,24 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/
List<InsuranceExportListVO> getInsuranceExportList(InsuranceExportListParam param);
/**
* 投保退回
*
* @author licancan
* @param idList
* @return {@link R<String>}
*/
R<String> rollBackInsurance(List<String> idList);
/**
* 办理成功
*
* @author licancan
* @param idList
* @return {@link R<String>}
*/
R<String> successfulInsurance(List<String> idList);
/***********************减员办理********************************/
/**
* 减员导入校验
......
......@@ -458,6 +458,71 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return insuranceExportList;
}
/**
* 投保退回
*
* @param idList
* @return {@link R<String>}
* @author licancan
*/
@Override
public R<String> rollBackInsurance(List<String> idList) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
if (CollectionUtils.isEmpty(idList)){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
}
List<TInsuranceDetail> detailList = baseMapper.selectBatchIds(idList);
if (CollectionUtils.isNotEmpty(detailList)){
detailList.stream().forEach(e ->{
// 记录状态置为「退回」
e.setBuyHandleStatus(CommonConstants.FOUR_INT);
e.setUpdateBy(user.getId());
e.setUpdateTime(LocalDateTime.now());
});
//更新
this.saveOrUpdateBatch(detailList);
}
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
/**
* 办理成功
*
* @param idList
* @return {@link R<String>}
* @author licancan
*/
@Override
public R<String> successfulInsurance(List<String> idList) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
if (CollectionUtils.isEmpty(idList)){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
}
List<TInsuranceDetail> detailList = baseMapper.selectBatchIds(idList);
if (CollectionUtils.isNotEmpty(detailList)){
for (TInsuranceDetail detail : detailList) {
if (detail.getBuyType() == CommonConstants.THREE_INT){
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
}
//记录状态均置为「已投保」
detail.setBuyHandleStatus(CommonConstants.THREE_INT);
//记录的有效状态,置为「有效」
detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT);
}
//更新
this.saveOrUpdateBatch(detailList);
//todo 根据结算类型推送ekp
}
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
/**
* 商险新增校验
*
......
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