Przeglądaj źródła

获取用户接口修改

全业务考评 8 miesięcy temu
rodzic
commit
9ec93bee77
19 zmienionych plików z 147 dodań i 38 usunięć
  1. 6 0
      ims-service/ims-eval/src/main/java/com/ims/eval/component/NextApproverImpl.java
  2. 13 4
      ims-service/ims-eval/src/main/java/com/ims/eval/config/permission/PermissionAspect.java
  3. 8 2
      ims-service/ims-eval/src/main/java/com/ims/eval/controller/DepartmentalPerformanceIndicatorPlanController.java
  4. 5 4
      ims-service/ims-eval/src/main/java/com/ims/eval/controller/EvaluationWarningRuleController.java
  5. 2 1
      ims-service/ims-eval/src/main/java/com/ims/eval/controller/UserController.java
  6. 3 1
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationWarningInfoService.java
  7. 2 2
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationWarningRuleService.java
  8. 9 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IUserService.java
  9. 22 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/custom/PostUserService.java
  10. 2 1
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptAssessmentDeclarationServiceImpl.java
  11. 1 1
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptResponsibilityServiceImpl.java
  12. 5 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateReportServiceImpl.java
  13. 6 1
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptBusinessAssessmentServiceImpl.java
  14. 6 5
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptBusinessPlanServiceImpl.java
  15. 7 1
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptRatingServiceImpl.java
  16. 4 6
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationWarningInfoServiceImpl.java
  17. 4 5
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationWarningRuleServiceImpl.java
  18. 41 3
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/UserServiceImpl.java
  19. 1 1
      ims-service/ims-eval/src/main/resources/mappers/EvaluateReportMapper.xml

+ 6 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/component/NextApproverImpl.java

