人员考核结果按考核时间排序;解决评分保存未计算等级问题;解决未评分时考核任务清单中查看评分详情报错
parent
d090a638fd
commit
1a88af49dd
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.db.dto.MonthRangeSo;
|
import com.gunshi.db.dto.MonthRangeSo;
|
||||||
import com.gunshi.project.xyt.entity.so.AssessTaskPageSo;
|
import com.gunshi.project.xyt.entity.so.AssessTaskPageSo;
|
||||||
import com.gunshi.project.xyt.entity.vo.AssessResultVo;
|
import com.gunshi.project.xyt.entity.vo.AssessResultVo;
|
||||||
|
import com.gunshi.project.xyt.model.AssessIndicator;
|
||||||
import com.gunshi.project.xyt.model.AssessObject;
|
import com.gunshi.project.xyt.model.AssessObject;
|
||||||
import com.gunshi.project.xyt.model.AssessTask;
|
import com.gunshi.project.xyt.model.AssessTask;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
@ -23,11 +24,12 @@ public interface AssessTaskMapper extends BaseMapper<AssessTask> {
|
||||||
|
|
||||||
@Select("""
|
@Select("""
|
||||||
<script>
|
<script>
|
||||||
select t1.indicator_id from public.assess_template_indicator_rel t1
|
select t1.indicator_id,t2.standard_score from public.assess_template_indicator_rel t1
|
||||||
|
left join public.assess_indicator t2 on t1.indicator_id = t2.id
|
||||||
where t1.template_id = #{templateId}
|
where t1.template_id = #{templateId}
|
||||||
</script>
|
</script>
|
||||||
""")
|
""")
|
||||||
List<Long> queryIndicators(@Param("templateId") Long templateId);
|
List<AssessIndicator> queryIndicators(@Param("templateId") Long templateId);
|
||||||
|
|
||||||
@Select("""
|
@Select("""
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -84,7 +86,8 @@ public interface AssessTaskMapper extends BaseMapper<AssessTask> {
|
||||||
|
|
||||||
@Select("""
|
@Select("""
|
||||||
<script>
|
<script>
|
||||||
select t.object_id,t.indicator_id,t.standard_score,t.assess_score,s.object_user_name,s.assess_score as resScore,m.indicator_name,n.name as categoryName from public.assess_object_rating t
|
select t.object_id,t.indicator_id,t.standard_score,t.assess_score,s.object_user_name,s.assess_score as resScore,m.indicator_name,n.name as categoryName
|
||||||
|
from public.assess_object_rating t
|
||||||
left join public.assess_object s on t.object_id = s.id
|
left join public.assess_object s on t.object_id = s.id
|
||||||
left join public.assess_indicator m on t.indicator_id = m.id
|
left join public.assess_indicator m on t.indicator_id = m.id
|
||||||
left join public.assess_category n on m.category_id = n.id
|
left join public.assess_category n on m.category_id = n.id
|
||||||
|
|
@ -108,6 +111,7 @@ public interface AssessTaskMapper extends BaseMapper<AssessTask> {
|
||||||
where t.status = 3
|
where t.status = 3
|
||||||
and date_trunc('MONTH', t.start_date) <![CDATA[>=]]> #{obj.start}
|
and date_trunc('MONTH', t.start_date) <![CDATA[>=]]> #{obj.start}
|
||||||
and date_trunc('MONTH', t.start_date) <![CDATA[<=]]> #{obj.end}
|
and date_trunc('MONTH', t.start_date) <![CDATA[<=]]> #{obj.end}
|
||||||
|
order by t.start_date
|
||||||
</script>
|
</script>
|
||||||
""")
|
""")
|
||||||
List<AssessTask> resultStat(@Param("obj") MonthRangeSo monthRangeSo);
|
List<AssessTask> resultStat(@Param("obj") MonthRangeSo monthRangeSo);
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,9 @@ public class AssessTaskService extends ServiceImpl<AssessTaskMapper, AssessTask>
|
||||||
@Autowired
|
@Autowired
|
||||||
private AssessObjectRatingMapper objectRatingMapper;
|
private AssessObjectRatingMapper objectRatingMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AssessTeamRatingService teamRatingService;
|
||||||
|
|
||||||
public AssessTask saveData(AssessTask dto) {
|
public AssessTask saveData(AssessTask dto) {
|
||||||
dto.setId(IdWorker.getId());
|
dto.setId(IdWorker.getId());
|
||||||
dto.setStatus(0);
|
dto.setStatus(0);
|
||||||
|
|
@ -116,6 +119,21 @@ public class AssessTaskService extends ServiceImpl<AssessTaskMapper, AssessTask>
|
||||||
List<AssessTeam> teams = assessObjectService.getTeam(id);
|
List<AssessTeam> teams = assessObjectService.getTeam(id);
|
||||||
teams.stream().forEach(o->o.setStatus(1));
|
teams.stream().forEach(o->o.setStatus(1));
|
||||||
assessObjectService.updateTeams(teams);
|
assessObjectService.updateTeams(teams);
|
||||||
|
|
||||||
|
//考核指标
|
||||||
|
List<AssessTeamRating> ratings = new ArrayList<>();
|
||||||
|
List<AssessIndicator> indicatorIds = this.baseMapper.queryIndicators(task.getTemplateId());
|
||||||
|
for(AssessTeam team : teams){
|
||||||
|
for(AssessIndicator indicator : indicatorIds){
|
||||||
|
AssessTeamRating rating = new AssessTeamRating();
|
||||||
|
rating.setId(IdWorker.getId());
|
||||||
|
rating.setTeamId(team.getId());
|
||||||
|
rating.setIndicatorId(indicator.getId());
|
||||||
|
rating.setStandardScore(indicator.getStandardScore());
|
||||||
|
ratings.add(rating);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
teamRatingService.saveBatch(ratings);
|
||||||
return "启动成功";
|
return "启动成功";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,11 @@ public class AssessTeamRatingService extends ServiceImpl<AssessTeamRatingMapper,
|
||||||
@Autowired
|
@Autowired
|
||||||
private AssessIndicatorRatingService indicatorRatingService;
|
private AssessIndicatorRatingService indicatorRatingService;
|
||||||
|
|
||||||
|
public Boolean saveScore(AssessScoreVo vo) {
|
||||||
|
return commonScore(vo,9);
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean score(AssessScoreVo vo) {
|
private Boolean commonScore(AssessScoreVo vo,Integer status){
|
||||||
List<AssessTeamRating> ratings = vo.getRatings();
|
List<AssessTeamRating> ratings = vo.getRatings();
|
||||||
Long teamId = ratings.get(0).getTeamId();
|
Long teamId = ratings.get(0).getTeamId();
|
||||||
this.delData(teamId);
|
this.delData(teamId);
|
||||||
|
|
@ -69,7 +72,7 @@ public class AssessTeamRatingService extends ServiceImpl<AssessTeamRatingMapper,
|
||||||
AssessTask task = taskMapper.selectById(vo.getTaskId());
|
AssessTask task = taskMapper.selectById(vo.getTaskId());
|
||||||
//更新该考核人员对考核对象的状态为已评分
|
//更新该考核人员对考核对象的状态为已评分
|
||||||
AssessTeam assessTeam = teamMapper.selectById(teamId);
|
AssessTeam assessTeam = teamMapper.selectById(teamId);
|
||||||
assessTeam.setStatus(2);
|
assessTeam.setStatus(status);
|
||||||
//获取模板信息
|
//获取模板信息
|
||||||
AssessTemplate template = templateMapper.selectById(task.getTemplateId());
|
AssessTemplate template = templateMapper.selectById(task.getTemplateId());
|
||||||
//根据总得分计算等级
|
//根据总得分计算等级
|
||||||
|
|
@ -78,10 +81,16 @@ public class AssessTeamRatingService extends ServiceImpl<AssessTeamRatingMapper,
|
||||||
assessTeam.setAssessLevel(level);
|
assessTeam.setAssessLevel(level);
|
||||||
teamMapper.updateById(assessTeam);
|
teamMapper.updateById(assessTeam);
|
||||||
Boolean res = this.saveBatch(ratings);
|
Boolean res = this.saveBatch(ratings);
|
||||||
|
if(status == 2){
|
||||||
updateObjectAndTask(assessTeam.getObjectId(),vo.getTaskId(),template,task);
|
updateObjectAndTask(assessTeam.getObjectId(),vo.getTaskId(),template,task);
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean score(AssessScoreVo vo) {
|
||||||
|
return commonScore(vo,2);
|
||||||
|
}
|
||||||
|
|
||||||
private void delData(Long teamId) {
|
private void delData(Long teamId) {
|
||||||
List<AssessTeamRating> teamRatings = this.list(new QueryWrapper<AssessTeamRating>().eq("team_id", teamId));
|
List<AssessTeamRating> teamRatings = this.list(new QueryWrapper<AssessTeamRating>().eq("team_id", teamId));
|
||||||
if(CollectionUtils.isNotEmpty(teamRatings)){
|
if(CollectionUtils.isNotEmpty(teamRatings)){
|
||||||
|
|
@ -176,21 +185,7 @@ public class AssessTeamRatingService extends ServiceImpl<AssessTeamRatingMapper,
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean saveScore(AssessScoreVo vo) {
|
|
||||||
List<AssessTeamRating> ratings = vo.getRatings();
|
|
||||||
for(AssessTeamRating rating : ratings){
|
|
||||||
rating.setId(IdWorker.getId());
|
|
||||||
rating.setRectifyStatus(0);
|
|
||||||
fileService.save(rating.getFiles(), rating.getId().toString(), getGroupId(),getScoreType());
|
|
||||||
}
|
|
||||||
Long teamId = ratings.get(0).getTeamId();
|
|
||||||
this.delData(teamId);
|
|
||||||
AssessTeam assessTeam = teamMapper.selectById(teamId);
|
|
||||||
assessTeam.setAssessScore(vo.getScore());
|
|
||||||
assessTeam.setStatus(9);
|
|
||||||
teamMapper.updateById(assessTeam);
|
|
||||||
return this.saveOrUpdateBatch(ratings);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<Long,List<AssessRatingVo>> scoreDetail(Long objectId) {
|
public Map<Long,List<AssessRatingVo>> scoreDetail(Long objectId) {
|
||||||
List<AssessRatingVo> list = this.baseMapper.scoreByObjectId(objectId);
|
List<AssessRatingVo> list = this.baseMapper.scoreByObjectId(objectId);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue