提交修改
This commit is contained in:
commit
e8e99bd78b
@ -43,4 +43,5 @@ public interface FlowChartMapper extends BaseMapper<FlowChart> {
|
||||
|
||||
List<FlowChart> selectFlowChartsByGroupId(Long groupId);
|
||||
|
||||
List<FlowChartRoleDto> selectCanSetChartRoleByChartId(Long id);
|
||||
}
|
||||
@ -37,7 +37,7 @@ public interface ResultTagetLibMapper extends BaseMapper<ResultTagetLib> {
|
||||
int deleteResultTagetLibById(@Param("id")Long id);
|
||||
|
||||
|
||||
List<ResultTagetLibDto> selectResultTagetLibByModelId(Long id);
|
||||
List<ResultTagetLib> selectResultTagetLibByModelId(Long id);
|
||||
|
||||
List<ResultTagetLibDto> selectByCondition(@Param("page") IPage page, @Param("req") ResultTagetLibSearchReq req);
|
||||
|
||||
|
||||
@ -41,4 +41,6 @@ public interface FlowChartService extends IService<FlowChart> {
|
||||
List<FlowChartDto> selectFlowChartDtoByFlowManagerId(Long id);
|
||||
|
||||
List<FlowChart> selectFlowChartsByGroupId(Long groupId);
|
||||
|
||||
List<FlowChartRoleDto> selectCanSetChartRoleByChartId(Long id);
|
||||
}
|
||||
@ -82,6 +82,12 @@ public class FlowChartServiceImpl extends ServiceImpl<FlowChartMapper, FlowChart
|
||||
return flowChartMapper.selectFlowChartsByGroupId(groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FlowChartRoleDto> selectCanSetChartRoleByChartId(Long id)
|
||||
{
|
||||
return flowChartMapper.selectCanSetChartRoleByChartId(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -383,9 +383,21 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
evaluationGroup =
|
||||
evaluationGroupService.selectEvaluationGroupByCopyId(evaluationGroup.getId(),flowStart.getId());
|
||||
if(evaluationGroup == null){
|
||||
log.info("无法assess/manager/detail找到拷贝组信息");
|
||||
log.info("无法找到拷贝组信息");
|
||||
return 5;
|
||||
}
|
||||
resultModelDtos = resultModelService.selectResultDtoByGroupId(evaluationGroup.getId());
|
||||
if(resultModelDtos.size() == 0){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||
log.info("拷贝组的维度信息错误");
|
||||
return 1;
|
||||
}
|
||||
for (ResultModelDto modelDto:resultModelDtos
|
||||
) {
|
||||
List<ResultTagetLibDto> resultTagetLibDtos = resultTagetLibService.selectResultTagetLibDtoByModelId(modelDto.getId());
|
||||
modelDto.setTagetLibs(resultTagetLibDtos);
|
||||
}
|
||||
|
||||
//以下代码没必要更新,因为这个拷贝分用不到。正确的对应关系清查看lz_evaluation_start_staff
|
||||
//evaluationGroup.setStaffIds(evaluationGroup.getStaffIds() + ",");
|
||||
|
||||
@ -424,6 +436,8 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
resultRecord.setCurrentApprovalStaffName(staffInfo.getName());
|
||||
|
||||
resultRecordService.insertResultRecord(resultRecord);
|
||||
//下面生成实际的考核流程
|
||||
resultRecordService.initFlowRecord(resultRecord.getId());
|
||||
staffInfo.setRecordId(resultRecord.getId());
|
||||
|
||||
for (ResultModelDto modelDto:resultModelDtos
|
||||
@ -454,8 +468,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
|
||||
}
|
||||
|
||||
//下面生成实际的考核流程
|
||||
resultRecordService.initFlowRecord(resultRecord.getId());
|
||||
|
||||
}
|
||||
evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs);
|
||||
return 0;
|
||||
|
||||
@ -181,7 +181,7 @@ public class ResultModelServiceImpl extends ServiceImpl<ResultModelMapper, Resul
|
||||
}
|
||||
|
||||
}
|
||||
if(delCount == 0){
|
||||
/*if(delCount == 0){
|
||||
//如果全部被删除,或者没有传入具体维度,那么默认保存一个维度
|
||||
//没有传具体的维度
|
||||
ResultModel resultModel = new ResultModel();
|
||||
@ -192,7 +192,7 @@ public class ResultModelServiceImpl extends ServiceImpl<ResultModelMapper, Resul
|
||||
resultModel.setOrderBy(resultModelOrderBy);
|
||||
resultModelMapper.insertResultModel(resultModel);
|
||||
return R.ok();
|
||||
}
|
||||
}*/
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ -138,6 +138,7 @@ public class AssessManagerController extends AbstractController{
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功")})
|
||||
public R assessToScore(@RequestBody @ApiParam AssessToScoreReq req){
|
||||
try {
|
||||
log.info("开始评分,当前登陆用户,userId:" + getUserId());
|
||||
assessManagerService.toScore(req);
|
||||
} catch (Exception e) {
|
||||
log.error("开始评分异常" ,e);
|
||||
|
||||
@ -57,8 +57,8 @@ public class FlowChartController {
|
||||
List<FlowChartDto> flowChartDtos = flowChartService.selectFlowChartDtoByFlowManagerId(flowManager.getId());
|
||||
for (FlowChartDto dto:flowChartDtos
|
||||
) {
|
||||
List<FlowChartRoleDto> flowCharts = flowChartService.selectChartRoleByChartId(dto.getId());
|
||||
dto.setRoleDtos(flowCharts);
|
||||
List<FlowChartRoleDto> flowChartRoles = flowChartService.selectCanSetChartRoleByChartId(dto.getId());
|
||||
dto.setRoleDtos(flowChartRoles);
|
||||
if(groupId > 0){
|
||||
//获取节点已保存的数据
|
||||
FlowChartDetailRecordListDto flowChartDetailRecordListDto = new FlowChartDetailRecordListDto();
|
||||
|
||||
@ -37,7 +37,7 @@ public interface ResultTagetLibService extends IService<ResultTagetLib> {
|
||||
int deleteResultTagetLibById(Long id);
|
||||
|
||||
|
||||
List<ResultTagetLibDto> selectResultTagetLibByModelId(Long id);
|
||||
List<ResultTagetLib> selectResultTagetLibByModelId(Long id);
|
||||
|
||||
PageUtils selectResultTagetLibByReq(ResultTagetLibSearchReq req);
|
||||
|
||||
|
||||
@ -292,33 +292,34 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
log.info("更新evaluationStartStaff 数据 为已评分 " + i);
|
||||
|
||||
List<ToScoreDingTalkDto> dtos = resultRecordMapper.selectToScoreList(req.getStartId(), evaluation);
|
||||
if(CollectionUtils.isEmpty(dtos)){
|
||||
log.info("该考评组无数据 evaluationId:" + evaluation);
|
||||
continue;
|
||||
if(CollectionUtils.isNotEmpty(dtos)){
|
||||
log.info("本次评分更新操作 num: " + dtos.size());
|
||||
dtos.forEach(dto -> {
|
||||
Long recordId = dto.getId();
|
||||
//更新流程绩效
|
||||
ApprovalDto approvalDto = new ApprovalDto();
|
||||
approvalDto.setStatus(1);
|
||||
approvalDto.setResultRecordId(recordId);
|
||||
approvalDto.setMenuName("开始评分");
|
||||
try {
|
||||
R r = resultRecordService.newApproval(approvalDto);
|
||||
log.info("绩效id aLong :" + recordId + " ,res" + JSON.toJSONString(r));
|
||||
} catch (Exception e) {
|
||||
log.error("执行中状态跳过失败 recorId:" + recordId,e);
|
||||
}
|
||||
//钉钉通知评分构建
|
||||
StaffSimpleInfo staffSimpleInfo = new StaffSimpleInfo();
|
||||
staffSimpleInfo.setId(dto.getStaffId());
|
||||
staffSimpleInfo.setRecordId(recordId);
|
||||
staffSimpleInfo.setStartId(req.getStartId());
|
||||
toStaffids.add(staffSimpleInfo);
|
||||
|
||||
});
|
||||
}
|
||||
else {
|
||||
log.info("该考评组无数据 evaluationId:" + evaluation);
|
||||
}
|
||||
log.info("本次评分更新操作 num: " + dtos.size());
|
||||
dtos.forEach(dto -> {
|
||||
Long recordId = dto.getId();
|
||||
//更新流程绩效
|
||||
ApprovalDto approvalDto = new ApprovalDto();
|
||||
approvalDto.setStatus(1);
|
||||
approvalDto.setResultRecordId(recordId);
|
||||
approvalDto.setMenuName("开始评分");
|
||||
try {
|
||||
R r = resultRecordService.newApproval(approvalDto);
|
||||
log.info("绩效id aLong :" + recordId + " ,res" + JSON.toJSONString(r));
|
||||
} catch (Exception e) {
|
||||
log.error("执行中状态跳过失败 recorId:" + recordId,e);
|
||||
}
|
||||
//钉钉通知评分构建
|
||||
StaffSimpleInfo staffSimpleInfo = new StaffSimpleInfo();
|
||||
staffSimpleInfo.setId(dto.getStaffId());
|
||||
staffSimpleInfo.setRecordId(recordId);
|
||||
staffSimpleInfo.setStartId(req.getStartId());
|
||||
toStaffids.add(staffSimpleInfo);
|
||||
|
||||
|
||||
});
|
||||
//更新flowRecord记录
|
||||
List<Object> objects = resultRecordService.listObjs(new QueryWrapper<ResultRecord>()
|
||||
.eq("is_delete", 0)
|
||||
@ -331,15 +332,16 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
log.info("更新flowRecord记录,i:" + updateExecution);
|
||||
|
||||
}
|
||||
|
||||
//通知评分
|
||||
try {
|
||||
String s = dingtalkBusiness.sendWorkMSGWithAsyn(toStaffids, WorkMsgTypeEnum.START_SCORE.getType());
|
||||
log.info("钉钉评分响应返回,res:" + s);
|
||||
} catch (Exception e) {
|
||||
log.error("通知评分异常:ids: " + JSON.toJSONString(toStaffids) + " ,e: " ,e);
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(toStaffids)){
|
||||
//通知评分
|
||||
try {
|
||||
String s = dingtalkBusiness.sendWorkMSGWithAsyn(toStaffids, WorkMsgTypeEnum.START_SCORE.getType());
|
||||
log.info("钉钉评分响应返回,res:" + s);
|
||||
} catch (Exception e) {
|
||||
log.error("通知评分异常:ids: " + JSON.toJSONString(toStaffids) + " ,e: " ,e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -102,6 +102,7 @@ public class AssessServiceImpl implements AssessService {
|
||||
log.info("获取 roleDepartment,staffRole: " + JSON.toJSONString(staffRole));
|
||||
// 0 标识全部部门
|
||||
if (staffRole.getDepartmentId() == 0) {
|
||||
log.info("staffRole 为0,管理全部部门");
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -55,7 +55,7 @@ public class ResultTagetLibServiceImpl extends ServiceImpl<ResultTagetLibMapper,
|
||||
if(resultModel == null){
|
||||
return R.error("找不到相关考核模板");
|
||||
}
|
||||
List<ResultTagetLibDto> resultTagetLibDtos = selectResultTagetLibByModelId(resultModel.getId());
|
||||
List<ResultTagetLibDto> resultTagetLibDtos = selectResultTagetLibDtoByModelId(resultModel.getId());
|
||||
BigDecimal weight = BigDecimal.ZERO;
|
||||
for(int i = 0; i < resultTagetLibDtos.size(); i++){
|
||||
ResultTagetLibDto dto = resultTagetLibDtos.get(i);
|
||||
@ -92,7 +92,7 @@ public class ResultTagetLibServiceImpl extends ServiceImpl<ResultTagetLibMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResultTagetLibDto> selectResultTagetLibByModelId(Long id){
|
||||
public List<ResultTagetLib> selectResultTagetLibByModelId(Long id){
|
||||
return resultTagetLibMapper.selectResultTagetLibByModelId(id);
|
||||
}
|
||||
|
||||
|
||||
@ -119,5 +119,11 @@
|
||||
) and is_delete=0 order by step_index asc
|
||||
</select>
|
||||
|
||||
<select id="selectCanSetChartRoleByChartId" resultType="com.lz.modules.flow.model.FlowChartRoleDto" >
|
||||
SELECT crole.id as id, crole.chart_id as chart_id, crole.role_id as role_id, role.name as role_name,
|
||||
crole.type as type FROM lz_flow_chart_role crole left join lz_record_role role on role.id=crole.role_id
|
||||
where crole.chart_id=#{id} and crole.type = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
update lz_result_taget_lib set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
<select id="selectResultTagetLibByModelId" resultType="com.lz.modules.flow.model.ResultTagetLibDto" >
|
||||
<select id="selectResultTagetLibByModelId" resultType="com.lz.modules.flow.entity.ResultTagetLib" >
|
||||
select * from lz_result_taget_lib where model_id=#{id} and is_delete = 0 order by order_by desc
|
||||
</select>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user