批量推送时如果没有第三方id,查询
This commit is contained in:
parent
aeea27efbf
commit
99bace6039
@ -186,6 +186,34 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
if(flowStart1 == null){
|
if(flowStart1 == null){
|
||||||
insertFlowStart(flowStart);
|
insertFlowStart(flowStart);
|
||||||
}else{
|
}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.setId(flowStart1.getId());
|
||||||
flowStart.setIsDelete(flowStart1.getIsDelete());
|
flowStart.setIsDelete(flowStart1.getIsDelete());
|
||||||
@ -299,6 +327,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
evaluationGroup.setId(null);
|
evaluationGroup.setId(null);
|
||||||
evaluationGroup.setGmtCreate(null);
|
evaluationGroup.setGmtCreate(null);
|
||||||
evaluationGroup.setGmtModified(null);
|
evaluationGroup.setGmtModified(null);
|
||||||
|
evaluationGroup.setStartId(flowStart.getId());
|
||||||
evaluationGroupService.insertEvaluationGroup(evaluationGroup);
|
evaluationGroupService.insertEvaluationGroup(evaluationGroup);
|
||||||
|
|
||||||
//拷贝考评组的指标信息
|
//拷贝考评组的指标信息
|
||||||
|
|||||||
@ -28,6 +28,8 @@ import javax.annotation.Resource;
|
|||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author fumeiai
|
* @author fumeiai
|
||||||
@ -199,6 +201,22 @@ public class DingtalkBusiness {
|
|||||||
|
|
||||||
public String sendWorkMSGWithThread(List<StaffSimpleInfo> toStaffids, int type) {
|
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);
|
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
|
||||||
|
|
||||||
ThreadSendMessage threadSendMessage = new ThreadSendMessage(toStaffids, workMsgTypeEnum, appid);
|
ThreadSendMessage threadSendMessage = new ThreadSendMessage(toStaffids, workMsgTypeEnum, appid);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user