This commit is contained in:
杜建超 2020-10-22 17:17:05 +08:00
parent 1572d6df84
commit 51d9cfbc5b
3 changed files with 34 additions and 12 deletions

View File

@ -1,5 +1,6 @@
package com.lz.modules.performance.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.modules.flow.dao.FlowStartMapper;
@ -11,6 +12,8 @@ import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.res.AssessManagerDetailRes;
import com.lz.modules.performance.res.AssessManagerListRes;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.entity.app.ResultRecord;
import io.swagger.annotations.ApiImplicitParam;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,9 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.ToLongFunction;
@ -40,6 +41,8 @@ public class AssessManagerController {
private FlowStartMapper flowStartMapper;
@Autowired
private EvaluationGroupService evaluationGroupService;
@Autowired
private ResultRecordMapper resultRecordMapper;
@RequestMapping("assess/manager/list")
@ -54,13 +57,13 @@ public class AssessManagerController {
}
list.forEach(flowStart -> {
AssessManagerListRes res = new AssessManagerListRes();
String name = flowStart.getName();
res.setId(flowStart.getId());
res.setName(flowStart.getName());
if(flowStart.getCycleType()==0){
}else if(flowStart.getCycleType()==1){
res.setName(name);
if(name.contains("绩效考核")){
res.setCycleTime(name.substring(0,name.lastIndexOf("绩效考核")));
}
res.setJoinNum("");
data.add(res);
});
@ -97,13 +100,16 @@ public class AssessManagerController {
if(CollectionUtils.isEmpty(evaluationGroups)){
return R.ok();
}
Set<String> staffIds = new HashSet<>();
evaluationGroups.stream().forEach(evaluationGroup -> {
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(evaluationGroup.getId());
//删除考核任务
staffIds.addAll(strings);
});
List<String> distStaffIds = new ArrayList<>(staffIds);
// 批量删除
resultRecordMapper.batchDeleteByStaffIdsAndMonth(distStaffIds,"","");
return R.ok();
}
}

View File

@ -79,6 +79,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ResultRecord> selectResultRankList(@Param("page") IPage page, @Param("req") ChartResultReq req);
void
void batchDeleteByStaffIdsAndMonth(@Param("staffIds")List<String> staffIds,@Param("startTime")String startTime,@Param("endTime")String endTime);
int countStartAndGroupNum(@Param("startId")Long startId);
}

View File

@ -353,5 +353,20 @@
where r.is_delete =0 and s.is_delete=0 ORDER BY all_score desc
</select>
<update id="batchDeleteByStaffIdsAndMonth">
update lz_result_record set is_delete = 1 where
is_delete = 0
and month_time = #{}
staff_id in
<foreach collection="staffIds" item="staff_id" open="(" close=")"
separator=",">
#{staff_id}
</foreach>
</update>
<select id="countStartAndGroupNum" resultType="int">
select COUNT(1) from lz_result_record where is_delete = 0 and start_id = #{startId}
</select>
</mapper>