Commit 4d8b5b1d authored by huyuchen's avatar huyuchen

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

parents eacb6b4c 3691d45c
......@@ -20,6 +20,7 @@ public class ArchivesConstants {
*/
public static final String PROJECT_CONTENT = "复项";
/**
* 复档复项
*/
......@@ -136,4 +137,16 @@ public class ArchivesConstants {
*/
public static final String CONTRACT_AUDIT_REMARK_TOO_LONG = "审核说明不可超过200字!";
/**
* 处理状态
*/
public static final String HANDLE_FLAG_ONE= "未处理-已处理";
/**
* 处理状态
*/
public static final String HANDLE_FLAG_TWO= "已处理-未处理";
public static final int MYEAR_MONTH=-717;
public static final int WYEAR_MONTH=-597;
}
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
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 java.io.Serializable;
/**
* @author wzb
* @description 人员退休提醒
* @date 2023-05-18 15:11:11
*/
@Data
@TableName("t_employee_retirement")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "项目档案表")
public class TEmployeeRetirement extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
/**
* 员工姓名
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
@ExcelAttribute(name = "员工姓名")
@Schema(description = "员工姓名")
private String empName;
/**
* 身份证号码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证号码")
@ExcelAttribute(name = "身份证号码")
@Schema(description = "身份证号码")
private String empIdcard;
/**
* 手机号码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("手机号码")
@ExcelAttribute(name = "手机号码")
@Schema(description = "手机号码")
private String empPhone;
/**
* 性别
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("性别")
@ExcelAttribute(name = "性别")
@Schema(description = "性别")
private String empSex;
/**
* 年龄
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("年龄")
@ExcelAttribute(name = "年龄")
@Schema(description = "年龄")
private Integer empAge;
/**
* 员工类型(字典值,0外包1派遣2代理)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工类型")
@ExcelAttribute(name = "员工类型")
@Schema(description = "员工类型")
private String empNatrue;
/**
* 档案-省
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("省")
@ExcelAttribute(name = "省")
@Schema(description = "档案-省")
private Integer fileProvince;
/**
* 档案-市
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("市")
@ExcelAttribute(name = "市")
@Schema(description = "档案-市")
private Integer fileCity;
/**
* 档案-县
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("县")
@ExcelAttribute(name = "县")
@Schema(description = "档案-县")
private Integer fileTown;
/**
* 社保-省
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保-省")
@ExcelAttribute(name = "社保-省")
@Schema(description = "社保-省")
private Integer socialProvince;
/**
* 社保-市
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保-市")
@ExcelAttribute(name = "社保-市")
@Schema(description = "社保-市")
private Integer socialCity;
/**
* 社保-县
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保-县")
@ExcelAttribute(name = "社保-县")
@Schema(description = "社保-县")
private Integer socialTown;
/**
* 项目名称
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目名称")
@ExcelAttribute(name = "项目名称")
@Schema(description = "项目名称")
private String deptName;
/**
* 客户名称
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户名称")
@ExcelAttribute(name = "客户名称")
@Schema(description = "客户名称")
private String unitName;
/**
* 客户编码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户编码")
@ExcelAttribute(name = "客户编码")
@Schema(description = "客户编码")
private String unitNo;
/**
* 项目编码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户编码")
@ExcelAttribute(name = "客户编码")
@Schema(description = "客户编码")
private String deptNo;
/**
* 是否处理(0未处理,1处理)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否处理")
@ExcelAttribute(name = "是否处理")
@Schema(description = "是否处理")
private Integer handleFlag;
}
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
* @TableName t_employee_retirement_flag_detail
*/
@Data
@TableName("t_employee_retirement_Flag_detail")
@Schema(description = "项目档案表")
public class TEmployeeRetirementFlagDetail implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
private String datailId;
/**
* 创建人id
*/
private String createBy;
/**
* 创建人姓名
*/
private String createName;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人id
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 操作内容
*/
private String context;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
/**
* @author wzb
* @description 批量修改处理状态类
* @date 2023-05-19 16:30:29
*/
@Data
public class ChangeHandleFlagAllVo {
/**
* id集合
*/
private String[] ids;
/**
* 处理状态
*/
private Integer handleFlag;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
/**
* @author wzb
* @description 修改处理状态类
* @date 2023-05-22 17:09:54
*/
@Data
public class ChangeHandleFlagVo {
/**
* id
*/
private String id;
/**
* 处理状态
*/
private Integer handleFlag;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeRetirement;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeRetirementFlagDetail;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/**
* @author wzb
* @description TODO
* @date 2023-05-22 17:44:35
*/
@Data
@ExcelIgnoreUnannotated
public class TEmployeeRetirementExportVo{
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
/**
* 员工姓名
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
@ExcelAttribute(name = "员工姓名")
@Schema(description = "员工姓名")
private String empName;
/**
* 身份证号码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证号码")
@ExcelAttribute(name = "身份证号码")
@Schema(description = "身份证号码")
private String empIdcard;
/**
* 手机号码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("手机号码")
@ExcelAttribute(name = "手机号码")
@Schema(description = "手机号码")
private String empPhone;
/**
* 性别
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("性别")
@ExcelAttribute(name = "性别",readConverterExp = "1=男,2=女")
@Schema(description = "性别")
private String empSex;
/**
* 年龄
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("年龄")
@ExcelAttribute(name = "年龄")
@Schema(description = "年龄")
private Integer empAge;
/**
* 员工类型(字典值,0外包1派遣2代理)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工类型")
@ExcelAttribute(name = "员工类型",readConverterExp = "0=外包,1=派遣,2=代理")
@Schema(description = "员工类型")
private String empNatrue;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案")
@ExcelAttribute(name = "档案")
@Schema(description = "档案")
private String fileAddress;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保")
@ExcelAttribute(name = "社保")
@Schema(description = "社保")
private String socialAddress;
/**
* 档案-省
*/
@Schema(description = "档案-省")
private Integer fileProvince;
/**
* 档案-市
*/
@JsonIgnore
@Schema(description = "档案-市")
private Integer fileCity;
/**
* 档案-县
*/
@Schema(description = "档案-县")
private Integer fileTown;
/**
* 社保-省
*/
@Schema(description = "社保-省")
private Integer socialProvince;
/**
* 社保-市
*/
@Schema(description = "社保-市")
private Integer socialCity;
/**
* 社保-县
*/
@Schema(description = "社保-县")
private Integer socialTown;
/**
* 项目名称
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目名称")
@ExcelAttribute(name = "项目名称")
@Schema(description = "项目名称")
private String deptName;
/**
* 客户名称
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户名称")
@ExcelAttribute(name = "客户名称")
@Schema(description = "客户名称")
private String unitName;
/**
* 客户编码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户编码")
@ExcelAttribute(name = "客户编码")
@Schema(description = "客户编码")
private String unitNo;
/**
* 项目编码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户编码")
@ExcelAttribute(name = "客户编码")
@Schema(description = "客户编码")
private String deptNo;
/**
* 是否处理(0未处理,1处理)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否处理")
@ExcelAttribute(name = "是否处理")
@Schema(description = "是否处理")
private String handleFlag;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeRetirement;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author wzb
* @description TODO
* @date 2023-05-22 19:37:37
*/
@Data
public class TEmployeeRetirementSearchVo extends TEmployeeRetirement {
/**
* 员工类型下拉多选
*/
@TableField(exist = false)
@Schema(description = "员工类型下拉多选")
private String[]empTypeList;
@TableField(exist = false)
@Schema(description = "id集合")
private String[]idList;
/**
* @Author fxj
* 查询数据起
**/
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
private int limitEnd;
}
......@@ -3,12 +3,14 @@ package com.yifu.cloud.plus.v1.yifu.archives;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* @author pig archetype
* <p>
* 项目启动类
*/
@EnableYifuResourceServer
@SpringBootApplication
public class ArchivesApplication {
......
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.TEmployeeRetirement;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeRetirementService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeHandleFlagAllVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeHandleFlagVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeRetirementExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeRetirementSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Set;
/**
* @author wzb
* @description 退休人员提醒
* @date 2023-05-18 16:11:02
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeeretirement" )
@Tag(name = "退休人员提醒")
public class TEmployeeRetirementController {
private final TEmployeeRetirementService tEmployeeRetirementService;
/**
* 分页查询
*
* @author wzb
* @param page
* @param searchVo
* @return {@link R< IPage< TEmployeeRetirement>>}
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R<IPage<TEmployeeRetirement>> getTEmployeeRetirementPage(Page page, TEmployeeRetirementSearchVo searchVo) {
return R.ok(tEmployeeRetirementService.getTEmployeeRetirementPage(page,searchVo));
}
@Inner
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/inner/retireeRemind" )
public void retireeRemind() {
tEmployeeRetirementService.retireeRemind();
}
/**
* 批量修改状态
*
* @author wzb
* @param changeHandleFlagAllVo
* @return {@link R}
*/
@Operation(summary = "批量修改状态", description = "修改状态")
@PostMapping("/changeHandleFlagAll")
public R changeHandleFlagAll( @RequestBody ChangeHandleFlagAllVo changeHandleFlagAllVo) {
return R.ok(tEmployeeRetirementService.changeHandleFlagAll(changeHandleFlagAllVo));
}
/**
* 修改状态
*
* @author wzb
* @param changeHandleFlagVo
* @return {@link R}
*/
@Operation(summary = "修改状态", description = "修改状态")
@PostMapping("/changeHandleFlag")
public R changeHandleFlag(@RequestBody ChangeHandleFlagVo changeHandleFlagVo) {
return R.ok(tEmployeeRetirementService.changeHandleFlag(changeHandleFlagVo));
}
/**
* 修改状态
*/
@Operation(summary = "操作日志详情", description = "操作日志详情")
@GetMapping("/getHandleFlagDetail")
public R getHandleFlagDetail(String id) {
return R.ok(tEmployeeRetirementService.getHandleFlagDetail(id));
}
/**
* 人员退休提醒批量导出
*
* @author wzb
* @param response
* @param searchVo
* @return void
*/
@Operation(summary = "人员退休提醒批量导出", description = "人员退休提醒批量导出")
@GetMapping("/export")
public void export(HttpServletResponse response, TEmployeeRetirementSearchVo searchVo) {
tEmployeeRetirementService.listExport(response, searchVo);
}
}
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.TEmployeeRetirementFlagDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author 86187
* @description 针对表【t_employee_retirement_flag_detail】的数据库操作Mapper
* @createDate 2023-05-20 16:18:07
* @Entity generator.domain.TEmployeeRetirementFlagDetail
*/
@Mapper
public interface TEmployeeRetirementFlagDetailMapper extends BaseMapper<TEmployeeRetirementFlagDetail> {
List<TEmployeeRetirementFlagDetail> getDatail(@Param("id") String id);
}
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.TEmployeeRetirement;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @author 86187
* @description 针对表【t_employee_retirement】的数据库操作Mapper
* @createDate 2023-05-18 15:40:46
* @Entity generator.domain.TEmployeeRetirement
*/
@Mapper
public interface TEmployeeRetirementMapper extends BaseMapper<TEmployeeRetirement> {
IPage<TEmployeeRetirement> getTEmployeeRetirementPage(Page page, @Param("searchVo") TEmployeeRetirementSearchVo searchVo);
List<TEmployeeRetirement> getBirthday(@Param("TT") String TT, @Param("LL") String LL);
boolean changeHandleFlagAll(@Param("changeHandleFlagAllVo") ChangeHandleFlagAllVo changeHandleFlagAllVo);
boolean changeHandleFlag(@Param("changeHandleFlagVo")ChangeHandleFlagVo changeHandleFlagVo);
int selectByEmpIdcard(@Param("empIdCard") String empIdCard);
int add(@Param("tEmployeeRetirement") TEmployeeRetirement tEmployeeRetirement);
long selectExportCount(@Param("tEmployeeRetirement") TEmployeeRetirementExportVo tEmployeeRetirement);
List<TEmployeeRetirementExportVo>noPageDiy(@Param("searchVo")TEmployeeRetirementSearchVo searchVo);
int noPageCountDiy(@Param("searchVo")TEmployeeRetirementSearchVo searchVo);
String selectByIdd(@Param("id")Integer id);
}
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.TEmployeeRetirementFlagDetail;
;
/**
* @author wzb
* @description 针对表【t_employee_retirement_flag_detail】的数据库操作Service
* @createDate 2023-05-20 16:18:07
*/
public interface TEmployeeRetirementFlagDetailService extends IService<TEmployeeRetirementFlagDetail> {
}
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.TEmployeeRetirement;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeRetirementFlagDetail;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeHandleFlagAllVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeHandleFlagVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeRetirementSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author 86187
* @description 针对表【t_employee_retirement】的数据库操作Service
* @createDate 2023-05-18 15:40:46
*/
public interface TEmployeeRetirementService extends IService<TEmployeeRetirement> {
/**
* 人员退休提醒分页列表
*
* @author wzb
* @param page
* @param searchVo
* @return {@link IPage< TEmployeeRetirement>}
*/
IPage<TEmployeeRetirement> getTEmployeeRetirementPage(Page page, TEmployeeRetirementSearchVo searchVo);
/**
* 批量修改状态
*
* @author wzb
* @param changeHandleFlagAllVo
* @return {@link boolean}
*/
boolean changeHandleFlagAll(ChangeHandleFlagAllVo changeHandleFlagAllVo);
/**
* 修改状态
*
* @author wzb
* @param changeHandleFlagVo
* @return {@link boolean}
*/
boolean changeHandleFlag(ChangeHandleFlagVo changeHandleFlagVo);
/**
* 退休提醒人员导出
*
* @author wzb
* @param response
* @param searchVo
* @return void
*/
void listExport (HttpServletResponse response, TEmployeeRetirementSearchVo searchVo);
/**
* 退休提醒定时任务
*
* @author wzb
* @param
* @return void
*/
void retireeRemind() ;
/**
* 获取处理日志
*
* @author wzb
* @param id
* @return {@link List< TEmployeeRetirementFlagDetail>}
*/
List<TEmployeeRetirementFlagDetail> getHandleFlagDetail(String id);
}
......@@ -246,22 +246,23 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
}
if (EmployeeConstants.SITUATION_ONE.equals(tEmployeeContractInfo.getSituation())) {
TEmployeeContractInfo contractInfo = this.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, tEmployeeContractInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getContractStart, tEmployeeContractInfo.getContractStart())
.eq(TEmployeeContractInfo::getContractEnd, tEmployeeContractInfo.getContractEnd())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_INT)
.and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_INT)
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
return R.failed("不能重复添加");
}
}
}
return null;
}
......
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.TEmployeeRetirementFlagDetail;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeRetirementFlagDetailMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeRetirementFlagDetailService;
import org.springframework.stereotype.Service;
/**
* @author 86187
* @description 针对表【t_employee_retirement_flag_detail】的数据库操作Service实现
* @createDate 2023-05-20 16:18:07
*/
@Service
public class TEmployeeRetirementFlagDetailServiceImpl extends ServiceImpl<TEmployeeRetirementFlagDetailMapper, TEmployeeRetirementFlagDetail>
implements TEmployeeRetirementFlagDetailService {
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.date.DateTime;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeRetirement;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeRetirementFlagDetail;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeRetirementFlagDetailMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeRetirementMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeRetirementService;
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.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchAuditExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author 86187
* @description 针对表【t_employee_retirement】的数据库操作Service实现
* @createDate 2023-05-18 15:40:46
*/
@Service
public class TEmployeeRetirementServiceImpl extends ServiceImpl<TEmployeeRetirementMapper, TEmployeeRetirement>
implements TEmployeeRetirementService {
@Autowired
private TEmployeeRetirementMapper tEmployeeRetirementMapper;
@Autowired
private TEmployeeRetirementFlagDetailMapper tEmployeeRetirementFlagDetailMapper;
@Override
public IPage<TEmployeeRetirement> getTEmployeeRetirementPage(Page page, TEmployeeRetirementSearchVo searchVo) {
return baseMapper.getTEmployeeRetirementPage(page, searchVo);
}
@Override
@Scheduled(cron = "0 */1 * * * ?")
public void retireeRemind() {
Date date = new Date();
YifuUser user = SecurityUtils.getUser();
SimpleDateFormat formatterMenYear = new SimpleDateFormat("YYYYMM");
String YearMonth = formatterMenYear.format(date);
SimpleDateFormat formatterManDate = new SimpleDateFormat("dd");
String dateOne = formatterManDate.format(date);
String mRemainTime = DateUtil.getYearAndMonth(YearMonth, ArchivesConstants.MYEAR_MONTH);
String wRemainTime = DateUtil.getYearAndMonth(YearMonth, ArchivesConstants.WYEAR_MONTH);
String TT = mRemainTime + dateOne;
StringBuffer stringBuffer = new StringBuffer(TT);
stringBuffer.insert(CommonConstants.FOUR_INT, "-");
stringBuffer.insert(CommonConstants.SEVEN_INT, "-");
String LL = wRemainTime + dateOne;
StringBuffer stringBufferOne = new StringBuffer(LL);
stringBufferOne.insert(CommonConstants.FOUR_INT, "-");
stringBufferOne.insert(CommonConstants.SEVEN_INT, "-");
List<TEmployeeRetirement> list = baseMapper.getBirthday(TT,LL);
for (TEmployeeRetirement tEmployeeRetirement : list) {
int i = baseMapper.selectByEmpIdcard(tEmployeeRetirement.getEmpIdcard());
if (i == 0) {
tEmployeeRetirement.setHandleFlag(0);
tEmployeeRetirement.setCreateBy("1");
tEmployeeRetirementMapper.insert(tEmployeeRetirement);
}
}
}
@Override
public boolean changeHandleFlagAll(ChangeHandleFlagAllVo changeHandleFlagAllVo) {
YifuUser user = SecurityUtils.getUser();
for (int i = 0; i < changeHandleFlagAllVo.getIds().length; i++) {
TEmployeeRetirementFlagDetail tEmployeeRetirementFlagDetail = new TEmployeeRetirementFlagDetail();
if (changeHandleFlagAllVo.getHandleFlag() == 0) {
tEmployeeRetirementFlagDetail.setDatailId(changeHandleFlagAllVo.getIds()[i]);
tEmployeeRetirementFlagDetail.setContext(ArchivesConstants.HANDLE_FLAG_ONE);
tEmployeeRetirementFlagDetail.setCreateBy(user.getId());
tEmployeeRetirementFlagDetail.setCreateName(user.getNickname());
tEmployeeRetirementFlagDetail.setCreateTime(DateTime.now());
tEmployeeRetirementFlagDetailMapper.insert(tEmployeeRetirementFlagDetail);
}
if (changeHandleFlagAllVo.getHandleFlag() == 1) {
tEmployeeRetirementFlagDetail.setDatailId(changeHandleFlagAllVo.getIds()[i]);
tEmployeeRetirementFlagDetail.setContext(ArchivesConstants.HANDLE_FLAG_TWO);
tEmployeeRetirementFlagDetail.setCreateBy(user.getId());
tEmployeeRetirementFlagDetail.setCreateName(user.getNickname());
tEmployeeRetirementFlagDetail.setCreateTime(DateTime.now());
tEmployeeRetirementFlagDetailMapper.insert(tEmployeeRetirementFlagDetail);
}
}
return baseMapper.changeHandleFlagAll(changeHandleFlagAllVo);
}
@Override
public boolean changeHandleFlag(ChangeHandleFlagVo changeHandleFlagVo) {
YifuUser user = SecurityUtils.getUser();
TEmployeeRetirementFlagDetail tEmployeeRetirementFlagDetail = new TEmployeeRetirementFlagDetail();
if(changeHandleFlagVo.getHandleFlag()==0){
tEmployeeRetirementFlagDetail.setDatailId(changeHandleFlagVo.getId());
tEmployeeRetirementFlagDetail.setContext(ArchivesConstants.HANDLE_FLAG_ONE);
tEmployeeRetirementFlagDetail.setCreateBy(user.getId());
tEmployeeRetirementFlagDetail.setCreateTime(DateTime.now());
tEmployeeRetirementFlagDetail.setCreateName(user.getNickname());
tEmployeeRetirementFlagDetailMapper.insert(tEmployeeRetirementFlagDetail);
}
if(changeHandleFlagVo.getHandleFlag()==1){
tEmployeeRetirementFlagDetail.setDatailId(changeHandleFlagVo.getId());
tEmployeeRetirementFlagDetail.setContext(ArchivesConstants.HANDLE_FLAG_TWO);
tEmployeeRetirementFlagDetail.setCreateBy(user.getId());
tEmployeeRetirementFlagDetail.setCreateTime(DateTime.now());
tEmployeeRetirementFlagDetail.setCreateName(user.getNickname());
tEmployeeRetirementFlagDetailMapper.insert(tEmployeeRetirementFlagDetail);
}
return baseMapper.changeHandleFlag(changeHandleFlagVo);
}
@Override
public void listExport(HttpServletResponse response, TEmployeeRetirementSearchVo searchVo) {
String fileName = "人员退休提醒批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
List<TEmployeeRetirementExportVo> list = new ArrayList<>();
long count = noPageCountDiy(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 , "UTF-8"));
ExcelUtil<TEmployeeRetirementExportVo> util = new ExcelUtil<>(TEmployeeRetirementExportVo.class);
// 获取所有字典type
Map<String,String> nameAndDicTypeMap = util.getConverterDicType();
// 获取所有字典对应的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TEmployeeRetirementExportVo.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap))
.build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
for (TEmployeeRetirementExportVo tEmployeeRetirementExportVo :list) {
String fileProvince = baseMapper.selectByIdd(tEmployeeRetirementExportVo.getFileProvince());
String fileCity = baseMapper.selectByIdd(tEmployeeRetirementExportVo.getFileCity());
String fileTown = baseMapper.selectByIdd(tEmployeeRetirementExportVo.getFileTown());
if (null != fileProvince && null != fileCity && null != fileTown) {
if (null != fileCity && null == fileTown) {
tEmployeeRetirementExportVo.setFileAddress(fileProvince + "/" + fileCity);
} else {
tEmployeeRetirementExportVo.setFileAddress(fileProvince + "/" + fileCity + "/" + fileTown);
}
}
String socialProvince = baseMapper.selectByIdd(tEmployeeRetirementExportVo.getSocialProvince());
String socialCity = baseMapper.selectByIdd(tEmployeeRetirementExportVo.getSocialCity());
String socailTown = baseMapper.selectByIdd(tEmployeeRetirementExportVo.getSocialTown());
if (null != socialProvince && null != socialCity && null != socailTown) {
if (null != socialCity && null == socailTown) {
tEmployeeRetirementExportVo.setSocialAddress(socialProvince + "/" + socialCity);
} else {
tEmployeeRetirementExportVo.setFileAddress(socialProvince + "/" + socialCity + "/" + socailTown);
}
}
}
if (Common.isNotNull(list)){
writeSheet = EasyExcel.writerSheet("人员退休提醒批量导出"+index).build();
excelWriter.write(list,writeSheet);
index++;
}
if (Common.isNotNull(list)){
list.clear();
}
}
}else {
WriteSheet writeSheet = EasyExcel.writerSheet("人员退休提醒批量导出"+index).build();
excelWriter.write(list,writeSheet);
}
if (Common.isNotNull(list)){
list.clear();
}
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}
}
@Override
public List<TEmployeeRetirementFlagDetail> getHandleFlagDetail(String id) {
return tEmployeeRetirementFlagDetailMapper.getDatail(id);
}
private List<TEmployeeRetirementExportVo> noPageDiy(TEmployeeRetirementSearchVo searchVo) {
return baseMapper.noPageDiy(searchVo);
}
private int noPageCountDiy(TEmployeeRetirementSearchVo searchVo) {
return baseMapper.noPageCountDiy(searchVo);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeRetirementFlagDetailMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeRetirementFlagDetail">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="datailId" column="DATAIL_ID" jdbcType="VARCHAR"/>
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
<result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="UPDATE_BY" jdbcType="VARCHAR"/>
<result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
<result property="context" column="CONTEXT" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,CREATE_BY,CREATE_NAME,DATAIL_ID,
CREATE_TIME,UPDATE_BY,UPDATE_TIME,
CONTEXT
</sql>
<select id="getDatail" resultType="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeRetirementFlagDetail">
SELECT a.ID,a.DATAIL_ID,a.CREATE_NAME,a.CREATE_BY,a.CREATE_TIME,a.CONTEXT
FROM t_employee_retirement_flag_detail a
where a.DATAIL_ID=#{id}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeRetirementMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeRetirement">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="empName" column="EMP_NAME" jdbcType="VARCHAR"/>
<result property="empIdcard" column="EMP_IDCARD" jdbcType="VARCHAR"/>
<result property="empPhone" column="EMP_PHONE" jdbcType="VARCHAR"/>
<result property="empSex" column="EMP_SEX" jdbcType="VARCHAR"/>
<result property="empAge" column="EMP_AGE" jdbcType="INTEGER"/>
<result property="empNatrue" column="EMP_NATRUE" jdbcType="VARCHAR"/>
<result property="fileProvince" column="FILE_PROVINCE" jdbcType="INTEGER"/>
<result property="fileCity" column="FILE_CITY" jdbcType="INTEGER"/>
<result property="fileTown" column="FILE_TOWN" jdbcType="INTEGER"/>
<result property="socialProvince" column="SOCIAL_PROVINCE" jdbcType="INTEGER"/>
<result property="socialCity" column="SOCIAL_CITY" jdbcType="INTEGER"/>
<result property="socialTown" column="SOCIAL_TOWN" jdbcType="INTEGER"/>
<result property="deptName" column="DEPT_NAME" jdbcType="VARCHAR"/>
<result property="unitName" column="UNIT_NAME" jdbcType="VARCHAR"/>
<result property="unitNo" column="UNIT_NO" jdbcType="VARCHAR"/>
<result property="deptNo" column="DEPT_NO" jdbcType="VARCHAR"/>
<result property="handleFlag" column="HANDLE_FLAG" jdbcType="INTEGER"/>
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
<result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="UPDATE_BY" jdbcType="VARCHAR"/>
<result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
ID,EMP_NAME,EMP_IDCARD,
EMP_PHONE,EMP_SEX,EMP_AGE,
EMP_NATRUE,FILE_PROVINCE,FILE_CITY,
FILE_TOWN,SOCIAL_PROVINCE,SOCIAL_CITY,
SOCIAL_TOWN,DEPT_NAME,UNIT_NAME,
UNIT_NO,DEPT_NO,HANDLE_FLAG,
CREATE_BY,CREATE_NAME,CREATE_TIME,
UPDATE_BY,UPDATE_TIME
</sql>
<sql id="tEmployeeRetirement_pageWhere">
<if test="searchVo.empName != null and searchVo.empName.trim() != ''">
AND a.EMP_NAME like concat('%',#{searchVo.empName},'%')
</if>
<if test="searchVo.empIdcard != null and searchVo.empIdcard.trim() != ''">
AND a.EMP_IDCARD like concat('%',#{searchVo.empIdcard},'%')
</if>
<if test="searchVo.fileProvince != null">
AND a.FILE_PROVINCE = #{searchVo.fileProvince}
</if>
<if test="searchVo.fileCity != null">
AND a.FILE_CITY = #{searchVo.fileCity}
</if>
<if test="searchVo.fileTown != null">
AND a.FILE_TOWN = #{searchVo.fileTown}
</if>
<if test="searchVo.socialProvince != null">
AND a.SOCIAL_PROVINCE = #{searchVo.socialProvince}
</if>
<if test="searchVo.socialCity != null">
AND a.SOCIAL_CITY = #{searchVo.socialCity}
</if>
<if test="searchVo.socialTown != null">
AND a.SOCIAL_TOWN = #{searchVo.socialTown}
</if>
<if test="searchVo.unitName!= null">
AND a.UNIT_NAME = #{searchVo.unitName}
</if>
<if test="searchVo.unitNo!= null">
AND a.UNIT_NO = #{searchVo.unitNo}
</if>
<if test="searchVo.deptName!= null">
AND a.DEPT_NAME like concat('%',#{searchVo.deptName},'%')
</if>
<if test="searchVo.deptNo!= null">
AND a.DEPT_NO =#{searchVo.deptNo}
</if>
<if test="searchVo.handleFlag!= null">
AND a.HANDLE_FLAG =#{searchVo.handleFlag}
</if>
<if test="searchVo.empTypeList != null and searchVo.empTypeList.length>0">
AND a.EMP_NATRUE IN
<foreach collection="searchVo.empTypeList" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="searchVo.idList != null and searchVo.idList.length > 0">
and a.ID in
<foreach collection="searchVo.idList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</sql>
<sql id="tEmployeeRetirement_where">
<if test="searchVo.empName != null and searchVo.empName.trim() != ''">
AND a.EMP_NAME like concat('%',#{searchVo.empName},'%')
</if>
<if test="searchVo.empIdcard != null and searchVo.empIdcard.trim() != ''">
AND a.EMP_IDCARD like concat('%',#{searchVo.empIdcard},'%')
</if>
<if test="searchVo.fileProvince != null">
AND b.FILE_PROVINCE = #{searchVo.fileProvince}
</if>
<if test="searchVo.fileCity != null">
AND b.FILE_CITY = #{searchVo.fileCity}
</if>
<if test="searchVo.fileTown != null">
AND b.FILE_TOWN = #{searchVo.fileTown}
</if>
<if test="searchVo.socialProvince != null">
AND a.SOCIAL_PROVINCE = #{searchVo.socialProvince}
</if>
<if test="searchVo.socialCity != null">
AND a.SOCIAL_CITY = #{searchVo.socialCity}
</if>
<if test="searchVo.socialTown != null">
AND a.SOCIAL_TOWN = #{searchVo.socialTown}
</if>
<if test="searchVo.unitName!= null">
AND a.UNIT_NAME = #{searchVo.unitName}
</if>
<if test="searchVo.unitNo!= null">
AND a.UNIT_NO = #{searchVo.unitNo}
</if>
<if test="searchVo.deptName!= null">
AND a.DEPT_NAME like concat('%',#{searchVo.deptName},'%')
</if>
<if test="searchVo.deptNo!= null">
AND a.DEPART_NO =#{searchVo.deptNo}
</if>
<if test="searchVo.handleFlag!= null">
AND a.HANDLE_FLAG =#{searchVo.handleFlag}
</if>
<if test="searchVo.empTypeList != null and searchVo.empTypeList.length>0">
AND a.EMP_NATRUE IN
<foreach collection="searchVo.empTypeList" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</sql>
<select id="getTEmployeeRetirementPage" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_retirement a
<where>
<include refid="tEmployeeRetirement_pageWhere"/>
</where>
order by a.CREATE_TIME desc
</select>
<select id="selectByEmpIdcard" resultType="Integer">
SELECT count(*)
<include refid="Base_Column_List"/>
FROM t_employee_retirement a
where EMP_IDCARD=#{empIdCard}
</select>
<select id="getBirthday" parameterType="String" resultMap="BaseResultMap">
SELECT a.EMP_NAME,
a.EMP_IDCARD,
b.EMP_SEX,
b.EMP_AGE,
b.EMP_PHONE,
CASE
WHEN MAX(a.EMP_NATRUE)=3 THEN "3"
WHEN MIN(a.EMP_NATRUE)=0 THEN "0"
WHEN MIN(a.EMP_NATRUE)=1 THEN "1"
ELSE a.EMP_NATRUE END as EMP_NATRUE,
a.UNIT_NAME,
a.UNIT_NO,
a.DEPT_NAME,
a.DEPT_NO,
b.FILE_PROVINCE,
b.FILE_CITY,
b.FILE_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
b.EMP_BIRTHDAY
FROM t_employee_project a
LEFT JOIN t_employee_info b ON a.EMP_IDCARD = b.EMP_IDCARD
where datediff(#{TT}, b.EMP_BIRTHDAY) = 0
and
b.EMP_SEX = '1'
and b.FILE_STATUS = 0
or datediff(#{LL}, b.EMP_BIRTHDAY) = 0
and b.EMP_SEX = '2'
and b.FILE_STATUS = 0
GROUP BY a.EMP_ID
</select>
<update id="changeHandleFlagAll" parameterType="com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeHandleFlagAllVo">
update t_employee_retirement a
set a.HANDLE_FLAG=#{changeHandleFlagAllVo.handleFlag}
where a.ID in
<foreach item="idStr" index="index" collection="changeHandleFlagAllVo.ids" open="(" separator="," close=")">
#{idStr}
</foreach>
</update>
<update id="changeHandleFlag" parameterType="com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeHandleFlagVo">
update t_employee_retirement a
set a.HANDLE_FLAG=#{changeHandleFlagVo.handleFlag}
where a.ID = #{changeHandleFlagVo.id}
</update>
<insert id="add">
insert into t_employee_retirement (EMP_NAME)
value (#{tEmployeeRetirement.empName})
</insert>
<select id="selectExportCount" resultType="java.lang.Long">
SELECT
count(1)
from t_employee_retirement a
<where>
<include refid="tEmployeeRetirement_pageWhere"/>
</where>
</select>
<select id="noPageDiy" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeRetirementExportVo">
SELECT a.ID,
EMP_NAME,
EMP_IDCARD,
EMP_PHONE,
CASE WHEN a.EMP_SEX=1 THEN "男"
WHEN a.EMP_SEX =2 THEN "女"
ELSE "" END as "EMP_SEX",
EMP_AGE,
CASE WHEN a.EMP_NATRUE='0' THEN "外包"
WHEN a.EMP_NATRUE='1' THEN "派遣"
WHEN a.EMP_NATRUE='2' THEN "代理"
WHEN a.EMP_NATRUE='3' THEN "内部员工"
ELSE "" END as "EMP_NATRUE",
FILE_PROVINCE,
CASE WHEN a.HANDLE_FLAG=0 THEN "未处理"
WHEN a.HANDLE_FLAG =1 THEN "已处理"
ELSE "" END as "HANDLE_FLAG",
FILE_CITY, FILE_TOWN, SOCIAL_PROVINCE, SOCIAL_CITY, SOCIAL_TOWN,
DEPT_NAME, UNIT_NAME, UNIT_NO, DEPT_NO
<include refid="Base_Column_List"/>
FROM t_employee_retirement a
<where>
<include refid="tEmployeeRetirement_pageWhere"/>
</where>
order by a.CREATE_TIME desc
</select>
<!--tEmployeeInfo导出查询count改造 fxj 2022-11-03-->
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
count(1)
from t_employee_retirement a
<where>
<include refid="tEmployeeRetirement_pageWhere"/>
</where>
</select>
<select id="selectByIdd" resultType="String">
SELECT a.AREA_NAME
from mvp_salary.sys_area a
where id = #{id}
</select>
</mapper>
......@@ -52,4 +52,12 @@ public class ArchiveTask {
log.info("-------------每天更新人员档案、项目档案的过期合同为2不在用-定时任务结束------------");
}
public void retireeRemind() {
log.info("-------------每日凌晨1点人员退休提醒-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/temployeeretirement/inner/everyDayRemind", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每日凌晨1点人员退休提醒-定时任务开始------------");
}
}
\ No newline at end of file
......@@ -162,8 +162,8 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
if (Common.isEmpty(data.getId())) {
data.setErrorFlag(true);
errorMessage.append("ID为空;");
}else{
TMinSalary ll=baseMapper.selectById(data.getId());
} else {
TMinSalary ll = baseMapper.selectById(data.getId());
if (Common.isEmpty(baseMapper.selectById(data.getId()))) {
data.setErrorFlag(true);
errorMessage.append("ID不存在无法更新,请核实后再操作!;");
......@@ -173,7 +173,8 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
errorMessage.append("所在地、最低工资(元)、状态为空;");
}
if(null !=data.getLocation()){
if (null != data.getLocation()) {
if (data.getLocation().contains("/")) {
String location[] = data.getLocation().split("/");
if (!data.getLocation().isEmpty()) {
if (location.length == 1) {
......@@ -186,7 +187,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
errorMessage.append("对应区域不存在;");
}
}
if(location.length==2){
if (location.length == 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
......@@ -203,9 +204,9 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisProvinceName)) {
query.eq(TMinSalary::getProvince,redisProvinceName );
query.eq(TMinSalary::getProvince, redisProvinceName);
}
if (Common.isNotNull(redisCityName) ){
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
}
......@@ -218,7 +219,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
}
}
}
if(location.length>2){
if (location.length > 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
......@@ -239,7 +240,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getProvince,redisCityName );
query.eq(TMinSalary::getProvince, redisCityName);
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
......@@ -257,7 +258,8 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
errorMessage.append("已存在对应区域在用的配置信息;");
}
}}
}
}
if (null != data.getSalaryBase()) {
if (!ValidityUtil.validateStandard(data.getSalaryBase())) {
data.setErrorFlag(true);
......@@ -271,12 +273,109 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
}
}
}
if (data.getLocation().contains("-")) {
String location[] = data.getLocation().split("-");
if (!data.getLocation().isEmpty()) {
if (location.length == 1) {
data.setErrorFlag(true);
errorMessage.append("所在地”请精确到市或县/区;");
}
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
}
if (location.length == 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisProvinceName)) {
query.eq(TMinSalary::getProvince, redisProvinceName);
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
}
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
}
}
}
if (location.length > 2) {
String redisProvinceName = getRedisAreaValue(location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisProvinceName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
String redisCityName = getRedisAreaValue(location[CommonConstants.ONE_INT] + "_" + location[CommonConstants.ZERO_INT]);
if (Common.isEmpty(redisCityName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
String redisTownName = getRedisAreaValue(location[CommonConstants.TWO_INT] + "_" + location[CommonConstants.ONE_INT]);
if (Common.isEmpty(redisTownName)) {
data.setErrorFlag(true);
errorMessage.append("对应区域不存在;");
}
TMinSalary entity = baseMapper.selectById(data.getId());
if (Common.isNotNull(entity)) {
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getProvince, redisCityName);
}
if (Common.isNotNull(redisCityName)) {
query.eq(TMinSalary::getCity, redisCityName);
}
if (Common.isNotNull(redisTownName)) {
query.eq(TMinSalary::getTown, redisTownName);
}
if (Common.isEmpty(location[2])) {
query.isNull(TMinSalary::getTown);
}
query.ne(TMinSalary::getId, data.getId());
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT) {
data.setErrorFlag(true);
errorMessage.append("已存在对应区域在用的配置信息;");
}
}
}
if (null != data.getSalaryBase()) {
if (!ValidityUtil.validateStandard(data.getSalaryBase())) {
data.setErrorFlag(true);
errorMessage.append("最低工资,请填写>0的两位小数;");
}
}
if (null!=data.getStatus()) {
if (!(CommonConstants.START.equals(data.getStatus()) || CommonConstants.STOP.equals(data.getStatus()))) {
data.setErrorFlag(true);
errorMessage.append("填写的状态不是启用或停用");
}
}
}
}
}
if (data.isErrorFlag()) {
data.setErrorMessage(errorMessage.toString());
......
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