This commit is contained in:
杜建超 2020-10-30 09:27:38 +08:00
parent 2b6265cb97
commit d8a4bf513a
7 changed files with 47 additions and 3 deletions

View File

@ -41,4 +41,5 @@ public interface EvaluationStartStaffMapper extends BaseMapper<EvaluationStartSt
int existByStartIdAndEvaluationId(@Param("startId") Long startId,@Param("evaluationId")Long evaluationId);
int updateBatchToScore(@Param("startId") Long startId,@Param("evaluationId")Long evaluationId);
}

View File

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

View File

@ -99,4 +99,8 @@ public class EvaluationStartStaffServiceImpl extends ServiceImpl<EvaluationStart
return evaluationStartStaffMapper.selectManagerEvaluationStartStaff(evaluationId,userId);
}
@Override
public int updateBatchToScore(Long startId,Long evaluationId) {
return evaluationStartStaffMapper.updateBatchToScore(startId, evaluationId);
}
}

View File

@ -1,8 +1,10 @@
package com.lz.modules.performance.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.dto.ApprovalDto;
import com.lz.modules.app.dto.StaffSimpleDto;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.dao.FlowStartMapper;
@ -11,6 +13,7 @@ import com.lz.modules.flow.entity.EvaluationStartStaff;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.EvaluationStartStaffService;
import com.lz.modules.flow.service.FlowRecordService;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.AssessListReq;
@ -20,6 +23,7 @@ import com.lz.modules.performance.res.AssessManagerListRes;
import com.lz.modules.performance.service.AssessManagerService;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
import com.sun.org.apache.regexp.internal.RE;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -49,6 +53,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
private EvaluationStartStaffService evaluationStartStaffService;
@Autowired
private StaffService staffService;
@Autowired
private ResultRecordService resultRecordService;
@Override
public PageUtils assessList(AssessListReq req) {
@ -158,11 +164,23 @@ public class AssessManagerServiceImpl implements AssessManagerService {
@Override
public void toScore(AssessToScoreReq req) {
String[] split = req.getEvaluationIds().split(",");
Arrays.asList(split);
for(String s:split){
Long evaluation = Long.valueOf(s);
//更新评分
int i = evaluationStartStaffService.updateBatchToScore(req.getStartId(), evaluation);
/* evaluationStartStaffService.updateBatchById()
evaluationStartStaffService.saveBatch()*/
List<Long> longs = resultRecordMapper.selectToScoreList(req.getStartId(), evaluation);
}
List<String> strings = Arrays.asList(split);
//更新流程绩效
ApprovalDto approvalDto = new ApprovalDto();
try {
resultRecordService.newApproval(approvalDto);
} catch (Exception e) {
e.printStackTrace();
}
}

View File

@ -90,4 +90,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ChartStatistical> countAssessNumByFlowProcess(@Param("req")AssessDetailReq req);
void batchDeleteByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffIds") List<String> staffIds);
List<Long> selectToScoreList(@Param("startId")Long startId,@Param("evaluationId")Long evaluationId);
}

View File

@ -461,5 +461,12 @@
)
</update>
<select id="selectToScoreList" resultType="long">
select id from lz_result_record where is_delete = 0
and start_id = #{startId}
and flow_process = 2
and evaluation_id = #{evaluationId}
</select>
</mapper>

View File

@ -130,5 +130,15 @@
select count(1) from lz_evaluation_start_staff where is_delete = 0 and evaluation_id=#{evaluationId}
AND start_id =#{startId} and score = 1 limit 1
</select>
<update id="updateBatchToScore">
update
lz_evaluation_start_staff
set
score = 1,
,gmt_modified = now()
where is_delete = 0 and score = 0 and type = 0
and evaluation_id = #{evaluationId} and start_id = #{startId}
</update>
</mapper>