Commit 4b48583b authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 0f9215cd cd3f18ac
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -57,7 +58,7 @@ public class ProjectSetInfoVo implements Serializable {
* 商险结算类型:0预估 1 实缴
*/
@Schema(description = "商险结算类型")
private String insuranceSettleType;
private String insuranceSettleType = CommonConstants.ONE_STRING;
}
......@@ -8,5 +8,7 @@ public class EmployeeContractConstants {
public static final String NOT_CREATE_USER = "不是创建人,无法删除";
public static final String NOT_AUDIT_STATUS = "不是待提交或审核不通过,无法删除";
public static final String NOT_AUDIT = "未审核通过,无法更新";
public static final String INVALID = "作废、终止,无法更新";
}
......@@ -668,16 +668,21 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 存储
contractInfo = baseMapper.getOneContractByApplyNo(excel.getApplyNo());
if (contractInfo != null && Common.isNotNull(contractInfo.getId())) {
newContractInfo = new TEmployeeContractInfo();
newContractInfo.setId(contractInfo.getId());
newContractInfo.setContractNo(excel.getContractNo());
newContractInfo.setFileCabinetNo(excel.getFileCabinetNo());
this.updateById(newContractInfo);
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[3], contractInfo.getId(), "", contractInfo, newContractInfo);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
if (CommonConstants.dingleDigitIntArray[2] != contractInfo.getAuditStatus()) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeContractConstants.NOT_AUDIT));
} else if (EmployeeConstants.SITUATION_SIX.equals(contractInfo.getSituation())
|| EmployeeConstants.SITUATION_SEVEN.equals(contractInfo.getSituation())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeContractConstants.INVALID));
} else {
newContractInfo = new TEmployeeContractInfo();
newContractInfo.setId(contractInfo.getId());
newContractInfo.setContractNo(excel.getContractNo());
newContractInfo.setFileCabinetNo(excel.getFileCabinetNo());
this.updateById(newContractInfo);
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[3], contractInfo.getId(), "", contractInfo, newContractInfo);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeContractConstants.NO_INFO));
}
......
......@@ -387,4 +387,6 @@ public interface CommonConstants {
String SIX_STRING = "6";
String SEVEN_STRING = "7";
public static final BigDecimal MONEY_MAX = new BigDecimal("999999.99");
}
......@@ -7,6 +7,42 @@ package com.yifu.cloud.plus.v1.yifu.insurances.constants;
*/
public class InsurancesConstants {
/**
* 新增
*/
public static final String ADD = "新增";
/**
* 批增
*/
public static final String BATCH = "批增";
/**
* 替换
*/
public static final String REPLACE = "替换";
/**
* 删除
*/
public static final String DELETE = "删除";
/**
* 编辑
*/
public static final String EDIT = "编辑";
/**
* 导出办理
*/
public static final String EXPORT = "导出办理";
/**
* 投保退回
*/
public static final String ROLLBACK = "投保退回";
/**
* 办理成功
*/
public static final String SUCCESSFUL = "办理成功";
/**
* 登记保单保费
*/
public static final String REGISTERED = "登记保单保费";
/**
* 新增投保成功
*/
......@@ -60,10 +96,6 @@ public class InsurancesConstants {
* 无效、已过期、已出险、已减员的 不能替换
*/
public static final String REPLACE_IS_NOT_ALLOW = "无效、已过期、已出险、已减员的 不能替换";
/**
* 订单编号不能为空
*/
public static final String ORDER_NO_NOT_EMPTY = "订单编号不能为空";
/**
* 员工姓名不能为空
*/
......@@ -84,6 +116,14 @@ public class InsurancesConstants {
* 员工身份证号格式有误
*/
public static final String EMP_IDCARD_NO_NOT_LEGITIMATE = "员工身份证号格式有误";
/**
* 员工姓名、身份证号不一致
*/
public static final String EMP_ID_CARD_NO_NOT_FIT = "员工姓名、身份证号不一致";
/**
* 替换员工姓名、身份证号不一致
*/
public static final String REPLACE_EMP_ID_CARD_NO_NOT_FIT = "替换员工姓名、身份证号不一致";
/**
* 替换员工身份证号格式有误
*/
......@@ -144,18 +184,34 @@ public class InsurancesConstants {
* 商险购买地省名称不能为空
*/
public static final String INSURANCE_PROVINCE_NAME_NOT_EMPTY = "商险购买地省名称不能为空";
/**
* 商险购买地省名称不存在
*/
public static final String INSURANCE_PROVINCE_NAME_NOT_EXIST = "商险购买地省名称不存在";
/**
* 商险购买地市名称
*/
public static final String INSURANCE_CITY_NAME_NOT_EMPTY = "商险购买地市名称不能为空";
/**
* 商险购买地市名称不存在
*/
public static final String INSURANCE_CITY_NAME_NOT_EXIST = "商险购买地市名称不存在";
/**
* 商险办理省名称不能为空
*/
public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EMPTY = "商险办理省名称不能为空";
/**
* 商险办理省名称不存在
*/
public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST = "商险办理省名称不存在";
/**
* 商险办理城市名称不能为空
*/
public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EMPTY = "商险办理城市名称不能为空";
/**
* 商险办理城市名称不存在
*/
public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EXIST = "商险办理城市名称不存在";
/**
* 结算月不能为空
*/
......@@ -220,7 +276,7 @@ public class InsurancesConstants {
/**
* 当前保单已结算,无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR = "前保单已结算,无法变更结算月";
public static final String SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR = "前保单已结算,无法变更结算月";
/**
* 替换项目ID和原有项目ID相同
......@@ -232,4 +288,24 @@ public class InsurancesConstants {
*/
public static final String DUPLICATE_DATA_ERROR = "重复数据";
/**
* 当前变更结算月列表为空
*/
public static final String SETTLE_MONTH_CHANGE_LIST_IS_EMPTY ="当前变更结算月列表为空";
/**
* 替换人员不允许变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_IS_EFFECT_ERROR ="替换人员不允许变更结算月";
/**
* 替换人员不允许变更所属项目
*/
public static final String DEPT_NO_CHANGE_IS_EFFECT_ERROR ="替换人员不允许变更所属项目";
/**
* 当前保单已结算,无法变更所属项目
*/
public static final String DEPT_NO_CHANGE_SETTLE_HANDLE_STATUS_ERROR = "当前保单已结算,无法变更所属项目";
}
......@@ -58,7 +58,7 @@ public class TInsuranceCompany extends BaseEntity {
*/
@NotBlank(message = "计费方式不能为空")
@StringVal({"0","1"})
@Schema(description = "计费方式")
@Schema(description = "计费方式(0:按天,1:按月)")
private String billingType;
/**
......
......@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -42,12 +41,6 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 项目编码
*/
......
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;
import java.time.LocalDateTime;
/**
* 商险结算表
* @TableName t_insurance_settle
* @author licancan
* @description 商险结算表 t_insurance_settle
* @date 2022-07-25 14:20:16
*/
@Data
@TableName("t_insurance_settle")
......
......@@ -14,11 +14,6 @@ import java.io.Serializable;
@Schema(description = "商险办理新增入参")
public class InsuranceAddParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 员工姓名
......
......@@ -16,11 +16,6 @@ import java.time.LocalDate;
@Schema(description = "商险办理批增入参")
public class InsuranceBatchParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 项目编码
......
......@@ -19,6 +19,12 @@ import java.time.LocalDateTime;
@Schema(description = "投保详情VO")
public class InsuranceDetailVO implements Serializable {
private static final long serialVersionUID = 628032758008497542L;
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 员工姓名
*/
......
......@@ -22,12 +22,6 @@ public class InsuranceExportListVO implements Serializable {
*/
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 项目名称
*/
......
......@@ -24,12 +24,6 @@ public class InsuranceListVO implements Serializable {
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 员工姓名
*/
......
......@@ -24,12 +24,6 @@ public class InsuranceRefundHandlingListVo implements Serializable {
*/
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 项目名称
*/
......@@ -175,7 +169,7 @@ public class InsuranceRefundHandlingListVo implements Serializable {
* 创建人姓名
*/
@Schema(description = "创建人(派单人)")
private String createName;
private String refundCreateName;
/**
* 备注
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
......@@ -18,24 +18,20 @@ import java.util.List;
@Data
@Tag(name = "减员办理类")
public class InsuranceRefundListParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
@Schema(name = "办理类型")
@NotBlank(message = "办理类型不能为空")
private String refundType;
@Schema(name = "减员办理类型")
@NotBlank(message = "减员办理类型不能为空")
private Integer refundType;
@Schema(name = "办理列表")
@NotBlank(message = "办理列表不能为空")
private String [] idList;
@Schema(description = "减员办理列表")
private List<String> insuranceDetailList;
@Schema(name = "办理人")
@NotBlank(message = "办理类型不能为空")
@Schema(name = "更新人")
private String updateBy;
@Schema(name = "办理时间")
@NotBlank(message = "办理类型不能为空")
private LocalDateTime refundCreateTime;
@Schema(name = "更新时间")
private LocalDateTime updateTime;
}
......@@ -10,11 +10,11 @@ import java.time.LocalDate;
/**
* @author zhaji
* @description 已投保列表
* @description 已减员列表
* @date 2022-07-21 11:31:30
*/
@Data
@Tag(name = "已投保列表")
@Tag(name = "已减员列表")
public class InsuranceRefundListVo implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
......@@ -24,12 +24,6 @@ public class InsuranceRefundListVo implements Serializable {
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 项目名称
*/
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaji
* @description 减员办理参数
* @date 2022-07-25 14:17:16
*/
@Data
@Schema(name = "减员办理参数")
public class InsuranceRefundOperationParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
@Schema(name = "办理类型")
@NotBlank(message = "办理类型不能为空")
private Integer operationType;
@Schema(name = "减员办理列表")
private List<InsuranceRefundHandlingListVo> insuranceRefundHandlingList;
@Schema(name = "办理参数")
private InsuranceRefundHandlingParam param;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author zhaji
* @description 减员办理返回类
* @date 2022-07-21 12:30:37
*/
@Schema(name = "减员办理返回类")
@Data
public class InsuranceRefundResultVo implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String projectName;
/**
* 项目编码
*/
@JsonIgnore
private String deptNo;
/**
* 投保岗位
*/
@Schema(description = "投保岗位")
private String post;
/**
* 保单开始时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单开始时间")
private LocalDate policyStart;
/**
* 保单结束时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单结束时间")
private LocalDate policyEnd;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
/**
* 错误原因
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private String errorMessage;
}
......@@ -74,12 +74,6 @@ public class InsuranceReplaceParam implements Serializable {
@Schema(description = "替换员工项目编码")
private String replaceDeptNo;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 岗位
*/
......
......@@ -30,12 +30,6 @@ public class InsuredListVo implements Serializable {
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 员工姓名
*/
......
......@@ -51,6 +51,12 @@ public class InsuredParam implements Serializable {
@Schema(description = "保险公司ID")
private String insuranceCompanyId;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 保单开始时间
*/
......
......@@ -65,7 +65,12 @@
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
</dependencies>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-check-api</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import io.swagger.v3.oas.annotations.Operation;
......@@ -159,11 +160,11 @@ public class TInsuranceDetailController {
*
* @author licancan
* @param idList
* @return {@link R<String>}
* @return {@link R<List<TInsuranceDetail>>}
*/
@Operation(summary = "投保退回", description = "投保退回")
@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);
}
......@@ -172,11 +173,11 @@ public class TInsuranceDetailController {
*
* @author licancan
* @param idList
* @return {@link R<String>}
* @return {@link R<List<TInsuranceDetail>>}
*/
@Operation(summary = "办理成功", description = "办理成功")
@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);
}
......@@ -242,7 +243,7 @@ public class TInsuranceDetailController {
@Operation(summary = "已投保列表分页查询", description = "已投保列表分页查询")
@PostMapping("/getInsuredListPage")
public R<IPage<InsuredListVo>> getInsuredListPage(Page<InsuredListVo> page, @RequestBody InsuredParam param) {
return R.ok(tInsuranceDetailService.getInsuredListPage(page, param));
return R.ok(tInsuranceDetailService.getInsuredListPage(page,param));
}
/**
......@@ -255,7 +256,7 @@ public class TInsuranceDetailController {
@Operation(summary = "已投保列表不分页查询", description = "已投保列表不分页查询")
@PostMapping("/getInsuredList")
public R<List<InsuredListVo>> getInsuredList(@RequestBody InsuredParam param) {
return R.ok(tInsuranceDetailService.getInsuredList(param));
return R.ok(tInsuranceDetailService.getInsuredList(param),"查询成功");
}
/**
......@@ -299,15 +300,15 @@ public class TInsuranceDetailController {
}
/**
* 减员办理列表不分页查询
* 导出减员列表
*
* @author zhaji
* @param param 查询条件
* @return {@link R<List< InsuranceRefundHandlingListVo >>}
*/
@Operation(summary = "减员办理列表不分页查询", description = "减员办理列表不分页查询")
@Operation(summary = "导出减员列表", description = "导出减员列表")
@PostMapping("/getInsuranceRefundHandlingList")
public R<List<InsuranceRefundHandlingListVo>> getInsuranceRefundHandlingList(@RequestBody InsuranceRefundHandlingParam param) {
public R<List<InsuranceRefundHandlingListVo>> getInsuranceRefundHandlingList(@RequestBody InsuranceRefundOperationParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingList(param));
}
......@@ -323,4 +324,45 @@ public class TInsuranceDetailController {
public R updateInsuranceRefund(@RequestBody InsuranceRefundListParam insuranceDetail) {
return tInsuranceDetailService.updateInsuranceRefund(insuranceDetail);
}
/**
* 根据保险公司名称查询保单明细
*
* @author zhaji
* @param CompanyName 保险公司id
* @return {@link R<List< InsuranceRefundHandlingListVo >>}
*/
@Operation(summary = "根据保险公司名称查询保单明细", description = "根据保险公司名称查询保单明细")
@GetMapping("/selectByCompanyName")
public R selectByCompanyName(String CompanyName) {
return tInsuranceDetailService.selectByCompanyName(CompanyName);
}
/**
* 根据险种名称查询保单明细
*
* @author zhaji
* @param id 险种id
* @return {@link R<List< InsuranceRefundHandlingListVo >>}
*/
@Operation(summary = "根据险种名称查询保单明细", description = "根据险种名称查询保单明细")
@GetMapping("/selectByTypeId")
public R selectByTypeName(String id) {
return tInsuranceDetailService.selectByTypeId(id);
}
/**
* 出险
*
* @author zhaji
* @param id 险种id
* @return {@link R<List< InsuranceRefundHandlingListVo >>}
*/
@Operation(summary = "出险", description = "出险")
@GetMapping("/updateIsUse")
public R updateIsUse(String id) {
return tInsuranceDetailService.updateIsUse(id);
}
}
......@@ -17,6 +17,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @author zhaji
......@@ -40,7 +41,7 @@ public class TInsuranceTypeController {
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R<IPage<InsuranceTypeVo>> getInsuranceTypePage(Page page, @RequestBody TInsuranceType insuranceType) {
public R<IPage<InsuranceTypeVo>> getInsuranceTypePage(Page page,TInsuranceType insuranceType) {
return R.ok(insuranceTypeService.pageDiy(page, insuranceType));
}
......@@ -51,8 +52,8 @@ public class TInsuranceTypeController {
*/
@Operation(summary = "新增险种", description = "新增险种:hasPermission('demo_insuranceType_add')")
@SysLog("新增险种")
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_insuranceType_add')" )
@PostMapping("/save")
//@PreAuthorize("@pms.hasPermission('demo_insuranceType_add')" )
public R save(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.saveInsuranceType(insuranceType);
}
......@@ -64,9 +65,33 @@ public class TInsuranceTypeController {
*/
@Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('demo_insuranceType_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_insuranceType_get')" )
//@PreAuthorize("@pms.hasPermission('demo_insuranceType_get')" )
public R getInsuranceTypeDetail(@PathVariable("id" ) String id) {
return insuranceTypeService.getInsuranceTypeDetail(id);
}
/**
* 修改险种
* @param insuranceType 险种明细
* @return R
*/
@Operation(summary = "修改险种", description = "新增险种:hasPermission('demo_insuranceType_add')")
@SysLog("修改险种")
@PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('demo_insuranceType_add')" )
public R update(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.updateInsuranceType(insuranceType);
}
/**
* 查询险种列表
* @param insuranceType 险种信息
* @return
*/
@Operation(summary = "查询险种列表", description = "查询险种列表")
@GetMapping("/list" )
public R getInsuranceTypeList(TInsuranceType insuranceType) {
return insuranceTypeService.getInsuranceTypeList(insuranceType);
}
}
......@@ -47,8 +47,8 @@ public class TInsuranceTypeRateController {
* @return R
*/
@Operation(summary = "删除购买费率信息", description = "删除购买费率信息:hasPermission('demo_insuranceTypeRate_delete')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_insuranceTypeRate_delete')" )
@DeleteMapping("/{id}" )
//@PreAuthorize("@pms.hasPermission('demo_insuranceTypeRate_delete')" )
public R deleteById(@PathVariable("id" ) String id) {
return insuranceTypeRateService.deleteInsuranceTypeRate(id);
}
......@@ -60,8 +60,8 @@ public class TInsuranceTypeRateController {
*/
@Operation(summary = "新增费率", description = "新增费率:hasPermission('demo_insuranceTypeRate_add')")
@SysLog("新增费率" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_insuranceTypeRate_add')" )
@PostMapping("/save")
//@PreAuthorize("@pms.hasPermission('demo_insuranceTypeRate_add')" )
public R save(@RequestBody TInsuranceTypeRate insuranceTypeRate) {
return insuranceTypeRateService.saveInsuranceTypeRate(insuranceTypeRate);
}
......
......@@ -34,7 +34,7 @@ public class TInsuranceTypeStandardController {
* 查询购买标准列表(不分页)
* @return
*/
@Operation(summary = "费率列表", description = "费率列表")
@Operation(summary = "购买标准列表", description = "购买标准列表")
@GetMapping("/list" )
public R getInsuranceTypeRateList(String id) {
return insuranceTypeStandardService.getInsuranceTypeStandard(id);
......@@ -46,8 +46,8 @@ public class TInsuranceTypeStandardController {
* @return R
*/
@Operation(summary = "删除购买标准信息", description = "删除购买标准信息:hasPermission('demo_insuranceTypeStandard_delete')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_insuranceTypeStandard_delete')" )
@DeleteMapping("/{id}" )
//@PreAuthorize("@pms.hasPermission('demo_insuranceTypeStandard_delete')" )
public R deleteById(@PathVariable("id" ) String id) {
return insuranceTypeStandardService.deleteInsuranceTypeStandard(id);
}
......@@ -59,8 +59,8 @@ public class TInsuranceTypeStandardController {
*/
@Operation(summary = "新增购买标准", description = "新增购买标准:hasPermission('demo_insuranceTypeStandard_add')")
@SysLog("新增购买标准" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_insuranceTypeStandard_add')" )
@PostMapping("/save")
//@PreAuthorize("@pms.hasPermission('demo_insuranceTypeStandard_add')" )
public R save(@RequestBody TInsuranceTypeStandard insuranceTypeStandard) {
return insuranceTypeStandardService.saveInsuranceTypeStandard(insuranceTypeStandard);
}
......
......@@ -105,7 +105,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
List<InsuranceRefundListVo> getInsuranceRefundList( @Param("param") InsuranceRefundParam param);
/**
* 减员列表分页查询
* 减员办理列表分页查询
*
* @author zhaji
* @param page 分页参数
......@@ -115,7 +115,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
IPage<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, @Param("param") InsuranceRefundHandlingParam param);
/**
* 减员列表不分页查询
* 减员办理列表不分页查询
*
* @author zhaji
* @param param 查询参数
......@@ -131,4 +131,13 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @return {@link boolean}
*/
Integer updateInsuranceRefund(@Param("param") InsuranceRefundListParam insuranceDetail);
/**
* 查询保单列表
*
* @author zhaji
* @param idList idList
* @return {@link List< TInsuranceDetail>}
*/
List<TInsuranceDetail> selectDetailListByIds(@Param("idList") String [] 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;
import org.apache.ibatis.annotations.Mapper;
/**
* @author Administrator
* @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Mapper
* @createDate 2022-07-21 16:21:22
* @Entity generator.domain.TInsuranceSettle
*/
* @author licancan
* @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Mapper
* @date 2022-07-25 14:20:16
*/
@Mapper
public interface TInsuranceSettleMapper extends BaseMapper<TInsuranceSettle> {
}
......@@ -104,18 +104,18 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*
* @author licancan
* @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
* @param idList
* @return {@link R<String>}
* @return {@link R<List<TInsuranceDetail>>}
*/
R<String> successfulInsurance(List<String> idList);
R<List<TInsuranceDetail>> successfulInsurance(List<String> idList);
/**
* 登记保单保费
......@@ -192,7 +192,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param param 查询参数
* @return {@link List< InsuranceRefundHandlingListVo>}
*/
List<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingList(InsuranceRefundHandlingParam param);
List<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingList(InsuranceRefundOperationParam param);
/**
* 减员办理
......@@ -221,4 +221,30 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/
R deptChange(List<DeptChangeCheckParam> deptChangeCheckList);
/**
* 根据保险公司名称查询保单明细
*
* @author zhaji
* @param companyName 保险公司名称
* @return {@link R}
*/
R selectByCompanyName(String companyName);
/**
* 根据险种id查询保单明细
*
* @author zhaji
* @param id
* @return {@link R}
*/
R selectByTypeId(String id);
/**
* 出险
*
* @author zhaji
* @param id
* @return {@link R}
*/
R updateIsUse(String id);
}
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;
import org.springframework.stereotype.Service;
/**
* @author Administrator
* @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Service
* @createDate 2022-07-21 16:21:22
*/
* @author licancan
* @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Service
* @date 2022-07-25 14:20:16
*/
@Service
public interface TInsuranceSettleService extends IService<TInsuranceSettle> {
......
......@@ -9,6 +9,8 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import java.util.List;
/**
* @author Administrator
* @description 针对表【t_insurance_type(险种表)】的数据库操作Service
......@@ -43,4 +45,21 @@ public interface TInsuranceTypeService extends IService<TInsuranceType> {
*/
R getInsuranceTypeDetail(String id);
/**
* 修改险种信息
*
* @author zhaji
* @param insuranceType
* @return {@link R}
*/
R updateInsuranceType(TInsuranceType insuranceType);
/**
* 查询险种列表
*
* @author zhaji
* @param insuranceType
* @return {@link List< TInsuranceType>}
*/
R getInsuranceTypeList(TInsuranceType insuranceType);
}
......@@ -9,11 +9,14 @@ 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.util.Common;
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.security.util.SecurityUtils;
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.mapper.TInsuranceCompanyMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -45,16 +48,18 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
if(Common.isEmpty(insuranceCompany)){
return R.failed("新增的信息为空");
}
YifuUser user = SecurityUtils.getUser();
String billingType = insuranceCompany.getBillingType();
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确");
}
boolean b = companyIsExists(insuranceCompany.getCompanyName());
if (!b){
insuranceCompany.setCreateBy("");
insuranceCompany.setCreateName("");
insuranceCompany.setCreateBy(user.getId());
insuranceCompany.setCreateName(user.getNickname());
insuranceCompany.setCreateTime(LocalDateTime.now());
return R.ok(this.save(insuranceCompany));
insuranceCompany.setDeleteFlag(CommonConstants.ZERO_INT);
return R.ok(save(insuranceCompany),"新增成功");
}else{
return R.failed("当前保险公司已存在");
}
......@@ -69,8 +74,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
*/
@Override
public R updateInsuranceCompany(TInsuranceCompany insuranceCompany) {
YifuUser user = SecurityUtils.getUser();
String id = insuranceCompany.getId();
if (Common.isEmpty(id)){
if (StringUtils.isEmpty(id)){
return R.failed("要修改的保险公司id为空");
}
String billingType = insuranceCompany.getBillingType();
......@@ -103,6 +109,8 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
}
}
}else{
insuranceCompany.setUpdateBy(user.getId());
insuranceCompany.setUpdateTime(LocalDateTime.now());
return R.ok(updateById(insuranceCompany));
}
}
......@@ -115,6 +123,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
*/
@Override
public R deleteById(String id) {
YifuUser user = SecurityUtils.getUser();
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceCompany::getId,id).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany one = this.getOne(queryWrapper);
......@@ -122,8 +131,10 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
return R.failed("当前保险公司不存在");
}else {
LambdaUpdateWrapper<TInsuranceCompany> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceCompany::getId,id);
updateWrapper.set(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
updateWrapper.eq(TInsuranceCompany::getId,id)
.set(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.set(TInsuranceCompany :: getUpdateBy,user.getId())
.set(TInsuranceCompany :: getUpdateTime,LocalDateTime.now());
return R.ok(update(updateWrapper));
}
}
......
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;
import org.springframework.stereotype.Service;
/**
* @author Administrator
* @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Service实现
* @createDate 2022-07-21 16:21:22
*/
* @author licancan
* @description 针对表【t_insurance_settle(商险结算表)】的数据库操作Service实现
* @date 2022-07-25 14:20:16
*/
@Service
public class TInsuranceSettleServiceImpl extends ServiceImpl<TInsuranceSettleMapper, TInsuranceSettle>
implements TInsuranceSettleService {
public class TInsuranceSettleServiceImpl extends ServiceImpl<TInsuranceSettleMapper, TInsuranceSettle> implements TInsuranceSettleService {
}
......@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.R;
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.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
......@@ -15,8 +17,10 @@ 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.util.ValidityUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/**
......@@ -59,7 +63,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R deleteInsuranceTypeRate(String id) {
YifuUser user = SecurityUtils.getUser();
if(Common.isEmpty(id)){
return R.failed("费率id不能为空");
}
......@@ -68,9 +74,11 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
return R.failed("费率信息不存在或已被删除");
}
LambdaUpdateWrapper<TInsuranceTypeRate> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceTypeRate::getId,id);
updateWrapper.set(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT);
return R.ok(update(updateWrapper));
updateWrapper.eq(TInsuranceTypeRate::getId,id)
.set(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ONE_INT)
.set(TInsuranceTypeRate :: getUpdateBy,user.getId())
.set(TInsuranceTypeRate :: getUpdateTime, LocalDateTime.now());
return R.ok(update(updateWrapper),"删除费率信息成功");
}
/**
......@@ -81,7 +89,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R saveInsuranceTypeRate(TInsuranceTypeRate insuranceTypeRate) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(insuranceTypeRate)){
return R.failed("新增的费率信息为空");
}
......@@ -103,6 +113,10 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
.eq(TInsuranceTypeRate :: getRate,insuranceTypeRate.getRate()).eq(TInsuranceTypeRate:: getMonth ,insuranceTypeRate.getMonth());
List<TInsuranceTypeRate> list = this.list(queryWrapper);
if (list.isEmpty()){
insuranceTypeRate.setDeleteFlag(CommonConstants.ZERO_INT);
insuranceTypeRate.setCreateBy(user.getId());
insuranceTypeRate.setCreateName(user.getNickname());
insuranceTypeRate.setCreateTime(LocalDateTime.now());
return R.ok(this.baseMapper.insert(insuranceTypeRate));
}else{
return R.failed("当前险种已存在相同的费率");
......
......@@ -2,12 +2,15 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.R;
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.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
......@@ -19,10 +22,12 @@ 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.vo.InsuranceTypeVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/**
......@@ -58,10 +63,11 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
*/
@Override
public R saveInsuranceType(TInsuranceType insuranceType) {
YifuUser user = SecurityUtils.getUser();
String companyId = insuranceType.getInsuranceCompanyId();
String bankNo = insuranceType.getBankNo();
if(Common.isNumber(bankNo)){
if(!Common.isNumber(bankNo)){
return R.failed("银行账号格式不正确");
}
LambdaQueryWrapper<TInsuranceCompany> companyWrapper = new LambdaQueryWrapper<>();
companyWrapper.eq(TInsuranceCompany::getId,companyId).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
......@@ -75,6 +81,10 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
if (!Common.isEmpty(type)){
return R.failed("当前险种已存在");
}else{
insuranceType.setDeleteFlag(CommonConstants.ZERO_INT);
insuranceType.setCreateBy(user.getId());
insuranceType.setCreateName(user.getNickname());
insuranceType.setCreateTime(LocalDateTime.now());
return R.ok(save(insuranceType));
}
}
......@@ -104,4 +114,66 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
return R.ok(insuranceTypeVo);
}
/**
* 修改险种信息
*
* @author zhaji
* @param insuranceType 险种信息
* @return {@link R}
*/
@Override
public R updateInsuranceType(TInsuranceType insuranceType) {
if (Common.isEmpty(insuranceType.getId())){
return R.failed("险种ID不能为空");
}
TInsuranceType byId = getById(insuranceType.getId());
if(Common.isEmpty(byId) || byId.getDeleteFlag() == CommonConstants.ONE_INT){
return R.failed("当前险种信息不存在或已被删除");
}
if(byId.getName().equals(insuranceType.getName())){
return R.ok(this.updateById(insuranceType),"修改险种信息成功");
}else{
LambdaQueryWrapper<TInsuranceType> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceType::getName,insuranceType.getName())
.eq(TInsuranceType::getInsuranceCompanyId,insuranceType.getInsuranceCompanyId())
.eq(TInsuranceType::getDeleteFlag,CommonConstants.ZERO_INT);
TInsuranceType one = this.getOne(queryWrapper);
if (Common.isEmpty(one)){
return R.ok(this.updateById(insuranceType),"修改险种信息成功");
}else{
return R.failed("当前险种名称已存在");
}
}
}
/**
* 查询险种列表
*
* @author zhaji
* @param insuranceType 险种信息
* @return {@link List< TInsuranceType>}
*/
@Override
public R getInsuranceTypeList(TInsuranceType insuranceType) {
String companyId = insuranceType.getInsuranceCompanyId();
LambdaQueryWrapper<TInsuranceType> query = new LambdaQueryWrapper<>();
query.eq(TInsuranceType::getDeleteFlag,CommonConstants.ZERO_INT);
if(StringUtils.isBlank(companyId)){
List<TInsuranceType> list = this.list(query);
return R.ok(list,"查询险种列表成功");
}else{
LambdaQueryWrapper<TInsuranceCompany> companyWrapper = new LambdaQueryWrapper<>();
companyWrapper.eq(TInsuranceCompany::getId,companyId).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany insuranceCompany = insuranceCompanyService.getOne(companyWrapper);
if(Common.isEmpty(insuranceCompany)){
return R.failed("所属保险公司不存在或已被删除");
}else{
query.eq(TInsuranceType::getInsuranceCompanyId,companyId);
List<TInsuranceType> list = this.list(query);
return R.ok(list,"查询险种列表成功");
}
}
}
}
......@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.R;
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.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
......@@ -15,8 +17,10 @@ import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/**
......@@ -61,7 +65,9 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R deleteInsuranceTypeStandard(String id) {
YifuUser user = SecurityUtils.getUser();
if(Common.isEmpty(id)){
return R.failed("购买标准id不能为空");
}
......@@ -78,9 +84,11 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
return R.failed("当前险种的购买标准已存在对应的商险信息,不能删除");
}
LambdaUpdateWrapper<TInsuranceTypeStandard> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceTypeStandard::getId,id);
updateWrapper.set(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT);
return R.ok(update(updateWrapper));
updateWrapper.eq(TInsuranceTypeStandard::getId,id)
.set(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ONE_INT)
.set(TInsuranceTypeStandard :: getUpdateBy,user.getId())
.set(TInsuranceTypeStandard :: getUpdateTime,LocalDateTime.now());
return R.ok(update(updateWrapper),"删除购买标准成功");
}
/**
* 新增购买标准
......@@ -90,7 +98,9 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R saveInsuranceTypeStandard(TInsuranceTypeStandard insuranceTypeStandard) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(insuranceTypeStandard)){
return R.failed("新增的购买标准信息为空");
}
......@@ -117,7 +127,11 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
.eq(TInsuranceTypeStandard::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceTypeStandard> list = list(queryWrapper);
if(list.isEmpty()){
return R.ok(this.baseMapper.insert(insuranceTypeStandard));
insuranceTypeStandard.setDeleteFlag(CommonConstants.ZERO_INT);
insuranceTypeStandard.setCreateBy(user.getId());
insuranceTypeStandard.setCreateName(user.getNickname());
insuranceTypeStandard.setCreateTime(LocalDateTime.now());
return R.ok(this.baseMapper.insert(insuranceTypeStandard),"新增购买标准成功");
}else{
return R.failed("当前险种下的购买标准已存在");
}
......
......@@ -8,7 +8,6 @@
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="empName" column="EMP_NAME" jdbcType="VARCHAR"/>
<result property="empIdcardNo" column="EMP_IDCARD_NO" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="deptNo" column="DEPT_NO" jdbcType="VARCHAR"/>
<result property="post" column="POST" jdbcType="VARCHAR"/>
<result property="insuranceCompanyName" column="INSURANCE_COMPANY_NAME" jdbcType="VARCHAR"/>
......@@ -53,7 +52,7 @@
<sql id="Base_Column_List">
ID,EMP_NAME,
EMP_IDCARD_NO,ORDER_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,INSURANCE_TYPE_NAME,
EMP_IDCARD_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,INSURANCE_TYPE_NAME,
INSURANCE_TYPE_ID,BUY_STANDARD,MEDICAL_QUOTA,DIE_DISABLE_QUOTA,POLICY_NO,
POLICY_START,POLICY_END,POLICY_EFFECT,
BATCH_DATE,SETTLE_MONTH,INVOICE_NO,
......@@ -67,7 +66,6 @@
</sql>
<select id="getInsuranceListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
select detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
......@@ -104,7 +102,6 @@
<select id="getInsuranceList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
select detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
......@@ -141,6 +138,7 @@
<select id="getInsuranceDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO">
select
detail.id as id,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
......@@ -184,7 +182,6 @@
<select id="getInsuranceExportListBySelect" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListVO">
select detail.id as id,
detail.ORDER_NO as orderNo,
detail.DEPT_NO as deptNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
......@@ -215,7 +212,6 @@
<select id="getInsuranceExportList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListVO">
select detail.id as id,
detail.ORDER_NO as orderNo,
detail.DEPT_NO as deptNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
......@@ -257,7 +253,6 @@
<select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
......@@ -271,7 +266,8 @@
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard
from t_insurance_detail detail
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
......@@ -315,7 +311,6 @@
<select id="getInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
......@@ -386,7 +381,6 @@
<select id="getInsuranceRefundPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.POST as post,
......@@ -395,11 +389,14 @@
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.POLICY_NO as policyNo,
detail.REFUND_CREATE_TIME as refundCreateTime
refund.CREATE_TIME as refundCreateTime
from
t_insurance_detail detail
t_insurance_detail detail,
t_insurance_refund refund
where
detail.DELETE_FLAG = 0
and
detail.ID = refund.INS_DETAIL_ID
and
detail.REDUCE_HANDLE_STATUS = 4
<if test="param.empName != null and param.empName.trim() != ''">
......@@ -423,12 +420,11 @@
<if test="param.policyEnd != null and param.policyEnd.trim() != ''">
AND detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')
</if>
ORDER BY detail.REFUND_CREATE_TIME DESC
ORDER BY refund.CREATE_TIME DESC
</select>
<select id="getInsuranceRefundList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.DEPT_NO as deptNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
......@@ -445,10 +441,13 @@
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.REFUND_CREATE_TIME as refundCreateTime
refund.CREATE_TIME as refundCreateTime
from
t_insurance_detail detail
t_insurance_detail detail,
t_insurance_refund refund
where
detail.ID = refund.INS_DETAIL_ID
and
detail.DELETE_FLAG = 0
and
detail.REDUCE_HANDLE_STATUS = 4
......@@ -473,12 +472,11 @@
<if test="param.policyEnd != null and param.policyEnd.trim() != ''">
AND detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')
</if>
ORDER BY detail.REFUND_CREATE_TIME DESC
ORDER BY refund.CREATE_TIME DESC
</select>
<select id="getInsuranceRefundHandlingPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundHandlingListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
......@@ -498,9 +496,10 @@
detail.CREATE_NAME as createName,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus
from
t_insurance_detail detail
t_insurance_detail detail,
t_insurance_refund refund
where
detail.DELETE_FLAG = 0
detail.ID = refund.INS_DETAIL_ID
and
(detail.REDUCE_HANDLE_STATUS is not null and detail.REDUCE_HANDLE_STATUS != 3)
<if test="param.empName != null and param.empName.trim() != ''">
......@@ -521,12 +520,11 @@
<if test="param.isUse != null and param.isUse.trim() != ''">
and detail.IS_USE like concat('%',replace(replace(#{param.isUse},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.REFUND_CREATE_TIME DESC
ORDER BY refund.CREATE_TIME DESC
</select>
<select id="getInsuranceRefundHandlingList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundHandlingListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.DEPT_NO as deptNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
......@@ -574,6 +572,19 @@
ORDER BY detail.REFUND_CREATE_TIME DESC
</select>
<select id="selectDetailListByIds"
resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
select
<include refid="Base_Column_List"></include>
from
t_insurance_detail
where
ID in
<foreach collection="param.idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<update id="updateInsuranceRefund">
update
t_insurance_detail detail
......@@ -582,9 +593,11 @@
REDUCE_HANDLE_STATUS = #{param.refundType},
UPDATE_TIME = #{param.refundCreateTime}
where
detail.id in
detail.ID in
<foreach collection="param.idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</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.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>
......@@ -44,7 +44,6 @@
ID as id,
INSURANCE_TYPE_ID as insuranceTypeId,
BUY_STANDARD as buyStandard,
TYPE as type,
MEDICAL_QUOTA as medicalQuota,
DIE_DISABLE_QUOTA as dieDisableQuota
from
......
......@@ -13,6 +13,6 @@
</resultMap>
<sql id="Base_Column_List">
ID,INSURANCE_TYPE_ID,BUY_STANDARD,MEDICAL_QUOTA,DIE_DISABLE_QUOTA
ID,INSURANCE_TYPE_ID,BUY_STANDARD,MEDICAL_QUOTA,DIE_DISABLE_QUOTA,
</sql>
</mapper>
......@@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
......@@ -34,7 +33,6 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TPreDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchUpdateVo;
import lombok.extern.slf4j.Slf4j;
import org.ehcache.impl.internal.util.ServiceUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
......@@ -43,7 +41,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLDecoder;
import java.util.ArrayList;
......@@ -221,7 +218,7 @@ public class TPreDispatchInfoController {
* @Author huyc
* @Date 2022-07-18
* @param jsonString
* @param houseId 社保户ID
* @param socialHouse 社保户
* @param departId 结算主体ID
* @return
**/
......@@ -229,9 +226,8 @@ public class TPreDispatchInfoController {
@SysLog("预派单批量新增派增")
@PostMapping("/analysisJsonStringImportAdd")
@PreAuthorize("@pms.hasPermission('social:tpredispatchinfo_importAddList')")
public R analysisJsonStringImportAdd(@RequestBody String jsonString,
@RequestParam(value = "houseId",required = true) String houseId,
@RequestParam(value = "departId",required = true) String departId) {
public R analysisJsonStringImportAdd(@RequestBody String jsonString, @RequestParam(value = "socialHouse",required = false) String socialHouse,
@RequestParam(value = "fundHouse",required = false) String fundHouse, @RequestParam String departId) {
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed(CommonConstants.USER_FAIL);
......@@ -248,7 +244,7 @@ public class TPreDispatchInfoController {
return R.failed(util1.getErrorInfo(),PreDispatchConstants.DATA_CHECK);
} else {
if (null != listInfo && !listInfo.isEmpty()) {
errorInfo = tPreDispatchInfoService.batchSavePreDisPatchAdd(listInfo, user,houseId,departId);
errorInfo = tPreDispatchInfoService.batchSavePreDisPatchAdd(listInfo, user,socialHouse,fundHouse,departId);
} else {
errorInfo.add(new ErrorMessage(null, CommonConstants.DATA_CAN_NOT_EMPTY));
}
......
......@@ -104,11 +104,11 @@ public interface TPreDispatchInfoService extends IService<TPreDispatchInfo> {
* @Date 2022-07-18
* @param listInfo
* @param user
* @param houseId
* @param socialHouse
* @param departId
* @return
**/
List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String houseId, String departId);
List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String socialHouse, String fundHouse, String departId);
/**
* 预派单批量新增派减
......
......@@ -546,7 +546,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
@Override
public List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String houseId, String departId) {
public List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String socialHouse, String fundHouse, String departId) {
List<ErrorMessage> errorList = new ArrayList<>();
R<TSettleDomainSelectVo> domainR = archivesDaprUtil.getSettleDomainSelectVoById(departId);
TSettleDomainSelectVo selectVo = domainR.getData();
......@@ -579,7 +579,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
continue;
}
// 基础封装 其他
initBaseInfo(houseId, selectVo, info);
initBaseInfo(socialHouse, fundHouse, selectVo, info);
// 2.先校验已有数据
checkBatchSave(info, CommonConstants.ZERO_STRING);
// 3.封装 社保缴纳地 公积金缴纳地
......@@ -1026,15 +1026,14 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/**
* 初始化基础数据 如 各种状态 合同数据等
*
* @param houseId
* @param socialHouse
* @param selectVo
* @param info
* @return
* @Author fxj
* @Date 2020-12-31
**/
private void initBaseInfo(String houseId, TSettleDomainSelectVo selectVo, TPreDispatchInfo info) {
private void initBaseInfo(String socialHouse, String fundHouse, TSettleDomainSelectVo selectVo, TPreDispatchInfo info) {
info.setType(CommonConstants.ZERO_STRING);
info.setDataSubStatus(CommonConstants.ONE_STRING);
info.setStatus(CommonConstants.ZERO_STRING);
......@@ -1056,8 +1055,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
info.setContractTermAdd(Integer.toString(Common.getYearOfTime(info.getContractStart(), info.getContractEnd())));
// 默认工时制 综合工时制2
info.setWorkingHoursAdd(CommonConstants.TWO_STRING);
info.setSocialHouseAdd(houseId);
info.setFundHouseAdd(houseId);
info.setSocialHouseAdd(socialHouse);
info.setFundHouseAdd(fundHouse);
}
/**
......
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