Commit d4e16df3 by 邓实川

冲突解决

parents 27567a09 7f7bf226
This source diff could not be displayed because it is too large. You can view the blob instead.
package cn.timer.api.aspect;
import java.lang.reflect.Method;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.lang.Console;
import cn.timer.api.aspect.lang.annotation.BindingResultCtrol;
import cn.timer.api.aspect.lang.annotation.Role;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.utils.ResultUtil;
/**
* 角色权限 处理
*
* @author Tang
*/
@Aspect
@Component
public class RoleAspect {
// private static final Logger log = LoggerFactory.getLogger(RoleAspect.class);
@Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Resource
private HttpSession session;
// 配置织入点
@Pointcut("@annotation(cn.timer.api.aspect.lang.annotation.Role)")
public void RolePointCut() {
}
@Around("RolePointCut()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
Object retVal;
// 获得注解
Role role = getAnnotationLog(joinPoint);
String httpMethodName = role.httpMethod().name();
List<Integer> sysRoleType = ListUtil.toList();
for (SysRoleType t : role.sysRoleType()) {
sysRoleType.add(t.getType());
}
QyzxEmpLogin eld = BeanUtil.toBean(session.getAttribute("ui"), QyzxEmpLogin.class);
Integer orgCode = eld.getOrgId();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, eld.getId())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, sysRoleType)
.count();
if (count <= 0) {
switch (httpMethodName) {
case "POST":
retVal = ResultUtil.error("无权限操作");
break;
case "PUT":
retVal = ResultUtil.error("无权限编辑");
break;
case "GET":
retVal = ResultUtil.error("无权限查看");
break;
case "DELETE":
retVal = ResultUtil.error("无权限删除");
break;
default:
retVal = ResultUtil.error("无权限操作");
break;
}
return retVal;
}else {
return retVal = joinPoint.proceed(joinPoint.getArgs());
}
}
/**
* 是否存在注解,如果存在就获取
*/
private Role getAnnotationLog(JoinPoint joinPoint) {
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method != null) {
return method.getAnnotation(Role.class);
}
return null;
}
}
package cn.timer.api.aspect.lang.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import cn.timer.api.config.enums.HttpMethod;
import cn.timer.api.config.enums.SysRoleType;
/**
* 自定义 角色 注解
*
* @author Tang
*
*/
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Role {
/**
* 操作 类型
*/
public HttpMethod httpMethod() default HttpMethod.POST;
/**
* 角色类型
*/
public SysRoleType[] sysRoleType() default {SysRoleType.U_TYPE_ADMIN,SysRoleType.U_TYPE_C_ADMIN};
}
......@@ -19,7 +19,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-05-26
* @author Tang 2020-05-27
*/
@Data
......@@ -37,10 +37,12 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
private Integer id;
@ApiModelProperty(value = "绩效考核id 绩效考核id", example = "10")
private Integer performanceAppraisalId;
@ApiModelProperty(value = "员工id 员工id", example = "10")
private Integer empNum;
......@@ -48,8 +50,8 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
private String name;
@ApiModelProperty(value = "考核说明", example = "考核说明")
private String appraisalExplain;
private String appraisalExplain;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
private Date createTime;
......@@ -58,7 +60,46 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
@ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10")
private Date updateTime;
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "10")
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "0")
private Integer sts;
// 已归档绩效
@TableField(exist = false)
private Integer archivedPNum;
// 进行中绩效
@TableField(exist = false)
private Integer underwayPNum;
// 最近绩效方案
@TableField(exist = false)
private String recentlyProject;
// 最近绩效评分
@TableField(exist = false)
private Double recentlyScore;
// 最近绩效等级
@TableField(exist = false)
private String recentlyLevel;
@TableField(exist = false)
private String userName;
@TableField(exist = false)
private String phone;
@TableField(exist = false)
private String bmName;
@TableField(exist = false)
private Date rzTime;
@TableField(exist = false)
private String executorName;
@TableField(exist = false)
private Double comprehensiveScore;
@TableField(exist = false)
private String level;
@TableField(exist = false)
private String confirmor;
}
\ No newline at end of file
......@@ -4,6 +4,8 @@ import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -11,6 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -37,10 +40,10 @@ public class JxglAppraisalAssessment extends Model<JxglAppraisalAssessment> {
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
private Integer id;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id 考核id", example = "10")
private Integer appraisalId;
......@@ -50,6 +53,7 @@ public class JxglAppraisalAssessment extends Model<JxglAppraisalAssessment> {
@ApiModelProperty(value = "评定人名称", example = "评定人名称")
private String assessorName;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "综合评分", example = "综合评分")
private String comprehensiveScore;
......@@ -63,6 +67,7 @@ public class JxglAppraisalAssessment extends Model<JxglAppraisalAssessment> {
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
private Date createTime;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "等级", example = "等级")
private String level;
......
package cn.timer.api.bean.jxgl;
import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
......@@ -66,5 +67,10 @@ public class JxglAppraisalIndicators extends Model<JxglAppraisalIndicators> {
@ApiModelProperty(value = "类型 0 非固定 1 固定", example = "0")
private Integer type;
@TableField(exist = false)
private List<JxglAppraisalIndicatorsAssessment> appraisalIndicatorsAssessments;
@TableField(exist = false)
private List<JxglAppraisalItem> appraisalItems;
}
\ No newline at end of file
package cn.timer.api.bean.jxgl;
import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -65,6 +67,10 @@ public class JxglAppraisalIndicatorsT extends Model<JxglAppraisalIndicatorsT> {
private Date updateTime;
@ApiModelProperty(value = "类型", example = "0 非固定 1 固定")
private String type;
private Integer type;
@TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核项模板", example = "")
private List<JxglAppraisalItemT> appraisalItemTs;
}
\ No newline at end of file
......@@ -34,10 +34,10 @@ public class JxglAppraisalItemT extends Model<JxglAppraisalItemT> {
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
@ApiModelProperty(value = "编号", example = "10")
private Integer id;
@ApiModelProperty(value = "考核指标id 考核指标id", example = "10")
@ApiModelProperty(value = "考核指标模板id", example = "10")
private Integer appraisalIndicatorsTId;
@ApiModelProperty(value = "标题", example = "标题")
......@@ -46,7 +46,7 @@ public class JxglAppraisalItemT extends Model<JxglAppraisalItemT> {
@ApiModelProperty(value = "内容", example = "内容")
private String content;
@ApiModelProperty(value = "排序 排序", example = "10")
@ApiModelProperty(value = "排序", example = "10")
private Integer ranks;
}
\ No newline at end of file
package cn.timer.api.bean.jxgl;
import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -57,5 +59,8 @@ public class JxglAppraisalT extends Model<JxglAppraisalT> {
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10")
private Date updateTime;
@TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核指标模板", example = "")
private List<JxglAppraisalIndicatorsT> appraisalIndicatorsTs;
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.Valid;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.config.validation.ValidList;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -54,5 +56,9 @@ public class JxglBasicSetting extends Model<JxglBasicSetting> {
@ApiModelProperty(value="更新时间 ",example="2020-10-10 10:10:10")
private Date updateTime;
@Valid
@TableField(exist = false) // 是否转换
@ApiModelProperty(value="绩效等级",example="1")
private ValidList<JxglPerformanceRating> performanceRatings;
}
\ No newline at end of file
package cn.timer.api.bean.jxgl;
import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -72,4 +75,33 @@ public class JxglPerformanceAppraisal extends Model<JxglPerformanceAppraisal> {
@ApiModelProperty(value="流程节点",example="")
private byte[] processNode;
@ApiModelProperty(value="被考核人员",example="")
private byte[] beingAppraisalPerson;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "创建时间")
private Date createTime;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "最近处理时间 ", example = "最近处理时间")
private Date updateTime;
@TableField(exist = false)
private Integer targetSeting;
@TableField(exist = false)
private Integer performanceScore;
@TableField(exist = false)
private Integer resultVerification;
@TableField(exist = false)
private Integer performanceArchive;
@TableField(exist = false)
private JxglAppraisal appraisal;
@TableField(exist = false)
private JxglAppraisalAssessment appraisalAssessment;
}
\ No newline at end of file
......@@ -35,26 +35,26 @@ public class JxglPerformanceRating extends Model<JxglPerformanceRating> {
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
@ApiModelProperty(value = "编号", example = "10")
private Integer id;
@ApiModelProperty(value = "绩效基础设置id 绩效基础设置id", example = "10")
@ApiModelProperty(value = "绩效基础设置id", example = "10")
private Integer basicSettingId;
@NotBlank(message = "等级名称不能为空")
@NotBlank(message = "等级名称 不能为空")
@ApiModelProperty(value = "等级名称", example = "等级名称")
private String name;
@NotNull(message = "区间最小分数不能为空")
@ApiModelProperty(value = "区间最小分数 区间最小分数", example = "10")
@NotNull(message = "区间最小分数 不能为空")
@ApiModelProperty(value = "区间最小分数", example = "10")
private Integer sectionMinScore;
@NotNull(message = "区间最大分数不能为空")
@ApiModelProperty(value = "区间最大分数 区间最大分数", example = "10")
@NotNull(message = "区间最大分数 不能为空")
@ApiModelProperty(value = "区间最大分数", example = "10")
private Integer sectionMaxScore;
@ApiModelProperty(value = "排序 排序", example = "10")
@NotNull(message = "排序 不能为空")
@ApiModelProperty(value = "排序", example = "10")
private Integer ranks;
}
\ No newline at end of file
......@@ -37,14 +37,13 @@ public class JxglProcessNode extends Model<JxglProcessNode> {
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
@ApiModelProperty(value = "编号", example = "10")
private Integer id;
@ApiModelProperty(value = "考核id 考核id", example = "10")
@ApiModelProperty(value = "考核id", example = "10")
private Integer appraisalId;
@ApiModelProperty(value = "执行人id(员工id) 执行人id(员工id)", example = "10")
@ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId;
@ApiModelProperty(value = "执行人名称", example = "执行人名称")
......@@ -62,7 +61,7 @@ public class JxglProcessNode extends Model<JxglProcessNode> {
@ApiModelProperty(value = "主管层级 0直属主管 1上上级主管", example = "10")
private Integer leaderTier;
@ApiModelProperty(value = "权重 权重", example = "10")
@ApiModelProperty(value = "权重", example = "10")
private Integer weight;
@ApiModelProperty(value = "状态 0未执行 1执行中 2 已执行", example = "10")
......
......@@ -19,4 +19,5 @@ public class UserAttendanceRel implements Serializable{
private Integer qyid;
private String empnum;
private String empname;
}
\ No newline at end of file
......@@ -114,10 +114,10 @@ public class KqglAssoBcsz extends Model<KqglAssoBcsz> {
private Integer isXiuxi;
@ApiModelProperty(value = "休息开始时间 休息开始时间", example = "101")
private Long startTime;
private String startTime;
@ApiModelProperty(value = "休息结束时间 休息结束时间", example = "101")
private Long endTime;
private String endTime;
@ApiModelProperty(value = "上下班次数(1/2/3 最大值为3)", example = "101")
private Integer sxbcs;
......
......@@ -64,6 +64,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
@ApiModelProperty(value = "假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)", example = "101")
private Integer leaveBalance;
@ApiModelProperty(value = "规则类型(1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假)", example = "101")
private Integer rulesType;
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.dto.login.QysDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -62,10 +63,6 @@ public class QyzxEmpLogin extends Model<QyzxEmpLogin> {
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value="注册时间 ",example="注册时间")
private Date regTime;
/*
* @ApiModelProperty(value="到期时间 ",example="到期时间") private Date endTime;
*/
@ApiModelProperty(value="头像地址 ",example="http://asd")
private String headUrl;
......@@ -86,4 +83,6 @@ public class QyzxEmpLogin extends Model<QyzxEmpLogin> {
@Builder.Default
private List<QysDto> qys = new ArrayList<QysDto>();
@TableField(exist = false)
private YgglMainEmp ygglMainEmp;
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import java.io.Serializable;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.config.swagger.IgnoreSwaggerParameter;
import cn.timer.api.dto.yggl.UserInfo;
import lombok.*;
@Data
......@@ -28,5 +29,9 @@ public class UserBean implements Serializable {
@IgnoreSwaggerParameter
private String refreshToken;
@IgnoreSwaggerParameter
private UserInfo userInfo;
}
package cn.timer.api.config.enuminterface;
import lombok.Getter;
public interface JxglEnumInterface {
/**
* 考核指标 类型 0员工 1部门
*/
@Getter
enum BeingAppraisalType implements JxglEnumInterface {
EMPLOYEE(0, "员工 "), DEPARTMENT(1, "部门");
private Integer type;
private String name;
BeingAppraisalType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 考核指标 状态 0被考核人 1无需被考核人
*/
@Getter
enum BeingAppraisalSts implements JxglEnumInterface {
NEED(0, "被考核人"), NOT_NEED(1, "无需被考核人");
private Integer type;
private String name;
BeingAppraisalSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 考核指标 类型 0 非固定 1 固定
*/
@Getter
enum IndicatorsType implements JxglEnumInterface {
NOT_FIXATION(0, "非固定 "), FIXATION(1, "固定");
private Integer type;
private String name;
IndicatorsType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 是否可见 0是 1否。评分及评分结果能否被员工看见
*/
@Getter
enum IsVisible implements JxglEnumInterface {
TRUE(0, "是"), FALSE(1, "否");
private Integer type;
private String name;
IsVisible(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*绩效考核 状态 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核
*/
@Getter
enum PerformanceAppraisalSts implements JxglEnumInterface {
TARGET_SETING(0, "目标制定"), PERFORMANCE_SCORE(1, "绩效评分"), RESULT_VERIFICATION(2, "结果确认"), PERFORMANCE_ARCHIVE(3, "绩效归档"), TERMINATION_ASSESSMENT(4, "终止考核");
private Integer type;
private String name;
PerformanceAppraisalSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*考核 状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档
*/
@Getter
enum AppraisalSts implements JxglEnumInterface {
TARGET_FILL_IN(0, "目标填写"), TARGET_CONFIRMED(1, "目标确认"),
SELF_ASSESSMENT(2, "自评"), SUPERIOR_SCORE(3, "上级评分"),
RESULT_VERIFICATION(4, "结果确认"), ASSESSMENT_COMPLETE(5, "考核完成"),
TERMINATION_ASSESSMENT(6, "终止考核"), PERFORMANCE_ARCHIVE(7, "绩效归档");
private Integer type;
private String name;
AppraisalSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*执行人类型 0被考核人 1主管 2指定成员
*/
@Getter
enum ExecuteType implements JxglEnumInterface {
/**
* 0被考核人
*/
BEING_APPRAISAL_PERSON(0, "被考核人"),
/**
* 1主管
*/
LEADER(1, "主管"),
/**
* 2指定成员
*/
SPECIFIED_MEMBER(2, "指定成员");
private Integer type;
private String name;
ExecuteType(Integer type, String name) {
this.type = type;
this.name = name;
}
public static String getName(int index) {
ExecuteType[] executeTypes = ExecuteType.values();
String res = "";
if (executeTypes.length > index) {
res = executeTypes[index].getName();
}
return res;
}
}
/**
*流程类型 0目标填写 1目标确认 2自评 3上级评分 4 结果确认
*/
@Getter
enum ProcessType implements JxglEnumInterface {
TARGET_FILL_IN(0, "目标填写"), TARGET_CONFIRMED(1, "目标确认"), SELF_ASSESSMENT(2, "自评"), SUPERIOR_SCORE(3, "上级评分"), RESULT_VERIFICATION(4, "结果确认");
private Integer type;
private String name;
ProcessType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*主管层级 0直属主管 1上上级主管
*/
@Getter
enum LeaderTier implements JxglEnumInterface {
FIRST(0, "直属主管"), SECOND(1, "上上级主管");
private Integer type;
private String name;
LeaderTier(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 节点状态 0未执行 1执行中 2 已执行
*/
@Getter
enum ProcessNodeSts implements JxglEnumInterface {
NON_EXECUTION(0, "未执行"), IN_EXECUTION(1, "执行中"), EXECUTED(2, "已执行 ");
private Integer type;
private String name;
ProcessNodeSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 评定类型 0自评 1上级评价
*/
@Getter
enum AssessmentType implements JxglEnumInterface {
SELF_ASSESSMENT(0, "自评"), SUPERIOR_SCORE(1, "上级评价");
private Integer type;
private String name;
AssessmentType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*考核记录 类型 0发起考核 1目标填写 2目标确认 3目标驳回 4自评 5评分驳回 6上级评分 7结果确认 8修改评分 9 考核完成 10 终止考核 11绩效归档
*/
@Getter
enum AppraisalLogType implements JxglEnumInterface {
START(0, "发起考核"), TARGET_FILL_IN(1, "目标填写"),
TARGET_CONFIRMED(2, "目标确认"), TARGET_DISMISS(3, "目标驳回"),
SELF_ASSESSMENT(4, "自评"), SCORE_DISMISS(5, "评分驳回"),
SUPERIOR_SCORE(6, "上级评分"), RESULT_VERIFICATION(7, "结果确认"),
UPDATE_SCORE(8, "修改评分"), ASSESSMENT_COMPLETE(9, "考核完成"),
TERMINATION_ASSESSMENT(10, "终止考核"),PERFORMANCE_ARCHIVE(11, "绩效归档");
private Integer type;
private String name;
AppraisalLogType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
}
......@@ -11,22 +11,7 @@ import lombok.Getter;
@Getter
public enum CommonEnum {
NULL_STR(0,""),
/**
* 1 超管理员
*/
U_TYPE_ADMIN(0, "超管理员"),
/**
* 2 子管理
*/
U_TYPE_C_ADMIN(1, "子管理"),
/**
* 3 普通员工
*/
U_TYPE_EMP(2, "普通员工"),
/**
* 0 关闭
......@@ -74,10 +59,6 @@ public enum CommonEnum {
*/
DEPT_TYPE_OFF(1,"关闭"),
/**
* 审批组-其他
*/
SPZ_OTHER(999999,"其他")
;
private Integer type;
......
package cn.timer.api.config.enums;
import lombok.Getter;
/**
* 角色类型
* @author Administrator
*
*/
@Getter
public enum SysRoleType {
/**
* 0 超管理员
*/
U_TYPE_ADMIN(0, "超管理员"),
/**
* 1 子管理
*/
U_TYPE_C_ADMIN(1, "子管理"),
/**
* 2 普通员工
*/
U_TYPE_EMP(2, "普通员工");
private Integer type;
private String desc;
SysRoleType(Integer type, String desc) {
this.type = type;
this.desc = desc;
}
public Integer getType() {
return this.type;
}
}
......@@ -10,10 +10,13 @@ import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
import cn.hutool.core.bean.BeanUtil;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.controller.dzht.cn.tign.hz.constant.CacheKeyConstant;
import cn.timer.api.dto.yggl.UserInfo;
@Component
public class UserMethodArgumentResolver implements HandlerMethodArgumentResolver {
......@@ -38,19 +41,19 @@ public class UserMethodArgumentResolver implements HandlerMethodArgumentResolver
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
// String webRequestid = webRequest.getSessionId();
// String sessionid = session.getId();
QyzxEmpLogin eld = (QyzxEmpLogin) session.getAttribute("ui");
String token = (String) session.getAttribute(CacheKeyConstant.TOKEN);
String refreshToken = (String) session.getAttribute(CacheKeyConstant.REFRESH_TOKEN);
QyzxEmpLogin eld = BeanUtil.toBean(session.getAttribute("ui"), QyzxEmpLogin.class);
String token = BeanUtil.toBean(session.getAttribute(CacheKeyConstant.TOKEN), String.class);
String refreshToken = BeanUtil.toBean(session.getAttribute(CacheKeyConstant.REFRESH_TOKEN), String.class);
// Object phone = webRequest.getAttribute(currentUserAnnotation.id(),
// NativeWebRequest.SCOPE_SESSION);
Integer empNum = eld.getId();
Integer orgCode = eld.getOrgId();
// Integer empNum = (Integer) redisTemplate.get("empNum:"+sessionid);
// Integer orgCode = (Integer) redisTemplate.get("orgCode:"+sessionid);
UserBean userBean = UserBean.builder().token(token).refreshToken(refreshToken).empNum(empNum)
.orgCode(orgCode).qyzxEmpLogin(eld).build();
// log.info("webRequest:"+sessionid);
return userBean;
YgglMainEmp mE = eld.getYgglMainEmp();
UserInfo userInfo = UserInfo.builder().name(mE.getName()).phone(mE.getPhone()).bmgwId(mE.getBmgwId()).build();
return UserBean.builder().token(token).refreshToken(refreshToken).empNum(eld.getId())
.orgCode(eld.getOrgId()).userInfo(userInfo).qyzxEmpLogin(eld).build();
}
}
......@@ -21,10 +21,12 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.aspect.lang.annotation.Log;
......@@ -43,9 +45,11 @@ import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.enuminterface.YgEnumInterface.YgJobType;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.controller.spmk.service.SpmkServiceImpl;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.login.QysDto;
import cn.timer.api.dto.qyzx.EntRegisterDto;
......@@ -144,6 +148,9 @@ public class LoginController {
private ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private AliyunSMS aliyunSMS;
// @Autowired
......@@ -254,7 +261,8 @@ public class LoginController {
String phone = entRegisterDto.getPhone();
String code = entRegisterDto.getCode().toString();
// String codeRedis = (String) redisTemplate.get(phone);
String codeRedis = session.getAttribute(phone).toString();
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
if (code == null || !code.equals(codeRedis)) {
return ResultUtil.error("验证码不符");
}
......@@ -315,8 +323,8 @@ public class LoginController {
return ResultUtil.error("新密码与原密码相同,请修改后重试!");
}
} else {
Object codeRedis = session.getAttribute(phone);
if (!code.equals(codeRedis.toString())) {
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
if (!code.equals(codeRedis)) {
return ResultUtil.error("短信验证码错误");
}
if (Md5.md5(pw).equals(dbPwd)) {
......@@ -343,8 +351,7 @@ public class LoginController {
String code = entRegisterDto.getCode();
if (entRegisterDto.getPwUpdateType() != 2) {
// String codeRedis =redisTemplate.get(phone).toString();
String codeRedis = session.getAttribute(phone).toString();
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
if (code == null) {
return ResultUtil.error("请填写验证码");
}
......@@ -404,7 +411,7 @@ public class LoginController {
String phone = entRegisterDto.getPhone();
String code = entRegisterDto.getCode();
// String codeRedis = redisTemplate.get(phone).toString();
String codeRedis = (String) session.getAttribute(phone);
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
if (code == null || !code.toString().equals(codeRedis)) {
return ResultUtil.error("验证码不符/失效");
......@@ -457,7 +464,7 @@ public class LoginController {
if (login != null) {
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, login.getId())
.eq(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType()).count();
.eq(QyzxEmpEntAsso::getUserType, SysRoleType.U_TYPE_ADMIN.getType()).count();
if (count > max) {
return ResultUtil.error("已注册过企业");
......@@ -487,7 +494,7 @@ public class LoginController {
}
boolean b4 = YgglMainEmp.builder().orgCode(qyzxEntInfoM.getId()).empNum(login.getId()).rzTime(new Date())
.isManager(CommonEnum.U_TYPE_ADMIN.getType()).name(username).phone(phone)
.isManager(SysRoleType.U_TYPE_ADMIN.getType()).name(username).phone(phone)
.jobType(YgJobType.QUANZHI.getType()).jobStatus(YgEnumInterface.jobStatus.ZHENSHI.getType()).build()
.insert();
if (!b4) {
......@@ -497,7 +504,7 @@ public class LoginController {
// 员工企业关联表
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId())
.status(1).userType(CommonEnum.U_TYPE_ADMIN.getType()).build();
.status(1).userType(SysRoleType.U_TYPE_ADMIN.getType()).build();
boolean b3 = qyzxEmpEntAsso.insert();
if (!b3) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
......@@ -533,10 +540,9 @@ public class LoginController {
String code = entRegisterDto.getCode();
String phone = entRegisterDto.getPhone();
// Object codeRedis = redisTemplate.get(phone);
Integer codeRedis = (Integer) session.getAttribute(phone);
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
if (codeRedis == null || !code.equals(codeRedis.toString()))
if (codeRedis == null || !code.equals(codeRedis))
return ResultUtil.error("验证码不符");
QyzxEmpLogin qyzxEmpLogin1 = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
......@@ -555,10 +561,13 @@ public class LoginController {
} catch (Exception e) {
e.printStackTrace();
}
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId());
if (qys.size() == 0)
return ResultUtil.error("没有任何公司可以查看!");
qyzxEmpLogin1.setQys(qys);
QysDto ctrl = qys.get(0);
if (qyzxEmpLogin1.getOrgId() != null) {
......@@ -568,22 +577,24 @@ public class LoginController {
}
}
// Stream<QysDto> s = qys.stream()
// .filter(item -> item.getStatus() == 1 && qyzxEmpLogin1.getOrgId().equals(item.getId()));
//
// if (s != null) {
// ctrl = s.findFirst().get();
// }
}
YgglMainEmp userInfo = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.select(YgglMainEmp::getName,YgglMainEmp::getPhone,YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getEmpNum, qyzxEmpLogin1.getId())
.eq(YgglMainEmp::getOrgCode, qyzxEmpLogin1.getOrgId()));
if (userInfo == null) {
return ResultUtil.error("账号不存在");
}
qyzxEmpLogin1.setYgglMainEmp(userInfo);
if (ctrl.getStatus() == null || ctrl.getStatus().equals(0)) {
return ResultUtil.error("帐号被禁用");
}
qyzxEmpLogin1.setOrgId(ctrl.getId());
@SuppressWarnings("unused")
String phone = qyzxEmpLogin1.getPhone();
if (CommonEnum.U_TYPE_ADMIN.getType().equals(ctrl.getUserType())
|| CommonEnum.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) {
if (SysRoleType.U_TYPE_ADMIN.getType().equals(ctrl.getUserType())
|| SysRoleType.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) {
} else {
// 获取权限
ArrayList<Integer> list = new ArrayList<Integer>();
......@@ -607,9 +618,7 @@ public class LoginController {
// 需要更新最后一次登陆信息
// 用户信息缓存
session.setAttribute("ui", qyzxEmpLogin1);
// redisTemplate.set("loginUser:" + phone, session.getId());
// redisTemplate.set("empNum:" + session.getId(), qyzxEmpLogin1.getId());
// redisTemplate.set("orgCode:" + session.getId(), qyzxEmpLogin1.getOrgId());
return ResultUtil.data(qyzxEmpLogin1);
}
......
......@@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.kqgl.PunchCardDetails;
import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import cn.timer.api.bean.kqmk.KqglAssoDkmx;
......@@ -28,6 +29,7 @@ import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.dao.kqmk.KqglAssoDkmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dto.kqmk.AttLateLate;
......@@ -49,6 +51,10 @@ public class ClockInController {
@Autowired
private KqglMainKqzMapper kqglmainkqzmapper;
//打卡明细表
@Autowired
private KqglAssoDkmxMapper kqglassodkmxmapper;
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf2 = new SimpleDateFormat("EEE");
......@@ -90,7 +96,7 @@ public class ClockInController {
int dkmx = 0;
//查询打卡当天是否有记录
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.gt(KqglAssoDkmx::getDksj, startDate).lt(KqglAssoDkmx::getDksj, endDate));
.ge(KqglAssoDkmx::getDksj, startDate).le(KqglAssoDkmx::getDksj, endDate));
AttendanceCardListDto attdate = MethodCall(qyid,userid,putime);
ClockCollectData clockt = new ClockCollectData();
long starttime1 = 0,starttime1ks = 0,starttime1js = 0,endtime1 = 0,endtime1ks = 0,endtime1js = 0,starttime2 = 0,starttime2ks = 0,starttime2js = 0,endtime2 = 0,endtime2ks = 0,endtime2js = 0,starttime3 = 0,starttime3ks = 0,starttime3js = 0,
......@@ -182,21 +188,29 @@ public class ClockInController {
dkmx = pcd.getId();
}else { //*****修改
dkmx = dkmc.getId();
KqglAssoDkmx pcd = KqglAssoDkmx.builder().build();
if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() == null)){//下班1
int xbdk1jg = 0;
pcd.setId(dkmc.getId());
pcd.setXbdk1(time_);//下班1打卡时间
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){}else{xbdk1jg = Math.abs(Integer.valueOf(time.toString()));}//上班1打卡结果
if(time > 0){
pcd.setXbdk1jg(0);// 打卡结果
}else{
pcd.setXbdk1jg(Math.abs(Integer.valueOf(time.toString())));//上班1打卡结果
}
}
double gzsc = 0;
if(dkmc.getSbdk1() != null){
Long time = (time_ - dkmc.getSbdk1())/1000/60;
gzsc = Math.abs(Double.valueOf(time.toString()));//只打一次卡时计算工作时长
pcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长
}
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
KqglAssoDkmx.builder().id(dkmc.getId()).xbdk1(time_).xbdk1jg(xbdk1jg).gzsc(gzsc).build().updateById();
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() == null)){//上班2
int sbdk2jg = 0,yzcdsc = 0,yzcdcs = 0,kgcdcs = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
......@@ -207,26 +221,44 @@ public class ClockInController {
yzcdsc = sbdk2jg - yzcd;
}
if(sbdk2jg > kgcdfzs) {kgcdcs++;}
KqglAssoDkmx.builder().id(dkmc.getId()).sbdk2(time_).sbdk2jg(sbdk2jg).yzcdcs(yzcdcs).yzcdsc(Double.valueOf(yzcdsc)).kgcdfzs(kgcdcs).build().updateById();
pcd.setId(dkmc.getId());
pcd.setSbdk2(time_);//上班1打卡时间
pcd.setSbdk2jg(sbdk2jg);
pcd.setYzcdcs(yzcdcs);
pcd.setYzcdsc(Double.valueOf(yzcdsc));
pcd.setKgcdfzs(kgcdcs);
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() == null)){//下班2
int xbdk2jg = 0;
pcd.setId(dkmc.getId());
pcd.setXbdk2(time_);//下班1打卡时间
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){}else{xbdk2jg = Math.abs(Integer.valueOf(time.toString()));}
if(time > 0){
pcd.setXbdk2jg(0);// 打卡结果
}else{
pcd.setXbdk2jg(Math.abs(Integer.valueOf(time.toString())));
}
}
//班次为4次时,计算工作时长
double worktime = 0;
if(dkmc.getSbdk2() != null){
Long time = (time_ - dkmc.getSbdk2())/1000/60;
BigDecimal om = new BigDecimal(dkmc.getGzsc());
BigDecimal on = new BigDecimal(time);
worktime = Math.abs(om.add(on).doubleValue());
double worktime = Math.abs(om.add(on).doubleValue());
pcd.setGzsc(worktime);
}
KqglAssoDkmx.builder().id(dkmc.getId()).xbdk2(time_).xbdk2jg(xbdk2jg).gzsc(worktime).build().updateById();
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
&& (("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() == null)){//上班3
int sbdk3jg = 0,yzcdsc = 0,yzcdcs = 0,kgcdcs = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
......@@ -237,27 +269,44 @@ public class ClockInController {
yzcdsc = sbdk3jg - yzcd;
}
if(sbdk3jg > kgcdfzs) {kgcdcs++;}
KqglAssoDkmx.builder().id(dkmc.getId()).sbdk3(time_).sbdk3jg(sbdk3jg).yzcdcs(yzcdcs).yzcdsc(Double.valueOf(yzcdsc)).kgcdfzs(kgcdcs).build().updateById();
pcd.setId(dkmc.getId());
pcd.setSbdk3(time_);//上班1打卡时间
pcd.setSbdk3jg(sbdk3jg);
pcd.setYzcdcs(yzcdcs);
pcd.setYzcdsc(Double.valueOf(yzcdsc));
pcd.setKgcdfzs(kgcdcs);
kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
&& (!("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() != null) && (("").equals(dkmc.getXbdk3()) || dkmc.getXbdk3() == null)){//下班3
int xbdk3jg = 0;
pcd.setId(dkmc.getId());
pcd.setXbdk3(time_);//下班1打卡时间
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){}else{xbdk3jg = Math.abs(Integer.valueOf(time.toString()));}
if(time > 0){
pcd.setXbdk3jg(0);// 打卡结果
}else{
pcd.setXbdk3jg(Math.abs(Integer.valueOf(time.toString())));
}
}
//班次为6次时,计算工作时长
double worktime = 0;
if(dkmc.getSbdk3() != null){
Long time = (time_ - dkmc.getSbdk3())/1000/60;
BigDecimal om = new BigDecimal(dkmc.getGzsc());//第二次
BigDecimal on = new BigDecimal(time);
worktime = Math.abs(om.add(on).doubleValue());
double worktime = Math.abs(om.add(on).doubleValue());
pcd.setGzsc(worktime);
}
KqglAssoDkmx.builder().id(dkmc.getId()).xbdk3(time_).xbdk3jg(xbdk3jg).gzsc(worktime).build().updateById();
}
pcd.setId(dkmc.getId());
if(atttype <= 6){
KqglAssoDkmx.builder().id(dkmc.getId()).build().updateById();
int update = kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
}
}
......@@ -295,7 +344,8 @@ public class ClockInController {
}
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式
long attime;
if(punchcardtime == 0 && !isRange){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间)
// if(punchcardtime == 0 && !isRange){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间)
if(punchcardtime == 0){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间)
String remarks = "";
if(("1").equals(asVerifyMode)) {remarks = "考勤机指纹打卡";}else if(("20").equals(asVerifyMode)) {remarks = "考勤机人脸打卡";}else if(("40").equals(asVerifyMode)) {remarks = "考勤机掌纹打卡";}else if(("60").equals(asVerifyMode)) {remarks = "考勤机密码打卡";}
//cardtype--1:GPS,2:WIFI,3:考勤机
......
......@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.timer.api.bean.kqmk.AttendanceSocks;
public class AttendanceUtil {
// 默认cron 5秒一次
private static String cron = "0/5 * * * * ?";
// 默认cron 5秒一次 0/5 * * * * ?
private static String cron = "0 0 19 * * ?";//下午七点
// 数据库cron
public static String getCron(String tablename) {
......
......@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.controller.kqgl.ClockInTool;
......@@ -43,6 +44,7 @@ public class KqglServiceImpl implements KqglService {
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getEndtime())).build().insert();
}
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, leaveappr.getUserid()));
int modifynumber = 1;
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, leaveappr.getUserid())
.orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1"));
......@@ -69,6 +71,25 @@ public class KqglServiceImpl implements KqglService {
.overtimeTypeId(overappr.getOvertimetype()).compensateId(overappr.getCompensate()).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getStarttime()))
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getEndtime())).build().insert();
}
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, overappr.getUserid()));
//查询当前公司调休的id
KqglAssoLeaveRules learul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, emp.getOrgCode()).eq(KqglAssoLeaveRules::getRulesType, 2));
if(overappr.getCompensate() == 1) {
int modifynumber = 1;
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, overappr.getUserid())
.orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1"));
if(balan != null) {
modifynumber = balan.getModifyNumber()+1;
}
KqglAssoLeaveBalance.builder().leaveRulesId(learul.getId()).userid(overappr.getUserid()).modifyAction(2).balanceDays("+"+overappr.getDuration())
.reason("系统按照规则自动(加班)").modifyUserid(emp.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(emp.getOrgCode()).isAutomatic(1).modifyNumber(modifynumber).build().insert();//员工假期余额
}
return true;
}
......
......@@ -40,6 +40,7 @@ import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.qyzx.QyzxEntInfoMMapper;
......@@ -277,8 +278,8 @@ public class QyzxController {
return ResultUtil.data(menus, "你不是该企业的用户!");
}
if (CommonEnum.U_TYPE_ADMIN.getType().equals(ctrl.getUserType())
|| CommonEnum.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) {
if (SysRoleType.U_TYPE_ADMIN.getType().equals(ctrl.getUserType())
|| SysRoleType.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) {
} else {
// 获取权限
ArrayList<Integer> list = new ArrayList<Integer>();
......
......@@ -80,9 +80,11 @@ import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.enuminterface.YgEnumInterface.jobStatus;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.config.exception.Regular;
import cn.timer.api.config.validation.ValidList;
import cn.timer.api.dao.clazz.CommonAreaMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.yggl.YgMzDtoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
......@@ -124,6 +126,9 @@ public class YgglController {
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Autowired
private QyzxEmpLoginMapper qyzxEmpLoginMapper;
......@@ -272,7 +277,7 @@ public class YgglController {
if (ygglMainEmp == null) {
QyzxEmpEntAsso.builder()
.empNum(login.getId()).orgCode(orgCode).userType(CommonEnum.U_TYPE_EMP.getType()).status(CommonEnum.U_STS_ON.getType())
.empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType()).status(CommonEnum.U_STS_ON.getType())
.build()
.insert();
ygglMainEmp = YgglMainEmp.builder()
......@@ -449,7 +454,7 @@ public class YgglController {
}
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode)
.userType(CommonEnum.U_TYPE_EMP.getType()).status(CommonEnum.U_STS_ON.getType()).build().insert();// usertype2普通员工 status1正常
.userType(SysRoleType.U_TYPE_EMP.getType()).status(CommonEnum.U_STS_ON.getType()).build().insert();// usertype2普通员工 status1正常
yme = YgglMainEmp.builder()
.name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime)
......@@ -1298,13 +1303,20 @@ public class YgglController {
YgglMainLzb.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date())
.build().update(new UpdateWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getEmpNum, empNum));
LambdaQueryWrapper<QyzxEmpEntAsso> queryWrapper = new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getEmpNum, empNum);
// 确认离职 删除员工关联表
QyzxEmpEntAsso.builder().empNum(lzygQueryDto.getEmpNum()).build()
.delete(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getEmpNum, empNum));
qyzxEmpEntAssoMapper.delete(queryWrapper);
// 初始化 部门主管
zzglBmgwMMapper.update(ZzglBmgwM.builder().leader(null).build(),
new UpdateWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getLeader, empNum));
// 更新当前企业
List<QyzxEmpEntAsso> listEEA = qyzxEmpEntAssoMapper.selectList(queryWrapper);
if (listEEA != null && listEEA.size() > 0) {
QyzxEmpLogin.builder().id(empNum).orgId(CollUtil.getFirst(listEEA).getOrgCode()).build().updateById();
}
return ResultUtil.success("确认离职员工成功");
}
......
......@@ -8,4 +8,9 @@ public interface YgglService {
void applicationResignation(LzygQueryDto lzygQueryDto);
void applicationRegularization(YgzzDto ygzzDto);
/*
* 根据 员工ID 和 主管层级 查询 主管
*/
Integer selectLeaderEmpNumById(Integer orgCode, Integer id, Integer leave);
}
package cn.timer.api.controller.yggl.service;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.yggl.YgglMainLzb;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgzzDto;
@Service
public class YgglServiceImpl implements YgglService {
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private ZzglBmgwMMapper zzglBmgwMMapper;
@Override
public void applicationResignation(LzygQueryDto lzygQueryDto) {
// TODO Auto-generated method stub
......@@ -50,4 +65,50 @@ public class YgglServiceImpl implements YgglService {
.build().update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()));
}
@Override
public Integer selectLeaderEmpNumById(Integer orgCode, Integer id, Integer leave) {
// TODO Auto-generated method stub
YgglMainEmp mainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.select(YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getEmpNum, id));
Integer gWId = mainEmp != null ? mainEmp.getBmgwId() : null;
// 企业所有部门岗位
List<ZzglBmgwM> listBM = zzglBmgwMMapper.selectList(new QueryWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getOrgCode, orgCode));
// 岗位
ZzglBmgwM gW = CollUtil.getFirst(listBM.stream().filter(bM -> bM.getId().equals(gWId)).collect(Collectors.toList()));
// 岗位id
Integer baseBmgwId = gW != null ? gW.getUpId() : null;
// 部门列表
// List<ZzglBmgwM> listbM = ListUtil.toList();
// 指定 主管id
Integer leaderId = null;
for (int i = 0,n = leave; i < n; i++) {
ZzglBmgwM bmgwM = getLeaderEmp(listBM, baseBmgwId);
baseBmgwId = bmgwM != null ? bmgwM.getId() : null;
if (i == n-1) {
// listbM.add(bmgwM);
leaderId = baseBmgwId;
}
}
return leaderId;
}
private ZzglBmgwM getLeaderEmp(List<ZzglBmgwM> listBM, Integer baseBmgwId) {
ZzglBmgwM zzglBmgwM = baseBmgwId != null ?
CollUtil.getFirst(listBM.stream()
.filter(bM -> bM.getId().equals(baseBmgwId)).collect(Collectors.toList()))
: null;
return zzglBmgwM;
}
}
......@@ -2,6 +2,7 @@ package cn.timer.api.controller.zzgl.service;
import java.util.List;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
/**
......@@ -17,4 +18,6 @@ public interface ZzglBmgwMService {
List<Integer> selectMenuByPostId(Integer id);
public List<YgglMainEmp> selectOtherlistent(Integer orgCode, Integer id);
}
......@@ -9,6 +9,8 @@ import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
......@@ -101,4 +103,26 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService {
return menuList;
}
@Override
public List<YgglMainEmp> selectOtherlistent(Integer orgCode, Integer id){
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = ZzglBmgwM.builder().build().selectList(new QueryWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getOrgCode, orgCode));
list.add(id);
ZzglBmgwM.getDepts(list, id, zzglBmgwMs);
if (list == null || list.size() == 0) {
return null;
} else {
LambdaQueryWrapper<YgglMainEmp> ygglMainEmpsLambdaQueryWrapper = new LambdaQueryWrapper<>();
ygglMainEmpsLambdaQueryWrapper
.select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone,
YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).and(i -> i.in(YgglMainEmp::getBmgwId, list.toArray()));
List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper);
return ygglMainEmps;
}
}
}
package cn.timer.api.dao.jxgl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -12,6 +14,4 @@ import cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT;
@Repository
public interface JxglAppraisalIndicatorsTMapper extends BaseMapper<JxglAppraisalIndicatorsT> {
}
package cn.timer.api.dao.jxgl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -12,6 +14,8 @@ import cn.timer.api.bean.jxgl.JxglAppraisalItemT;
@Repository
public interface JxglAppraisalItemTMapper extends BaseMapper<JxglAppraisalItemT> {
int insertList(List<JxglAppraisalItemT> aItemTs);
}
package cn.timer.api.dao.jxgl;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.jxgl.JxglAppraisal;
import cn.timer.api.dto.jxgl.AppraisalDetail;
import cn.timer.api.dto.jxgl.AppraisalQuery;
import cn.timer.api.dto.jxgl.EmpPerformanceQuery;
/**
* 考核
......@@ -12,6 +17,10 @@ import cn.timer.api.bean.jxgl.JxglAppraisal;
@Repository
public interface JxglAppraisalMapper extends BaseMapper<JxglAppraisal> {
IPage<JxglAppraisal> selectListByQuery(IPage<JxglAppraisal> page,@Param("param") AppraisalQuery query);
AppraisalDetail selectDetailById(Integer orgCode, Integer id);
IPage<JxglAppraisal> selectListEmpByQuery(IPage<JxglAppraisal> page,@Param("param") EmpPerformanceQuery query);
}
......@@ -12,6 +12,8 @@ import cn.timer.api.bean.jxgl.JxglAppraisalT;
@Repository
public interface JxglAppraisalTMapper extends BaseMapper<JxglAppraisalT> {
JxglAppraisalT selectDetailById(Integer id);
}
......@@ -12,6 +12,8 @@ import cn.timer.api.bean.jxgl.JxglBasicSetting;
@Repository
public interface JxglBasicSettingMapper extends BaseMapper<JxglBasicSetting> {
JxglBasicSetting selectAll(Integer orgCode);
}
package cn.timer.api.dao.jxgl;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.dto.jxgl.EmpAppraisalQuery;
import cn.timer.api.dto.jxgl.PerformanceAppraisalQuery;
/**
* 绩效考核
......@@ -12,6 +19,13 @@ import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal;
@Repository
public interface JxglPerformanceAppraisalMapper extends BaseMapper<JxglPerformanceAppraisal> {
IPage<JxglPerformanceAppraisal> selectListByQuery(IPage<SpmkApproveSummary> page, @Param("param") PerformanceAppraisalQuery param);
IPage<JxglPerformanceAppraisal> selectListEmpByQuery(IPage<JxglPerformanceAppraisal> page,@Param("param") EmpAppraisalQuery query);
IPage<JxglPerformanceAppraisal> selectArchiveListByQuery(IPage<SpmkApproveSummary> page,@Param("param")
PerformanceAppraisalQuery query);
}
package cn.timer.api.dao.jxgl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -12,6 +14,6 @@ import cn.timer.api.bean.jxgl.JxglPerformanceRating;
@Repository
public interface JxglPerformanceRatingMapper extends BaseMapper<JxglPerformanceRating> {
int insertList(List<JxglPerformanceRating> list);
}
......@@ -2,8 +2,13 @@ package cn.timer.api.dao.kqgl;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.kqgl.AttendanceDetails;
import cn.timer.api.bean.kqgl.PunchRecord;
import cn.timer.api.dto.kqmk.OriginalRecordDto;
public interface PunchRecordMapper {
int deleteByPrimaryKey(Integer id);
......@@ -31,4 +36,8 @@ public interface PunchRecordMapper {
List<PunchRecord> getMaintenancePunchCardList(Long start,Long end,Integer userId);
List<PunchRecord> selFuzzyOriginalAttendance(AttendanceDetails attendancedetails);
IPage<PunchRecord> QueryOriginalRecord(IPage<PunchRecord> page,@Param("param") OriginalRecordDto originalrecorddto);
}
\ No newline at end of file
......@@ -16,4 +16,6 @@ import cn.timer.api.dto.kqmk.AttSubsidiaryDto;
public interface KqglAssoDkmxMapper extends BaseMapper<KqglAssoDkmx> {
AttSubsidiaryDto subsidiary(int userid, String data);
int updateByPrimaryKeySelective(KqglAssoDkmx kqglassodkmx);
}
......@@ -17,4 +17,6 @@ import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
public interface KqglAssoLeaveRulesMapper extends BaseMapper<KqglAssoLeaveRules> {
int insertleaverulesList(List<KqglAssoLeaveRules> kqglassoleaverules);
List<KqglAssoLeaveRules> selHeaderdata(int orgcode,int leavetype,int isopen);
}
......@@ -6,6 +6,7 @@ import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoRulesVice;
import cn.timer.api.dto.kqmk.KqglAssoRulesViceDto;
/**
......@@ -16,5 +17,7 @@ import cn.timer.api.bean.kqmk.KqglAssoRulesVice;
public interface KqglAssoRulesViceMapper extends BaseMapper<KqglAssoRulesVice> {
int insertrulesviceList(List<KqglAssoRulesVice> kqglassorulesvice);
List<KqglAssoRulesViceDto> leaveRulesIdload(int leaverulesid);
}
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import cn.timer.api.bean.jxgl.JxglAppraisalAssessment;
import cn.timer.api.bean.jxgl.JxglAppraisalIndicators;
import cn.timer.api.bean.jxgl.JxglAppraisalLog;
import cn.timer.api.bean.jxgl.JxglProcessNode;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppraisalDetail implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
private Integer id;
@ApiModelProperty(value = "绩效考核id 绩效考核id", example = "10")
private Integer performanceAppraisalId;
@ApiModelProperty(value = "员工id 员工id", example = "10")
private Integer empNum;
@ApiModelProperty(value = "名称", example = "名称")
private String name;
@ApiModelProperty(value = "考核说明", example = "考核说明")
private String appraisalExplain;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
private Date createTime;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10")
private Date updateTime;
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "0")
private Integer sts;
private List<JxglProcessNode> processNodes;
private List<JxglAppraisalAssessment> appraisalAssessments;
private List<JxglAppraisalLog> appraisalLogs;
private List<JxglAppraisalIndicators> appraisalIndicators;
}
package cn.timer.api.dto.jxgl;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppraisalQuery extends Page{
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "绩效考核id", example = "")
private Integer id;
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
@ApiModelProperty(value = "姓名、手机号", example = "")
private String query;
@Max(value = 4,message = ValidationMsg.MAX+" 只能为 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档")
@Min(value = 0,message = ValidationMsg.MIN+" 只能为 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档")
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档", example = "0")
private Integer sts;
@ApiModelProperty(value = "部门id", example = "")
private Integer bmId;
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.dto.spmk.User;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BeingAppraisalPerson implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "id", example = "10")
private Integer id;
/**
* 0员工 1部门
*/
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "类型 0员工 1部门", example = "0")
private Integer type;
/**
* 0被考核人 1无需考核人
*/
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "状态 0被考核人 1无需考核人", example = "0")
private Integer sts;
}
package cn.timer.api.dto.jxgl;
import java.util.Date;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import cn.timer.api.bean.jxgl.JxglPerformanceRating;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.config.validation.ValidList;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -18,26 +14,12 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BasicSettingDto {
public class EmpAppraisalQuery extends Page {
@ApiModelProperty(value="编号",example="10")
private Integer id;
@ApiModelProperty(value="企业id",example="10")
private Integer orgCode;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="最高分",example="100")
private Integer maxScore;
@ApiModelProperty(value="创建时间",example="2020-10-10 10:10:10")
private Date createTime;
@ApiModelProperty(value="更新时间",example="2020-10-10 10:10:10")
private Date updateTime;
@Valid
@ApiModelProperty(value="绩效等级",example="1")
private ValidList<JxglPerformanceRating> performanceRatings;
@ApiModelProperty(value = "员工id", example = "")
private Integer id;
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
}
package cn.timer.api.dto.jxgl;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmpPerformanceQuery extends Page {
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "绩效考核id", example = "")
private Integer id;
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
@ApiModelProperty(value = "姓名、手机号", example = "")
private String query;
@ApiModelProperty(value = "部门id", example = "")
private Integer bmId;
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.google.gson.JsonObject;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PerformanceAppraisal implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId (type = IdType.AUTO)
@ApiModelProperty(value="编号 编号",example="10")
private Integer id;
@ApiModelProperty(value="企业id 企业id",example="10")
private Integer orgCode;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="名称",example="名称")
private String name;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="周期 0月 1季 2年 3半年",example="10")
private Integer period;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="开始时间",example="2020-10-10 10:10:10")
private Date appraisalStartTime;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="结束时间",example="2020-10-10 10:10:10")
private Date appraisalEndTime;
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value="是否可见 0是 1否。评分及评分结果能否被员工看见",example="1")
private Integer isVisible;
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 4,message = ValidationMsg.MAX)
@ApiModelProperty(value="状态 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核",example="10")
private Integer sts;
@ApiModelProperty(value="范围",example="部门名称、被考核人名称")
private String scope;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="考核模板名称",example="考核模板名称")
private String appraisalTName;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="考核模板id",example="1")
private Integer appraisalTId;
@ApiModelProperty(value="考核人数 考核人数",example="10")
private Integer appraisalPersonNum;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="流程节点",example="")
private List<ProcessNode> processNode;
@Valid
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="被考核人员",example="")
private List<BeingAppraisalPerson> beingAppraisalPerson;
}
package cn.timer.api.dto.jxgl;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PerformanceAppraisalQuery extends Page{
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
@ApiModelProperty(value = "考核名称", example = "")
private String query;
@Max(value = 4,message = ValidationMsg.MAX+" 只能为 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核")
@Min(value = 0,message = ValidationMsg.MIN+" 只能为 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核")
@ApiModelProperty(value = "状态 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核", example = "0")
private Integer sts;
@ApiModelProperty(value = "开始时间 ", example = "2000-10-10 10:10:10")
private String startTime;
@ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10")
private String endTime;
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProcessNode implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId;
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 2,message = ValidationMsg.MAX)
@ApiModelProperty(value = "执行人类型 0被考核人 1主管 2指定成员", example = "10")
private Integer executeType;
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 4,message = ValidationMsg.MAX)
@ApiModelProperty(value = "类型 0目标填写 1目标确认 2自评 3上级评分 4 结果确认", example = "10")
private Integer processType;
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "主管层级 0直属主管 1上上级主管", example = "10")
private Integer leaderTier;
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 100,message = ValidationMsg.MAX)
@ApiModelProperty(value = "权重", example = "10")
private Integer weight;
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import cn.timer.api.bean.jxgl.JxglProcessNode;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProcessNodeUpdate implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "编号", example = "10")
private Integer id;
@ApiModelProperty(value = "考核id", example = "10")
private Integer appraisalId;
@ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId;
@ApiModelProperty(value = "执行人名称", example = "执行人名称")
private String executorName;
}
......@@ -44,6 +44,9 @@ public class KqglAssoLeaveRulesDto {
@ApiModelProperty(value = "假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)", example = "101")
private Integer leaveBalance;
@ApiModelProperty(value = "规则类型(1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假)", example = "101")
private Integer rulesType;
@ApiModelProperty(value = "适用范围集合", example = "101")
private String[] range;
......
package cn.timer.api.dto.kqmk;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class KqglAssoRulesViceDto {
@ApiModelProperty(value = "假期规则id 假期规则id", example = "101")
private Integer leaveRulesId;
}
package cn.timer.api.dto.kqmk;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ModifyEmployeeBalanceDto {
private Integer empnum;
private Integer leaverulesid;
}
package cn.timer.api.dto.kqmk;
import cn.timer.api.utils.Page;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OriginalRecordDto extends Page {
private Integer qyid;
private String start;
private String end;
private String text;
}
......@@ -20,6 +20,6 @@ public class VacationInformationDto {
KqglAssoLeaveRules rules;
@ApiModelProperty(value = "假期规则-适用范围 ", example = "字段说明")
List<KqglAssoRulesVice> range;
List<KqglAssoRulesViceDto> range;
}
package cn.timer.api.dto.yggl;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserInfo {
private String name;
private String phone;
private Integer bmgwId;
}
......@@ -7,10 +7,28 @@ import lombok.Data;
*
*/
@Data
public class Page {
//当前页
private Integer currentPage;
//当前页总条数
private Integer totalPage;
public Integer getCurrentPage() {
return currentPage == null || currentPage <= 0 ? 1 : currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
public Integer getTotalPage() {
return totalPage == null || totalPage <= 0 ? 10 : totalPage;
}
public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}
}
package cn.timer.api.utils;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
public class StreamUtils {
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Map<Object,Boolean> seen = new ConcurrentHashMap<>();
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
}
}
......@@ -148,8 +148,6 @@ public class RouterUtils {
List<YgglMainEmp> listYgglMainEmp = selectOtherlistent(Integer.parseInt(obj.get("orgCode",FromData.class).getValue().trim()), Integer.valueOf(listRelations.get(i).getDepartmentId().trim()));
System.out.println(listYgglMainEmp);
if (listYgglMainEmp != null && listYgglMainEmp.size() > 0) {
List<User> listUsers = new ArrayList<User>();
for (YgglMainEmp emp : listYgglMainEmp) {
......
......@@ -26,6 +26,17 @@
content JxglAppraisalItemT_content,
ranks JxglAppraisalItemT_ranks
</sql>
<insert id="insertList" useGeneratedKeys="true" keyColumn="id" parameterType="list">
INSERT INTO jxgl_appraisal_item_t
(appraisal_indicators_t_id,title,content,ranks)
values
<foreach item="item" index="index" collection="list" open="" separator="," close="">
(
#{item.appraisalIndicatorsTId},#{item.title},#{item.content},#{item.ranks}
)
</foreach>
</insert>
<!--
......
......@@ -11,6 +11,33 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<resultMap id="BaseResultMap_b" type="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT" >
<id column="id" property="id" />
<result column="appraisal_t_id" property="appraisalTId" />
<result column="title" property="title" />
<result column="weight" property="weight" />
<result column="is_edit" property="isEdit" />
<result column="is_set_weight" property="isSetWeight" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="type" property="type" />
<collection column="JxglAppraisalItemT_id" property="appraisalItemTs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalItemT"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalItemTMapper.BaseResultMap" columnPrefix="JxglAppraisalItemT_">
</collection>
</resultMap>
<resultMap id="BaseResultMap_All" type="cn.timer.api.bean.jxgl.JxglAppraisalT" >
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="name" property="name" />
<result column="appraisal_explain" property="appraisalExplain" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<collection column="JxglAppraisalIndicatorsT_id" property="appraisalIndicatorsTs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalTMapper.BaseResultMap_b" columnPrefix="JxglAppraisalIndicatorsT_">
</collection>
</resultMap>
<sql id="Base_Column_List">
id,
......@@ -29,6 +56,48 @@
create_time JxglAppraisalT_create_time,
update_time JxglAppraisalT_update_time
</sql>
<sql id="Base_Column_List_a">
a.id,
a.org_code,
a.name,
a.appraisal_explain,
a.create_time,
a.update_time
</sql>
<sql id="Base_Column_List_Alias_b">
b.id JxglAppraisalIndicatorsT_id,
b.appraisal_t_id JxglAppraisalIndicatorsT_appraisal_t_id,
b.title JxglAppraisalIndicatorsT_title,
b.weight JxglAppraisalIndicatorsT_weight,
b.is_edit JxglAppraisalIndicatorsT_is_edit,
b.is_set_weight JxglAppraisalIndicatorsT_is_set_weight,
b.create_time JxglAppraisalIndicatorsT_create_time,
b.update_time JxglAppraisalIndicatorsT_update_time,
b.type JxglAppraisalIndicatorsT_type
</sql>
<sql id="Base_Column_List_Alias_c">
c.id JxglAppraisalIndicatorsT_JxglAppraisalItemT_id,
c.appraisal_indicators_t_id JxglAppraisalIndicatorsT_JxglAppraisalItemT_appraisal_indicators_t_id,
c.title JxglAppraisalIndicatorsT_JxglAppraisalItemT_title,
c.content JxglAppraisalIndicatorsT_JxglAppraisalItemT_content,
c.ranks JxglAppraisalIndicatorsT_JxglAppraisalItemT_ranks
</sql>
<select id="selectDetailById" resultMap="BaseResultMap_All">
SELECT
<include refid="Base_Column_List_a" />,
<include refid="Base_Column_List_Alias_b" />,
<include refid="Base_Column_List_Alias_c" />
FROM jxgl_appraisal_t a
LEFT JOIN jxgl_appraisal_indicators_t b ON a.id = b.appraisal_t_id
LEFT JOIN jxgl_appraisal_item_t c ON b.id = c.appraisal_indicators_t_id
WHERE a.id = #{id}
</select>
<!--
......
......@@ -10,6 +10,17 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<resultMap id="BaseResultMap_All" type="cn.timer.api.bean.jxgl.JxglBasicSetting" >
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="max_score" property="maxScore" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<collection column="JxglPerformanceRating_id" property="performanceRatings" ofType="cn.timer.api.bean.jxgl.JxglPerformanceRating"
resultMap="cn.timer.api.dao.jxgl.JxglPerformanceRatingMapper.BaseResultMap" columnPrefix="JxglPerformanceRating_">
</collection>
</resultMap>
<sql id="Base_Column_List">
id,
......@@ -26,7 +37,33 @@
create_time JxglBasicSetting_create_time,
update_time JxglBasicSetting_update_time
</sql>
<sql id="Base_Column_List_a">
a.id,
a.org_code,
a.max_score,
a.create_time,
a.update_time
</sql>
<sql id="Base_Column_List_Alias_b">
b.id JxglPerformanceRating_id,
b.basic_setting_id JxglPerformanceRating_basic_setting_id,
b.name JxglPerformanceRating_name,
b.section_min_score JxglPerformanceRating_section_min_score,
b.section_max_score JxglPerformanceRating_section_max_score,
b.ranks JxglPerformanceRating_ranks
</sql>
<select id="selectAll" resultMap="BaseResultMap_All">
SELECT
<include refid="Base_Column_List_a" />,
<include refid="Base_Column_List_Alias_b" />
FROM jxgl_basic_setting a
LEFT JOIN jxgl_performance_rating b ON a.id = b.basic_setting_id
WHERE a.org_code = #{orgCode}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglBasicSetting">
......
......@@ -29,6 +29,17 @@
section_max_score JxglPerformanceRating_section_max_score,
ranks JxglPerformanceRating_ranks
</sql>
<insert id="insertList" useGeneratedKeys="true" keyColumn="id" parameterType="list">
INSERT INTO jxgl_performance_rating
(basic_setting_id,name,section_min_score,section_max_score,ranks)
values
<foreach item="item" index="index" collection="list" open="" separator="," close="">
(
#{item.basicSettingId},#{item.name},#{item.sectionMinScore},#{item.sectionMaxScore},#{item.ranks}
)
</foreach>
</insert>
<!--
......
......@@ -313,7 +313,7 @@
bmgw.post,
dkmx.*
from kqgl_asso_dkmx dkmx
LEFT JOIN yggl_main_emp as info on info.emp_num = dkmx.userid
LEFT JOIN yggl_main_emp as info on info.emp_num = dkmx.userid and info.org_code = #{qyid,jdbcType=INTEGER}
LEFT JOIN (select m.name as post,um.name as dept,m.id as mid
from zzgl_bmgw_m m
left join zzgl_bmgw_m um on um.id = m.up_id
......@@ -339,7 +339,7 @@
bmgw.post,
dkmx.*
from kqgl_asso_dkmx dkmx
LEFT JOIN yggl_main_emp as info on info.emp_num = dkmx.userid
LEFT JOIN yggl_main_emp as info on info.emp_num = dkmx.userid and info.org_code = #{qyid,jdbcType=INTEGER}
LEFT JOIN (select m.name as post,um.name as dept,m.id as mid
from zzgl_bmgw_m m
left join zzgl_bmgw_m um on um.id = m.up_id
......
......@@ -32,6 +32,32 @@
id, dktime, lon, lat, address, results, user_id, type, status, sort, card_type, macname,
mac, qyid, attdate, attime, dkmxid,bcid,remarks,punchmode,punchequipment
</sql>
<select id="QueryOriginalRecord" resultMap="BaseResultMap">
select dkjl.*,
bmgw.dept,
bmgw.post,
info.`name` username
from kqgl_asso_dkjl dkjl
LEFT JOIN yggl_main_emp as info on info.emp_num = dkjl.user_id and info.org_code = #{param.qyid}
LEFT JOIN (select m.name as post,um.name as dept,m.id as mid
from zzgl_bmgw_m m
left join zzgl_bmgw_m um on um.id = m.up_id
) as bmgw on bmgw.mid = info.bmgw_id
where dkjl.qyid = #{param.qyid}
<if test="param.start != ''" >
and dkjl.attime &gt;= #{param.start}
</if>
<if test="param.end != ''" >
and dkjl.attime &lt;= #{param.end}
</if>
<if test="param.text != null and param.text != ''" >
and (info.`name` like CONCAT('%',#{param.text},'%') or info.emp_num = #{param.text})
</if>
ORDER BY dkjl.id ASC
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
......@@ -282,7 +308,7 @@
bmgw.post,
info.`name` username
from kqgl_asso_dkjl dkjl
LEFT JOIN yggl_main_emp as info on info.emp_num = dkjl.user_id
LEFT JOIN yggl_main_emp as info on info.emp_num = dkjl.user_id and info.org_code = #{qyid,jdbcType=INTEGER}
LEFT JOIN (select m.name as post,um.name as dept,m.id as mid
from zzgl_bmgw_m m
left join zzgl_bmgw_m um on um.id = m.up_id
......@@ -297,7 +323,7 @@
bmgw.post,
info.`name` username
from kqgl_asso_dkjl dkjl
LEFT JOIN yggl_main_emp as info on info.emp_num = dkjl.user_id
LEFT JOIN yggl_main_emp as info on info.emp_num = dkjl.user_id and info.org_code = #{qyid,jdbcType=INTEGER}
LEFT JOIN (select m.name as post,um.name as dept,m.id as mid
from zzgl_bmgw_m m
left join zzgl_bmgw_m um on um.id = m.up_id
......
......@@ -8,6 +8,7 @@
<result column="qyid" property="qyid" jdbcType="INTEGER" />
<result column="empnum" property="empnum" jdbcType="VARCHAR" />
<result column="empname" property="empname" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, kqzid, userid, qyid
......@@ -107,7 +108,8 @@
<select id="selectAttendanceOfficerByKqzid" resultMap="BaseResultMap">
select yhkqz.*,
us.emp_num as empnum
us.emp_num as empnum,
us.name as empname
from kqgl_asso_yhkqz yhkqz
LEFT JOIN yggl_main_emp as us on us.emp_num = yhkqz.userid and us.org_code = #{orgcode}
where yhkqz.kqzid = #{kqzid,jdbcType=INTEGER}
......
......@@ -95,6 +95,34 @@
and SUBSTR(dk.`data`,1,7) = #{data}
GROUP BY dk.userid
</select>
<update id="updateByPrimaryKeySelective" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkmx">
UPDATE kqgl_asso_dkmx
<set>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != data'>data = #{data},</if>
<if test ='null != sbdk1'>sbdk1 = #{sbdk1},</if>
<if test ='null != sbdk1jg'>sbdk1jg = #{sbdk1jg},</if>
<if test ='null != xbdk1'>xbdk1 = #{xbdk1},</if>
<if test ='null != xbdk1jg'>xbdk1jg = #{xbdk1jg},</if>
<if test ='null != sbdk2'>sbdk2 = #{sbdk2},</if>
<if test ='null != sbdk2jg'>sbdk2jg = #{sbdk2jg},</if>
<if test ='null != xbdk2'>xbdk2 = #{xbdk2},</if>
<if test ='null != xbdk2jg'>xbdk2jg = #{xbdk2jg},</if>
<if test ='null != sbdk3'>sbdk3 = #{sbdk3},</if>
<if test ='null != sbdk3jg'>sbdk3jg = #{sbdk3jg},</if>
<if test ='null != xbdk3'>xbdk3 = #{xbdk3},</if>
<if test ='null != xbdk3jg'>xbdk3jg = #{xbdk3jg},</if>
<if test ='null != ydkcs'>ydkcs = #{ydkcs},</if>
<if test ='null != gzsc'>gzsc = #{gzsc},</if>
<if test ='null != qyid'>qyid = #{qyid},</if>
<if test ='null != dksj'>dksj = #{dksj},</if>
<if test ='null != yzcdcs'>yzcdcs = #{yzcdcs},</if>
<if test ='null != yzcdsc'>yzcdsc = #{yzcdsc},</if>
<if test ='null != kgcdfzs'>kgcdfzs = #{kgcdfzs}</if>
</set>
WHERE id = #{id}
</update>
<!--
......@@ -237,34 +265,6 @@
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkmx">
UPDATE kqgl_asso_dkmx
<set>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != data'>data = #{data},</if>
<if test ='null != sbdk1'>sbdk1 = #{sbdk1},</if>
<if test ='null != sbdk1jg'>sbdk1jg = #{sbdk1jg},</if>
<if test ='null != xbdk1'>xbdk1 = #{xbdk1},</if>
<if test ='null != xbdk1jg'>xbdk1jg = #{xbdk1jg},</if>
<if test ='null != sbdk2'>sbdk2 = #{sbdk2},</if>
<if test ='null != sbdk2jg'>sbdk2jg = #{sbdk2jg},</if>
<if test ='null != xbdk2'>xbdk2 = #{xbdk2},</if>
<if test ='null != xbdk2jg'>xbdk2jg = #{xbdk2jg},</if>
<if test ='null != sbdk3'>sbdk3 = #{sbdk3},</if>
<if test ='null != sbdk3jg'>sbdk3jg = #{sbdk3jg},</if>
<if test ='null != xbdk3'>xbdk3 = #{xbdk3},</if>
<if test ='null != xbdk3jg'>xbdk3jg = #{xbdk3jg},</if>
<if test ='null != ydkcs'>ydkcs = #{ydkcs},</if>
<if test ='null != gzsc'>gzsc = #{gzsc},</if>
<if test ='null != qyid'>qyid = #{qyid},</if>
<if test ='null != dksj'>dksj = #{dksj},</if>
<if test ='null != yzcdcs'>yzcdcs = #{yzcdcs},</if>
<if test ='null != yzcdsc'>yzcdsc = #{yzcdsc},</if>
<if test ='null != kgcdfzs'>kgcdfzs = #{kgcdfzs}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
......
......@@ -14,6 +14,7 @@
<result column="org_code" property="orgCode" />
<result column="is_open" property="isOpen" />
<result column="leave_balance" property="leaveBalance" />
<result column="rules_type" property="rulesType" />
</resultMap>
<sql id="Base_Column_List">
......@@ -26,7 +27,8 @@
create_userid,
org_code,
is_open,
leave_balance
leave_balance,
rules_type
</sql>
<sql id="Base_Column_List_Alias">
......@@ -41,9 +43,16 @@
is_open KqglAssoLeaveRules_is_open,
leave_balance KqglAssoLeaveRules_leave_balance
</sql>
<select id="selHeaderdata" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_leave_rules
WHERE org_code = #{orgcode}
AND (leave_type = #{leavetype} OR is_open = #{isopen})
</select>
<insert id="insertleaverulesList" parameterType="java.util.List" >
insert into kqgl_asso_leave_rules (name,company,leave_type,apply,create_time,create_userid,org_code,is_open,leave_balance)
insert into kqgl_asso_leave_rules (name,company,leave_type,apply,create_time,create_userid,org_code,is_open,leave_balance,rules_type)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.name != null" >
......@@ -71,7 +80,10 @@
#{item.isOpen,jdbcType=INTEGER},
</if>
<if test="item.leaveBalance != null" >
#{item.leaveBalance,jdbcType=INTEGER}
#{item.leaveBalance,jdbcType=INTEGER},
</if>
<if test="item.rulesType != null" >
#{item.rulesType,jdbcType=INTEGER}
</if>
)
</foreach>
......
......@@ -8,6 +8,10 @@
<result column="leave_rules_id" property="leaveRulesId" />
<result column="attgroup_id" property="attgroupId" />
</resultMap>
<resultMap id="RulesViceDtoMap" type="cn.timer.api.dto.kqmk.KqglAssoRulesViceDto" >
<result column="leave_rules_id" property="leaveRulesId" />
</resultMap>
<sql id="Base_Column_List">
id,
......@@ -34,6 +38,13 @@
)
</foreach>
</insert>
<select id="leaveRulesIdload" resultMap="RulesViceDtoMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_rules_vice
WHERE leaveRulesId = #{leaverulesid}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoRulesVice">
......
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