提交修改

This commit is contained in:
quyixiao 2020-10-28 14:40:01 +08:00
commit 706b097dda
40 changed files with 542 additions and 97 deletions

View File

@ -8,6 +8,7 @@ import com.lz.modules.app.dto.RecordDetailDto;
import com.lz.modules.app.dto.StaffDepartmentDto; import com.lz.modules.app.dto.StaffDepartmentDto;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity; import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
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.ResultRecordReq; import com.lz.modules.app.req.ResultRecordReq;
import com.lz.modules.app.resp.ResultDetailResp; import com.lz.modules.app.resp.ResultDetailResp;
import com.lz.modules.app.resp.Step; import com.lz.modules.app.resp.Step;
@ -15,8 +16,7 @@ import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService; import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.app.service.StaffService; import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.entity.*; import com.lz.modules.flow.entity.*;
import com.lz.modules.flow.model.Auth; import com.lz.modules.flow.model.*;
import com.lz.modules.flow.model.ResultRecordDetailDto;
import com.lz.modules.flow.req.ResultDetailReq; import com.lz.modules.flow.req.ResultDetailReq;
import com.lz.modules.flow.service.*; import com.lz.modules.flow.service.*;
import com.lz.modules.sys.controller.AbstractController; import com.lz.modules.sys.controller.AbstractController;
@ -51,7 +51,7 @@ import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("user/lzresultrecord") @RequestMapping("user/lzresultrecord")
@Slf4j @Slf4j
@Api("绩效相关-吴林") @Api(tags = "绩效相关")
public class ResultRecordController extends AbstractController { public class ResultRecordController extends AbstractController {
@Autowired @Autowired
private ResultRecordService lzResultRecordService; private ResultRecordService lzResultRecordService;
@ -90,6 +90,9 @@ public class ResultRecordController extends AbstractController {
@Autowired @Autowired
private ResultModelService resultModelService; private ResultModelService resultModelService;
@Autowired
private ResultCalculateService resultCalculateService;
/** /**
* 列表 * 列表
*/ */
@ -319,12 +322,15 @@ public class ResultRecordController extends AbstractController {
* 信息 * 信息
*/ */
@GetMapping("/getDetail") @GetMapping("/getDetail")
@ApiOperation("获取绩效详情") @ApiOperation("获取绩效详情-吴林")
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = ResultRecordDetailDto.class)}) @ApiResponses({@ApiResponse(code = 200, message = "成功", response = ResultRecordDetailDto.class)})
public R getDetail(@RequestParam @ApiParam("绩效id") Long id) { public R getDetail(@RequestParam @ApiParam("绩效id") Long id) {
ResultRecord resultRecord = lzResultRecordService.selectResultRecordById(id); ResultRecord resultRecord = lzResultRecordService.selectResultRecordById(id);
SysUserEntity user = getUser(); if(resultRecord == null){
return R.error("绩效不存在");
}
/*SysUserEntity user = getUser();
if(resultRecord.getStaffId().longValue() != user.getUserId().longValue()){ if(resultRecord.getStaffId().longValue() != user.getUserId().longValue()){
//下面判断权限,是否可读 //下面判断权限,是否可读
EvaluationStartStaff evaluationStartStaff = EvaluationStartStaff evaluationStartStaff =
@ -332,10 +338,127 @@ public class ResultRecordController extends AbstractController {
if(evaluationStartStaff == null){//非考核组设置的绩效管理人员下面应在查询其他权限 if(evaluationStartStaff == null){//非考核组设置的绩效管理人员下面应在查询其他权限
return R.error("未被授权访问"); return R.error("未被授权访问");
} }
} }*/
//获取考核维度等信息 //获取考核维度等信息
ResultRecordDetailDto resultRecordDetailDto = new ResultRecordDetailDto();
BeanUtils.copyProperties(resultRecord, resultRecordDetailDto);
List<ResultModel> resultModels = resultModelService.selectResultModelByGroupId(resultRecord.getEvaluationId()); List<ResultModel> resultModels = resultModelService.selectResultModelByGroupId(resultRecord.getEvaluationId());
return R.ok().put("data", resultRecord); //获取计算公式
List<CalculateModel> calculateModels = getCalculate(resultModels.get(0).getCalculateId());
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
resultRecordDetailDto.setAvatar(staffEntity.getAvatar());
resultRecordDetailDto.setJobNumber(staffEntity.getJobNumber());
List<ResultRecortModelDto> resultRecortModelDtos = new ArrayList<>();
for (ResultModel model:resultModels
) {
resultRecordDetailDto.setGradeGroupId(model.getGradeGroupId());
ResultRecortModelDto resultRecortModelDto = new ResultRecortModelDto();
BeanUtils.copyProperties(model, resultRecortModelDto);
List<ResultDetailDto> detailDtos =
resultDetailService.selectDtosByRecordId(resultRecord.getId(), model.getType());
//下面设置计算公式
resultRecortModelDto.setDetailDtos(detailDtos);
resultRecortModelDtos.add(resultRecortModelDto);
}
resultRecordDetailDto.setRecortModelDtos(resultRecortModelDtos);
return R.ok().put("data", resultRecordDetailDto);
}
private List<CalculateModel> getCalculate(Long id){
ResultCalculate resultCalculate =
resultCalculateService.selectResultCalculateById(id);
char[] chars = new char[resultCalculate.getCalculate().length()];
resultCalculate.getCalculate().getChars(0, chars.length, chars, 0);
List<CalculateModel> calculateModels = new ArrayList<>();
CalculateModel calculateModel = null;
int type = 0;//0table名称 1字段名称
String value = "";
for (int i = 0; i < chars.length;i++
) {
char b = chars[i];
if(b == '*' || b == '/' || b == '+' || b == '-'){
calculateModel.setFieldName(getBeanName(value));
calculateModel.setOpt(String.valueOf(b));
calculateModels.add(calculateModel);
calculateModel = null;
type = 0;
value = "";
continue;
}else if(b == '>'){
if(type == 0){
value = value.replace("lz_", "");//去掉lz_前缀
calculateModel.setTableName(getBeanName(value));
}
type--;
type *= -1;
value = "";
continue;
}
if(calculateModel == null){
calculateModel = new CalculateModel();
}
value += String.valueOf(b);
if(i == chars.length - 1){
calculateModel.setFieldName(getBeanName(value));
calculateModels.add(calculateModel);
break;
}
}
return calculateModels;
}
private String getBeanName(String value){
String[] bean = value.split("_");
value = "";
for(String s:bean){
value += s.substring(0, 1).toUpperCase() + s.substring(1);
}
return value;
}
@PostMapping("/saveDetail")
@ApiOperation("保存绩效详情-吴林")
public R saveDetail(@RequestBody @ApiParam ResultRecordDetailDto dto) {
ResultRecord resultRecord = new ResultRecord();
BeanUtils.copyProperties(dto, resultRecord);
List<ResultDetail> inserts = new ArrayList<>();
List<ResultDetail> updates = new ArrayList<>();
for (ResultRecortModelDto model:dto.getRecortModelDtos()
) {
int index = 0;
for (ResultDetailDto detailDto:model.getDetailDtos()
) {//排序
ResultDetail resultDetail = new ResultDetail();
BeanUtils.copyProperties(detailDto, resultDetail);
resultDetail.setPriority(index);
index++;
if(resultDetail.getId() != null){
updates.add(resultDetail);
}else{
inserts.add(resultDetail);
}
}
}
if(inserts.size() > 0){
resultDetailService.saveBatch(inserts);
}
if(updates.size() > 0){
resultDetailService.updateBatchById(updates);
}
return R.ok();
} }
/** /**

View File

@ -92,4 +92,6 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
List<StaffSimpleInfo> selectStaffSimpleInfos(@Param("sIds") List<Long> sIds); List<StaffSimpleInfo> selectStaffSimpleInfos(@Param("sIds") List<Long> sIds);
List<StaffEntity> selectOnJobByIds(@Param("mIds") List<Long> mIds); List<StaffEntity> selectOnJobByIds(@Param("mIds") List<Long> mIds);
StaffSimpleInfo selectStaffSimpleInfo(@Param("staffId") Long staffId);
} }

View File

@ -44,6 +44,8 @@ public class StaffSimpleInfo implements Serializable {
private String departmentId; private String departmentId;
//钉钉飞书等第三方人员id //钉钉飞书等第三方人员id
private String employeeId; private String employeeId;
//头像
private String avatar;
} }

View File

@ -97,5 +97,7 @@ public interface StaffService extends IService<StaffEntity> {
DepartManagers findLeader(Long id, Integer type); DepartManagers findLeader(Long id, Integer type);
//查找在职的 //查找在职的
List<StaffEntity> selectOnJobByIds(List<Long> mIds); List<StaffEntity> selectOnJobByIds(List<Long> mIds);
StaffSimpleInfo selectStaffSimpleInfo(Long staffId);
} }

View File

@ -514,5 +514,10 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
return staffDao.selectOnJobByIds(mIds); return staffDao.selectOnJobByIds(mIds);
} }
@Override
public StaffSimpleInfo selectStaffSimpleInfo(Long staffId){
return staffDao.selectStaffSimpleInfo(staffId);
}
} }

View File

@ -35,9 +35,12 @@ public interface EvaluationGroupMapper extends BaseMapper<EvaluationGroup> {
int deleteEvaluationGroupById(@Param("id")Long id); int deleteEvaluationGroupById(@Param("id")Long id);
List<EvaluationGroup> seleteEvaluationGroupByReq(@Param("page") IPage page, @Param("req") EvaluationGroupReq req); List<EvaluationGroup> seleteEvaluationGroupByReq(@Param("page") IPage page, @Param("req") EvaluationGroupReq req, @Param("list") List<Long> gIds);
List<EvaluationGroup> selectEvaluationGroupByIds(@Param("ids") List<Long> ids); List<EvaluationGroup> selectEvaluationGroupByIds(@Param("ids") List<Long> ids);
EvaluationGroup selectEvaluationGroupByName(@Param("name") String name); EvaluationGroup selectEvaluationGroupByName(@Param("name") String name);
void deleteByIds(@Param("ids") List<Long> ids);
} }

View File

@ -10,7 +10,7 @@ import java.util.Date;
* <p> * <p>
* </p>*流程图lz_flow的父 * </p>*流程图lz_flow的父
* @author quyixiao * @author quyixiao
* @since 2020-10-26 * @since 2020-10-28
*/ */
@Data @Data
@ -47,6 +47,9 @@ public class FlowChart implements java.io.Serializable {
//当前是目标确认还是评分0目标制定1目标确认2执行中3结果值录入4评分5考核结束 //当前是目标确认还是评分0目标制定1目标确认2执行中3结果值录入4评分5考核结束
@ApiModelProperty(value = "当前是目标确认还是评分0目标制定1目标确认2执行中3结果值录入4评分5考核结束", name = "flowProcess") @ApiModelProperty(value = "当前是目标确认还是评分0目标制定1目标确认2执行中3结果值录入4评分5考核结束", name = "flowProcess")
private Integer flowProcess; private Integer flowProcess;
//描述前端提示如果有值就提示
@ApiModelProperty(value = "描述,前端提示,如果有值就提示", name = "desc")
private String desc;
/** /**
* *
* @return * @return
@ -197,6 +200,21 @@ public class FlowChart implements java.io.Serializable {
this.flowProcess = flowProcess; this.flowProcess = flowProcess;
} }
/**
* 描述前端提示如果有值就提示
* @return
*/
public String getDesc() {
return desc;
}
/**
* 描述前端提示如果有值就提示
* @param desc
*/
public void setDesc(String desc) {
this.desc = desc;
}
@Override @Override
public String toString() { public String toString() {
return "FlowChart{" + return "FlowChart{" +
@ -210,6 +228,7 @@ public class FlowChart implements java.io.Serializable {
",type=" + type + ",type=" + type +
",stepIndex=" + stepIndex + ",stepIndex=" + stepIndex +
",flowProcess=" + flowProcess + ",flowProcess=" + flowProcess +
",desc=" + desc +
"}"; "}";
} }
} }

View File

@ -0,0 +1,12 @@
package com.lz.modules.flow.model;
import lombok.Data;
/*
* 计算公式
* */
@Data
public class CalculateModel {
private String tableName;//表明对象名称
private String fieldName;//字段属性名称
private String opt;//计算方法 + - * /
}

View File

@ -40,6 +40,9 @@ public class FlowChartDto {
@ApiModelProperty(value = "节点详细数据", name = "chartDetails") @ApiModelProperty(value = "节点详细数据", name = "chartDetails")
private FlowChartDetailRecordListDto chartDetails; private FlowChartDetailRecordListDto chartDetails;
//描述前端提示如果有值就提示
@ApiModelProperty(value = "描述,前端提示,如果有值就提示", name = "desc")
private String desc;
/** /**
* *
* @return * @return

View File

@ -44,9 +44,11 @@ public class ResultDetailDto {
@ApiModelProperty(value = "评分说明", name = "scoreComment") @ApiModelProperty(value = "评分说明", name = "scoreComment")
private String scoreComment; private String scoreComment;
//评分说明
@ApiModelProperty(value = "计算公式", name = "calculate")
private String calculate;
//优先级从大到小 //优先级从大到小
@ApiModelProperty(value = "优先级,从大到小", name = "priority") @ApiModelProperty(value = "优先级,从到大", name = "priority")
private Integer priority; private Integer priority;
/** /**
* *

View File

@ -15,7 +15,7 @@ import java.util.List;
*/ */
@Data @Data
@ApiModel(value = "绩详情Dto") @ApiModel(value = "详情Dto")
public class ResultRecordDetailDto { public class ResultRecordDetailDto {
// //
@ApiModelProperty(value = "", name = "id") @ApiModelProperty(value = "", name = "id")
@ -37,18 +37,29 @@ public class ResultRecordDetailDto {
@ApiModelProperty(value = "员工id", name = "staffId") @ApiModelProperty(value = "员工id", name = "staffId")
private Long staffId; private Long staffId;
//使用的哪个等级等级组idlz_result_grade的group_id
@ApiModelProperty(value = "使用的哪个等级。等级组idlz_result_grade的group_id", name = "gradeGroupId")
private Long gradeGroupId;
//当前审批流转所在员工 id //当前审批流转所在员工 id
@ApiModelProperty(value = "当前审批流转所在员工 id", name = "flowStaffIdRole") @ApiModelProperty(value = "当前审批流转所在员工 id", name = "flowStaffIdRole")
private Long flowStaffIdRole; private Long flowStaffIdRole;
//员工所在部门 id //员工所在部门 id
@ApiModelProperty(value = "员工所在部门 id", name = "departmentId") @ApiModelProperty(value = "员工所在部门 id", name = "departmentId")
private Long departmentId; private String departmentId;
//员工所在部门名称 //员工所在部门名称
@ApiModelProperty(value = "员工所在部门名称", name = "departmentName") @ApiModelProperty(value = "员工所在部门名称", name = "departmentName")
private String departmentName; private String departmentName;
//员工姓名 //员工姓名
@ApiModelProperty(value = "员工姓名", name = "staffName") @ApiModelProperty(value = "员工姓名", name = "staffName")
private String staffName; private String staffName;
//员工姓名
@ApiModelProperty(value = "员工头像", name = "avatar")
private String avatar;
//员工姓名
@ApiModelProperty(value = "员工工号", name = "jobNumber")
private String jobNumber;
//当前审批的员工 id //当前审批的员工 id
@ApiModelProperty(value = "当前审批的员工 id", name = "currentApprovalStaffId") @ApiModelProperty(value = "当前审批的员工 id", name = "currentApprovalStaffId")
private Long currentApprovalStaffId; private Long currentApprovalStaffId;
@ -175,14 +186,14 @@ public class ResultRecordDetailDto {
* 员工所在部门 id * 员工所在部门 id
* @return * @return
*/ */
public Long getDepartmentId() { public String getDepartmentId() {
return departmentId; return departmentId;
} }
/** /**
* 员工所在部门 id * 员工所在部门 id
* @param departmentId * @param departmentId
*/ */
public void setDepartmentId(Long departmentId) { public void setDepartmentId(String departmentId) {
this.departmentId = departmentId; this.departmentId = departmentId;
} }

View File

@ -33,12 +33,7 @@ public class ResultRecortModelDto {
@ApiModelProperty(value = "考核子项目个数最大限制", name = "maxCount") @ApiModelProperty(value = "考核子项目个数最大限制", name = "maxCount")
private Integer maxCount; private Integer maxCount;
//lz_result_calculate 的id计算法方法id //lz_result_calculate 的id计算法方法id
@ApiModelProperty(value = "lz_result_calculate 的id计算法方法id", name = "calculateId")
private Long calculateId;
//使用的哪个等级等级组idlz_result_grade的group_id
@ApiModelProperty(value = "使用的哪个等级。等级组idlz_result_grade的group_id", name = "gradeGroupId")
private Long gradeGroupId;
//排序 //排序
@ApiModelProperty(value = "排序", name = "orderBy") @ApiModelProperty(value = "排序", name = "orderBy")
private Integer orderBy; private Integer orderBy;
@ -120,38 +115,8 @@ public class ResultRecortModelDto {
this.maxCount = maxCount; this.maxCount = maxCount;
} }
/**
* lz_result_calculate 的id计算法方法id
* @return
*/
public Long getCalculateId() {
return calculateId;
}
/**
* lz_result_calculate 的id计算法方法id
* @param calculateId
*/
public void setCalculateId(Long calculateId) {
this.calculateId = calculateId;
}
/**
* 使用的哪个等级等级组idlz_result_grade的group_id
* @return
*/
public Long getGradeGroupId() {
return gradeGroupId;
}
/**
* 使用的哪个等级等级组idlz_result_grade的group_id
* @param gradeGroupId
*/
public void setGradeGroupId(Long gradeGroupId) {
this.gradeGroupId = gradeGroupId;
}
/** /**
* 排序 * 排序
* @return * @return
@ -175,8 +140,6 @@ public class ResultRecortModelDto {
",type=" + type + ",type=" + type +
",weight=" + weight + ",weight=" + weight +
",maxCount=" + maxCount + ",maxCount=" + maxCount +
",calculateId=" + calculateId +
",gradeGroupId=" + gradeGroupId +
",orderBy=" + orderBy + ",orderBy=" + orderBy +
"}"; "}";
} }

View File

@ -39,6 +39,9 @@ public class EvaluationGroupReq implements java.io.Serializable {
@ApiModelProperty(value = "", name = "name") @ApiModelProperty(value = "", name = "name")
private String name; private String name;
@ApiModelProperty(value = "startId", name = "发起id任务id")
private Long startId;

View File

@ -53,6 +53,9 @@ public class FlowChartReq implements java.io.Serializable {
//执行步骤第几步从0开始 //执行步骤第几步从0开始
@ApiModelProperty(value = "执行步骤第几步从0开始", name = "stepIndex") @ApiModelProperty(value = "执行步骤第几步从0开始", name = "stepIndex")
private Integer stepIndex; private Integer stepIndex;
//描述前端提示如果有值就提示
@ApiModelProperty(value = "描述,前端提示,如果有值就提示", name = "desc")
private String desc;
/** /**
* *
* @return * @return

View File

@ -46,4 +46,6 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
EvaluationGroup selectEvaluationGroupByName(String name); EvaluationGroup selectEvaluationGroupByName(String name);
//获取考核组里面所有参与的人员信息去除重复去除离职 //获取考核组里面所有参与的人员信息去除重复去除离职
List<StaffSimpleInfo> selectAllStaffSimpleInfoByGroupId(EvaluationGroup evaluationGroup); List<StaffSimpleInfo> selectAllStaffSimpleInfoByGroupId(EvaluationGroup evaluationGroup);
void deleteByIds(List<Long> ids);
} }

View File

@ -13,8 +13,10 @@ 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;
import com.lz.modules.flow.entity.EvaluationGroup; import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.req.EvaluationGroupReq; import com.lz.modules.flow.req.EvaluationGroupReq;
import com.lz.modules.flow.service.EvaluationGroupService; import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.FlowStartService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -50,6 +52,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
@Autowired @Autowired
private DepartmentsService departmentsService; private DepartmentsService departmentsService;
@Autowired
private FlowStartService flowStartService;
@Override @Override
@ -88,8 +93,24 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
@Override @Override
public PageUtils selectEvaluationGroupByReq(EvaluationGroupReq req){ public PageUtils selectEvaluationGroupByReq(EvaluationGroupReq req){
List<Long> gIds = null;
if(req.getStartId() != null){
FlowStart flowStart = flowStartService.selectFlowStartById(req.getStartId());
if(flowStart == null){
return null;
}
gIds = Arrays.stream(flowStart.getGroupIds().split(","))
.map(new Function<String, Long>() {
@Override
public Long apply(String s) {
return Long.parseLong(s);
}
})
.collect(Collectors.toList());
}
List<Long> finalGIds = gIds;
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()) PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize())
.doSelect(page -> evaluationGroupMapper.seleteEvaluationGroupByReq(page, req)); .doSelect(page -> evaluationGroupMapper.seleteEvaluationGroupByReq(page, req, finalGIds));
//下面实时统计考核人数 //下面实时统计考核人数
List<EvaluationGroup> groups = pageUtils.getList(); List<EvaluationGroup> groups = pageUtils.getList();
for (EvaluationGroup group:groups for (EvaluationGroup group:groups
@ -213,4 +234,10 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
return staffSimpleInfos; return staffSimpleInfos;
} }
@Override
public void deleteByIds(List<Long> ids) {
evaluationGroupMapper.deleteByIds(ids);
}
} }

View File

@ -2,8 +2,10 @@ package com.lz.modules.performance.controller;
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.flow.dao.FlowStartMapper; import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.FlowStart; import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessListReq; import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.req.AssessDetailReq; import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.res.AssessManagerDetailRes; import com.lz.modules.performance.res.AssessManagerDetailRes;
@ -75,6 +77,30 @@ public class AssessManagerController {
} }
@PostMapping("assess/manager/change")
@ApiOperation("考核管理组管理变更")
@ApiResponses({@ApiResponse(code = 200,message = "成功")})
public R assessChange(@RequestBody AssessChangeReq req){
if(req.getStartId()==null){
return R.error("考核id不能为空");
}
if(req.getChangeType()==null){
return R.error("变动类型无效");
}
if(StringUtil.isBlank(req.getStaffIds())){
return R.error("变动人员不能为空");
}
String errorMsg = assessManagerService.assessChange(req);
if(StringUtil.isNotBlank(errorMsg)){
return R.error(errorMsg);
}
return R.ok();
}
@GetMapping("assess/manager/delete") @GetMapping("assess/manager/delete")
@ApiOperation("删除考核任务") @ApiOperation("删除考核任务")

View File

@ -7,6 +7,7 @@ import com.lz.modules.equipment.entity.model.BasePage;
import com.lz.modules.flow.dao.FlowStartMapper; import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.FlowStart; import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.FlowStartService; import com.lz.modules.flow.service.FlowStartService;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.performance.req.ChartStartsReq; import com.lz.modules.performance.req.ChartStartsReq;
import com.lz.modules.performance.res.ChartStartsRes; import com.lz.modules.performance.res.ChartStartsRes;
import com.lz.modules.performance.res.ChartStatisticalRes; import com.lz.modules.performance.res.ChartStatisticalRes;
@ -62,13 +63,13 @@ public class ChartController extends AbstractController{
} }
/*@PostMapping("chart/rank") @PostMapping("chart/detail")
@ApiOperation("获取绩排名列表") @ApiOperation("获取报表等级详情")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ResultRankListRes.class)}) @ApiResponses({@ApiResponse(code = 200,message = "成功",response = ResultRankListRes.class)})
public R rankList(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) ChartResultReq req){ public R chartDetailList(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) ChartResultReq req){
PageUtils pageUtils = chartResultService.resultRankList(req); PageUtils pageUtils = chartResultService.selectChartDetailList(req);
return R.ok().put("data",pageUtils); return R.ok().put("data",pageUtils);
}*/ }

View File

@ -121,6 +121,7 @@ public class EvaluationGroupController {
} }
@PostMapping("/update") @PostMapping("/update")
public R update(@RequestBody @ApiParam EvaluationGroup evaluationGroup) { public R update(@RequestBody @ApiParam EvaluationGroup evaluationGroup) {
evaluationGroupService.updateEvaluationGroupById(evaluationGroup); evaluationGroupService.updateEvaluationGroupById(evaluationGroup);

View File

@ -29,7 +29,7 @@ public class UserTaskController extends AbstractController{
@ApiOperation("获取待办/处理事项") @ApiOperation("获取待办/处理事项")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskListRes.class)}) @ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskListRes.class)})
public R list(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) AssessTaskReq req){ public R list(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) AssessTaskReq req){
PageUtils pageUtils = assessService.userTaskList(req, getUserId()); PageUtils pageUtils = assessService.userTaskList(req, 313L);
return R.ok().put("data",pageUtils); return R.ok().put("data",pageUtils);
} }
} }

