Browse Source

绩效结果考核申报获取审批领导修改

hlf 1 year ago
parent
commit
391c152706

+ 13 - 20
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DeptAssessmentDeclarationController.java

@@ -14,7 +14,6 @@ import com.ims.eval.entity.DeptAssessmentDeclarationComplete;
 import com.ims.eval.entity.DeptAssessmentDeclarationContent;
 import com.ims.eval.entity.EvaluationDept;
 import com.ims.eval.entity.dto.request.EmployeeDTO;
-import com.ims.eval.entity.dto.request.PostDTO;
 import com.ims.eval.entity.dto.request.PostUserDTO;
 import com.ims.eval.entity.dto.request.SummaryInformationDTO;
 import com.ims.eval.entity.dto.result.R;
@@ -91,7 +90,7 @@ public class DeptAssessmentDeclarationController {
 		@RequestParam(value = "deptName", required = false) String deptName,
 		@RequestParam(value = "annual", required = false) Integer annual,
 		@RequestParam(value = "declarationMonth", required = false) Integer declarationMonth) {
-		IPage<DeptAssessmentDeclaration> list = deptAssessmentDeclarationService.listPage(pageNum, pageSize, deptId, orderNumber, deptName, annual, declarationMonth,request);
+		IPage<DeptAssessmentDeclaration> list = deptAssessmentDeclarationService.listPage(pageNum, pageSize, deptId, orderNumber, deptName, annual, declarationMonth, request);
 		return R.ok().data(list);
 	}
 
