Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
杜建超 2020-11-04 16:19:39 +08:00
commit a95005be4e
2 changed files with 47 additions and 0 deletions

View File

@ -186,6 +186,34 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
if(flowStart1 == null){
insertFlowStart(flowStart);
}else{
List<String> ids1= Arrays.stream(flowStart1.getGroupIds().split(",")).map(new Function<String, String>() {
@Override
public String apply(String s) {
return s;
}
}).collect(Collectors.toList());
Map<String, String> maps = ids1.stream().collect(Collectors.toMap(e->e, e->e));
List<String> ids= Arrays.stream(flowStart.getGroupIds().split(",")).map(new Function<String, String>() {
@Override
public String apply(String s) {
return s;
}
}).collect(Collectors.toList());
for (String str:ids
) {//过滤掉已经发起的
if(maps.containsKey(str)){
ids.remove(str);
}
}
if(ids.size() == 0){
return R.ok("发起成功,该任务已经发起过")
.put("data", flowStart1);
}
ids1.addAll(ids);
flowStart1.setGroupIds(ids1.stream().collect(Collectors.joining(",")));//把新的组信息加入
updateById(flowStart1);//更新组信息到记录里面
flowStart.setId(flowStart1.getId());
flowStart.setIsDelete(flowStart1.getIsDelete());
@ -299,6 +327,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
evaluationGroup.setId(null);
evaluationGroup.setGmtCreate(null);
evaluationGroup.setGmtModified(null);
evaluationGroup.setStartId(flowStart.getId());
evaluationGroupService.insertEvaluationGroup(evaluationGroup);
//拷贝考评组的指标信息

View File

@ -28,6 +28,8 @@ import javax.annotation.Resource;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author fumeiai
@ -199,6 +201,22 @@ public class DingtalkBusiness {
public String sendWorkMSGWithThread(List<StaffSimpleInfo> toStaffids, int type) {
if(toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0){
//查询第三方id
List<Long> ids = toStaffids.stream().map(new Function<StaffSimpleInfo, Long>() {
@Override
public Long apply(StaffSimpleInfo staffSimpleInfo) {
return staffSimpleInfo.getId();
}
}).collect(Collectors.toList());
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(ids);
Map<Long, StaffSimpleInfo> map = toStaffids.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, e->e));
for (StaffSimpleInfo staff:staffSimpleInfos
) {
StaffSimpleInfo staff1 = map.get(staff.getId());
staff1.setEmployeeId(staff1.getEmployeeId());
}
}
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
ThreadSendMessage threadSendMessage = new ThreadSendMessage(toStaffids, workMsgTypeEnum, appid);