View File

@ -0,0 +1,26 @@
package com.lz.modules.performance.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Author: djc
* @Desc:
* @Date: 2020/10/27 14:49
*/
@Data
@ApiModel("考核管理变动实体")
public class AssessChangeReq {
@ApiModelProperty(value = "考核id",name = "startId")
private Long startId;
@ApiModelProperty(value = "变更类型 0 :添加 1删除",name = "changeType")
private Integer changeType;
@ApiModelProperty(value = "变动人员ids",name = "staffIds")
private String staffIds;
}

View File

@ -17,8 +17,8 @@ import java.util.List;
@ApiModel("获取考核详情实体") @ApiModel("获取考核详情实体")
public class AssessDetailReq extends BasePage{ public class AssessDetailReq extends BasePage{
//考勤组id //考勤组id
@ApiModelProperty(value = "考勤组ids",name = "evaluationIds") @ApiModelProperty(value = "考勤组ids ,逗号隔开",name = "evaluationIds")
private List<Long> evaluationIds; private String evaluationIds;
//发起考核的id //发起考核的id
@ApiModelProperty(value = "发起考核的id",name = "startId") @ApiModelProperty(value = "发起考核的id",name = "startId")
private Long startId; private Long startId;
@ -26,8 +26,8 @@ public class AssessDetailReq extends BasePage{
@ApiModelProperty(value = "员工名称",name = "staffName") @ApiModelProperty(value = "员工名称",name = "staffName")
private String staffName; private String staffName;
//人员id数组 //人员id数组
@ApiModelProperty(value = "人员id数组",name = "staffIds") @ApiModelProperty(value = "人员ids,逗号隔开",name = "staffIds")
private List<Long> staffIds; private String staffIds;
//状态 确认 执行 结果录入 //状态 确认 执行 结果录入
@ApiModelProperty(value = "状态 确认 执行 结果录入。。。",name = "flowProcess") @ApiModelProperty(value = "状态 确认 执行 结果录入。。。",name = "flowProcess")
private Integer flowProcess; private Integer flowProcess;

View File

@ -0,0 +1,25 @@
package com.lz.modules.performance.req;
import com.lz.modules.equipment.entity.model.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: djc
* @Desc:
* @Date: 2020/10/27 16:05
*/
@Data
@ApiModel("获取报表等级详情实体")
public class ChartResultReq extends BasePage{
@ApiModelProperty(value = "部门id",name = "departmentId")
private String departmentId;
@ApiModelProperty(value = "考核id",name = "startId")
private Long startId;
@ApiModelProperty(value = "等级",name = "scoreLevel")
private Long scoreLevel;
}

View File

@ -1,5 +1,7 @@
package com.lz.modules.performance.res; package com.lz.modules.performance.res;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -11,15 +13,24 @@ import java.util.List;
* @Date: 2020/10/21 11:35 * @Date: 2020/10/21 11:35
*/ */
@Data @Data
@ApiModel("考核详情列表实体")
public class AssessManagerDetailRes { public class AssessManagerDetailRes {
@ApiModelProperty(value = "姓名",name = "staffName")
private String staffName; private String staffName;
@ApiModelProperty(value = "部门名称",name = "departmentName")
private String departmentName; private String departmentName;
@ApiModelProperty(value = "考核组",name = "evaluationName")
private String evaluationName; private String evaluationName;
@ApiModelProperty(value = "考核结果",name = "allScore")
private String allScore; private String allScore;
@ApiModelProperty(value = "绩效等级",name = "scoreLevel")
private String scoreLevel; private String scoreLevel;
@ApiModelProperty(value = "id",name = "id")
private Long id;
} }

View File

@ -14,4 +14,7 @@ public class ChartStatistical {
@ApiModelProperty(value = "人数",name = "num") @ApiModelProperty(value = "人数",name = "num")
private int num = 0; private int num = 0;
@ApiModelProperty(value = "状态",name = "flowProcess")
private Long flowProcess;
} }

View File

@ -26,10 +26,7 @@ public class ResultRankListRes {
private String scoreLevel; private String scoreLevel;
//绩效结果 //绩效结果
@ApiModelProperty(value = "绩效结果",name = "result") @ApiModelProperty(value = "绩效结果",name = "result")
private String result; private String allScore;
//绩效排名
@ApiModelProperty(value = "绩效排名",name = "rank")
private String rank;
@ApiModelProperty(value = "id",name = "recordId") @ApiModelProperty(value = "id",name = "recordId")
private Long recordId; private Long recordId;
} }

View File

@ -2,6 +2,7 @@ package com.lz.modules.performance.service;
import com.lz.common.utils.PageUtils; import com.lz.common.utils.PageUtils;
import com.lz.modules.flow.entity.FlowStart; import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq; import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.AssessListReq; import com.lz.modules.performance.req.AssessListReq;
@ -14,8 +15,9 @@ public interface AssessManagerService {
PageUtils assessList(AssessListReq req); PageUtils assessList(AssessListReq req);
PageUtils assessDetail(AssessDetailReq req); PageUtils assessDetail(AssessDetailReq req);
void accessDelete(FlowStart flowStart); void accessDelete(FlowStart flowStart);
String assessChange(AssessChangeReq req);
} }

