wangzhun 2 years ago
parent
commit
9fd178170d

+ 9 - 0
sxgk-projet/base-service/src/main/java/com/tofly/base/controller/UserController.java

@@ -854,7 +854,16 @@ public class UserController {
         map.put("menus", menuList);
         return ResultRespone.success(map);
     }
+    @PostMapping("/getUserInfo")
+    @ApiOperation(value = "获取用户基本信息及菜单信息")
+    public ResultRespone getUserInfoPost() {
+        Map map = new HashMap();
+        ToflyUser user = SecurityUtils.getUser();
+        map.put("username", user.getUsername());
+        map.put("name", user.getRealName());
 
+        return ResultRespone.success(map);
+    }
 
     @ToFlyAppLog(title = "通过文件批量新增用户")
     @ApiOperation(value = "通过文件批量新增用户")

File diff suppressed because it is too large
+ 17 - 0
sxgk-projet/base-service/src/test/java/com/tofly/base/utils/DesUtilsTest.java


+ 21 - 0
sxgk-projet/sxgk/src/main/java/com/tofly/sxgk/custom/controller/NewPipeAndNodeController.java

@@ -56,6 +56,27 @@ public class NewPipeAndNodeController {
         return ResultRespone.success   ( customNewPipeAndNodeService.getPictureList(page,prjId,userName,code,departmentId,photoType,beginDate,endDate));
     }
 
