提交候tgit
This commit is contained in:
commit
72f9918bab
@ -19,6 +19,7 @@ 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.app.service.DepartmentsService;
|
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.StaffOccupationService;
|
||||||
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.*;
|
import com.lz.modules.flow.model.*;
|
||||||
@ -27,6 +28,7 @@ import com.lz.modules.flow.service.*;
|
|||||||
import com.lz.modules.job.business.DingtalkBusiness;
|
import com.lz.modules.job.business.DingtalkBusiness;
|
||||||
import com.lz.modules.performance.dto.ResultTaskDto;
|
import com.lz.modules.performance.dto.ResultTaskDto;
|
||||||
|
|
||||||
|
import com.lz.modules.performance.dto.StaffTypeDto;
|
||||||
import com.lz.modules.performance.req.ResultUpdateTaskReq;
|
import com.lz.modules.performance.req.ResultUpdateTaskReq;
|
||||||
|
|
||||||
import com.lz.modules.performance.entity.ResultTask;
|
import com.lz.modules.performance.entity.ResultTask;
|
||||||
@ -48,6 +50,7 @@ import com.lz.modules.sys.service.app.ResultRecordService;
|
|||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@ -134,9 +137,13 @@ public class ResultRecordController extends AbstractController {
|
|||||||
private ResourceService resourceService;
|
private ResourceService resourceService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ChartResultService chartResultService;
|
private ChartResultService chartResultService;
|
||||||
|
@Autowired
|
||||||
|
private FlowStartService flowStartService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResultTaskService resultTaskService;
|
private ResultTaskService resultTaskService;
|
||||||
|
@Autowired
|
||||||
|
private StaffOccupationService staffOccupationService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -632,6 +639,44 @@ public class ResultRecordController extends AbstractController {
|
|||||||
resultRecordDetailDto.setWeight(weight);
|
resultRecordDetailDto.setWeight(weight);
|
||||||
resultRecordDetailDto.setRecortModelDtos(resultRecortModelDtos);
|
resultRecordDetailDto.setRecortModelDtos(resultRecortModelDtos);
|
||||||
|
|
||||||
|
//增加导出所需数据
|
||||||
|
List<String> depIds = Lists.newArrayList(resultRecord.getDepartmentId());
|
||||||
|
Map<Long, List<String>> map = departmentsService.selectDepartmentTreeByDepIds(depIds);
|
||||||
|
|
||||||
|
List<String> names = map.get(Long.valueOf(resultRecord.getDepartmentId()));
|
||||||
|
if(CollectionUtils.isNotEmpty(names)){
|
||||||
|
Collections.reverse(names);
|
||||||
|
int size = names.size();
|
||||||
|
if(size>0 && StringUtils.isNotBlank(names.get(0))){
|
||||||
|
resultRecordDetailDto.setDepartmentOne(names.get(0));
|
||||||
|
}
|
||||||
|
if(size>1 && StringUtils.isNotBlank(names.get(1))){
|
||||||
|
resultRecordDetailDto.setDepartmentTwo(names.get(1));
|
||||||
|
}
|
||||||
|
if(size>2 && StringUtils.isNotBlank(names.get(2))){
|
||||||
|
resultRecordDetailDto.setDepartmentThree(names.get(2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> staffIds = Lists.newArrayList(resultRecord.getStaffId());
|
||||||
|
List<StaffTypeDto> staffTypeDtos = staffOccupationService.selectStaffTypesByStaffIds(staffIds);
|
||||||
|
|
||||||
|
if(CollectionUtils.isNotEmpty(staffTypeDtos)){
|
||||||
|
resultRecordDetailDto.setPosition(staffTypeDtos.get(0).getPosition());
|
||||||
|
}
|
||||||
|
FlowStart flowStart = flowStartService.selectFlowStartById(resultRecord.getStartId());
|
||||||
|
if(flowStart != null){
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||||
|
String startDate = sdf.format(flowStart.getStartTime());
|
||||||
|
if(flowStart.getCycleType().intValue() != 0){
|
||||||
|
String endDate = sdf.format(flowStart.getEndTime());
|
||||||
|
resultRecordDetailDto.setAssessCycle(startDate + "至" + endDate );
|
||||||
|
}else{
|
||||||
|
resultRecordDetailDto.setAssessCycle(startDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return R.ok().put("data", resultRecordDetailDto);
|
return R.ok().put("data", resultRecordDetailDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -767,6 +812,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
resultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
|
resultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
|
||||||
|
|
||||||
List<ResultDetail> updateResultDetails = new ArrayList<>();
|
List<ResultDetail> updateResultDetails = new ArrayList<>();
|
||||||
|
List<ResultDetail> editResultDetails = new ArrayList<>();//涉及到修改的指标保存,方便后面生成修改记录
|
||||||
|
|
||||||
//获取当前绩效的节点
|
//获取当前绩效的节点
|
||||||
boolean isSetKeyResult = false;
|
boolean isSetKeyResult = false;
|
||||||
@ -802,11 +848,15 @@ public class ResultRecordController extends AbstractController {
|
|||||||
BeanUtils.copyProperties(detailDto, resultDetail);
|
BeanUtils.copyProperties(detailDto, resultDetail);
|
||||||
if(!isSetKeyResult){
|
if(!isSetKeyResult){
|
||||||
if(resultDetail.getIsDelete() != null && resultDetail.getIsDelete().intValue() == 1){//被删除了
|
if(resultDetail.getIsDelete() != null && resultDetail.getIsDelete().intValue() == 1){//被删除了
|
||||||
|
log.info("指标被删除了");
|
||||||
resultDetail.setIsBack(2);
|
resultDetail.setIsBack(2);
|
||||||
resultDetail.setBackId(resultDetail.getId());
|
resultDetail.setBackId(resultDetail.getId());
|
||||||
updateResultDetails.add(resultDetail);
|
updateResultDetails.add(resultDetail);
|
||||||
|
editResultDetails.add(resultDetail);
|
||||||
}else if(resultDetail.getId() == null){
|
}else if(resultDetail.getId() == null){
|
||||||
resultDetail.setIsBack(3);//新增
|
resultDetail.setIsBack(3);//新增
|
||||||
|
editResultDetails.add(resultDetail);//插入数据库之后会生成id
|
||||||
|
log.info("新增指标");
|
||||||
}else {
|
}else {
|
||||||
if(resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){
|
if(resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){
|
||||||
//这里判断是否有更新,或者删除
|
//这里判断是否有更新,或者删除
|
||||||
@ -817,15 +867,18 @@ public class ResultRecordController extends AbstractController {
|
|||||||
|
|
||||||
if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){
|
if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){
|
||||||
//打上标识
|
//打上标识
|
||||||
|
log.info("修改名称");
|
||||||
isUp = true;
|
isUp = true;
|
||||||
}
|
}
|
||||||
if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){
|
if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){
|
||||||
//打上标识
|
//打上标识
|
||||||
|
log.info("修改关键结果");
|
||||||
isUp = true;
|
isUp = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){
|
if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){
|
||||||
//打上标识
|
//打上标识
|
||||||
|
log.info("修改权重");
|
||||||
isUp = true;
|
isUp = true;
|
||||||
}
|
}
|
||||||
if(isUp){
|
if(isUp){
|
||||||
@ -833,6 +886,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
resultDetail1.setIsBack(2);
|
resultDetail1.setIsBack(2);
|
||||||
resultDetail1.setBackId(resultDetail.getId());
|
resultDetail1.setBackId(resultDetail.getId());
|
||||||
inserts.add(resultDetail1);
|
inserts.add(resultDetail1);
|
||||||
|
editResultDetails.add(resultDetail1);//插入数据库之后会生成id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -907,16 +961,11 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//下面不限权重的,计算权重之和是否超标
|
|
||||||
/*if(model.getWeight() != null && model.getWeight().compareTo(BigDecimal.ZERO) != 0
|
|
||||||
&& weight.compareTo(model.getWeight()) == 1){
|
|
||||||
return R.error(model.getName() + "的指标之和不能超过" + model.getWeight().multiply(BigDecimal.valueOf(100)) + "%");
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
//下面更新指标记录
|
//下面更新指标记录
|
||||||
/*if(inserts.size() > 0){
|
if(inserts.size() > 0){
|
||||||
resultDetailService.saveBatch(inserts);
|
resultDetailService.saveBatch(inserts);
|
||||||
}*/
|
}
|
||||||
if(updates.size() > 0){
|
if(updates.size() > 0){
|
||||||
resultDetailService.updateBatchById(updates);
|
resultDetailService.updateBatchById(updates);
|
||||||
}
|
}
|
||||||
@ -933,21 +982,21 @@ public class ResultRecordController extends AbstractController {
|
|||||||
|
|
||||||
if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0){
|
if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0){
|
||||||
//修改评论信息
|
//修改评论信息
|
||||||
updateResultDetails.addAll(resultDetailService.selectNotNoticeResultDetailByRecordId(dto.getId())) ;
|
editResultDetails.addAll(resultDetailService.selectNotNoticeResultDetailByRecordId(dto.getId())) ;
|
||||||
log.info("可能需要写入评论的内容条数{}", updateResultDetails.size());
|
log.info("可能需要写入评论的内容条数{}", updateResultDetails.size());
|
||||||
//去重
|
//去重
|
||||||
mapDetails = updateResultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
|
mapDetails = editResultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
|
||||||
updateResultDetails = mapDetails.values().stream().collect(Collectors.toList());
|
editResultDetails = mapDetails.values().stream().collect(Collectors.toList());
|
||||||
if(!isSetKeyResult){
|
if(!isSetKeyResult){
|
||||||
log.info("实际需要写入评论的内容条数{}", updateResultDetails.size());
|
log.info("实际需要写入评论的内容条数{}", updateResultDetails.size());
|
||||||
if(updateResultDetails.size() > 0){
|
if(editResultDetails.size() > 0){
|
||||||
updates.addAll(inserts);
|
updates.addAll(inserts);
|
||||||
|
|
||||||
mapDetails = updates.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
|
mapDetails = updates.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
|
||||||
|
|
||||||
String commandValue = "";
|
String commandValue = "";
|
||||||
int commandIndex = 1;
|
int commandIndex = 1;
|
||||||
for (ResultDetail resultDetail1:updateResultDetails
|
for (ResultDetail resultDetail1:editResultDetails
|
||||||
) {
|
) {
|
||||||
log.info("修改的对象为{}", resultDetail1);
|
log.info("修改的对象为{}", resultDetail1);
|
||||||
if(resultDetail1.getIsDelete().intValue() == 1){
|
if(resultDetail1.getIsDelete().intValue() == 1){
|
||||||
@ -1014,7 +1063,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
for (ResultDetail resultDetail1:updateResultDetails
|
for (ResultDetail resultDetail1:editResultDetails
|
||||||
) {
|
) {
|
||||||
if(resultDetail1.getIsBack().intValue() == 3){
|
if(resultDetail1.getIsBack().intValue() == 3){
|
||||||
resultDetail1.setIsBack(0);
|
resultDetail1.setIsBack(0);
|
||||||
@ -1023,7 +1072,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resultDetailService.updateBatchById(updateResultDetails);
|
resultDetailService.updateBatchById(editResultDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|||||||
@ -85,6 +85,22 @@ public class ResultRecordDetailDto {
|
|||||||
List<ResultRecortModelDto> recortModelDtos;
|
List<ResultRecortModelDto> recortModelDtos;
|
||||||
@ApiModelProperty(value = "当前指标权重之和", name = "weight")
|
@ApiModelProperty(value = "当前指标权重之和", name = "weight")
|
||||||
BigDecimal weight;
|
BigDecimal weight;
|
||||||
|
|
||||||
|
//新增导出所需数据
|
||||||
|
@ApiModelProperty(value = "考核周期", name = "assessCycle")
|
||||||
|
private String assessCycle;
|
||||||
|
//一级部门
|
||||||
|
@ApiModelProperty(value = "一级部门", name = "departmentOne")
|
||||||
|
private String departmentOne;
|
||||||
|
//二级部门
|
||||||
|
@ApiModelProperty(value = "二级部门", name = "departmentTwo")
|
||||||
|
private String departmentTwo;
|
||||||
|
//三级部门
|
||||||
|
@ApiModelProperty(value = "三级部门", name = "departmentThree")
|
||||||
|
private String departmentThree;
|
||||||
|
@ApiModelProperty(value = "职位", name = "position")
|
||||||
|
private String position;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -260,7 +260,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
Map<Long, List<FlowChartRole>> mustRole = new HashMap<>();
|
Map<Long, List<FlowChartRole>> mustRole = new HashMap<>();
|
||||||
Map<Long, List<FlowChartRole>> selfMustRole = new HashMap<>();
|
Map<Long, List<FlowChartRole>> selfMustRole = new HashMap<>();
|
||||||
List<StaffSimpleInfo> noticeStaff = new ArrayList<>();
|
List<StaffSimpleInfo> noticeStaff = new ArrayList<>();
|
||||||
List<StartStartDto> resultRecords = new ArrayList<>();
|
List<StartStartDto> startStartDtos = new ArrayList<>();
|
||||||
for (int n = 0; n < evaluationGroups.size(); n++
|
for (int n = 0; n < evaluationGroups.size(); n++
|
||||||
) {
|
) {
|
||||||
EvaluationGroup evaluationGroup = evaluationGroups.get(n);
|
EvaluationGroup evaluationGroup = evaluationGroups.get(n);
|
||||||
@ -307,11 +307,11 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
|
return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
|
||||||
case 0:
|
case 0:
|
||||||
noticeStaff.addAll(staffIds);
|
noticeStaff.addAll(staffIds);
|
||||||
resultRecords.add(startDto);
|
startStartDtos.add(startDto);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
initFlowRecordAnsy(resultRecords, noticeStaff);
|
initFlowRecordAnsy(startStartDtos, noticeStaff);
|
||||||
//dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
|
//dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
|
||||||
return R.ok("发起成功").put("data", flowStart);
|
return R.ok("发起成功").put("data", flowStart);
|
||||||
}
|
}
|
||||||
@ -774,7 +774,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
resultDetail.setType(modelDto.getType());
|
resultDetail.setType(modelDto.getType());
|
||||||
resultDetail.setKeyResult(libDto.getKeyResult());
|
resultDetail.setKeyResult(libDto.getKeyResult());
|
||||||
resultDetail.setCheckWeight(libDto.getWeight());
|
resultDetail.setCheckWeight(libDto.getWeight());
|
||||||
resultDetail.setStaffId(resultRecord.getId());
|
resultDetail.setStaffId(resultRecord.getStaffId());
|
||||||
resultDetail.setPriority(libDto.getOrderBy());
|
resultDetail.setPriority(libDto.getOrderBy());
|
||||||
resultDetail.setModelId(modelDto.getId());
|
resultDetail.setModelId(modelDto.getId());
|
||||||
resultDetails.add(resultDetail);
|
resultDetails.add(resultDetail);
|
||||||
|
|||||||
@ -710,7 +710,7 @@ public class DingtalkBusiness {
|
|||||||
} else {
|
} else {
|
||||||
url += "?halokit=" + System.currentTimeMillis();
|
url += "?halokit=" + System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
url += ("&detail=1&id=" + resultDetail.getRecordId());
|
url += ("&detail=1&id=" + resultDetail.getRecordId() + "&detailId=" + resultDetail.getId());
|
||||||
url = URLEncoder.encode(url);
|
url = URLEncoder.encode(url);
|
||||||
|
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ public class DingtalkBusiness {
|
|||||||
if (token != null && token.length() > 0) {
|
if (token != null && token.length() > 0) {
|
||||||
|
|
||||||
StaffSimpleInfo fromStaffSimpleInfo = staffService.selectStaffSimpleInfo(taskProcessRecord.getStaffId());
|
StaffSimpleInfo fromStaffSimpleInfo = staffService.selectStaffSimpleInfo(taskProcessRecord.getStaffId());
|
||||||
if (taskProcessRecord.getStaffId().longValue() != resultDetail.getId().longValue()) {
|
if (taskProcessRecord.getStaffId().longValue() != resultDetail.getStaffId().longValue()) {
|
||||||
//自己评论自己的不允许给自己发消息
|
//自己评论自己的不允许给自己发消息
|
||||||
StaffSimpleInfo toStaffSimpleInfo = staffService.selectStaffSimpleInfo(resultDetail.getStaffId());
|
StaffSimpleInfo toStaffSimpleInfo = staffService.selectStaffSimpleInfo(resultDetail.getStaffId());
|
||||||
|
|
||||||
@ -760,7 +760,7 @@ public class DingtalkBusiness {
|
|||||||
info.setEmployeeId(userIds);
|
info.setEmployeeId(userIds);
|
||||||
logger.info("推送的人员信息{}", info);
|
logger.info("推送的人员信息{}", info);
|
||||||
dingTalkUtil.sendSingleActionCardMSG(appid, info, WorkMsgTypeEnum.TASK_REPLY_COMMENT.getTitle(),
|
dingTalkUtil.sendSingleActionCardMSG(appid, info, WorkMsgTypeEnum.TASK_REPLY_COMMENT.getTitle(),
|
||||||
WorkMsgTypeEnum.TASK_REPLY_COMMENT.getContent(), WorkMsgTypeEnum.TASK_REPLY_COMMENT.getBtnText(), url, token);
|
content, WorkMsgTypeEnum.TASK_REPLY_COMMENT.getBtnText(), url, token);
|
||||||
m = 0;
|
m = 0;
|
||||||
userIds = "";
|
userIds = "";
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
package com.lz.modules.job.task;
|
package com.lz.modules.job.task;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.job.business.DingtalkBusiness;
|
import com.lz.modules.job.business.DingtalkBusiness;
|
||||||
import com.lz.modules.performance.enums.ResultFlowProcessEnum;
|
import com.lz.modules.performance.enums.ResultFlowProcessEnum;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -36,11 +38,15 @@ public class ResultTaskNoticJob implements ITask {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(String params) {
|
public void run(String params) {
|
||||||
|
logger.info("绩效任务填写通知开始。。。");
|
||||||
List<Long> ids = resultRecordService.selectStaffIdsByFlowProcess(process);
|
List<Long> ids = resultRecordService.selectStaffIdsByFlowProcess(process);
|
||||||
List<StaffEntity> staffEntities = staffService.selectByIds(ids);
|
if(CollectionUtils.isNotEmpty(ids)){
|
||||||
String res = dingtalkBusiness.sendTaskInputMsg(staffEntities);
|
logger.info("通知人员id: " + JSON.toJSONString(ids));
|
||||||
logger.info("绩效任务填写通知响应:" + res);
|
List<StaffEntity> staffEntities = staffService.selectByIds(ids);
|
||||||
|
String res = dingtalkBusiness.sendTaskInputMsg(staffEntities);
|
||||||
|
logger.info("绩效任务填写通知响应:" + res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,20 +5,28 @@ import cn.hutool.core.io.IoUtil;
|
|||||||
import cn.hutool.poi.excel.ExcelUtil;
|
import cn.hutool.poi.excel.ExcelUtil;
|
||||||
import cn.hutool.poi.excel.ExcelWriter;
|
import cn.hutool.poi.excel.ExcelWriter;
|
||||||
import cn.hutool.poi.excel.StyleSet;
|
import cn.hutool.poi.excel.StyleSet;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.flow.model.ResultDetailDto;
|
import com.lz.modules.flow.model.ResultDetailDto;
|
||||||
import com.lz.modules.flow.model.ResultRecordDetailDto;
|
import com.lz.modules.flow.model.ResultRecordDetailDto;
|
||||||
import com.lz.modules.flow.model.ResultRecortModelDto;
|
import com.lz.modules.flow.model.ResultRecortModelDto;
|
||||||
|
import com.lz.modules.job.business.DingtalkBusiness;
|
||||||
import com.lz.modules.performance.dto.RecordDetailExportDto;
|
import com.lz.modules.performance.dto.RecordDetailExportDto;
|
||||||
|
import com.lz.modules.performance.enums.ResultFlowProcessEnum;
|
||||||
import com.lz.modules.performance.req.ChartResultReq;
|
import com.lz.modules.performance.req.ChartResultReq;
|
||||||
import com.lz.modules.performance.res.LevelDetailExportRes;
|
import com.lz.modules.performance.res.LevelDetailExportRes;
|
||||||
import com.lz.modules.performance.service.ChartResultService;
|
import com.lz.modules.performance.service.ChartResultService;
|
||||||
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -30,6 +38,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -43,9 +52,19 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Api(value="导出excel接口", tags={"导出表格"})
|
@Api(value="导出excel接口", tags={"导出表格"})
|
||||||
public class ExportController {
|
public class ExportController {
|
||||||
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ChartResultService chartResultService;
|
private ChartResultService chartResultService;
|
||||||
|
@Autowired
|
||||||
|
DingtalkBusiness dingtalkBusiness;
|
||||||
|
@Autowired
|
||||||
|
private ResultRecordService resultRecordService;
|
||||||
|
@Autowired
|
||||||
|
private StaffService staffService;
|
||||||
|
|
||||||
|
static final List<Integer> process = Lists.newArrayList(ResultFlowProcessEnum.TARGET.getStatus(), ResultFlowProcessEnum.CONFIRM.getStatus(),
|
||||||
|
ResultFlowProcessEnum.DO.getStatus(), ResultFlowProcessEnum.WRITE.getStatus());
|
||||||
|
|
||||||
@GetMapping("/export/levelDetail")
|
@GetMapping("/export/levelDetail")
|
||||||
@ApiOperation("导出等级详情")
|
@ApiOperation("导出等级详情")
|
||||||
@ -87,7 +106,15 @@ public class ExportController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/testDingTalkTask")
|
||||||
|
public void testDingTalkTask(){
|
||||||
|
List<Long> ids = resultRecordService.selectStaffIdsByFlowProcess(process);
|
||||||
|
log.info(JSON.toJSONString(ids));
|
||||||
|
List<Long> objects = Lists.newArrayList(313L,314L,294L);
|
||||||
|
List<StaffEntity> staffEntities = staffService.selectByIds(objects);
|
||||||
|
String res = dingtalkBusiness.sendTaskInputMsg(staffEntities);
|
||||||
|
logger.info("绩效任务填写通知响应:" + res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -57,6 +57,9 @@ public class ResultTaskController extends AbstractController{
|
|||||||
@ApiOperation("任务变更记录")
|
@ApiOperation("任务变更记录")
|
||||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskProcessRecordDto.class)})
|
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskProcessRecordDto.class)})
|
||||||
public R changeTaskList(@RequestBody ChangeTaskListReq req){
|
public R changeTaskList(@RequestBody ChangeTaskListReq req){
|
||||||
|
if(req.getStaffId()==null){
|
||||||
|
req.setStaffId(getUserId());
|
||||||
|
}
|
||||||
PageUtils pageUtils = taskProcessRecordService.selectTaskProcessRecordsByTaskId(req);
|
PageUtils pageUtils = taskProcessRecordService.selectTaskProcessRecordsByTaskId(req);
|
||||||
return R.ok().put("data",pageUtils);
|
return R.ok().put("data",pageUtils);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,6 +44,17 @@ public class TaskProcessRecordDto {
|
|||||||
@ApiModelProperty(value = "职位", name = "position")
|
@ApiModelProperty(value = "职位", name = "position")
|
||||||
private String position;
|
private String position;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "@员工id", name = "atStaffIds")
|
||||||
|
private String atStaffIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "@员工姓名", name = "atStaffNames")
|
||||||
|
private String atStaffNames;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是不是自己的评论", name = "isSelf")
|
||||||
|
private int isSelf;
|
||||||
|
|
||||||
|
private Long staffId;
|
||||||
|
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|
||||||
private Long detailId;
|
private Long detailId;
|
||||||
|
|||||||
@ -23,4 +23,7 @@ public class ChangeTaskListReq extends BasePage {
|
|||||||
|
|
||||||
@ApiModelProperty(value="0:记录 不传全部",name = "useType")
|
@ApiModelProperty(value="0:记录 不传全部",name = "useType")
|
||||||
private Integer useType;
|
private Integer useType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="员工id",name = "staffId")
|
||||||
|
private Long staffId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,12 +110,26 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
|
|||||||
TaskProcessRecordDto taskProcessRecordDto = taskProcessRecordMapper.selectTaskProcessRecordLastByTaskId(resultTaskDto.getId());
|
TaskProcessRecordDto taskProcessRecordDto = taskProcessRecordMapper.selectTaskProcessRecordLastByTaskId(resultTaskDto.getId());
|
||||||
if(taskProcessRecordDto != null){
|
if(taskProcessRecordDto != null){
|
||||||
//resultTaskDto.setLabel(taskProcessRecordDto.getLabel());
|
//resultTaskDto.setLabel(taskProcessRecordDto.getLabel());
|
||||||
ProcessRecordEnum byType = ProcessRecordEnum.findByType(taskProcessRecordDto.getType());
|
if(taskProcessRecordDto.getUseType()==0){
|
||||||
Optional.ofNullable(byType).ifPresent(processRecordEnum -> resultTaskDto.setTypeDesc(byType.getDesc()));
|
ProcessRecordEnum byType = ProcessRecordEnum.findByType(taskProcessRecordDto.getType());
|
||||||
if(finalStaffEntity !=null){
|
Optional.ofNullable(byType).ifPresent(processRecordEnum -> resultTaskDto.setTypeDesc(byType.getDesc()));
|
||||||
resultTaskDto.setAvatar(finalStaffEntity.getAvatar());
|
if(finalStaffEntity !=null){
|
||||||
resultTaskDto.setStaffName(finalStaffEntity.getName());
|
resultTaskDto.setAvatar(finalStaffEntity.getAvatar());
|
||||||
|
resultTaskDto.setStaffName(finalStaffEntity.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if(taskProcessRecordDto.getUseType()==1){
|
||||||
|
resultTaskDto.setTypeDesc(taskProcessRecordDto.getLabel());
|
||||||
|
StaffEntity staffEntity1 = staffService.selectStaffById(taskProcessRecordDto.getStaffId());
|
||||||
|
if(staffEntity1 !=null){
|
||||||
|
resultTaskDto.setAvatar(staffEntity1.getAvatar());
|
||||||
|
resultTaskDto.setStaffName(staffEntity1.getName());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -140,6 +140,19 @@ public class TaskProcessRecordServiceImpl extends ServiceImpl<TaskProcessRecordM
|
|||||||
});
|
});
|
||||||
Optional.ofNullable(staffOccupationByStaffId).ifPresent(staffOccupationEntity -> dto.setPosition(staffOccupationEntity.getPosition()));
|
Optional.ofNullable(staffOccupationByStaffId).ifPresent(staffOccupationEntity -> dto.setPosition(staffOccupationEntity.getPosition()));
|
||||||
|
|
||||||
|
if (dto.getUseType()==1 ) {
|
||||||
|
if(dto.getStaffId().equals(req.getStaffId())){
|
||||||
|
dto.setIsSelf(1);
|
||||||
|
}
|
||||||
|
staffEntity = staffService.selectStaffById(dto.getStaffId());
|
||||||
|
Optional.ofNullable(staffEntity).ifPresent(staffEntity12 -> {
|
||||||
|
dto.setAvatar(staffEntity12.getAvatar());
|
||||||
|
dto.setStaffName(staffEntity12.getName());
|
||||||
|
StaffOccupationEntity staffOccupation= staffOccupationService.getStaffOccupationByStaffId(staffEntity12.getId());
|
||||||
|
Optional.ofNullable(staffOccupation).ifPresent(staffOccupationEntity -> dto.setPosition(staffOccupationEntity.getPosition()));
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -645,7 +645,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectStaffIdsByFlowProcess" resultType="long">
|
<select id="selectStaffIdsByFlowProcess" resultType="long">
|
||||||
select staff_id from lz_result_record where is_delete = 0
|
select DISTINCT (staff_id) from lz_result_record where is_delete = 0 and start_id !=0
|
||||||
and flow_process in (
|
and flow_process in (
|
||||||
<foreach collection="flowProcess" item="process" separator=",">
|
<foreach collection="flowProcess" item="process" separator=",">
|
||||||
#{process}
|
#{process}
|
||||||
|
|||||||
@ -131,7 +131,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectTaskProcessRecordsByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
<select id="selectTaskProcessRecordsByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
||||||
select gmt_create,remark,label,type,name,use_type,detail_id,task_id from lz_task_process_record where task_id=#{taskId}
|
select gmt_create,remark,label,type,name,use_type,detail_id,task_id,staff_id,at_staff_ids,at_staff_names from lz_task_process_record where task_id=#{taskId}
|
||||||
<if test="useType !=null">
|
<if test="useType !=null">
|
||||||
and use_type = #{useType}
|
and use_type = #{useType}
|
||||||
</if>
|
</if>
|
||||||
@ -143,13 +143,13 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectTaskProcessRecordLastByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
<select id="selectTaskProcessRecordLastByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
||||||
select gmt_create,remark,label,type from lz_task_process_record where task_id=#{taskId} and is_delete = 0
|
select gmt_create,remark,label,type,use_type,task_id,detail_id,staff_id,at_staff_ids,at_staff_names from lz_task_process_record where task_id=#{taskId} and is_delete = 0
|
||||||
order by id desc limit 1
|
order by id desc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectTaskProcessRecordsByTaskIdsAndType" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
<select id="selectTaskProcessRecordsByTaskIdsAndType" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
||||||
select gmt_create,remark,label,type,use_type,task_id,detail_id from lz_task_process_record where is_delete = 0
|
select gmt_create,remark,label,type,use_type,task_id,detail_id,staff_id,at_staff_ids,at_staff_names from lz_task_process_record where is_delete = 0
|
||||||
<if test="useType !=null">
|
<if test="useType !=null">
|
||||||
and use_type = #{useType}
|
and use_type = #{useType}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user