View File

@ -3,6 +3,7 @@ package com.lz.modules.performance.service;
import com.lz.common.utils.PageUtils; import com.lz.common.utils.PageUtils;
import com.lz.modules.equipment.entity.model.BasePage; import com.lz.modules.equipment.entity.model.BasePage;
import com.lz.modules.performance.req.AssessDetailReq; import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.performance.req.ChartStartsReq; import com.lz.modules.performance.req.ChartStartsReq;
import com.lz.modules.performance.res.ChartStartsRes; import com.lz.modules.performance.res.ChartStartsRes;
import com.lz.modules.performance.res.ChartStatistical; import com.lz.modules.performance.res.ChartStatistical;
@ -21,7 +22,7 @@ public interface ChartResultService {
List<ChartStatistical> countDepartmentAndStaffNum(List<String>staffIds); List<ChartStatistical> countDepartmentAndStaffNum(List<String>staffIds);
//PageUtils resultRankList(ChartResultReq req); PageUtils selectChartDetailList(ChartResultReq req);
PageUtils chartStarts(ChartStartsReq req); PageUtils chartStarts(ChartStartsReq req);

View File

@ -3,11 +3,14 @@ package com.lz.modules.performance.service.impl;
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.dto.StaffSimpleDto;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.dao.FlowStartMapper; import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.EvaluationGroup; import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.entity.FlowStart; import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.EvaluationGroupService; import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.EvaluationStartStaffService; import com.lz.modules.flow.service.EvaluationStartStaffService;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq; import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.AssessListReq; import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.res.AssessManagerDetailRes; import com.lz.modules.performance.res.AssessManagerDetailRes;
@ -21,8 +24,12 @@ 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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.util.stream.Collectors.toList;
/** /**
* @Author: djc * @Author: djc
* @Desc: * @Desc:
@ -38,6 +45,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
private EvaluationGroupService evaluationGroupService; private EvaluationGroupService evaluationGroupService;
@Autowired @Autowired
private EvaluationStartStaffService evaluationStartStaffService; private EvaluationStartStaffService evaluationStartStaffService;
@Autowired
private StaffService staffService;
@Override @Override
public PageUtils assessList(AssessListReq req) { public PageUtils assessList(AssessListReq req) {
@ -83,7 +92,60 @@ public class AssessManagerServiceImpl implements AssessManagerService {
public void accessDelete(FlowStart flowStart) { public void accessDelete(FlowStart flowStart) {
flowStart.setIsDelete(1); flowStart.setIsDelete(1);
flowStartMapper.updateFlowStartById(flowStart); flowStartMapper.updateFlowStartById(flowStart);
String groupIds = flowStart.getGroupIds();
if(StringUtil.isNotBlank(groupIds)){
String[] split = groupIds.split(",");
List<String> ids = Arrays.asList(split);
List<Long> collect = ids.stream().map(s -> Long.valueOf(s)).collect(toList());
evaluationGroupService.deleteByIds(collect);
}
resultRecordMapper.batchDeleteByStartId(flowStart.getId()); resultRecordMapper.batchDeleteByStartId(flowStart.getId());
return ; return ;
} }
@Override
public String assessChange(AssessChangeReq req) {
String ok = StringUtil.EMPTY;
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
if(flowStart == null){
return "暂无此考核组信息";
}
String[] split = flowStart.getGroupIds().split(",");
String[] changeStaffIds = req.getStaffIds().split(",");
List<String> strings = Arrays.asList(split);
List<Long> ids = strings.stream().map(s -> Long.valueOf(s)).collect(toList());
List<EvaluationGroup> evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids);
Set<String> staffIds = new HashSet<>();
for(EvaluationGroup group:evaluationGroups){
List<String> staff = evaluationGroupService.selectAllStaffIdsByGroupId(group.getId());
staffIds.addAll(staff);
}
List<String> all = new ArrayList<>(staffIds);
List<String> change = Arrays.asList(changeStaffIds);
if(req.getChangeType() == 0){
//获取不在考评组的人员
List<String> notInGroup = change.stream().filter(item -> !all.contains(item)).collect(toList());
if(CollectionUtils.isNotEmpty(notInGroup)){
List<Long> collect = notInGroup.stream().map(s -> Long.valueOf(s)).collect(toList());
List<StaffSimpleDto> staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(collect);
String notInGroupNames = StringUtil.EMPTY;
for(StaffSimpleDto dto:staffSimpleDtos){
notInGroupNames = notInGroupNames + dto.getName() + " ";
}
return notInGroupNames;
}
//初始化添加用户的数据 TODO
return ok;
}
if(req.getChangeType() == 1){
resultRecordMapper.batchDeleteByStartIdAndStaffId(req.getStartId(),change);
return ok;
}
return ok;
}
} }

View File

@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.lz.common.utils.PageUtils; import com.lz.common.utils.PageUtils;
import com.lz.common.utils.StringUtil; import com.lz.common.utils.StringUtil;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity; import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService; import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.app.service.StaffService; import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.dao.FlowStartMapper; import com.lz.modules.flow.dao.FlowStartMapper;
@ -13,6 +15,7 @@ import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.FlowStartService; import com.lz.modules.flow.service.FlowStartService;
import com.lz.modules.performance.enums.ResultFlowProcessEnum; import com.lz.modules.performance.enums.ResultFlowProcessEnum;
import com.lz.modules.performance.req.AssessDetailReq; import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.performance.req.ChartStartsReq; import com.lz.modules.performance.req.ChartStartsReq;
import com.lz.modules.performance.res.ChartStartsRes; import com.lz.modules.performance.res.ChartStartsRes;
import com.lz.modules.performance.res.ChartStatistical; import com.lz.modules.performance.res.ChartStatistical;
@ -26,7 +29,6 @@ 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.Consumer;
/** /**
* @Author: djc * @Author: djc
@ -50,6 +52,8 @@ public class ChartResultServiceImpl implements ChartResultService {
private FlowStartService flowStartService; private FlowStartService flowStartService;
@Autowired @Autowired
private FlowStartMapper flowStartMapper; private FlowStartMapper flowStartMapper;
@Autowired
private DepartmentsService departmentsService;
@Override @Override
@ -78,11 +82,18 @@ public class ChartResultServiceImpl implements ChartResultService {
} }
data.add(res); data.add(res);
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(3L); FlowStart flowStart = flowStartMapper.selectFlowStartById(startId);
List<ChartStatistical> depstaff = this.countDepartmentAndStaffNum(strings); String[] split = flowStart.getGroupIds().split(",");
Set<String> staffIds = new HashSet<>();
for(String s:split){
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(Long.valueOf(s));
staffIds.addAll(strings);
}
List<String> all = new ArrayList<>(staffIds);
List<ChartStatistical> depstaff = this.countDepartmentAndStaffNum(all);
res = new ChartStatisticalRes(); res = new ChartStatisticalRes();
res.setType(2); res.setType(2);
res.setStatisticals(depstaff); res.setStatisticals(buildDepStaffs(depstaff));
res.setDefaultTime(defaultTime); res.setDefaultTime(defaultTime);
if(StringUtil.isNotBlank(defaultTime)){ if(StringUtil.isNotBlank(defaultTime)){
res.setDefaultId(startId); res.setDefaultId(startId);
@ -122,13 +133,15 @@ public class ChartResultServiceImpl implements ChartResultService {
return data; return data;
} }
/* @Override @Override
public PageUtils resultRankList(ChartResultReq req) { public PageUtils selectChartDetailList(ChartResultReq req) {
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId());
List<String> ids = staffService.staffsByAllDeparmentIds(allDeparmentIds);
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect( PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect(
page -> resultRecordMapper.selectResultRankList(page,req) page -> resultRecordMapper.selectChartDetailList(page,ids,req.getStartId(),req.getScoreLevel())
); );
return pageUtils; return pageUtils;
}*/ }
@Override @Override
public PageUtils chartStarts(ChartStartsReq req) { public PageUtils chartStarts(ChartStartsReq req) {
@ -183,6 +196,7 @@ public class ChartResultServiceImpl implements ChartResultService {
ChartStatistical statistical = new ChartStatistical(); ChartStatistical statistical = new ChartStatistical();
statistical.setDesc(flowProcessEnum.getDesc()); statistical.setDesc(flowProcessEnum.getDesc());
statistical.setNum(0); statistical.setNum(0);
statistical.setFlowProcess(Long.valueOf(flowProcessEnum.getStatus()));
Object o = map.get(flowProcessEnum.getDesc()); Object o = map.get(flowProcessEnum.getDesc());
if(o!=null){ if(o!=null){
statistical.setNum(Integer.valueOf(o.toString())); statistical.setNum(Integer.valueOf(o.toString()));
@ -191,4 +205,18 @@ public class ChartResultServiceImpl implements ChartResultService {
} }
return data; return data;
} }
private List<ChartStatistical> buildDepStaffs(List<ChartStatistical> depStaffs){
depStaffs.stream().forEach(chartStatistical -> {
String desc = chartStatistical.getDesc();
DepartmentsEntity departmentsEntity = departmentsService.selectByDepartmentId(desc);
if(departmentsEntity!=null && StringUtil.isNotBlank(departmentsEntity.getDepartmentName())){
chartStatistical.setDesc(departmentsEntity.getDepartmentName());
}
});
return depStaffs;
}
} }

