Commit e85cff9f by tangzhaoqian Committed by chenzg

登录缓存数据优化、员工绩效、历史归档、转派、终止考核

parent c6dff835
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};
}
...@@ -63,7 +63,25 @@ public class JxglAppraisal extends Model<JxglAppraisal> { ...@@ -63,7 +63,25 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "0") @ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "0")
private Integer sts; 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) @TableField(exist = false)
private String userName; private String userName;
...@@ -72,10 +90,16 @@ public class JxglAppraisal extends Model<JxglAppraisal> { ...@@ -72,10 +90,16 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
@TableField(exist = false) @TableField(exist = false)
private String bmName; private String bmName;
@TableField(exist = false) @TableField(exist = false)
private Date rzTime;
@TableField(exist = false)
private String executorName; private String executorName;
@TableField(exist = false) @TableField(exist = false)
private Double comprehensiveScore; private Double comprehensiveScore;
@TableField(exist = false) @TableField(exist = false)
private String level; private String level;
@TableField(exist = false)
private String confirmor;
} }
\ No newline at end of file
...@@ -4,6 +4,8 @@ import java.util.Date; ...@@ -4,6 +4,8 @@ import java.util.Date;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; 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.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
...@@ -11,6 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -11,6 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -37,10 +40,10 @@ public class JxglAppraisalAssessment extends Model<JxglAppraisalAssessment> { ...@@ -37,10 +40,10 @@ public class JxglAppraisalAssessment extends Model<JxglAppraisalAssessment> {
@Id @Id
@GeneratedValue @GeneratedValue
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10") @ApiModelProperty(value = "编号 编号", example = "10")
private Integer id; private Integer id;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id 考核id", example = "10") @ApiModelProperty(value = "考核id 考核id", example = "10")
private Integer appraisalId; private Integer appraisalId;
...@@ -50,6 +53,7 @@ public class JxglAppraisalAssessment extends Model<JxglAppraisalAssessment> { ...@@ -50,6 +53,7 @@ public class JxglAppraisalAssessment extends Model<JxglAppraisalAssessment> {
@ApiModelProperty(value = "评定人名称", example = "评定人名称") @ApiModelProperty(value = "评定人名称", example = "评定人名称")
private String assessorName; private String assessorName;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "综合评分", example = "综合评分") @ApiModelProperty(value = "综合评分", example = "综合评分")
private String comprehensiveScore; private String comprehensiveScore;
...@@ -63,6 +67,7 @@ public class JxglAppraisalAssessment extends Model<JxglAppraisalAssessment> { ...@@ -63,6 +67,7 @@ public class JxglAppraisalAssessment extends Model<JxglAppraisalAssessment> {
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10") @ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
private Date createTime; private Date createTime;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "等级", example = "等级") @ApiModelProperty(value = "等级", example = "等级")
private String level; private String level;
......
package cn.timer.api.bean.jxgl; package cn.timer.api.bean.jxgl;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
...@@ -97,4 +98,10 @@ public class JxglPerformanceAppraisal extends Model<JxglPerformanceAppraisal> { ...@@ -97,4 +98,10 @@ public class JxglPerformanceAppraisal extends Model<JxglPerformanceAppraisal> {
@TableField(exist = false) @TableField(exist = false)
private Integer performanceArchive; private Integer performanceArchive;
@TableField(exist = false)
private JxglAppraisal appraisal;
@TableField(exist = false)
private JxglAppraisalAssessment appraisalAssessment;
} }
\ No newline at end of file
...@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.dto.login.QysDto; import cn.timer.api.dto.login.QysDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -63,10 +64,6 @@ public class QyzxEmpLogin extends Model<QyzxEmpLogin> { ...@@ -63,10 +64,6 @@ public class QyzxEmpLogin extends Model<QyzxEmpLogin> {
@ApiModelProperty(value="注册时间 ",example="注册时间") @ApiModelProperty(value="注册时间 ",example="注册时间")
private Date regTime; private Date regTime;
/*
* @ApiModelProperty(value="到期时间 ",example="到期时间") private Date endTime;
*/
@ApiModelProperty(value="头像地址 ",example="http://asd") @ApiModelProperty(value="头像地址 ",example="http://asd")
private String headUrl; private String headUrl;
...@@ -86,4 +83,6 @@ public class QyzxEmpLogin extends Model<QyzxEmpLogin> { ...@@ -86,4 +83,6 @@ public class QyzxEmpLogin extends Model<QyzxEmpLogin> {
@Builder.Default @Builder.Default
private List<QysDto> qys = new ArrayList<QysDto>(); 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; ...@@ -4,6 +4,7 @@ import java.io.Serializable;
import cn.timer.api.bean.qyzx.QyzxEmpLogin; import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.config.swagger.IgnoreSwaggerParameter; import cn.timer.api.config.swagger.IgnoreSwaggerParameter;
import cn.timer.api.dto.yggl.UserInfo;
import lombok.*; import lombok.*;
@Data @Data
...@@ -29,4 +30,8 @@ public class UserBean implements Serializable { ...@@ -29,4 +30,8 @@ public class UserBean implements Serializable {
@IgnoreSwaggerParameter @IgnoreSwaggerParameter
private String refreshToken; private String refreshToken;
@IgnoreSwaggerParameter
private UserInfo userInfo;
} }
...@@ -11,22 +11,7 @@ import lombok.Getter; ...@@ -11,22 +11,7 @@ import lombok.Getter;
@Getter @Getter
public enum CommonEnum { public enum CommonEnum {
NULL_STR(0,""), NULL_STR(0,""),
/**
* 1 超管理员
*/
U_TYPE_ADMIN(0, "超管理员"),
/**
* 2 子管理
*/
U_TYPE_C_ADMIN(1, "子管理"),
/**
* 3 普通员工
*/
U_TYPE_EMP(2, "普通员工"),
/** /**
* 0 关闭 * 0 关闭
...@@ -74,10 +59,6 @@ public enum CommonEnum { ...@@ -74,10 +59,6 @@ public enum CommonEnum {
*/ */
DEPT_TYPE_OFF(1,"关闭"), DEPT_TYPE_OFF(1,"关闭"),
/**
* 审批组-其他
*/
SPZ_OTHER(999999,"其他")
; ;
private Integer type; 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; ...@@ -10,10 +10,13 @@ import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer; 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.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.controller.dzht.cn.tign.hz.constant.CacheKeyConstant; import cn.timer.api.controller.dzht.cn.tign.hz.constant.CacheKeyConstant;
import cn.timer.api.dto.yggl.UserInfo;
@Component @Component
public class UserMethodArgumentResolver implements HandlerMethodArgumentResolver { public class UserMethodArgumentResolver implements HandlerMethodArgumentResolver {
...@@ -38,19 +41,19 @@ public class UserMethodArgumentResolver implements HandlerMethodArgumentResolver ...@@ -38,19 +41,19 @@ public class UserMethodArgumentResolver implements HandlerMethodArgumentResolver
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
// String webRequestid = webRequest.getSessionId(); // String webRequestid = webRequest.getSessionId();
// String sessionid = session.getId(); // String sessionid = session.getId();
QyzxEmpLogin eld = (QyzxEmpLogin) session.getAttribute("ui");
String token = (String) session.getAttribute(CacheKeyConstant.TOKEN); QyzxEmpLogin eld = BeanUtil.toBean(session.getAttribute("ui"), QyzxEmpLogin.class);
String refreshToken = (String) session.getAttribute(CacheKeyConstant.REFRESH_TOKEN); 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(), // Object phone = webRequest.getAttribute(currentUserAnnotation.id(),
// NativeWebRequest.SCOPE_SESSION); // NativeWebRequest.SCOPE_SESSION);
Integer empNum = eld.getId();
Integer orgCode = eld.getOrgId(); YgglMainEmp mE = eld.getYgglMainEmp();
// Integer empNum = (Integer) redisTemplate.get("empNum:"+sessionid); UserInfo userInfo = UserInfo.builder().name(mE.getName()).phone(mE.getPhone()).bmgwId(mE.getBmgwId()).build();
// Integer orgCode = (Integer) redisTemplate.get("orgCode:"+sessionid);
UserBean userBean = UserBean.builder().token(token).refreshToken(refreshToken).empNum(empNum) return UserBean.builder().token(token).refreshToken(refreshToken).empNum(eld.getId())
.orgCode(orgCode).qyzxEmpLogin(eld).build(); .orgCode(eld.getOrgId()).userInfo(userInfo).qyzxEmpLogin(eld).build();
// log.info("webRequest:"+sessionid);
return userBean;
} }
} }
...@@ -21,10 +21,12 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -21,10 +21,12 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.timer.api.aspect.lang.annotation.Log; import cn.timer.api.aspect.lang.annotation.Log;
...@@ -43,9 +45,11 @@ import cn.timer.api.config.annotation.UserBean; ...@@ -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;
import cn.timer.api.config.enuminterface.YgEnumInterface.YgJobType; import cn.timer.api.config.enuminterface.YgEnumInterface.YgJobType;
import cn.timer.api.config.enums.CommonEnum; 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.controller.spmk.service.SpmkServiceImpl;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper; import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper; 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.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.login.QysDto; import cn.timer.api.dto.login.QysDto;
import cn.timer.api.dto.qyzx.EntRegisterDto; import cn.timer.api.dto.qyzx.EntRegisterDto;
...@@ -144,6 +148,9 @@ public class LoginController { ...@@ -144,6 +148,9 @@ public class LoginController {
private ZzglBmgwMMapper zzglBmgwMMapper; private ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired @Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private AliyunSMS aliyunSMS; private AliyunSMS aliyunSMS;
// @Autowired // @Autowired
...@@ -254,7 +261,8 @@ public class LoginController { ...@@ -254,7 +261,8 @@ public class LoginController {
String phone = entRegisterDto.getPhone(); String phone = entRegisterDto.getPhone();
String code = entRegisterDto.getCode().toString(); String code = entRegisterDto.getCode().toString();
// String codeRedis = (String) redisTemplate.get(phone); // 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)) { if (code == null || !code.equals(codeRedis)) {
return ResultUtil.error("验证码不符"); return ResultUtil.error("验证码不符");
} }
...@@ -315,8 +323,8 @@ public class LoginController { ...@@ -315,8 +323,8 @@ public class LoginController {
return ResultUtil.error("新密码与原密码相同,请修改后重试!"); return ResultUtil.error("新密码与原密码相同,请修改后重试!");
} }
} else { } else {
Object codeRedis = session.getAttribute(phone); String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
if (!code.equals(codeRedis.toString())) { if (!code.equals(codeRedis)) {
return ResultUtil.error("短信验证码错误"); return ResultUtil.error("短信验证码错误");
} }
if (Md5.md5(pw).equals(dbPwd)) { if (Md5.md5(pw).equals(dbPwd)) {
...@@ -343,8 +351,7 @@ public class LoginController { ...@@ -343,8 +351,7 @@ public class LoginController {
String code = entRegisterDto.getCode(); String code = entRegisterDto.getCode();
if (entRegisterDto.getPwUpdateType() != 2) { if (entRegisterDto.getPwUpdateType() != 2) {
// String codeRedis =redisTemplate.get(phone).toString(); String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
String codeRedis = session.getAttribute(phone).toString();
if (code == null) { if (code == null) {
return ResultUtil.error("请填写验证码"); return ResultUtil.error("请填写验证码");
} }
...@@ -404,7 +411,7 @@ public class LoginController { ...@@ -404,7 +411,7 @@ public class LoginController {
String phone = entRegisterDto.getPhone(); String phone = entRegisterDto.getPhone();
String code = entRegisterDto.getCode(); String code = entRegisterDto.getCode();
// String codeRedis = redisTemplate.get(phone).toString(); // 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)) { if (code == null || !code.toString().equals(codeRedis)) {
return ResultUtil.error("验证码不符/失效"); return ResultUtil.error("验证码不符/失效");
...@@ -457,7 +464,7 @@ public class LoginController { ...@@ -457,7 +464,7 @@ public class LoginController {
if (login != null) { if (login != null) {
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper) Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, login.getId()) .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) { if (count > max) {
return ResultUtil.error("已注册过企业"); return ResultUtil.error("已注册过企业");
...@@ -487,7 +494,7 @@ public class LoginController { ...@@ -487,7 +494,7 @@ public class LoginController {
} }
boolean b4 = YgglMainEmp.builder().orgCode(qyzxEntInfoM.getId()).empNum(login.getId()).rzTime(new Date()) 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() .jobType(YgJobType.QUANZHI.getType()).jobStatus(YgEnumInterface.jobStatus.ZHENSHI.getType()).build()
.insert(); .insert();
if (!b4) { if (!b4) {
...@@ -497,7 +504,7 @@ public class LoginController { ...@@ -497,7 +504,7 @@ public class LoginController {
// 员工企业关联表 // 员工企业关联表
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId()) 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(); boolean b3 = qyzxEmpEntAsso.insert();
if (!b3) { if (!b3) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
...@@ -533,10 +540,9 @@ public class LoginController { ...@@ -533,10 +540,9 @@ public class LoginController {
String code = entRegisterDto.getCode(); String code = entRegisterDto.getCode();
String phone = entRegisterDto.getPhone(); String phone = entRegisterDto.getPhone();
// Object codeRedis = redisTemplate.get(phone); String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
Integer codeRedis = (Integer) session.getAttribute(phone);
if (codeRedis == null || !code.equals(codeRedis.toString())) if (codeRedis == null || !code.equals(codeRedis))
return ResultUtil.error("验证码不符"); return ResultUtil.error("验证码不符");
QyzxEmpLogin qyzxEmpLogin1 = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper) QyzxEmpLogin qyzxEmpLogin1 = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
...@@ -555,10 +561,13 @@ public class LoginController { ...@@ -555,10 +561,13 @@ public class LoginController {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId()); List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId());
if (qys.size() == 0) if (qys.size() == 0)
return ResultUtil.error("没有任何公司可以查看!"); return ResultUtil.error("没有任何公司可以查看!");
qyzxEmpLogin1.setQys(qys); qyzxEmpLogin1.setQys(qys);
QysDto ctrl = qys.get(0); QysDto ctrl = qys.get(0);
if (qyzxEmpLogin1.getOrgId() != null) { if (qyzxEmpLogin1.getOrgId() != null) {
...@@ -568,22 +577,24 @@ public class LoginController { ...@@ -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)) { if (ctrl.getStatus() == null || ctrl.getStatus().equals(0)) {
return ResultUtil.error("帐号被禁用"); return ResultUtil.error("帐号被禁用");
} }
qyzxEmpLogin1.setOrgId(ctrl.getId()); qyzxEmpLogin1.setOrgId(ctrl.getId());
@SuppressWarnings("unused")
String phone = qyzxEmpLogin1.getPhone(); if (SysRoleType.U_TYPE_ADMIN.getType().equals(ctrl.getUserType())
if (CommonEnum.U_TYPE_ADMIN.getType().equals(ctrl.getUserType()) || SysRoleType.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) {
|| CommonEnum.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) {
} else { } else {
// 获取权限 // 获取权限
ArrayList<Integer> list = new ArrayList<Integer>(); ArrayList<Integer> list = new ArrayList<Integer>();
...@@ -607,9 +618,7 @@ public class LoginController { ...@@ -607,9 +618,7 @@ public class LoginController {
// 需要更新最后一次登陆信息 // 需要更新最后一次登陆信息
// 用户信息缓存 // 用户信息缓存
session.setAttribute("ui", qyzxEmpLogin1); 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); return ResultUtil.data(qyzxEmpLogin1);
} }
......
...@@ -40,6 +40,7 @@ import cn.timer.api.bean.zzgl.ZzglBmgwM; ...@@ -40,6 +40,7 @@ import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enums.CommonEnum; 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.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper; import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.qyzx.QyzxEntInfoMMapper; import cn.timer.api.dao.qyzx.QyzxEntInfoMMapper;
...@@ -277,8 +278,8 @@ public class QyzxController { ...@@ -277,8 +278,8 @@ public class QyzxController {
return ResultUtil.data(menus, "你不是该企业的用户!"); return ResultUtil.data(menus, "你不是该企业的用户!");
} }
if (CommonEnum.U_TYPE_ADMIN.getType().equals(ctrl.getUserType()) if (SysRoleType.U_TYPE_ADMIN.getType().equals(ctrl.getUserType())
|| CommonEnum.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) { || SysRoleType.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) {
} else { } else {
// 获取权限 // 获取权限
ArrayList<Integer> list = new ArrayList<Integer>(); ArrayList<Integer> list = new ArrayList<Integer>();
......
...@@ -80,9 +80,11 @@ import cn.timer.api.config.annotation.UserBean; ...@@ -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;
import cn.timer.api.config.enuminterface.YgEnumInterface.jobStatus; import cn.timer.api.config.enuminterface.YgEnumInterface.jobStatus;
import cn.timer.api.config.enums.CommonEnum; 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.exception.Regular;
import cn.timer.api.config.validation.ValidList; import cn.timer.api.config.validation.ValidList;
import cn.timer.api.dao.clazz.CommonAreaMapper; 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.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.yggl.YgMzDtoMapper; import cn.timer.api.dao.yggl.YgMzDtoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper; import cn.timer.api.dao.yggl.YgglMainEmpMapper;
...@@ -126,6 +128,9 @@ public class YgglController { ...@@ -126,6 +128,9 @@ public class YgglController {
private YgglMainEmpMapper ygglMainEmpMapper; private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired @Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Autowired
private QyzxEmpLoginMapper qyzxEmpLoginMapper; private QyzxEmpLoginMapper qyzxEmpLoginMapper;
@Autowired @Autowired
...@@ -272,7 +277,7 @@ public class YgglController { ...@@ -272,7 +277,7 @@ public class YgglController {
if (ygglMainEmp == null) { if (ygglMainEmp == null) {
QyzxEmpEntAsso.builder() 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() .build()
.insert(); .insert();
ygglMainEmp = YgglMainEmp.builder() ygglMainEmp = YgglMainEmp.builder()
...@@ -449,7 +454,7 @@ public class YgglController { ...@@ -449,7 +454,7 @@ public class YgglController {
} }
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode) 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() yme = YgglMainEmp.builder()
.name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType) .name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime) .jobStatus(YgEnumInterface.jobStatus.SHIYONG.getType()).rzTime(rzTime)
...@@ -1298,14 +1303,21 @@ public class YgglController { ...@@ -1298,14 +1303,21 @@ public class YgglController {
YgglMainLzb.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date()) YgglMainLzb.builder().empNum(empNum).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date())
.build().update(new UpdateWrapper<YgglMainLzb>().lambda().eq(YgglMainLzb::getEmpNum, empNum)); .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() qyzxEmpEntAssoMapper.delete(queryWrapper);
.delete(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getEmpNum, empNum));
// 初始化 部门主管 // 初始化 部门主管
zzglBmgwMMapper.update(ZzglBmgwM.builder().leader(null).build(), zzglBmgwMMapper.update(ZzglBmgwM.builder().leader(null).build(),
new UpdateWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getLeader, empNum)); 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("确认离职员工成功"); return ResultUtil.success("确认离职员工成功");
} }
......
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.jxgl.JxglAppraisal; import cn.timer.api.bean.jxgl.JxglAppraisal;
import cn.timer.api.dto.jxgl.AppraisalDetail; import cn.timer.api.dto.jxgl.AppraisalDetail;
import cn.timer.api.dto.jxgl.AppraisalQuery; import cn.timer.api.dto.jxgl.AppraisalQuery;
import cn.timer.api.dto.jxgl.EmpPerformanceQuery;
/** /**
* 考核 * 考核
...@@ -20,4 +21,6 @@ public interface JxglAppraisalMapper extends BaseMapper<JxglAppraisal> { ...@@ -20,4 +21,6 @@ public interface JxglAppraisalMapper extends BaseMapper<JxglAppraisal> {
AppraisalDetail selectDetailById(Integer orgCode, Integer id); AppraisalDetail selectDetailById(Integer orgCode, Integer id);
IPage<JxglAppraisal> selectListEmpByQuery(IPage<JxglAppraisal> page,@Param("param") EmpPerformanceQuery query);
} }
...@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal; import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal;
import cn.timer.api.bean.spmk.SpmkApproveSummary; import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.dto.jxgl.EmpAppraisalQuery;
import cn.timer.api.dto.jxgl.PerformanceAppraisalQuery; import cn.timer.api.dto.jxgl.PerformanceAppraisalQuery;
/** /**
...@@ -20,6 +21,11 @@ public interface JxglPerformanceAppraisalMapper extends BaseMapper<JxglPerforman ...@@ -20,6 +21,11 @@ public interface JxglPerformanceAppraisalMapper extends BaseMapper<JxglPerforman
IPage<JxglPerformanceAppraisal> selectListByQuery(IPage<SpmkApproveSummary> page, @Param("param") PerformanceAppraisalQuery param); 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.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 EmpAppraisalQuery extends Page {
@NotNull(message = ValidationMsg.NOTNULL)
@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; package cn.timer.api.dto.jxgl;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Max; import javax.validation.constraints.Max;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg; import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page; import cn.timer.api.utils.Page;
......
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;
}
...@@ -29,6 +29,28 @@ ...@@ -29,6 +29,28 @@
<result column="executor_name" property="executorName" /> <result column="executor_name" property="executorName" />
<result column="comprehensive_score" property="comprehensiveScore" /> <result column="comprehensive_score" property="comprehensiveScore" />
<result column="level" property="level" /> <result column="level" property="level" />
<result column="confirmor" property="confirmor" />
</resultMap>
<resultMap id="BaseResultMap_Emp" type="cn.timer.api.bean.jxgl.JxglAppraisal" >
<id column="id" property="id" />
<result column="performance_appraisal_id" property="performanceAppraisalId" />
<result column="emp_num" property="empNum" />
<result column="name" property="name" />
<result column="appraisal_explain" property="appraisalExplain" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="sts" property="sts" />
<result column="user_name" property="userName" />
<result column="phone" property="phone" />
<result column="bm_name" property="bmName" />
<result column="rz_time" property="rzTime" />
<result column="archivedPNum" property="archivedPNum" />
<result column="underwayPNum" property="underwayPNum" />
<result column="recentlyProject" property="recentlyProject" />
<result column="recentlyScore" property="recentlyScore" />
<result column="recentlyLevel" property="recentlyLevel" />
</resultMap> </resultMap>
<resultMap id="BaseResultMap_e" type="cn.timer.api.bean.jxgl.JxglAppraisalIndicators" > <resultMap id="BaseResultMap_e" type="cn.timer.api.bean.jxgl.JxglAppraisalIndicators" >
...@@ -181,6 +203,7 @@ ...@@ -181,6 +203,7 @@
b.name user_name, b.phone, b.name user_name, b.phone,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = b.bmgw_id limit 1) limit 1) as bm_name, (SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = b.bmgw_id limit 1) limit 1) as bm_name,
(SELECT name FROM yggl_main_emp WHERE emp_num = c.executor_id AND org_code = #{param.orgCode}) as executor_name, (SELECT name FROM yggl_main_emp WHERE emp_num = c.executor_id AND org_code = #{param.orgCode}) as executor_name,
(SELECT executor_name FROM jxgl_process_node WHERE process_type = 4 AND sts = 2 LIMIT 1) as confirmor,
d.comprehensive_score ,d.level d.comprehensive_score ,d.level
FROM jxgl_appraisal a FROM jxgl_appraisal a
LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num AND b.org_code = #{param.orgCode} LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num AND b.org_code = #{param.orgCode}
...@@ -190,8 +213,8 @@ ...@@ -190,8 +213,8 @@
WHERE a.performance_appraisal_id = #{param.id} WHERE a.performance_appraisal_id = #{param.id}
<if test="param.query != null and param.query != ''"> <if test="param.query != null and param.query != ''">
and ( and (
a.name like CONCAT('%',#{param.query},'%') or b.name like CONCAT('%',#{param.query},'%') or
a.phone like CONCAT('%',#{param.query},'%') b.phone like CONCAT('%',#{param.query},'%')
) )
</if> </if>
<if test="param.sts != null"> <if test="param.sts != null">
...@@ -201,6 +224,34 @@ ...@@ -201,6 +224,34 @@
</select> </select>
<select id="selectListEmpByQuery" resultMap="BaseResultMap_Emp" >
SELECT
a.emp_num,
b.name user_name, b.phone,b.rz_time,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = b.bmgw_id limit 1) limit 1) as bm_name,
SUM((CASE WHEN c.sts = 3 THEN 1 ELSE 0 END)) AS archivedPNum,
SUM((CASE WHEN c.sts in (0,1,2) THEN 1 ELSE 0 END)) AS underwayPNum,
(SELECT name FROM jxgl_performance_appraisal WHERE id = a.performance_appraisal_id ORDER BY create_time DESC LIMIT 1 ) recentlyProject,
(SELECT comprehensive_score FROM jxgl_appraisal_assessment WHERE type = 1 AND appraisal_id in (SELECT id FROM jxgl_appraisal WHERE emp_num = a.emp_num) ORDER BY create_time DESC LIMIT 1 ) recentlyScore,
(SELECT level FROM jxgl_appraisal_assessment WHERE type = 1 AND appraisal_id in (SELECT id FROM jxgl_appraisal WHERE emp_num = a.emp_num) ORDER BY create_time DESC LIMIT 1 ) recentlyLevel
FROM jxgl_appraisal a
LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num AND b.org_code = #{param.orgCode}
LEFT JOIN jxgl_performance_appraisal c ON a.performance_appraisal_id = c.id
<!-- 缺部门 搜索 -->
<where>
<if test="param.query != null and param.query != ''">
and (
b.name like CONCAT('%',#{param.query},'%') or
b.phone like CONCAT('%',#{param.query},'%')
)
</if>
</where>
GROUP BY a.emp_num
ORDER BY a.id DESC
</select>
<select id="selectDetailById" resultMap="BaseResultMap_Detail"> <select id="selectDetailById" resultMap="BaseResultMap_Detail">
SELECT SELECT
<include refid="Base_Column_List_a" />, <include refid="Base_Column_List_a" />,
......
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
<result column="performance_score" property="performanceScore" /> <result column="performance_score" property="performanceScore" />
<result column="result_verification" property="resultVerification" /> <result column="result_verification" property="resultVerification" />
<result column="performance_archive" property="performanceArchive" /> <result column="performance_archive" property="performanceArchive" />
<association property="appraisal" column="b_id" javaType="cn.timer.api.bean.jxgl.JxglAppraisal" columnPrefix="b_"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalMapper.BaseResultMap" />
<association property="appraisalAssessment" column="c_id" javaType="cn.timer.api.bean.jxgl.JxglAppraisalAssessment" columnPrefix="c_"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalAssessmentMapper.BaseResultMap" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -80,6 +85,29 @@ ...@@ -80,6 +85,29 @@
a.update_time a.update_time
</sql> </sql>
<sql id="Base_Column_List_b">
b.id b_id,
b.performance_appraisal_id b_performance_appraisal_id,
b.emp_num b_emp_num,
b.name b_name,
b.appraisal_explain b_appraisal_explain,
b.create_time b_create_time,
b.update_time b_update_time,
b.sts b_sts
</sql>
<sql id="Base_Column_List_c">
c.id c_id,
c.appraisal_id c_appraisal_id,
c.assessor_id c_assessor_id,
c.assessor_name c_assessor_name,
c.comprehensive_score c_comprehensive_score,
c.remarks c_remarks,
c.type c_type,
c.create_time c_create_time,
c.level c_level
</sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
id JxglPerformanceAppraisal_id, id JxglPerformanceAppraisal_id,
org_code JxglPerformanceAppraisal_org_code, org_code JxglPerformanceAppraisal_org_code,
...@@ -107,7 +135,7 @@ ...@@ -107,7 +135,7 @@
SUM((CASE WHEN b.sts = 7 THEN 1 ELSE 0 END)) AS performance_archive SUM((CASE WHEN b.sts = 7 THEN 1 ELSE 0 END)) AS performance_archive
FROM jxgl_performance_appraisal a FROM jxgl_performance_appraisal a
LEFT JOIN jxgl_appraisal b ON a.id = b.performance_appraisal_id LEFT JOIN jxgl_appraisal b ON a.id = b.performance_appraisal_id
WHERE a.org_code = #{param.orgCode} WHERE a.org_code = #{param.orgCode} AND a.sts != 3
<if test="param.query != null and param.query != ''"> <if test="param.query != null and param.query != ''">
and ( and (
a.name like CONCAT('%',#{param.query},'%') a.name like CONCAT('%',#{param.query},'%')
...@@ -127,6 +155,44 @@ ...@@ -127,6 +155,44 @@
</select> </select>
<select id="selectArchiveListByQuery" resultMap="BaseResultMap_ALl" >
SELECT
<include refid="Base_Column_List_a" />,
SUM((CASE WHEN b.sts in (0,1) THEN 1 ELSE 0 END)) AS target_seting,
SUM((CASE WHEN b.sts in (2,3) THEN 1 ELSE 0 END)) AS performance_score,
SUM((CASE WHEN b.sts in (4,5) THEN 1 ELSE 0 END)) AS result_verification,
SUM((CASE WHEN b.sts = 7 THEN 1 ELSE 0 END)) AS performance_archive
FROM jxgl_performance_appraisal a
LEFT JOIN jxgl_appraisal b ON a.id = b.performance_appraisal_id
WHERE a.org_code = #{param.orgCode} AND a.sts = 3
<if test="param.query != null and param.query != ''">
and (
a.name like CONCAT('%',#{param.query},'%')
)
</if>
<if test="param.startTime != null and param.startTime != ''">
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and a.create_time <![CDATA[ <= ]]> #{param.endTime}
</if>
GROUP BY a.id
ORDER BY a.id DESC
</select>
<select id="selectListEmpByQuery" resultMap="BaseResultMap_ALl" >
SELECT
a.name,a.appraisal_start_time,a.appraisal_end_time,
b.sts b_sts,
c.comprehensive_score c_comprehensive_score,
c.level c_level
FROM jxgl_performance_appraisal a
LEFT JOIN jxgl_appraisal b ON b.performance_appraisal_id = a.id
LEFT JOIN jxgl_appraisal_assessment c ON b.id = c.appraisal_id
WHERE a.org_code = #{param.orgCode} AND b.emp_num = #{param.id} AND c.type = 1
</select>
<!-- <!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglPerformanceAppraisal"> <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglPerformanceAppraisal">
......
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