| | |
| | | @Permission |
| | | @ResponseBody |
| | | public Object list(@RequestParam(required = false) String name, |
| | | @RequestParam(required = false) String phone, |
| | | @RequestParam(required = false) String beginTime, |
| | | @RequestParam(required = false) String endTime, |
| | | @RequestParam(required = false) Integer deptid, |
| | |
| | | beginTime = split[0]; |
| | | endTime = split[1]; |
| | | } |
| | | List<Map<String, Object>> users = userService.selectUsers(null, name, beginTime, endTime, deptid,high1,high2,weight1,weight2,hospital,tag); |
| | | List<Map<String, Object>> users = userService.selectUsers(null, name,phone, beginTime, endTime, deptid,high1,high2,weight1,weight2,hospital,tag); |
| | | return new UserWarpper(users).warp(); |
| | | } |
| | | |
| | |
| | | String time1 = format.format(date); |
| | | String fileName ="用户信息.xls"; |
| | | String[] title = new String[] {"用户名","手机号","出生日期","身高","体重","就诊医院","用户标签","注册时间","问卷调查分数"}; |
| | | List<Map<String, Object>> users = userService.selectUsers(null, null, null, null, null,null,null,null,null,null,null); |
| | | List<Map<String, Object>> users = userService.selectUsers(null, null,null, null, null, null,null,null,null,null,null,null); |
| | | String[][] values = new String[users.size()][]; |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); // 设置日期时间格式 |
| | | SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置日期时间格式 |
| | |
| | | values[i][4] = d.get("weight").toString(); |
| | | values[i][5] = (String) d.get("hospital"); |
| | | String tagsName = (String) d.get("tagsName"); |
| | | String replace = tagsName.replace(",", ";"); |
| | | values[i][6] = replace; |
| | | if (tagsName!=null) { |
| | | String replace = tagsName.replace(",", ";"); |
| | | values[i][6] = replace; |
| | | } |
| | | values[i][7] = formatter1.format(d.get("createtime")); // 将Date类型转换为String |
| | | values[i][8] = formatter.format(d.get("createtime")); // 将Date类型转换为String |
| | | |
| | |
| | | * 判断当前登录的用户是否有操作这个用户的权限 |
| | | */ |
| | | private void assertAuth(Integer userId) { |
| | | if (ShiroKit.isAdmin()) { |
| | | return; |
| | | } |
| | | List<Integer> deptDataScope = ShiroKit.getDeptDataScope(); |
| | | User user = this.userService.selectById(userId); |
| | | Integer deptid = user.getDeptid(); |
| | | if (deptDataScope.contains(deptid)) { |
| | | return; |
| | | } else { |
| | | throw new GunsException(BizExceptionEnum.NO_PERMITION); |
| | | } |
| | | // if (ShiroKit.isAdmin()) { |
| | | // return; |
| | | // } |
| | | // List<Integer> deptDataScope = ShiroKit.getDeptDataScope(); |
| | | // User user = this.userService.selectById(userId); |
| | | // Integer deptid = user.getDeptid(); |
| | | // if (deptDataScope.contains(deptid)) { |
| | | // return; |
| | | // } else { |
| | | // throw new GunsException(BizExceptionEnum.NO_PERMITION); |
| | | // } |
| | | |
| | | } |
| | | } |