Commit c67cfcfc authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.9' into MVP1.7.9

parents b7a2e276 7a6c50a7
...@@ -2,12 +2,14 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity; ...@@ -2,12 +2,14 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 入职待建档表 * 入职待建档表
...@@ -112,5 +114,8 @@ public class EmployeeRegistrationPre extends BaseEntity { ...@@ -112,5 +114,8 @@ public class EmployeeRegistrationPre extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String reason; private String reason;
@Schema(description = "商险配置列表")
@TableField(exist = false)
private List<TEmployeeInsurancePre> insurancePreList;
} }
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;
/**
* 入职确认信息变更日志表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@Data
@TableName("t_employee_pre_log")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "入职确认信息变更日志表")
public class TEmployeePreLog extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 变化主体:档案信息、商险信息
*/
@ExcelAttribute(name = "变化主体:档案信息、商险信息", maxLength = 100)
@Length(max = 100, message = "变化主体:档案信息、商险信息不能超过100个字符")
@ExcelProperty("变化主体:档案信息、商险信息")
@Schema(description = "变化主体:档案信息、商险信息")
private String diffTitle;
/**
* 入职确认信息ID——employee_registration_pre
*/
@ExcelAttribute(name = "入职确认信息ID——employee_registration_pre", isNotEmpty = true, errorInfo = "入职确认信息ID——employee_registration_pre不能为空", maxLength = 32)
@NotBlank(message = "入职确认信息ID——employee_registration_pre不能为空")
@Length(max = 32, message = "入职确认信息ID——employee_registration_pre不能超过32个字符")
@ExcelProperty("入职确认信息ID——employee_registration_pre")
@Schema(description = "入职确认信息ID——employee_registration_pre")
private String preId;
@TableField(exist = false)
private List<TEmployeePreLogDetail> detailList = new ArrayList<>();
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 入职确认信息变更日志明细表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@Data
@TableName("t_employee_pre_log_detail")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "入职确认信息变更日志明细表")
public class TEmployeePreLogDetail extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 类型:1档案;2商险
*/
@ExcelAttribute(name = "类型:1档案;2商险", maxLength = 1)
@Length(max = 1, message = "类型:1档案;2商险不能超过1个字符")
@ExcelProperty("类型:1档案;2商险")
@Schema(description = "类型:1档案;2商险")
private String type;
/**
* 入职确认信息表ID
*/
@ExcelAttribute(name = "入职确认信息表ID", isNotEmpty = true, errorInfo = "入职确认信息表ID不能为空", maxLength = 32)
@NotBlank(message = "入职确认信息表ID不能为空")
@Length(max = 32, message = "入职确认信息表ID不能超过32个字符")
@ExcelProperty("入职确认信息表ID")
@Schema(description = "入职确认信息表ID")
private String preId;
/**
* 入职日志ID
*/
@ExcelAttribute(name = "入职日志ID", isNotEmpty = true, errorInfo = "入职日志ID不能为空", maxLength = 32)
@NotBlank(message = "入职日志ID不能为空")
@Length(max = 32, message = "入职日志ID不能超过32个字符")
@ExcelProperty("入职日志ID")
@Schema(description = "入职日志ID")
private String preLogId;
/**
* 原来的信息
*/
@ExcelAttribute(name = "原来的信息", isNotEmpty = true, errorInfo = "原来的信息不能为空")
@NotBlank(message = "原来的信息不能为空")
@ExcelProperty("原来的信息")
@Schema(description = "原来的信息")
private String oldInfo;
/**
* 新的信息
*/
@ExcelAttribute(name = "新的信息", isNotEmpty = true, errorInfo = "新的信息不能为空")
@NotBlank(message = "新的信息不能为空")
@ExcelProperty("新的信息")
@Schema(description = "新的信息")
private String newInfo;
/**
* 差异的信息(属性名称,逗号隔开)
*/
@ExcelAttribute(name = "差异的信息(属性名称,逗号隔开)")
@ExcelProperty("差异的信息(属性名称,逗号隔开)")
@Schema(description = "差异的信息(属性名称,逗号隔开)")
private String differenceInfo;
/**
* 修改类型:1新增;2修改;3删除
*/
@ExcelAttribute(name = "修改类型:1新增;2修改;3删除", maxLength = 1)
@Length(max = 1, message = "修改类型:1新增;2修改;3删除不能超过1个字符")
@ExcelProperty("修改类型:1新增;2修改;3删除")
@Schema(description = "修改类型:1新增;2修改;3删除")
private String modelType;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 入职确认信息变更日志表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@Data
public class TEmployeePreLogSearchVo extends TEmployeePreLog {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLogDetail;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 入职确认信息变更日志表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@Data
public class TEmployeePreLogVo extends TEmployeePreLog implements Serializable {
List<TEmployeePreLogDetail> detailList = new ArrayList<>();
}
...@@ -60,7 +60,7 @@ public class EmployeeRegistrationPreController { ...@@ -60,7 +60,7 @@ public class EmployeeRegistrationPreController {
@Operation(summary = "通过id查询", description = "通过id查询") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" ) @GetMapping("/{id}" )
public R<EmployeeRegistrationPre> getById(@PathVariable("id" ) String id) { public R<EmployeeRegistrationPre> getById(@PathVariable("id" ) String id) {
return R.ok(employeeRegistrationPreService.getById(id)); return R.ok(employeeRegistrationPreService.getEmployeeRegistrationPreById(id));
} }
/** /**
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeePreLogSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
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 java.util.List;
/**
* 入职确认信息变更日志表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeeprelog")
@Tag(name = "入职确认信息变更日志表管理")
public class TEmployeePreLogController {
private final TEmployeePreLogService tEmployeePreLogService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tEmployeePreLog 入职确认信息变更日志表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TEmployeePreLog>> getTEmployeePreLogPage(Page<TEmployeePreLog> page, TEmployeePreLogSearchVo tEmployeePreLog) {
return new R<>(tEmployeePreLogService.getTEmployeePreLogPage(page, tEmployeePreLog));
}
/**
* 不分页查询
*
* @param tEmployeePreLog 入职确认信息变更日志表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<TEmployeePreLog>> getTEmployeePreLogNoPage(@RequestBody TEmployeePreLogSearchVo tEmployeePreLog) {
return R.ok(tEmployeePreLogService.noPageDiy(tEmployeePreLog));
}
/**
* 通过id查询入职确认信息变更日志表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('archives_temployeeprelog_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('archives_temployeeprelog_get')")
public R<TEmployeePreLog> getById(@PathVariable("id") String id) {
return R.ok(tEmployeePreLogService.getById(id));
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLogDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 入职确认信息变更日志明细表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@Mapper
public interface TEmployeePreLogDetailMapper extends BaseMapper<TEmployeePreLogDetail> {
/**
* 入职确认信息变更日志明细表简单分页查询
*
* @param preId 入职确认信息变更日志明细表
* @return
*/
List<TEmployeePreLogDetail> getTEmployeePreLogDetailList(@Param("preId") String preId);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 入职确认信息变更日志表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@Mapper
public interface TEmployeePreLogMapper extends BaseMapper<TEmployeePreLog> {
/**
* 入职确认信息变更日志表简单分页查询
*
* @param tEmployeePreLog 入职确认信息变更日志表
* @return
*/
IPage<TEmployeePreLog> getTEmployeePreLogPage(Page<TEmployeePreLog> page, @Param("tEmployeePreLog") TEmployeePreLog tEmployeePreLog);
}
...@@ -113,4 +113,12 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr ...@@ -113,4 +113,12 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr
**/ **/
EmployeeRegistrationPre getPreInfo(String empIdCard, String deptId); EmployeeRegistrationPre getPreInfo(String empIdCard, String deptId);
/**
* @Description: 根据ID获取商险待购买
* @Author: hgw
* @Date: 2025/4/9 15:01
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre>
**/
EmployeeRegistrationPre getEmployeeRegistrationPreById(String id);
} }
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLogDetail;
import java.util.List;
/**
* 入职确认信息变更日志明细表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
public interface TEmployeePreLogDetailService extends IService<TEmployeePreLogDetail> {
/**
* 入职确认信息变更日志明细表简单分页查询
*
* @param preId 入职确认信息变更日志明细表
* @return
*/
List<TEmployeePreLogDetail> getTEmployeePreLogDetailList(String preId);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeePreLogSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import java.util.List;
import java.util.Map;
/**
* 入职确认信息变更日志表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
public interface TEmployeePreLogService extends IService<TEmployeePreLog> {
/**
* 入职确认信息变更日志表简单分页查询
*
* @param tEmployeePreLog 入职确认信息变更日志表
* @return
*/
IPage<TEmployeePreLog> getTEmployeePreLogPage(Page<TEmployeePreLog> page, TEmployeePreLogSearchVo tEmployeePreLog);
List<TEmployeePreLog> noPageDiy(TEmployeePreLogSearchVo searchVo);
/**
* @Description: 添加日志并修改商险list
* @Author: hgw
* @Date: 2025/4/9 14:50
* @return: void
**/
void saveModifyAndUpdateInsurance(String empPreId, EmployeeRegistrationPre oldInfo
, EmployeeRegistrationPre newInfo, YifuUser user, Map<String, TEmployeeInsurancePre> oldMap);
}
...@@ -18,18 +18,28 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.*; ...@@ -18,18 +18,28 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult; import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.RegistParamVo; import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.RegistParamVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CspDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EmployeePreLogListVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceExitCheckVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -51,14 +61,25 @@ import java.util.*; ...@@ -51,14 +61,25 @@ import java.util.*;
@Log4j2 @Log4j2
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@EnableConfigurationProperties(DaprInsurancesProperties.class)
public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegistrationPreMapper, EmployeeRegistrationPre> implements EmployeeRegistrationPreService { public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegistrationPreMapper, EmployeeRegistrationPre> implements EmployeeRegistrationPreService {
private final DaprInsurancesProperties daprInsurancesProperties;
@Autowired
private InsuranceDaprUtil insuranceDaprUtil;
@Autowired
private SocialDaprUtils socialDaprUtils;
@Autowired @Autowired
private CspDaprUtils cspDaprUtils; private CspDaprUtils cspDaprUtils;
@Autowired @Autowired
private TEmployeeLogService tEmployeeLogService; private TEmployeeLogService tEmployeeLogService;
private final TEmployeePreLogService tEmployeePreLogService;
private final TCompleteMonitorMapper completeMonitorMapper; private final TCompleteMonitorMapper completeMonitorMapper;
private final TSettleDomainService tSettleDomainService; private final TSettleDomainService tSettleDomainService;
...@@ -378,14 +399,145 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -378,14 +399,145 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
return R.ok(); return R.ok();
} }
/**
* @param employeeRegistrationPre
* @Description: 修改入职确认信息
* @Author: hgw + hyc
* @Date: 2025/4/9 14:45
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R
**/
@Override @Override
public R updateCommonInfo(EmployeeRegistrationPre employeeRegistrationPre) { public R updateCommonInfo(EmployeeRegistrationPre employeeRegistrationPre) {
EmployeeRegistrationPre updatePre = baseMapper.selectById(employeeRegistrationPre.getId()); if (Common.isEmpty(employeeRegistrationPre.getId())) {
if (Common.isEmpty(updatePre)) { return R.failed("请传ID");
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} }
//旧的对象,用来对比变更参数 //旧的对象,用来对比变更参数
EmployeeRegistrationPre comparePre = baseMapper.selectById(employeeRegistrationPre.getId()); EmployeeRegistrationPre comparePre = baseMapper.selectById(employeeRegistrationPre.getId());
if (Common.isEmpty(comparePre)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
Map<String, TEmployeeInsurancePre> oldMap = new HashMap<>();
// 查原商险,来对比
R<EmployeePreLogListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(), daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/getListByEmpPreId", employeeRegistrationPre.getId(), EmployeePreLogListVo.class, SecurityConstants.FROM_IN);
List<TEmployeeInsurancePre> oldList = null;
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null && !sdr.getData().getPreList().isEmpty()) {
oldList = sdr.getData().getPreList();
}
// 1:存在商险,判断合规性+日期+五个不同等:
if (Common.isNotNull(employeeRegistrationPre.getServerItem()) && employeeRegistrationPre.getServerItem().contains("商险")) {
if (employeeRegistrationPre.getInsurancePreList() == null
|| employeeRegistrationPre.getInsurancePreList().isEmpty()) {
return R.failed("含商险服务,商险配置不可为空");
}
List<TEmployeeInsurancePre> newList = employeeRegistrationPre.getInsurancePreList();
// 1:合规性:查找信息是否允许:
List<TEmployeeInsuranceExitCheckVo> errorList = new ArrayList<>();
TEmployeeInsuranceExitCheckVo checkVo;
Map<String, TEmployeeInsurancePre> newMap = new HashMap<>();
// 新的KeyMap,存项目
Map<String, String> newKeyDeptNoMap = new HashMap<>();
// 判断重复性MAP
Map<String, Integer> keyMap = new HashMap<>();
String key;
String newDeptNo;
TEmployeeInsurancePreVo preVo;
for (TEmployeeInsurancePre insurancePreVo : newList) {
if (Common.isNotNull(insurancePreVo.getId())) {
newMap.put(insurancePreVo.getId(), insurancePreVo);
}
// 1:重复性判断
key = this.getFiveKey(insurancePreVo);
newDeptNo = insurancePreVo.getDeptNo();
if (Common.isEmpty(newDeptNo)) {
return R.failed("请传项目编码");
}
newKeyDeptNoMap.put(key, insurancePreVo.getDeptNo());
if (keyMap.get(key) == null) {
keyMap.put(key, CommonConstants.ONE_INT);
} else {
return R.failed("保险公司、险种、购买标准、保单起、止日期不可同时重复!");
}
// 2:是否工作日判断
String error = checkInsuranceBuy(insurancePreVo);
if (null != error) {
return R.failed(error);
}
insurancePreVo.setEmpIdcard(employeeRegistrationPre.getEmpIdcard());
insurancePreVo.setDeptNo(employeeRegistrationPre.getDeptNo());
//商险是否存在判断
preVo = new TEmployeeInsurancePreVo();
preVo.setEmployeeName(employeeRegistrationPre.getEmployeeName());
preVo.setEmpIdcard(employeeRegistrationPre.getEmpIdcard());
preVo.setBuyStandard(insurancePreVo.getBuyStandard());
preVo.setInsuranceTypeName(insurancePreVo.getInsuranceTypeName());
preVo.setInsuranceCompanyName(insurancePreVo.getInsuranceCompanyName());
preVo.setPolicyStart(insurancePreVo.getPolicyStart());
preVo.setPolicyEnd(insurancePreVo.getPolicyEnd());
checkVo = checkInsuranceExit(preVo);
if (null != checkVo) {
errorList.add(checkVo);
} else {
if (Common.isNotNull(preVo.getProcessStatus())) {
insurancePreVo.setProcessStatus(preVo.getProcessStatus());
} else {
insurancePreVo.setProcessStatus(CommonConstants.ZERO_STRING);
}
}
}
if (!errorList.isEmpty()) {
return R.other(CommonConstants.TWO_INT,null,errorList);
}
// 2:商险待办 的判断:
if (oldList != null && !oldList.isEmpty()) {
TEmployeeInsurancePre newPre;
String oldKey;
for (TEmployeeInsurancePre oldInsurance: oldList) {
// 1:判断是否变更 商险待办 的项目
oldKey = this.getFiveKey(oldInsurance);
newDeptNo = newKeyDeptNoMap.get(oldKey);
if (Common.isNotNull(newDeptNo) && !newDeptNo.equals(oldInsurance.getDeptNo())) {
return R.failed("不可变更项目,请检查商险配置!");
}
oldMap.put(oldInsurance.getId(), oldInsurance);
newPre = newMap.get(oldInsurance.getId());
// 是否为不可修改的状态
if (Common.isNotNull(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()) )) {
if (newPre == null) {
return R.failed("含有不可删除的商险,请刷新后再修改!");
} else if (Common.isNotNull(newPre.getModelType()) && !CommonConstants.FOUR_STRING.equals(newPre.getModelType())) {
return R.failed("含有不可更改的商险,请刷新后再修改!");
}
} else {
if (newPre == null) {
oldInsurance.setModelType(CommonConstants.THREE_STRING);
newList.add(oldInsurance);
}
}
}
employeeRegistrationPre.setInsurancePreList(newList);
}
} else {
// 2:保存时不存在商险类型,判断是否有不可删除的数据,有则拒绝:
if (oldList != null && !oldList.isEmpty()) {
for (TEmployeeInsurancePre oldInsurance: oldList) {
if (Common.isNotNull(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()) )) {
return R.failed("含有不可删除的商险,请刷新后再修改!");
}
}
}
}
//操作记录中字典值的转化 //操作记录中字典值的转化
String natureItemBefore = null; String natureItemBefore = null;
String natureItemAfter = null; String natureItemAfter = null;
...@@ -461,13 +613,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -461,13 +613,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
try { try {
updatePre.setServerItem(employeeRegistrationPre.getServerItem());
updatePre.setEmpNature(employeeRegistrationPre.getEmpNature());
updatePre.setContractType(employeeRegistrationPre.getContractType());
updatePre.setFileProvince(employeeRegistrationPre.getFileProvince());
updatePre.setFileCity(employeeRegistrationPre.getFileCity());
updatePre.setFileTown(employeeRegistrationPre.getFileTown());
updatePre.setContractSubName(null == employeeRegistrationPre.getContractSubName() ? "" : employeeRegistrationPre.getContractSubName());
baseMapper.updateById(employeeRegistrationPre); baseMapper.updateById(employeeRegistrationPre);
if (null != natureItemBefore) { if (null != natureItemBefore) {
comparePre.setEmpNature(natureItemBefore); comparePre.setEmpNature(natureItemBefore);
...@@ -487,14 +633,42 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -487,14 +633,42 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
if (null != contractXfAfter) { if (null != contractXfAfter) {
employeeRegistrationPre.setContractSubName(contractXfAfter); employeeRegistrationPre.setContractSubName(contractXfAfter);
} }
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[4], // 添加日志并修改商险list
employeeRegistrationPre.getId().toString(), "", comparePre, employeeRegistrationPre,user); tEmployeePreLogService.saveModifyAndUpdateInsurance(employeeRegistrationPre.getId(), comparePre
, employeeRegistrationPre, user, oldMap);
} catch (Exception e) { } catch (Exception e) {
log.error("生成入职待确认信息修改操作日志异常", e); log.error("生成入职待确认信息修改操作日志异常", e);
} }
return R.ok(); return R.ok();
} }
/**
* @param insurancePreVo
* @Description: 获取5个字段构成的关键字
* @Author: hgw
* @Date: 2025/4/9 11:23
* @return: java.lang.String
**/
private String getFiveKey(TEmployeeInsurancePre insurancePreVo) {
// 1:重复性判断
return isNullToEmpty(insurancePreVo.getBuyStandard()) + CommonConstants.DOWN_LINE_STRING
+ isNullToEmpty(insurancePreVo.getInsuranceTypeName()) + CommonConstants.DOWN_LINE_STRING
+ isNullToEmpty(insurancePreVo.getInsuranceCompanyName()) + CommonConstants.DOWN_LINE_STRING
+ isNullToEmpty(insurancePreVo.getPolicyStart()) + CommonConstants.DOWN_LINE_STRING + isNullToEmpty(insurancePreVo.getPolicyEnd());
}
/**
* @param str
* @Description: 空转化为空字符
* @Author: hgw
* @Date: 2025/4/9 11:29
* @return: java.lang.String
**/
private String isNullToEmpty(Object str) {
return null == str ? "" : str.toString();
}
@Override @Override
public R getListCount(EmployeeRegistrationPreSearchVo searchVo) { public R getListCount(EmployeeRegistrationPreSearchVo searchVo) {
try { try {
...@@ -516,6 +690,113 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -516,6 +690,113 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
} }
private String checkInsuranceBuy(TEmployeeInsurancePre preVo) {
//新增判断保单开始日期
TEmployeeInsuranceWorkDayVo vo = new TEmployeeInsuranceWorkDayVo();
R<Boolean> dataR;
if (preVo.getBuyType() == 1) {
vo.setRegistDate(preVo.getPolicyStart());
dataR = socialDaprUtils.checkIsWorkDay(vo);
if (Common.isNotNull(dataR) && Boolean.TRUE.equals(dataR.getData())) {
return "新增类型的保单开始日期不能为工作日;";
}
}
if (preVo.getBuyType() == 3 && Common.isNotNull(preVo.getExpectedCollectionTime())){
// 将 LocalDateTime 转换为 java.util.Date
vo.setRegistDate(DateUtil.convertToDateByLocalDateTime(preVo.getExpectedCollectionTime()));
dataR = socialDaprUtils.checkIsWorkDay(vo);
if (Common.isNotNull(dataR) && Boolean.TRUE.equals(dataR.getData())) {
return "批增类型的预计派单日期不能为工作日;";
}
}
if (preVo.getBuyType() == 4 && Common.isNotNull(preVo.getExpectedCollectionTime())){
vo.setRegistDate(DateUtil.convertToDateByLocalDateTime(preVo.getExpectedCollectionTime()));
dataR = socialDaprUtils.checkIsWorkDay(vo);
if (Common.isNotNull(dataR) && Boolean.TRUE.equals(dataR.getData())) {
return "替换类型的预计派单日期不能为工作日;";
}
}
return null;
}
// 商险是否存在判断 type 1 单个接收 2 批量接收
private TEmployeeInsuranceExitCheckVo checkInsuranceExit(TEmployeeInsurancePreVo preVo) {
//查询入职确认信息数据
boolean erorFlag = false;
R<TEmployeeInsuranceSelectVo> dataR = insuranceDaprUtil.selectInsurancePreInfoList(preVo);
//查询商险数据
TInsuranceDetail insuranceDetail= null;
R<TEmployeeInsuranceSelectVo> dataInsurR = insuranceDaprUtil.selectInsuranceInfo(preVo);
if (Common.isNotNull(dataInsurR) && Common.isNotNull(dataInsurR.getData().getInsuranceDetail())) {
insuranceDetail = dataInsurR.getData().getInsuranceDetail();
}
//二次确认接收场景
if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getData().getInsurancePreList())
&& !dataR.getData().getInsurancePreList().isEmpty()) {
//已存在该身份证的商险入职确认信息
List<TEmployeeInsurancePre> list = dataR.getData().getInsurancePreList();
for (TEmployeeInsurancePre pre : list) {
//项目不同
if (!preVo.getDeptNo().equals(pre.getDeptNo()) && (pre.getProcessStatus().equals(CommonConstants.ZERO_STRING) ||
pre.getProcessStatus().equals(CommonConstants.ONE_STRING) ||
pre.getProcessStatus().equals(CommonConstants.TWO_STRING))) {
erorFlag = true;
break;
}
//项目相同
if (null != insuranceDetail && preVo.getDeptNo().equals(insuranceDetail.getDeptNo()) &&
insuranceDetail.getBuyHandleStatus() != CommonConstants.FIVE_INT &&
insuranceDetail.getBuyHandleStatus() != CommonConstants.FOUR_INT) {
erorFlag = true;
break;
}
if (null != insuranceDetail && !preVo.getDeptNo().equals(insuranceDetail.getDeptNo())
&& insuranceDetail.getBuyHandleStatus() != CommonConstants.FIVE_INT) {
erorFlag = true;
break;
}
}
} else {
//第一次确认接收场景
if (Common.isNotNull(insuranceDetail)) {
//项目不同
if (!preVo.getDeptNo().equals(insuranceDetail.getDeptNo()) && (insuranceDetail.getBuyHandleStatus() == CommonConstants.ONE_INT ||
insuranceDetail.getBuyHandleStatus() == CommonConstants.TWO_INT ||
insuranceDetail.getBuyHandleStatus() == CommonConstants.THREE_INT)) {
erorFlag = true;
}
//项目相同带回状态
if (preVo.getDeptNo().equals(insuranceDetail.getDeptNo()) && insuranceDetail.getBuyHandleStatus() != CommonConstants.FIVE_INT) {
if (insuranceDetail.getBuyHandleStatus() == CommonConstants.ONE_INT) {
preVo.setProcessStatus(CommonConstants.THREE_STRING);
} else if (insuranceDetail.getBuyHandleStatus() == CommonConstants.TWO_INT) {
preVo.setProcessStatus(CommonConstants.FOUR_STRING);
} else if (insuranceDetail.getBuyHandleStatus() == CommonConstants.THREE_INT) {
preVo.setProcessStatus(CommonConstants.SIX_STRING);
} else if (insuranceDetail.getBuyHandleStatus() == CommonConstants.FOUR_INT) {
preVo.setProcessStatus(CommonConstants.FIVE_STRING);
}
}
}
}
//组装错误信息
if (erorFlag) {
TEmployeeInsuranceExitCheckVo exitCheckVo = new TEmployeeInsuranceExitCheckVo();
exitCheckVo.setBuyType(preVo.getBuyType());
exitCheckVo.setEmployeeName(preVo.getEmployeeName());
exitCheckVo.setEmpIdcard(preVo.getEmpIdcard());
exitCheckVo.setPolicyStart(preVo.getPolicyStart());
exitCheckVo.setPolicyEnd(preVo.getPolicyEnd());
exitCheckVo.setBuyStandard(preVo.getBuyStandard());
exitCheckVo.setInsuranceCompanyName(preVo.getInsuranceCompanyName());
exitCheckVo.setInsuranceTypeName(preVo.getInsuranceTypeName());
exitCheckVo.setErrorMsg("存在流程中/已完结的商险数据");
return exitCheckVo;
} else {
return null;
}
}
@Override @Override
public R registrationPreAudit(EmployeeRegistrationPre pre) { public R registrationPreAudit(EmployeeRegistrationPre pre) {
TPreEmpMain empMain = empMainMapper.selectOne(Wrappers.<TPreEmpMain>query().lambda() TPreEmpMain empMain = empMainMapper.selectOne(Wrappers.<TPreEmpMain>query().lambda()
...@@ -774,4 +1055,35 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -774,4 +1055,35 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
return pre; return pre;
} }
/**
* @param id 入职确认表ID
* @Description: 根据ID获取商险待购买
* @Author: hgw
* @Date: 2025/4/9 15:00
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre>
**/
@Override
public EmployeeRegistrationPre getEmployeeRegistrationPreById(String id) {
EmployeeRegistrationPre pre = this.getById(id);
if (pre != null) {
// 查原商险,来对比
R<EmployeePreLogListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(), daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/getListByEmpPreId", id, EmployeePreLogListVo.class, SecurityConstants.FROM_IN);
List<TEmployeeInsurancePre> oldList;
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null && !sdr.getData().getPreList().isEmpty()) {
oldList = sdr.getData().getPreList();
for (TEmployeeInsurancePre oldInsurance : oldList) {
if (Common.isNotNull(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()) )) {
oldInsurance.setModelType(CommonConstants.FOUR_STRING);
}
}
pre.setInsurancePreList(oldList);
}
}
return pre;
}
} }
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLogDetail;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeePreLogDetailMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogDetailService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 入职确认信息变更日志明细表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@Log4j2
@Service
public class TEmployeePreLogDetailServiceImpl extends ServiceImpl<TEmployeePreLogDetailMapper, TEmployeePreLogDetail> implements TEmployeePreLogDetailService {
/**
* 入职确认信息变更日志明细表简单分页查询
*
* @param preId 入职确认信息变更日志明细表
* @return
*/
@Override
public List<TEmployeePreLogDetail> getTEmployeePreLogDetailList(String preId) {
return baseMapper.getTEmployeePreLogDetailList(preId);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLogDetail;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeePreLogMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogDetailService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeePreLogSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.*;
import static com.alibaba.fastjson.serializer.SerializerFeature.*;
/**
* 入职确认信息变更日志表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@Log4j2
@Service
@AllArgsConstructor
@EnableConfigurationProperties(DaprInsurancesProperties.class)
public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMapper, TEmployeePreLog> implements TEmployeePreLogService {
private final DaprInsurancesProperties daprInsurancesProperties;
private final TEmployeePreLogDetailService tEmployeePreLogDetailService;
/**
* 入职确认信息变更日志表简单分页查询
*
* @param tEmployeePreLog 入职确认信息变更日志表
* @return
*/
@Override
public IPage<TEmployeePreLog> getTEmployeePreLogPage(Page<TEmployeePreLog> page, TEmployeePreLogSearchVo tEmployeePreLog) {
if (Common.isNotNull(tEmployeePreLog.getPreId())) {
IPage<TEmployeePreLog> pageList = baseMapper.getTEmployeePreLogPage(page, tEmployeePreLog);
List<TEmployeePreLogDetail> detailList = tEmployeePreLogDetailService.getTEmployeePreLogDetailList(tEmployeePreLog.getPreId());
Map<String, List<TEmployeePreLogDetail>> detailMap = new HashMap<>();
if (detailList != null && !detailList.isEmpty()) {
List<TEmployeePreLogDetail> detailList1;
for (TEmployeePreLogDetail detail : detailList) {
detailList1 = detailMap.get(detail.getPreLogId());
if (detailList1 == null) {
detailList1 = new ArrayList<>();
}
detailList1.add(detail);
detailMap.put(detail.getPreLogId(), detailList1);
}
}
for (TEmployeePreLog tEmployeePreLog1 : pageList.getRecords()) {
if (detailMap.get(tEmployeePreLog1.getId()) != null) {
tEmployeePreLog1.setDetailList(detailMap.get(tEmployeePreLog1.getId()));
}
}
return pageList;
}
return null;
}
@Override
public List<TEmployeePreLog> noPageDiy(TEmployeePreLogSearchVo searchVo) {
LambdaQueryWrapper<TEmployeePreLog> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TEmployeePreLog::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
private LambdaQueryWrapper<TEmployeePreLog> buildQueryWrapper(TEmployeePreLogSearchVo entity) {
LambdaQueryWrapper<TEmployeePreLog> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TEmployeePreLog::getCreateTime, entity.getCreateTimes()[0])
.le(TEmployeePreLog::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TEmployeePreLog::getCreateName, entity.getCreateName());
}
return wrapper;
}
private SerializerFeature[] features = new SerializerFeature[]{
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
WriteNullStringAsEmpty, WriteDateUseDateFormat
};
@Override
public void saveModifyAndUpdateInsurance(String empPreId, EmployeeRegistrationPre oldInfo
, EmployeeRegistrationPre newInfo, YifuUser user, Map<String, TEmployeeInsurancePre> oldMap) {
try {
//比较记录不影响业务逻辑,用try套住
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异
List<TEmployeeInsurancePre> newList = newInfo.getInsurancePreList();
String diffTitle = null;
String logId = UUID.randomUUID().toString();
// 要保存的明细
List<TEmployeePreLogDetail> detailList = new ArrayList<>();
// 档案信息修改
TEmployeePreLogDetail detailEmpLog = null;
if (Common.isNotNull(differenceKey)) {
diffTitle = "档案信息";
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING);
detailEmpLog.setType(CommonConstants.ONE_STRING);
this.setLogBaseInfo(empPreId, oldInfo, newInfo, user, differenceKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
}
// 有ID,修改或删除
if (oldMap == null) {
oldMap = new HashMap<>();
}
List<TEmployeeInsurancePre> saveOrUpdateList = new ArrayList<>();
if (newList != null && !newList.isEmpty()) {
if (Common.isNotNull(diffTitle)) {
diffTitle += "、";
}
diffTitle += "商险信息";
TEmployeeInsurancePre oldInsurance;
String differenceInsuranceKey;
TEmployeePreLogDetail detailInsuranceLog;
for (TEmployeeInsurancePre newInsurance : newList) {
differenceInsuranceKey = null;
if (Common.isNotNull(newInsurance.getModelType())) {
// 1:新增
if (CommonConstants.ONE_STRING.equals(newInsurance.getModelType())) {
saveOrUpdateList.add(newInsurance);
detailInsuranceLog = new TEmployeePreLogDetail();
detailInsuranceLog.setModelType(newInsurance.getModelType());
detailInsuranceLog.setType(CommonConstants.TWO_STRING);
this.setLogBaseInfo(empPreId, null, newInsurance, user, differenceInsuranceKey, logId, detailInsuranceLog);
detailList.add(detailInsuranceLog);
} else if (CommonConstants.TWO_STRING.equals(newInsurance.getModelType())) {
// 2:修改有老ID
if (Common.isNotNull(newInsurance.getId())) {
oldInsurance = oldMap.get(newInsurance.getId());
if (oldInsurance != null) {
differenceInsuranceKey = HrEquator.comparisonValue(oldInsurance, newInsurance);
} else {
saveOrUpdateList.add(newInsurance);
}
detailInsuranceLog = new TEmployeePreLogDetail();
detailInsuranceLog.setModelType(CommonConstants.TWO_STRING);
detailInsuranceLog.setType(CommonConstants.TWO_STRING);
this.setLogBaseInfo(empPreId, oldInsurance, newInsurance, user, differenceInsuranceKey, logId, detailInsuranceLog);
detailList.add(detailInsuranceLog);
} else {
saveOrUpdateList.add(newInsurance);
// 2:修改无老ID
detailInsuranceLog = new TEmployeePreLogDetail();
detailInsuranceLog.setModelType(CommonConstants.ONE_STRING);
detailInsuranceLog.setType(CommonConstants.TWO_STRING);
this.setLogBaseInfo(empPreId, null, newInsurance, user, differenceInsuranceKey, logId, detailInsuranceLog);
detailList.add(detailInsuranceLog);
}
} else if (CommonConstants.THREE_STRING.equals(newInsurance.getModelType())) {
// 3:删除
detailInsuranceLog = new TEmployeePreLogDetail();
detailInsuranceLog.setModelType(newInsurance.getModelType());
detailInsuranceLog.setType(CommonConstants.TWO_STRING);
this.setLogBaseInfo(empPreId, newInsurance, null, user, differenceInsuranceKey, logId, detailInsuranceLog);
detailList.add(detailInsuranceLog);
}
}
}
}
// 有修改,则加日志
if (Common.isNotNull(diffTitle)) {
TEmployeePreLog empPreLog = new TEmployeePreLog();
empPreLog.setId(logId);
empPreLog.setPreId(empPreId);
empPreLog.setDiffTitle(diffTitle);
empPreLog.setCreateTime(LocalDateTime.now());
if (Common.isNotNull(user)) {
empPreLog.setCreateBy(user.getId());
empPreLog.setCreateName(user.getNickname());
}
baseMapper.insert(empPreLog);
if (!detailList.isEmpty()) {
tEmployeePreLogDetailService.saveBatch(detailList);
}
if (!saveOrUpdateList.isEmpty()) {
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(), daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/saveOrUpdateInsuranceList"
, JSON.toJSONString(saveOrUpdateList), Boolean.class, SecurityConstants.FROM_IN);
}
}
} catch (Exception e) {
log.error(JSON.toJSON(newInfo) + "插入修改记录报错>>>", e);
}
}
/**
* @Description: 填充基本信息
* @Author: hgw
* @Date: 2025/4/8 10:49
* @return: void
**/
private void setLogBaseInfo(String empPreId, Object oldInfo, Object newInfo
, YifuUser user, String differenceKey, String logId, TEmployeePreLogDetail detailEmpLog) {
detailEmpLog.setPreId(empPreId);
detailEmpLog.setPreLogId(logId);
detailEmpLog.setDifferenceInfo(differenceKey);
detailEmpLog.setCreateTime(LocalDateTime.now());
if (Common.isNotNull(user)) {
detailEmpLog.setCreateBy(user.getId());
detailEmpLog.setCreateName(user.getNickname());
}
if (Common.isNotNull(oldInfo)) {
detailEmpLog.setOldInfo(JSON.toJSONString(oldInfo, features));
}
if (Common.isNotNull(newInfo)) {
detailEmpLog.setNewInfo(JSON.toJSONString(newInfo, features));
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!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.archives.mapper.TEmployeePreLogDetailMapper">
<resultMap id="tEmployeePreLogDetailMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLogDetail">
<id property="id" column="ID"/>
<result property="type" column="TYPE"/>
<result property="preLogId" column="PRE_LOG_ID"/>
<result property="preId" column="PRE_ID"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="oldInfo" column="OLD_INFO"/>
<result property="newInfo" column="NEW_INFO"/>
<result property="differenceInfo" column="DIFFERENCE_INFO"/>
<result property="modelType" column="MODEL_TYPE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.TYPE,
a.PRE_LOG_ID,
a.PRE_ID,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.OLD_INFO,
a.NEW_INFO,
a.DIFFERENCE_INFO,
a.MODEL_TYPE
</sql>
<!--tEmployeePreLogDetail简单分页查询-->
<select id="getTEmployeePreLogDetailList" resultMap="tEmployeePreLogDetailMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_pre_log_detail a
where a.PRE_ID = #{preId}
order by a.create_time asc
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!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.archives.mapper.TEmployeePreLogMapper">
<resultMap id="tEmployeePreLogMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog">
<id property="id" column="ID"/>
<result property="diffTitle" column="DIFF_TITLE"/>
<result property="preId" column="PRE_ID"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.DIFF_TITLE,
a.PRE_ID,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="tEmployeePreLog_where">
<if test="tEmployeePreLog != null">
<if test="tEmployeePreLog.id != null and tEmployeePreLog.id.trim() != ''">
AND a.ID = #{tEmployeePreLog.id}
</if>
<if test="tEmployeePreLog.diffTitle != null and tEmployeePreLog.diffTitle.trim() != ''">
AND a.DIFF_TITLE = #{tEmployeePreLog.diffTitle}
</if>
<if test="tEmployeePreLog.preId != null and tEmployeePreLog.preId.trim() != ''">
AND a.PRE_ID = #{tEmployeePreLog.preId}
</if>
<if test="tEmployeePreLog.createBy != null and tEmployeePreLog.createBy.trim() != ''">
AND a.CREATE_BY = #{tEmployeePreLog.createBy}
</if>
<if test="tEmployeePreLog.createName != null and tEmployeePreLog.createName.trim() != ''">
AND a.CREATE_NAME = #{tEmployeePreLog.createName}
</if>
<if test="tEmployeePreLog.createTime != null">
AND a.CREATE_TIME = #{tEmployeePreLog.createTime}
</if>
<if test="tEmployeePreLog.updateBy != null and tEmployeePreLog.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tEmployeePreLog.updateBy}
</if>
<if test="tEmployeePreLog.updateTime != null">
AND a.UPDATE_TIME = #{tEmployeePreLog.updateTime}
</if>
</if>
</sql>
<!--tEmployeePreLog简单分页查询-->
<select id="getTEmployeePreLogPage" resultMap="tEmployeePreLogMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_pre_log a
<where>
1=1
<include refid="tEmployeePreLog_where"/>
</where>
</select>
</mapper>
...@@ -10,7 +10,9 @@ import java.math.BigDecimal; ...@@ -10,7 +10,9 @@ import java.math.BigDecimal;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalAdjusters;
import java.util.*; import java.util.*;
...@@ -681,6 +683,20 @@ public class DateUtil { ...@@ -681,6 +683,20 @@ public class DateUtil {
return dt; return dt;
} }
/**
* @param localDateTime
* @Description: 将LocalDateTime转成Date
* @Author: hgw
* @Date: 2025/4/8 21:13
* @return: java.util.Date
**/
public static Date convertToDateByLocalDateTime(LocalDateTime localDateTime) {
ZoneId defaultZoneId = ZoneId.systemDefault();
Instant instant = localDateTime.atZone(defaultZoneId).toInstant();
Date date = Date.from(instant);
return date;
}
public static String dateFromat(Date date, int minute) { public static String dateFromat(Date date, int minute) {
String dateFormat = null; String dateFormat = null;
int year = Integer.parseInt(getYear(date)); int year = Integer.parseInt(getYear(date));
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity; package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -39,6 +41,7 @@ public class TEmployeeInsurancePre extends BaseEntity { ...@@ -39,6 +41,7 @@ public class TEmployeeInsurancePre extends BaseEntity {
@Schema(description = "手机号码") @Schema(description = "手机号码")
private String empPhone; private String empPhone;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "入职日期") @Schema(description = "入职日期")
private Date joinLeaveDate; private Date joinLeaveDate;
...@@ -60,12 +63,14 @@ public class TEmployeeInsurancePre extends BaseEntity { ...@@ -60,12 +63,14 @@ public class TEmployeeInsurancePre extends BaseEntity {
@Schema(description = "项目id") @Schema(description = "项目id")
private String deptId; private String deptId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "预计派单时间") @Schema(description = "预计派单时间")
private LocalDateTime expectedCollectionTime; private LocalDateTime expectedCollectionTime;
@Schema(description = "登记人") @Schema(description = "登记人")
private String registUser; private String registUser;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "登记时间") @Schema(description = "登记时间")
private LocalDateTime registTime; private LocalDateTime registTime;
...@@ -84,9 +89,11 @@ public class TEmployeeInsurancePre extends BaseEntity { ...@@ -84,9 +89,11 @@ public class TEmployeeInsurancePre extends BaseEntity {
@Schema(description = "购买类型, 1新增、3批增、4替换") @Schema(description = "购买类型, 1新增、3批增、4替换")
private Integer buyType; private Integer buyType;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "保单开始时间") @Schema(description = "保单开始时间")
private Date policyStart; private Date policyStart;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "保单结束时间") @Schema(description = "保单结束时间")
private Date policyEnd; private Date policyEnd;
...@@ -126,4 +133,8 @@ public class TEmployeeInsurancePre extends BaseEntity { ...@@ -126,4 +133,8 @@ public class TEmployeeInsurancePre extends BaseEntity {
@Schema(description = "替换项目编码") @Schema(description = "替换项目编码")
private String replaceDeptNo; private String replaceDeptNo;
@TableField(exist = false)
@Schema(description = "修改类型:1新增;2修改;3删除;4状态346为不可编辑")
private String modelType;
} }
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @author hgw
* @description 商险待办任务表VO
* @date 2025-4-8 11:20:05
*/
@Data
@Schema(description = "商险待办任务表VO")
public class EmployeePreLogListVo implements Serializable {
private static final long serialVersionUID = 628032758008497542L;
private List<TEmployeeInsurancePre> preList = new ArrayList<>();
}
...@@ -12,6 +12,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; ...@@ -12,6 +12,7 @@ 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.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EmployeePreLogListVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
...@@ -186,4 +187,23 @@ public class TEmployeeInsurancePreController { ...@@ -186,4 +187,23 @@ public class TEmployeeInsurancePreController {
tEmployeeInsurancePreService.pushWxConfrimMessage(); tEmployeeInsurancePreService.pushWxConfrimMessage();
} }
/**
* @param empPreId 入职确认信息表ID
* @Description: 获取商险信息
* @Author: hgw
* @Date: 2025/4/8 9:23
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre>>
**/
@Inner
@PostMapping("/inner/getListByEmpPreId")
public EmployeePreLogListVo getListByEmpPreId(@RequestBody String empPreId){
return tEmployeeInsurancePreService.getListByEmpPreId(empPreId);
}
@Inner
@PostMapping("/inner/saveOrUpdateInsuranceList")
public Boolean saveOrUpdateInsuranceList(@RequestBody List<TEmployeeInsurancePre> preList) {
return tEmployeeInsurancePreService.saveOrUpdateInsuranceList(preList);
}
} }
...@@ -31,4 +31,12 @@ public interface TEmployeeInsurancePreMapper extends BaseMapper<TEmployeeInsuran ...@@ -31,4 +31,12 @@ public interface TEmployeeInsurancePreMapper extends BaseMapper<TEmployeeInsuran
List<TEmployeeInsurancePreExportVo> selectExportList(@Param("employeeRegistration") TEmployeeInsurancePreSearchVo employeeRegistration); List<TEmployeeInsurancePreExportVo> selectExportList(@Param("employeeRegistration") TEmployeeInsurancePreSearchVo employeeRegistration);
List<TEmployeeInsurancePre> getAllUnconfimData(); List<TEmployeeInsurancePre> getAllUnconfimData();
/**
* 根据empPreId查询
* @param empPreId 入职确认信息表主键
* @return
*/
List<TEmployeeInsurancePre> getListByEmpPreId(@Param("empPreId") String empPreId);
void deleteByEmpPreId(@Param("empPreId") String empPreId);
} }
...@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo; ...@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EmployeePreLogListVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
...@@ -70,4 +71,20 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc ...@@ -70,4 +71,20 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
void pushWxConfrimMessage(); void pushWxConfrimMessage();
/**
* @Description: 查询list
* @Author: hgw
* @Date: 2025/4/8 11:31
* @return: com.yifu.cloud.plus.v1.yifu.insurances.vo.EmployeePreLogListVo
**/
EmployeePreLogListVo getListByEmpPreId(String empPreId);
/**
* @Description: 先删后增
* @Author: hgw
* @Date: 2025/4/8 11:31
* @return: boolean
**/
boolean saveOrUpdateInsuranceList(List<TEmployeeInsurancePre> preList);
} }
...@@ -539,4 +539,32 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -539,4 +539,32 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
} }
} }
} }
/**
* @param empPreId 入职确认ID
* @Description: 根据
* @Author: hgw
* @Date: 2025/4/7 18:29
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre>
**/
@Override
public EmployeePreLogListVo getListByEmpPreId(String empPreId) {
EmployeePreLogListVo vo = new EmployeePreLogListVo();
List<TEmployeeInsurancePre> preList = baseMapper.getListByEmpPreId(empPreId);
vo.setPreList(preList);
return vo;
}
/**
* @Description: 先删后增
* @Author: hgw
* @Date: 2025/4/8 11:30
* @return: boolean
**/
@Override
public boolean saveOrUpdateInsuranceList(List<TEmployeeInsurancePre> preList) {
baseMapper.deleteByEmpPreId(preList.get(0).getRegisterId());
this.saveOrUpdateBatch(preList);
return true;
}
} }
...@@ -225,6 +225,18 @@ ...@@ -225,6 +225,18 @@
</where> </where>
</select> </select>
<!--查询list,用来对比,记录日志-->
<select id="getListByEmpPreId" resultMap="tEmployeeInsurancePreMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_insurance_pre a
where a.register_id = #{empPreId}
</select>
<!--先删后加-->
<delete id="deleteByEmpPreId">
delete FROM t_employee_insurance_pre where register_id = #{empPreId} and process_status in ('0','1','2','5')
</delete>
<select id="selectExportCount" resultType="java.lang.Long"> <select id="selectExportCount" resultType="java.lang.Long">
SELECT SELECT
count(1) count(1)
......
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