|
@@ -645,8 +645,23 @@ public class DeptAssessmentDeclarationController {
|
|
|
@PostMapping(value = "/addApprovalLeader")
|
|
|
public R addApprovalLeader(@RequestParam(value = "id") String id,
|
|
|
@RequestParam(value = "employeeNo") String employeeNo) {
|
|
|
- List<UserDTO> list = new ArrayList<>();
|
|
|
- return R.ok().data(list);
|
|
|
+ boolean b = false;
|
|
|
+ JSONObject jsonArr = userService.pageList(1, 500, "", "", "", employeeNo, "", "", request);
|
|
|
+ JSONObject jsonArr1 = (JSONObject) jsonArr.get("data");
|
|
|
+ JSONArray array = JSONUtil.parseArray(jsonArr1.get("records"));
|
|
|
+ List<UserDTO> userList = JSONUtil.toList(array, UserDTO.class);
|
|
|
+ if (userList.size() > 0) {
|
|
|
+ DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
|
|
|
+ deptAssessmentDeclaration.setDeptLeaderId(userList.get(0).getId());
|
|
|
+ deptAssessmentDeclaration.setDeptLeaderNo(userList.get(0).getNo());
|
|
|
+ deptAssessmentDeclaration.setDeptLeaderName(userList.get(0).getName());
|
|
|
+ b = deptAssessmentDeclarationService.updateById(deptAssessmentDeclaration);
|
|
|
+ }
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error("添加审批领导失败!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|