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

Merge branch 'feature-licancan' into 'develop'

Feature licancan

See merge request fangxinjiang/yifu!35
parents 5ef48817 44e9fce0
...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity; ...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @author licancan
* @description 商险操作表 t_insurance_operate
* @date 2022-07-25 14:20:16
*/
@Data
@TableName("t_insurance_operate")
@Schema(description = "商险操作表")
public class TInsuranceOperate implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
* 商险明细id
*/
@Schema(description = "商险明细id")
private String insuranceDetailId;
/**
* 操作描述 新增商险人员/批增商险人员/替换商险/变更所属项目/商险导出办理/商险办理成功/商险办理失败。。。。。
*/
@Schema(description = "操作描述")
private String operateDesc;
/**
* 创建者
*/
@Schema(description = "创建人")
private String createBy;
/**
* 创建人姓名
*/
@Schema(description = "创建人-姓名")
private String createName;
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
...@@ -11,8 +11,9 @@ import java.math.BigDecimal; ...@@ -11,8 +11,9 @@ import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
* 商险结算表 * @author licancan
* @TableName t_insurance_settle * @description 商险结算表 t_insurance_settle
* @date 2022-07-25 14:20:16
*/ */
@Data @Data
@TableName("t_insurance_settle") @TableName("t_insurance_settle")
......
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*; import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
...@@ -159,11 +160,11 @@ public class TInsuranceDetailController { ...@@ -159,11 +160,11 @@ public class TInsuranceDetailController {
* *
* @author licancan * @author licancan
* @param idList * @param idList
* @return {@link R<String>} * @return {@link R<List<TInsuranceDetail>>}
*/ */
@Operation(summary = "投保退回", description = "投保退回") @Operation(summary = "投保退回", description = "投保退回")
@PostMapping("/rollBackInsurance") @PostMapping("/rollBackInsurance")
public R<String> rollBackInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){ public R<List<TInsuranceDetail>> rollBackInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){
return tInsuranceDetailService.rollBackInsurance(idList); return tInsuranceDetailService.rollBackInsurance(idList);
} }
...@@ -172,11 +173,11 @@ public class TInsuranceDetailController { ...@@ -172,11 +173,11 @@ public class TInsuranceDetailController {
* *
* @author licancan * @author licancan
* @param idList * @param idList
* @return {@link R<String>} * @return {@link R<List<TInsuranceDetail>>}
*/ */
@Operation(summary = "办理成功", description = "办理成功") @Operation(summary = "办理成功", description = "办理成功")
@PostMapping("/successfulInsurance") @PostMapping("/successfulInsurance")
public R<String> successfulInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){ public R<List<TInsuranceDetail>> successfulInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){
return tInsuranceDetailService.successfulInsurance(idList); return tInsuranceDetailService.successfulInsurance(idList);
} }
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import org.apache.ibatis.annotations.Mapper;
/**
* @author licancan
* @description 针对表【t_insurance_operate(商险操作表)】的数据库操作Mapper
* @date 2022-07-25 14:20:16
*/
@Mapper
public interface TInsuranceOperateMapper extends BaseMapper<TInsuranceOperate> {
}
...@@ -5,13 +5,11 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle; ...@@ -5,13 +5,11 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
* @author Administrator * @author licancan
* @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Mapper * @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Mapper
* @createDate 2022-07-21 16:21:22 * @date 2022-07-25 14:20:16
* @Entity generator.domain.TInsuranceSettle */
*/
@Mapper @Mapper
public interface TInsuranceSettleMapper extends BaseMapper<TInsuranceSettle> { public interface TInsuranceSettleMapper extends BaseMapper<TInsuranceSettle> {
} }
...@@ -104,18 +104,18 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -104,18 +104,18 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* *
* @author licancan * @author licancan
* @param idList * @param idList
* @return {@link R<String>} * @return {@link R<List<TInsuranceDetail>>}
*/ */
R<String> rollBackInsurance(List<String> idList); R<List<TInsuranceDetail>> rollBackInsurance(List<String> idList);
/** /**
* 办理成功 * 办理成功
* *
* @author licancan * @author licancan
* @param idList * @param idList
* @return {@link R<String>} * @return {@link R<List<TInsuranceDetail>>}
*/ */
R<String> successfulInsurance(List<String> idList); R<List<TInsuranceDetail>> successfulInsurance(List<String> idList);
/** /**
* 登记保单保费 * 登记保单保费
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
/**
* @author licancan
* @description 针对表【t_insurance_operate(商险操作表)】的数据库操作Service
* @date 2022-07-25 14:20:16
*/
public interface TInsuranceOperateService extends IService<TInsuranceOperate> {
}
...@@ -5,10 +5,10 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle; ...@@ -5,10 +5,10 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
* @author Administrator * @author licancan
* @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Service * @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Service
* @createDate 2022-07-21 16:21:22 * @date 2022-07-25 14:20:16
*/ */
@Service @Service
public interface TInsuranceSettleService extends IService<TInsuranceSettle> { public interface TInsuranceSettleService extends IService<TInsuranceSettle> {
......
...@@ -148,8 +148,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -148,8 +148,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceAddParam> listResult = map.get("listResult"); List<InsuranceAddParam> listResult = map.get("listResult");
//保存到数据库中的结果 //保存到数据库中的结果
List<InsuranceAddParam> listSuccess = map.get("listSuccess"); List<InsuranceAddParam> listSuccess = map.get("listSuccess");
if (CollectionUtils.isNotEmpty(listSuccess)){
List<TInsuranceDetail> detailList = new ArrayList<>(); List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
for (InsuranceAddParam success : listSuccess) { for (InsuranceAddParam success : listSuccess) {
TInsuranceDetail detail = new TInsuranceDetail(); TInsuranceDetail detail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(success,detail); BeanCopyUtils.copyProperties(success,detail);
...@@ -482,11 +482,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -482,11 +482,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* 投保退回 * 投保退回
* *
* @param idList * @param idList
* @return {@link R<String>} * @return {@link R<List<TInsuranceDetail>>}
* @author licancan * @author licancan
*/ */
@Override @Override
public R<String> rollBackInsurance(List<String> idList) { public R<List<TInsuranceDetail>> rollBackInsurance(List<String> idList) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN); return R.failed(CommonConstants.PLEASE_LOG_IN);
...@@ -495,6 +495,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -495,6 +495,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY); return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
} }
List<TInsuranceDetail> detailList = baseMapper.selectBatchIds(idList); List<TInsuranceDetail> detailList = baseMapper.selectBatchIds(idList);
List<TInsuranceDetail> errorList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(detailList)){ if (CollectionUtils.isNotEmpty(detailList)){
detailList.stream().forEach(e ->{ detailList.stream().forEach(e ->{
// 记录状态置为「退回」 // 记录状态置为「退回」
...@@ -505,18 +506,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -505,18 +506,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//更新 //更新
this.saveOrUpdateBatch(detailList); this.saveOrUpdateBatch(detailList);
} }
return R.ok(InsurancesConstants.OPERATE_SUCCESS); return R.ok(errorList,InsurancesConstants.OPERATE_SUCCESS);
} }
/** /**
* 办理成功 * 办理成功
* *
* @param idList * @param idList
* @return {@link R<String>} * @return {@link R<List<TInsuranceDetail>>}
* @author licancan * @author licancan
*/ */
@Override @Override
public R<String> successfulInsurance(List<String> idList) { public R<List<TInsuranceDetail>> successfulInsurance(List<String> idList) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN); return R.failed(CommonConstants.PLEASE_LOG_IN);
...@@ -525,6 +526,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -525,6 +526,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY); return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
} }
List<TInsuranceDetail> detailList = baseMapper.selectBatchIds(idList); List<TInsuranceDetail> detailList = baseMapper.selectBatchIds(idList);
List<TInsuranceDetail> errorList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(detailList)){ if (CollectionUtils.isNotEmpty(detailList)){
for (TInsuranceDetail detail : detailList) { for (TInsuranceDetail detail : detailList) {
if (detail.getBuyType() == CommonConstants.THREE_INT){ if (detail.getBuyType() == CommonConstants.THREE_INT){
...@@ -540,7 +542,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -540,7 +542,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.saveOrUpdateBatch(detailList); this.saveOrUpdateBatch(detailList);
//todo 根据结算类型推送ekp //todo 根据结算类型推送ekp
} }
return R.ok(InsurancesConstants.OPERATE_SUCCESS); return R.ok(errorList, InsurancesConstants.OPERATE_SUCCESS);
} }
/** /**
...@@ -916,7 +918,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -916,7 +918,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
listResult.add(param); listResult.add(param);
continue; continue;
...@@ -1141,17 +1143,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1141,17 +1143,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
listResult.add(param); listResult.add(param);
continue; continue;
} }
if (ValidityUtil.validateIDCard(param.getReplaceEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getReplaceEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.REPLACE_EMP_IDCARD_NO_NOT_LEGITIMATE);
listResult.add(param); listResult.add(param);
continue; continue;
} }
// todo校验身份合法 // todo 校验身份合法
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){ if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
listResult.add(param); listResult.add(param);
...@@ -1180,10 +1182,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1180,10 +1182,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
}else { }else {
// 无效、已过期、已出险、已减员的 不能替换 // 无效、已过期、已出险、已减员的 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.FIVE_INT if (detail.getBuyHandleStatus() == CommonConstants.FIVE_INT){
|| detail.getIsUse() == CommonConstants.ONE_INT
|| detail.getIsOverdue() == CommonConstants.ONE_INT
|| detail.getIsEffect() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.REPLACE_IS_NOT_ALLOW); param.setErrorMessage(InsurancesConstants.REPLACE_IS_NOT_ALLOW);
listResult.add(param); listResult.add(param);
continue; continue;
...@@ -1255,7 +1254,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1255,7 +1254,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
listResult.add(param); listResult.add(param);
continue; continue;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceOperateMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import org.springframework.stereotype.Service;
/**
* @author licancan
* @description 针对表【t_insurance_operate(商险操作表)】的数据库操作Service实现
* @date 2022-07-25 14:20:16
*/
@Service
public class TInsuranceOperateServiceImpl extends ServiceImpl<TInsuranceOperateMapper, TInsuranceOperate> implements TInsuranceOperateService {
}
...@@ -8,12 +8,11 @@ import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceSettleService; ...@@ -8,12 +8,11 @@ import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceSettleService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
* @author Administrator * @author licancan
* @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Service实现 * @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Service实现
* @createDate 2022-07-21 16:21:22 * @date 2022-07-25 14:20:16
*/ */
@Service @Service
public class TInsuranceSettleServiceImpl extends ServiceImpl<TInsuranceSettleMapper, TInsuranceSettle> public class TInsuranceSettleServiceImpl extends ServiceImpl<TInsuranceSettleMapper, TInsuranceSettle> implements TInsuranceSettleService {
implements TInsuranceSettleService {
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="insuranceDetailId" column="INSURANCE_DETAIL_ID" jdbcType="VARCHAR"/>
<result property="operateDesc" column="OPERATE_DESC" jdbcType="VARCHAR"/>
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
<result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
ID,INSURANCE_DETAIL_ID,OPERATE_DESC,
CREATE_BY,CREATE_NAME,CREATE_TIME
</sql>
</mapper>
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