View File

@ -9,6 +9,7 @@ package com.lz.modules.sys.dao.app;
*/ */
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.common.utils.BigDecimalUtil; import com.lz.common.utils.BigDecimalUtil;
import com.lz.modules.flow.model.ResultDetailDto;
import com.lz.modules.sys.entity.app.ResultDetail; import com.lz.modules.sys.entity.app.ResultDetail;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -43,4 +44,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(@Param("list") List<ResultDetail> resultDetails); Long insertResultDetails(@Param("list") List<ResultDetail> resultDetails);
List<ResultDetailDto> selectDtosByRecordId(@Param("recordResultId") Long id, @Param("type") int type);
} }

View File

@ -77,7 +77,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ChartStatistical> countNumByScoreLevel(@Param("startId") Long startId); List<ChartStatistical> countNumByScoreLevel(@Param("startId") Long startId);
//List<ResultRecord> selectResultRankList(@Param("page") IPage page, @Param("req") ChartResultReq req); List<ResultRecord> selectChartDetailList(@Param("page") IPage page, @Param("staffIds") List<String> staffIds, @Param("startId")Long startId,@Param("scoreLevel")Long scoreLevel);
void batchDeleteByStartId(@Param("startId")Long startId); void batchDeleteByStartId(@Param("startId")Long startId);
@ -88,4 +88,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<AssessManagerDetailRes> selectAssessListByStartId(@Param("page") IPage page, @Param("req")AssessDetailReq req); List<AssessManagerDetailRes> selectAssessListByStartId(@Param("page") IPage page, @Param("req")AssessDetailReq req);
List<ChartStatistical> countAssessNumByFlowProcess(@Param("req")AssessDetailReq req); List<ChartStatistical> countAssessNumByFlowProcess(@Param("req")AssessDetailReq req);
void batchDeleteByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffIds") List<String> staffIds);
} }