+
+
+    @GetMapping("/getPictureListAll" )
+    @ApiOperation(value = "图片列表分页查询(不区分项目)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "userName", value = "用户名称", required = false, dataType = "String"),
+            @ApiImplicitParam(name = "code", value = "code", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "departmentId", value = "科室id", required = false, dataType = "String"),
+            @ApiImplicitParam(name = "photoType", value = "照片", required = false, dataType = "String"),
+            @ApiImplicitParam(name = "beginDate", value = "开始时间", required = false, dataType = "String"),
+            @ApiImplicitParam(name = "endDate", value = "结束时间", required = false, dataType = "String")
+    })
+    public ResultRespone getPictureListAll(Page page, String userName,
+                                        @RequestParam(value="code") String code,
+                                        String departmentId,
+                                        String photoType,
+                                        String beginDate,
+                                        String endDate) {
+        return ResultRespone.success   ( customNewPipeAndNodeService.getPictureList(page,null,userName,code,departmentId,photoType,beginDate,endDate));
+    }
+
     @GetMapping("/progressShow" )
     @ApiOperation(value = "进度查看")
     @ApiImplicitParams({

+ 0 - 8
sxgk-projet/sxgk/src/main/java/com/tofly/sxgk/tgpms/TgpmsConnectionTask.java

@@ -199,14 +199,6 @@ public class TgpmsConnectionTask implements ApplicationRunner {
             throw new ToflyDeniedException("Error of get remote data while sync 3tier pro info: " + resp.getMsg());
         }
 
-//        final List<RemoteOrganizeSyncService.EstimateSubResp.DataItem.SubProjectInfoItem.CwpInfoItem> cwps =
-//                resp.getData().stream().flatMap(first -> first.getSubprojectinfo().stream()).flatMap(second -> second.getCwpinfo().stream()).collect(Collectors.toList());
-   //     System.out.println(cwps.size());
-      //  final List<Prjchild> cwpsDb = prjchildService.list();
-        //final List<String> cwpCodes = cwpsDb.stream().map(cwp -> cwp.getAcode() + cwp.getPcode() + cwp.getCode()).collect(Collectors.toList());
-        //System.out.println("cwpCodes = " + cwpCodes.size());
-        //final Set<String> cwpCodesDistinct = new HashSet<>(cwpCodes);
-      //  System.out.println("cwpCodesDistinct = " + cwpCodesDistinct.size());
 
         List<Areacompany> areaCompsFromDb = areacompanyService.list();
 

+ 7 - 4
sxgk-projet/sxgk/src/main/resources/customMapper/CustomNewPipeAndNodeServiceMapper.xml

@@ -465,8 +465,10 @@
     left join tf_ywpn_tdtech_w td on td.id= npipe.pd_code
     where
     1=1
+    <if test="prjId!=null and prjId != ''">
+        and w2.prj_id=#{prjId}
+    </if>
 
-      and w2.prj_id=#{prjId}
     <if test="userName!=null and userName != ''">
         and us.real_name=#{userName}
     </if>
@@ -925,7 +927,7 @@
     </select>
 
     <select id="findUserPsInfo" resultType="java.util.Map">
-    select *from(
+    select * from(
 
         <foreach item="userRoad" index="key" collection="userRoads" open="" separator=" union all " close="">
         <if test='pbsType ==null || pbsType=="node"'>
@@ -982,12 +984,12 @@
         <if test="queryStatus !=null and queryStatus !=''">
             and   instr(status,#{queryStatus})  >0
         </if>
-        order by substr(code,1,instr( code, '.', 1 , 4 )+1), substr(code,instr( code, '.', 1 , 4 )+1)
+        order by substr(code,1,instr( code, '.', 1 , 4 )+1), substr(code,0,instr( code, '.', 1 , 4 )+1)
     </select>
 
 
         <select id="findUserPsInfoByUserId" resultType="java.util.Map">
-        select *from  (
+       select *from ( select *from  (
             <if test='pbsType ==null || pbsType=="node"'>
             select pipe_id,
                    code,
@@ -1110,6 +1112,7 @@
             <if test="queryStatus !=null and queryStatus !=''">
                 and   instr(status,#{queryStatus})  >0
             </if>
+            )
         </select>
     <select id="findFileByCrcValue" resultType="java.lang.Integer">
         select sum(total) from(

+ 1 - 1
sxgk-projet/tofly-auth/src/main/java/com/tofly/auth/AuthApplication.java

@@ -14,4 +14,4 @@ public class AuthApplication {
     }
 
 
-}
+}

+ 3 - 3
sxgk-projet/tofly-auth/src/main/java/com/tofly/auth/controller/TokenController.java

@@ -140,7 +140,7 @@ public class TokenController {
     }
 
 
-    @GetMapping("/testlogin")
+    @GetMapping("/third/testlogin")
     @ApiOperation(tags = "登陆接口", value = "模拟desk调用")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String"),
@@ -161,11 +161,11 @@ public class TokenController {
             @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String"),
     })
     public ResultRespone mydeskLogin(String token) {
-
+        log.info("进入mydesklogin");
         HttpHeaders requestHeaders = new HttpHeaders();
         requestHeaders.set("tokenCheck", token);
         HttpEntity<MultiValueMap> requestEntity = new HttpEntity<MultiValueMap>(requestHeaders);
-        ResponseEntity<HashMap> result = restTemplate.exchange("http://tofly-getway/auth/oauth/login", HttpMethod.GET, requestEntity, HashMap.class);
+        ResponseEntity<HashMap> result = restTemplate.exchange("http://tofly-getway/auth/oauth/login", HttpMethod.POST, requestEntity, HashMap.class);
         return ResultRespone.success(result.getBody());
     }
     @GetMapping("/loginByTgpms")

+ 2 - 0
sxgk-projet/tofly-auth/src/main/java/com/tofly/auth/oauth/ToFlyUserDetailsService.java

@@ -181,10 +181,12 @@ public class ToFlyUserDetailsService implements UserDetailsService {
             responseEntity = restTemplate.postForEntity(mydeskConnectInfo.getGetUserInfoByToken()+"?token="+token,requestEntity, String.class);
         }catch (Exception  e){
             e.printStackTrace();
+            log.error("账号或密码出现异常,请联系管理员",e);
             throw new UsernameNotFoundException("账号或密码出现异常,请联系管理员");
         }
         String body1 = responseEntity.getBody();
         if("not_login".equals(body1)){
+            log.error("token已失效,请联系管理员");
             throw new UsernameNotFoundException("token已失效,请联系管理员");
         }
         JSONObject jsonObject = JSON.parseObject(body1);

+ 1 - 0
sxgk-projet/tofly-auth/src/main/java/com/tofly/auth/oauth/ToflyAuthenticationProvider.java

@@ -110,6 +110,7 @@ public class ToflyAuthenticationProvider implements AuthenticationProvider {
              username = usernamePrefix.substring(0,usernamePrefix.lastIndexOf("_"));
         }else{
             if(usernamePrefix.indexOf(TOKEN_LOGIN_SUF)==-1){
+
                 usernamePrefix = username+NAME_PASSWORD_LOGIN;
             }
 

+ 3 - 2
sxgk-projet/tofly-getway/src/main/java/com/tofly/toflygetway/filter/LoginParamFilter.java

@@ -67,10 +67,11 @@ public class LoginParamFilter extends AbstractGatewayFilterFactory {
         return (exchange, chain) -> {
             ServerHttpRequest request = exchange.getRequest();
             List<String> list = request.getHeaders().get(TOKEN_LOGIN_HEADER);
-
+        log.info(request.getURI().getPath());
             //修改为oauth/login
             if (!StringUtil.containsAnyIgnoreCase(request.getURI().getPath(), SecurityConstants.OAUTH_LOGIN_URL)
-                    && !StringUtil.containsAnyIgnoreCase(request.getURI().getPath(), SecurityConstants.OAUTH_TOKEN_URL)) {
+                    && !StringUtil.containsAnyIgnoreCase(request.getURI().getPath(), SecurityConstants.OAUTH_TOKEN_URL)
+            ) {
                 return chain.filter(exchange);
             }