发起考评时保存拷贝考核组id
This commit is contained in:
parent
2c07bed2cb
commit
4295254080
@ -52,4 +52,5 @@ public interface EvaluationGroupMapper extends BaseMapper<EvaluationGroup> {
|
|||||||
|
|
||||||
EvaluationGroup selectEvaluationGroupByCopyId(@Param("copyId")Long copyId,@Param("startId")Long startId);
|
EvaluationGroup selectEvaluationGroupByCopyId(@Param("copyId")Long copyId,@Param("startId")Long startId);
|
||||||
|
|
||||||
|
List<EvaluationGroup> selectEvaluationGroupByCopyIds(@Param("ids") List<Long> ids);
|
||||||
}
|
}
|
||||||
@ -59,4 +59,6 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
|
|||||||
String getEvaluationCopyIdsByEvaluationIds(String evaluationIds,Long startId);
|
String getEvaluationCopyIdsByEvaluationIds(String evaluationIds,Long startId);
|
||||||
|
|
||||||
EvaluationGroup selectEvaluationGroupByCopyId(Long copyId, Long startId);
|
EvaluationGroup selectEvaluationGroupByCopyId(Long copyId, Long startId);
|
||||||
|
|
||||||
|
List<EvaluationGroup> selectEvaluationGroupByCopyIds(List<Long> ids);
|
||||||
}
|
}
|
||||||
@ -424,4 +424,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
|||||||
public EvaluationGroup selectEvaluationGroupByCopyId(Long copyId, Long startId){
|
public EvaluationGroup selectEvaluationGroupByCopyId(Long copyId, Long startId){
|
||||||
return evaluationGroupMapper.selectEvaluationGroupByCopyId(copyId, startId);
|
return evaluationGroupMapper.selectEvaluationGroupByCopyId(copyId, startId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EvaluationGroup> selectEvaluationGroupByCopyIds(List<Long> ids){
|
||||||
|
return evaluationGroupMapper.selectEvaluationGroupByCopyIds(ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -206,16 +206,33 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
}else{
|
}else{
|
||||||
flowStart.setName(startDate + "绩效考核");
|
flowStart.setName(startDate + "绩效考核");
|
||||||
}
|
}
|
||||||
|
List<String> newIds = new ArrayList<>();
|
||||||
FlowStart flowStart1 = selectFlowStartByName(flowStart.getName());
|
FlowStart flowStart1 = selectFlowStartByName(flowStart.getName());
|
||||||
if(flowStart1 == null){
|
if(flowStart1 == null){
|
||||||
insertFlowStart(flowStart);
|
insertFlowStart(flowStart);
|
||||||
|
flowStart1 = flowStart;
|
||||||
}else{
|
}else{
|
||||||
List<String> ids1= Arrays.stream(flowStart1.getGroupIds().split(",")).map(new Function<String, String>() {
|
|
||||||
|
//因为保存的时拷贝后的组,所以这里查询原来的组
|
||||||
|
List<Long> lIds= Arrays.stream(flowStart1.getGroupIds().split(",")).map(new Function<String, Long>() {
|
||||||
@Override
|
@Override
|
||||||
public String apply(String s) {
|
public Long apply(String s) {
|
||||||
return s;
|
newIds.add(s);
|
||||||
|
return Long.valueOf(s);
|
||||||
}
|
}
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
List<EvaluationGroup> evaluationGroups = evaluationGroupService.selectEvaluationGroupByCopyIds(lIds);
|
||||||
|
|
||||||
|
List<String> ids1= evaluationGroups.stream().map(new Function<EvaluationGroup, String>() {
|
||||||
|
@Override
|
||||||
|
public String apply(EvaluationGroup evaluationGroup) {
|
||||||
|
return evaluationGroup.getId().toString();
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
//查询拷贝后的
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Map<String, String> maps = ids1.stream().collect(Collectors.toMap(e->e, e->e));
|
Map<String, String> maps = ids1.stream().collect(Collectors.toMap(e->e, e->e));
|
||||||
|
|
||||||
//求差集发起,但是历史记录怎么搞
|
//求差集发起,但是历史记录怎么搞
|
||||||
@ -234,9 +251,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(ids.size() == 0){
|
if(ids.size() == 0){
|
||||||
/*return R.ok("发起成功,该任务已经发起过")
|
/*return R.ok("发起成功,该任务已经发起过")
|
||||||
.put("data", flowStart1);*/
|
.put("data", flowStart1);*/
|
||||||
@ -246,8 +260,8 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
}else{
|
}else{
|
||||||
log.info("有新增组");
|
log.info("有新增组");
|
||||||
ids1.addAll(ids);
|
ids1.addAll(ids);
|
||||||
flowStart1.setGroupIds(ids1.stream().collect(Collectors.joining(",")));//把新的组信息加入
|
flowStart1.setGroupIds(ids1.stream().collect(Collectors.joining(",")));//把新的组信息加入,把拷贝前的组信息保存下来
|
||||||
updateFlowStartById(flowStart1);//更新组信息到记录里面
|
|
||||||
|
|
||||||
flowStart.setGroupIds(ids.stream().collect(Collectors.joining(",")));//过滤后的考核组
|
flowStart.setGroupIds(ids.stream().collect(Collectors.joining(",")));//过滤后的考核组
|
||||||
flowStart.setId(flowStart1.getId());
|
flowStart.setId(flowStart1.getId());
|
||||||
@ -315,12 +329,16 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
case 5:
|
case 5:
|
||||||
return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
|
return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
|
||||||
case 0:
|
case 0:
|
||||||
|
newIds.add(evaluationGroup.getId().toString());
|
||||||
noticeStaff.addAll(staffIds);
|
noticeStaff.addAll(staffIds);
|
||||||
startStartDtos.add(startDto);
|
startStartDtos.add(startDto);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
flowStart1.setGroupIds(newIds.stream().collect(Collectors.joining(",")));
|
||||||
|
updateFlowStartById(flowStart1);//更新组信息到记录里面
|
||||||
initFlowRecordAnsy(startStartDtos, 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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -165,5 +165,11 @@
|
|||||||
<select id="selectEvaluationGroupByCopyId" resultType="EvaluationGroup" >
|
<select id="selectEvaluationGroupByCopyId" resultType="EvaluationGroup" >
|
||||||
select * from lz_evaluation_group where is_delete = 0 and copy_id = #{copyId} and start_id = #{startId} limit 1
|
select * from lz_evaluation_group where is_delete = 0 and copy_id = #{copyId} and start_id = #{startId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEvaluationGroupByCopyIds" resultType="EvaluationGroup" >
|
||||||
|
select * from lz_evaluation_group join ( select copy_id from lz_evaluation_group where is_delete = 0 and id in (
|
||||||
|
<foreach collection="ids" item="item" separator=",">#{item}</foreach>
|
||||||
|
)) as b on lz_evaluation_group.id = b.copy_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user