View File

@ -5,6 +5,7 @@ import com.lz.common.utils.BigDecimalUtil;
import com.lz.modules.app.resp.ResultDetailResp; import com.lz.modules.app.resp.ResultDetailResp;
import com.lz.modules.app.resp.Step; import com.lz.modules.app.resp.Step;
import com.lz.modules.flow.model.Auth; import com.lz.modules.flow.model.Auth;
import com.lz.modules.flow.model.ResultDetailDto;
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;
@ -67,4 +68,6 @@ public interface ResultDetailService extends IService<ResultDetail> {
List<ResultDetail> selectByRecordIdAndType(Long id, int i); List<ResultDetail> selectByRecordIdAndType(Long id, int i);
Long insertResultDetails(List<ResultDetail> resultDetails); Long insertResultDetails(List<ResultDetail> resultDetails);
List<ResultDetailDto> selectDtosByRecordId(Long id, int type);
} }

View File

@ -12,6 +12,7 @@ import com.lz.modules.app.service.StaffService;
import com.lz.modules.app.utils.t.TwoTuple; import com.lz.modules.app.utils.t.TwoTuple;
import com.lz.modules.flow.entity.*; import com.lz.modules.flow.entity.*;
import com.lz.modules.flow.model.Auth; import com.lz.modules.flow.model.Auth;
import com.lz.modules.flow.model.ResultDetailDto;
import com.lz.modules.flow.model.StaffRoleDto; import com.lz.modules.flow.model.StaffRoleDto;
import com.lz.modules.flow.service.*; import com.lz.modules.flow.service.*;
import com.lz.modules.sys.dao.app.ResultDetailMapper; import com.lz.modules.sys.dao.app.ResultDetailMapper;
@ -334,4 +335,9 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
} }
@Override
public List<ResultDetailDto> selectDtosByRecordId(Long id, int type){
return resultDetailMapper.selectDtosByRecordId(id, type);
}
} }

