瀏覽代碼

问卷次数增加问卷2

liangpeile 1 年之前
父節點
當前提交
8d79790fdc

+ 24 - 24
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/APIController.java

@@ -864,43 +864,43 @@ public class APIController {
         String userPhone = JwtUtil.getUsername(Authorization);
 
         //校验token==================
-        if (!redisUtil.hasKey( CommonConstant.PREFIX_NFT_USER_TOKEN + userPhone )) {
-            result.setMessage( "TOKEN失效" );
-            result.setCode( 201 );
+        if (!redisUtil.hasKey(CommonConstant.PREFIX_NFT_USER_TOKEN + userPhone)) {
+            result.setMessage("TOKEN失效");
+            result.setCode(201);
             return result;
         }
         try {
 
-        //1. 校验用户是否有效
-        //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
+            //1. 校验用户是否有效
+            //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq( "phone", userPhone );
-            AdminUser storeMember1 = adminUserService.getOne( queryWrapper );
+            queryWrapper.eq("phone", userPhone);
+            AdminUser storeMember1 = adminUserService.getOne(queryWrapper);
 
             if (storeMember1 == null) {
-                result.setMessage( "token校验该用户不存在" );
-                baseCommonService.addLog( "用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null );
+                result.setMessage("token校验该用户不存在");
+                baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
                 return result;
             }
 
-        QueryWrapper<AdminTopic> queryWrapper2 = new QueryWrapper<>();
-        queryWrapper2.eq("username", "付秀权");
-        queryWrapper2.eq("phone", "18651654800");
-        List<AdminTopic> list = adminTopicService.listNum(queryWrapper2);
+            QueryWrapper<AdminTopic> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("username", storeMember1.getName());
+            queryWrapper2.eq("phone", storeMember1.getPhone());
+            List<AdminTopic> list = adminTopicService.listNum(queryWrapper2);
 
-        QueryWrapper<AdminTopicTwo> queryWrapper3 = new QueryWrapper<>();
-        queryWrapper3.eq("username", "朱惠云");
-        queryWrapper3.eq("phone", "15026921681");
-        List<AdminTopicTwo> adminTopicTwos = adminTopicService.listNum2(queryWrapper3);
+            QueryWrapper<AdminTopicTwo> queryWrapper3 = new QueryWrapper<>();
+            queryWrapper3.eq("username", storeMember1.getName());
+            queryWrapper3.eq("phone", storeMember1.getPhone());
+            List<AdminTopicTwo> adminTopicTwos = adminTopicService.listNum2(queryWrapper3);
 
-        result.setMessage("获取个人问卷调查次数成功");
-        result.setResult(list.size() + adminTopicTwos.size());
-        result.setCode(200);
-        return result;
+            result.setMessage("获取个人问卷调查次数成功");
+            result.setResult(list.size() + adminTopicTwos.size());
+            result.setCode(200);
+            return result;
         } catch (Exception e) {
-            result.setMessage( "获取个人问卷调查次数失败" );
-            result.setResult( null );
-            result.setCode( 0 );
+            result.setMessage("获取个人问卷调查次数失败");
+            result.setResult(null);
+            result.setCode(0);
             return result;
         }
     }