Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
97a5f62a62
@ -55,4 +55,6 @@ public interface DepartmentsDao extends BaseMapper<DepartmentsEntity> {
|
||||
List<DepartmentsEntity> selectEntityByDepartmentIds(@Param("dIds") List<String> dIds);
|
||||
|
||||
List<DepartmentsEntity> selectEntityByParentDepartmentIds(@Param("dIds") List<DepartmentsEntity> dIds);
|
||||
|
||||
DepartmentsEntity selectParentDepartmentByDepartmentId(String departmentId);
|
||||
}
|
||||
|
||||
@ -64,4 +64,6 @@ public interface DepartmentsStaffRelateDao extends BaseMapper<DepartmentsStaffRe
|
||||
List<ReportProgressListDto> getDepartmentNameByStaffIds(@Param("staffIds") List<String> staffIds);
|
||||
|
||||
List<String> selectStaffIdsByDepartments(@Param("deparmentIds")List<String> deparmentIds);
|
||||
|
||||
List<StaffEntity> selectLeadersByDepartmentId(@Param("depId") String depId);
|
||||
}
|
||||
|
||||
@ -90,4 +90,6 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
|
||||
List<StaffSimpleInfo> selectAllStaffSimpleInfos(@Param("depart") DepartmentsEntity depart);
|
||||
|
||||
List<StaffSimpleInfo> selectStaffSimpleInfos(@Param("sIds") List<Long> sIds);
|
||||
|
||||
List<StaffEntity> selectOnJobByIds(@Param("mIds") List<Long> mIds);
|
||||
}
|
||||
|
||||
@ -42,6 +42,8 @@ public class StaffSimpleInfo implements Serializable {
|
||||
private String departmentName;
|
||||
//部门id
|
||||
private String departmentId;
|
||||
//钉钉,飞书等第三方人员id
|
||||
private String employeeId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -54,5 +54,8 @@ public interface DepartmentsService extends IService<DepartmentsEntity> {
|
||||
List<DepartmentsDto> getDepartmentTreeByStaffId(String staffId,boolean containSelf);
|
||||
|
||||
List<DepartmentsEntity> selectAllDepartmentIds(List<String> dIds);
|
||||
|
||||
//查找父级部门
|
||||
DepartmentsEntity selectParentDepartmentByDepartmentId(String departmentId);
|
||||
}
|
||||
|
||||
|
||||
@ -42,5 +42,7 @@ public interface DepartmentsStaffRelateService extends IService<DepartmentsStaff
|
||||
DepartmentsStaffRelateEntity selectByStaffId(Long staffId);
|
||||
|
||||
List<String> selectStaffIdsByDepartments(List<String> deparmentIds);
|
||||
|
||||
List<StaffEntity> selectLeadersByDepartmentId(String depId);
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import com.lz.modules.app.entity.DepartmentsEntity;
|
||||
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.flow.model.DepartManagers;
|
||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||
import com.lz.modules.sys.entity.SysUserEntity;
|
||||
|
||||
@ -92,5 +93,9 @@ public interface StaffService extends IService<StaffEntity> {
|
||||
List<StaffSimpleInfo> selectAllStaffSimpleInfos(DepartmentsEntity depart);
|
||||
|
||||
List<StaffSimpleInfo> selectStaffSimpleInfos(List<Long> sIds);
|
||||
//查找第几及领导
|
||||
DepartManagers findLeader(Long id, Integer type);
|
||||
//查找在职的
|
||||
List<StaffEntity> selectOnJobByIds(List<Long> mIds);
|
||||
}
|
||||
|
||||
|
||||
@ -290,5 +290,10 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DepartmentsEntity selectParentDepartmentByDepartmentId(String departmentId){
|
||||
return departmentsDao.selectParentDepartmentByDepartmentId(departmentId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.lz.modules.app.service.impl;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -100,4 +101,9 @@ public class DepartmentsStaffRelateServiceImpl extends ServiceImpl<DepartmentsSt
|
||||
}
|
||||
return departmentsStaffRelateDao.selectStaffIdsByDepartments(deparmentIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StaffEntity> selectLeadersByDepartmentId(String depId){
|
||||
return departmentsStaffRelateDao.selectLeadersByDepartmentId(depId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,8 +13,10 @@ import com.lz.modules.app.dao.StaffDao;
|
||||
import com.lz.modules.app.entity.*;
|
||||
import com.lz.modules.app.service.*;
|
||||
import com.lz.modules.equipment.entity.model.FindByNameModel;
|
||||
import com.lz.modules.flow.model.DepartManagers;
|
||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||
import com.lz.modules.sys.entity.SysUserEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -32,6 +34,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service("staffService")
|
||||
@Slf4j
|
||||
public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> implements StaffService {
|
||||
|
||||
protected final static org.slf4j.Logger logger = LoggerFactory.getLogger(StaffServiceImpl.class);
|
||||
@ -463,5 +466,52 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
||||
return staffDao.selectStaffSimpleInfos(sIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
//查找第几及领导
|
||||
public DepartManagers findLeader(Long id, Integer type){
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectByStaffId(id);
|
||||
DepartManagers departManagers = new DepartManagers();
|
||||
if(departmentsStaffRelateEntity != null){
|
||||
if(departmentsStaffRelateEntity.getIsLeader().intValue() == 1
|
||||
& departmentsStaffRelateEntity.getStaffId().longValue() == id.longValue()){
|
||||
//自己是部门领导
|
||||
type++;
|
||||
}
|
||||
String depId = departmentsStaffRelateEntity.getDepartmentId();
|
||||
departManagers.setDepartmentId(depId);
|
||||
while(type > 1){
|
||||
//查找父级部门
|
||||
DepartmentsEntity departmentsEntity =
|
||||
departmentsService.selectParentDepartmentByDepartmentId(depId);
|
||||
if(departmentsEntity != null){
|
||||
depId = departmentsEntity.getDepartmentId();
|
||||
}else{
|
||||
log.info("没有找到父级部门,部门id{}", depId);
|
||||
departManagers.setManagers(new ArrayList<>());
|
||||
}
|
||||
type--;
|
||||
}
|
||||
List<StaffEntity> staffEntities =
|
||||
departmentsStaffRelateService.selectLeadersByDepartmentId(depId);
|
||||
departManagers.setManagers(staffEntities);
|
||||
if(staffEntities.size() == 0){
|
||||
log.info("无法找到管理人员.部门id{}", depId);
|
||||
}
|
||||
|
||||
return departManagers;
|
||||
|
||||
|
||||
}
|
||||
log.info("没有找到部门信息,员工id{}", id);
|
||||
departManagers.setManagers(new ArrayList<>());
|
||||
return departManagers;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StaffEntity> selectOnJobByIds(List<Long> mIds){
|
||||
return staffDao.selectOnJobByIds(mIds);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -35,4 +35,5 @@ public interface FlowStartMapper extends BaseMapper<FlowStart> {
|
||||
|
||||
List<FlowStart> selectListByTime(@Param("page") IPage page, @Param("cycleType")Integer cycleType,@Param("name")String name);
|
||||
|
||||
FlowStart selectFlowStartByName(@Param("name") String name);
|
||||
}
|
||||
@ -9,6 +9,7 @@ package com.lz.modules.flow.dao;
|
||||
*/
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.modules.flow.entity.ResultModel;
|
||||
import com.lz.modules.flow.entity.ResultTagetLib;
|
||||
import com.lz.modules.flow.model.ResultModelDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -39,4 +40,5 @@ public interface ResultModelMapper extends BaseMapper<ResultModel> {
|
||||
List<ResultModelDto> selectResultDtoByGroupId(Long id);
|
||||
|
||||
int deleteResultModelByGroupId(Long id);
|
||||
|
||||
}
|
||||
@ -48,4 +48,6 @@ public interface ResultTagetLibMapper extends BaseMapper<ResultTagetLib> {
|
||||
int updateResultTagetLibByIds(@Param("list") List<ResultTagetLib> inserts);
|
||||
|
||||
List<ResultTagetLibItemReq> selectResultTagetLibByModelReqId(Long id);
|
||||
|
||||
List<ResultTagetLibDto> selectResultTagetLibDtoByModelId(Long id);
|
||||
}
|
||||
@ -49,6 +49,9 @@ public class EvaluationGroup implements java.io.Serializable {
|
||||
@ApiModelProperty(value = "排除人员ids,逗号隔开", name = "outIds")
|
||||
private String outIds;
|
||||
|
||||
@ApiModelProperty(value = "本记录被拷贝的id,每次发起绩效备份一份copy_id表示被复制的那份id。发起后所有相关逻辑表使用的是拷贝后新生成的ID。绩效考核流程中,如果原考评组有人员变动,该拷贝也将变动", name = "copyId")
|
||||
private Long copyId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "参与考核人数", name = "counts")
|
||||
private int counts;
|
||||
@ -201,6 +204,7 @@ public class EvaluationGroup implements java.io.Serializable {
|
||||
",depIds=" + depIds +
|
||||
",staffIds=" + staffIds +
|
||||
",outIds=" + outIds +
|
||||
",copyId=" + copyId +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,7 @@ public class FlowApprovalRole implements java.io.Serializable {
|
||||
@ApiModelProperty(value = "审批用户id", name = "approvalId")
|
||||
private Long approvalId;
|
||||
//0表示指定员工,1表示1级主管,2表示二级主管....
|
||||
@ApiModelProperty(value = "0表示指定员工,1表示1级主管,2表示二级主管....", name = "type")
|
||||
@ApiModelProperty(value = "-1考核人员自己,0表示指定员工,1表示1级主管,2表示二级主管....", name = "type")
|
||||
private Integer type;
|
||||
//审批人角色id
|
||||
@ApiModelProperty(value = "审批人角色id", name = "roleId")
|
||||
@ -44,9 +44,7 @@ public class FlowApprovalRole implements java.io.Serializable {
|
||||
//步骤类型0:依次,1:或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可)
|
||||
@ApiModelProperty(value = "步骤类型0:依次,1:或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可)", name = "stepType")
|
||||
private Integer stepType;
|
||||
//-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||
@ApiModelProperty(value = "-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....", name = "approvalType")
|
||||
private Integer approvalType;
|
||||
|
||||
//小结点的第几步,从0开始,如果是多人,步数相同
|
||||
@ApiModelProperty(value = "小结点的第几步,从0开始,如果是多人,步数相同", name = "stepIndex")
|
||||
private Integer stepIndex;
|
||||
@ -185,20 +183,7 @@ public class FlowApprovalRole implements java.io.Serializable {
|
||||
this.stepType = stepType;
|
||||
}
|
||||
|
||||
/**
|
||||
* -1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||
* @return
|
||||
*/
|
||||
public Integer getApprovalType() {
|
||||
return approvalType;
|
||||
}
|
||||
/**
|
||||
* -1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||
* @param approvalType
|
||||
*/
|
||||
public void setApprovalType(Integer approvalType) {
|
||||
this.approvalType = approvalType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 小结点的第几步,从0开始,如果是多人,步数相同
|
||||
@ -227,7 +212,6 @@ public class FlowApprovalRole implements java.io.Serializable {
|
||||
",roleId=" + roleId +
|
||||
",flowId=" + flowId +
|
||||
",stepType=" + stepType +
|
||||
",approvalType=" + approvalType +
|
||||
",stepIndex=" + stepIndex +
|
||||
"}";
|
||||
}
|
||||
|
||||
12
src/main/java/com/lz/modules/flow/model/DepartManagers.java
Normal file
12
src/main/java/com/lz/modules/flow/model/DepartManagers.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.lz.modules.flow.model;
|
||||
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DepartManagers {
|
||||
private String departmentId;
|
||||
private List<StaffEntity> managers;
|
||||
}
|
||||
@ -19,7 +19,7 @@ public class FlowApprovalRoleDto {
|
||||
@ApiModelProperty(value = "审批用户id", name = "approvalId")
|
||||
private Long approvalId;
|
||||
//0表示指定员工,1表示1级主管,2表示二级主管....
|
||||
@ApiModelProperty(value = "0表示指定员工,1表示1级主管,2表示二级主管....", name = "type")
|
||||
@ApiModelProperty(value = "-1考核人员自己,0表示指定员工,1表示1级主管,2表示二级主管....", name = "type")
|
||||
private Integer type;
|
||||
//审批人角色id
|
||||
@ApiModelProperty(value = "审批人角色id", name = "roleId")
|
||||
@ -30,9 +30,7 @@ public class FlowApprovalRoleDto {
|
||||
//步骤类型0:依次,1:或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可)
|
||||
@ApiModelProperty(value = "步骤类型0:依次,1:或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可)", name = "stepType")
|
||||
private Integer stepType;
|
||||
//-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||
@ApiModelProperty(value = "-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....", name = "approvalType")
|
||||
private Integer approvalType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -123,20 +121,7 @@ public class FlowApprovalRoleDto {
|
||||
this.stepType = stepType;
|
||||
}
|
||||
|
||||
/**
|
||||
* -1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||
* @return
|
||||
*/
|
||||
public Integer getApprovalType() {
|
||||
return approvalType;
|
||||
}
|
||||
/**
|
||||
* -1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||
* @param approvalType
|
||||
*/
|
||||
public void setApprovalType(Integer approvalType) {
|
||||
this.approvalType = approvalType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -147,7 +132,6 @@ public class FlowApprovalRoleDto {
|
||||
",roleId=" + roleId +
|
||||
",flowId=" + flowId +
|
||||
",stepType=" + stepType +
|
||||
",approvalType=" + approvalType +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,7 @@ public class FlowApprovalRoleReq implements java.io.Serializable {
|
||||
@ApiModelProperty(value = "审批用户id", name = "approvalId")
|
||||
private Long approvalId;
|
||||
//0表示指定员工,1表示1级主管,2表示二级主管....
|
||||
@ApiModelProperty(value = "0表示指定员工,1表示1级主管,2表示二级主管....", name = "type")
|
||||
@ApiModelProperty(value = "-1考核人员自己,0表示指定员工,1表示1级主管,2表示二级主管....", name = "type")
|
||||
private Integer type;
|
||||
//审批人角色id
|
||||
@ApiModelProperty(value = "审批人角色id", name = "roleId")
|
||||
@ -53,9 +53,7 @@ public class FlowApprovalRoleReq implements java.io.Serializable {
|
||||
//步骤类型0:依次,1:或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可)
|
||||
@ApiModelProperty(value = "步骤类型0:依次,1:或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可)", name = "stepType")
|
||||
private Integer stepType;
|
||||
//-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||
@ApiModelProperty(value = "-1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....", name = "approvalType")
|
||||
private Integer approvalType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -191,20 +189,7 @@ public class FlowApprovalRoleReq implements java.io.Serializable {
|
||||
this.stepType = stepType;
|
||||
}
|
||||
|
||||
/**
|
||||
* -1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||
* @return
|
||||
*/
|
||||
public Integer getApprovalType() {
|
||||
return approvalType;
|
||||
}
|
||||
/**
|
||||
* -1考核人员自己,0指定人员id,此时approval_id有值,1一级主管,2二级主管....
|
||||
* @param approvalType
|
||||
*/
|
||||
public void setApprovalType(Integer approvalType) {
|
||||
this.approvalType = approvalType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -218,7 +203,6 @@ public class FlowApprovalRoleReq implements java.io.Serializable {
|
||||
",roleId=" + roleId +
|
||||
",flowId=" + flowId +
|
||||
",stepType=" + stepType +
|
||||
",approvalType=" + approvalType +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -32,5 +32,5 @@ public interface FlowStartService extends IService<FlowStart> {
|
||||
int deleteFlowStartById(Long id);
|
||||
|
||||
|
||||
|
||||
FlowStart selectFlowStartByName(String name);
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.lz.modules.flow.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.modules.flow.entity.ResultModel;
|
||||
import com.lz.modules.flow.entity.ResultTagetLib;
|
||||
import com.lz.modules.flow.model.ResultModelDto;
|
||||
|
||||
import java.util.List;
|
||||
@ -39,4 +40,5 @@ public interface ResultModelService extends IService<ResultModel> {
|
||||
List<ResultModelDto> selectResultDtoByGroupId(Long id);
|
||||
|
||||
R deleteResultModelByGroupId(Long id);
|
||||
|
||||
}
|
||||
@ -144,6 +144,7 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
@Override
|
||||
public List<StaffSimpleInfo> selectAllStaffSimpleInfoByGroupId(EvaluationGroup evaluationGroup){
|
||||
List<StaffSimpleInfo> staffSimpleInfos = new ArrayList<>();
|
||||
//下面获取部门人员
|
||||
if(!StringUtil.isEmpty(evaluationGroup.getDepIds())){
|
||||
|
||||
|
||||
@ -167,6 +168,7 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
}
|
||||
}
|
||||
|
||||
//下面获取指定人员
|
||||
if(!StringUtil.isEmpty(evaluationGroup.getStaffIds())){
|
||||
|
||||
List<Long> sIds = Arrays.stream(evaluationGroup.getStaffIds()
|
||||
@ -200,6 +202,8 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
staffSimpleInfoMap.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
staffSimpleInfos = staffSimpleInfoMap.values().stream().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@ -58,6 +58,10 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
return flowStartMapper.deleteFlowStartById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlowStart selectFlowStartByName(String name){
|
||||
return flowStartMapper.selectFlowStartByName(name);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -4,13 +4,16 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.modules.flow.dao.ResultModelMapper;
|
||||
import com.lz.modules.flow.entity.ResultModel;
|
||||
import com.lz.modules.flow.entity.ResultTagetLib;
|
||||
import com.lz.modules.flow.model.ResultModelDto;
|
||||
import com.lz.modules.flow.service.ResultModelService;
|
||||
import com.lz.modules.performance.service.ResultTagetLibService;
|
||||
import com.lz.modules.sys.entity.app.ResultDetail;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -32,7 +35,7 @@ public class ResultModelServiceImpl extends ServiceImpl<ResultModelMapper, Resul
|
||||
|
||||
@Autowired
|
||||
private ResultTagetLibService resultTargetLibService;
|
||||
|
||||
private static int maxInsertSQL = 100;
|
||||
|
||||
|
||||
@Override
|
||||
@ -93,4 +96,5 @@ public class ResultModelServiceImpl extends ServiceImpl<ResultModelMapper, Resul
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -7,11 +7,17 @@ import com.lz.common.emun.CheckStaffType;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.entity.StaffSimpleInfo;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.entity.*;
|
||||
import com.lz.modules.flow.model.DepartManagers;
|
||||
import com.lz.modules.flow.model.ResultModelDto;
|
||||
import com.lz.modules.flow.model.ResultTagetLibDto;
|
||||
import com.lz.modules.flow.req.ResultModelItemReq;
|
||||
import com.lz.modules.flow.req.ResultTagetLibItemReq;
|
||||
import com.lz.modules.flow.service.*;
|
||||
import com.lz.modules.performance.service.ResultTagetLibService;
|
||||
import com.lz.modules.sys.entity.app.ResultDetail;
|
||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||
import com.lz.modules.sys.service.app.ResultDetailService;
|
||||
@ -20,9 +26,11 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.apache.commons.collections.map.HashedMap;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collector;
|
||||
@ -65,16 +73,23 @@ public class FlowStartController {
|
||||
@Autowired
|
||||
private ResultDetailService resultDetailService;
|
||||
|
||||
@Autowired
|
||||
private ResultTagetLibService resultTagetLibService;
|
||||
|
||||
@Autowired
|
||||
private StaffService staffService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getById")
|
||||
public R getById(@RequestParam Long id) {
|
||||
public R getById(@RequestParam Long id, @RequestParam int type) {
|
||||
EvaluationGroup evaluationGroup = evaluationGroupService.selectEvaluationGroupById(id);
|
||||
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);
|
||||
//flowStart = flowStartService.selectFlowStartById(flowStart.getId());
|
||||
//List<StaffEntity> staffEntity = staffService.findLeader(id, type);
|
||||
return R.ok().put("data",staffIds);
|
||||
}
|
||||
|
||||
@ -89,8 +104,33 @@ public class FlowStartController {
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("发起新的考核任务")
|
||||
public R save(@RequestBody @ApiParam FlowStart flowStart) {
|
||||
flowStartService.insertFlowStart(flowStart);
|
||||
Map<Long, String> chartNameMaps = new HashedMap();
|
||||
//下面生成或者合并发起绩效
|
||||
if(flowStart.getStartTime() == null){
|
||||
return R.error("未设置有效考核月份");
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月");
|
||||
String startDate = sdf.format(flowStart.getStartTime());
|
||||
|
||||
if(flowStart.getCycleType().intValue() != 0){
|
||||
//月份
|
||||
if(flowStart.getEndTime() == null){
|
||||
return R.error("未设置有效考核结束月份");
|
||||
}
|
||||
String endDate = sdf.format(flowStart.getStartTime());
|
||||
flowStart.setName(startDate + "-" + endDate + "绩效考核");
|
||||
}else{
|
||||
flowStart.setName(startDate + "绩效考核");
|
||||
}
|
||||
FlowStart flowStart1 = flowStartService.selectFlowStartByName(flowStart.getName());
|
||||
if(flowStart1 == null){
|
||||
flowStartService.insertFlowStart(flowStart);
|
||||
}else{
|
||||
flowStart = flowStart1;
|
||||
}
|
||||
|
||||
|
||||
Map<Long, String> chartNameMaps = new HashedMap();//流程节点与流程名称对应map,下面多次循环,减少数据库查找
|
||||
Map<String, List<StaffEntity>> staffManages = new HashedMap();//部门(id+几级)和部门几级管理对应关系,减少数据库查找
|
||||
//下面开始初始化流程
|
||||
List<Long> ids = Arrays.stream(flowStart.getGroupIds().split(",")).map(new Function<String, Long>() {
|
||||
@Override
|
||||
@ -100,28 +140,98 @@ public class FlowStartController {
|
||||
}).collect(Collectors.toList());
|
||||
List<EvaluationGroup> evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids);
|
||||
|
||||
for (EvaluationGroup evaluationGroup:evaluationGroups
|
||||
for (int n = 0; n < evaluationGroups.size(); n++
|
||||
) {
|
||||
EvaluationGroup evaluationGroup = evaluationGroups.get(n);
|
||||
//下面初始化员工考核流程
|
||||
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(n == 0){//如果一个组都没有添加,那么直接删除
|
||||
flowStartService.deleteFlowStartById(flowStart.getId());
|
||||
}
|
||||
|
||||
return R.error(evaluationGroup.getName() + "——无有效考核人员");
|
||||
}
|
||||
List<ResultModelDto> resultModelDtos = resultModelService.selectResultDtoByGroupId(evaluationGroup.getId());
|
||||
if(resultModelDtos.size() == 0){
|
||||
if(n == 0){//如果一个组都没有添加,那么直接删除
|
||||
flowStartService.deleteFlowStartById(flowStart.getId());
|
||||
}
|
||||
return R.error(evaluationGroup.getName() + "——没有设置考核模板");
|
||||
}
|
||||
|
||||
|
||||
List<FlowChartDetailRecord> flowChartDetailRecords
|
||||
= flowChartDetailRecordService.selectFlowChartDetailRecordByGroupId(evaluationGroup.getId());
|
||||
if(flowChartDetailRecords.size() == 0){
|
||||
if(n == 0){//如果一个组都没有添加,那么直接删除
|
||||
flowStartService.deleteFlowStartById(flowStart.getId());
|
||||
}
|
||||
return R.error(evaluationGroup.getName() + "——没有设置考核流程");
|
||||
}
|
||||
|
||||
List<StaffEntity> staffManagers = null;
|
||||
if(!StringUtil.isEmpty(evaluationGroup.getManagerIds())){
|
||||
List<Long> mIds = Arrays.stream(evaluationGroup.getManagerIds().split(","))
|
||||
.map(new Function<String, Long>() {
|
||||
@Override
|
||||
public Long apply(String s) {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
//查找在职的管理人员
|
||||
staffManagers = staffService.selectOnJobByIds(mIds);
|
||||
|
||||
}
|
||||
if(staffManagers == null || staffManagers.size() == 0){
|
||||
if(n == 0){//如果一个组都没有添加,那么直接删除
|
||||
flowStartService.deleteFlowStartById(flowStart.getId());
|
||||
}
|
||||
return R.error(evaluationGroup.getName() + "——没有设置绩效管理人员");
|
||||
}
|
||||
|
||||
//下面拷贝一份考评组信息发起后所使用的考评组id为复制后的id
|
||||
evaluationGroup.setCopyId(evaluationGroup.getId());
|
||||
evaluationGroup.setId(null);
|
||||
evaluationGroup.setGmtCreate(null);
|
||||
evaluationGroup.setGmtModified(null);
|
||||
evaluationGroupService.insertEvaluationGroup(evaluationGroup);
|
||||
|
||||
//拷贝考评组的指标信息
|
||||
List<ResultTagetLib> resultTagetLibs = new ArrayList<>();
|
||||
|
||||
for (ResultModelDto dto:resultModelDtos
|
||||
) {
|
||||
|
||||
|
||||
dto.setEvaluationGroupId(evaluationGroup.getId());//设置拷贝组的id
|
||||
//下面拷贝一份考评组信息的维度信息
|
||||
ResultModel resultModel = new ResultModel();
|
||||
BeanUtils.copyProperties(dto, resultModel);
|
||||
resultModel.setId(null);
|
||||
resultModelService.insertResultModel(resultModel);
|
||||
|
||||
List<ResultTagetLibDto> libDtos = resultTagetLibService.selectResultTagetLibDtoByModelId(dto.getId());
|
||||
dto.setTagetLibs(libDtos);
|
||||
for (ResultTagetLibDto libDto: libDtos
|
||||
) {
|
||||
//下面拷贝考评组里面的指标信息
|
||||
ResultTagetLib resultTagetLib = new ResultTagetLib();
|
||||
BeanUtils.copyProperties(libDto, resultTagetLib);
|
||||
resultTagetLib.setModelId(resultModel.getId());//设置新的维度id
|
||||
resultTagetLib.setId(null);
|
||||
resultTagetLibs.add(resultTagetLib);
|
||||
}
|
||||
}
|
||||
if(resultTagetLibs.size() > 0){
|
||||
//插入备份的考评组指标信息
|
||||
resultTagetLibService.insertResultTagetLibs(resultTagetLibs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//下面初始化lz_flow流程表 lz_flow_approval_role流程审批表
|
||||
List<FlowApprovalRole> flowApprovalRoles = new ArrayList<>();
|
||||
int stepIndex = 0;
|
||||
@ -132,13 +242,15 @@ public class FlowStartController {
|
||||
flow.setOpt("+");
|
||||
flow.setStartId(flowStart.getId());
|
||||
flow.setChartId(flowChartDetailRecord.getChartId());
|
||||
String optName = chartNameMaps.get(flowChartDetailRecord.getChartId());
|
||||
if(optName == null){
|
||||
String optName;
|
||||
if(chartNameMaps.containsKey(flowChartDetailRecord.getChartId())){//缓存
|
||||
optName = chartNameMaps.get(flowChartDetailRecord.getChartId());
|
||||
}else{//查找数据库
|
||||
FlowChart flowChart = flowChartService.selectFlowChartById(flowChartDetailRecord.getChartId());
|
||||
chartNameMaps.put(flowChart.getId(), flowChart.getName());
|
||||
optName = flowChart.getName();
|
||||
}
|
||||
flow.setOpt(optName);
|
||||
flow.setOptDesc(optName);
|
||||
flowService.insertFlow(flow);
|
||||
|
||||
if(flowChartDetailRecord.getOptType().intValue() == ChartOptType.APPOINT.getCode()){//指定人员的
|
||||
@ -153,9 +265,9 @@ public class FlowStartController {
|
||||
flowApprovalRole.setApprovalId(Long.parseLong(id));
|
||||
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
||||
flowApprovalRole.setRoleId(Long.parseLong(roleId));
|
||||
flowApprovalRole.setApprovalType(flowChartDetailRecord.getOptType());
|
||||
flowApprovalRole.setType(flowChartDetailRecord.getOptType());
|
||||
flowApprovalRoles.add(flowApprovalRole);
|
||||
flowApprovalRole.setStepType(stepIndex);
|
||||
flowApprovalRole.setStepIndex(stepIndex);
|
||||
}
|
||||
stepIndex++;
|
||||
}
|
||||
@ -167,12 +279,13 @@ public class FlowStartController {
|
||||
flowApprovalRole.setFlowId(flow.getId());
|
||||
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
||||
flowApprovalRole.setRoleId(Long.parseLong(roleId));
|
||||
flowApprovalRole.setApprovalType(flowChartDetailRecord.getOptType());
|
||||
flowApprovalRole.setType(flowChartDetailRecord.getOptType());
|
||||
flowApprovalRoles.add(flowApprovalRole);
|
||||
flowApprovalRole.setStepType(stepIndex);
|
||||
stepIndex++;
|
||||
flowApprovalRole.setStepIndex(stepIndex);
|
||||
|
||||
|
||||
}
|
||||
stepIndex++;
|
||||
}
|
||||
|
||||
}
|
||||
@ -183,7 +296,23 @@ public class FlowStartController {
|
||||
//初始化lz_result_details数据
|
||||
List<ResultDetail> resultDetails = new ArrayList<>();
|
||||
|
||||
|
||||
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
|
||||
|
||||
//下面初始化管理人员对应关系
|
||||
for (StaffEntity entity:staffManagers
|
||||
) {
|
||||
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
||||
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
||||
evaluationStartStaff.setEvaluationName(evaluationGroup.getName());
|
||||
evaluationStartStaff.setStaffId(entity.getId());
|
||||
evaluationStartStaff.setStartId(flowStart.getId());
|
||||
evaluationStartStaff.setType(CheckStaffType.MANAGER.getCode());
|
||||
evaluationStartStaffs.add(evaluationStartStaff);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//下面初始化参与人员
|
||||
for (StaffSimpleInfo staffInfo:staffIds
|
||||
) {
|
||||
@ -191,7 +320,7 @@ public class FlowStartController {
|
||||
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
||||
evaluationStartStaff.setEvaluationName(evaluationGroup.getName());
|
||||
evaluationStartStaff.setStaffId(staffInfo.getId());
|
||||
evaluationStartStaff.setStaffId(flowStart.getId());
|
||||
evaluationStartStaff.setStartId(flowStart.getId());
|
||||
evaluationStartStaff.setType(CheckStaffType.STAFF.getCode());
|
||||
evaluationStartStaffs.add(evaluationStartStaff);
|
||||
|
||||
@ -212,29 +341,92 @@ public class FlowStartController {
|
||||
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() + "}");
|
||||
if(approvalRole.getStepIndex().intValue() == 0){//找到所有步骤为0的人员
|
||||
Long staffId = approvalRole.getApprovalId();//默认为指定人员。
|
||||
if(approvalRole.getType().intValue() == ChartOptType.SELF.getCode()){
|
||||
//制定人员为自己的
|
||||
staffId = staffInfo.getId();
|
||||
if(i == 0){//目前只设置一个,多个不明确是否支持,roleJSON是支持多个的
|
||||
//设置当前审批员工id current_approval_staff_id
|
||||
resultRecord.setCurrentApprovalStaffId(staffInfo.getId());
|
||||
//设置当前审批员工姓名 current_approval_staff_name
|
||||
resultRecord.setCurrentApprovalStaffName(staffInfo.getName());
|
||||
|
||||
}
|
||||
} else if(approvalRole.getType().intValue() > 0){//当设置为几级领导时
|
||||
///查找领导,如果不存在那么设置管理人员
|
||||
List<StaffEntity> staffLeader;
|
||||
String key = staffInfo.getDepartmentId() + approvalRole.getType();
|
||||
if(staffManages.containsKey(key)){
|
||||
staffLeader = staffManages.get(staffInfo.getDepartmentId());
|
||||
}else{
|
||||
DepartManagers departManagers =
|
||||
staffService.findLeader(staffInfo.getId(), approvalRole.getType());
|
||||
staffLeader = departManagers.getManagers();
|
||||
staffManages.put(key, departManagers.getManagers());
|
||||
}
|
||||
|
||||
if(staffLeader.size() == 0){
|
||||
//没有领导,通知到组设置的绩效管理人员
|
||||
for (StaffEntity entity:staffManagers
|
||||
) {
|
||||
roleJSON += ("{\"roleId\":0,\"staffId\":" + entity.getId() + "},");//这里写死了权限为0的即为找不到领导
|
||||
|
||||
}
|
||||
if(i == 0){//目前只设置一个,多个不明确是否支持,roleJSON是支持多个的
|
||||
//设置当前审批员工id current_approval_staff_id
|
||||
resultRecord.setCurrentApprovalStaffId(staffManagers.get(0).getId());
|
||||
//设置当前审批员工姓名 current_approval_staff_name
|
||||
resultRecord.setCurrentApprovalStaffName(staffManagers.get(0).getName());
|
||||
|
||||
}
|
||||
}else{
|
||||
for(int j = 0; j <staffLeader.size(); j++ ){
|
||||
StaffEntity staff = staffLeader.get(j);
|
||||
|
||||
roleJSON += ("{\"roleId\":"+ approvalRole.getRoleId() +
|
||||
",\"staffId\":" + staff.getId() + "},");
|
||||
}
|
||||
if(i == 0){//目前只设置一个,多个不明确是否支持,roleJSON是支持多个的
|
||||
//设置当前审批员工id current_approval_staff_id
|
||||
resultRecord.setCurrentApprovalStaffId(staffLeader.get(0).getId());
|
||||
//设置当前审批员工姓名 current_approval_staff_name
|
||||
resultRecord.setCurrentApprovalStaffName(staffLeader.get(0).getName());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}else{
|
||||
roleJSON += (",{\"roleId\":"+ approvalRole.getRoleId() +
|
||||
",\"staffId\":" + approvalRole.getApprovalId() + "}");
|
||||
if(i == 0){//目前只设置一个,多个不明确是否支持,roleJSON是支持多个的
|
||||
//设置当前审批员工id current_approval_staff_id
|
||||
resultRecord.setCurrentApprovalStaffId(approvalRole.getApprovalId());
|
||||
//设置当前审批员工姓名 current_approval_staff_name
|
||||
resultRecord.setCurrentApprovalStaffName("");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
roleJSON += ("{\"roleId\":"+ approvalRole.getRoleId() +
|
||||
",\"staffId\":" + staffId + "},");
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
roleJSON += "]";
|
||||
roleJSON = roleJSON.replace(",]", "]");
|
||||
resultRecord.setFlowStaffIdRole(roleJSON);
|
||||
resultRecordService.insertResultRecord(resultRecord);
|
||||
//下面生成ResultDetail对象
|
||||
for (ResultModelDto modelDto:resultModelDtos
|
||||
) {
|
||||
if(modelDto.getTagetLibs().size() > 0){//模板里面有添加指标
|
||||
|
||||
|
||||
if(modelDto.getTagetLibs() != null && modelDto.getTagetLibs().size() > 0){//模板里面有添加指标
|
||||
for (ResultTagetLibDto libDto:
|
||||
modelDto.getTagetLibs()) {
|
||||
|
||||
|
||||
ResultDetail resultDetail = new ResultDetail();
|
||||
resultDetail.setRecordId(resultRecord.getId());
|
||||
resultDetail.setTarget(libDto.getName());
|
||||
@ -252,38 +444,19 @@ public class FlowStartController {
|
||||
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表
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -48,4 +48,6 @@ public interface ResultTagetLibService extends IService<ResultTagetLib> {
|
||||
int updateResultTagetLibByIds(List<ResultTagetLib> inserts);
|
||||
|
||||
List<ResultTagetLibItemReq> selectResultTagetLibByModelReqId(Long id);
|
||||
|
||||
List<ResultTagetLibDto> selectResultTagetLibDtoByModelId(Long id);
|
||||
}
|
||||
@ -125,6 +125,11 @@ public class ResultTagetLibServiceImpl extends ServiceImpl<ResultTagetLibMapper,
|
||||
return resultTagetLibMapper.selectResultTagetLibByModelReqId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultTagetLibDto> selectResultTagetLibDtoByModelId(Long id){
|
||||
return resultTagetLibMapper.selectResultTagetLibDtoByModelId(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -42,5 +42,5 @@ public interface ResultDetailMapper extends BaseMapper<ResultDetail> {
|
||||
//计算业务/价值观得分
|
||||
BigDecimal calculateScore(@Param("recordId") Long recordId, @Param("staffId") Long staffId,@Param("type") Integer type);
|
||||
|
||||
Long insertResultDetails(List<ResultDetail> resultDetails);
|
||||
Long insertResultDetails(@Param("list") List<ResultDetail> resultDetails);
|
||||
}
|
||||
@ -10,10 +10,7 @@ import com.lz.modules.app.resp.Step;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.app.utils.t.TwoTuple;
|
||||
import com.lz.modules.flow.entity.Flow;
|
||||
import com.lz.modules.flow.entity.FlowDepartment;
|
||||
import com.lz.modules.flow.entity.FlowRecord;
|
||||
import com.lz.modules.flow.entity.FlowRelation;
|
||||
import com.lz.modules.flow.entity.*;
|
||||
import com.lz.modules.flow.model.Auth;
|
||||
import com.lz.modules.flow.model.StaffRoleDto;
|
||||
import com.lz.modules.flow.service.*;
|
||||
@ -313,6 +310,28 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
||||
if(resultDetails.size() <= maxInsertSQL){
|
||||
return resultDetailMapper.insertResultDetails(resultDetails);
|
||||
}
|
||||
//下面防止sql语句过大
|
||||
Long count = Long.parseLong("0");
|
||||
int insert = 0;
|
||||
List<ResultDetail> resultDetails1 = new ArrayList<>();
|
||||
for (ResultDetail detail:resultDetails
|
||||
) {
|
||||
resultDetails1.add(detail);
|
||||
insert++;
|
||||
if(insert >= maxInsertSQL){
|
||||
count += resultDetailMapper.insertResultDetails(resultDetails1);
|
||||
resultDetails1.clear();
|
||||
insert = 0;
|
||||
}
|
||||
|
||||
}
|
||||
if(resultDetails1.size() > 0){
|
||||
count += resultDetailMapper.insertResultDetails(resultDetails1);
|
||||
}
|
||||
return count;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -159,20 +159,23 @@
|
||||
staff_id,
|
||||
priority,
|
||||
is_delete
|
||||
)values(
|
||||
#{ type},
|
||||
#{ target},
|
||||
#{ keyResult},
|
||||
#{ checkWeight},
|
||||
#{ checkResult},
|
||||
#{ superScore},
|
||||
#{ acquireScore},
|
||||
#{ scoreComment},
|
||||
#{ recordId},
|
||||
#{ staffId},
|
||||
#{ priority},
|
||||
)values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{ item.type},
|
||||
#{ item.target},
|
||||
#{ item.keyResult},
|
||||
#{ item.checkWeight},
|
||||
#{ item.checkResult},
|
||||
#{ item.superScore},
|
||||
#{ item.acquireScore},
|
||||
#{ item.scoreComment},
|
||||
#{ item.recordId},
|
||||
#{ item.staffId},
|
||||
#{ item.priority},
|
||||
0
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -13,12 +13,13 @@
|
||||
<result column="dep_ids" property="depIds"/>
|
||||
<result column="staff_ids" property="staffIds"/>
|
||||
<result column="out_ids" property="outIds"/>
|
||||
<result column="copy_id" property="copyId"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name, manager_ids AS managerIds, dep_ids AS depIds, staff_ids AS staffIds, out_ids AS outIds
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name, manager_ids AS managerIds, dep_ids AS depIds, staff_ids AS staffIds, out_ids AS outIds, copy_id AS copyId
|
||||
</sql>
|
||||
|
||||
|
||||
@ -36,6 +37,7 @@
|
||||
<if test="depIds != null">dep_ids, </if>
|
||||
<if test="staffIds != null">staff_ids, </if>
|
||||
<if test="outIds != null">out_ids, </if>
|
||||
<if test="copyId != null">copy_id, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
@ -45,6 +47,7 @@
|
||||
<if test="depIds != null">#{ depIds}, </if>
|
||||
<if test="staffIds != null">#{ staffIds}, </if>
|
||||
<if test="outIds != null">#{ outIds}, </if>
|
||||
<if test="copyId != null">#{ copyId}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
@ -62,7 +65,8 @@
|
||||
<if test="managerIds != null">manager_ids = #{managerIds},</if>
|
||||
<if test="depIds != null">dep_ids = #{depIds},</if>
|
||||
<if test="staffIds != null">staff_ids = #{staffIds},</if>
|
||||
<if test="outIds != null">out_ids = #{outIds}</if>
|
||||
<if test="outIds != null">out_ids = #{outIds},</if>
|
||||
<if test="copyId != null">copy_id = #{copyId}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
@ -79,18 +83,19 @@
|
||||
manager_ids = #{managerIds},
|
||||
dep_ids = #{depIds},
|
||||
staff_ids = #{staffIds},
|
||||
out_ids = #{outIds}
|
||||
out_ids = #{outIds},
|
||||
copy_id = #{copyId}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteEvaluationGroupById" parameterType="java.lang.Long">
|
||||
update lz_evaluation_group set is_delete = 1 where id=#{id} limit 1
|
||||
update lz_evaluation_group set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
<select id="seleteEvaluationGroupByReq" resultType="EvaluationGroup" >
|
||||
select * from lz_evaluation_group where is_delete = 0
|
||||
select * from lz_evaluation_group where is_delete = 0 and copy_id = 0
|
||||
<if test="req.startTime != null"><![CDATA[and gmt_create > #{req.startTime}]]></if>
|
||||
<if test="req.endTime != null"><![CDATA[and gmt_create < #{req.endTime}]]></if>
|
||||
<if test="req.name != null and req.name != ''">and name like concat('%', #{req.name} '%') </if>
|
||||
@ -108,6 +113,5 @@
|
||||
select * from lz_evaluation_group where name=#{name} and is_delete = 0 limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -13,14 +13,13 @@
|
||||
<result column="role_id" property="roleId"/>
|
||||
<result column="flow_id" property="flowId"/>
|
||||
<result column="step_type" property="stepType"/>
|
||||
<result column="approval_type" property="approvalType"/>
|
||||
<result column="step_index" property="stepIndex"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<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, step_index AS stepIndex
|
||||
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, step_index AS stepIndex
|
||||
</sql>
|
||||
|
||||
|
||||
@ -38,7 +37,6 @@
|
||||
<if test="roleId != null">role_id, </if>
|
||||
<if test="flowId != null">flow_id, </if>
|
||||
<if test="stepType != null">step_type, </if>
|
||||
<if test="approvalType != null">approval_type, </if>
|
||||
<if test="stepIndex != null">step_index, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
@ -49,7 +47,6 @@
|
||||
<if test="roleId != null">#{ roleId}, </if>
|
||||
<if test="flowId != null">#{ flowId}, </if>
|
||||
<if test="stepType != null">#{ stepType}, </if>
|
||||
<if test="approvalType != null">#{ approvalType}, </if>
|
||||
<if test="stepIndex != null">#{ stepIndex}, </if>
|
||||
0,
|
||||
now(),
|
||||
@ -69,7 +66,6 @@
|
||||
<if test="roleId != null">role_id = #{roleId},</if>
|
||||
<if test="flowId != null">flow_id = #{flowId},</if>
|
||||
<if test="stepType != null">step_type = #{stepType},</if>
|
||||
<if test="approvalType != null">approval_type = #{approvalType},</if>
|
||||
<if test="stepIndex != null">step_index = #{stepIndex}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
@ -88,7 +84,6 @@
|
||||
role_id = #{roleId},
|
||||
flow_id = #{flowId},
|
||||
step_type = #{stepType},
|
||||
approval_type = #{approvalType},
|
||||
step_index = #{stepIndex}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
@ -101,13 +96,12 @@
|
||||
|
||||
<insert id="insertFlowApprovalRoles" parameterType="FlowApprovalRole" useGeneratedKeys="true" keyProperty="id" >
|
||||
|
||||
insert into lz_flow_chart_detail_record(
|
||||
insert into lz_flow_approval_role(
|
||||
approval_id,
|
||||
type,
|
||||
role_id,
|
||||
flow_id,
|
||||
step_type,
|
||||
approval_type,
|
||||
step_index,
|
||||
is_delete
|
||||
)values
|
||||
@ -117,7 +111,6 @@
|
||||
#{ item.roleId},
|
||||
#{ item.flowId},
|
||||
#{ item.stepType},
|
||||
#{ item.approvalType},
|
||||
#{ item.stepIndex},
|
||||
0
|
||||
)
|
||||
|
||||
@ -114,7 +114,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectFlowChartDetailRecordByGroupId" resultType="FlowChartDetailRecord" >
|
||||
select * from lz_flow_chart_detail_record where evaluation_group_id=#{groupId} and is_delete = 0 order by step_index desc
|
||||
select * from lz_flow_chart_detail_record where evaluation_group_id=#{groupId} and is_delete = 0 order by step_index asc
|
||||
</select>
|
||||
|
||||
<insert id="insertFlowChartDetailRecords" parameterType="FlowChartDetailRecord" useGeneratedKeys="true" keyProperty="id" >
|
||||
|
||||
@ -97,5 +97,9 @@
|
||||
and name LIKE CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectFlowStartByName" resultType="FlowStart" >
|
||||
select * from lz_flow_start where name=#{name} and is_delete = 0 limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -114,12 +114,14 @@
|
||||
</select>
|
||||
|
||||
<select id="selectResultDtoByGroupId" resultType="com.lz.modules.flow.model.ResultModelDto" >
|
||||
select * from lz_result_model where evaluation_group_id=#{id} and is_delete = 0 order by order_by desc
|
||||
select * from lz_result_model where evaluation_group_id=#{id} and is_delete = 0 order by order_by asc
|
||||
</select>
|
||||
|
||||
<update id="deleteResultModelByGroupId" parameterType="java.lang.Long">
|
||||
update lz_result_model set is_delete = 1 where evaluation_group_id=#{id}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -144,7 +144,11 @@
|
||||
</update>
|
||||
|
||||
<select id="selectResultTagetLibByModelReqId" resultType="com.lz.modules.flow.req.ResultTagetLibItemReq" >
|
||||
select id, is_delete, name, weight, key_result from lz_result_taget_lib where model_id=#{id} and is_delete = 0 order by order_by desc
|
||||
select id, is_delete, name, weight, key_result from lz_result_taget_lib where model_id=#{id} and is_delete = 0 order by order_by asc
|
||||
</select>
|
||||
|
||||
<select id="selectResultTagetLibDtoByModelId" resultType="com.lz.modules.flow.model.ResultTagetLibDto" >
|
||||
select id, name, model_id, weight, key_result, order_by from lz_result_taget_lib where model_id=#{id} and is_delete = 0 order by order_by asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -170,5 +170,14 @@
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="selectParentDepartmentByDepartmentId" resultType="com.lz.modules.app.entity.DepartmentsEntity">
|
||||
select
|
||||
*
|
||||
from lz_departments
|
||||
where department_id =
|
||||
(select department_parent_id as department_id from lz_departments where department_id = #{departmentId} and is_delete=0 limit 1)
|
||||
and is_delete=0 limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -103,4 +103,10 @@
|
||||
#{department_id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectLeadersByDepartmentId"
|
||||
resultType="com.lz.modules.app.entity.StaffEntity">
|
||||
select staff.* from lz_staff as staff join lz_departments_staff_relate as relate on staff.id = relate.staff_id
|
||||
where relate.is_delete=0 and relate.department_id = #{depId} and relate.is_leader = 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -481,24 +481,33 @@
|
||||
</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
|
||||
select staff.id as id, staff.job_number as job_number, staff.name as name, staff.employee_id as employee_id, 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 staff_id from lz_departments_staff_relate where department_id = #{depart.departmentId} and is_delete=0
|
||||
) and occupation.staff_status=0 and staff.is_delete=0 and occupation.is_delete=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 (
|
||||
info.department_id as department_id, info.employee_id as employee_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
|
||||
staffinfo.position, staffinfo.employee_id as employee_id, relate.department_id as department_id from (
|
||||
select staff.id as id, staff.job_number as job_number, staff.name as name,staff.employee_id as employee_id, 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
|
||||
) and occupation.staff_status=0 and occupation.is_delete=0 and staff.is_delete=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>
|
||||
|
||||
<select id="selectOnJobByIds" resultType="com.lz.modules.app.entity.StaffEntity">
|
||||
select staff.*
|
||||
from lz_staff staff join lz_staff_occupation occupation on staff.id=occupation.staff_id where staff.id in (
|
||||
<foreach collection="mIds" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
) and occupation.staff_status=0 and staff.is_delete=0 and occupation.is_delete=0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -96,7 +96,7 @@ public class MysqlMain {
|
||||
//list.add(new TablesBean("lz_flow_chart_detail_record"));
|
||||
//list.add(new TablesBean("lz_flow_approval_role"));
|
||||
|
||||
list.add(new TablesBean("lz_evaluation_start_staff"));
|
||||
list.add(new TablesBean("lz_evaluation_group"));
|
||||
|
||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user