View File

@ -178,5 +178,9 @@
</foreach> </foreach>
</insert> </insert>
<select id="selectDtosByRecordId" resultType="com.lz.modules.flow.model.ResultDetailDto">
select * from lz_result_detail where record_id=#{recordResultId} and type = #{type} and is_delete = 0 order by priority asc
</select>
</mapper> </mapper>

View File

@ -360,11 +360,23 @@
SELECT count(score_level) num,case score_level WHEN 0 THEN '无等级' ELSE score_level END as 'desc' from lz_result_record where is_delete=0 and start_id =#{startId} GROUP BY score_level SELECT count(score_level) num,case score_level WHEN 0 THEN '无等级' ELSE score_level END as 'desc' from lz_result_record where is_delete=0 and start_id =#{startId} GROUP BY score_level
</select> </select>
<select id="selectResultRankList" resultType="com.lz.modules.performance.res.ResultRankListRes"> <select id="selectChartDetailList" resultType="com.lz.modules.performance.res.ResultRankListRes">
SELECT r.id,all_score,department_name,staff_name,score_level,job_number from lz_result_record r SELECT r.id recordId,all_score,department_name,staff_name,score_level,job_number staffNo from lz_result_record r
LEFT JOIN lz_staff s LEFT JOIN lz_staff s
on r.staff_id = s.id on r.staff_id = s.id
where r.is_delete =0 and s.is_delete=0 ORDER BY all_score desc where r.is_delete =0 and s.is_delete=0
and r.start_id = #{startId}
<if test="staffIds!=null and staffIds.size()!=0">
and r.staff_id in (
<foreach collection="staffIds" item="staff_id" separator=",">
#{staff_id}
</foreach>
)
</if>
<if test="scoreLevel !=null">
and r.score_level = #{scoreLevel}
</if>
ORDER BY all_score desc
</select> </select>
@ -383,14 +395,14 @@
</select> </select>
<select id="selectAssessListByStartId" resultType="com.lz.modules.performance.res.AssessManagerDetailRes"> <select id="selectAssessListByStartId" resultType="com.lz.modules.performance.res.AssessManagerDetailRes">
select staff_name,department_name,all_score,score_level,evaluation_name from lz_result_record r select r.id,staff_name,department_name,all_score,score_level,evaluation_name from lz_result_record r
LEFT JOIN lz_evaluation_start_staff s LEFT JOIN lz_evaluation_start_staff s
ON r.start_id = s.start_id and r.staff_id = s.staff_id ON r.start_id = s.start_id and r.staff_id = s.staff_id
where r.is_delete = 0 and s.is_delete = 0 where r.is_delete = 0 and s.is_delete = 0
and r.start_id = #{req.startId} and r.start_id = #{req.startId}
<if test="req.evaluationIds !=null and req.evaluationIds.size()!=0"> <if test="req.evaluationIds !=null and req.evaluationIds !=''">
and r.evaluation_id in( and r.evaluation_id in(
<foreach collection="req.evaluationIds" item="evaluation_id" separator=","> <foreach collection="req.evaluationIds.split(',')" item="evaluation_id" open="(" separator="," close=")">
#{evaluation_id} #{evaluation_id}
</foreach> </foreach>
) )
@ -399,11 +411,11 @@
and r.flow_process = #{req.flowProcess} and r.flow_process = #{req.flowProcess}
</if> </if>
<if test="req.staffName !=null and req.staffName!=''"> <if test="req.staffName !=null and req.staffName!=''">
and r.staff_name = #{req.staffName} and r.staff_name LIKE CONCAT('%',#{req.staffName},'%')
</if> </if>
<if test="req.staffIds !=null and req.staffIds.size() !=0"> <if test="req.staffIds !=null and req.staffIds !=''">
and r.staff_id in( and r.staff_id in(
<foreach collection="req.staffIds" item="staff_id" separator=","> <foreach collection="req.staffIds.split(',')" item="staff_id" open="(" separator="," close=")">
#{staff_id} #{staff_id}
</foreach> </foreach>
) )
@ -414,9 +426,9 @@
SELECT count(flow_process) num,flow_process as 'desc' from lz_result_record SELECT count(flow_process) num,flow_process as 'desc' from lz_result_record
where is_delete=0 where is_delete=0
and start_id =#{req.startId} and start_id =#{req.startId}
<if test="req.evaluationIds !=null and req.evaluationIds.size()!=0"> <if test="req.evaluationIds !=null and req.evaluationIds !=''">
and evaluation_id in( and evaluation_id in(
<foreach collection="req.evaluationIds" item="evaluation_id" separator=","> <foreach collection="req.evaluationIds.split(',')" item="evaluation_id" open="(" separator="," close=")">
#{evaluation_id} #{evaluation_id}
</foreach> </foreach>
) )
@ -425,11 +437,11 @@
and flow_process = #{req.flowProcess} and flow_process = #{req.flowProcess}
</if> </if>
<if test="req.staffName !=null and req.staffName!=''"> <if test="req.staffName !=null and req.staffName!=''">
and staff_name = #{req.staffName} and staff_name LIKE CONCAT('%',#{req.staffName},'%')
</if> </if>
<if test="req.staffIds !=null and req.staffIds.size() !=0"> <if test="req.staffIds !=null and req.staffIds !=''">
and staff_id in( and staff_id in(
<foreach collection="req.staffIds" item="staff_id" separator=","> <foreach collection="req.staffIds.split(',')" item="staff_id" open="(" separator="," close=")">
#{staff_id} #{staff_id}
</foreach> </foreach>
) )
@ -437,5 +449,17 @@
GROUP BY flow_process GROUP BY flow_process
</select> </select>
<update id="batchDeleteByStartIdAndStaffId">
update lz_result_record set is_delete = 1 where
is_delete = 0
and start_id = #{startId}
and staff_id in (
<foreach collection="staffIds" item="staff_id" separator=",">
#{staff_id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@ -96,9 +96,18 @@
<select id="seleteEvaluationGroupByReq" resultType="EvaluationGroup" > <select id="seleteEvaluationGroupByReq" resultType="EvaluationGroup" >
select * from lz_evaluation_group where is_delete = 0 and copy_id = 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.startTime != null"><![CDATA[and gmt_create > #{req.startTime}]]></if>
<if test="req.endTime != null"><![CDATA[and gmt_create < #{req.endTime}]]></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> <if test="req.name != null and req.name != ''">and name like concat('%', #{req.name} '%') </if>
<if test="list != null">
and id in (
<foreach collection="list" item="item" separator=",">
#{item}
</foreach>
)
group by id
</if>
</select> </select>
<select id="selectEvaluationGroupByIds" resultType="EvaluationGroup" > <select id="selectEvaluationGroupByIds" resultType="EvaluationGroup" >
@ -113,5 +122,13 @@
select * from lz_evaluation_group where name=#{name} and is_delete = 0 limit 1 select * from lz_evaluation_group where name=#{name} and is_delete = 0 limit 1
</select> </select>
<update id="deleteByIds">
update lz_evaluation_group set is_delete = 1 where is_delete=0
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper> </mapper>

View File

@ -14,12 +14,13 @@
<result column="type" property="type"/> <result column="type" property="type"/>
<result column="step_index" property="stepIndex"/> <result column="step_index" property="stepIndex"/>
<result column="flow_process" property="flowProcess"/> <result column="flow_process" property="flowProcess"/>
<result column="desc" property="desc"/>
</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, name AS name, process_id AS processId, status AS status, type AS type, step_index AS stepIndex, flow_process AS flowProcess id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name, process_id AS processId, status AS status, type AS type, step_index AS stepIndex, flow_process AS flowProcess, desc AS desc
</sql> </sql>
@ -38,6 +39,7 @@
<if test="type != null">type, </if> <if test="type != null">type, </if>
<if test="stepIndex != null">step_index, </if> <if test="stepIndex != null">step_index, </if>
<if test="flowProcess != null">flow_process, </if> <if test="flowProcess != null">flow_process, </if>
<if test="desc != null">desc, </if>
is_delete, is_delete,
gmt_create, gmt_create,
gmt_modified gmt_modified
@ -48,6 +50,7 @@
<if test="type != null">#{ type}, </if> <if test="type != null">#{ type}, </if>
<if test="stepIndex != null">#{ stepIndex}, </if> <if test="stepIndex != null">#{ stepIndex}, </if>
<if test="flowProcess != null">#{ flowProcess}, </if> <if test="flowProcess != null">#{ flowProcess}, </if>
<if test="desc != null">#{ desc}, </if>
0, 0,
now(), now(),
now() now()
@ -66,7 +69,8 @@
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>
<if test="stepIndex != null">step_index = #{stepIndex},</if> <if test="stepIndex != null">step_index = #{stepIndex},</if>
<if test="flowProcess != null">flow_process = #{flowProcess}</if> <if test="flowProcess != null">flow_process = #{flowProcess},</if>
<if test="desc != null">desc = #{desc}</if>
</trim> </trim>
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
@ -84,7 +88,8 @@
status = #{status}, status = #{status},
type = #{type}, type = #{type},
step_index = #{stepIndex}, step_index = #{stepIndex},
flow_process = #{flowProcess} flow_process = #{flowProcess},
desc = #{desc}
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
</update> </update>

View File

@ -467,7 +467,11 @@
<foreach collection="ids" item="id" separator=","> <foreach collection="ids" item="id" separator=",">
#{id} #{id}
</foreach> </foreach>
) and occupation.staff_status=0 ) and occupation.staff_status=0 order by field(staff.id,
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</select> </select>
<select id="getDepatAllStaffInfos" resultType="com.lz.modules.app.dto.StaffDto"> <select id="getDepatAllStaffInfos" resultType="com.lz.modules.app.dto.StaffDto">
@ -510,4 +514,16 @@
</foreach> </foreach>
) and occupation.staff_status=0 and staff.is_delete=0 and occupation.is_delete=0 ) and occupation.staff_status=0 and staff.is_delete=0 and occupation.is_delete=0
</select> </select>
<select id="selectStaffSimpleInfo" 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, 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, 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 = #{staffId}
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>
</mapper> </mapper>

View File

@ -96,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_result_detail")); list.add(new TablesBean("lz_flow_chart"));
List<TablesBean> list2 = new ArrayList<TablesBean>(); List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments(); Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();