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-03 17:37:38 +08:00
commit 831693d207
5 changed files with 39 additions and 0 deletions

View File

@ -8,6 +8,7 @@ package com.lz.modules.flow.dao;
* @since 2020-10-13
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.app.entity.StaffSimpleInfo;
import com.lz.modules.flow.entity.EvaluationStartStaff;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -46,4 +47,6 @@ public interface EvaluationStartStaffMapper extends BaseMapper<EvaluationStartSt
int deleteEvaluationStartStaffChangeAssess(@Param("startId") Long startId,@Param("staffIds") List<String> staffIds);
List<Long> selectStaffIdsByStart(@Param("startId") Long startId);
List<Long> selectStaffIdsByStartAndStaffId(@Param("startId") Long id, @Param("list") List<StaffSimpleInfo> staffIds);
}

View File

@ -1,6 +1,7 @@
package com.lz.modules.flow.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.app.entity.StaffSimpleInfo;
import com.lz.modules.flow.entity.EvaluationStartStaff;
import java.util.List;
@ -40,4 +41,5 @@ public interface EvaluationStartStaffService extends IService<EvaluationStartSta
int updateBatchToScore(Long startId,Long evaluationId);
List<Long> selectStaffIdsByStartAndStaffId(Long id, List<StaffSimpleInfo> staffIds);
}

View File

@ -1,6 +1,7 @@
package com.lz.modules.flow.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.modules.app.entity.StaffSimpleInfo;
import com.lz.modules.flow.dao.EvaluationStartStaffMapper;
import com.lz.modules.flow.entity.EvaluationStartStaff;
import com.lz.modules.flow.service.EvaluationStartStaffService;
@ -103,4 +104,9 @@ public class EvaluationStartStaffServiceImpl extends ServiceImpl<EvaluationStart
public int updateBatchToScore(Long startId,Long evaluationId) {
return evaluationStartStaffMapper.updateBatchToScore(startId, evaluationId);
}
@Override
public List<Long> selectStaffIdsByStartAndStaffId(Long id, List<StaffSimpleInfo> staffIds){
return evaluationStartStaffMapper.selectStaffIdsByStartAndStaffId(id, staffIds);
}
}

View File

@ -8,6 +8,7 @@ import com.lz.common.utils.StringUtil;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.entity.StaffSimpleInfo;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.dao.EvaluationStartStaffMapper;
import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.*;
import com.lz.modules.flow.model.*;
@ -83,6 +84,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
@Override
public FlowStart selectFlowStartById(Long id){
return flowStartMapper.selectFlowStartById(id);
@ -180,6 +182,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
}else{
flowStart.setId(flowStart1.getId());
flowStart.setIsDelete(flowStart1.getIsDelete());
}
@ -202,6 +205,21 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
//下面初始化员工考核流程
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);
if(flowStart.getIsDelete() != null){//已经发起过的
//下面去调已经发起的用户
List<Long> longs = evaluationStartStaffService.selectStaffIdsByStartAndStaffId(flowStart.getId(), staffIds);
if(longs.size() > 0){
Map<Long, StaffSimpleInfo> map
= staffIds.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, e->e));
for (Long key:longs
) {
map.remove(key);
}
staffIds = map.values().stream().collect(Collectors.toList());
}
}
if(staffIds.size() == 0){
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚

View File

@ -167,5 +167,15 @@
<select id="selectStaffIdsByStart" resultType="long">
select staff_id from lz_evaluation_start_staff where start_id=#{startId} and is_delete = 0
</select>
<select id="selectStaffIdsByStartAndStaffId" resultType="long">
select staff_id from lz_evaluation_start_staff where start_id=#{startId} and is_delete = 0
and staff_id in (
<foreach collection="list" item="item" separator=",">
#{item.id}
</foreach>
)
group by staff_id
</select>
</mapper>