@@ -30,6 +30,7 @@ public class NextApproverImpl {
 	public List<SysUser> submitTask1(String id, String a2, String a3) {
 		List<SysUser> userList = null;
 		try {
+			log.info("请求参数id"+id);
 			userList = new ArrayList<>();
 			DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
 			if (null != deptAssessmentDeclaration) {
@@ -41,7 +42,12 @@ public class NextApproverImpl {
 			}
 		} catch (Exception e) {
 			e.printStackTrace();
+			log.error("获取流程审批人员错误", e);
 		}
+		for (SysUser u : userList){
+			log.info("返回审批人名字"+u.getName());
+		}
+
 		return userList;
 	}
 

+ 13 - 4
ims-service/ims-eval/src/main/java/com/ims/eval/config/permission/PermissionAspect.java

@@ -60,6 +60,9 @@ public class PermissionAspect implements Interceptor {
 	@Autowired
 	private PostUserService postUserService;
 
+////	@Resource
+//	private IUserService userService;
+
 
 	//扫描的包路径,需要权限的加在mapper类及方法上
 	private String packagePath = "com.ims.eval.dao";
@@ -81,6 +84,7 @@ public class PermissionAspect implements Interceptor {
 
 	//请求头code
 	private String code;
+	private String bladeAuth;
 	//缓存权限类名
 	private static List<String> classNames;
 	//缓存权限类名+方法名
@@ -103,13 +107,14 @@ public class PermissionAspect implements Interceptor {
 				(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
 			HttpServletRequest request = Objects.requireNonNull(attributes).getRequest();
 			code =  request.getHeader("code");
+			bladeAuth = request.getHeader("Blade-Auth");
 	}
 
 	@Override
 	public Object intercept(Invocation invocation) throws Throwable {
 
 		//部门权限
-		MyuserResDTO user = getSysUser(code);
+		MyuserResDTO user = getSysUser(code,bladeAuth);
 		DataDictionary dept = getSysDept(user);
 
 		//岗位权限
@@ -225,8 +230,12 @@ public class PermissionAspect implements Interceptor {
 						boolean zbtype = null != methodNames.get(newId + "-" + newName+"zbtype") ?methodNames.get(newId + "-" + newName+"zbtype") :false;
 						boolean bktype = null != methodNames.get(newId + "-" + newName+"bktype") ?methodNames.get(newId + "-" + newName+"bktype") :false;
 
-						if (null != post && post.getKeyValue().equals("JCDW")) {
 
+						System.out.println("==========type="+type+";zbtype"+zbtype+";bktype"+bktype);
+
+
+						if (null != post && post.getKeyValue().equals("JCDW")) {
+							System.out.println("==========post.getKeyValue()="+post.getKeyValue());
 							if (type) {
 								sql = getSql(sql, organizationId, "JCDW");
 							}
@@ -340,11 +349,11 @@ public class PermissionAspect implements Interceptor {
 	}
 
 	@Cacheable(value = "user_code")
-	public MyuserResDTO getSysUser(String code) {
+	public MyuserResDTO getSysUser(String code,String bladeAuth) {
 		if (StringUtils.isBlank(code) || code.toLowerCase().equals("null")){
 			return null;
 		}
-		JSONObject json = serviceBuilder.getGatewayUrl().getSysUser(code);
+		JSONObject json = postUserService.getSysUser(code,bladeAuth,request);
 		MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
 		return user;
 	}

+ 8 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DepartmentalPerformanceIndicatorPlanController.java

@@ -17,6 +17,7 @@ import com.ims.eval.feign.RemoteServiceBuilder;
 import com.ims.eval.service.IEvaluationDeptBusinessContentService;
 import com.ims.eval.service.IEvaluationDeptBusinessPlanService;
 import com.ims.eval.service.IEvaluationDeptService;
+import com.ims.eval.service.IUserService;
 import com.ims.eval.util.ExcelUtil;
 import com.ims.eval.util.WordUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -56,6 +57,9 @@ public class DepartmentalPerformanceIndicatorPlanController {
 	@Resource
 	private RemoteServiceBuilder remoteServiceBuilder;
 
+	@Resource
+	private IUserService userService;
+
 	/**
 	 * 部门考评业务列表信息(分页)
 	 *
@@ -196,7 +200,8 @@ public class DepartmentalPerformanceIndicatorPlanController {
 	@GetMapping(value = "/details/{id}/{deptId}/{deptName}")
 	public R details(@PathVariable("id") String id, @PathVariable("deptId") String deptId, @PathVariable("deptName") String deptName) {
 		String code = request.getHeader("code");
-		JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
+		String auth = request.getHeader("Blade-Auth");
+		JSONObject json = userService.getSysUser(code,auth);
 		MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
 		user.getDeptOrg().getType();
 		if ("150".equals(user.getDeptOrg().getType())) {
@@ -288,7 +293,8 @@ public class DepartmentalPerformanceIndicatorPlanController {
 				deptList.add(dept);
 			} else {
 				String code = request.getHeader("code");
-				JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
+				String auth = request.getHeader("Blade-Auth");
+				JSONObject json = userService.getSysUser(code,auth);
 				MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
 				user.getDeptOrg().getType();
 				if ("150".equals(user.getDeptOrg().getType())) {

+ 5 - 4
ims-service/ims-eval/src/main/java/com/ims/eval/controller/EvaluationWarningRuleController.java

@@ -8,10 +8,10 @@ import com.ims.eval.entity.dto.result.R;
 import com.ims.eval.service.IEvaluationWarningInfoService;
 import com.ims.eval.service.IEvaluationWarningRuleService;
 import io.swagger.annotations.ApiOperation;
-import javafx.beans.binding.SetExpression;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 
@@ -32,7 +32,8 @@ public class EvaluationWarningRuleController {
 	@Autowired
 	private IEvaluationWarningInfoService warningInfoService;
 
-
+	@Autowired
+	private HttpServletRequest request;
 	@ApiOperation(value = "考评预警规则", notes = "查询")
 	@GetMapping(value = "rule/list")
 	public R EvaluationWarningRuleList(
@@ -54,7 +55,7 @@ public class EvaluationWarningRuleController {
 			String decode = URLDecoder.decode(warningRule.getExpression(), "UTF-8");
 			String expression = decode.replaceAll(" ", "+");
 			warningRule.setExpression(expression);
-			boolean flag = warningRuleService.saveOrUpdate(code, warningRule);
+			boolean flag = warningRuleService.saveOrUpdate(code, warningRule,request);
 			if (flag) {
 				return R.ok();
 			}
@@ -94,7 +95,7 @@ public class EvaluationWarningRuleController {
 	@ApiOperation(value = "考评预警详情更新", notes = "")
 	@PostMapping(value = "info/save")
 	public R EvaluationWarningInfoSave(@RequestHeader("Code") String code, @RequestBody EvaluationWarningInfo warningInfo){
-		boolean flag = warningInfoService.updateItem(code, warningInfo);
+		boolean flag = warningInfoService.updateItem(code, warningInfo,request);
 		if (flag) {
 			return R.ok();
 		}

+ 2 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/UserController.java

@@ -75,7 +75,8 @@ public class UserController {
 		@RequestParam(value = "code", required = false) String code) {
 		JSONObject json = null;
 		try {
-			json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
+			String auth = request.getHeader("Blade-Auth");
+			json = userService.getSysUser(code,auth);
 		} catch (Exception e) {
 			e.printStackTrace();
 		}

+ 3 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationWarningInfoService.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ims.eval.entity.EvaluationWarningInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import javax.servlet.http.HttpServletRequest;
+
 
 /**
  * <p>
@@ -21,6 +23,6 @@ public interface IEvaluationWarningInfoService extends IService<EvaluationWarnin
 	 */
 	IPage<EvaluationWarningInfo> warningInfoList(Integer pageNum, Integer pageSize, String binSection, String st, String et);
 
-	boolean updateItem(String code, EvaluationWarningInfo warningInfo);
+	boolean updateItem(String code, EvaluationWarningInfo warningInfo, HttpServletRequest request);
 
 }

+ 2 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationWarningRuleService.java

@@ -3,7 +3,7 @@ package com.ims.eval.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ims.eval.entity.EvaluationWarningRule;
 import com.baomidou.mybatisplus.extension.service.IService;
-
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -28,5 +28,5 @@ public interface IEvaluationWarningRuleService extends IService<EvaluationWarnin
 
 
 
-	boolean saveOrUpdate(String code, EvaluationWarningRule warningRule);
+	boolean saveOrUpdate(String code, EvaluationWarningRule warningRule,HttpServletRequest request);
 }

+ 9 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IUserService.java

@@ -97,4 +97,13 @@ public interface IUserService extends IService<Myuser> {
 	JSONObject getbladeAuth(String username, String password) throws Exception;
 
 	JSONObject getLoginNameByUserInfo(String info, HttpServletRequest request);
+
+
+	/**
+	 * 通过code获取user
+	 *
+	 * @param code
+	 * @return
+	 */
+	JSONObject getSysUser(String code,String auth);
 }

+ 22 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/custom/PostUserService.java

@@ -2,12 +2,15 @@ package com.ims.eval.service.custom;
 
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.ims.eval.config.ImaConfig;
 import com.ims.eval.entity.dto.result.ResultInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.*;
 import org.springframework.stereotype.Service;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 import org.springframework.web.client.RestTemplate;
 
 import javax.servlet.http.HttpServletRequest;
@@ -74,4 +77,23 @@ public class PostUserService {
 		return null;
 	}
 
+
+
+	public JSONObject getSysUser(String code,String bladeAuth, HttpServletRequest request) {
+
+		System.out.println("请求-6-获取用户信息");
+		MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+		headers.add("Blade-Auth", "bearer " +bladeAuth);
+		HttpEntity<LinkedMultiValueMap<String, Object>> param = new HttpEntity<>(null, headers);
+
+		ResponseEntity<String> responseEntity2 = restTemplate.postForEntity(imaConfig.getGatewayUrl() + "/ims-idms/sysuser/getSysUser?code={code}",
+			param, String.class, code);
+		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
+		if (200 == responseEntity2.getStatusCodeValue()) {
+			return JSON.parseObject(responseEntity2.getBody());
+		}
+		return null;
+	}
+
+
 }

+ 2 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptAssessmentDeclarationServiceImpl.java

@@ -76,7 +76,8 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 
 
 		String code = request.getHeader("code");
-		JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
+		String auth = request.getHeader("Blade-Auth");
+		JSONObject json = userService.getSysUser(code,auth);
 		MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
 
 		user.getDeptOrg().getType();

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptResponsibilityServiceImpl.java

@@ -283,7 +283,7 @@ public class DeptResponsibilityServiceImpl extends ServiceImpl<DeptResponsibilit
 	@Override
 	public List<Map> targetValueeport(String id, String dept, HttpServletRequest request) {
 		DeptResponsibilityResDTO resDTO = baseMapper.selectById(id);
-		Myuser myuser = userService.getSysUser(request.getHeader("code"));
+		Myuser myuser = userService.getSysUser(request);
 //		responsibilityIndicatorInfoMapper.listByresponsibilityId()
 
 		return null;

+ 5 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateReportServiceImpl.java

@@ -231,8 +231,13 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
 						continue;
 					}
 
+				}else {
+					if(rule.getScjyWeight()<=0){
+						continue;
+					}
 				}
 
+
 				StringBuilder remark = new StringBuilder();
 				//生产95%基建5%前期0%
 				if (rule.getScjyWeight() > 0) {

+ 6 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptBusinessAssessmentServiceImpl.java

@@ -13,9 +13,11 @@ import com.ims.eval.entity.dto.response.MyuserResDTO;
 import com.ims.eval.feign.RemoteServiceBuilder;
 import com.ims.eval.service.IEvaluationDeptBusinessAssessmentService;
 import com.ims.eval.service.IEvaluationDeptService;
+import com.ims.eval.service.IUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
@@ -31,6 +33,8 @@ public class EvaluationDeptBusinessAssessmentServiceImpl extends ServiceImpl<Eva
 	private IEvaluationDeptService evaluationDeptService;
 	@Autowired
 	private RemoteServiceBuilder remoteServiceBuilder;
+	@Resource
+	private IUserService userService;
 
 	@Override
 	public IPage<EvaluationDeptBusinessAssessment> listPage(Integer pageNum, Integer pageSize, String deptId, String responsibilityCode, String des, String appraisalYear, String stage, HttpServletRequest request) {
@@ -41,7 +45,8 @@ public class EvaluationDeptBusinessAssessmentServiceImpl extends ServiceImpl<Eva
 		Page<EvaluationDeptBusinessAssessment> page = new Page<>(pageNum, pageSize);
 		IPage<EvaluationDeptBusinessAssessment> list = null;
 		String code = request.getHeader("code");
-		JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
+		String auth = request.getHeader("Blade-Auth");
+		JSONObject json = userService.getSysUser(code,auth);
 		MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
 		user.getDeptOrg().getType();
 		if ("150".equals(user.getDeptOrg().getType())) {

+ 6 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptBusinessPlanServiceImpl.java

@@ -15,13 +15,11 @@ import com.ims.eval.entity.EvaluationDeptBusinessAssessment;
 import com.ims.eval.entity.EvaluationDeptBusinessPlan;
 import com.ims.eval.entity.dto.response.MyuserResDTO;
 import com.ims.eval.feign.RemoteServiceBuilder;
-import com.ims.eval.service.IEvaluationDeptBusinessAssessmentService;
-import com.ims.eval.service.IEvaluationDeptBusinessContentService;
-import com.ims.eval.service.IEvaluationDeptBusinessPlanService;
-import com.ims.eval.service.IEvaluationDeptService;
+import com.ims.eval.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.text.DecimalFormat;
 import java.util.ArrayList;
@@ -46,6 +44,8 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
 
 	@Autowired
 	private RemoteServiceBuilder remoteServiceBuilder;
+	@Resource
+	private IUserService userService;
 
 	@Override
 	public IPage<EvaluationDeptBusinessPlan> listPage(Integer pageNum, Integer pageSize, String deptId, String responsibilityCode, String des, String appraisalYear, String stage, HttpServletRequest request) {
@@ -56,7 +56,8 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
 		Page<EvaluationDeptBusinessPlan> page = new Page<>(pageNum, pageSize);
 		IPage<EvaluationDeptBusinessPlan> list = null;
 		String code = request.getHeader("code");
-		JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
+		String auth = request.getHeader("Blade-Auth");
+		JSONObject json = userService.getSysUser(code,auth);
 		MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
 		user.getDeptOrg().getType();
 		if ("150".equals(user.getDeptOrg().getType())) {

+ 7 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptRatingServiceImpl.java

@@ -13,9 +13,11 @@ import com.ims.eval.entity.EvaluationDeptRating;
 import com.ims.eval.entity.dto.response.MyuserResDTO;
 import com.ims.eval.feign.RemoteServiceBuilder;
 import com.ims.eval.service.IEvaluationDeptRatingService;
+import com.ims.eval.service.IUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
@@ -31,6 +33,9 @@ public class EvaluationDeptRatingServiceImpl extends ServiceImpl<EvaluationDeptR
 	@Autowired
 	private RemoteServiceBuilder remoteServiceBuilder;
 
+	@Resource
+	private IUserService userService;
+
 	@Override
 	public IPage<EvaluationDeptRating> listPage(Integer pageNum, Integer pageSize, String deptId, String deptName, String annual) {
 		if ("23031009".equals(deptId)) {//组织人事部
@@ -142,7 +147,8 @@ public class EvaluationDeptRatingServiceImpl extends ServiceImpl<EvaluationDeptR
 	public List<EvaluationDeptRating> list(String deptId, String deptName, String annual, HttpServletRequest request) {
 
 		String code = request.getHeader("code");
-		JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
+		String auth = request.getHeader("Blade-Auth");
+		JSONObject json = userService.getSysUser(code,auth);
 		MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
 
 		user.getDeptOrg().getType();

+ 4 - 6
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationWarningInfoServiceImpl.java

@@ -9,7 +9,6 @@ import com.ims.eval.cache.CacheContext;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.EvaluationWarningInfo;
 import com.ims.eval.dao.EvaluationWarningInfoMapper;
-import com.ims.eval.entity.OrganizationEvaluationRule;
 import com.ims.eval.entity.dto.response.MyuserResDTO;
 import com.ims.eval.service.IEvaluationWarningInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -17,9 +16,8 @@ import com.ims.eval.service.IUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+
 
 /**
  * <p>
@@ -66,9 +64,9 @@ public class EvaluationWarningInfoServiceImpl extends ServiceImpl<EvaluationWarn
 
 
 	@Override
-	public boolean updateItem(String code, EvaluationWarningInfo warningInfo) {
+	public boolean updateItem(String code, EvaluationWarningInfo warningInfo, HttpServletRequest request) {
 		if (StringUtils.isNotEmpty(code) && !code.equals("null")){
-			MyuserResDTO user = userService.getSysUser(code);
+			MyuserResDTO user = userService.getSysUser(request);
 			if (user != null){
 				warningInfo.setUserName(user.getName());
 				warningInfo.setUserCode(code);

+ 4 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationWarningRuleServiceImpl.java

@@ -5,10 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ims.common.utils.StringUtils;
 import com.ims.eval.config.CustomException;
-import com.ims.eval.entity.EvaluationWarningInfo;
 import com.ims.eval.entity.EvaluationWarningRule;
 import com.ims.eval.dao.EvaluationWarningRuleMapper;
-import com.ims.eval.entity.OrganizationEvaluation;
 import com.ims.eval.entity.dto.response.MyuserResDTO;
 import com.ims.eval.service.IEvaluationWarningRuleService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -16,9 +14,9 @@ import com.ims.eval.service.IUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * <p>
@@ -66,10 +64,11 @@ public class EvaluationWarningRuleServiceImpl extends ServiceImpl<EvaluationWarn
 		return list;
 	}
 
+
 	@Override
-	public boolean saveOrUpdate(String code, EvaluationWarningRule warningRule) {
+	public boolean saveOrUpdate(String code, EvaluationWarningRule warningRule,HttpServletRequest request) {
 		if (StringUtils.isNotEmpty(code) && !code.equals("null")){
-			MyuserResDTO user = userService.getSysUser(code);
+			MyuserResDTO user = userService.getSysUser(request);
 			if (user != null){
 				if (StringUtils.isNotEmpty(warningRule.getId())){
 					warningRule.setUpdateBy(user.getName());

+ 41 - 3
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/UserServiceImpl.java

@@ -25,6 +25,7 @@ import org.springframework.util.MultiValueMap;
 import org.springframework.web.client.RestTemplate;
 import springfox.documentation.annotations.Cacheable;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Base64;
 import java.util.List;
@@ -50,6 +51,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, Myuser> implements
 
 	@Autowired
 	private ImaConfig imaConfig;
+	@Resource
+	private IUserService userService;
 
 	@Override
 	public List<Myuser> listAll(String id, String orgId, String unitId) {
@@ -93,7 +96,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, Myuser> implements
 	@Override
 	public MyuserResDTO getSysUser(String code) {
 		try {
+			System.out.println("请求-3-获取用户信息");
 			Object json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
+
 			MyuserResDTO user = JSON.parseObject(json.toString(), MyuserResDTO.class);
 			return user;
 		} catch (Exception e) {
@@ -108,10 +113,23 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, Myuser> implements
 			if (null == request.getHeader("code")) {
 				throw new CustomException("请求鉴权信息为空");
 			}
+			System.out.println("请求-2-获取用户信息");
+			MyuserResDTO user = null;
+			MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+			headers.add("Blade-Auth", "bearer " + request.getHeader("Blade-Auth"));
 			String code = request.getHeader("code");
-			JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
-			MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
-			return user;
+			HttpEntity<LinkedMultiValueMap<String, Object>> param = new HttpEntity<>(null, headers);
+
+			ResponseEntity<String> responseEntity2 = restTemplate.postForEntity(imaConfig.getGatewayUrl() + "/ims-idms/sysuser/getSysUser?code={code}",
+				param, String.class, code);
+			log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
+			if (200 == responseEntity2.getStatusCodeValue()) {
+
+				user = JSONObject.parseObject(JSON.parseObject(responseEntity2.getBody()).getJSONObject("data").toJSONString(), MyuserResDTO.class);
+				return user;
+			}
+			return null;
+
 		} catch (Exception e) {
 			e.printStackTrace();
 			return null;
@@ -220,4 +238,24 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, Myuser> implements
 		}
 		return null;
 	}
+
+	@Override
+	public JSONObject getSysUser(String code,String auth) {
+
+
+		System.out.println("请求--获取用户信息");
+		MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+		headers.add("Blade-Auth", "bearer " + auth);
+		HttpEntity<LinkedMultiValueMap<String, Object>> param = new HttpEntity<>(null, headers);
+
+		ResponseEntity<String> responseEntity2 = restTemplate.postForEntity(imaConfig.getGatewayUrl() + "/ims-idms/sysuser/getSysUser?code={code}",
+			param, String.class, code);
+		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
+		if (200 == responseEntity2.getStatusCodeValue()) {
+			return JSON.parseObject(responseEntity2.getBody());
+		}
+		return null;
+	}
+
+
 }

+ 1 - 1
ims-service/ims-eval/src/main/resources/mappers/EvaluateReportMapper.xml

@@ -63,7 +63,7 @@
             </if>
 
         </where>
-            order by r.year,r.month desc
+        order by r.year desc, CAST(REPLACE(r.month, '-', '0') AS INT)  desc,b.order_num asc
     </select>
     <select id="selectList" resultType="com.ims.eval.entity.dto.response.EvaluateReportInfoResDTO">