| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.AppUserClient; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.StoreStaffClient; |
| | |
| | | import com.dsh.course.feignClient.activity.model.BodySideAppointment; |
| | | import com.dsh.course.feignClient.activity.model.QueryBodySideAppointment; |
| | | import com.dsh.course.feignClient.activity.model.QueryBodySideAppointmentVO; |
| | | import com.dsh.course.feignClient.communityWorldCup.Model.StoreIds; |
| | | import com.dsh.course.feignClient.communityWorldCup.WorldCupClient; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.ListQuery; |
| | | import com.dsh.course.feignClient.course.CoursePackageClient; |
| | | import com.dsh.course.feignClient.other.BallClient; |
| | | import com.dsh.course.feignClient.other.StoreClient; |
| | | import com.dsh.course.feignClient.other.model.SiteChangeStateVO; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.modular.system.controller.util.MD5; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IRoleService; |
| | | import com.dsh.guns.modular.system.service.IUserService; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | private IRoleService roleService; |
| | | @Autowired |
| | | private StudentClient studentClient; |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | @Autowired |
| | | private ISiteBookingService siteBookingService; |
| | | @Autowired |
| | | private CoursePackageClient coursePackageClient; |
| | | @Autowired |
| | | private BallClient ballClient; |
| | | |
| | | /** |
| | | * 跳转体测预约管理首页 |
| | | */ |
| | |
| | | Integer roleType = UserExt.getUser().getObjectType(); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | List<User> sales = userService.list(new QueryWrapper<User>().eq("deptid", 2)); |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | sales = userService.list(new QueryWrapper<User>().eq("deptid", 2).eq("objectType",3).eq("objectId",UserExt.getUser().getObjectId())); |
| | | } |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("roleType",roleType); |
| | | model.addAttribute("sales",sales); |
| | |
| | | |
| | | } |
| | | if (data.getViplevelId()!=null){ |
| | | // todo创建会员等级表 |
| | | |
| | | model.addAttribute("level","黄金"); |
| | | } |
| | | model.addAttribute("level","黄金"); |
| | |
| | | return PREFIX + "TAppUser_edit.html"; |
| | | } |
| | | |
| | | @Autowired |
| | | private WorldCupClient worldCupClient; |
| | | /** |
| | | * 获取所有用户信息 |
| | | * @return |
| | |
| | | @ResponseBody |
| | | public List<QueryAppUserVO> listAll(String province, String city,String name, |
| | | String phone,Integer isVip, String salesmanUserName){ |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | QueryAppUser queryAppUser = new QueryAppUser(); |
| | | queryAppUser.setProvince(province); |
| | | queryAppUser.setCity(city); |
| | |
| | | TCity c = cityService.getOne(new QueryWrapper<TCity>().eq("code", city)); |
| | | queryAppUser.setCity(c.getName()); |
| | | } |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | queryAppUser.setInsertType(objectType); |
| | | queryAppUser.setTypeId(UserExt.getUser().getObjectId()); |
| | | if (objectType == 2){ |
| | | // 获取运营商下的所有门店id集合 |
| | | List<Integer> storeIds = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId)) |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | | // 根据门店id集合查询 属于该运营商下的门店举办的赛事 |
| | | ListQuery listQuery = new ListQuery(); |
| | | listQuery.setIds(storeIds); |
| | | // 通过门店ids 获取赛事的支付记录 获取到用户的ids |
| | | List<Integer> list = competitionClient.getUserIds(listQuery); |
| | | |
| | | // 获取场地预约记录 拿到用户ids |
| | | List<Integer> siteUsers = siteBookingService.list(new QueryWrapper<SiteBooking>().in("storeId", storeIds)) |
| | | .stream().map(SiteBooking::getAppUserId).collect(Collectors.toList()); |
| | | // 获取课程购买记录 拿到用户ids |
| | | List<Integer> cpUsers = coursePackageClient.getCoursePackageByStoreIds(storeIds); |
| | | // 获取游戏记录 拿到用户ids |
| | | List<Integer> gameUsers = ballClient.getGameByStoreIds(storeIds); |
| | | // 查询世界杯记录 获取用户ids |
| | | StoreIds storeIds1 = new StoreIds(); |
| | | storeIds1.setStoreIds(storeIds); |
| | | List<Integer> userIds = worldCupClient.getUserIds(storeIds1); |
| | | // 用户ids |
| | | List<Integer> users = new ArrayList<>(); |
| | | users.addAll(list); |
| | | users.addAll(siteUsers); |
| | | users.addAll(cpUsers); |
| | | users.addAll(gameUsers); |
| | | users.addAll(userIds); |
| | | // 去重后的用户id |
| | | List<Integer> collect = users.stream().distinct().collect(Collectors.toList()); |
| | | if (collect.isEmpty()){ |
| | | collect.add(-1); |
| | | } |
| | | queryAppUser.setUserIds(collect); |
| | | // List<QueryAppUserVO> queryAppUserVOS1 = new ArrayList<>(); |
| | | // // 根据用户消费记录 去查询用户ids |
| | | // for (Integer integer : collect) { |
| | | // if (!collect1.contains(integer)){ |
| | | // TAppUser tAppUser = appUserClient.queryAppUser1(integer); |
| | | // QueryAppUserVO queryAppUserVO = new QueryAppUserVO(); |
| | | // BeanUtils.copyProperties(tAppUser,queryAppUserVO); |
| | | // queryAppUserVOS.add(queryAppUserVO); |
| | | // } |
| | | // } |
| | | } |
| | | if (objectType == 3){ |
| | | // 获取运营商下的所有门店id集合 |
| | | List<Integer> storeIds = new ArrayList<>(); |
| | | storeIds.add(objectId); |
| | | // 根据门店id集合查询 属于该运营商下的门店举办的赛事 |
| | | ListQuery listQuery = new ListQuery(); |
| | | listQuery.setIds(storeIds); |
| | | // 通过门店ids 获取赛事的支付记录 获取到用户的ids |
| | | List<Integer> list = competitionClient.getUserIds(listQuery); |
| | | // 获取场地预约记录 拿到用户ids |
| | | List<Integer> siteUsers = siteBookingService.list(new QueryWrapper<SiteBooking>().in("storeId", storeIds) |
| | | .ne("status",0) |
| | | .ne("status",5) |
| | | ) |
| | | .stream().map(SiteBooking::getAppUserId).collect(Collectors.toList()); |
| | | // 获取课程购买记录 拿到用户ids |
| | | List<Integer> cpUsers = coursePackageClient.getCoursePackageByStoreIds(storeIds); |
| | | // 获取游戏记录 拿到用户ids |
| | | List<Integer> gameUsers = ballClient.getGameByStoreIds(storeIds); |
| | | StoreIds storeIds1 = new StoreIds(); |
| | | storeIds1.setStoreIds(storeIds); |
| | | // 查询世界杯记录 获取用户ids |
| | | List<Integer> userIds = worldCupClient.getUserIds(storeIds1); |
| | | // 用户ids |
| | | List<Integer> users = new ArrayList<>(); |
| | | users.addAll(list); |
| | | users.addAll(siteUsers); |
| | | users.addAll(cpUsers); |
| | | users.addAll(gameUsers); |
| | | users.addAll(userIds); |
| | | // 去重后的用户id |
| | | List<Integer> collect = users.stream().distinct().collect(Collectors.toList()); |
| | | if (collect.isEmpty()){ |
| | | collect.add(-1); |
| | | } |
| | | queryAppUser.setUserIds(collect); |
| | | // List<QueryAppUserVO> queryAppUserVOS1 = new ArrayList<>(); |
| | | // // 根据用户消费记录 去查询用户ids |
| | | // for (Integer integer : collect) { |
| | | // if (!collect1.contains(integer)){ |
| | | // TAppUser tAppUser = appUserClient.queryAppUser1(integer); |
| | | // QueryAppUserVO queryAppUserVO = new QueryAppUserVO(); |
| | | // BeanUtils.copyProperties(tAppUser,queryAppUserVO); |
| | | // queryAppUserVOS.add(queryAppUserVO); |
| | | // } |
| | | // } |
| | | } |
| | | List<QueryAppUserVO> queryAppUserVOS = appUserClient.listAll(queryAppUser); |
| | | List<Integer> collect1 = queryAppUserVOS.stream().map(QueryAppUserVO::getId).collect(Collectors.toList()); |
| | | for (QueryAppUserVO queryAppUserVO : queryAppUserVOS) { |
| | | if (queryAppUserVO.getSalesmanUserId()!=null){ |
| | | queryAppUserVO.setSalesmanUserName(userService.getById(queryAppUserVO.getSalesmanUserId()).getName()); |
| | | User byId = userService.getById(queryAppUserVO.getSalesmanUserId()); |
| | | if (byId!=null){ |
| | | queryAppUserVO.setSalesmanUserName(byId.getName()); |
| | | } |
| | | } |
| | | } |
| | | if (salesmanUserName!=null && (!salesmanUserName.equals(""))){ |
| | |
| | | @ResponseBody |
| | | public Object addAppUser(@RequestBody TAppUser appUser){ |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | appUser.setPassword(MD5.md5("111111")); |
| | | appUser.setProvince(""); |
| | | appUser.setProvinceCode(""); |
| | | appUser.setCity(""); |
| | | appUser.setCityCode(""); |
| | | appUser.setInsertType(objectType); |
| | | appUser.setAddUserId(UserExt.getUser().getObjectId()); |
| | | Object o = appUserClient.addAppUser1(appUser); |
| | |
| | | @RequestMapping("/addAppUserStudent") |
| | | @ResponseBody |
| | | public Object addAppUser(@RequestBody TStudent student){ |
| | | Double height = student.getHeight(); |
| | | Double weight = student.getWeight(); |
| | | double v = weight / (height * height); |
| | | student.setBmi(v); |
| | | return studentClient.addStudent(student); |
| | | } |
| | | /** |