| | |
| | | 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.account.StudentClient; |
| | | import com.dsh.course.feignClient.account.model.*; |
| | | import com.dsh.course.feignClient.activity.BodySideAppointmentClient; |
| | | 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.other.StoreClient; |
| | | import com.dsh.course.feignClient.other.model.SiteChangeStateVO; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | |
| | | private ICityService cityService; |
| | | @Autowired |
| | | private IRoleService roleService; |
| | | |
| | | @Autowired |
| | | private StudentClient studentClient; |
| | | /** |
| | | * 跳转体测预约管理首页 |
| | | */ |
| | |
| | | /** |
| | | * 跳转体测预约管理添加页面 |
| | | */ |
| | | @RequestMapping("/addStudent") |
| | | public String addStudent(Model model) { |
| | | @RequestMapping("/addStudent/{appUserId}") |
| | | public String addStudent(Model model,@PathVariable("appUserId") Integer appUserId) { |
| | | Integer roleType = UserExt.getUser().getObjectType(); |
| | | List<CityManager> province = cityManagerClient.listAll(); |
| | | Set<String> seenNames = new HashSet<>(); |
| | | List<CityManager> result = new ArrayList<>(); |
| | | for (CityManager cityManager : province) { |
| | | if(!seenNames.contains(cityManager.getProvince())){ |
| | | result.add(cityManager); |
| | | seenNames.add(cityManager.getProvince()); |
| | | } |
| | | } |
| | | if (roleType == 2){ |
| | | Integer cityManagerId = UserExt.getUser().getObjectId(); |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(cityManagerId); |
| | | List<Store> stores = storeClient.getStoreByCityManagerId(cityManagerId); |
| | | model.addAttribute("stores",stores); |
| | | } |
| | | model.addAttribute("list",result); |
| | | |
| | | model.addAttribute("roleType",roleType); |
| | | TAppUser tAppUser = appUserClient.queryById(appUserId); |
| | | model.addAttribute("data",tAppUser); |
| | | model.addAttribute("name",tAppUser.getName()); |
| | | return PREFIX + "TAppUser_addStudent.html"; |
| | | } |
| | | /** |
| | |
| | | String format3 = format2.format(data.getVipEndTime()); |
| | | model.addAttribute("vipEndTime",format3); |
| | | } |
| | | if (data.getViplevelId()!=null){ |
| | | // todo创建会员等级表 |
| | | model.addAttribute("level","黄金"); |
| | | } |
| | | model.addAttribute("level","黄金"); |
| | | List<TStudent> tStudents = studentClient.queryStudentList(data.getId()); |
| | | model.addAttribute("students",tStudents); |
| | | return PREFIX + "TAppUser_edit.html"; |
| | | } |
| | | |
| | |
| | | for (QueryAppUserVO queryAppUserVO : queryAppUserVOS) { |
| | | if (queryAppUserVO.getSalesmanUserId()!=null){ |
| | | for (User sale : sales) { |
| | | if (queryAppUserVO.getSalesmanUserId() == sale.getId()){ |
| | | if (queryAppUserVO.getSalesmanUserId().equals(sale.getId())){ |
| | | result.add(queryAppUserVO); |
| | | } |
| | | } |
| | |
| | | @RequestMapping("/addAppUser") |
| | | @ResponseBody |
| | | public Object addAppUser(@RequestBody TAppUser appUser){ |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | appUser.setInsertType(objectType); |
| | | appUser.setAddUserId(UserExt.getUser().getId()); |
| | | Object o = appUserClient.addAppUser1(appUser); |
| | | return o; |
| | | } |
| | | /** |
| | | * 添加/修改体测预约记录 |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/addBodySideAppointments") |
| | | public ResultUtil addBodySideAppointments(@RequestBody QueryBodySideAppointmentVO vo) { |
| | | Integer roleType = UserExt.getUser().getObjectType(); |
| | | // 获取当前登录人id |
| | | Integer cityManagerId = UserExt.getUser().getObjectId(); |
| | | if (roleType == 2){ |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(cityManagerId); |
| | | vo.setProvince(cityManager.getProvince()); |
| | | vo.setProvinceCode(cityManager.getProvinceCode()); |
| | | vo.setCity(cityManager.getCity()); |
| | | vo.setCityCode(cityManager.getCityCode()); |
| | | }else if (roleType == 3){ |
| | | TStoreStaff storeByStoreStaffId = storeStaffClient.getStoreByStoreStaffId(cityManagerId); |
| | | Store storeById = storeClient.getStoreById(storeByStoreStaffId.getStoreId()); |
| | | vo.setProvince(storeById.getProvince()); |
| | | vo.setProvinceCode(storeById.getProvinceCode()); |
| | | vo.setCity(storeById.getCity()); |
| | | vo.setCityCode(storeById.getCityCode()); |
| | | } |
| | | bodySideAppointmentClient.addBodySideAppointments(vo); |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 添加/修改体测预约记录 |
| | | * 新增学员 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/addAppUserStudent") |
| | | @ResponseBody |
| | | @RequestMapping(value = "/getInfoById") |
| | | public BodySideAppointment getInfoById(@RequestBody Integer id) { |
| | | return bodySideAppointmentClient.getInfoById(id); |
| | | public Object addAppUser(@RequestBody TStudent student){ |
| | | return studentClient.addStudent(student); |
| | | } |
| | | |
| | | /** |
| | | * 手动标记用户已经到店并完成体测 |
| | | * 上/下架 1为上架 2为下架 3为删除 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/changeState") |
| | | @ResponseBody |
| | | @RequestMapping(value = "/changeState") |
| | | public Object changeState(@RequestBody List<Integer> ids) { |
| | | return bodySideAppointmentClient.changeState(ids); |
| | | public Object changeState(@RequestBody AdvertisementChangeStateDTO dto){ |
| | | appUserClient.changeState(dto); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | } |