Commit 3076dea4 authored by huyuchen's avatar huyuchen

huych-含风险项目商险不购买申请提交

parent 5c5a87ea
......@@ -108,6 +108,8 @@ public interface CacheConstants {
**/
String EVERYDAY_DISPATCH_CODE = "everyday_dispatch_code";
String EVERYDAY_UNBUY_CODE = "everyday_unbuy_code";
/**
* 区域数据--标签
*/
......
......@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonCardVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
......@@ -157,4 +158,15 @@ public class SocialDaprUtils {
public R<Boolean> updateIncomeSettleStatus(List<EkpInsuranceViewVo> infoVo) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/updateIncomeSettleStatus", JSON.toJSONString(infoVo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 更新结算信息
* @Date 17:38 2022/12/26
* @Param
* @return
**/
public R<Boolean> selectExitSocialInjury(TInsuranceUnpurchasePersonCardVo cardVo) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialfundinfo/inner/selectExitSocialInjury", JSON.toJSONString(cardVo), Boolean.class, SecurityConstants.FROM_IN);
}
}
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonAddVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -79,7 +80,28 @@ public class TInsuranceUnpurchaseApply extends BaseEntity {
@Schema(description ="当前审核人ID")
private String auditUserId;
@Schema(description ="当前审核人ID")
private String unbuyNum;
@Schema(description ="明细数据集")
@TableField(exist = false)
private List<TInsuranceUnpurchasePerson> personList;
private List<TInsuranceUnpurchasePersonAddVo> personList;
/**
* 附件Id
*/
@TableField(exist = false)
private List<String> attaIdList;
/**
* 暂存,提交,编辑区分
*/
@TableField(exist = false)
private String saveFlag;
// /**
// * 印章附件
// */
// @TableField(exist = false)
// private List<TAttaInfo> attaInfoList;
}
......@@ -80,5 +80,4 @@ public class TInsuranceUnpurchasePerson extends BaseEntity {
@Schema(description ="服务项是否勾选商险 0 是 1 否")
private String insuranceFlag;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 含风险项目不购买申请表
......@@ -19,113 +17,76 @@ import java.io.Serializable;
* @date 2025-01-10 11:24:38
*/
@Data
public class TInsuranceUnpurchaseApplyVo extends RowIndex implements Serializable {
public class TInsuranceUnpurchaseApplyVo implements Serializable {
/**
* id
* 申请编号
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 36, message = "id 不能超过36 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 36)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
@ExcelAttribute(name = "申请编号")
@Schema(description = "申请编号")
@ExcelProperty("申请编号")
private String applyNo;
/**
* 项目ID
* 项目名称
*/
@Length(max = 32, message = "项目ID 不能超过32 个字符")
@ExcelAttribute(name = "项目ID", maxLength = 32)
@Schema(description = "项目ID")
@ExcelProperty("项目ID")
private String deptId;
@ExcelAttribute(name = "项目名称")
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@Length(max = 30, message = "项目编码 不能超过30 个字符")
@ExcelAttribute(name = "项目编码", maxLength = 30)
@ExcelAttribute(name = "项目编码")
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 项目名称
*/
@Length(max = 50, message = "项目名称 不能超过50 个字符")
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 申请人所在部门
* 创建者-姓名
*/
@Length(max = 36, message = "申请人所在部门 不能超过36 个字符")
@ExcelAttribute(name = "申请人所在部门", maxLength = 36)
@Schema(description = "申请人所在部门")
@ExcelProperty("申请人所在部门")
private String createUserDeptId;
@ExcelAttribute(name = "申请人")
@Schema(description = "申请人")
@ExcelProperty("申请人")
private String createName;
/**
* 申请人所在部门名称
*/
@Length(max = 50, message = "申请人所在部门名称 不能超过50 个字符")
@ExcelAttribute(name = "申请人所在部门名称", maxLength = 50)
@Schema(description = "申请人所在部门名称")
@ExcelProperty("申请人所在部门名称")
@ExcelAttribute(name = "所属部门")
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String createUserDeptName;
/**
* 不购买原因 1 已购买社保 2 人员已离职
*/
@Length(max = 1, message = "不购买原因 1 已购买社保 2 人员已离职 不能超过1 个字符")
@ExcelAttribute(name = "不购买原因 1 已购买社保 2 人员已离职", maxLength = 1)
@Schema(description = "不购买原因 1 已购买社保 2 人员已离职")
@ExcelProperty("不购买原因 1 已购买社保 2 人员已离职")
private String reasonType;
/**
* 原因说明
*/
@Length(max = 50, message = "原因说明 不能超过50 个字符")
@ExcelAttribute(name = "原因说明", maxLength = 50)
@Schema(description = "原因说明")
@ExcelProperty("原因说明")
private String reasonInfo;
/**
* 申请编号
*/
@Length(max = 20, message = "申请编号 不能超过20 个字符")
@ExcelAttribute(name = "申请编号", maxLength = 20)
@Schema(description = "申请编号")
@ExcelProperty("申请编号")
private String applyNo;
/**
* 项目是否有审批通过记录 0 是 1 否
*/
@Length(max = 1, message = "项目是否有审批通过记录 0 是 1 否 不能超过1 个字符")
@ExcelAttribute(name = "项目是否有审批通过记录 0 是 1 否", maxLength = 1)
@Schema(description = "项目是否有审批通过记录 0 是 1 否")
@ExcelProperty("项目是否有审批通过记录 0 是 1 否")
private String auditFlag;
/**
* 申请人是否属于子分公司 0 是 1 否
* 申请时间
*/
@Length(max = 1, message = "申请人是否属于子分公司 0 是 1 否 不能超过1 个字符")
@ExcelAttribute(name = "申请人是否属于子分公司 0 是 1 否", maxLength = 1)
@Schema(description = "申请人是否属于子分公司 0 是 1 否")
@ExcelProperty("申请人是否属于子分公司 0 是 1 否")
private String companyFlag;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@ExcelAttribute(name = "申请时间")
@Schema(description = "申请时间")
@ExcelProperty("申请时间")
private LocalDateTime createTime;
@ExcelAttribute(name = "当前审核人")
@Schema(description = "当前审核人")
@ExcelProperty("当前审核人")
private String auditUser;
/**
* 是否删除 0未删除/1删除
* 不购买原因 1 已购买社保 2 人员已离职
*/
@Length(max = 1, message = "是否删除 0未删除/1删除 不能超过1 个字符")
@ExcelAttribute(name = "是否删除 0未删除/1删除", maxLength = 1)
@Schema(description = "是否删除 0未删除/1删除")
@ExcelProperty("是否删除 0未删除/1删除")
private String deleteFlag;
@ExcelAttribute(name = "不购买原因")
@Schema(description = "不购买原因")
@ExcelProperty("不购买原因")
private String reasonType;
/**
* 申请状态 0 草稿 1待提交 2 待审核 3 审核通过 4 审核不通过
*/
@Length(max = 1, message = "申请状态 0 草稿 1待提交 2 待审核 3 审核通过 4 审核不通过 不能超过1 个字符")
@ExcelAttribute(name = "申请状态 0 草稿 1待提交 2 待审核 3 审核通过 4 审核不通过", maxLength = 1)
@Schema(description = "申请状态 0 草稿 1待提交 2 待审核 3 审核通过 4 审核不通过")
@ExcelProperty("申请状态 0 草稿 1待提交 2 待审核 3 审核通过 4 审核不通过")
@ExcelAttribute(name = "审核状态")
@Schema(description = "审核状态")
@ExcelProperty("审核状态")
private String status;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 含风险项目不购买申请明细表
*
* @author huych
* @date 2025-01-10 11:23:21
*/
@Data
public class TInsuranceUnpurchasePersonAddVo implements Serializable {
@Schema(description = "行号")
private String rowIndex;
@Schema(description = "id")
private String id;
/**
* 姓名
*/
@ExcelProperty("员工姓名")
private String empName;
@Schema(description = "身份证号")
private String empIdcardNo;
@Schema(description = "就职岗位")
private String post;
@Schema(description = "code码区分报错")
private String code;
@Schema(description = "错误信息")
private String message;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 含风险项目不购买申请明细表
*
* @author huych
* @date 2025-01-10 11:23:21
*/
@Data
public class TInsuranceUnpurchasePersonCardVo implements Serializable {
/**
* 姓名
*/
@ExcelProperty("员工姓名")
private String empName;
@Schema(description = "身份证号")
private String empIdcardNo;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 含风险项目不购买申请明细表
......@@ -19,130 +16,82 @@ import java.io.Serializable;
* @date 2025-01-10 11:23:21
*/
@Data
public class TInsuranceUnpurchasePersonVo extends RowIndex implements Serializable {
public class TInsuranceUnpurchasePersonVo implements Serializable {
/**
* id
* 明细单号
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 36, message = "id 不能超过36 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 36)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 父级id
*/
@Length(max = 36, message = "父级id 不能超过36 个字符")
@ExcelAttribute(name = "父级id", maxLength = 36)
@Schema(description = "父级id")
@ExcelProperty("父级id")
private String parnetId;
/**
* 姓名
*/
@Length(max = 32, message = "姓名 不能超过32 个字符")
@ExcelAttribute(name = "姓名", maxLength = 32)
@Schema(description = "姓名")
@ExcelProperty("姓名")
private String empName;
/**
* 身份证号
*/
@Length(max = 32, message = "身份证号 不能超过32 个字符")
@ExcelAttribute(name = "身份证号", maxLength = 32)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcardNo;
/**
* 就职岗位
*/
@Length(max = 50, message = "就职岗位 不能超过50 个字符")
@ExcelAttribute(name = "就职岗位", maxLength = 50)
@Schema(description = "就职岗位")
@ExcelProperty("就职岗位")
private String post;
@ExcelAttribute(name = "明细单号")
@Schema(description = "明细单号")
@ExcelProperty("明细单号")
private String applyNoDetail;
/**
* 明细申请编
* 不购买申请流程单
*/
@Length(max = 20, message = "明细申请编号 不能超过20 个字符")
@ExcelAttribute(name = "明细申请编号", maxLength = 20)
@Schema(description = "明细申请编号")
@ExcelProperty("明细申请编号")
private String applyNoDetail;
@ExcelAttribute(name = "不购买申请流程单号")
@Schema(description = "不购买申请流程单号")
@ExcelProperty("不购买申请流程单号")
private String applyNo;
/**
* 项目ID
* 项目名称
*/
@Length(max = 32, message = "项目ID 不能超过32 个字符")
@ExcelAttribute(name = "项目ID", maxLength = 32)
@Schema(description = "项目ID")
@ExcelProperty("项目ID")
private String deptId;
@ExcelAttribute(name = "项目名称")
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@Length(max = 30, message = "项目编码 不能超过30 个字符")
@ExcelAttribute(name = "项目编码", maxLength = 30)
@ExcelAttribute(name = "项目编码")
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
@ExcelAttribute(name = "事业部")
@Schema(description = "事业部")
@ExcelProperty("事业部")
private String division;
@ExcelAttribute(name = "事业部条线")
@Schema(description = "事业部条线")
@ExcelProperty("事业部条线")
private String newLine;
/**
* 项目名称
*/
@Length(max = 50, message = "项目名称 不能超过50 个字符")
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 申请人所在部门
* 姓名
*/
@Length(max = 36, message = "申请人所在部门 不能超过36 个字符")
@ExcelAttribute(name = "申请人所在部门", maxLength = 36)
@Schema(description = "申请人所在部门")
@ExcelProperty("申请人所在部门")
private String createUserDeptId;
@ExcelAttribute(name = "员工姓名")
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 申请人所在部门名称
* 身份证号
*/
@Length(max = 50, message = "申请人所在部门名称 不能超过50 个字符")
@ExcelAttribute(name = "申请人所在部门名称", maxLength = 50)
@Schema(description = "申请人所在部门名称")
@ExcelProperty("申请人所在部门名称")
private String createUserDeptName;
@ExcelAttribute(name = "身份证号")
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcardNo;
/**
* 不购买原因 1 已购买社保 2 人员已离职
*/
@Length(max = 1, message = "不购买原因 1 已购买社保 2 人员已离职 不能超过1 个字符")
@ExcelAttribute(name = "不购买原因 1 已购买社保 2 人员已离职", maxLength = 1)
@Schema(description = "不购买原因 1 已购买社保 2 人员已离职")
@ExcelProperty("不购买原因 1 已购买社保 2 人员已离职")
@ExcelAttribute(name = "不购买原因")
@Schema(description = "不购买原因")
@ExcelProperty("不购买原因")
private String reasonType;
/**
* 原因说明
*/
@Length(max = 50, message = "原因说明 不能超过50 个字符")
@ExcelAttribute(name = "原因说明", maxLength = 50)
@Schema(description = "原因说明")
@ExcelProperty("原因说明")
private String reasonInfo;
/**
* 主表申请编号
*/
@Length(max = 20, message = "主表申请编号 不能超过20 个字符")
@ExcelAttribute(name = "主表申请编号", maxLength = 20)
@Schema(description = "主表申请编号")
@ExcelProperty("主表申请编号")
private String applyNo;
/**
* 社保是否在保 0 是 1 否
*/
@Length(max = 1, message = "社保是否在保 0 是 1 否 不能超过1 个字符")
@ExcelAttribute(name = "社保是否在保 0 是 1 否", maxLength = 1)
@Schema(description = "社保是否在保 0 是 1 否")
@ExcelProperty("社保是否在保 0 是 1 否")
@ExcelAttribute(name = "社保是否在保")
@Schema(description = "社保是否在保")
@ExcelProperty("社保是否在保")
private String socialStatus;
/**
* 发薪次数
*/
......@@ -151,4 +100,21 @@ public class TInsuranceUnpurchasePersonVo extends RowIndex implements Serializab
@ExcelProperty("发薪次数")
private Integer salaryNum;
/**
* 创建者-姓名
*/
@ExcelAttribute(name = "申请人")
@Schema(description = "申请人")
@ExcelProperty("申请人")
private String createName;
/**
* 申请时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@ExcelAttribute(name = "申请时间")
@Schema(description = "申请时间")
@ExcelProperty("申请时间")
private LocalDateTime createTime;
}
......@@ -68,7 +68,7 @@ public class TInsuranceUnpurchaseApplyController {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<TInsuranceUnpurchaseApply> getById(@PathVariable("id") String id) {
return R.ok(tInsuranceUnpurchaseApplyService.getById(id));
return tInsuranceUnpurchaseApplyService.getDetailInfoById(id);
}
/**
......@@ -81,7 +81,7 @@ public class TInsuranceUnpurchaseApplyController {
@SysLog("新增含风险项目不购买申请表")
@PostMapping("/add")
public R save(@RequestBody TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
return new R<>(tInsuranceUnpurchaseApplyService.save(tInsuranceUnpurchaseApply));
return new R<>(tInsuranceUnpurchaseApplyService.addApply(tInsuranceUnpurchaseApply));
}
/**
......
......@@ -5,7 +5,6 @@ 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.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceUnpurchasePersonService;
......@@ -13,7 +12,6 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonSearc
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
......@@ -60,51 +58,13 @@ public class TInsuranceUnpurchasePersonController {
return R.ok(tInsuranceUnpurchasePersonService.getById(id));
}
/**
* 新增含风险项目不购买申请明细表
* @param tInsuranceUnpurchasePerson 含风险项目不购买申请明细表
* @return R
*/
@Operation(summary = "新增含风险项目不购买申请明细表", description = "新增含风险项目不购买申请明细表")
@SysLog("新增含风险项目不购买申请明细表")
@PostMapping
public R<Boolean> save(@RequestBody TInsuranceUnpurchasePerson tInsuranceUnpurchasePerson) {
return R.ok(tInsuranceUnpurchasePersonService.save(tInsuranceUnpurchasePerson));
}
/**
* 修改含风险项目不购买申请明细表
* @param tInsuranceUnpurchasePerson 含风险项目不购买申请明细表
* @return R
*/
@Operation(summary = "修改含风险项目不购买申请明细表", description = "修改含风险项目不购买申请明细表")
@SysLog("修改含风险项目不购买申请明细表")
@PutMapping
public R<Boolean> updateById(@RequestBody TInsuranceUnpurchasePerson tInsuranceUnpurchasePerson) {
return R.ok(tInsuranceUnpurchasePersonService.updateById(tInsuranceUnpurchasePerson));
}
/**
* 通过id删除含风险项目不购买申请明细表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除含风险项目不购买申请明细表", description = "通过id删除含风险项目不购买申请明细表:hasPermission('insurances_tinsuranceunpurchaseperson_del')")
@SysLog("通过id删除含风险项目不购买申请明细表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_tinsuranceunpurchaseperson_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tInsuranceUnpurchasePersonService.removeById(id));
}
/**
* 含风险项目不购买申请明细表 批量导出
* @author huych
* @date 2025-01-10 11:23:21
**/
@Operation(description = "导出含风险项目不购买申请明细表 hasPermission('insurances_tinsuranceunpurchaseperson-export')")
@Operation(description = "导出含风险项目不购买申请明细表")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('insurances_tinsuranceunpurchaseperson-export')")
public void export(HttpServletResponse response, @RequestBody TInsuranceUnpurchasePersonSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchaseApplySearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchaseApplyVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -38,7 +39,11 @@ public interface TInsuranceUnpurchaseApplyMapper extends BaseMapper<TInsuranceUn
* @param tInsuranceUnpurchaseApply 含风险项目不购买申请表
* @return
*/
List<TInsuranceUnpurchaseApply> getTInsuranceUnpurchaseApplyExportList(@Param("tInsuranceUnpurchaseApply") TInsuranceUnpurchaseApplySearchVo tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchaseApplyVo> getTInsuranceUnpurchaseApplyExportList(@Param("tInsuranceUnpurchaseApply") TInsuranceUnpurchaseApplySearchVo tInsuranceUnpurchaseApply);
String getMaxInusuranceCode();
String getMaxInusuranceDetailCode();
/**
* 待审核分页查询
......
......@@ -5,9 +5,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 含风险项目不购买申请明细表
*
......@@ -23,4 +26,18 @@ public interface TInsuranceUnpurchasePersonMapper extends BaseMapper<TInsuranceU
*/
IPage<TInsuranceUnpurchasePerson> getTInsuranceUnpurchasePersonPage(Page<TInsuranceUnpurchasePerson> page
, @Param("tInsuranceUnpurchasePerson") TInsuranceUnpurchasePersonSearchVo tInsuranceUnpurchasePerson);
/**
* 含风险项目不购买申请表简单分页查询
* @param tInsuranceUnpurchasePerson 含风险项目不购买申请表
* @return
*/
long getTInsuranceUnpurchaseInfoExportCount(@Param("tInsuranceUnpurchasePerson") TInsuranceUnpurchasePersonSearchVo tInsuranceUnpurchasePerson);
/**
* 含风险项目不购买申请表简单导出查询
* @param tInsuranceUnpurchasePerson 含风险项目不购买申请表
* @return
*/
List<TInsuranceUnpurchasePersonVo> getTInsuranceUnpurchaseInfoExportList(@Param("tInsuranceUnpurchasePerson") TInsuranceUnpurchasePersonSearchVo tInsuranceUnpurchasePerson);
}
......@@ -8,6 +8,7 @@ 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.insurances.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchaseApplySearchVo;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
......@@ -63,5 +64,10 @@ public interface TInsuranceUnpurchaseApplyService extends IService<TInsuranceUnp
R<String> auditAndCommit(TInsuranceUnpurchaseApply insuranceUnpurchaseApply, String approvalResult, String approvalOpinion, YifuUser user)
throws CheckedException;
@Transactional
R addApply(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply);
R<TInsuranceUnpurchaseApply> getDetailInfoById(String id);
}
......@@ -3,28 +3,36 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.lock.annotation.Lock4j;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
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.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
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.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceUnpurchaseApplyMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeRateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceUnpurchasePersonService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl.process.TInsuranceUnpurchaseApplyAuditProcess;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchaseApplySearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchaseApplyVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonAddVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonCardVo;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -33,6 +41,7 @@ import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -48,6 +57,16 @@ import java.util.Map;
@Service
public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsuranceUnpurchaseApplyMapper, TInsuranceUnpurchaseApply> implements TInsuranceUnpurchaseApplyService {
@Resource
private TInsuranceUnpurchasePersonService personService;
@Resource
private SocialDaprUtils socialDaprUtil;
@Resource
private CacheManager cacheManager;
@Resource
@Lazy
private TInsuranceUnpurchaseApplyAuditProcess tInsuranceUnpurchaseApplyAuditProcess;
......@@ -63,7 +82,6 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
return baseMapper.getTInsuranceUnpurchaseApplyPage(page, tInsuranceUnpurchaseApply);
}
@Override
public R deleteById(String id) {
TInsuranceUnpurchaseApply apply = baseMapper.selectById(id);
if (Common.isNotNull(apply)) {
......@@ -85,14 +103,14 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
public void listExport(HttpServletResponse response, TInsuranceUnpurchaseApplySearchVo searchVo) {
String fileName = "含风险项目不购买申请表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TInsuranceUnpurchaseApply> list = new ArrayList<>();
List<TInsuranceUnpurchaseApplyVo> list = new ArrayList<>();
long count = baseMapper.getTInsuranceUnpurchaseApplyExportCount(searchVo);
try(ServletOutputStream out = response.getOutputStream();) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TInsuranceUnpurchaseApply.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TInsuranceUnpurchaseApplyVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i = i + CommonConstants.EXCEL_EXPORT_LIMIT) {
......@@ -122,6 +140,234 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
}
}
@Override
public R addApply(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
YifuUser user = SecurityUtils.getUser();
//字段长度校验
if (Common.isNotNull(tInsuranceUnpurchaseApply.getReasonInfo()) && tInsuranceUnpurchaseApply.getReasonInfo().length() > 200) {
return R.failed("原因说明不能超过两百个字符");
}
try {
//申请编号
String applyNo = getCode();
//获取明细当日最大申请编号
String applyDetail = baseMapper.getMaxInusuranceDetailCode();
//暂存不做校验
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
tInsuranceUnpurchaseApply.setCreateBy(user.getId());
tInsuranceUnpurchaseApply.setCreateName(user.getNickname());
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName());
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
tInsuranceUnpurchaseApply.setCreateTime(null);
tInsuranceUnpurchaseApply.setUpdateTime(null);
baseMapper.insert(tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchasePerson> personList = new ArrayList<>();
if (Common.isNotNull(tInsuranceUnpurchaseApply.getPersonList())) {
for (TInsuranceUnpurchasePersonAddVo vo : tInsuranceUnpurchaseApply.getPersonList()) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail,vo.getRowIndex()));
initValue(tInsuranceUnpurchaseApply, person);
personList.add(person);
}
personService.saveBatch(personList);
}
} else if (CommonConstants.TWO_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
//校验若该项目&该人员身份证号是否已经有过“已购买社保”的不购买商险明细,若有也会禁止重复提交!提示:姓名+身份证号、姓名+身份证号、已有申请记录,无需重复提交,可删除后再提交;
//校验该身份证&姓名组合的数据能否找到在途或在保的社保-工伤险数据,即是否为-“工伤”险正常参保的人员,不受项目限制,若“工伤”险皆正常在保或有在途“待审核、待办理”,则可正常提交,若未正常参保或无在途的参保数据,则提示“姓名+身份证号、姓名+身份证号无正常参保或派单中的数据,禁止提交!”
List<TInsuranceUnpurchasePersonAddVo> personList = addAndUpdCheck(tInsuranceUnpurchaseApply);
if (Common.isNotNull(personList) && !personList.isEmpty() &&
personList.stream().noneMatch(e -> CommonConstants.ONE_STRING.equals(e.getCode()))) {
tInsuranceUnpurchaseApply.setCreateBy(user.getId());
tInsuranceUnpurchaseApply.setCreateName(user.getNickname());
tInsuranceUnpurchaseApply.setCreateUserDeptName(user.getDeptName());
tInsuranceUnpurchaseApply.setCreateUserDeptId(user.getDeptId().toString());
tInsuranceUnpurchaseApply.setApplyNo(applyNo);
baseMapper.insert(tInsuranceUnpurchaseApply);
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail,vo.getRowIndex()));
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
} else {
return R.failed(personList);
}
} else if (CommonConstants.THREE_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
List<TInsuranceUnpurchasePersonAddVo> personList = addAndUpdCheck(tInsuranceUnpurchaseApply);
if (Common.isNotNull(personList) && !personList.isEmpty() &&
personList.stream().noneMatch(e -> CommonConstants.ONE_STRING.equals(e.getCode()))) {
//同倩倩确认申请时间实时更新
tInsuranceUnpurchaseApply.setCreateTime(LocalDateTime.now());
baseMapper.updateById(tInsuranceUnpurchaseApply);
//先删除明细表数据再重新生成
personService.remove(Wrappers.<TInsuranceUnpurchasePerson>lambdaQuery()
.eq(TInsuranceUnpurchasePerson::getParnetId, tInsuranceUnpurchaseApply.getId()));
List<TInsuranceUnpurchasePerson> personInfoList = new ArrayList<>();
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
TInsuranceUnpurchasePerson person = new TInsuranceUnpurchasePerson();
person.setEmpIdcardNo(vo.getEmpIdcardNo());
person.setEmpName(vo.getEmpName());
person.setPost(vo.getPost());
person.setApplyNoDetail(getDetailCode(applyDetail,vo.getRowIndex()));
initValue(tInsuranceUnpurchaseApply, person);
personInfoList.add(person);
}
personService.saveBatch(personInfoList);
} else {
return R.failed(personList);
}
}
return R.ok();
} catch (Exception e) {
e.printStackTrace();
return R.failed("系统异常,保存、更新失败!");
}
}
@Override
public R<TInsuranceUnpurchaseApply> getDetailInfoById(String id) {
TInsuranceUnpurchaseApply apply = baseMapper.selectById(id);
if (Common.isEmpty(apply)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
return R.ok();
}
public List<TInsuranceUnpurchasePersonAddVo> addAndUpdCheck(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
Map<String,String> sameCheckMap = new HashMap<>();
TInsuranceUnpurchasePerson exit;
List<TInsuranceUnpurchasePersonAddVo> personList = tInsuranceUnpurchaseApply.getPersonList();
if (Common.isNotNull(personList) && !personList.isEmpty()) {
for (TInsuranceUnpurchasePersonAddVo vo : personList) {
StringBuilder sameCheck = new StringBuilder();
sameCheck.append(vo.getEmpIdcardNo());
sameCheck.append("_");
sameCheck.append(vo.getEmpName());
sameCheck.append("_");
sameCheck.append(vo.getPost());
if (null == sameCheckMap.get(sameCheck.toString())) {
sameCheckMap.put(sameCheck.toString(), "1");
} else {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":已有申请记录,无需重复提交,可删除后再提交");
}
exit = personService.getOne(Wrappers.<TInsuranceUnpurchasePerson>query().lambda()
.eq(TInsuranceUnpurchasePerson::getDeptNo, tInsuranceUnpurchaseApply.getDeptNo())
.eq(TInsuranceUnpurchasePerson::getEmpIdcardNo, vo.getEmpIdcardNo())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exit)) {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":已有申请记录,无需重复提交,可删除后再提交");
continue;
}
TInsuranceUnpurchasePersonCardVo cardVo = new TInsuranceUnpurchasePersonCardVo();
cardVo.setEmpIdcardNo(vo.getEmpIdcardNo());
cardVo.setEmpName(vo.getEmpName());
R<Boolean> flag = socialDaprUtil.selectExitSocialInjury(cardVo);
if (Common.isEmpty(flag) || Boolean.TRUE.equals(!flag.getData())) {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":无正常参保或派单中的数据,禁止提交!");
}
}
}
return personList;
}
private void initValue(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply,TInsuranceUnpurchasePerson person) {
person.setParnetId(tInsuranceUnpurchaseApply.getId());
person.setApplyNo(tInsuranceUnpurchaseApply.getApplyNo());
person.setDeptId(tInsuranceUnpurchaseApply.getDeptId());
person.setDeptNo(tInsuranceUnpurchaseApply.getDeptNo());
person.setDivision(tInsuranceUnpurchaseApply.getDivision());
person.setNewLine(tInsuranceUnpurchaseApply.getNewLine());
person.setReasonInfo(tInsuranceUnpurchaseApply.getReasonInfo());
person.setCreateBy(tInsuranceUnpurchaseApply.getCreateBy());
person.setCreateName(tInsuranceUnpurchaseApply.getCreateName());
person.setCreateUserDeptName(tInsuranceUnpurchaseApply.getCreateUserDeptName());
person.setCreateUserDeptId(tInsuranceUnpurchaseApply.getCreateUserDeptId());
}
//获取申请编码
@Lock4j(expire = 60000, acquireTimeout = 1000)
public String getCode() {
String nowDay = DateUtil.getThisDay();
Cache cache = cacheManager.getCache(CacheConstants.EVERYDAY_UNBUY_CODE);
assert cache != null;
Object nowNumObj = cache.get(nowDay);
int nowNums = 1;
if (Common.isNotNull(nowNumObj)) {
SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1;
} else {
String empCode = null;
try {
empCode = baseMapper.getMaxInusuranceCode();
nowNums = Integer.parseInt(empCode) + 1;
} catch (NumberFormatException e) {
log.error("获取含风险项目不购买商险申请时出错:" + empCode);
}
}
cache.put(nowDay, nowNums);
return "SXBGM" + nowDay + this.getThreeNum(String.valueOf(nowNums));
}
//获取申请编码
public String getDetailCode(String empCode,String row) {
String nowDay = DateUtil.getThisDay();
int nowNums = 1;
try {
nowNums = Integer.parseInt(empCode) + Integer.parseInt(row);
} catch (NumberFormatException e) {
log.error("获取含风险项目不购买商险申请明细时出错:" + empCode);
}
return "SXBGMMX" + nowDay + this.getFiveNum(String.valueOf(nowNums));
}
/**
* @param nowNums 数字
* @Description: 获取三位字符型数字
* @Author: huych
* @Date: 2025/1/14 17:35
* @return: 三位字符型数字
**/
private String getThreeNum(String nowNums) {
if (nowNums.length() >= 3) {
return nowNums.substring(0, 3);
}
String[] zeroArr = {"0", "00", "000", "0000"};
int num = 2 - nowNums.length();
return zeroArr[num] + nowNums;
}
/**
* @param nowNums 数字
* @Description: 获取五位字符型数字
* @Author: huych
* @Date: 2025/1/14 17:35
* @return: 五位字符型数字
**/
private String getFiveNum(String nowNums) {
if (nowNums.length() >= 5) {
return nowNums.substring(0, 5);
}
String[] zeroArr = {"0", "00", "000", "0000"};
int num = 4 - nowNums.length();
return zeroArr[num] + nowNums;
}
/**
* 报价单审核分页
*
......
......@@ -13,6 +13,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceUnpurchasePersonMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceUnpurchasePersonService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......@@ -49,23 +50,21 @@ public class TInsuranceUnpurchasePersonServiceImpl extends ServiceImpl<TInsuranc
public void listExport(HttpServletResponse response, TInsuranceUnpurchasePersonSearchVo searchVo){
String fileName = "含风险项目商险不购买导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TInsuranceUnpurchasePerson> list = new ArrayList<>();
// long count = noPageCountDiy(searchVo);
long count = 0l;
List<TInsuranceUnpurchasePersonVo> list = new ArrayList<>();
long count = baseMapper.getTInsuranceUnpurchaseInfoExportCount(searchVo);
try (ServletOutputStream out = response.getOutputStream();){
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TInsuranceUnpurchasePerson.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TInsuranceUnpurchasePersonVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; i = i + CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
// list = noPageDiy(searchVo);
list = baseMapper.getTInsuranceUnpurchaseInfoExportList(searchVo);
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet("含风险项目不购买申请明细表"+index).build();
excelWriter.write(list,writeSheet);
......
......@@ -30,6 +30,20 @@
<result property="auditUser" column="AUDIT_USER"/>
<result property="auditUserId" column="AUDIT_USER_ID"/>
</resultMap>
<resultMap id="tInsuranceUnpurchaseApplyExportMap"
type="com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchaseApplyVo">
<result property="deptNo" column="DEPT_NO"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="createUserDeptName" column="CREATE_USER_DEPT_NAME"/>
<result property="reasonType" column="REASON_TYPE"/>
<result property="applyNo" column="APPLY_NO"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="status" column="STATUS"/>
<result property="auditUser" column="AUDIT_USER"/>
</resultMap>
<sql id="Base_Column_List">
a.ID, a.DEPT_ID, a.DEPT_NO, a.DEPT_NAME, a.CREATE_USER_DEPT_ID,
a.CREATE_USER_DEPT_NAME, a.REASON_TYPE, a.REASON_INFO, a.APPLY_NO,
......@@ -84,7 +98,7 @@
<include refid="Base_Column_List"/>
FROM t_insurance_unpurchase_apply a
<where>
a.DELETE_FLAG = '0'
1=1 and a.DELETE_FLAG = '0'
<include refid="tInsuranceUnpurchaseApply_where"/>
</where>
</select>
......@@ -95,13 +109,13 @@
count(1)
FROM t_insurance_unpurchase_apply a
<where>
a.DELETE_FLAG = '0'
1=1 and a.DELETE_FLAG = '0'
<include refid="tInsuranceUnpurchaseApply_where"/>
</where>
</select>
<!-- tInsuranceUnpurchaseApply简单分页查询 -->
<select id="getTInsuranceUnpurchaseApplyExportList" resultMap="tInsuranceUnpurchaseApplyMap">
<select id="getTInsuranceUnpurchaseApplyExportList" resultMap="tInsuranceUnpurchaseApplyExportMap">
SELECT
a.APPLY_NO,
a.DEPT_NAME,
......@@ -109,8 +123,8 @@
a.CREATE_NAME,
a.CREATE_USER_DEPT_NAME,
a.CREATE_TIME,
a.AUDIT_USER,
if(a.REASON_TYPE = '1','已购买社保','人员已离职') REASON_TYPE,
a.REASON_INFO,
CASE WHEN a.STATUS=0 THEN "草稿"
WHEN a.STATUS =1 THEN "待提交"
WHEN a.STATUS =2 THEN "待审核"
......@@ -188,5 +202,20 @@
order by r.create_time desc
</select>
<!-- 获取当日最大的编码 -->
<select id="getMaxInusuranceCode" resultType="java.lang.String">
SELECT ifnull(max(right (e.APPLY_NO, 3)), 0) EMP_CODE
FROM t_insurance_unpurchase_apply e
where e.DELETE_FLAG = '0'
and e.CREATE_TIME > DATE_FORMAT(now(), '%Y-%m-%d')
</select>
<!-- 获取当日最大的编码 -->
<select id="getMaxInusuranceDetailCode" resultType="java.lang.String">
SELECT ifnull(max(right (e.APPLY_NO_DETAIL, 5)), 0) EMP_CODE
FROM t_insurance_unpurchase_person e
where e.CREATE_TIME > DATE_FORMAT(now(), '%Y-%m-%d')
</select>
</mapper>
......@@ -31,6 +31,23 @@
<result property="division" column="DIVISION"/>
<result property="insuranceFlag" column="INSURANCE_FLAG"/>
</resultMap>
<resultMap id="tInsuranceUnpurchasePersonExportMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonVo">
<result property="empName" column="EMP_NAME"/>
<result property="empIdcardNo" column="EMP_IDCARD_NO"/>
<result property="applyNoDetail" column="APPLY_NO_DETAIL"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="reasonType" column="REASON_TYPE"/>
<result property="applyNo" column="APPLY_NO"/>
<result property="socialStatus" column="SOCIAL_STATUS"/>
<result property="salaryNum" column="SALARY_NUM"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="newLine" column="NEW_LINE"/>
<result property="division" column="DIVISION"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.PARNET_ID,
......@@ -116,7 +133,41 @@
<include refid="Base_Column_List"/>
FROM t_insurance_unpurchase_person a
<where>
1=1
1=1 and STATUS = '3'
<include refid="tInsuranceUnpurchasePerson_where"/>
</where>
</select>
<!--tInsuranceUnpurchasePerson导出条数查询-->
<select id="getTInsuranceUnpurchaseInfoExportCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_insurance_unpurchase_person a
<where>
1=1 and STATUS = '3'
<include refid="tInsuranceUnpurchasePerson_where"/>
</where>
</select>
<!--tInsuranceUnpurchasePerson导出查询-->
<select id="getTInsuranceUnpurchaseInfoExportList" resultMap="tInsuranceUnpurchasePersonExportMap">
SELECT
APPLY_NO_DETAIL,
APPLY_NO,
DEPT_NAME,
DEPT_NO,
DIVISION,
NEW_LINE,
EMP_NAME,
EMP_IDCARD_NO,
if(a.REASON_TYPE = '1','已购买社保','人员已离职') REASON_TYPE,
if(a.SOCIAL_STATUS='0','是','否') SOCIAL_STATUS,
SALARY_NUM,
CREATE_NAME,
CREATE_TIME
FROM t_insurance_unpurchase_person a
<where>
1=1 and STATUS = '3'
<include refid="tInsuranceUnpurchasePerson_where"/>
</where>
</select>
......
......@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonCardVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFundInfoService;
......@@ -181,4 +182,17 @@ public class TSocialFundInfoController {
return tSocialFundInfoService.selectSocialFoundByContract(sf);
}
/**
* @param cardVo
* @Description: 判断员工是否存在工伤社保数据
* @Author: huyc
* @Date: 2025/1/13
* @return:
**/
@Inner
@PostMapping("/inner/selectExitSocialInjury")
public Boolean selectExitSocialInjury(@RequestBody TInsuranceUnpurchasePersonCardVo cardVo) {
return tSocialFundInfoService.selectExitSocialInjury(cardVo);
}
}
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
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.insurances.vo.TInsuranceUnpurchasePersonCardVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchOneDetailVo;
......@@ -81,4 +82,6 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> {
int selectSocialFoundByContract(TSocialFundInfo sf);
Boolean selectExitSocialInjury(TInsuranceUnpurchasePersonCardVo cardVo);
}
......@@ -38,6 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceUnpurchasePersonCardVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
......@@ -59,6 +60,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 社保公积金查询表
......@@ -904,4 +907,15 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
}
return CommonConstants.ZERO_INT;
}
@Override
public Boolean selectExitSocialInjury(TInsuranceUnpurchasePersonCardVo cardVo) {
List<String> socialStatus = Stream.of("0","1","4","5").collect(Collectors.toList());
TSocialFundInfo socialFundInfo = baseMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getEmpIdcard, cardVo.getEmpIdcardNo())
.eq(TSocialFundInfo::getEmpName, cardVo.getEmpName())
.in(TSocialFundInfo::getWorkInjuryHandle, socialStatus)
.last(CommonConstants.LAST_ONE_SQL));
return null != socialFundInfo;
}
}
\ No newline at end of file
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