@@ -338,7 +337,7 @@ public class DeptAssessmentDeclarationController {
 					deptAssessmentDeclarationContent.setAssessmentDeclarationId(id);
 					deptAssessmentDeclarationContent.setEmployeeNo(str[0]);
 					JSONObject jsonArr = userService.getLoginNameByUserInfo(str[0], request);
-					if ("操作成功".equals(String.valueOf(jsonArr.get("msg")))){
+					if ("操作成功".equals(String.valueOf(jsonArr.get("msg")))) {
 						JSONObject data = (JSONObject) jsonArr.get("data");
 						deptAssessmentDeclarationContent.setEmployeeId(String.valueOf(data.get("id")));
 						deptAssessmentDeclarationContent.setEmployeeName(String.valueOf(data.get("name")));
@@ -640,7 +639,7 @@ public class DeptAssessmentDeclarationController {
 		boolean b = false;
 		JSONObject jsonArr = userService.getLoginNameByUserInfo(employeeNo, request);
 		JSONObject data = (JSONObject) jsonArr.get("data");
-		if (data.toJSONString().length()>0){
+		if (data.toJSONString().length() > 0) {
 			DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
 			if (null != deptAssessmentDeclaration) {
 				deptAssessmentDeclaration.setDeptLeaderId(String.valueOf(data.get("id")));
@@ -669,7 +668,7 @@ public class DeptAssessmentDeclarationController {
 		boolean b = false;
 		JSONObject jsonArr = userService.getLoginNameByUserInfo(employeeNo, request);
 		JSONObject data = (JSONObject) jsonArr.get("data");
-		if ("操作成功".equals(String.valueOf(data.get("msg")))){
+		if ("操作成功".equals(String.valueOf(data.get("msg")))) {
 			DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
 			if (null != deptAssessmentDeclaration) {
 				deptAssessmentDeclaration.setSeconderId(String.valueOf(data.get("id")));
@@ -694,21 +693,15 @@ public class DeptAssessmentDeclarationController {
 	@GetMapping(value = "/obtainApprovalLeader/{id}")
 	public R obtainApprovalLeader(@PathVariable String id) {
 		List<PostUserDTO> list = new ArrayList<>();
-		Object postList = postService.getPostList(1, 500, id, request);
-		if (null != postList) {
-			JSONObject postJsonArr = (JSONObject) postList;
-			JSONArray postArray = JSONUtil.parseArray(postJsonArr.get("records"));
-			List<PostDTO> postArrList = JSONUtil.toList(postArray, PostDTO.class);
-			for (PostDTO post : postArrList) {
-				if (post.getName().contains("主任")) {
-					Object postPersonnelList = postUserService.getPostUserList(1, 500, post.getId(), request);
-					if (null != postPersonnelList) {
-						JSONObject postPersonnelJsonArr = (JSONObject) postPersonnelList;
-						JSONArray postPersonnelArray = JSONUtil.parseArray(postPersonnelJsonArr.get("records"));
-						List<PostUserDTO> userArrList = JSONUtil.toList(postPersonnelArray, PostUserDTO.class);
-						if (userArrList.size() > 0) {
-							list.addAll(userArrList);
-						}
+		String jsonStr = postUserService.getBbUserPostList(0, 1000, id, request);
+		if (null != jsonStr) {
+			JSONObject jsonObj = JSONObject.parseObject(jsonStr);
+			JSONArray postPersonnelArray = JSONUtil.parseArray(jsonObj.get("data"));
+			List<PostUserDTO> postPersonnelArrList = JSONUtil.toList(postPersonnelArray, PostUserDTO.class);
+			for (PostUserDTO user : postPersonnelArrList) {
+				if (user.getMainPosName() != null && !"".equals(user.getMainPosName())) {
+					if (user.getMainPosName().contains("主任")) {
+						list.add(user);
 					}
 				}
 			}

+ 2 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/request/PostUserDTO.java

@@ -17,9 +17,9 @@ public class PostUserDTO {
 	private String no;
 
 	//人员名称
-	private String userName;
+	private String name;
 
 	//人员岗位
-	private String posName;
+	private String mainPosName;
 
 }

+ 19 - 8
ims-service/ims-eval/src/main/java/com/ims/eval/service/custom/PostUserService.java

@@ -28,13 +28,13 @@ public class PostUserService {
 	public Object getPostUserList(Integer current, Integer size, String posId, HttpServletRequest request) {
 		HttpHeaders headers = new HttpHeaders();
 		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
-		headers.add("Blade-Auth", "bearer "+request.getHeader("Blade-Auth"));
+		headers.add("Blade-Auth", "bearer " + request.getHeader("Blade-Auth"));
 		HttpEntity<Map> param = new HttpEntity<>(null, headers);
-		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() + "/ims-idms/pgposuser/page?current={1}&size={2}&posId={3}", HttpMethod.GET, param, String.class, current,size,posId);
+		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() + "/ims-idms/pgposuser/page?current={1}&size={2}&posId={3}", HttpMethod.GET, param, String.class, current, size, posId);
 		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
 		if (200 == responseEntity2.getStatusCodeValue()) {
 			ResultInfo resultInfo = JSON.parseObject(responseEntity2.getBody(), ResultInfo.class);
-			if(200 == resultInfo.getCode()){
+			if (200 == resultInfo.getCode()) {
 				return resultInfo.getData();
 			}
 			return null;
@@ -46,13 +46,13 @@ public class PostUserService {
 	public Object getUserPostList(Integer current, Integer size, String userId, HttpServletRequest request) {
 		HttpHeaders headers = new HttpHeaders();
 		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
-		headers.add("Blade-Auth", "bearer "+request.getHeader("Blade-Auth"));
+		headers.add("Blade-Auth", "bearer " + request.getHeader("Blade-Auth"));
 		HttpEntity<Map> param = new HttpEntity<>(null, headers);
-		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() + "/ims-idms/pgposuser/page?current={1}&size={2}&userId={3}", HttpMethod.GET, param, String.class, current,size,userId);
+		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() + "/ims-idms/pgposuser/page?current={1}&size={2}&userId={3}", HttpMethod.GET, param, String.class, current, size, userId);
 		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
 		if (200 == responseEntity2.getStatusCodeValue()) {
 			ResultInfo resultInfo = JSON.parseObject(responseEntity2.getBody(), ResultInfo.class);
-			if(200 == resultInfo.getCode()){
+			if (200 == resultInfo.getCode()) {
 				return resultInfo.getData();
 			}
 			return null;
@@ -60,7 +60,18 @@ public class PostUserService {
 		return null;
 	}
 
-
-
+	public String getBbUserPostList(Integer pageIndex, Integer pageSize, String baseFilter, HttpServletRequest request) {
+		HttpHeaders headers = new HttpHeaders();
+		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
+		headers.add("Blade-Auth", "bearer " + request.getHeader("Blade-Auth"));
+		HttpEntity<Map> param = new HttpEntity<>(null, headers);
+		String baseFilterStr = "((o.id ='" + baseFilter + "') or (o.parent_ids like '%,%" + baseFilter + ",%'))";
+		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() + "/ims-iam-ext/sys/sysUser/misData?pageIndex={1}&pageSize={2}&baseFilter={3}", HttpMethod.POST, param, String.class, pageIndex, pageSize, baseFilterStr);
+		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
+		if (200 == responseEntity2.getStatusCodeValue()) {
+			return responseEntity2.getBody();
+		}
+		return null;
+	}
 
 }