Commit acee334c authored by fangxinjiang's avatar fangxinjiang

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

parents e79eaa88 972909f7
package com.yifu.cloud.plus.v1.yifu.archives.vo; package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain; import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import lombok.Data; import lombok.Data;
...@@ -18,6 +19,8 @@ public class TSettleDomainListVo { ...@@ -18,6 +19,8 @@ public class TSettleDomainListVo {
private Map<String,TSettleDomain> mapVO; private Map<String,TSettleDomain> mapVO;
private List<TBusinessEmployeeExtendInfo> extendInfo;
/** /**
* 合同主体IDS * 合同主体IDS
*/ */
......
package com.yifu.cloud.plus.v1.yifu.archives.controller; package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TBusinessEmployeeExtendInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TBusinessEmployeeExtendInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO; import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmployeeExtendRedundancyDTO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import java.util.List;
import org.springframework.web.bind.annotation.RestController;
/** /**
...@@ -203,35 +206,38 @@ public class EmployeeBusinessController { ...@@ -203,35 +206,38 @@ public class EmployeeBusinessController {
// return this.businessEmployeeExtendInfoService.getNotLeaveExtendList(); // return this.businessEmployeeExtendInfoService.getNotLeaveExtendList();
// } // }
// //
// /** /**
// * 查询-列表:内部服务调用,获取所有员工拓展表信息 * 查询-列表:内部服务调用,获取所有员工拓展表信息
// * @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息 * @description: 查询-列表:内部服务调用,获取所有非离职员工拓展表信息
// * @return: R<List<TBusinessEmployeeExtendInfo>> * @return: R<List<TBusinessEmployeeExtendInfo>>
// * @author: wangweiguo * @author: wangweiguo
// * @date: 2021/8/25 * @date: 2021/8/25
// */ */
// @Inner @Inner
// @GetMapping("/inner/getAllExtendList") @PostMapping("/inner/getAllExtendList")
// public R<List<TBusinessEmployeeExtendInfo>> getAllExtendList() { public TSettleDomainListVo getAllExtendList() {
// List<TBusinessEmployeeExtendInfo> list = this.businessEmployeeExtendInfoService.list(); TSettleDomainListVo vo = new TSettleDomainListVo();
// return R.success(CommonConstants.SEARCH_SUCCESS, list); List<TBusinessEmployeeExtendInfo> list = this.businessEmployeeExtendInfoService.list();
// } vo.setExtendInfo(list);
// return vo;
// /** }
// * 查询-列表:内部服务调用,根据电工编号查询扩展表信息
// * @return: R<TBusinessEmployeeExtendInfo> /**
// * @author: wangweiguo * 查询-列表:内部服务调用,根据电工编号查询扩展表信息
// * @date: 2021/8/31 * @return: R<TBusinessEmployeeExtendInfo>
// */ * @author: wangweiguo
// @GetMapping("/inner/getExtendByBusinessTelecomNumber") * @date: 2021/8/31
// R<TBusinessEmployeeExtendInfo> getExtendByBusinessTelecomNumber(@RequestParam("businessTelecomNumber") String businessTelecomNumber) { */
// TBusinessEmployeeExtendInfo businessEmployeeExtendInfo = this.businessEmployeeExtendInfoService.lambdaQuery() @Inner
// .eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, businessTelecomNumber) @PostMapping("/inner/getExtendByBusinessTelecomNumber")
// .last(CommonConstants.SQL_LIMIT_ONE) R<TBusinessEmployeeExtendInfo> getExtendByBusinessTelecomNumber(@RequestParam("businessTelecomNumber") String businessTelecomNumber) {
// .one(); TBusinessEmployeeExtendInfo businessEmployeeExtendInfo = this.businessEmployeeExtendInfoService.lambdaQuery()
// return R.success(CommonConstants.SEARCH_SUCCESS, businessEmployeeExtendInfo); .eq(TBusinessEmployeeExtendInfo::getBusinessTelecomNumber, businessTelecomNumber)
// } .last(CommonConstants.LAST_ONE_SQL)
// .one();
return R.ok(businessEmployeeExtendInfo,CommonConstants.SEARCH_SUCCESS);
}
// /** // /**
// * @param // * @param
// * @Description: 获取所有附属信息 // * @Description: 获取所有附属信息
......
package com.yifu.cloud.plus.v1.business.dto.vacation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* @description: 新增假期
* @author: wangweiguo
* @date: 2021/8/13
*/
@Getter
@Setter
@ToString
public class AddOrSaveVacationRuleDTO implements Serializable {
/**
* 主键
*/
@Schema(description = "主键,更新时该值必传")
private Integer id;
/**
* 假期类型 1年假
*/
@NotBlank(message = "假期类型,不能为空")
@Schema(description = "假期类型 1年假")
private String type;
/**
* 是否自动发放假期时间 0否 1是
*/
@Schema(description = "是否自动发放假期时间 0否 1是")
@NotBlank(message = "是否自动发放假期时间,不能为空")
private String vacationAutoInit;
/**
* 假期初始化时间
*/
@Schema(description = "假期初始化时间")
@NotNull(message = "假期初始化时间,不能为空")
private LocalDate vacationInitDate;
/**
* 时间刻度 1按小时(和TIME_VALUE字段一起保证一天可以被不同单位数量的时间转换)
*/
@Schema(description = "时间刻度 1按小时(和TIME_VALUE字段一起保证一天可以被不同单位数量的时间转换)")
@NotBlank(message = "时间刻度,不能为空")
private String timeScale;
/**
* 以时间刻度为单位的时间值(和TIME_SCALE字段一起保证一天可以被不同单位数量的时间转换)
*/
@Schema(description = "以时间刻度为单位的时间值(和TIME_SCALE字段一起保证一天可以被不同单位数量的时间转换)")
@NotNull(message = "时间值,不能为空")
@Digits(integer = 5, fraction = 1, message = "整数不超过5位,小数不超过1位")
private BigDecimal timeValue;
}
package com.yifu.cloud.plus.v1.business.dto.vacation;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @description: 假勤信息表 新增或更新记录dto
* @author: wangweiguo
* @date: 2021-08-20
*/
@Setter
@Getter
@ToString
public class AddOrUpdateTVacationInfoDTO implements Serializable {
/**
* b端员工工号
*/
@Schema(description = "电信工号")
@NotBlank(message = "电信工号不能为空")
@Length(max = 20, message = "电信工号不能超过20字符")
private String businessTelecomNumber;
/**
* 人员姓名
*/
@Schema(description = "人员姓名")
@NotBlank(message = "人员姓名不能为空")
@Length(max = 32, message = "人员姓名不能超过32字符")
private String empName;
/**
* 身份证号码
*/
@Schema(description = "身份证号码")
@NotBlank(message = "身份证号码不能为空")
@Length(max = 32, message = "身份证号码不能超过32字符")
private String empIdcard;
/**
* 部门id
*/
@Schema(description = "部门id")
private Integer departId;
/**
* 部门名称
*/
@Schema(description = "部门名称")
private String departName;
/**
* b端岗位
*/
@Schema(description = "岗位")
@Length(max = 32, message = "岗位不能超过32字符")
private String businessPost;
/**
* 假勤类型(字典值)
*/
@Schema(description = "假勤类型(字典值)")
@NotBlank(message = "假勤类型不能为空")
private String vacationType;
/**
* 假勤开始时间
*/
@Schema(description = "假勤开始时间")
@NotNull(message = "假勤开始时间不能为空")
private LocalDateTime vacationStartTime;
/**
* 假勤结束时间
*/
@Schema(description = "假勤结束时间")
@NotNull(message = "假勤结束时间不能为空")
private LocalDateTime vacationEndTime;
/**
* 假勤时长
*/
@Schema(description = "假勤时长")
@NotNull(message = "假勤时长不能为空")
private BigDecimal vacationDuration;
/**
* 假勤事由
*/
@Schema(description = "假勤事由")
@Length(max = 200, message = "假勤事由不能超过200字符")
private String vacationReason;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
package com.yifu.cloud.plus.v1.business.dto.vacation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @description: 假期监控清零日志表 新增或更新记录dto
* @author: wangweiguo
* @date: 2021-08-16
*/
@Setter
@Getter
@ToString
public class AddVacationMonitorClearLogDTO implements Serializable {
/**
* 年假监控id
*/
@NotNull(message = "年假监控id不能为空")
@Schema(description = "年假监控id")
Integer vacationMonitorId;
/**
* 清零说明
*/
@Schema(description = "清零说明")
String clearNote;
}
package com.yifu.cloud.plus.v1.business.dto.vacation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @description: ChangeVacationStatusDTO
* @author: wangweiguo
* @date: 2021/8/24
*/
@Getter
@Setter
@ToString
public class ChangeVacationStatusDTO implements Serializable {
/**
* 主键
*/
@Schema(description = "主键")
@NotNull(message = "主键不能为空")
private String id;
/**
* 销假说明
*/
@Schema(description = "销假说明")
private String vacationNote;
/**
* 假勤实际结束时间
*/
@Schema(description = "假勤实际结束时间")
private LocalDateTime acturalVacationEndTime;
}
package com.yifu.cloud.plus.v1.business.dto.vacation;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* @description: ImportVacationInfoDTO
* @author: wangweiguo
* @date: 2021/8/24
*/
@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class ImportVacationInfoDTO implements Serializable {
/**
* 电信工号
*/
@NotBlank(message = "电信工号不能为空")
@Length(max = 20, message = "电信工号不能超过20个字符")
@Schema(description = "电信工号")
private String businessTelecomNumber;
/**
* 人员姓名
*/
@Length(max = 20, message = "姓名不能超过20个字符")
@Schema(description = "姓名")
private String empName;
/**
* 所属部门部门名称
*/
@Schema(description = "所属部门")
@Length(max = 32, message = "所属部门名称不能超过32个字符")
private String departName;
/**
* 假勤类型
*/
@Schema(description = "假勤类型")
@NotBlank(message = "假勤类型不能为空")
@Length(max = 32, message = "假勤类型不能超过32个字符")
private String vacationType;
/**
* 假勤事由
*/
@Schema(description = "假勤事由")
@Length(max = 200, message = "假勤事由不能超过200个字符")
private String vacationReason;
/**
* 假勤开始时间
*/
@Schema(description = "假勤开始时间")
@NotNull(message = "假勤开始时间不能为空")
private LocalDate vacationStartTime;
/**
* 假勤结束时间
*/
@Schema(description = "假勤结束时间")
@NotNull(message = "假勤结束时间不能为空")
private LocalDate vacationEndTime;
/**
* 假勤时长
*/
@Schema(description = "假勤时长")
@NotNull(message = "假勤时长不能为空")
@Digits(integer = 5, fraction = 1, message = "假勤时长整数部分不超过5位,小数部分不超过1位")
@DecimalMin(value = "0.0", message = "假勤时长不能为负数")
private BigDecimal vacationDuration;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
package com.yifu.cloud.plus.v1.business.dto.vacation;
import lombok.*;
import java.io.Serializable;
/**
* @description: UpdateVacationMonitorRedundancyDTO
* @author: wangweiguo
* @date: 2021/8/23
*/
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class UpdateVacationRedundancyDTO implements Serializable {
/**
* 身份证号
*/
private String empIdcard;
/**
* 姓名
*/
private String empName;
/**
* 电信工号
*/
private String businessTelecomNumber;
/**
* 岗位
*/
private String businessPost;
/**
* 部门id
*/
private Integer departId;
/**
* 标签
*/
private String label;
}
package com.yifu.cloud.plus.v1.business.query.vacation;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @description: 假勤信息表 分页查询query
* @author: wangweiguo
* @date: 2021-08-20
*/
@Setter
@Getter
@ToString
public class TVacationInfoQuery implements Serializable {
/**
* b端员工工号
*/
@Schema(description = "b端员工工号")
private String businessTelecomNumber;
/**
* 人员姓名
*/
@Schema(description = "人员姓名")
private String empName;
/**
* 身份证号码
*/
@Schema(description = "身份证号码")
private String empIdcard;
/**
* b端岗位
*/
@Schema(description = "岗位")
private String businessPost;
/**
* 部门id
*/
@Schema(description = "部门id")
private Integer departId;
/**
* 假勤类型(字典值)
*/
@Schema(description = "假勤类型(字典值)")
private String vacationType;
/**
* 假勤开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "假勤开始时间 yyyy-MM-dd HH:mm:ss")
private LocalDateTime vacationStartTime;
/**
* 假勤结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "假勤结束时间 yyyy-MM-dd HH:mm:ss")
private LocalDateTime vacationEndTime;
/**
* 假勤状态 0待休 1休假中 2到期待销假 3已销假
*/
@Schema(description = "假勤状态 0待休 1休假中 2到期待销假 3已销假")
private String vacationStatus;
/**
* 当前页码 默认为1
*/
@Schema(description = "当前页码 默认为1")
long current = 1;
/**
* 每页数量 默认为10
*/
@Schema(description = "每页数量 默认为10")
long size = 10;
/**
* 排序字段
*/
@Schema(description = "排序字段")
List<OrderItem> orders;
}
package com.yifu.cloud.plus.v1.business.query.vacation;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.List;
/**
* @description: 假期监控清零日志表 分页查询query
* @author: wangweiguo
* @date: 2021-08-16
*/
@Setter
@Getter
@ToString
public class TVacationMonitorClearLogQuery implements Serializable {
/**
* 当前页码 默认为1
*/
@Schema(description = "当前页码 默认为1")
long current = 1;
/**
* 每页数量 默认为10
*/
@Schema(description = "每页数量 默认为10")
long size = 10;
/**
* 排序字段
*/
@Schema(description = "排序字段")
List<OrderItem> orders;
}
package com.yifu.cloud.plus.v1.business.query.vacation;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.List;
/**
* @description: 假期监控表 分页查询query
* @author: wangweiguo
* @date: 2021-08-13
*/
@Setter
@Getter
@ToString
public class TVacationMonitorQuery implements Serializable {
/**
* 电信工号
*/
@Schema(description = "电信工号")
private String businessTelecomNumber;
/**
* 姓名
*/
@Schema(description = "姓名")
private String empName;
/**
* 身份证号码
*/
@Schema(description = "身份证号码")
private String empIdcard;
/**
* b端岗位
*/
@Schema(description = "岗位")
private String businessPost;
/**
* 部门id
*/
@Schema(description = "所属部门treeLogo")
private Integer departId;
/**
* 年份
*/
@Schema(description = "年份")
private String vacationYear;
/**
* 休假状态 0剩余未休 1已休
*/
@Schema(description = "休假状态 0剩余未休 1已休")
private String vacationStatus;
/**
* 当前页码 默认为1
*/
@Schema(description = "当前页码 默认为1")
long current = 1;
/**
* 每页数量 默认为10
*/
@Schema(description = "每页数量 默认为10")
long size = 10;
/**
* 排序字段
*/
@Schema(description = "排序字段")
List<OrderItem> orders;
}
package com.yifu.cloud.plus.v1.business.vo.vacation;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @description: 假勤信息表 分页查询展示 vo
* @author: wangweiguo
* @date: 2021-08-20
*/
@Setter
@Getter
@ToString
public class TVacationInfoVO implements Serializable {
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* b端员工工号
*/
@Schema(description = "电信工号")
private String businessTelecomNumber;
/**
* 人员姓名
*/
@Schema(description = "人员姓名")
private String empName;
/**
* 身份证号码
*/
@Schema(description = "身份证号码")
private String empIdcard;
/**
* 部门id
*/
@Schema(description = "部门id")
private Integer departId;
/**
* 部门名称
*/
@Schema(description = "部门名称")
private String departName;
/**
* 假勤状态
*/
@Schema(description = "假勤状态 0待休 1休假中 2到期待销假 3已销假")
private String vacationStatus;
/**
* b端岗位
*/
@Schema(description = "岗位")
private String businessPost;
/**
* 假勤类型(字典值)
*/
@Schema(description = "假勤类型(字典值)")
private String vacationType;
/**
* 假勤开始时间
*/
@Schema(description = "假勤开始时间")
private LocalDateTime vacationStartTime;
/**
* 假勤结束时间
*/
@Schema(description = "假勤结束时间")
private LocalDateTime vacationEndTime;
/**
* 假勤时长
*/
@Schema(description = "假勤时长")
private BigDecimal vacationDuration;
/**
* 假勤事由
*/
@Schema(description = "假勤事由")
private String vacationReason;
/**
* 假勤实际结束时间
*/
@Schema(description = "假勤实际结束时间")
private LocalDateTime acturalVacationEndTime;
/**
* 销假说明
*/
@Schema(description = "销假说明")
private String vacationNote;
/**
* 剩余年假时长
*/
@Schema(description = "剩余年假时长")
private BigDecimal vacationNotUsedDuration;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
package com.yifu.cloud.plus.v1.business.vo.vacation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @description: 假期监控清零日志表 分页查询展示 vo
* @author: wangweiguo
* @date: 2021-08-16
*/
@Setter
@Getter
@ToString
public class TVacationMonitorClearLogVO implements Serializable {
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 清零说明
*/
@Schema(description = "清零说明")
private String clearNote;
/**
* 清零时长
*/
@Schema(description = "清零时长")
private BigDecimal clearDuration;
/**
* 年份
*/
@Schema(description = "年份")
private String vacationYear;
/**
* 清零人姓名
*/
@Schema(description = "清零人姓名")
private String clearUser;
/**
* 清零时间
*/
@Schema(description = "清零时间")
private LocalDateTime clearTime;
private static final long serialVersionUID = 1L;
}
package com.yifu.cloud.plus.v1.business.vo.vacation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @description: 假期监控表 分页查询展示 vo
* @author: wangweiguo
* @date: 2021-08-13
*/
@Setter
@Getter
@ToString
public class TVacationMonitorVO implements Serializable {
/**
* 主键
*/
@Schema(description = "主键")
private Integer id;
/**
* 年份
*/
@Schema(description = "年份")
private String vacationYear;
/**
* 电信工号
*/
@Schema(description = "电信工号")
private String businessTelecomNumber;
/**
* 身份证号码
*/
@Schema(description = "身份证号")
private String empIdcard;
/**
* 姓名
*/
@Schema(description = "姓名")
private String empName;
/**
* 部门编码
*/
@Schema(description = "所属部门编码")
private String departCode;
/**
* 部门名称
*/
@Schema(description = "所属部门名称")
private String departName;
/**
* 部门id
*/
@Schema(description = "部门id")
private Integer departId;
/**
* b端岗位
*/
@Schema(description = "岗位")
private String businessPost;
/**
* 假期时长
*/
@Schema(description = "年假时长")
private BigDecimal vacationDuration;
/**
* 未使用假期时长
*/
@Schema(description = "未休时长")
private BigDecimal notUsedVacationDuration;
/**
* 入职时间
*/
@Schema(description = "入职时间")
private LocalDateTime businessEnjoinDate;
/**
* 在岗工龄
*/
@Schema(description = "在岗工龄")
private BigDecimal workingAge;
/**
* 休假状态 0未休完 1已休完
*/
@Schema(description = "休假状态 0未休完 1已休完")
private String vacationStatus;
private static final long serialVersionUID = 1L;
}
package com.yifu.cloud.plus.v1.business.vo.vacation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* @description: 假期配置规则VO
* @author: wangweiguo
* @date: 2021/8/13
*/
@Getter
@Setter
@ToString
public class VacationRuleConfigVO implements Serializable {
/**
* 主键
*/
@Schema(description = "主键")
private Integer id;
/**
* 假期类型 1年假
*/
@Schema(description = "假期类型 1年假")
private String type;
/**
* 是否自动发放假期时间 0否 1是
*/
@Schema(description = "是否自动发放假期时间 0否 1是")
private String vacationAutoInit;
/**
* 假期初始化时间
*/
@Schema(description = "假期初始化时间")
private LocalDate vacationInitDate;
/**
* 时间刻度 1按小时(和TIME_VALUE字段一起保证一天可以被不同单位数量的时间转换)
*/
@Schema(description = "时间刻度 1按小时(和TIME_VALUE字段一起保证一天可以被不同单位数量的时间转换")
private String timeScale;
/**
* 以时间刻度为单位的时间值(和TIME_SCALE字段一起保证一天可以被不同单位数量的时间转换)
*/
@Schema(description = "以时间刻度为单位的时间值(和TIME_SCALE字段一起保证一天可以被不同单位数量的时间转换)")
private BigDecimal timeValue;
}
package com.yifu.cloud.plus.v1.business.controller.vacation;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yifu.cloud.plus.v1.business.dto.vacation.AddOrUpdateTVacationInfoDTO;
import com.yifu.cloud.plus.v1.business.dto.vacation.ChangeVacationStatusDTO;
import com.yifu.cloud.plus.v1.business.dto.vacation.UpdateVacationRedundancyDTO;
import com.yifu.cloud.plus.v1.business.entity.vacation.TVacationInfo;
import com.yifu.cloud.plus.v1.business.query.vacation.TVacationInfoQuery;
import com.yifu.cloud.plus.v1.business.service.vacation.TVacationInfoService;
import com.yifu.cloud.plus.v1.business.vo.vacation.TVacationInfoVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.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.validation.Valid;
import java.util.List;
/**
* 假勤信息表 controller
* @author: wangweiguo
* @date: 2021-08-20
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/vacationInfo")
@Tag(name = "假勤信息表相关api")
public class TVacationInfoController {
private final TVacationInfoService tVacationInfoService;
/**
* 分页查询: 条件分页查询
* @param query 查询条件
* @return: R<IPage<TVacationInfoVO>>
* @author: wangweiguo
* @date: 2021-08-20
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/getListByPage")
public R<IPage<TVacationInfoVO>> getListByPage(TVacationInfoQuery query) {
return this.tVacationInfoService.getListByPage(query);
}
/**
* 导入: 通过json串格式导入假勤信息
* @param jsonStr json字符串数据
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/24
*/
@Operation(summary = "导入: 通过json串格式导入假勤信息", description = "导入: 通过json串格式导入假勤信息")
@PostMapping("/batchImportByJsonStr")
public R<List<ErrorMessage>> batchImportByJsonStr(@RequestBody String jsonStr) {
return this.tVacationInfoService.batchImportByJsonStr(jsonStr);
}
/**
* 查询:根据条件出列表
* @param query 查询条件
* @return: IPage<com.yifu.cloud.v1.hrobusiness.api.vo.vacation.TVacationInfoVO>>
* @author: wangweiguo
* @date: 2021/8/24
*/
@Operation(summary = "查询:根据条件出列表", description = "查询:根据条件出列表")
@GetMapping("/getList")
public R<List<TVacationInfoVO>> getList(TVacationInfoQuery query) {
return this.tVacationInfoService.getList(query);
}
/**
* 查询-详情:根据id查询数据
* @param id
* @return: R<TVacationInfoVO>
* @author: wangweiguo
* @date: 2021-08-24
*/
@Operation(summary = "查询-详情:根据id查询数据", description = "查询-详情:根据id查询数据")
@GetMapping("/{id}")
public R<TVacationInfoVO> getById(@PathVariable("id") String id) {
return this.tVacationInfoService.getDataById(id);
}
/**
* 添加:新增-单条-添加一条记录
* @param dto
* @return: R<TVacationInfo>
* @author: wangweiguo
* @date: 2021-08-24
*/
@Operation(summary = "添加:新增-单条-添加一条记录", description = "添加:新增-单条-添加一条记录")
@PostMapping
public R<TVacationInfo> save(@RequestBody @Valid AddOrUpdateTVacationInfoDTO dto) {
return this.tVacationInfoService.saveData(dto);
}
/**
* 销假:单条-根据id更新记录
* @param dto dto
* @return: R<Boolean>
* @author: wangweiguo
* @date: 2021-08-24
*/
@Operation(summary = "销假:单条-根据id更新", description = "销假:单条-根据id更新")
@PostMapping("/vacationEnd/{id}")
public R<Boolean> vacationEnd(@RequestBody @Valid ChangeVacationStatusDTO dto) {
return this.tVacationInfoService.vacationEnd(dto);
}
/**
* 删除-单条:根据id删除记录
* @param id
* @return: R<Boolean>
* @author: wangweiguo
* @date: 2021-08-20
*/
@Operation(summary = "根据id删除记录", description = "根据id删除记录")
@DeleteMapping("/{id}")
public R<Boolean> delById(@PathVariable("id") String id) {
return this.tVacationInfoService.removeDataById(id);
}
/**
* @author wangweiguo
* @description 更新假勤信息中的冗余信息
* @date 20:32 2021/8/24
* @param dtoList 更新冗余字段dto集合
* @return com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
**/
@Inner
@PostMapping("/inner/updateRedundancyEmployeeFields")
public R<Boolean> updateRedundancyEmployeeFields(@RequestBody List<UpdateVacationRedundancyDTO> dtoList) {
return this.tVacationInfoService.updateRedundancyEmployeeFields(dtoList);
}
}
package com.yifu.cloud.plus.v1.business.controller.vacation;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yifu.cloud.plus.v1.business.dto.vacation.UpdateVacationRedundancyDTO;
import com.yifu.cloud.plus.v1.business.query.vacation.TVacationMonitorQuery;
import com.yifu.cloud.plus.v1.business.service.vacation.TVacationMonitorService;
import com.yifu.cloud.plus.v1.business.vo.vacation.TVacationMonitorVO;
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.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
/**
* @description: 假期监控表 controller
* @author: wangweiguo
* @date: 2021-08-13
*/
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/vacationMonitor")
@Tag(name = "假期监控表相关api")
public class TVacationMonitorController {
private final TVacationMonitorService tVacationMonitorService;
/**
* @description: 分页查询: 条件分页查询
* @param query 查询条件
* @return: R<IPage<TVacationMonitorVO>>
* @author: wangweiguo
* @date: 2021-08-13
*/
@Operation(summary = "分页查询: 条件分页查询", description = "分页查询: 条件分页查询")
@GetMapping("/getListByPage")
public R<IPage<TVacationMonitorVO>> getListByPage(TVacationMonitorQuery query) {
return this.tVacationMonitorService.getListByPage(query);
}
/**
* @description: 导出:根据查询条件导出
* @param query 查询条件
* @return: R<List<TVacationMonitorVO>>
* @author: wangweiguo
* @date: 2021-08-13
*/
@Operation(summary = "导出:根据查询条件导出", description = "导出:根据查询条件导出")
@GetMapping("/exportByParams")
public R<List<TVacationMonitorVO>> exportByParams(TVacationMonitorQuery query) {
return this.tVacationMonitorService.exportByParams(query);
}
/**
* @description: 查询-剩余年假:根据身份证号查询剩余年假
* @param idcard
* @return: com.yifu.cloud.v1.common.core.util.R<java.math.BigDecimal>
* @author: wangweiguo
* @date: 2021/8/17
*/
@Operation(summary = "查询-剩余年假:根据身份证号查询剩余年假", description = "查询-剩余年假:根据身份证号查询剩余年假")
@GetMapping("getNotUsedVacationDurationByIdCard")
public R<BigDecimal> getNotUsedVacationDurationByIdCard(@RequestParam("idcard") String idcard) {
return this.tVacationMonitorService.getNotUsedVacationDurationByIdCard(idcard);
}
/**
* @description: 定时任务:内部服务调用,每天初始化员工年假信息
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/17
*/
@Inner
@PostMapping("/inner/buildMonitorDataForCurrentYear")
public R<Boolean> buildMonitorData() {
return this.tVacationMonitorService.buildMonitorData();
}
/**
* @description: 冗余更新:更新监控表中冗余的员工信息,电信工号和岗位
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/23
*/
@Inner
@PostMapping("/inner/updateRedundancyEmployeeFields")
public R<Boolean> updateRedundancyEmployeeFields(@RequestBody List<UpdateVacationRedundancyDTO> dtoList) {
return this.tVacationMonitorService.updateRedundancyEmployeeFields(dtoList);
}
}
package com.yifu.cloud.plus.v1.business.mapper.vacation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.vacation.TVacationInfo;
import com.yifu.cloud.plus.v1.business.query.vacation.TVacationInfoQuery;
import com.yifu.cloud.plus.v1.business.vo.vacation.TVacationInfoVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @description: 假勤信息表 mapper
* @Entity com.yifu.cloud.v1.hrobusiness.api.entity.vacation.TVacationInfo
* @author: wangweiguo
* @date: 2021-08-20
*/
public interface TVacationInfoMapper extends BaseMapper<TVacationInfo> {
/**
* @description: 分页查询: 条件分页查询
* @param query 查询条件
* @return: R<IPage<TVacationInfoVO>>
* @author: wangweiguo
* @date: 2021-08-20
*/
Page<TVacationInfoVO> getListByPage(Page<TVacationInfoVO> page, @Param("query") TVacationInfoQuery query);
/**
* @description: 列表查询查询: 条件列表查询
* @param query 查询条件
* @return: List<TVacationInfoVO>
* @author: wangweiguo
* @date: 2021-08-24
*/
List<TVacationInfoVO> getListByPage(@Param("query") TVacationInfoQuery query);
TVacationInfoVO getDataById(@Param("id") String id);
}
package com.yifu.cloud.plus.v1.business.mapper.vacation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.vacation.TVacationMonitor;
import com.yifu.cloud.plus.v1.business.query.vacation.TVacationMonitorQuery;
import com.yifu.cloud.plus.v1.business.vo.vacation.TVacationMonitorVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @description: 假期监控表 mapper
* @Entity generator.domain.TVacationMonitor
* @author: wangweiguo
* @date: 2021-08-13
*/
public interface TVacationMonitorMapper extends BaseMapper<TVacationMonitor> {
Page<TVacationMonitorVO> getListByPage(Page<TVacationMonitorVO> page, @Param("query") TVacationMonitorQuery query);
List<TVacationMonitorVO> getList(@Param("query")TVacationMonitorQuery query);
}
package com.yifu.cloud.plus.v1.business.service.vacation;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.business.dto.vacation.AddOrUpdateTVacationInfoDTO;
import com.yifu.cloud.plus.v1.business.dto.vacation.ChangeVacationStatusDTO;
import com.yifu.cloud.plus.v1.business.dto.vacation.UpdateVacationRedundancyDTO;
import com.yifu.cloud.plus.v1.business.entity.vacation.TVacationInfo;
import com.yifu.cloud.plus.v1.business.query.vacation.TVacationInfoQuery;
import com.yifu.cloud.plus.v1.business.vo.vacation.TVacationInfoVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
/**
* 假勤信息表 service层
* @author: wangweiguo
* @date: 2021-08-20
*/
public interface TVacationInfoService extends IService<TVacationInfo> {
/**
* 分页查询: 条件分页查询
* @param query 查询条件
* @return: R<IPage<TVacationInfoVO>>
* @author: wangweiguo
* @date: 2021-08-20
*/
R<IPage<TVacationInfoVO>> getListByPage(TVacationInfoQuery query);
/**
* 查询:根据条件出列表
* @param query 查询条件
* @return: IPage<com.yifu.cloud.v1.hrobusiness.api.vo.vacation.TVacationInfoVO>>
* @author: wangweiguo
* @date: 2021/8/24
*/
R<List<TVacationInfoVO>> getList(TVacationInfoQuery query);
/**
* 查询-详情:根据id查询数据
* @param id
* @return: R<TVacationInfoVO>
* @author: wangweiguo
* @date: 2021-08-24
*/
R<TVacationInfoVO> getDataById(String id);
/**
* 销假:单条-根据id更新记录
* @param dto dto
* @return: R<Boolean>
* @author: wangweiguo
* @date: 2021-08-24
*/
R<Boolean> vacationEnd(ChangeVacationStatusDTO dto);
/**
* 导入: 通过json串格式导入假勤信息
* @param jsonStr json字符串数据
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/24
*/
R<List<ErrorMessage>> batchImportByJsonStr(String jsonStr);
/**
* 删除-单条:根据id删除记录
* @param id
* @return: R<Boolean>
* @author: wangweiguo
* @date: 2021-08-20
*/
R<Boolean> removeDataById(String id);
/**
* 添加:新增-单条-添加一条记录
* @param dto
* @return: R<TVacationInfo>
* @author: wangweiguo
* @date: 2021-08-24
*/
R<TVacationInfo> saveData(AddOrUpdateTVacationInfoDTO dto);
/**
* @author wangweiguo
* @description 更新假勤信息中的冗余信息
* @date 20:32 2021/8/24
* @param dtoList 更新冗余字段dto集合
* @return com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
**/
R<Boolean> updateRedundancyEmployeeFields(List<UpdateVacationRedundancyDTO> dtoList);
}
package com.yifu.cloud.plus.v1.business.service.vacation;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.business.dto.vacation.UpdateVacationRedundancyDTO;
import com.yifu.cloud.plus.v1.business.entity.vacation.TVacationMonitor;
import com.yifu.cloud.plus.v1.business.query.vacation.TVacationMonitorQuery;
import com.yifu.cloud.plus.v1.business.vo.vacation.TVacationMonitorVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.math.BigDecimal;
import java.util.List;
/**
* @description: 假期监控表 service层
* @author: wangweiguo
* @date: 2021-08-13
*/
public interface TVacationMonitorService extends IService<TVacationMonitor> {
/**
* @description: 分页查询: 条件分页查询
* @param query 查询条件
* @return: R<IPage<TVacationMonitorVO>>
* @author: wangweiguo
* @date: 2021-08-13
*/
R<IPage<TVacationMonitorVO>> getListByPage(TVacationMonitorQuery query);
/**
* @description: 导出:根据查询条件导出
* @param query 查询条件
* @return: R<List<TVacationMonitorVO>>
* @author: wangweiguo
* @date: 2021-08-13
*/
R<List<TVacationMonitorVO>> exportByParams(TVacationMonitorQuery query);
/**
* @description: 保存或者更新监控记录
* @param entity
* @return: boolean
* @author: wangweiguo
* @date: 2021/8/16
*/
boolean saveOrUpdateData(TVacationMonitor entity);
/**
* @description: 批量保存 OR 新增
* @param list
* @return: boolean
* @author: wangweiguo
* @date: 2021/8/16
*/
boolean batchSaveOrUpdateData(List<TVacationMonitor> list);
/**
* @description: 查询:根据身份证号查询剩余年假
* @param idcard
* @return: com.yifu.cloud.v1.common.core.util.R<java.math.BigDecimal>
* @author: wangweiguo
* @date: 2021/8/17
*/
R<BigDecimal> getNotUsedVacationDurationByIdCard(String idcard);
/**
* @description: 定时任务:内部服务调用,每天初始化员工年假信息
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/17
*/
R<Boolean> buildMonitorData();
/**
* @description: 冗余更新:更新监控表中冗余的员工信息,电信工号和岗位
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/23
*/
R<Boolean> updateRedundancyEmployeeFields(List<UpdateVacationRedundancyDTO> dtoList);
/**
* @description: 释放假期时长
* @param empIdcard 身份证号
* @param vacationDuration 假期时长
* @param year 年份
* @return: boolean
* @author: wangweiguo
* @date: 2021/8/24
*/
boolean releaseVacationDuration(String empIdcard, BigDecimal vacationDuration, String year);
/**
* @description: 消耗假期时长
* @param empIdcard 身份证号
* @param vacationDuration 假期时长
* @param year 年份
* @return: boolean
* @author: wangweiguo
* @date: 2021/8/24
*/
boolean consumeVacationDuration(String empIdcard, BigDecimal vacationDuration, String year);
/**
* @description: 根据假勤年份和身份证号查询年假监控信息
* @param empIdcard 身份证号
* @param year 假勤年份
* @return: com.yifu.cloud.v1.hrobusiness.api.entity.vacation.TVacationMonitor
* @author: wangweiguo
* @date: 2021/8/24
*/
TVacationMonitor getMonitorByEmpIdcardAndYear(String empIdcard, String year);
}
...@@ -37,7 +37,7 @@ public class BusinessResultErrorMsg { ...@@ -37,7 +37,7 @@ public class BusinessResultErrorMsg {
public static final String DEPART_DATA_NOT_EXIST = "部门数据不存在"; public static final String DEPART_DATA_NOT_EXIST = "部门数据不存在";
public static final String VACATION_TYPE_NOT_EXIST = "假勤类型不存在"; public static final String SYS_ITEM_NOT_EXIST = "获取假勤类型字典值失败";
public static final String BUSINESS_TELECOM_NUMBER_NOT_EXIST = "电信工号不存在"; public static final String BUSINESS_TELECOM_NUMBER_NOT_EXIST = "电信工号不存在";
......
<?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.business.mapper.vacation.TVacationInfoMapper">
<resultMap id="TVacationInfoVO" type="com.yifu.cloud.plus.v1.business.vo.vacation.TVacationInfoVO">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="businessTelecomNumber" column="BUSINESS_TELECOM_NUMBER" jdbcType="VARCHAR"/>
<result property="empName" column="EMP_NAME" jdbcType="VARCHAR"/>
<result property="empIdcard" column="EMP_IDCARD" jdbcType="VARCHAR"/>
<result property="departId" column="DEPART_ID" jdbcType="INTEGER"/>
<result property="departName" column="DEPART_NAME" jdbcType="VARCHAR"/>
<result property="vacationStatus" column="VACATION_STATUS" jdbcType="CHAR"/>
<result property="businessPost" column="BUSINESS_POST" jdbcType="VARCHAR"/>
<result property="vacationType" column="VACATION_TYPE" jdbcType="VARCHAR"/>
<result property="vacationReason" column="VACATION_REASON" jdbcType="VARCHAR"/>
<result property="vacationNote" column="VACATION_NOTE" jdbcType="VARCHAR"/>
<result property="vacationStartTime" column="VACATION_START_TIME" jdbcType="TIMESTAMP"/>
<result property="vacationEndTime" column="VACATION_END_TIME" jdbcType="TIMESTAMP"/>
<result property="vacationDuration" column="VACATION_DURATION" jdbcType="DECIMAL"/>
<result property="vacationNotUsedDuration" column="VACATION_NOT_USED_DURATION" jdbcType="DECIMAL"/>
<result property="acturalVacationEndTime" column="ACTURAL_VACATION_END_TIME" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="GetListColumnList">
a.ID,
a.BUSINESS_TELECOM_NUMBER,
(case
when a.VACATION_STATUS <![CDATA[<>]]> '4' then '3'
when now() <![CDATA[<]]> a.VACATION_START_TIME then '0'
when now() <![CDATA[>=]]> a.VACATION_START_TIME and now() <![CDATA[<=]]> a.VACATION_END_TIME then '1'
when now() <![CDATA[>]]> a.VACATION_END_TIME then '2'
else ''
end
) as VACATION_STATUS,
a.EMP_NAME,
a.EMP_IDCARD,
a.DEPART_ID,
a.BUSINESS_POST,
a.VACATION_TYPE,
a.VACATION_START_TIME,
a.VACATION_END_TIME,
a.VACATION_DURATION,
a.VACATION_REASON,
a.VACATION_NOTE,
a.VACATION_NOT_USED_DURATION,
a.ACTURAL_VACATION_END_TIME,
b.NAME as DEPART_NAME
</sql>
<sql id="GetListWhere">
1=1
<if test="query.businessTelecomNumber != null and query.businessTelecomNumber.trim() != ''">
and a.BUSINESS_TELECOM_NUMBER like concat('%',#{query.businessTelecomNumber} ,'%')
</if>
<if test="query.empName != null and query.empName.trim() != ''">
and a.EMP_NAME like concat('%',#{query.empName} ,'%')
</if>
<if test="query.empIdcard != null and query.empIdcard.trim() != ''">
and a.EMP_IDCARD like concat('%',#{query.empIdcard} ,'%')
</if>
<if test="query.businessPost != null and query.businessPost.trim() != ''">
and a.BUSINESS_POST = #{query.businessPost}
</if>
<if test="query.departId != null and query.departId != 1">
AND (b.id = #{query.departId} or b.tree_logo like concat('%-', #{query.departId},'-%'))
</if>
<if test="query.vacationType != null and query.vacationType.trim() != ''">
and a.VACATION_TYPE = #{query.vacationType}
</if>
<if test="query.vacationStartTime != null and query.vacationEndTime != null">
and
(a.VACATION_START_TIME between #{query.vacationStartTime} and #{query.vacationEndTime}
or
a.VACATION_END_TIME between #{query.vacationStartTime} and #{query.vacationEndTime}
)
</if>
<if test="query.vacationStatus != null and query.vacationStatus.trim() != ''">
<!-- 待休 -->
<if test="query.vacationStatus == '0'.toString()">
and now() <![CDATA[<]]> a.VACATION_START_TIME
</if>
<!-- 休假中 -->
<if test="query.vacationStatus == '1'.toString()">
and now() <![CDATA[>=]]> a.VACATION_START_TIME and now() <![CDATA[<=]]> a.VACATION_END_TIME
</if>
<!-- 到期待销假 -->
<if test="query.vacationStatus == '2'.toString()">
and now() <![CDATA[>]]> a.VACATION_END_TIME and a.VACATION_STATUS = '4'
</if>
<!-- 已销假 -->
<if test="query.vacationStatus == '3'.toString()">
and a.VACATION_STATUS <![CDATA[<>]]> '4'
</if>
</if>
</sql>
<select id="getListByPage" resultMap="TVacationInfoVO">
select
<include refid="GetListColumnList"/>
from hr_business.t_vacation_info a
left join hr_business.t_bus_dept b
on a.DEPART_ID = b.id
<where>
<include refid="GetListWhere"/>
</where>
order by a.CREATE_TIME desc
</select>
<select id="getDataById" resultMap="TVacationInfoVO">
select
<include refid="GetListColumnList"/>
from hr_business.t_vacation_info a
left join hr_business.t_bus_dept b
on a.DEPART_ID = b.id
where a.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.business.mapper.vacation.TVacationMonitorMapper">
<resultMap id="Result_TVacationMonitorVO" type="com.yifu.cloud.plus.v1.business.vo.vacation.TVacationMonitorVO">
<result property="vacationYear" column="VACATION_YEAR" jdbcType="VARCHAR"/>
<result property="businessTelecomNumber" column="BUSINESS_TELECOM_NUMBER" jdbcType="VARCHAR"/>
<result property="empIdcard" column="EMP_IDCARD" jdbcType="VARCHAR"/>
<result property="empName" column="EMP_NAME" jdbcType="VARCHAR"/>
<result property="businessPost" column="BUSINESS_POST" jdbcType="VARCHAR"/>
<result property="vacationDuration" column="VACATION_DURATION" jdbcType="DECIMAL"/>
<result property="notUsedVacationDuration" column="NOT_USED_VACATION_DURATION" jdbcType="DECIMAL"/>
<result property="businessEnjoinDate" column="BUSINESS_ENJOIN_DATE" jdbcType="TIMESTAMP"/>
<result property="departCode" column="DEPART_CODE" jdbcType="VARCHAR"/>
<result property="departName" column="DEPART_NAME" jdbcType="VARCHAR"/>
<result property="departId" column="DEPART_ID" jdbcType="INTEGER"/>
</resultMap>
<sql id="Column_TVacationMonitorVO">
a.ID,
a.VACATION_YEAR,
a.BUSINESS_TELECOM_NUMBER,
a.EMP_IDCARD,
a.EMP_NAME,
b.name as DEPART_NAME,
b.id as DEPART_ID,
b.tree_logo as DEPART_CODE,
a.BUSINESS_POST,
a.VACATION_DURATION,
a.NOT_USED_VACATION_DURATION,
a.BUSINESS_ENJOIN_DATE,
a.VACATION_STATUS
</sql>
<sql id="Where_TVacationMonitorQuery">
1=1
<if test="query.businessTelecomNumber != null and query.businessTelecomNumber.trim() != ''">
and a.BUSINESS_TELECOM_NUMBER like concat('%', #{query.businessTelecomNumber}, '%')
</if>
<if test="query.empName != null and query.empName.trim() != ''">
and a.EMP_NAME like concat('%',#{query.empName}, '%')
</if>
<if test="query.empIdcard != null and query.empIdcard.trim() != ''">
and a.EMP_IDCARD like concat('%',#{query.empIdcard} , '%')
</if>
<if test="query.businessPost != null and query.businessPost.trim() != ''">
and a.BUSINESS_POST = #{query.businessPost}
</if>
<if test="query.departId != null and query.departId != 1">
AND (b.id = #{query.departId} or b.tree_logo like concat('%-', #{query.departId},'-%'))
</if>
<if test="query.vacationStatus != null and query.vacationStatus.trim() != ''">
and a.VACATION_STATUS = #{query.vacationStatus}
</if>
<if test="query.vacationYear != null and query.vacationYear.trim() != ''">
and a.VACATION_YEAR = #{query.vacationYear}
</if>
</sql>
<select id="getListByPage" resultMap="Result_TVacationMonitorVO">
select
<include refid="Column_TVacationMonitorVO"/>
from hr_business.t_vacation_monitor a
left join hr_business.t_bus_dept b on a.DEPART_ID = b.id
<where>
<include refid="Where_TVacationMonitorQuery"/>
</where>
order by a.VACATION_YEAR desc
</select>
<select id="getList" resultMap="Result_TVacationMonitorVO">
select
<include refid="Column_TVacationMonitorVO"/>
from hr_business.t_vacation_monitor a
left join hr_business.t_bus_dept b on a.DEPART_ID = b.id
<where>
<include refid="Where_TVacationMonitorQuery"/>
</where>
order by a.VACATION_YEAR desc
</select>
</mapper>
package com.yifu.cloud.plus.v1.yifu.common.core.util; package com.yifu.cloud.plus.v1.yifu.common.core.util;
import cn.hutool.core.collection.CollUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.*;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
...@@ -248,7 +253,28 @@ public class Common { ...@@ -248,7 +253,28 @@ public class Common {
return null; return null;
} }
} }
public static <T> HashMap<String, T> listToHashMapByKey(List<T> list, String filedKey) {
HashMap<String, T> hashMap = new HashMap<String,T>();
Object key = null;
String[] split = null;
if (null != list) {
if (filedKey.indexOf(CommonConstants.DOWN_LINE_CHAR) > CommonConstants.dingleDigitIntArray[0]) {
split = filedKey.split(CommonConstants.DOWN_LINE_STRING);
for (T t : list) {
key= null;
key = getFieldsValue(t, split, key);
hashMap.put(getStringValByObject(key), t);
}
} else {
for (T t : list) {
key= null;
key = getFieldValueByName(filedKey, t);
hashMap.put(getStringValByObject(key), t);
}
}
}
return hashMap;
}
public static <T> HashMap<String, T> listToHashMapByKey(List<T> list, String keyPreStr, String filedKey) { public static <T> HashMap<String, T> listToHashMapByKey(List<T> list, String keyPreStr, String filedKey) {
HashMap<String, T> hashMap = new HashMap<String,T>(); HashMap<String, T> hashMap = new HashMap<String,T>();
Object key = null; Object key = null;
...@@ -509,4 +535,121 @@ public class Common { ...@@ -509,4 +535,121 @@ public class Common {
} }
return false; return false;
} }
/**
* @description: 通过spring校验注解list中的数据格式, 后续补充剩余注解
* @param list 需要校验的list
* @return: java.util.List<com.yifu.cloud.v1.common.core.util.bean.ErrorMessage>
* @author: wangweiguo
* @date: 2021/8/24
*/
public static List<ErrorMessage> commonImportErrorMessage(List<?> list) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
if (!CollUtil.isEmpty(list)) {
int size = list.size();
for (int i = 0; i < size; i++) {
Object o = list.get(i);
Field[] fields = o.getClass().getDeclaredFields();
for (Field field : fields) {
Annotation[] declaredAnnotations = field.getDeclaredAnnotations();
if (declaredAnnotations.length == 0) {
continue;
}
try {
for (Annotation declaredAnnotation : declaredAnnotations) {
field.setAccessible(true);
Object val = field.get(o);
if (declaredAnnotation instanceof NotBlank) {
// @NotBlank
String s = (String) val;
if (StringUtils.isBlank(s)) {
errorMessageList.add(new ErrorMessage(i + 2, ((NotBlank) declaredAnnotation).message(), CommonConstants.RED));
break;
}
} else if (declaredAnnotation instanceof Length) {
// @Length
if (val instanceof String) {
String s = (String) val;
if (s.length() > ((Length) declaredAnnotation).max()) {
errorMessageList.add(new ErrorMessage(i + 2, ((Length) declaredAnnotation).message(), CommonConstants.RED));
break;
}
if (s.length() < ((Length) declaredAnnotation).min()) {
errorMessageList.add(new ErrorMessage(i + 2, ((Length) declaredAnnotation).message(), CommonConstants.RED));
break;
}
}
} else if (declaredAnnotation instanceof NotNull) {
// @NotNull
if (null == val) {
errorMessageList.add(new ErrorMessage(i + 2, ((NotNull) declaredAnnotation).message(), CommonConstants.RED));
break;
}
} else if(declaredAnnotation instanceof Size) {
// @Size
int curSize = 0;
if (val instanceof String) {
curSize = ((String) val).length();
}
if (val instanceof Collection) {
curSize = ((Collection<?>) val).size();
}
if (val instanceof Map) {
curSize = ((Map<?, ?>) val).size();
}
int min = ((Size) declaredAnnotation).min();
int max = ((Size) declaredAnnotation).max();
if (curSize > max) {
errorMessageList.add(new ErrorMessage(i + 2, ((Size) declaredAnnotation).message(), CommonConstants.RED));
break;
}
if (curSize < min) {
errorMessageList.add(new ErrorMessage(i + 2, ((Size) declaredAnnotation).message(), CommonConstants.RED));
break;
}
} else if (declaredAnnotation instanceof javax.validation.constraints.Pattern) {
// @Pattern
if (val instanceof String) {
if (!((String) val).matches(((javax.validation.constraints.Pattern) declaredAnnotation).regexp())) {
errorMessageList.add(new ErrorMessage(i + 2, ((javax.validation.constraints.Pattern) declaredAnnotation).message(), CommonConstants.RED));
break;
}
}
} else if (declaredAnnotation instanceof Digits) {
int maxIntegerLength = ((Digits) declaredAnnotation).integer();
int maxFractionLength = ((Digits) declaredAnnotation).fraction();
if (val instanceof BigDecimal) {
int integerPartLength = ((BigDecimal) val).precision() - ((BigDecimal) val).scale();
int fractionPartLength = Math.max(((BigDecimal) val).scale(), 0);
if (!( maxIntegerLength >= integerPartLength && maxFractionLength >= fractionPartLength )) {
errorMessageList.add(new ErrorMessage(i + 2, ((Digits) declaredAnnotation).message(), CommonConstants.RED));
break;
}
}
} else if (declaredAnnotation instanceof DecimalMin) {
BigDecimal minValue = BigDecimal.valueOf(Double.parseDouble(((DecimalMin) declaredAnnotation).value()));
if (val instanceof BigDecimal) {
if (minValue.compareTo((BigDecimal) val) >= 0) {
errorMessageList.add(new ErrorMessage(i + 2, ((DecimalMin) declaredAnnotation).message(), CommonConstants.RED));
break;
}
}
} else if (declaredAnnotation instanceof DecimalMax) {
BigDecimal maxValue = BigDecimal.valueOf(Double.parseDouble(((DecimalMax) declaredAnnotation).value()));
if (val instanceof BigDecimal) {
if (maxValue.compareTo((BigDecimal) val) <= 0) {
errorMessageList.add(new ErrorMessage(i + 2, ((DecimalMax) declaredAnnotation).message(), CommonConstants.RED));
break;
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return errorMessageList;
}
} }
...@@ -102,5 +102,26 @@ public class R<T> implements Serializable { ...@@ -102,5 +102,26 @@ public class R<T> implements Serializable {
apiResult.setMsg(msg); apiResult.setMsg(msg);
return apiResult; return apiResult;
} }
/**
* 返回成功状态
* @Author pwang
* @Date 2021-04-22 19:45
* @param
* @return
*@see
**/
public static boolean isSuccess(R r){
return r!=null && CommonConstants.SUCCESS == r.getCode();
}
/**
* 判断date是否有数据
* @Author pwang
* @Date 2021-04-22 19:45
* @param
* @return
*@see
**/
public static boolean haveData(R r){
return isSuccess(r) && null != r.getData();
}
} }
...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.common.dapr.util; ...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
...@@ -300,7 +301,7 @@ public class ArchivesDaprUtil { ...@@ -300,7 +301,7 @@ public class ArchivesDaprUtil {
} }
/** /**
* @Author fxj * @Author huyc
* @Description 校验手机号码重复 * @Description 校验手机号码重复
* @Date 22:11 2022/8/4 * @Date 22:11 2022/8/4
* @Param * @Param
...@@ -314,6 +315,36 @@ public class ArchivesDaprUtil { ...@@ -314,6 +315,36 @@ public class ArchivesDaprUtil {
return res; return res;
} }
/**
* @Author huyc
* @Description 获取所有员工拓展表信息
* @Date 22:11 2022/8/4
* @Param
* @return
**/
public R<TSettleDomainListVo> getAllExtendList() {
R<TSettleDomainListVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/customerBusiness/temployeeBusiness/inner/getAllExtendList" , "", TSettleDomainListVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("获取所有员工拓展表信息失败!");
}
return res;
}
/**
* @Author huyc
* @Description 获取所有员工拓展表信息
* @Date 22:11 2022/8/4
* @Param
* @return
**/
public R<TBusinessEmployeeExtendInfo> getExtendByBusinessTelecomNumber(String businessTelecomNumber) {
R<TBusinessEmployeeExtendInfo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/customerBusiness/temployeeBusiness/inner/getExtendByBusinessTelecomNumber" , businessTelecomNumber, TBusinessEmployeeExtendInfo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("根据电工编号查询扩展表信息失败!");
}
return res;
}
/** /**
* @Author fxj * @Author fxj
* @Description 更新项目档案和人员档案的社保公积金状态 * @Description 更新项目档案和人员档案的社保公积金状态
......
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