Commit 1bbdfcce authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

parents 783ef484 47ee39d2
...@@ -573,6 +573,12 @@ public class InsurancesConstants { ...@@ -573,6 +573,12 @@ public class InsurancesConstants {
* 修改保险公司 * 修改保险公司
*/ */
public static final String UPDATE_INSURANCE_COMPANY = "修改保险公司"; public static final String UPDATE_INSURANCE_COMPANY = "修改保险公司";
/**
* 删除保险公司
*/
public static final String DELETE_INSURANCE_COMPANY = "删除保险公司";
/** /**
* 新增险种 * 新增险种
*/ */
...@@ -631,4 +637,6 @@ public class InsurancesConstants { ...@@ -631,4 +637,6 @@ public class InsurancesConstants {
public static final String MONTH_CHANGE = "变更结算月"; public static final String MONTH_CHANGE = "变更结算月";
} }
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 结算信息作废记录表(用于记录项目变更导致推信息送至EKP)
* @TableName t_insurance_settle_cancel
*/
public class TInsuranceSettleCancel implements Serializable {
/**
*
*/
private String id;
/**
* 结算明细id
*/
private String insDetailId;
/**
* 结算信息表id
*/
private String settleId;
/**
* 项目编码
*/
private String deptNo;
/**
* 项目名称
*/
private String deptName;
/**
* 订单编号
*/
private String orderNo;
/**
* 推送标识 1成功 0失败
*/
private Integer isCancelPush;
/**
* 创建时间
*/
private Date createTime;
/**
* 操作人
*/
private String createUesr;
private static final long serialVersionUID = 1L;
/**
*
*/
public String getId() {
return id;
}
/**
*
*/
public void setId(String id) {
this.id = id;
}
/**
* 结算明细id
*/
public String getInsDetailId() {
return insDetailId;
}
/**
* 结算明细id
*/
public void setInsDetailId(String insDetailId) {
this.insDetailId = insDetailId;
}
/**
* 结算信息表id
*/
public String getSettleId() {
return settleId;
}
/**
* 结算信息表id
*/
public void setSettleId(String settleId) {
this.settleId = settleId;
}
/**
* 项目编码
*/
public String getDeptNo() {
return deptNo;
}
/**
* 项目编码
*/
public void setDeptNo(String deptNo) {
this.deptNo = deptNo;
}
/**
* 项目名称
*/
public String getDeptName() {
return deptName;
}
/**
* 项目名称
*/
public void setDeptName(String deptName) {
this.deptName = deptName;
}
/**
* 订单编号
*/
public String getOrderNo() {
return orderNo;
}
/**
* 订单编号
*/
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
/**
* 推送标识 1成功 0失败
*/
public Integer getIsCancelPush() {
return isCancelPush;
}
/**
* 推送标识 1成功 0失败
*/
public void setIsCancelPush(Integer isCancelPush) {
this.isCancelPush = isCancelPush;
}
/**
* 创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 操作人
*/
public String getCreateUesr() {
return createUesr;
}
/**
* 操作人
*/
public void setCreateUesr(String createUesr) {
this.createUesr = createUesr;
}
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.insurances.entity; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -8,7 +8,7 @@ import java.io.Serializable; ...@@ -8,7 +8,7 @@ import java.io.Serializable;
/** /**
* @author zhaji * @author zhaji
* @description 项目 * @description 项目信息
* @date 2022-07-29 09:35:31 * @date 2022-07-29 09:35:31
*/ */
@Data @Data
......
...@@ -3,7 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller; ...@@ -3,7 +3,8 @@ 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.Dept; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.Dept;
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;
...@@ -404,4 +405,30 @@ public class TInsuranceDetailController { ...@@ -404,4 +405,30 @@ public class TInsuranceDetailController {
return tInsuranceDetailService.getDeptList(); return tInsuranceDetailService.getDeptList();
} }
/**
* 出险
*
* @author zhaji
* @param userName 姓名
* @param empIdcardNo 身份证
* @return {@link R<List< RefundExportListVo >>}
*/
@Operation(summary = "紧急出险", description = "紧急出险")
@GetMapping("/urgentUpdateIsUse")
public R urgentUpdateIsUse(String userName,String empIdcardNo) {
return tInsuranceDetailService.urgentUpdateIsUse(userName,empIdcardNo);
}
/**
* 根据身份证查询所有的商险列表
*
* @author huyc
* @return
*/
@Operation(summary = "根据身份证查询所有的商险列表", description = "根据身份证查询所有的商险列表")
@PostMapping("/getInsuranceListByIdCard")
public R<IPage<TInsuranceDetail>> getInsuranceListByIdCard(Page<TInsuranceDetail> page,
@RequestParam String idCard) {
return new R<>(tInsuranceDetailService.getInsuranceListByIdCard(page, idCard));
}
} }
...@@ -168,4 +168,13 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -168,4 +168,13 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @return {@link List< RefundExportListVo>} * @return {@link List< RefundExportListVo>}
*/ */
List<RefundExportListVo> getRefundExportList(@Param("param") RefundExportListParam param); List<RefundExportListVo> getRefundExportList(@Param("param") RefundExportListParam param);
/**
* 根据身份证查询商险信息
* @param idCard 身份证号
* @author huyc
* @date 2022-08-01
* @return
*/
IPage<TInsuranceDetail> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
} }
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.TInsuranceSettleCancel;
import org.apache.ibatis.annotations.Mapper;
/**
* @author Administrator
* @description 针对表【t_insurance_settle_cancel(结算信息作废记录表(用于记录项目变更导致推信息送至EKP))】的数据库操作Mapper
* @createDate 2022-08-01 11:37:54
* @Entity generator.domain.TInsuranceSettleCancel
*/
@Mapper
public interface TInsuranceSettleCancelMapper extends BaseMapper<TInsuranceSettleCancel> {
}
...@@ -276,4 +276,23 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -276,4 +276,23 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/ */
R getDeptList(); R getDeptList();
/**
* EKP紧急出险
*
* @author zhaji
* @param userName
* @param empIdcardNo
* @return {@link R}
*/
R urgentUpdateIsUse(String userName, String empIdcardNo);
/**
* 根据身份证查询商险列表
*
* @author huyc
* @param
* @return {@link R}
*/
IPage<TInsuranceDetail> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard);
} }
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.TInsuranceSettleCancel;
/**
* @author Administrator
* @description 针对表【t_insurance_settle_cancel(结算信息作废记录表(用于记录项目变更导致推信息送至EKP))】的数据库操作Service
* @createDate 2022-08-01 11:37:54
*/
public interface TInsuranceSettleCancelService extends IService<TInsuranceSettleCancel> {
}
...@@ -5,23 +5,24 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; ...@@ -5,23 +5,24 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
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.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil; import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
...@@ -35,8 +36,19 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM ...@@ -35,8 +36,19 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
@Resource @Resource
private TInsuranceDetailService insuranceDetailService; private TInsuranceDetailService tInsuranceDetailService;
@Resource
private TInsuranceOperateService tInsuranceOperateService;
/**
* 分页查询保险公司
*
* @author zhaji
* @param page 分页参数
* @param insuranceCompany 查询类
* @return {@link IPage< TInsuranceCompany>}
*/
@Override @Override
public IPage<TInsuranceCompany> pageDiy(Page page, TInsuranceCompany insuranceCompany) { public IPage<TInsuranceCompany> pageDiy(Page page, TInsuranceCompany insuranceCompany) {
LambdaQueryWrapper<TInsuranceCompany> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceCompany> wrapper = new LambdaQueryWrapper<>();
...@@ -45,6 +57,13 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM ...@@ -45,6 +57,13 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
return list; return list;
} }
/**
* 新增保险公司
*
* @author zhaji
* @param insuranceCompany 新增类
* @return {@link R}
*/
@Override @Override
public R saveInsuranceCompany(TInsuranceCompany insuranceCompany) { public R saveInsuranceCompany(TInsuranceCompany insuranceCompany) {
if(Common.isEmpty(insuranceCompany)){ if(Common.isEmpty(insuranceCompany)){
...@@ -56,7 +75,10 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM ...@@ -56,7 +75,10 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
return R.failed("计费方式格式不正确"); return R.failed("计费方式格式不正确");
} }
if (!ValidityUtil.validate60(insuranceCompany.getCompanyName())){ if (!ValidityUtil.validate60(insuranceCompany.getCompanyName())){
return R.failed("保险公司名称过长"); return R.failed("保险公司名称格式不正确");
}
if (!ValidityUtil.validate50(insuranceCompany.getCompanyAddress())){
return R.failed("保险公司地址格式不正确");
} }
boolean b = companyIsExists(insuranceCompany.getCompanyName()); boolean b = companyIsExists(insuranceCompany.getCompanyName());
if (!b){ if (!b){
...@@ -64,9 +86,11 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM ...@@ -64,9 +86,11 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
insuranceCompany.setCreateName(user.getNickname()); insuranceCompany.setCreateName(user.getNickname());
insuranceCompany.setCreateTime(LocalDateTime.now()); insuranceCompany.setCreateTime(LocalDateTime.now());
insuranceCompany.setDeleteFlag(CommonConstants.ZERO_INT); insuranceCompany.setDeleteFlag(CommonConstants.ZERO_INT);
return R.ok(save(insuranceCompany),"新增成功"); save(insuranceCompany);
addOperate(insuranceCompany,user, InsurancesConstants.NEW_INSURANCE_COMPANY);
return R.ok("新增成功");
}else{ }else{
return R.failed("当前保险公司已存在"); return R.failed("保险公司名称不能重复添加");
} }
} }
...@@ -88,6 +112,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM ...@@ -88,6 +112,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){ if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确"); return R.failed("计费方式格式不正确");
} }
if (!ValidityUtil.validate50(insuranceCompany.getCompanyAddress())){
return R.failed("保险公司地址格式不正确");
}
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceCompany::getId,id).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT); queryWrapper.eq(TInsuranceCompany::getId,id).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany one = this.getOne(queryWrapper); TInsuranceCompany one = this.getOne(queryWrapper);
...@@ -96,8 +123,8 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM ...@@ -96,8 +123,8 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
} }
String companyName = one.getCompanyName(); String companyName = one.getCompanyName();
String newCompanyName = insuranceCompany.getCompanyName(); String newCompanyName = insuranceCompany.getCompanyName();
if (newCompanyName.length()>CommonConstants.SIXTY_INT){ if (!ValidityUtil.validate60(newCompanyName)){
return R.failed("要修改的保险公司名称过长"); return R.failed("要修改的保险公司名称格式不正确");
} }
//如果当前保险公司名称和修改后的名称不同 //如果当前保险公司名称和修改后的名称不同
if (!companyName.equals(insuranceCompany.getCompanyName())){ if (!companyName.equals(insuranceCompany.getCompanyName())){
...@@ -105,22 +132,26 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM ...@@ -105,22 +132,26 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
LambdaQueryWrapper<TInsuranceDetail> detailQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> detailQueryWrapper = new LambdaQueryWrapper<>();
detailQueryWrapper.eq(TInsuranceDetail::getInsuranceCompanyName,companyName) detailQueryWrapper.eq(TInsuranceDetail::getInsuranceCompanyName,companyName)
.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT); .eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceDetail> list = insuranceDetailService.list(detailQueryWrapper); List<TInsuranceDetail> list = tInsuranceDetailService.list(detailQueryWrapper);
if (Common.isNotEmpty(list)){ if (Common.isNotEmpty(list)){
return R.failed("当前保险公司的名称已存在对应的商险信息,不能进行修改"); return R.failed("当前保险公司的名称已存在对应的商险信息,不能进行修改");
}else{ }else{
//校验新的保险公司名称在数据库中是否存在 //校验新的保险公司名称在数据库中是否存在
boolean b = companyIsExists(insuranceCompany.getCompanyName()); boolean b = companyIsExists(insuranceCompany.getCompanyName());
if(b){ if(b){
return R.failed("当前保险公司名称已存在"); return R.failed("保险公司名称不能重复");
}else { }else {
return R.ok(updateById(insuranceCompany)); updateById(insuranceCompany);
addOperate(insuranceCompany,user, InsurancesConstants.NEW_INSURANCE_COMPANY);
return R.ok("修改保险信息公司成功");
} }
} }
}else{ }else{
insuranceCompany.setUpdateBy(user.getId()); insuranceCompany.setUpdateBy(user.getId());
insuranceCompany.setUpdateTime(LocalDateTime.now()); insuranceCompany.setUpdateTime(LocalDateTime.now());
return R.ok(updateById(insuranceCompany)); updateById(insuranceCompany);
addOperate(one,user, InsurancesConstants.UPDATE_INSURANCE_COMPANY);
return R.ok("修改保险信息公司成功");
} }
} }
/** /**
...@@ -144,10 +175,36 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM ...@@ -144,10 +175,36 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
.set(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT) .set(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.set(TInsuranceCompany :: getUpdateBy,user.getId()) .set(TInsuranceCompany :: getUpdateBy,user.getId())
.set(TInsuranceCompany :: getUpdateTime,LocalDateTime.now()); .set(TInsuranceCompany :: getUpdateTime,LocalDateTime.now());
return R.ok(update(updateWrapper)); update(updateWrapper);
addOperate(one,user, InsurancesConstants.DELETE_INSURANCE_COMPANY);
return R.ok("删除成功");
}
}
/**
* 操作记录
*
* @author zhaji
* @param insuranceCompany 保险公司
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(TInsuranceCompany insuranceCompany,YifuUser user,String operateDesc){
try {
TInsuranceOperate operate = new TInsuranceOperate();
operate.setInsuranceDetailId(insuranceCompany.getId());
operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now());
tInsuranceOperateService.save(operate);
}catch (Exception e){
e.getStackTrace();
} }
} }
/** /**
* 查询当前保险公司列表 * 查询当前保险公司列表
* *
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl; package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -2688,7 +2689,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2688,7 +2689,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(CommonConstants.FIVE_INT == buyHandleStatus){ if(CommonConstants.FIVE_INT == buyHandleStatus){
return R.failed("当前员工已减员,不能进行出险操作"); return R.failed("当前员工已减员,不能进行出险操作");
} }
if(null != reduceHandleStatus){ if(null != reduceHandleStatus && CommonConstants.THREE_INT != reduceHandleStatus){
return R.failed("当前员工在减员中,不能进行出险操作"); return R.failed("当前员工在减员中,不能进行出险操作");
} }
Integer isEffect = insuranceDetail.getIsEffect(); Integer isEffect = insuranceDetail.getIsEffect();
...@@ -3405,6 +3406,57 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3405,6 +3406,57 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
return R.ok(deptList); return R.ok(deptList);
}; }
/**
* EKP紧急出险
*
* @author zhaji
* @param userName
* @param empIdcardNo
* @return {@link R}
*/
@Override
public R urgentUpdateIsUse(String userName, String empIdcardNo) {
//员工姓名
if(StringUtils.isBlank(userName)){
}
//员工身份证
if(StringUtils.isBlank(empIdcardNo)){
return R.failed("身份证号为空");
}
//员工身份证
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(empIdcardNo)){
return R.failed("身份证格式不正确");
}
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
//查询所有在保,未出险,未过期,未失效,未减员的保单信息
queryWrapper.eq(TInsuranceDetail :: getEmpIdcardNo,empIdcardNo).eq(TInsuranceDetail :: getBuyHandleStatus ,CommonConstants.THREE_INT)
.eq(TInsuranceDetail :: getIsEffect,CommonConstants.ZERO_INT).eq(TInsuranceDetail :: getIsUse,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail :: getIsOverdue,CommonConstants.ZERO_INT)
.ne(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT)
.ne(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (CollectionUtils.isEmpty(list)){
return R.failed("无可出险的保单");
}
for (TInsuranceDetail tInsuranceDetail : list) {
tInsuranceDetail.setIsUse(CommonConstants.ONE_INT);
//tInsuranceDetail.setUpdateBy();
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
}
boolean b = updateBatchById(list);
if(b){
return R.ok("EKP紧急出险成功");
}else{
return R.ok("EKP紧急出险失败");
}
}
@Override
public IPage<TInsuranceDetail> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard) {
return baseMapper.getInsuranceListByIdCard(page, idCard);
}
} }
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.TInsuranceSettleCancel;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceSettleCancelMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceSettleCancelService;
import org.springframework.stereotype.Service;
/**
* @author Administrator
* @description 针对表【t_insurance_settle_cancel(结算信息作废记录表(用于记录项目变更导致推信息送至EKP))】的数据库操作Service实现
* @createDate 2022-08-01 11:37:54
*/
@Service
public class TInsuranceSettleCancelServiceImpl extends ServiceImpl<TInsuranceSettleCancelMapper, TInsuranceSettleCancel>
implements TInsuranceSettleCancelService {
}
...@@ -9,10 +9,13 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -9,10 +9,13 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeRateMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeRateMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil; import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
...@@ -34,6 +37,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat ...@@ -34,6 +37,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
@Resource @Resource
private TInsuranceTypeService insuranceTypeService; private TInsuranceTypeService insuranceTypeService;
@Resource
private TInsuranceOperateService tInsuranceOperateService;
/** /**
* 根据险种id查询费率列表 * 根据险种id查询费率列表
* *
...@@ -44,11 +50,11 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat ...@@ -44,11 +50,11 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
@Override @Override
public R getInsuranceTypeRateList(String id) { public R getInsuranceTypeRateList(String id) {
if (Common.isEmpty(id)){ if (Common.isEmpty(id)){
return R.failed("险种id为空"); return R.failed("险种为空");
} }
TInsuranceType byId = insuranceTypeService.getById(id); TInsuranceType byId = insuranceTypeService.getById(id);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){ if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除"); return R.failed("险种信息不存在或已被删除");
} }
LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,id); queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,id);
...@@ -78,7 +84,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat ...@@ -78,7 +84,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
.set(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ONE_INT) .set(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ONE_INT)
.set(TInsuranceTypeRate :: getUpdateBy,user.getId()) .set(TInsuranceTypeRate :: getUpdateBy,user.getId())
.set(TInsuranceTypeRate :: getUpdateTime, LocalDateTime.now()); .set(TInsuranceTypeRate :: getUpdateTime, LocalDateTime.now());
return R.ok(update(updateWrapper),"删除费率信息成功"); update(updateWrapper);
addOperate(byId,user, InsurancesConstants.DELETE_INSURANCE_TYPE_RATE);
return R.ok("删除费率信息成功");
} }
/** /**
...@@ -98,15 +106,15 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat ...@@ -98,15 +106,15 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
String insuranceTypeId = insuranceTypeRate.getInsuranceTypeId(); String insuranceTypeId = insuranceTypeRate.getInsuranceTypeId();
TInsuranceType byId = insuranceTypeService.getById(insuranceTypeId); TInsuranceType byId = insuranceTypeService.getById(insuranceTypeId);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){ if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除"); return R.failed("险种信息不存在或已被删除");
} }
String month = insuranceTypeRate.getMonth(); String month = insuranceTypeRate.getMonth();
if (!ValidityUtil.validatePositiveInt(month)){ if (!ValidityUtil.validatePositiveInt(month)){
return R.failed("当前月份格式不正确"); return R.failed("月份格式不正确");
} }
String rate = insuranceTypeRate.getRate(); String rate = insuranceTypeRate.getRate();
if (!ValidityUtil.validateMoney(rate)){ if (!ValidityUtil.validateMoney(rate)){
return R.failed("当前费率格式不正确"); return R.failed("费率格式不正确");
} }
LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,insuranceTypeId) queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,insuranceTypeId)
...@@ -117,11 +125,34 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat ...@@ -117,11 +125,34 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
insuranceTypeRate.setCreateBy(user.getId()); insuranceTypeRate.setCreateBy(user.getId());
insuranceTypeRate.setCreateName(user.getNickname()); insuranceTypeRate.setCreateName(user.getNickname());
insuranceTypeRate.setCreateTime(LocalDateTime.now()); insuranceTypeRate.setCreateTime(LocalDateTime.now());
save(insuranceTypeRate);
return R.ok(this.baseMapper.insert(insuranceTypeRate)); addOperate(insuranceTypeRate,user, InsurancesConstants.NEW_INSURANCE_TYPE_RATE);
return R.ok("新增费率信息成功");
}else{ }else{
return R.failed("当前险种已存在相同的费率"); return R.failed("该险种购买月份已存在");
} }
} }
/**
* 操作记录
*
* @author zhaji
* @param insuranceTypeRate 费率信息
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(TInsuranceTypeRate insuranceTypeRate,YifuUser user,String operateDesc){
try {
TInsuranceOperate operate = new TInsuranceOperate();
operate.setInsuranceDetailId(insuranceTypeRate.getId());
operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now());
tInsuranceOperateService.save(operate);
}catch (Exception e){
e.getStackTrace();
}
}
} }
...@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.impl; ...@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -11,20 +10,17 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -11,20 +10,17 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil; import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -39,7 +35,10 @@ import java.util.List; ...@@ -39,7 +35,10 @@ import java.util.List;
public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, TInsuranceType> implements TInsuranceTypeService { public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, TInsuranceType> implements TInsuranceTypeService {
@Resource @Resource
private TInsuranceCompanyService insuranceCompanyService; private TInsuranceCompanyService tInsuranceCompanyService;
@Resource
private TInsuranceOperateService tInsuranceOperateService;
/** /**
* 险种分页查询 * 险种分页查询
...@@ -51,7 +50,6 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -51,7 +50,6 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
*/ */
@Override @Override
public IPage<InsuranceTypeVo> pageDiy(Page<TInsuranceType> page, TInsuranceType insuranceType) { public IPage<InsuranceTypeVo> pageDiy(Page<TInsuranceType> page, TInsuranceType insuranceType) {
return this.baseMapper.selectInsuranceTypePage(page,insuranceType); return this.baseMapper.selectInsuranceTypePage(page,insuranceType);
} }
...@@ -63,6 +61,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -63,6 +61,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link R} * @return {@link R}
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public R saveInsuranceType(TInsuranceType insuranceType) { public R saveInsuranceType(TInsuranceType insuranceType) {
if(Common.isEmpty(insuranceType)){ if(Common.isEmpty(insuranceType)){
return R.failed("新增的险种信息为空"); return R.failed("新增的险种信息为空");
...@@ -86,22 +85,23 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -86,22 +85,23 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
} }
LambdaQueryWrapper<TInsuranceCompany> companyWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceCompany> companyWrapper = new LambdaQueryWrapper<>();
companyWrapper.eq(TInsuranceCompany::getId,companyId).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT); companyWrapper.eq(TInsuranceCompany::getId,companyId).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany insuranceCompany = insuranceCompanyService.getOne(companyWrapper); TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(companyWrapper);
if(Common.isEmpty(insuranceCompany)){ if(Common.isEmpty(insuranceCompany)){
return R.failed("所属保险公司不存在或已被删除"); return R.failed("所属保险公司不存在或已被删除");
} }
LambdaQueryWrapper<TInsuranceType> typeWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceType> typeWrapper = new LambdaQueryWrapper<>();
typeWrapper.eq(TInsuranceType :: getInsuranceCompanyId ,companyId).eq(TInsuranceType::getName,insuranceType.getName()).eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT); typeWrapper.eq(TInsuranceType :: getInsuranceCompanyId ,companyId).eq(TInsuranceType::getName,insuranceType.getName()).eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceType type = getOne(typeWrapper); TInsuranceType type = getOne(typeWrapper);
if (!Common.isEmpty(type)){ if (!Common.isEmpty(type)){
return R.failed("当前险种已存在"); return R.failed("当前保险公司已存在该险种");
}else{ }else{
insuranceType.setDeleteFlag(CommonConstants.ZERO_INT); insuranceType.setDeleteFlag(CommonConstants.ZERO_INT);
insuranceType.setCreateBy(user.getId()); insuranceType.setCreateBy(user.getId());
insuranceType.setCreateName(user.getNickname()); insuranceType.setCreateName(user.getNickname());
insuranceType.setCreateTime(LocalDateTime.now()); insuranceType.setCreateTime(LocalDateTime.now());
return R.ok(save(insuranceType)); save(insuranceType);
addOperate(insuranceType,user, InsurancesConstants.NEW_INSURANCE_TYPE);
return R.ok("新增险种信息成功");
} }
} }
...@@ -136,7 +136,9 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -136,7 +136,9 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link R} * @return {@link R}
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public R updateInsuranceType(TInsuranceType insuranceType) { public R updateInsuranceType(TInsuranceType insuranceType) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(insuranceType.getId())){ if (Common.isEmpty(insuranceType.getId())){
return R.failed("险种ID不能为空"); return R.failed("险种ID不能为空");
} }
...@@ -145,7 +147,11 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -145,7 +147,11 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
return R.failed("当前险种信息不存在或已被删除"); return R.failed("当前险种信息不存在或已被删除");
} }
if(byId.getName().equals(insuranceType.getName())){ if(byId.getName().equals(insuranceType.getName())){
return R.ok(this.updateById(insuranceType),"修改险种信息成功"); insuranceType.setUpdateBy(user.getId());
insuranceType.setUpdateTime(LocalDateTime.now());
updateById(insuranceType);
addOperate(insuranceType,user, InsurancesConstants.UPDATE_INSURANCE_TYPE);
return R.ok("修改险种信息成功");
}else{ }else{
LambdaQueryWrapper<TInsuranceType> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceType> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceType::getName,insuranceType.getName()) queryWrapper.eq(TInsuranceType::getName,insuranceType.getName())
...@@ -153,13 +159,40 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -153,13 +159,40 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
.eq(TInsuranceType::getDeleteFlag,CommonConstants.ZERO_INT); .eq(TInsuranceType::getDeleteFlag,CommonConstants.ZERO_INT);
TInsuranceType one = this.getOne(queryWrapper); TInsuranceType one = this.getOne(queryWrapper);
if (Common.isEmpty(one)){ if (Common.isEmpty(one)){
return R.ok(this.updateById(insuranceType),"修改险种信息成功"); insuranceType.setUpdateBy(user.getId());
insuranceType.setUpdateTime(LocalDateTime.now());
updateById(insuranceType);
addOperate(insuranceType,user, InsurancesConstants.UPDATE_INSURANCE_TYPE);
return R.ok("修改险种信息成功");
}else{ }else{
return R.failed("当前险种名称已存在"); return R.failed("当前险种名称已存在");
} }
} }
} }
/**
* 操作记录
*
* @author zhaji
* @param insuranceType 险种信息
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(TInsuranceType insuranceType,YifuUser user,String operateDesc){
try {
TInsuranceOperate operate = new TInsuranceOperate();
operate.setInsuranceDetailId(insuranceType.getId());
operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now());
tInsuranceOperateService.save(operate);
}catch (Exception e){
e.getStackTrace();
}
}
/** /**
* 查询险种列表 * 查询险种列表
* *
...@@ -179,7 +212,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -179,7 +212,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
}else{ }else{
LambdaQueryWrapper<TInsuranceCompany> companyWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceCompany> companyWrapper = new LambdaQueryWrapper<>();
companyWrapper.eq(TInsuranceCompany::getId,companyId).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT); companyWrapper.eq(TInsuranceCompany::getId,companyId).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany insuranceCompany = insuranceCompanyService.getOne(companyWrapper); TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(companyWrapper);
if(Common.isEmpty(insuranceCompany)){ if(Common.isEmpty(insuranceCompany)){
return R.failed("所属保险公司不存在或已被删除"); return R.failed("所属保险公司不存在或已被删除");
}else{ }else{
......
...@@ -8,6 +8,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -8,6 +8,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
...@@ -94,7 +95,9 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp ...@@ -94,7 +95,9 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
.set(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ONE_INT) .set(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ONE_INT)
.set(TInsuranceTypeStandard :: getUpdateBy,user.getId()) .set(TInsuranceTypeStandard :: getUpdateBy,user.getId())
.set(TInsuranceTypeStandard :: getUpdateTime,LocalDateTime.now()); .set(TInsuranceTypeStandard :: getUpdateTime,LocalDateTime.now());
return R.ok(update(updateWrapper),"删除购买标准成功"); update(updateWrapper);
addOperate(byId,user, InsurancesConstants.DELETE_INSURANCE_TYPE_STANDARD);
return R.ok("删除购买标准成功");
} }
/** /**
* 新增购买标准 * 新增购买标准
...@@ -137,12 +140,35 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp ...@@ -137,12 +140,35 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
insuranceTypeStandard.setCreateBy(user.getId()); insuranceTypeStandard.setCreateBy(user.getId());
insuranceTypeStandard.setCreateName(user.getNickname()); insuranceTypeStandard.setCreateName(user.getNickname());
insuranceTypeStandard.setCreateTime(LocalDateTime.now()); insuranceTypeStandard.setCreateTime(LocalDateTime.now());
return R.ok(this.baseMapper.insert(insuranceTypeStandard),"新增购买标准成功"); save(insuranceTypeStandard);
addOperate(insuranceTypeStandard,user, InsurancesConstants.NEW_INSURANCE_TYPE_STANDARD);
return R.ok("新增购买标准成功");
}else{ }else{
return R.failed("当前险种下的购买标准已存在"); return R.failed("该险种下购买标准已存在");
} }
} }
/**
* 操作记录
*
* @author zhaji
* @param insuranceTypeStandard 购买标准信息
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(TInsuranceTypeStandard insuranceTypeStandard,YifuUser user,String operateDesc){
try {
TInsuranceOperate operate = new TInsuranceOperate();
operate.setInsuranceDetailId(insuranceTypeStandard.getId());
operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now());
tInsuranceOperateService.save(operate);
}catch (Exception e){
e.getStackTrace();
}
}
} }
...@@ -761,4 +761,16 @@ ...@@ -761,4 +761,16 @@
#{item} #{item}
</foreach> </foreach>
</update> </update>
<!--getInsuranceListByIdCard-->
<select id="getInsuranceListByIdCard" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_detail
<where>
1=1
AND EMP_IDCARD_NO = #{idCard}
</where>
ORDER BY CREATE_TIME desc
</select>
</mapper> </mapper>
<?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.mapper.TInsuranceSettleCancelMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="insDetailId" column="INS_DETAIL_ID" jdbcType="VARCHAR"/>
<result property="settleId" column="SETTLE_ID" jdbcType="VARCHAR"/>
<result property="deptNo" column="DEPT_NO" jdbcType="VARCHAR"/>
<result property="deptName" column="DEPT_NAME" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="isCancelPush" column="IS_CANCEL_PUSH" jdbcType="TINYINT"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="createUesr" column="CREATE_UESR" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,INS_DETAIL_ID,SETTLE_ID,
DEPT_NO,DEPT_NAME,ORDER_NO,
IS_CANCEL_PUSH,CREATE_TIME,CREATE_UESR
</sql>
</mapper>
...@@ -144,10 +144,9 @@ public class TPaymentInfoController { ...@@ -144,10 +144,9 @@ public class TPaymentInfoController {
* @date 2022-07-22 * @date 2022-07-22
**/ **/
@SneakyThrows @SneakyThrows
@Operation(description = "导入省市社保-合肥三险 hasPermission('social_tpaymentinfo_batchImport')") @Operation(description = "导入省市社保-合肥三险")
@SysLog("批量新增缴费库-合肥三险") @SysLog("批量新增缴费库-合肥三险")
@PostMapping("/importListSocialHeFei") @PostMapping("/importListSocialHeFei")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_batchImport')")
public R<List<ErrorMessage>> importListSocialHeFei(@RequestBody MultipartFile file, @RequestParam String random, public R<List<ErrorMessage>> importListSocialHeFei(@RequestBody MultipartFile file, @RequestParam String random,
@RequestParam(value = "type") String type){ @RequestParam(value = "type") String type){
return tPaymentInfoService.importSocialHeFeiDiy(file.getInputStream(),random,type); return tPaymentInfoService.importSocialHeFeiDiy(file.getInputStream(),random,type);
......
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
package com.yifu.cloud.plus.v1.yifu.social.controller; package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
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.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
...@@ -26,11 +29,9 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TProvidentFund; ...@@ -26,11 +29,9 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TProvidentFund;
import com.yifu.cloud.plus.v1.yifu.social.service.TProvidentFundService; import com.yifu.cloud.plus.v1.yifu.social.service.TProvidentFundService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TProvidentFundSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TProvidentFundSearchVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -154,4 +155,30 @@ public class TProvidentFundController { ...@@ -154,4 +155,30 @@ public class TProvidentFundController {
public void export(HttpServletResponse response, @RequestBody TProvidentFundSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TProvidentFundSearchVo searchVo) {
tProvidentFundService.listExport(response,searchVo); tProvidentFundService.listExport(response,searchVo);
} }
/**
* @Description: 获取公积金,根据身份证与项目ID
* @Author: hgw
* @Date: 2022/8/1 11:27
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.social.entity.TProvidentFund>
**/
@Operation(summary = "获取公积金,根据身份证与项目ID", description = "获取公积金,根据身份证与项目ID")
@GetMapping("/getFundByIdCardAndDeptId" )
public R<TProvidentFund> getSocialByIdCardAndDeptId(@RequestParam String idCard
, @RequestParam(required = false) String deptId) {
TProvidentFund fund;
if (Common.isNotNull(deptId)) {
fund = tProvidentFundService.getOne(Wrappers.<TProvidentFund>query().lambda()
.eq(TProvidentFund::getEmpIdcard, idCard)
.eq(TProvidentFund::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TProvidentFund::getSettleDomain, deptId)
.orderByDesc(TProvidentFund::getCreateTime).last(CommonConstants.LAST_ONE_SQL));
} else {
fund = tProvidentFundService.getOne(Wrappers.<TProvidentFund>query().lambda()
.eq(TProvidentFund::getEmpIdcard, idCard)
.eq(TProvidentFund::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.orderByDesc(TProvidentFund::getCreateTime).last(CommonConstants.LAST_ONE_SQL));
}
return R.ok(fund);
}
} }
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
package com.yifu.cloud.plus.v1.yifu.social.controller; package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
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.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
...@@ -26,11 +29,9 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo; ...@@ -26,11 +29,9 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.TSocialInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -154,4 +155,30 @@ public class TSocialInfoController { ...@@ -154,4 +155,30 @@ public class TSocialInfoController {
public void export(HttpServletResponse response, @RequestBody TSocialInfoSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TSocialInfoSearchVo searchVo) {
tSocialInfoService.listExport(response,searchVo); tSocialInfoService.listExport(response,searchVo);
} }
/**
* @Description: 获取社保,根据身份证与项目ID
* @Author: hgw
* @Date: 2022/8/1 11:27
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo>
**/
@Operation(summary = "获取社保,根据身份证与项目ID", description = "获取社保,根据身份证与项目ID")
@GetMapping("/getSocialByIdCardAndDeptId" )
public R<TSocialInfo> getSocialByIdCardAndDeptId(@RequestParam String idCard
, @RequestParam(required = false) String deptId) {
TSocialInfo socialInfo;
if (Common.isNotNull(deptId)) {
socialInfo = tSocialInfoService.getOne(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getEmpIdcard, idCard)
.eq(TSocialInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TSocialInfo::getSettleDomain, deptId)
.orderByDesc(TSocialInfo::getCreateTime).last(CommonConstants.LAST_ONE_SQL));
} else {
socialInfo = tSocialInfoService.getOne(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getEmpIdcard, idCard)
.eq(TSocialInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.orderByDesc(TSocialInfo::getCreateTime).last(CommonConstants.LAST_ONE_SQL));
}
return R.ok(socialInfo);
}
} }
...@@ -363,9 +363,9 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe ...@@ -363,9 +363,9 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
continue; continue;
}*/ }*/
history.setUnitFundMoney(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(history.getUnitFundBase() history.setUnitFundMoney(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(history.getUnitFundBase()
, history.getUnitFundProp(), CommonConstants.ONE_OF_PERCENT), fundSetInfo.getFundPayPoint())); , history.getUnitFundProp(), CommonConstants.ONE_OF_PERCENT), Integer.parseInt(socialFundInfo.getFundPayPoint())));
history.setPersonalFundMoney(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(history.getPersonalFundBase() history.setPersonalFundMoney(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(history.getPersonalFundBase()
, history.getPersonalFundProp(), CommonConstants.ONE_OF_PERCENT), fundSetInfo.getFundPayPoint())); , history.getPersonalFundProp(), CommonConstants.ONE_OF_PERCENT), Integer.parseInt(socialFundInfo.getFundPayPoint())));
// 更新社保公积金表的公积金信息 // 更新社保公积金表的公积金信息
this.setSocialFundInfoByFund(socialFundInfo, history); this.setSocialFundInfoByFund(socialFundInfo, history);
} }
...@@ -497,10 +497,10 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe ...@@ -497,10 +497,10 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
socialFundInfo.setUnitFundSum(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply( socialFundInfo.setUnitFundSum(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(
socialFundInfo.getUnitProvidengCardinal(), socialFundInfo.getUnitProvidentPer(), CommonConstants.ONE_OF_PERCENT) socialFundInfo.getUnitProvidengCardinal(), socialFundInfo.getUnitProvidentPer(), CommonConstants.ONE_OF_PERCENT)
, Integer.valueOf(socialFundInfo.getFundPayPoint()))); , Integer.parseInt(socialFundInfo.getFundPayPoint())));
socialFundInfo.setPersonalFundSum(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply( socialFundInfo.setPersonalFundSum(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(
socialFundInfo.getPersonalProvidentCardinal(), socialFundInfo.getPersonalProvidentPer(), CommonConstants.ONE_OF_PERCENT) socialFundInfo.getPersonalProvidentCardinal(), socialFundInfo.getPersonalProvidentPer(), CommonConstants.ONE_OF_PERCENT)
, Integer.valueOf(socialFundInfo.getFundPayPoint()))); , Integer.parseInt(socialFundInfo.getFundPayPoint())));
} }
/** /**
......
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