Commit 656fb35b authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

"feature-zhaJi:修复减员创建人bug,新增orderNo字段"

See merge request fangxinjiang/yifu!205
parents da8f6b9a 4f2d25e6
......@@ -285,5 +285,29 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "商险办理时间")
private LocalDateTime handledTime;
private static final long serialVersionUID = 1L;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 创建人所在部门
*/
@Schema(description = "创建人所在部门")
private String createUserDeptId;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -32,6 +32,12 @@ public class TInsuranceRefund extends BaseEntity {
@Schema(description = "保单信息主键")
private String insDetailId;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 减员状态
*/
......@@ -56,7 +62,17 @@ public class TInsuranceRefund extends BaseEntity {
@Schema(description = "是否删除 0否/1是")
private Integer deleteFlag;
/**
* 创建人所在部门
*/
@Schema(description = "创建人所在部门")
private String createUserDeptId;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
private static final long serialVersionUID = 1L;
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 11:57:55
*/
@Data
public class InsuranceListOrderParam {
private String orderNo;
private List<InsuranceAddParam> data;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 12:13:48
*/
@Data
public class InsuranceOrderBatchParam {
private String orderNo;
private List<InsuranceBatchParam> data;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 12:35:52
*/
@Data
public class InsuranceOrderRefundParam {
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
private List<InsuranceRefundCheck> data;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 12:29:28
*/
@Data
public class InsuranceOrderReplaceParam {
private String orderNo;
private List<InsuranceReplaceParam> data;
}
......@@ -23,6 +23,12 @@ public class InsuranceRefundCheck implements Serializable {
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 员工姓名
*/
......
......@@ -118,7 +118,7 @@ public class TInsuranceDetailController {
*/
@Operation(summary = "投保新增", description = "投保新增")
@PostMapping("/addInsurance")
public R<List<InsuranceAddParam>> addInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceAddParam> paramList){
public R<List<InsuranceAddParam>> addInsurance(@RequestBody InsuranceListOrderParam paramList ){
return tInsuranceDetailService.addInsurance(paramList);
}
......@@ -131,7 +131,7 @@ public class TInsuranceDetailController {
*/
@Operation(summary = "投保批增", description = "投保批增")
@PostMapping("/batchInsurance")
public R<List<InsuranceBatchParam>> batchInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceBatchParam> paramList){
public R<List<InsuranceBatchParam>> batchInsurance(@RequestBody InsuranceOrderBatchParam paramList){
return tInsuranceDetailService.batchInsurance(paramList);
}
......@@ -144,7 +144,7 @@ public class TInsuranceDetailController {
*/
@Operation(summary = "投保替换", description = "投保替换")
@PostMapping("/replaceInsurance")
public R<List<InsuranceReplaceParam>> replaceInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceReplaceParam> paramList){
public R<List<InsuranceReplaceParam>> replaceInsurance(@RequestBody InsuranceOrderReplaceParam paramList){
return tInsuranceDetailService.replaceInsurance(paramList);
}
......@@ -280,15 +280,15 @@ public class TInsuranceDetailController {
}
/***********************减员办理********************************/
/**
* 导入减员校验
* @param insuranceRefundCheckList 导入减员校验
* 导入减员
* @param param 导入减员校验
* @author zhaji
* @date 2022-07-19
* @since v1.0
*/
@PostMapping("/saveInsuranceRefund")
public R saveInsuranceRefund(@RequestBody @Valid @Size(min = 1,message = "导入减员列表不能为空") List<InsuranceRefundCheck> insuranceRefundCheckList){
return tInsuranceDetailService.saveInsuranceRefund(insuranceRefundCheckList);
public R saveInsuranceRefund(@RequestBody InsuranceOrderRefundParam param){
return tInsuranceDetailService.saveInsuranceRefund(param);
}
/**
......@@ -353,7 +353,7 @@ public class TInsuranceDetailController {
*/
@Operation(summary = "已减员列表分页查询", description = "已减员列表分页查询")
@PostMapping("/getInsuranceRefundPageList")
public R<IPage<InsuranceRefundListVo>> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, @RequestBody InsuranceRefundParam param) {
public R getInsuranceRefundPageList(Page<InsuranceRefundParam> page, @RequestBody InsuranceRefundParam param) {
return tInsuranceDetailService.getInsuranceRefundPageList(page,param);
}
......
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author Administrator
......@@ -22,7 +23,7 @@ public interface TInsuranceRefundMapper extends BaseMapper<TInsuranceRefund> {
*/
TInsuranceRefund getByInsDetailId(String id);
void updateByInsDetailId(TInsuranceRefund insuranceRefund);
void updateByInsDetailId(@Param("param") TInsuranceRefund insuranceRefund);
int updateRefundMoney(TInsuranceRefund insuranceRefund);
}
......@@ -75,7 +75,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList
* @return {@link R<List<InsuranceAddParam>>}
*/
R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList);
R<List<InsuranceAddParam>> addInsurance(InsuranceListOrderParam paramList);
/**
* 商险批增
......@@ -84,7 +84,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList
* @return {@link R<List<InsuranceBatchParam>>}
*/
R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList);
R<List<InsuranceBatchParam>> batchInsurance(InsuranceOrderBatchParam paramList);
/**
* 商险替换
*
......@@ -92,7 +92,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList
* @return {@link R<List<InsuranceReplaceParam>>}
*/
R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList);
R<List<InsuranceReplaceParam>> replaceInsurance(InsuranceOrderReplaceParam paramList);
/**
* 通过id删除
......@@ -184,10 +184,10 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* 减员导入
*
* @author zhaji
* @param insuranceRefundCheckList 减员表
* @param param 减员表
* @return {@link R}
*/
R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList);
R saveInsuranceRefund(InsuranceOrderRefundParam param);
/**
* 已投保列表分页查询
......
......@@ -267,15 +267,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList) {
if (CollectionUtils.isEmpty(paramList)){
public R<List<InsuranceAddParam>> addInsurance(InsuranceListOrderParam paramList) {
if (CollectionUtils.isEmpty(paramList.getData())){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
Map<String, List<InsuranceAddParam>> map = addInsuranceCheck(paramList,user);
Map<String, List<InsuranceAddParam>> map = addInsuranceCheck(paramList.getData(),user);
//返回给前端的结果
List<InsuranceAddParam> listResult = map.get("listResult");
//保存到数据库中的结果
......@@ -286,7 +286,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail detail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(success,detail);
//购买类型,默认为「新增」
detail.setOrderNo(paramList.getOrderNo());
detail.setBuyType(CommonConstants.ONE_INT);
detail.setCreateUserDeptId(user.getDeptId().toString());
detail.setCreateUserDeptName(user.getDeptName());
//投保状态:待投保
detail.setBuyHandleStatus(CommonConstants.ONE_INT);
detail.setPolicyStart(LocalDateUtil.parseLocalDate(success.getPolicyStart()));
......@@ -314,15 +317,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList) {
if (CollectionUtils.isEmpty(paramList)){
public R<List<InsuranceBatchParam>> batchInsurance(InsuranceOrderBatchParam paramList) {
if (CollectionUtils.isEmpty(paramList.getData())){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
Map<String, List<InsuranceBatchParam>> map = batchInsuranceCheck(paramList,user);
Map<String, List<InsuranceBatchParam>> map = batchInsuranceCheck(paramList.getData(),user);
//返回给前端的结果
List<InsuranceBatchParam> listResult = map.get("listResult");
//保存到数据库中的结果
......@@ -337,6 +340,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//投保状态:待投保
detail.setBuyHandleStatus(CommonConstants.ONE_INT);
//保费都默认是0
detail.setOrderNo(paramList.getOrderNo());
detail.setCreateUserDeptId(user.getDeptId().toString());
detail.setCreateUserDeptName(user.getDeptName());
detail.setActualPremium(new BigDecimal("0.00"));
detail.setEstimatePremium(new BigDecimal("0.00"));
detail.setCreateBy(user.getId());
......@@ -359,15 +365,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList) {
if (CollectionUtils.isEmpty(paramList)){
public R<List<InsuranceReplaceParam>> replaceInsurance(InsuranceOrderReplaceParam paramList) {
if (CollectionUtils.isEmpty(paramList.getData())){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
Map<String, List<InsuranceReplaceParam>> map = replaceInsuranceCheck(paramList,user);
Map<String, List<InsuranceReplaceParam>> map = replaceInsuranceCheck(paramList.getData(),user);
//返回给前端的结果
List<InsuranceReplaceParam> listResult = map.get("listResult");
//保存到数据库中的结果
......@@ -397,6 +403,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.updateById(detail);
//新数据置为待办理
newDetail.setId(null);
newDetail.setOrderNo(paramList.getOrderNo());
newDetail.setBuyHandleStatus(CommonConstants.ONE_INT);
newDetail.setBuyType(CommonConstants.FOUR_INT);
newDetail.setEmpName(success.getReplaceEmpName());
......@@ -410,6 +417,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail.setIsUse(null);
newDetail.setIsEffect(null);
newDetail.setReduceHandleStatus(null);
newDetail.setCreateUserDeptId(user.getDeptId().toString());
newDetail.setCreateUserDeptName(user.getDeptName());
newDetail.setSignFlag(CommonConstants.ZERO_INT);
//创建时间是新数据插入时间
newDetail.setCreateTime(LocalDateTime.now());
......@@ -2874,16 +2883,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* 减员导入
*
* @author zhaji
* @param insuranceRefundCheckList 减员表
* @param param 减员表
* @return {@link R}
*/
@Override
public R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList) {
public R saveInsuranceRefund(InsuranceOrderRefundParam param) {
YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(insuranceRefundCheckList)){
if(!Common.isNotEmpty(param.getData())){
return R.failed("当前导入的减员信息为空");
}
Map<String, List<InsuranceRefundCheck>> refundMap = checkInsuranceRefundList(insuranceRefundCheckList,user);
Map<String, List<InsuranceRefundCheck>> refundMap = checkInsuranceRefundList(param.getData(),user);
List<InsuranceRefundCheck> successList = refundMap.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(successList)){
......@@ -2895,6 +2904,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefund.setUpdateTime(LocalDateTime.now());
insuranceRefund.setUpdateBy(user.getId());
insuranceRefund.setOrderNo(param.getOrderNo());
insuranceRefund.setCreateUserDeptId(user.getDeptId().toString());
insuranceRefund.setCreateUserDeptName(user.getDeptName());
if(StringUtils.isNotBlank(refund.getRemark())){
insuranceRefund.setRemark(refund.getRemark());
}
......@@ -3155,8 +3169,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detailList.add(detail);
refund.setInsDetailId(record.getId());
refund.setReduceHandleStatus(CommonConstants.TWO_INT);
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
refund.setUpdateBy(user.getId());
refund.setUpdateTime(LocalDateTime.now());
refundList.add(refund);
}
}
......@@ -3235,8 +3249,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
successList.add(tInsuranceDetail);
//更新减员记录
refund.setInsDetailId(tInsuranceDetail.getId());
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
refund.setUpdateBy(user.getId());
refund.setUpdateTime(LocalDateTime.now());
refund.setReduceHandleStatus(refundType);
refundList.add(refund);
}else{
......@@ -3281,8 +3295,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (InsuranceHandleImportParam param : successList) {
TInsuranceOperate operate = new TInsuranceOperate();
LambdaUpdateWrapper<TInsuranceRefund> refund = new LambdaUpdateWrapper<>();
refund.eq(TInsuranceRefund :: getInsDetailId ,param.getId());
refund.set(TInsuranceRefund :: getRemark,param.getRemark());
refund.eq(TInsuranceRefund :: getInsDetailId ,param.getId())
.set(TInsuranceRefund :: getRemark,param.getRemark())
.set(TInsuranceRefund :: getUpdateTime,LocalDateTime.now())
.set(TInsuranceRefund :: getUpdateBy,user.getId());
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail::getId, param.getId())
.set(TInsuranceDetail::getUpdateBy, user.getId())
......
......@@ -53,6 +53,9 @@
<result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/>
<result property="handledBy" column="HANDLED_BY" jdbcType="VARCHAR"/>
<result property="handledTime" column="HANDLED_TIME" jdbcType="TIMESTAMP"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="createUserDeptId" column="CREATE_USER_DEPT_ID" jdbcType="VARCHAR"/>
<result property="createUserDeptName" column="CREATE_USER_DEPT_NAME" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -67,7 +70,8 @@
BUY_HANDLE_STATUS,DEFAULT_SETTLE_ID,REDUCE_HANDLE_STATUS,
IS_USE,IS_EFFECT,IS_OVERDUE,REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME,
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME
</sql>
<!--投保分页查询-->
<select id="getInsuranceListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
......
......@@ -13,26 +13,51 @@
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
<result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
</resultMap>
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="createUserDeptId" column="CREATE_USER_DEPT_ID" jdbcType="VARCHAR"/>
<result property="createUserDeptName" column="CREATE_USER_DEPT_NAME" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,INS_DETAIL_ID,REDUCE_HANDLE_STATUS,
REFUND_MONEY,REMARK,CREATE_TIME,
CREATE_BY,CREATE_NAME
CREATE_BY,CREATE_NAME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME
</sql>
<update id="updateByInsDetailId">
update
t_insurance_refund
set
REDUCE_HANDLE_STATUS = #{reduceHandleStatus},
REMARK = #{remark},
CREATE_NAME= #{createName},
CREATE_BY = #{createBy},
CREATE_TIME = #{createTime},
UPDATE_BY = #{createBy},
UPDATE_TIME = #{createTime}
<if test="param.createName != null and param.createName.trim() != ''">
CREATE_NAME= #{param.createName},
</if>
<if test="param.createBy != null and param.createBy.trim() != ''">
CREATE_BY = #{param.createBy},
</if>
<if test="param.createTime != null">
CREATE_TIME = #{param.createTime},
</if>
<if test="param.updateBy != null and param.updateBy.trim() != ''">
UPDATE_BY = #{param.updateBy},
</if>
<if test="param.updateTime != null ">
UPDATE_TIME = #{param.updateTime},
</if>
<if test="param.createUserDeptName != null and param.createUserDeptName.trim() != ''">
CREATE_USER_DEPT_NAME= #{param.createUserDeptName},
</if>
<if test="param.createUserDeptId != null and param.createUserDeptId.trim() != ''">
CREATE_USER_DEPT_ID = #{param.createUserDeptId},
</if>
<if test="param.orderNo != null and param.orderNo.trim() != ''">
ORDER_NO = #{param.orderNo},
</if>
<if test="param.remark != null and param.remark.trim() != ''">
REMARK = #{param.remark},
</if>
REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
where
INS_DETAIL_ID = #{insDetailId}
INS_DETAIL_ID = #{param.insDetailId}
</update>
<update id="updateRefundMoney">
update
......
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