改的多,就不愿意描述
This commit is contained in:
parent
6a5f7c63e4
commit
474adeb112
@ -51,4 +51,8 @@ public interface DepartmentsDao extends BaseMapper<DepartmentsEntity> {
|
|||||||
List<String> selectDepartmentIdsByparentIds(@Param("parentIds") List parentIds, @Param("page") IPage page);
|
List<String> selectDepartmentIdsByparentIds(@Param("parentIds") List parentIds, @Param("page") IPage page);
|
||||||
|
|
||||||
List<DepartmentsEntity> selectDeparmentLevel1();
|
List<DepartmentsEntity> selectDeparmentLevel1();
|
||||||
|
|
||||||
|
List<DepartmentsEntity> selectEntityByDepartmentIds(@Param("dIds") List<String> dIds);
|
||||||
|
|
||||||
|
List<DepartmentsEntity> selectEntityByParentDepartmentIds(@Param("dIds") List<DepartmentsEntity> dIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,9 @@ package com.lz.modules.app.dao;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.lz.modules.app.dto.*;
|
import com.lz.modules.app.dto.*;
|
||||||
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.entity.StaffSimpleInfo;
|
||||||
import com.lz.modules.app.req.ReportListReq;
|
import com.lz.modules.app.req.ReportListReq;
|
||||||
import com.lz.modules.equipment.entity.model.FindByNameModel;
|
import com.lz.modules.equipment.entity.model.FindByNameModel;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@ -84,4 +86,8 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
|
|||||||
List<StaffSimpleDto> selectStaffSimpleInfoByIds(@Param("ids") List<Long> ids);
|
List<StaffSimpleDto> selectStaffSimpleInfoByIds(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
List<StaffDto> getDepatAllStaffInfos(@Param("departmentId") String departmentId);
|
List<StaffDto> getDepatAllStaffInfos(@Param("departmentId") String departmentId);
|
||||||
|
|
||||||
|
List<StaffSimpleInfo> selectAllStaffSimpleInfos(@Param("depart") DepartmentsEntity depart);
|
||||||
|
|
||||||
|
List<StaffSimpleInfo> selectStaffSimpleInfos(@Param("sIds") List<Long> sIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,6 +46,8 @@ public class DepartmentsEntity implements Serializable {
|
|||||||
private Integer status;
|
private Integer status;
|
||||||
//第几级部门
|
//第几级部门
|
||||||
private Integer level;
|
private Integer level;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自增主键
|
* 自增主键
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
47
src/main/java/com/lz/modules/app/entity/StaffSimpleInfo.java
Normal file
47
src/main/java/com/lz/modules/app/entity/StaffSimpleInfo.java
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package com.lz.modules.app.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工基本信息表
|
||||||
|
*
|
||||||
|
* @author fumeiai
|
||||||
|
* @email fumeiai@linzikg.com
|
||||||
|
* @date 2020-04-29 20:59:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StaffSimpleInfo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自增主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工号
|
||||||
|
*/
|
||||||
|
private String jobNumber;
|
||||||
|
|
||||||
|
//职位
|
||||||
|
private String position;
|
||||||
|
//部门名称
|
||||||
|
private String departmentName;
|
||||||
|
//部门id
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -53,5 +53,6 @@ public interface DepartmentsService extends IService<DepartmentsEntity> {
|
|||||||
*/
|
*/
|
||||||
List<DepartmentsDto> getDepartmentTreeByStaffId(String staffId,boolean containSelf);
|
List<DepartmentsDto> getDepartmentTreeByStaffId(String staffId,boolean containSelf);
|
||||||
|
|
||||||
|
List<DepartmentsEntity> selectAllDepartmentIds(List<String> dIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.modules.app.dto.*;
|
import com.lz.modules.app.dto.*;
|
||||||
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.entity.StaffSimpleInfo;
|
||||||
import com.lz.modules.equipment.entity.model.FindByNameModel;
|
import com.lz.modules.equipment.entity.model.FindByNameModel;
|
||||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||||
import com.lz.modules.sys.entity.SysUserEntity;
|
import com.lz.modules.sys.entity.SysUserEntity;
|
||||||
@ -86,5 +88,9 @@ public interface StaffService extends IService<StaffEntity> {
|
|||||||
List<StaffSimpleDto> selectStaffSimpleInfoByIds(List<Long> ids);
|
List<StaffSimpleDto> selectStaffSimpleInfoByIds(List<Long> ids);
|
||||||
|
|
||||||
List<StaffDto> getDepatAllStaffInfos(String departmentId);
|
List<StaffDto> getDepatAllStaffInfos(String departmentId);
|
||||||
|
|
||||||
|
List<StaffSimpleInfo> selectAllStaffSimpleInfos(DepartmentsEntity depart);
|
||||||
|
|
||||||
|
List<StaffSimpleInfo> selectStaffSimpleInfos(List<Long> sIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -266,4 +266,29 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
|||||||
return departmentsParentsList;
|
return departmentsParentsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DepartmentsEntity> selectAllDepartmentIds(List<String> dIds){
|
||||||
|
List<DepartmentsEntity> departmentsEntities = departmentsDao.selectEntityByDepartmentIds(dIds);
|
||||||
|
|
||||||
|
List<DepartmentsEntity> childs = selectAllChildDepartmentIds(departmentsEntities);
|
||||||
|
if(childs != null){
|
||||||
|
departmentsEntities.addAll(childs);
|
||||||
|
}
|
||||||
|
|
||||||
|
return departmentsEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DepartmentsEntity> selectAllChildDepartmentIds(List<DepartmentsEntity> departmentsEntities){
|
||||||
|
|
||||||
|
List<DepartmentsEntity> departments = departmentsDao.selectEntityByParentDepartmentIds(departmentsEntities);
|
||||||
|
if(departments.size() > 0){
|
||||||
|
List<DepartmentsEntity> childs = selectAllChildDepartmentIds(departments);
|
||||||
|
if(childs != null){
|
||||||
|
departments.addAll(childs);
|
||||||
|
}
|
||||||
|
return departments;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -453,6 +453,15 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
|||||||
return staffDao.getDepatAllStaffInfos(departmentId);
|
return staffDao.getDepatAllStaffInfos(departmentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StaffSimpleInfo> selectAllStaffSimpleInfos(DepartmentsEntity depart){
|
||||||
|
return staffDao.selectAllStaffSimpleInfos(depart);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StaffSimpleInfo> selectStaffSimpleInfos(List<Long> sIds){
|
||||||
|
return staffDao.selectStaffSimpleInfos(sIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import java.util.Date;
|
|||||||
* <p>
|
* <p>
|
||||||
* </p>*发起考核考,核组人员对应关系表
|
* </p>*发起考核考,核组人员对应关系表
|
||||||
* @author quyixiao
|
* @author quyixiao
|
||||||
* @since 2020-10-22
|
* @since 2020-10-23
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -44,6 +44,9 @@ public class EvaluationStartStaff implements java.io.Serializable {
|
|||||||
//0: 未通知评分 1: 已通知评分
|
//0: 未通知评分 1: 已通知评分
|
||||||
@ApiModelProperty(value = "0: 未通知评分 1: 已通知评分", name = "score")
|
@ApiModelProperty(value = "0: 未通知评分 1: 已通知评分", name = "score")
|
||||||
private Integer score;
|
private Integer score;
|
||||||
|
//考核组名称
|
||||||
|
@ApiModelProperty(value = "考核组名称", name = "evaluationName")
|
||||||
|
private String evaluationName;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -179,6 +182,21 @@ public class EvaluationStartStaff implements java.io.Serializable {
|
|||||||
this.score = score;
|
this.score = score;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考核组名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getEvaluationName() {
|
||||||
|
return evaluationName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 考核组名称
|
||||||
|
* @param evaluationName
|
||||||
|
*/
|
||||||
|
public void setEvaluationName(String evaluationName) {
|
||||||
|
this.evaluationName = evaluationName;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "EvaluationStartStaff{" +
|
return "EvaluationStartStaff{" +
|
||||||
@ -191,6 +209,7 @@ public class EvaluationStartStaff implements java.io.Serializable {
|
|||||||
",staffId=" + staffId +
|
",staffId=" + staffId +
|
||||||
",type=" + type +
|
",type=" + type +
|
||||||
",score=" + score +
|
",score=" + score +
|
||||||
|
",evaluationName=" + evaluationName +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10,7 +10,7 @@ import java.util.Date;
|
|||||||
* <p>
|
* <p>
|
||||||
* </p>*流程审批表
|
* </p>*流程审批表
|
||||||
* @author quyixiao
|
* @author quyixiao
|
||||||
* @since 2020-10-21
|
* @since 2020-10-23
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -47,6 +47,9 @@ public class FlowApprovalRole implements java.io.Serializable {
|
|||||||
//-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
//-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||||
@ApiModelProperty(value = "-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....", name = "approvalType")
|
@ApiModelProperty(value = "-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....", name = "approvalType")
|
||||||
private Integer approvalType;
|
private Integer approvalType;
|
||||||
|
//小结点的第几步,从0开始,如果是多人,步数相同
|
||||||
|
@ApiModelProperty(value = "小结点的第几步,从0开始,如果是多人,步数相同", name = "stepIndex")
|
||||||
|
private Integer stepIndex;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -197,6 +200,21 @@ public class FlowApprovalRole implements java.io.Serializable {
|
|||||||
this.approvalType = approvalType;
|
this.approvalType = approvalType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小结点的第几步,从0开始,如果是多人,步数相同
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer getStepIndex() {
|
||||||
|
return stepIndex;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 小结点的第几步,从0开始,如果是多人,步数相同
|
||||||
|
* @param stepIndex
|
||||||
|
*/
|
||||||
|
public void setStepIndex(Integer stepIndex) {
|
||||||
|
this.stepIndex = stepIndex;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "FlowApprovalRole{" +
|
return "FlowApprovalRole{" +
|
||||||
@ -210,6 +228,7 @@ public class FlowApprovalRole implements java.io.Serializable {
|
|||||||
",flowId=" + flowId +
|
",flowId=" + flowId +
|
||||||
",stepType=" + stepType +
|
",stepType=" + stepType +
|
||||||
",approvalType=" + approvalType +
|
",approvalType=" + approvalType +
|
||||||
|
",stepIndex=" + stepIndex +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3,6 +3,7 @@ package com.lz.modules.flow.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
|
import com.lz.modules.app.entity.StaffSimpleInfo;
|
||||||
import com.lz.modules.flow.entity.EvaluationGroup;
|
import com.lz.modules.flow.entity.EvaluationGroup;
|
||||||
import com.lz.modules.flow.req.EvaluationGroupReq;
|
import com.lz.modules.flow.req.EvaluationGroupReq;
|
||||||
|
|
||||||
@ -43,4 +44,6 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
|
|||||||
List<EvaluationGroup> selectEvaluationGroupByIds(List<Long> ids);
|
List<EvaluationGroup> selectEvaluationGroupByIds(List<Long> ids);
|
||||||
|
|
||||||
EvaluationGroup selectEvaluationGroupByName(String name);
|
EvaluationGroup selectEvaluationGroupByName(String name);
|
||||||
|
//获取考核组里面所有参与的人员信息,去除重复,去除离职
|
||||||
|
List<StaffSimpleInfo> selectAllStaffSimpleInfoByGroupId(EvaluationGroup evaluationGroup);
|
||||||
}
|
}
|
||||||
@ -5,6 +5,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.lz.common.utils.ISelect;
|
import com.lz.common.utils.ISelect;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
|
import com.lz.common.utils.StringUtil;
|
||||||
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
|
import com.lz.modules.app.entity.StaffSimpleInfo;
|
||||||
|
import com.lz.modules.app.service.DepartmentsService;
|
||||||
import com.lz.modules.app.service.StaffOccupationService;
|
import com.lz.modules.app.service.StaffOccupationService;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.flow.dao.EvaluationGroupMapper;
|
import com.lz.modules.flow.dao.EvaluationGroupMapper;
|
||||||
@ -16,6 +20,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -40,6 +47,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
|||||||
@Autowired
|
@Autowired
|
||||||
private EvaluationGroupService evaluationGroupService;
|
private EvaluationGroupService evaluationGroupService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DepartmentsService departmentsService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -130,4 +140,70 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
|||||||
public EvaluationGroup selectEvaluationGroupByName(String name){
|
public EvaluationGroup selectEvaluationGroupByName(String name){
|
||||||
return evaluationGroupMapper.selectEvaluationGroupByName(name);
|
return evaluationGroupMapper.selectEvaluationGroupByName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StaffSimpleInfo> selectAllStaffSimpleInfoByGroupId(EvaluationGroup evaluationGroup){
|
||||||
|
List<StaffSimpleInfo> staffSimpleInfos = new ArrayList<>();
|
||||||
|
if(!StringUtil.isEmpty(evaluationGroup.getDepIds())){
|
||||||
|
|
||||||
|
|
||||||
|
List<String> dIds = Arrays.stream(evaluationGroup.
|
||||||
|
getDepIds().split(",")).map(new Function<String, String>() {
|
||||||
|
@Override
|
||||||
|
public String apply(String s) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
//获取所有部门信息,包括子部门
|
||||||
|
List<DepartmentsEntity> departmentsEntities = departmentsService.selectAllDepartmentIds(dIds);
|
||||||
|
//下面获取部门下面的所有在职人员
|
||||||
|
for (DepartmentsEntity depart:departmentsEntities
|
||||||
|
) {
|
||||||
|
|
||||||
|
List<StaffSimpleInfo> staffSimpleInfos1 = staffService.selectAllStaffSimpleInfos(depart);
|
||||||
|
if(staffSimpleInfos1 != null){
|
||||||
|
staffSimpleInfos.addAll(staffSimpleInfos1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!StringUtil.isEmpty(evaluationGroup.getStaffIds())){
|
||||||
|
|
||||||
|
List<Long> sIds = Arrays.stream(evaluationGroup.getStaffIds()
|
||||||
|
.split(",")).map(new Function<String, Long>() {
|
||||||
|
@Override
|
||||||
|
public Long apply(String s) {
|
||||||
|
return Long.parseLong(s);
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
List<StaffSimpleInfo> staffSimpleInfos1 = staffService.selectStaffSimpleInfos(sIds);
|
||||||
|
if(staffSimpleInfos1 != null){
|
||||||
|
staffSimpleInfos.addAll(staffSimpleInfos1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//下面去重
|
||||||
|
if(staffSimpleInfos.size() > 1){
|
||||||
|
//下面去除跨部门的人员,只保留第一次添加进来的人员
|
||||||
|
Map<Long, StaffSimpleInfo> staffSimpleInfoMap =
|
||||||
|
staffSimpleInfos.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, Function.identity(), (e, replace) -> e));
|
||||||
|
//下面删除排除人员信息
|
||||||
|
if(!StringUtil.isEmpty(evaluationGroup.getOutIds())){
|
||||||
|
List<Long> oIds = Arrays.stream(evaluationGroup.getOutIds().split(",")).map(new Function<String, Long>() {
|
||||||
|
@Override
|
||||||
|
public Long apply(String s) {
|
||||||
|
return Long.parseLong(s);
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (Long id:oIds
|
||||||
|
) {
|
||||||
|
staffSimpleInfoMap.remove(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
staffSimpleInfos = staffSimpleInfoMap.values().stream().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return staffSimpleInfos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ public class EvaluationStartStaffServiceImpl extends ServiceImpl<EvaluationStart
|
|||||||
return evaluationStartStaffMapper.insertEvaluationStartStaffs(evaluationStartStaffs);
|
return evaluationStartStaffMapper.insertEvaluationStartStaffs(evaluationStartStaffs);
|
||||||
}
|
}
|
||||||
//下面防止sql语句过大
|
//下面防止sql语句过大
|
||||||
Long count = Long.getLong("0");
|
Long count = Long.parseLong("0");
|
||||||
int insert = 0;
|
int insert = 0;
|
||||||
List<EvaluationStartStaff> startStaffs = new ArrayList<>();
|
List<EvaluationStartStaff> startStaffs = new ArrayList<>();
|
||||||
for (EvaluationStartStaff startStaff:evaluationStartStaffs
|
for (EvaluationStartStaff startStaff:evaluationStartStaffs
|
||||||
|
|||||||
@ -68,7 +68,7 @@ public class FlowApprovalRoleServiceImpl extends ServiceImpl<FlowApprovalRoleMap
|
|||||||
return flowApprovalRoleMapper.insertFlowApprovalRoles(flowApprovalRoles);
|
return flowApprovalRoleMapper.insertFlowApprovalRoles(flowApprovalRoles);
|
||||||
}
|
}
|
||||||
//下面防止sql语句过大
|
//下面防止sql语句过大
|
||||||
Long count = Long.getLong("0");
|
Long count = Long.parseLong("0");
|
||||||
int insert = 0;
|
int insert = 0;
|
||||||
List<FlowApprovalRole> approvalRoles = new ArrayList<>();
|
List<FlowApprovalRole> approvalRoles = new ArrayList<>();
|
||||||
for (FlowApprovalRole role:flowApprovalRoles
|
for (FlowApprovalRole role:flowApprovalRoles
|
||||||
|
|||||||
@ -7,19 +7,21 @@ import com.lz.common.emun.CheckStaffType;
|
|||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
import com.lz.common.utils.StringUtil;
|
import com.lz.common.utils.StringUtil;
|
||||||
|
import com.lz.modules.app.entity.StaffSimpleInfo;
|
||||||
import com.lz.modules.flow.entity.*;
|
import com.lz.modules.flow.entity.*;
|
||||||
|
import com.lz.modules.flow.model.ResultModelDto;
|
||||||
|
import com.lz.modules.flow.model.ResultTagetLibDto;
|
||||||
import com.lz.modules.flow.service.*;
|
import com.lz.modules.flow.service.*;
|
||||||
import com.lz.modules.sys.entity.app.ResultDetail;
|
import com.lz.modules.sys.entity.app.ResultDetail;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
|
import com.lz.modules.sys.service.app.ResultDetailService;
|
||||||
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.apache.commons.collections.map.HashedMap;
|
import org.apache.commons.collections.map.HashedMap;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@ -54,16 +56,26 @@ public class FlowStartController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FlowApprovalRoleService flowApprovalRoleService;
|
private FlowApprovalRoleService flowApprovalRoleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FlowChartService flowChartService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ResultRecordService resultRecordService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ResultDetailService resultDetailService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/getById")
|
@GetMapping("/getById")
|
||||||
public R getById(@RequestBody FlowStart flowStart) {
|
public R getById(@RequestParam Long id) {
|
||||||
flowStart = flowStartService.selectFlowStartById(flowStart.getId());
|
EvaluationGroup evaluationGroup = evaluationGroupService.selectEvaluationGroupById(id);
|
||||||
return R.ok().put("flowStart",flowStart);
|
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);
|
||||||
|
//flowStart = flowStartService.selectFlowStartById(flowStart.getId());
|
||||||
|
return R.ok().put("data",staffIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -78,12 +90,12 @@ public class FlowStartController {
|
|||||||
@ApiOperation("发起新的考核任务")
|
@ApiOperation("发起新的考核任务")
|
||||||
public R save(@RequestBody @ApiParam FlowStart flowStart) {
|
public R save(@RequestBody @ApiParam FlowStart flowStart) {
|
||||||
flowStartService.insertFlowStart(flowStart);
|
flowStartService.insertFlowStart(flowStart);
|
||||||
Map<Integer, String> chartNameMaps = new HashedMap();
|
Map<Long, String> chartNameMaps = new HashedMap();
|
||||||
//下面开始初始化流程
|
//下面开始初始化流程
|
||||||
List<Long> ids = Arrays.stream(flowStart.getGroupIds().split(",")).map(new Function<String, Long>() {
|
List<Long> ids = Arrays.stream(flowStart.getGroupIds().split(",")).map(new Function<String, Long>() {
|
||||||
@Override
|
@Override
|
||||||
public Long apply(String s) {
|
public Long apply(String s) {
|
||||||
return Long.getLong(s);
|
return Long.parseLong(s);
|
||||||
}
|
}
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
List<EvaluationGroup> evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids);
|
List<EvaluationGroup> evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids);
|
||||||
@ -91,15 +103,16 @@ public class FlowStartController {
|
|||||||
for (EvaluationGroup evaluationGroup:evaluationGroups
|
for (EvaluationGroup evaluationGroup:evaluationGroups
|
||||||
) {
|
) {
|
||||||
//下面初始化员工考核流程
|
//下面初始化员工考核流程
|
||||||
List<String> staffIds = evaluationGroupService.selectAllStaffIdsByGroupId(evaluationGroup.getId());
|
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);
|
||||||
|
|
||||||
|
|
||||||
|
Map<Long, StaffSimpleInfo> staffSimpleInfoMap =
|
||||||
|
staffIds.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, Function.identity(), (e, replacement) -> e));
|
||||||
|
|
||||||
if(staffIds.size() == 0){
|
if(staffIds.size() == 0){
|
||||||
return R.error(evaluationGroup.getName() + "——无有效考核人员");
|
return R.error(evaluationGroup.getName() + "——无有效考核人员");
|
||||||
}
|
}
|
||||||
List<ResultModel> resultModels = resultModelService.selectResultModelByGroupId(evaluationGroup.getId());
|
List<ResultModelDto> resultModelDtos = resultModelService.selectResultDtoByGroupId(evaluationGroup.getId());
|
||||||
if(resultModels.size() == 0){
|
if(resultModelDtos.size() == 0){
|
||||||
return R.error(evaluationGroup.getName() + "——没有设置考核模板");
|
return R.error(evaluationGroup.getName() + "——没有设置考核模板");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,55 +122,9 @@ public class FlowStartController {
|
|||||||
return R.error(evaluationGroup.getName() + "——没有设置考核流程");
|
return R.error(evaluationGroup.getName() + "——没有设置考核流程");
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化lz_result_records数据
|
|
||||||
List<ResultRecord> resultRecords = new ArrayList<>();
|
|
||||||
//初始化lz_result_details数据
|
|
||||||
List<ResultDetail> resultDetails = new ArrayList<>();
|
|
||||||
|
|
||||||
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
|
|
||||||
//下面初始化参与人员
|
|
||||||
for (String staffId:staffIds
|
|
||||||
) {
|
|
||||||
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
|
||||||
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
|
||||||
evaluationStartStaff.setStaffId(Long.getLong(staffId));
|
|
||||||
evaluationStartStaff.setStaffId(flowStart.getId());
|
|
||||||
evaluationStartStaff.setType(CheckStaffType.STAFF.getCode());
|
|
||||||
evaluationStartStaffs.add(evaluationStartStaff);
|
|
||||||
|
|
||||||
|
|
||||||
for (ResultModel resultModel:resultModels
|
|
||||||
) {
|
|
||||||
ResultRecord resultRecord = new ResultRecord();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if(evaluationStartStaffs.size() == 0){
|
|
||||||
|
|
||||||
return R.error(evaluationGroup.getName() + "——未指定考核参与人员");
|
|
||||||
|
|
||||||
}
|
|
||||||
//下面初始化管理人员
|
|
||||||
if(evaluationGroup.getManagerIds() != null && evaluationGroup.getManagerIds().length() > 0){
|
|
||||||
String[] managerIds = evaluationGroup.getManagerIds().split(",");
|
|
||||||
for (String staffId:managerIds
|
|
||||||
) {
|
|
||||||
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
|
||||||
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
|
||||||
evaluationStartStaff.setStaffId(Long.getLong(staffId));
|
|
||||||
evaluationStartStaff.setStaffId(flowStart.getId());
|
|
||||||
evaluationStartStaff.setType(CheckStaffType.MANAGER.getCode());
|
|
||||||
evaluationStartStaffs.add(evaluationStartStaff);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(evaluationStartStaffs.size() > 0){
|
|
||||||
evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs);
|
|
||||||
//下面初始化lz_flow流程表 lz_flow_approval_role流程审批表
|
//下面初始化lz_flow流程表 lz_flow_approval_role流程审批表
|
||||||
|
|
||||||
List<FlowApprovalRole> flowApprovalRoles = new ArrayList<>();
|
List<FlowApprovalRole> flowApprovalRoles = new ArrayList<>();
|
||||||
|
int stepIndex = 0;
|
||||||
for (FlowChartDetailRecord flowChartDetailRecord:flowChartDetailRecords
|
for (FlowChartDetailRecord flowChartDetailRecord:flowChartDetailRecords
|
||||||
) {
|
) {
|
||||||
Flow flow = new Flow();
|
Flow flow = new Flow();
|
||||||
@ -167,7 +134,9 @@ public class FlowStartController {
|
|||||||
flow.setChartId(flowChartDetailRecord.getChartId());
|
flow.setChartId(flowChartDetailRecord.getChartId());
|
||||||
String optName = chartNameMaps.get(flowChartDetailRecord.getChartId());
|
String optName = chartNameMaps.get(flowChartDetailRecord.getChartId());
|
||||||
if(optName == null){
|
if(optName == null){
|
||||||
|
FlowChart flowChart = flowChartService.selectFlowChartById(flowChartDetailRecord.getChartId());
|
||||||
|
chartNameMaps.put(flowChart.getId(), flowChart.getName());
|
||||||
|
optName = flowChart.getName();
|
||||||
}
|
}
|
||||||
flow.setOpt(optName);
|
flow.setOpt(optName);
|
||||||
flowService.insertFlow(flow);
|
flowService.insertFlow(flow);
|
||||||
@ -181,12 +150,14 @@ public class FlowStartController {
|
|||||||
) {
|
) {
|
||||||
FlowApprovalRole flowApprovalRole = new FlowApprovalRole();
|
FlowApprovalRole flowApprovalRole = new FlowApprovalRole();
|
||||||
flowApprovalRole.setFlowId(flow.getId());
|
flowApprovalRole.setFlowId(flow.getId());
|
||||||
flowApprovalRole.setApprovalId(Long.getLong(id));
|
flowApprovalRole.setApprovalId(Long.parseLong(id));
|
||||||
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
||||||
flowApprovalRole.setRoleId(Long.getLong(roleId));
|
flowApprovalRole.setRoleId(Long.parseLong(roleId));
|
||||||
flowApprovalRole.setApprovalType(flowChartDetailRecord.getOptType());
|
flowApprovalRole.setApprovalType(flowChartDetailRecord.getOptType());
|
||||||
flowApprovalRoles.add(flowApprovalRole);
|
flowApprovalRoles.add(flowApprovalRole);
|
||||||
|
flowApprovalRole.setStepType(stepIndex);
|
||||||
}
|
}
|
||||||
|
stepIndex++;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
String[] roleIds = flowChartDetailRecord.getRoleIds().split(",");
|
String[] roleIds = flowChartDetailRecord.getRoleIds().split(",");
|
||||||
@ -195,21 +166,121 @@ public class FlowStartController {
|
|||||||
FlowApprovalRole flowApprovalRole = new FlowApprovalRole();
|
FlowApprovalRole flowApprovalRole = new FlowApprovalRole();
|
||||||
flowApprovalRole.setFlowId(flow.getId());
|
flowApprovalRole.setFlowId(flow.getId());
|
||||||
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
||||||
flowApprovalRole.setRoleId(Long.getLong(roleId));
|
flowApprovalRole.setRoleId(Long.parseLong(roleId));
|
||||||
flowApprovalRole.setApprovalType(flowChartDetailRecord.getOptType());
|
flowApprovalRole.setApprovalType(flowChartDetailRecord.getOptType());
|
||||||
flowApprovalRoles.add(flowApprovalRole);
|
flowApprovalRoles.add(flowApprovalRole);
|
||||||
|
flowApprovalRole.setStepType(stepIndex);
|
||||||
|
stepIndex++;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//插入记录
|
|
||||||
}
|
}
|
||||||
|
//插入记录
|
||||||
if(flowApprovalRoles.size() > 0){
|
if(flowApprovalRoles.size() > 0){
|
||||||
flowApprovalRoleService.insertFlowApprovalRoles(flowApprovalRoles);
|
flowApprovalRoleService.insertFlowApprovalRoles(flowApprovalRoles);
|
||||||
|
|
||||||
|
//初始化lz_result_details数据
|
||||||
|
List<ResultDetail> resultDetails = new ArrayList<>();
|
||||||
|
|
||||||
|
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
|
||||||
|
//下面初始化参与人员
|
||||||
|
for (StaffSimpleInfo staffInfo:staffIds
|
||||||
|
) {
|
||||||
|
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
||||||
|
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
||||||
|
evaluationStartStaff.setEvaluationName(evaluationGroup.getName());
|
||||||
|
evaluationStartStaff.setStaffId(staffInfo.getId());
|
||||||
|
evaluationStartStaff.setStaffId(flowStart.getId());
|
||||||
|
evaluationStartStaff.setType(CheckStaffType.STAFF.getCode());
|
||||||
|
evaluationStartStaffs.add(evaluationStartStaff);
|
||||||
|
|
||||||
|
|
||||||
|
//初始化lz_result_records数据
|
||||||
|
ResultRecord resultRecord = new ResultRecord();
|
||||||
|
resultRecord.setDepartmentId(staffInfo.getDepartmentId());
|
||||||
|
resultRecord.setDepartmentName(staffInfo.getDepartmentName());
|
||||||
|
resultRecord.setStaffId(staffInfo.getId());
|
||||||
|
resultRecord.setStaffName(staffInfo.getName());
|
||||||
|
resultRecord.setType(1);//设置为提交目标
|
||||||
|
resultRecord.setStatus(0);//设置为新建
|
||||||
|
resultRecord.setStartId(flowStart.getId());
|
||||||
|
resultRecord.setEvaluationId(evaluationGroup.getId());
|
||||||
|
resultRecord.setFlowProcess(0);//设置为目标制定
|
||||||
|
|
||||||
|
//下面初始化flow_staff_id_role字段,步骤为0的
|
||||||
|
String roleJSON = "[";
|
||||||
|
for (int i = 0; i < flowApprovalRoles.size() ;i++){
|
||||||
|
FlowApprovalRole approvalRole = flowApprovalRoles.get(i);
|
||||||
|
if(approvalRole.getStepIndex().intValue() == 0){
|
||||||
|
if(i == 0){
|
||||||
|
//设置当前审批员工id current_approval_staff_id
|
||||||
|
resultRecord.setCurrentApprovalStaffId(approvalRole.getApprovalId());
|
||||||
|
//设置当前审批员工姓名 current_approval_staff_name
|
||||||
|
resultRecord.setCurrentApprovalStaffName("");
|
||||||
|
roleJSON += ("{\"roleId\":"+ approvalRole.getRoleId() +
|
||||||
|
",\"staffId\":" + approvalRole.getApprovalId() + "}");
|
||||||
|
}else{
|
||||||
|
roleJSON += (",{\"roleId\":"+ approvalRole.getRoleId() +
|
||||||
|
",\"staffId\":" + approvalRole.getApprovalId() + "}");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
roleJSON += "]";
|
||||||
|
resultRecord.setFlowStaffIdRole(roleJSON);
|
||||||
|
resultRecordService.insertResultRecord(resultRecord);
|
||||||
|
//下面生成ResultDetail对象
|
||||||
|
for (ResultModelDto modelDto:resultModelDtos
|
||||||
|
) {
|
||||||
|
if(modelDto.getTagetLibs().size() > 0){//模板里面有添加指标
|
||||||
|
for (ResultTagetLibDto libDto:
|
||||||
|
modelDto.getTagetLibs()) {
|
||||||
|
ResultDetail resultDetail = new ResultDetail();
|
||||||
|
resultDetail.setRecordId(resultRecord.getId());
|
||||||
|
resultDetail.setTarget(libDto.getName());
|
||||||
|
resultDetail.setType(modelDto.getType());
|
||||||
|
resultDetail.setKeyResult(libDto.getKeyResult());
|
||||||
|
resultDetail.setCheckWeight(libDto.getWeight());
|
||||||
|
resultDetail.setStaffId(staffInfo.getId());
|
||||||
|
resultDetail.setPriority(libDto.getOrderBy());
|
||||||
|
resultDetails.add(resultDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//如果有数据插入lz_result_detail表
|
||||||
|
if(resultDetails.size() > 0){
|
||||||
|
//
|
||||||
|
resultDetailService.insertResultDetails(resultDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
//下面初始化管理人员
|
||||||
|
if(!StringUtil.isEmpty(evaluationGroup.getManagerIds())){
|
||||||
|
String[] managerIds = evaluationGroup.getManagerIds().split(",");
|
||||||
|
for (String staffId:managerIds
|
||||||
|
) {
|
||||||
|
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
||||||
|
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
||||||
|
evaluationStartStaff.setEvaluationName(evaluationGroup.getName());
|
||||||
|
evaluationStartStaff.setStaffId(Long.parseLong(staffId));
|
||||||
|
evaluationStartStaff.setStaffId(flowStart.getId());
|
||||||
|
evaluationStartStaff.setType(CheckStaffType.MANAGER.getCode());
|
||||||
|
evaluationStartStaffs.add(evaluationStartStaff);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs);
|
||||||
|
}else{
|
||||||
|
return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//下面初始化lz_result_record表和lz_result_detail表
|
//下面初始化lz_result_record表和lz_result_detail表
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -41,4 +41,6 @@ public interface ResultDetailMapper extends BaseMapper<ResultDetail> {
|
|||||||
|
|
||||||
//计算业务/价值观得分
|
//计算业务/价值观得分
|
||||||
BigDecimal calculateScore(@Param("recordId") Long recordId, @Param("staffId") Long staffId,@Param("type") Integer type);
|
BigDecimal calculateScore(@Param("recordId") Long recordId, @Param("staffId") Long staffId,@Param("type") Integer type);
|
||||||
|
|
||||||
|
Long insertResultDetails(List<ResultDetail> resultDetails);
|
||||||
}
|
}
|
||||||
@ -1,59 +1,87 @@
|
|||||||
package com.lz.modules.sys.entity.app;
|
package com.lz.modules.sys.entity.app;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 菜单权限表
|
|
||||||
* </p>*业绩记录表
|
* </p>*业绩记录表
|
||||||
* @author quyixiao
|
* @author quyixiao
|
||||||
* @since 2020-09-15
|
* @since 2020-10-23
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("lz_result_record")
|
@TableName("lz_result_record")
|
||||||
|
@ApiModel(value = "业绩记录表")
|
||||||
public class ResultRecord implements java.io.Serializable {
|
public class ResultRecord implements java.io.Serializable {
|
||||||
//
|
//
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
//是否删除状态,1:删除,0:有效
|
//是否删除状态,1:删除,0:有效
|
||||||
|
@ApiModelProperty(value = "是否删除状态,1:删除,0:有效", name = "isDelete")
|
||||||
private Integer isDelete;
|
private Integer isDelete;
|
||||||
//创建时间
|
//创建时间
|
||||||
|
@ApiModelProperty(value = "创建时间", name = "gmtCreate")
|
||||||
private Date gmtCreate;
|
private Date gmtCreate;
|
||||||
//最后修改时间
|
//最后修改时间
|
||||||
|
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
|
||||||
private Date gmtModified;
|
private Date gmtModified;
|
||||||
//月份
|
//月份
|
||||||
|
@ApiModelProperty(value = "月份", name = "monthTime")
|
||||||
private Date monthTime;
|
private Date monthTime;
|
||||||
//0.新建,1 提交审批中,2 拒绝, 3 侍提交 ,4 审批通过,5 驳回,6申述,7 流程终止
|
//0.新建,1 提交审批中,2 拒绝, 3 侍提交 ,4 审批通过,5 驳回,6申述,7 流程终止
|
||||||
|
@ApiModelProperty(value = "0.新建,1 提交审批中,2 拒绝, 3 侍提交 ,4 审批通过,5 驳回,6申述,7 流程终止", name = "status")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
//最后得分
|
//最后得分
|
||||||
|
@ApiModelProperty(value = "最后得分", name = "lastScore")
|
||||||
private BigDecimal lastScore;
|
private BigDecimal lastScore;
|
||||||
//总分
|
//总分
|
||||||
|
@ApiModelProperty(value = "总分", name = "allScore")
|
||||||
private BigDecimal allScore;
|
private BigDecimal allScore;
|
||||||
//备注
|
//备注
|
||||||
|
@ApiModelProperty(value = "备注", name = "remark")
|
||||||
private String remark;
|
private String remark;
|
||||||
//员工id
|
//员工id
|
||||||
|
@ApiModelProperty(value = "员工id", name = "staffId")
|
||||||
private Long staffId;
|
private Long staffId;
|
||||||
//类型 ,1 表示提交目标,2 表示提交结果
|
//类型 ,1 表示提交目标,2 表示提交结果
|
||||||
|
@ApiModelProperty(value = "类型 ,1 表示提交目标,2 表示提交结果", name = "type")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
//当前审批流转所在员工 id
|
//当前审批流转所在员工 id
|
||||||
|
@ApiModelProperty(value = "当前审批流转所在员工 id", name = "flowStaffIdRole")
|
||||||
private String flowStaffIdRole;
|
private String flowStaffIdRole;
|
||||||
//员工所在部门 id
|
//员工所在部门 id
|
||||||
|
@ApiModelProperty(value = "员工所在部门 id", name = "departmentId")
|
||||||
private String departmentId;
|
private String departmentId;
|
||||||
//员工所在部门名称
|
//员工所在部门名称
|
||||||
|
@ApiModelProperty(value = "员工所在部门名称", name = "departmentName")
|
||||||
private String departmentName;
|
private String departmentName;
|
||||||
//员工姓名
|
//员工姓名
|
||||||
|
@ApiModelProperty(value = "员工姓名", name = "staffName")
|
||||||
private String staffName;
|
private String staffName;
|
||||||
//当前审批的员工 id
|
//当前审批的员工 id
|
||||||
|
@ApiModelProperty(value = "当前审批的员工 id", name = "currentApprovalStaffId")
|
||||||
private Long currentApprovalStaffId;
|
private Long currentApprovalStaffId;
|
||||||
//当前审批的员工名,以逗号隔开
|
//当前审批的员工名,以逗号隔开
|
||||||
|
@ApiModelProperty(value = "当前审批的员工名,以逗号隔开", name = "currentApprovalStaffName")
|
||||||
private String currentApprovalStaffName;
|
private String currentApprovalStaffName;
|
||||||
//等级
|
//等级
|
||||||
|
@ApiModelProperty(value = "等级", name = "scoreLevel")
|
||||||
private String scoreLevel;
|
private String scoreLevel;
|
||||||
|
//发起考核次数
|
||||||
|
@ApiModelProperty(value = "发起考核次数", name = "startId")
|
||||||
|
private Long startId;
|
||||||
|
//当前是目标确认还是评分,0,目标制定,1,目标确认,2执行中,3,结果值录入,4,评分,5考核结束
|
||||||
|
@ApiModelProperty(value = "当前是目标确认还是评分,0,目标制定,1,目标确认,2执行中,3,结果值录入,4,评分,5考核结束", name = "flowProcess")
|
||||||
|
private Integer flowProcess;
|
||||||
|
//考核组id
|
||||||
|
@ApiModelProperty(value = "考核组id", name = "evaluationId")
|
||||||
|
private Long evaluationId;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -130,14 +158,14 @@ public class ResultRecord implements java.io.Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0.新建,1 提交审批中,2 拒绝, 3 侍提交 ,4 审批通过,5 驳回
|
* 0.新建,1 提交审批中,2 拒绝, 3 侍提交 ,4 审批通过,5 驳回,6申述,7 流程终止
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Integer getStatus() {
|
public Integer getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 0.新建,1 提交审批中,2 拒绝, 3 侍提交 ,4 审批通过,5 驳回
|
* 0.新建,1 提交审批中,2 拒绝, 3 侍提交 ,4 审批通过,5 驳回,6申述,7 流程终止
|
||||||
* @param status
|
* @param status
|
||||||
*/
|
*/
|
||||||
public void setStatus(Integer status) {
|
public void setStatus(Integer status) {
|
||||||
@ -324,6 +352,51 @@ public class ResultRecord implements java.io.Serializable {
|
|||||||
this.scoreLevel = scoreLevel;
|
this.scoreLevel = scoreLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起考核次数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Long getStartId() {
|
||||||
|
return startId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 发起考核次数
|
||||||
|
* @param startId
|
||||||
|
*/
|
||||||
|
public void setStartId(Long startId) {
|
||||||
|
this.startId = startId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前是目标确认还是评分,0,目标制定,1,目标确认,2执行中,3,结果值录入,4,评分,5考核结束
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer getFlowProcess() {
|
||||||
|
return flowProcess;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 当前是目标确认还是评分,0,目标制定,1,目标确认,2执行中,3,结果值录入,4,评分,5考核结束
|
||||||
|
* @param flowProcess
|
||||||
|
*/
|
||||||
|
public void setFlowProcess(Integer flowProcess) {
|
||||||
|
this.flowProcess = flowProcess;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考核组id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Long getEvaluationId() {
|
||||||
|
return evaluationId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 考核组id
|
||||||
|
* @param evaluationId
|
||||||
|
*/
|
||||||
|
public void setEvaluationId(Long evaluationId) {
|
||||||
|
this.evaluationId = evaluationId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ResultRecord{" +
|
return "ResultRecord{" +
|
||||||
@ -345,6 +418,9 @@ public class ResultRecord implements java.io.Serializable {
|
|||||||
",currentApprovalStaffId=" + currentApprovalStaffId +
|
",currentApprovalStaffId=" + currentApprovalStaffId +
|
||||||
",currentApprovalStaffName=" + currentApprovalStaffName +
|
",currentApprovalStaffName=" + currentApprovalStaffName +
|
||||||
",scoreLevel=" + scoreLevel +
|
",scoreLevel=" + scoreLevel +
|
||||||
|
",startId=" + startId +
|
||||||
|
",flowProcess=" + flowProcess +
|
||||||
|
",evaluationId=" + evaluationId +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,4 +65,6 @@ public interface ResultDetailService extends IService<ResultDetail> {
|
|||||||
String getScoreLevel(double doubleValue);
|
String getScoreLevel(double doubleValue);
|
||||||
|
|
||||||
List<ResultDetail> selectByRecordIdAndType(Long id, int i);
|
List<ResultDetail> selectByRecordIdAndType(Long id, int i);
|
||||||
|
|
||||||
|
Long insertResultDetails(List<ResultDetail> resultDetails);
|
||||||
}
|
}
|
||||||
@ -81,6 +81,8 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
private FlowRecordService flowRecordService;
|
private FlowRecordService flowRecordService;
|
||||||
|
|
||||||
|
|
||||||
|
static int maxInsertSQL = 100;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long insertResultDetail(ResultDetail resultDetail){
|
public Long insertResultDetail(ResultDetail resultDetail){
|
||||||
return resultDetailMapper.insertResultDetail(resultDetail);
|
return resultDetailMapper.insertResultDetail(resultDetail);
|
||||||
@ -306,4 +308,11 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
return resultDetailMapper.selectByRecordIdType(id,type);
|
return resultDetailMapper.selectByRecordIdType(id,type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long insertResultDetails(List<ResultDetail> resultDetails){
|
||||||
|
if(resultDetails.size() <= maxInsertSQL){
|
||||||
|
return resultDetailMapper.insertResultDetails(resultDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -145,5 +145,35 @@
|
|||||||
and record_id = #{recordId} and staff_id = #{staffId} and type = #{type}
|
and record_id = #{recordId} and staff_id = #{staffId} and type = #{type}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertResultDetails" parameterType="ResultDetail" useGeneratedKeys="true" keyProperty="id" >
|
||||||
|
insert into lz_result_detail(
|
||||||
|
type,
|
||||||
|
target,
|
||||||
|
key_result,
|
||||||
|
check_weight,
|
||||||
|
check_result,
|
||||||
|
super_score,
|
||||||
|
acquire_score,
|
||||||
|
score_comment,
|
||||||
|
record_id,
|
||||||
|
staff_id,
|
||||||
|
priority,
|
||||||
|
is_delete
|
||||||
|
)values(
|
||||||
|
#{ type},
|
||||||
|
#{ target},
|
||||||
|
#{ keyResult},
|
||||||
|
#{ checkWeight},
|
||||||
|
#{ checkResult},
|
||||||
|
#{ superScore},
|
||||||
|
#{ acquireScore},
|
||||||
|
#{ scoreComment},
|
||||||
|
#{ recordId},
|
||||||
|
#{ staffId},
|
||||||
|
#{ priority},
|
||||||
|
0
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.lz.modules.sys.dao.app.ResultRecordMapper">
|
<mapper namespace="com.lz.modules.app.dao.ResultRecordMapper">
|
||||||
|
|
||||||
<!-- 通用查询映射结果 -->
|
<!-- 通用查询映射结果 -->
|
||||||
<resultMap id="BaseResultMap" type="com.lz.modules.sys.entity.app.ResultRecord">
|
<resultMap id="BaseResultMap" type="com.lz.modules.sys.entity.app.ResultRecord">
|
||||||
@ -22,12 +22,15 @@
|
|||||||
<result column="current_approval_staff_id" property="currentApprovalStaffId"/>
|
<result column="current_approval_staff_id" property="currentApprovalStaffId"/>
|
||||||
<result column="current_approval_staff_name" property="currentApprovalStaffName"/>
|
<result column="current_approval_staff_name" property="currentApprovalStaffName"/>
|
||||||
<result column="score_level" property="scoreLevel"/>
|
<result column="score_level" property="scoreLevel"/>
|
||||||
|
<result column="start_id" property="startId"/>
|
||||||
|
<result column="flow_process" property="flowProcess"/>
|
||||||
|
<result column="evaluation_id" property="evaluationId"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, month_time AS monthTime, status AS status, last_score AS lastScore, all_score AS allScore, remark AS remark, staff_id AS staffId, type AS type, flow_staff_id_role AS flowStaffIdRole, department_id AS departmentId, department_name AS departmentName, staff_name AS staffName, current_approval_staff_id AS currentApprovalStaffId, current_approval_staff_name AS currentApprovalStaffName, score_level AS scoreLevel
|
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, month_time AS monthTime, status AS status, last_score AS lastScore, all_score AS allScore, remark AS remark, staff_id AS staffId, type AS type, flow_staff_id_role AS flowStaffIdRole, department_id AS departmentId, department_name AS departmentName, staff_name AS staffName, current_approval_staff_id AS currentApprovalStaffId, current_approval_staff_name AS currentApprovalStaffName, score_level AS scoreLevel, start_id AS startId, flow_process AS flowProcess, evaluation_id AS evaluationId
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
@ -54,6 +57,9 @@
|
|||||||
<if test="currentApprovalStaffId != null">current_approval_staff_id, </if>
|
<if test="currentApprovalStaffId != null">current_approval_staff_id, </if>
|
||||||
<if test="currentApprovalStaffName != null">current_approval_staff_name, </if>
|
<if test="currentApprovalStaffName != null">current_approval_staff_name, </if>
|
||||||
<if test="scoreLevel != null">score_level, </if>
|
<if test="scoreLevel != null">score_level, </if>
|
||||||
|
<if test="startId != null">start_id, </if>
|
||||||
|
<if test="flowProcess != null">flow_process, </if>
|
||||||
|
<if test="evaluationId != null">evaluation_id, </if>
|
||||||
is_delete,
|
is_delete,
|
||||||
gmt_create,
|
gmt_create,
|
||||||
gmt_modified
|
gmt_modified
|
||||||
@ -72,6 +78,9 @@
|
|||||||
<if test="currentApprovalStaffId != null">#{ currentApprovalStaffId}, </if>
|
<if test="currentApprovalStaffId != null">#{ currentApprovalStaffId}, </if>
|
||||||
<if test="currentApprovalStaffName != null">#{ currentApprovalStaffName}, </if>
|
<if test="currentApprovalStaffName != null">#{ currentApprovalStaffName}, </if>
|
||||||
<if test="scoreLevel != null">#{ scoreLevel}, </if>
|
<if test="scoreLevel != null">#{ scoreLevel}, </if>
|
||||||
|
<if test="startId != null">#{ startId}, </if>
|
||||||
|
<if test="flowProcess != null">#{ flowProcess}, </if>
|
||||||
|
<if test="evaluationId != null">#{ evaluationId}, </if>
|
||||||
0,
|
0,
|
||||||
now(),
|
now(),
|
||||||
now()
|
now()
|
||||||
@ -98,7 +107,10 @@
|
|||||||
<if test="staffName != null">staff_name = #{staffName},</if>
|
<if test="staffName != null">staff_name = #{staffName},</if>
|
||||||
<if test="currentApprovalStaffId != null">current_approval_staff_id = #{currentApprovalStaffId},</if>
|
<if test="currentApprovalStaffId != null">current_approval_staff_id = #{currentApprovalStaffId},</if>
|
||||||
<if test="currentApprovalStaffName != null">current_approval_staff_name = #{currentApprovalStaffName},</if>
|
<if test="currentApprovalStaffName != null">current_approval_staff_name = #{currentApprovalStaffName},</if>
|
||||||
<if test="scoreLevel != null">score_level = #{scoreLevel}</if>
|
<if test="scoreLevel != null">score_level = #{scoreLevel},</if>
|
||||||
|
<if test="startId != null">start_id = #{startId},</if>
|
||||||
|
<if test="flowProcess != null">flow_process = #{flowProcess},</if>
|
||||||
|
<if test="evaluationId != null">evaluation_id = #{evaluationId}</if>
|
||||||
</trim>
|
</trim>
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -124,7 +136,10 @@
|
|||||||
staff_name = #{staffName},
|
staff_name = #{staffName},
|
||||||
current_approval_staff_id = #{currentApprovalStaffId},
|
current_approval_staff_id = #{currentApprovalStaffId},
|
||||||
current_approval_staff_name = #{currentApprovalStaffName},
|
current_approval_staff_name = #{currentApprovalStaffName},
|
||||||
score_level = #{scoreLevel}
|
score_level = #{scoreLevel},
|
||||||
|
start_id = #{startId},
|
||||||
|
flow_process = #{flowProcess},
|
||||||
|
evaluation_id = #{evaluationId}
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@ -134,7 +149,6 @@
|
|||||||
update lz_result_record set is_delete = 1 where id=#{id} limit 1
|
update lz_result_record set is_delete = 1 where id=#{id} limit 1
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<update id="deleteResultRecordById2" parameterType="java.lang.Long">
|
<update id="deleteResultRecordById2" parameterType="java.lang.Long">
|
||||||
update lz_result_record set is_delete = 2 where id=#{id} limit 1
|
update lz_result_record set is_delete = 2 where id=#{id} limit 1
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
@ -13,12 +13,13 @@
|
|||||||
<result column="staff_id" property="staffId"/>
|
<result column="staff_id" property="staffId"/>
|
||||||
<result column="type" property="type"/>
|
<result column="type" property="type"/>
|
||||||
<result column="score" property="score"/>
|
<result column="score" property="score"/>
|
||||||
|
<result column="evaluation_name" property="evaluationName"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, evaluation_id AS evaluationId, start_id AS startId, staff_id AS staffId, type AS type, score AS score
|
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, evaluation_id AS evaluationId, start_id AS startId, staff_id AS staffId, type AS type, score AS score, evaluation_name AS evaluationName
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
@ -36,6 +37,7 @@
|
|||||||
<if test="staffId != null">staff_id, </if>
|
<if test="staffId != null">staff_id, </if>
|
||||||
<if test="type != null">type, </if>
|
<if test="type != null">type, </if>
|
||||||
<if test="score != null">score, </if>
|
<if test="score != null">score, </if>
|
||||||
|
<if test="evaluationName != null">evaluation_name, </if>
|
||||||
is_delete,
|
is_delete,
|
||||||
gmt_create,
|
gmt_create,
|
||||||
gmt_modified
|
gmt_modified
|
||||||
@ -45,6 +47,7 @@
|
|||||||
<if test="staffId != null">#{ staffId}, </if>
|
<if test="staffId != null">#{ staffId}, </if>
|
||||||
<if test="type != null">#{ type}, </if>
|
<if test="type != null">#{ type}, </if>
|
||||||
<if test="score != null">#{ score}, </if>
|
<if test="score != null">#{ score}, </if>
|
||||||
|
<if test="evaluationName != null">#{ evaluationName}, </if>
|
||||||
0,
|
0,
|
||||||
now(),
|
now(),
|
||||||
now()
|
now()
|
||||||
@ -62,7 +65,8 @@
|
|||||||
<if test="startId != null">start_id = #{startId},</if>
|
<if test="startId != null">start_id = #{startId},</if>
|
||||||
<if test="staffId != null">staff_id = #{staffId},</if>
|
<if test="staffId != null">staff_id = #{staffId},</if>
|
||||||
<if test="type != null">type = #{type},</if>
|
<if test="type != null">type = #{type},</if>
|
||||||
<if test="score != null">score = #{score}</if>
|
<if test="score != null">score = #{score},</if>
|
||||||
|
<if test="evaluationName != null">evaluation_name = #{evaluationName}</if>
|
||||||
</trim>
|
</trim>
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -79,14 +83,17 @@
|
|||||||
start_id = #{startId},
|
start_id = #{startId},
|
||||||
staff_id = #{staffId},
|
staff_id = #{staffId},
|
||||||
type = #{type},
|
type = #{type},
|
||||||
score = #{score}
|
score = #{score},
|
||||||
|
evaluation_name = #{evaluationName}
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<update id="deleteEvaluationStartStaffById" parameterType="java.lang.Long">
|
<update id="deleteEvaluationStartStaffById" parameterType="java.lang.Long">
|
||||||
update lz_evaluation_start_staff set is_delete = 1 where id=#{id} limit 1
|
update lz_evaluation_start_staff set is_delete = 1 where id=#{id} limit 1
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertEvaluationStartStaffs" parameterType="EvaluationStartStaff" useGeneratedKeys="true" keyProperty="id" >
|
<insert id="insertEvaluationStartStaffs" parameterType="EvaluationStartStaff" useGeneratedKeys="true" keyProperty="id" >
|
||||||
|
|
||||||
insert into lz_evaluation_start_staff(
|
insert into lz_evaluation_start_staff(
|
||||||
@ -94,6 +101,7 @@
|
|||||||
start_id,
|
start_id,
|
||||||
staff_id,
|
staff_id,
|
||||||
type,
|
type,
|
||||||
|
evaluation_name,
|
||||||
is_delete
|
is_delete
|
||||||
)values
|
)values
|
||||||
<foreach collection="list" item="item" separator=",">(
|
<foreach collection="list" item="item" separator=",">(
|
||||||
@ -101,6 +109,7 @@
|
|||||||
#{ item.startId},
|
#{ item.startId},
|
||||||
#{ item.staffId},
|
#{ item.staffId},
|
||||||
#{ item.type},
|
#{ item.type},
|
||||||
|
#{ item.evaluationName},
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
@ -14,12 +14,13 @@
|
|||||||
<result column="flow_id" property="flowId"/>
|
<result column="flow_id" property="flowId"/>
|
||||||
<result column="step_type" property="stepType"/>
|
<result column="step_type" property="stepType"/>
|
||||||
<result column="approval_type" property="approvalType"/>
|
<result column="approval_type" property="approvalType"/>
|
||||||
|
<result column="step_index" property="stepIndex"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, approval_id AS approvalId, type AS type, role_id AS roleId, flow_id AS flowId, step_type AS stepType, approval_type AS approvalType
|
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, approval_id AS approvalId, type AS type, role_id AS roleId, flow_id AS flowId, step_type AS stepType, approval_type AS approvalType, step_index AS stepIndex
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
@ -38,6 +39,7 @@
|
|||||||
<if test="flowId != null">flow_id, </if>
|
<if test="flowId != null">flow_id, </if>
|
||||||
<if test="stepType != null">step_type, </if>
|
<if test="stepType != null">step_type, </if>
|
||||||
<if test="approvalType != null">approval_type, </if>
|
<if test="approvalType != null">approval_type, </if>
|
||||||
|
<if test="stepIndex != null">step_index, </if>
|
||||||
is_delete,
|
is_delete,
|
||||||
gmt_create,
|
gmt_create,
|
||||||
gmt_modified
|
gmt_modified
|
||||||
@ -48,6 +50,7 @@
|
|||||||
<if test="flowId != null">#{ flowId}, </if>
|
<if test="flowId != null">#{ flowId}, </if>
|
||||||
<if test="stepType != null">#{ stepType}, </if>
|
<if test="stepType != null">#{ stepType}, </if>
|
||||||
<if test="approvalType != null">#{ approvalType}, </if>
|
<if test="approvalType != null">#{ approvalType}, </if>
|
||||||
|
<if test="stepIndex != null">#{ stepIndex}, </if>
|
||||||
0,
|
0,
|
||||||
now(),
|
now(),
|
||||||
now()
|
now()
|
||||||
@ -66,7 +69,8 @@
|
|||||||
<if test="roleId != null">role_id = #{roleId},</if>
|
<if test="roleId != null">role_id = #{roleId},</if>
|
||||||
<if test="flowId != null">flow_id = #{flowId},</if>
|
<if test="flowId != null">flow_id = #{flowId},</if>
|
||||||
<if test="stepType != null">step_type = #{stepType},</if>
|
<if test="stepType != null">step_type = #{stepType},</if>
|
||||||
<if test="approvalType != null">approval_type = #{approvalType}</if>
|
<if test="approvalType != null">approval_type = #{approvalType},</if>
|
||||||
|
<if test="stepIndex != null">step_index = #{stepIndex}</if>
|
||||||
</trim>
|
</trim>
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -84,7 +88,8 @@
|
|||||||
role_id = #{roleId},
|
role_id = #{roleId},
|
||||||
flow_id = #{flowId},
|
flow_id = #{flowId},
|
||||||
step_type = #{stepType},
|
step_type = #{stepType},
|
||||||
approval_type = #{approvalType}
|
approval_type = #{approvalType},
|
||||||
|
step_index = #{stepIndex}
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@ -103,6 +108,7 @@
|
|||||||
flow_id,
|
flow_id,
|
||||||
step_type,
|
step_type,
|
||||||
approval_type,
|
approval_type,
|
||||||
|
step_index,
|
||||||
is_delete
|
is_delete
|
||||||
)values
|
)values
|
||||||
<foreach collection="list" item="item" separator=",">(
|
<foreach collection="list" item="item" separator=",">(
|
||||||
@ -112,6 +118,7 @@
|
|||||||
#{ item.flowId},
|
#{ item.flowId},
|
||||||
#{ item.stepType},
|
#{ item.stepType},
|
||||||
#{ item.approvalType},
|
#{ item.approvalType},
|
||||||
|
#{ item.stepIndex},
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
@ -154,7 +154,21 @@
|
|||||||
where d1.department_id = #{departmentId}
|
where d1.department_id = #{departmentId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEntityByDepartmentIds" resultType="com.lz.modules.app.entity.DepartmentsEntity">
|
||||||
|
select * from lz_departments where department_id in (
|
||||||
|
<foreach collection="dIds" item="item" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEntityByParentDepartmentIds" resultType="com.lz.modules.app.entity.DepartmentsEntity">
|
||||||
|
select * from lz_departments where department_parent_id in (
|
||||||
|
<foreach collection="dIds" item="item" separator=",">
|
||||||
|
#{item.departmentId}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -479,4 +479,26 @@
|
|||||||
join lz_staff_occupation occ on jj.staff_id=occ.staff_id where occ.staff_status=0 and occ.is_delete=0
|
join lz_staff_occupation occ on jj.staff_id=occ.staff_id where occ.staff_status=0 and occ.is_delete=0
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAllStaffSimpleInfos" resultType="com.lz.modules.app.entity.StaffSimpleInfo">
|
||||||
|
select staff.id as id, staff.job_number as job_number, staff.name as name, occupation.position as position
|
||||||
|
, #{depart.departmentId} as department_id, #{depart.departmentName} as department_name
|
||||||
|
from lz_staff staff join lz_staff_occupation occupation on staff.id=occupation.staff_id where staff.id in (
|
||||||
|
select staff_id from lz_departments_staff_relate where department_id = #{depart.departmentId}
|
||||||
|
) and occupation.staff_status=0
|
||||||
|
</select>
|
||||||
|
<select id="selectStaffSimpleInfos" resultType="com.lz.modules.app.entity.StaffSimpleInfo">
|
||||||
|
select info.id as id, info.job_number as job_number, info.name as name, info.position,
|
||||||
|
info.department_id as department_id, dep.department_name as department_name from (
|
||||||
|
select staffinfo.id as id, staffinfo.job_number as job_number, staffinfo.name as name,
|
||||||
|
staffinfo.position, relate.department_id as department_id from (
|
||||||
|
select staff.id as id, staff.job_number as job_number, staff.name as name, occupation.position as position
|
||||||
|
from lz_staff staff join lz_staff_occupation occupation on staff.id=occupation.staff_id where staff.id in (
|
||||||
|
<foreach collection="sIds" item="item" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
) and occupation.staff_status=0
|
||||||
|
) as staffinfo left join lz_departments_staff_relate relate on staffinfo.id = relate.staff_id
|
||||||
|
) as info left join lz_departments dep on info.department_id = dep.department_id GROUP BY info.id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -5,9 +5,9 @@ import org.springframework.util.ResourceUtils;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class MysqlMain {
|
public class MysqlMain {
|
||||||
|
|
||||||
@ -51,6 +51,20 @@ public class MysqlMain {
|
|||||||
*/
|
*/
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
|
/*List<TestMap> testMaps = new ArrayList<>();
|
||||||
|
TestMap test = new TestMap();
|
||||||
|
test.setName("123");
|
||||||
|
test.setMobile("18969093321");
|
||||||
|
testMaps.add(test);
|
||||||
|
|
||||||
|
test = new TestMap();
|
||||||
|
test.setName("123");
|
||||||
|
test.setMobile("18969093321");
|
||||||
|
testMaps.add(test);
|
||||||
|
|
||||||
|
Map<String, TestMap> t = testMaps.stream().collect(Collectors.toMap(TestMap::getName, testMap -> testMap));*/
|
||||||
|
|
||||||
|
|
||||||
String path = ResourceUtils.getURL("classpath:").getPath();
|
String path = ResourceUtils.getURL("classpath:").getPath();
|
||||||
System.out.println(path);
|
System.out.println(path);
|
||||||
String dir = null;
|
String dir = null;
|
||||||
@ -82,7 +96,7 @@ public class MysqlMain {
|
|||||||
//list.add(new TablesBean("lz_flow_chart_detail_record"));
|
//list.add(new TablesBean("lz_flow_chart_detail_record"));
|
||||||
//list.add(new TablesBean("lz_flow_approval_role"));
|
//list.add(new TablesBean("lz_flow_approval_role"));
|
||||||
|
|
||||||
list.add(new TablesBean("lz_flow"));
|
list.add(new TablesBean("lz_evaluation_start_staff"));
|
||||||
|
|
||||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||||
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user