| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.CityManagerClient; |
| | |
| | | import com.dsh.course.feignClient.account.model.Coach; |
| | | import com.dsh.course.feignClient.course.*; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.course.feignClient.other.model.Site; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.dto.SelectDto; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.ITSiteService; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.models.auth.In; |
| | | import org.aspectj.weaver.ast.Var; |
| | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | |
| | | |
| | | @Autowired |
| | | private TOperatorService tOperatorService; |
| | | @Autowired |
| | | private TOperatorCityService tOperatorCityService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/getCoursePackageByType") |
| | | public List<TCoursePackage> getCoursePackageByType(Integer storeId){ |
| | | return coursePackageClient.getCoursePackageByType(storeId); |
| | | public List<TCoursePackage> getCoursePackageByType(Integer storeId,Integer typeId){ |
| | | return coursePackageClient.getCoursePackageByType(typeId,storeId); |
| | | } |
| | | /** |
| | | * 跳转到列表页 |
| | |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | if (cityManager!=null){ |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @Autowired |
| | | private ICityService cityService; |
| | | @GetMapping("/openAddCoursePackage") |
| | | public String openAddCoursePackage(Model model,Integer type){ |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType(); |
| | | model.addAttribute("coursePackageType", tCoursePackageTypes); |
| | | String cityCode = null; |
| | | String cityCode = ""; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | // 获取到这个运营商下面的所有门店 |
| | | List<TStore> operatorId = storeService.list(new QueryWrapper<TStore>().eq("operatorId",objectId)); |
| | | model.addAttribute("store", operatorId); |
| | | List<Coach> coach = coachClient.queryCoachByOperatorId(objectId); |
| | | model.addAttribute("coach", coach); |
| | | // 如果该运营商下面没有门店 |
| | | if (operatorId.size()==0){ |
| | | List<TStore> o = new ArrayList<>(); |
| | | List<TSite> tSites = new ArrayList<>(); |
| | | model.addAttribute("store", o); |
| | | model.addAttribute("site", tSites); |
| | | }else{ |
| | | List<TSite> storeId = siteService.list(new QueryWrapper<TSite>() |
| | | .eq("storeId", operatorId.get(0).getId())); |
| | | model.addAttribute("site", storeId); |
| | | } |
| | | }else{ |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | Object code = list.get(0).get("code"); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(code.toString(), cityCode); |
| | | model.addAttribute("city", list1); |
| | | String code1 = list1.get(0).get("code").toString(); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1)); |
| | | model.addAttribute("store", list2); |
| | | TStore store = list2.get(0); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", store.getId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | List<Coach> coaches = coachClient.queryCoachByCity(code1); |
| | | model.addAttribute("coach", coaches); |
| | | System.out.println("========type========"+type); |
| | | } |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | Object code = list.get(0).get("code"); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(code.toString(), cityCode); |
| | | model.addAttribute("city", list1); |
| | | String code1 = list1.get(0).get("code").toString(); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1)); |
| | | model.addAttribute("store", list2); |
| | | TStore store = list2.get(0); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", store.getId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | List<Coach> coaches = coachClient.queryCoachByCity(code1); |
| | | model.addAttribute("coach", coaches); |
| | | |
| | | |
| | | model.addAttribute("objectType",objectType); |
| | | model.addAttribute("type",type); |
| | | System.out.println("========type========"+type); |
| | | // if (type ==1){ |
| | | // return PREFIX + "coursePackage_edit.html"; |
| | | // } |
| | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | // if(objectType == 2){//城市管理员 |
| | | // CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | // cityCode = cityManager.getCityCode(); |
| | | // } |
| | | System.out.println("======="+storeService.queryCity(code, cityCode)); |
| | | // return storeService.queryCity(code, cityCode); |
| | | return new ResultUtil(0,null,null,storeService.queryCity(code, cityCode),null); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryCity3") |
| | | public ResultUtil queryCity3(){ |
| | | |
| | | System.out.println("======="+storeService.queryCity1()); |
| | | // return storeService.queryCity(code, cityCode); |
| | | return new ResultUtil(0,null,null,storeService.queryCity1(),null); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | return new ResultUtil(0,0,null,list,null); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryStore3") |
| | | public ResultUtil queryStore3(){ |
| | | List<TStore> list = storeService.list(new QueryWrapper<TStore>().select("id","name").eq("state", 1)); |
| | | // Map<String,Integer> map = new LinkedHashMap<>(); |
| | | List<SelectDto> selectDtos = new ArrayList<>(); |
| | | Map<String,Integer> map = new HashMap<>(); |
| | | // for (TStore store : list) { |
| | | // SelectDto selectDto = new SelectDto(); |
| | | // selectDto.setId(Long.valueOf(store.getId())); |
| | | // selectDto.setValue(store.getName()); |
| | | // selectDtos.add(selectDto); |
| | | // |
| | | // } |
| | | // map.put("options",selectDtos); |
| | | |
| | | return new ResultUtil(0,0,null,list,null); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryStore1/") |
| | |
| | | Date startDate = null; |
| | | Date endDate =null ; |
| | | |
| | | |
| | | String holitime = coursePackage.getHolitime(); |
| | | if (holitime!=null&&holitime!="") { |
| | | String[] dateParts = holitime.split(" - "); |
| | |
| | | coursePackage.setStatus(1); |
| | | coursePackage.setState(1); |
| | | coursePackage.setInsertTime(new Date()); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | if (objectType==2){ |
| | | Integer storeId = coursePackage.getStoreId(); |
| | | TStore store = storeService.getOne(new QueryWrapper<TStore>().eq("id", storeId)); |
| | | coursePackage.setProvince(store.getProvince()); |
| | | coursePackage.setProvinceCode(store.getProvinceCode()); |
| | | coursePackage.setCity(store.getCity()); |
| | | coursePackage.setCityCode(store.getCityCode()); |
| | | } |
| | | |
| | | |
| | | // 详情多图片 |
| | | // String substring = coursePackage.getDetailDrawing().substring(0, coursePackage.getDetailDrawing().length() - 1); |
| | | // coursePackage.setDetailDrawing(substring); |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryWalkInStudentList") |
| | | @PostMapping("/queryWalkInStudentListqueryCoursePackageLists") |
| | | public Object queryWalkInStudentList(Long coursePackageSchedulingId, String userName, String studentName){ |
| | | Page<Map<String, Object>> page = coursePackageService.queryWalkInStudentList(coursePackageSchedulingId, userName, studentName); |
| | | return super.packForBT(page); |