修复当人员在多个部门时,获取部门几级领导异常。目前搜索第一个为准

This commit is contained in:
wulin 2020-10-26 16:29:14 +08:00
parent 5c896280de
commit 86fc82ae8c
5 changed files with 14 additions and 8 deletions

View File

@ -488,6 +488,7 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
}else{
log.info("没有找到父级部门部门id{}", depId);
departManagers.setManagers(new ArrayList<>());
return departManagers;
}
type--;
}

View File

@ -36,4 +36,6 @@ public interface FlowStartService extends IService<FlowStart> {
FlowStart selectFlowStartByName(String name);
R saveStart(FlowStart flowStart);
R getModelById(Long id, int type);
}

View File

@ -490,5 +490,14 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
return R.ok("发起成功");
}
@Override
public R getModelById(Long id, int type){
/*EvaluationGroup evaluationGroup = evaluationGroupService.selectEvaluationGroupById(id);
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);*/
//flowStart = flowStartService.selectFlowStartById(flowStart.getId());
DepartManagers staffEntity = staffService.findLeader(id, type);
return R.ok().put("data",staffEntity);
}
}

View File

@ -46,8 +46,6 @@ public class FlowStartController {
private FlowStartService flowStartService;
@Autowired
private EvaluationGroupService evaluationGroupService;
@ -58,11 +56,7 @@ public class FlowStartController {
@GetMapping("/getById")
public R getById(@RequestParam Long id, @RequestParam int type) {
EvaluationGroup evaluationGroup = evaluationGroupService.selectEvaluationGroupById(id);
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);
//flowStart = flowStartService.selectFlowStartById(flowStart.getId());
//List<StaffEntity> staffEntity = staffService.findLeader(id, type);
return R.ok().put("data",staffIds);
return flowStartService.getModelById(id, type);
}

View File

@ -78,7 +78,7 @@
<select id="selectByStaffId" resultType="com.lz.modules.app.entity.DepartmentsStaffRelateEntity">
select * from lz_departments_staff_relate where is_delete=0 and staff_id = #{staffId}
select * from lz_departments_staff_relate where is_delete=0 and staff_id = #{staffId} limit 1
</select>