| | |
| | | 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.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.TCity; |
| | | import com.dsh.guns.modular.system.model.TOperator; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | 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 ICityService cityService; |
| | | |
| | | |
| | | |
| | |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @Autowired |
| | | private TOperatorService operatorService; |
| | | @GetMapping("/openCoursePackageListPage") |
| | | public String openCoursePackageListPage(Model model){ |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType(); |
| | | model.addAttribute("coursePackageType", tCoursePackageTypes); |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("province", list); |
| | | model.addAttribute("objectType", objectType); |
| | | return PREFIX + "coursePackage.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); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @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/") |
| | | public ResultUtil queryStore2(){ |
| | | // List<TStore> list = storeService.list(new QueryWrapper<TStore>().select("id","name").eq("cityCode", cityCode).eq("state", 1)); |
| | |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据门店id获取场地 |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/querySite") |
| | | public List<TSite> querySite4(Integer storeId){ |
| | | System.out.println("==storeId==="+storeId); |
| | | List<TSite> list = siteService.list(new QueryWrapper<TSite>().select("id","name").eq("storeId", storeId).eq("state", 1)); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | // @ResponseBody |
| | | // @PostMapping("/querySite") |
| | | // public List<TSite> querySite2(){ |
| | | // return null; |
| | | // } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/querySite/") |
| | |
| | | coursePackage.setStatus(1); |
| | | coursePackage.setState(1); |
| | | coursePackage.setInsertTime(new Date()); |
| | | // 详情多图片 |
| | | // String substring = coursePackage.getDetailDrawing().substring(0, coursePackage.getDetailDrawing().length() - 1); |
| | | // coursePackage.setDetailDrawing(substring); |
| | | coursePackageService.addCoursePackage(coursePackage, coursePackagePaymentConfig); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editCoursePackageState1") |
| | | public ResultUtil editCoursePackageState1(Integer id, Integer state){ |
| | | TCoursePackage coursePackage = new TCoursePackage(); |
| | | coursePackage.setId(id); |
| | | coursePackage.setStatus(state); |
| | | coursePackageService.editCoursePackageState(coursePackage); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑课包折扣 |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/afterClassExercises") |
| | | public ResultUtil afterClassExercises(Long id, Integer courseId, Integer integral){ |
| | | public ResultUtil afterClassExercises(Long id, Integer courseId, Integer integral,Integer packId){ |
| | | return coursePackageService.afterClassExercises(id, courseId, integral); |
| | | } |
| | | |