This commit is contained in:
杜建超 2020-10-28 17:48:24 +08:00
parent 538dab9114
commit cfe61f1a58
9 changed files with 70 additions and 1 deletions

View File

@ -38,4 +38,7 @@ public interface EvaluationStartStaffMapper extends BaseMapper<EvaluationStartSt
EvaluationStartStaff selectOneByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffId")Long staffId);
EvaluationStartStaff selectManagerEvaluationStartStaff(@Param("evaluationId") Long evaluationId, @Param("staffId") Long userId);
int existByStartIdAndEvaluationId(@Param("startId") Long startId,@Param("evaluationId")Long evaluationId);
}

View File

@ -56,6 +56,10 @@ public class EvaluationGroup implements java.io.Serializable {
@ApiModelProperty(value = "参与考核人数", name = "counts")
private int counts;
@TableField(exist = false)
@ApiModelProperty(value = "是否评分 0 :未通知 1已通知", name = "score")
private int score;
/**
*
* @return

View File

@ -37,4 +37,6 @@ public interface EvaluationStartStaffService extends IService<EvaluationStartSta
EvaluationStartStaff selectOneByStartIdAndStaffId(Long startId,Long staffId);
EvaluationStartStaff selectManagerEvaluationStartStaff(Long evaluationId, Long userId);
int existByStartIdAndEvaluationId(Long startId,Long evaluationId);
}

View File

@ -12,6 +12,7 @@ import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.StaffOccupationService;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.dao.EvaluationGroupMapper;
import com.lz.modules.flow.dao.EvaluationStartStaffMapper;
import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.req.EvaluationGroupReq;
@ -55,6 +56,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
@Autowired
private FlowStartService flowStartService;
@Autowired
private EvaluationStartStaffMapper evaluationStartStaffMapper;
@Override
@ -117,6 +121,10 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
) {
List<String> ids = evaluationGroupService.selectAllStaffIdsByGroupId(group.getId());
group.setCounts(ids.size());
int i = evaluationStartStaffMapper.existByStartIdAndEvaluationId(req.getStartId(),group.getId());
if(i>0){
group.setScore(1);
}
}
return pageUtils;
}

View File

@ -98,4 +98,9 @@ public class EvaluationStartStaffServiceImpl extends ServiceImpl<EvaluationStart
public EvaluationStartStaff selectManagerEvaluationStartStaff(Long evaluationId, Long userId){
return evaluationStartStaffMapper.selectManagerEvaluationStartStaff(evaluationId,userId);
}
@Override
public int existByStartIdAndEvaluationId(Long startId, Long evaluationId) {
return evaluationStartStaffMapper.existByStartIdAndEvaluationId(startId, evaluationId);
}
}

View File

@ -0,0 +1,21 @@
package com.lz.modules.performance.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: djc
* @Desc:
* @Date: 2020/10/28 17:22
*/
@Data
@ApiModel("开始评分")
public class AssessToScoreReq {
@ApiModelProperty(value = "考核组ids",name = "evaluationIds")
private String evaluationIds;
@ApiModelProperty(value = "考核id",name = "startId")
private Long startId;
}

View File

@ -5,6 +5,7 @@ import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.req.AssessToScoreReq;
/**
* @Author: djc
@ -20,4 +21,6 @@ public interface AssessManagerService {
void accessDelete(FlowStart flowStart);
String assessChange(AssessChangeReq req);
void toScore(AssessToScoreReq req);
}

View File

@ -13,6 +13,7 @@ import com.lz.modules.flow.service.EvaluationStartStaffService;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.req.AssessToScoreReq;
import com.lz.modules.performance.res.AssessManagerDetailRes;
import com.lz.modules.performance.res.AssessManagerListRes;
import com.lz.modules.performance.service.AssessManagerService;
@ -111,17 +112,19 @@ public class AssessManagerServiceImpl implements AssessManagerService {
if(flowStart == null){
return "暂无此考核组信息";
}
//获取本次考的所有考评组信息
String[] split = flowStart.getGroupIds().split(",");
String[] changeStaffIds = req.getStaffIds().split(",");
List<String> strings = Arrays.asList(split);
List<Long> ids = strings.stream().map(s -> Long.valueOf(s)).collect(toList());
List<EvaluationGroup> evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids);
Set<String> staffIds = new HashSet<>();
//获取所有考核人员
for(EvaluationGroup group:evaluationGroups){
List<String> staff = evaluationGroupService.selectAllStaffIdsByGroupId(group.getId());
staffIds.addAll(staff);
}
List<String> all = new ArrayList<>(staffIds);
String[] changeStaffIds = req.getStaffIds().split(",");
List<String> change = Arrays.asList(changeStaffIds);
if(req.getChangeType() == 0){
//获取不在考评组的人员
@ -142,10 +145,26 @@ public class AssessManagerServiceImpl implements AssessManagerService {
}
if(req.getChangeType() == 1){
//删除本次考核任务
resultRecordMapper.batchDeleteByStartIdAndStaffId(req.getStartId(),change);
return ok;
}
return ok;
}
@Override
public void toScore(AssessToScoreReq req) {
String[] split = req.getEvaluationIds().split(",");
for(String s:split){
int i = evaluationStartStaffService.existByStartIdAndEvaluationId(req.getStartId(), Long.valueOf(s));
if(i<1){
}
}
}
}

View File

@ -126,5 +126,9 @@
AND staff_id =#{staffId} and type = 1 is_delete = 0 and limit 1
</select>
<select id="existByStartIdAndEvaluationId" resultType="Integer">
select count(1) from lz_evaluation_start_staff where is_delete = 0 and evaluation_id=#{evaluationId}
AND staff_id =#{staffId} and score = 1 limit 1
</select>
</mapper>