| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.common.utils.Md5Utils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.dto.JsDto; |
| | | import com.dsh.course.dto.StudentQeryDto; |
| | | import com.dsh.course.feignClient.account.AppUserClient; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.CoachClient; |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | import com.dsh.course.feignClient.account.model.Coach; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.course.CoursePackageClient; |
| | | import com.dsh.course.feignClient.course.CoursePackageDiscountClient; |
| | | import com.dsh.course.feignClient.course.CoursePackagePaymentConfigClient; |
| | | import com.dsh.course.feignClient.course.CoursePackageTypeClient; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackage; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackageType; |
| | | import com.dsh.course.feignClient.other.BallClient; |
| | | import com.dsh.course.feignClient.other.SiteClient; |
| | |
| | | import com.dsh.course.service.TGameConfigService; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.modular.system.controller.util.MD5; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.dto.*; |
| | | import com.dsh.guns.modular.system.service.*; |
| | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.Base64Utils; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.BufferedReader; |
| | |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Controller |
| | | @RequestMapping("/ball") |
| | |
| | | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | @RequestMapping("/tolist") |
| | | public String tolist(Model model) { |
| | |
| | | return new ResultUtil<>(0,0,"到店成功",null,null); |
| | | } |
| | | |
| | | @RequestMapping("/confirm/{id}") |
| | | @ResponseBody |
| | | public ResultUtil confirm(@PathVariable("id") Integer id) { |
| | | |
| | | SiteBooking byId = iSiteBookingService.getById(id); |
| | | String money = byId.getMoney(); |
| | | // todo 这里手动支付 默认按照现金当作支付金额 后续可能要问下产品 |
| | | String[] split = money.split(","); |
| | | Double aDouble = Double.valueOf(split[0]); |
| | | System.out.println("============"+id); |
| | | SiteBooking siteBooking = new SiteBooking(); |
| | | siteBooking.setPayMoney(aDouble); |
| | | siteBooking.setId(id); |
| | | siteBooking.setStatus(1); |
| | | siteBooking.setPayType(4); |
| | | siteBooking.setPayUserId(UserExt.getUser().getId()); |
| | | iSiteBookingService.updateById(siteBooking); |
| | | |
| | | return new ResultUtil<>(0,0,"手动支付成功",null,null); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取变更列表 |
| | | */ |
| | |
| | | @ResponseBody |
| | | public List<Game> changelist(BallQueryDto ballQueryDto) { |
| | | System.out.println("=======ballQueryDto=========="+ballQueryDto); |
| | | |
| | | User user = UserExt.getUser(); |
| | | ballQueryDto.setType(user.getObjectType()); |
| | | ballQueryDto.setId(user.getObjectId()); |
| | | return ballClient.list(ballQueryDto); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editCoursePackageState") |
| | | public ResultUtil editCoursePackageState(Integer id, Integer state){ |
| | | Game game = new Game(); |
| | | game.setId(id); |
| | | game.setState(state); |
| | | ballClient.save(game); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/save") |
| | | @ResponseBody |
| | |
| | | , String zs2, BigDecimal zs2Coin, BigDecimal zs2Cash, String zs2Image, BigDecimal zs2Int, Integer zs2Id,Integer zs2IId |
| | | , String ly, BigDecimal lyCoin, BigDecimal lyCash, String lyImage, BigDecimal lyInt, Integer lyId,Integer lyIId |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ) { |
| | | |
| | | Game game = new Game(); |
| | | game.setRed(red); |
| | | game.setState(0); |
| | | game.setBlue(blue); |
| | | |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | |
| | | if (objectType ==3){ |
| | | |
| | | |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | System.out.println("=====byId======="+byId); |
| | | game.setProvinceCode(byId.getProvinceCode()); |
| | | game.setCityCode(byId.getCityCode()); |
| | | |
| | | |
| | | }else { |
| | | game.setProvinceCode(province); |
| | | game.setCityCode(city); |
| | | |
| | | } |
| | | game.setSiteId(site); |
| | | game.setStoreId(store); |
| | | game.setId(id); |
| | |
| | | |
| | | |
| | | |
| | | System.out.println("---------------------------"+gameConfigList); |
| | | System.out.println("---------------------------"+gameConfigList); |
| | | ballClient.saveConfig( gameConfigList); |
| | | return null; |
| | | } |
| | |
| | | @RequestMapping("/pre_add") |
| | | public String add(Model model) { |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | |
| | | if (objectType ==3){ |
| | | |
| | | model.addAttribute("is3","true"); |
| | | model.addAttribute("storeId",UserExt.getUser().getObjectId()); |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | System.out.println("=====byId======="+byId); |
| | | model.addAttribute("cityCode",byId.getCityCode()); |
| | | model.addAttribute("provinceCode",byId.getProvinceCode()); |
| | | model.addAttribute("oId",byId.getOperatorId()); |
| | | return PREFIX+"ball_pre_add1.html"; |
| | | |
| | | } |
| | | |
| | | if (objectType == 2){ |
| | | model.addAttribute("is3","true"); |
| | | model.addAttribute("oId",UserExt.getUser().getObjectId()); |
| | | return PREFIX+"ball_pre_add2.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | model.addAttribute("is","${is}"); |
| | | |
| | | |
| | | |
| | | return PREFIX+"ball_pre_add.html"; |
| | | } |
| | |
| | | System.out.println("---------game------"+game); |
| | | model.addAttribute("game",game); |
| | | |
| | | if (game.getOperationId() ==0){ |
| | | model.addAttribute("opId","平台"); |
| | | model.addAttribute("is","平台"); |
| | | }else { |
| | | model.addAttribute("opId",game.getOperationId()); |
| | | } |
| | | |
| | | TGameConfig kc = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 14)); |
| | | model.addAttribute("kc",kc); |
| | | |
| | | |
| | | TGameConfig sq = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 16)); |
| | | model.addAttribute("sq",sq); |
| | | |
| | | |
| | | TGameConfig sm = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 13)); |
| | | model.addAttribute("sm",sm); |
| | | |
| | | TGameConfig sd = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 15)); |
| | | model.addAttribute("sd",sd); |
| | | |
| | | TGameConfig fk = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 1)); |
| | | model.addAttribute("fk",fk); |
| | | |
| | | TGameConfig jx = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 7)); |
| | | model.addAttribute("jx",jx); |
| | | |
| | | TGameConfig qw = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 8)); |
| | | model.addAttribute("qw",qw); |
| | | |
| | | TGameConfig zs = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 10)); |
| | | model.addAttribute("zs",zs); |
| | | |
| | | TGameConfig zs2 = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 11)); |
| | | model.addAttribute("zs2",zs2); |
| | | |
| | | TGameConfig ly = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 5)); |
| | | model.addAttribute("ly",ly); |
| | | |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | |
| | | if (objectType ==3){ |
| | | model.addAttribute("is3","true"); |
| | | model.addAttribute("storeId",UserExt.getUser().getObjectId()); |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | model.addAttribute("cityCode",byId.getCityCode()); |
| | | model.addAttribute("provinceCode",byId.getProvinceCode()); |
| | | model.addAttribute("oId",byId.getOperatorId()); |
| | | return PREFIX+"ball_pre_edit1.html"; |
| | | |
| | | } |
| | | if (objectType == 2){ |
| | | return PREFIX+"ball_pre_edit2.html"; |
| | | |
| | | } |
| | | |
| | | return PREFIX+"ball_pre_edit.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/pre_info/{id}") |
| | | public String pre_info(@PathVariable("id") Integer id,Model model) { |
| | | |
| | | Game game = ballClient.queryGame(id); |
| | | System.out.println("---------game------"+game); |
| | | model.addAttribute("game",game); |
| | | |
| | | |
| | | if (game.getOperationId() ==0){ |
| | | model.addAttribute("opId","平台"); |
| | | model.addAttribute("is","平台"); |
| | | }else { |
| | | model.addAttribute("opId",game.getOperationId()); |
| | | } |
| | | |
| | | TGameConfig kc = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 14)); |
| | | model.addAttribute("kc",kc); |
| | |
| | | |
| | | |
| | | |
| | | return PREFIX+"ball_pre_edit.html"; |
| | | return PREFIX+"ball_pre_info.html"; |
| | | } |
| | | |
| | | @Autowired |
| | |
| | | |
| | | |
| | | List<OrderDto> timeRanges = new ArrayList<>(); |
| | | |
| | | |
| | | Site site = siteClient.listById(book.getSiteId()); |
| | | System.out.println("================"+site); |
| | | String appointmentStartTime = site.getAppointmentStartTime(); |
| | |
| | | System.out.println("是否超过当前日期"+isAfterCurrentDate); |
| | | String currentTime = appointmentStartTime; |
| | | while (currentTime.compareTo(appointmentEndTime) < 0) { |
| | | String nextTime = getNextTime(currentTime); |
| | | String nextTime = null; |
| | | if("智慧场地".equals(site.getTypeName())){ |
| | | nextTime=getNextTimeOne(currentTime); |
| | | }else { |
| | | nextTime= getNextTime(currentTime); |
| | | } |
| | | |
| | | |
| | | String timeRange = currentTime + "-" + nextTime; |
| | |
| | | orderDto.setState(1); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | timeRanges.add(orderDto); |
| | | currentTime = nextTime; |
| | | } |
| | |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | Object code = list.get(0).get("code"); |
| | |
| | | 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)); |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | list2=storeService.list(new QueryWrapper<TStore>().eq("id", UserExt.getUser().getObjectId()).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); |
| | | |
| | | model.addAttribute("objType", UserExt.getUser().getObjectType()); |
| | | // 查询运营商下所有门店 所有场地 |
| | | if (objectType == 2){ |
| | | List<TStore> stores = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId)); |
| | | model.addAttribute("store", stores); |
| | | // 门店ids |
| | | List<Integer> storeIds = stores.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | List<TSite> sites = siteService.list(new QueryWrapper<TSite>().in("storeId", storeIds)); |
| | | model.addAttribute("site", sites); |
| | | } |
| | | model.addAttribute("objectType", objectType); |
| | | |
| | | return PREFIX+"yuyue_edit.html"; |
| | | } |
| | |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | |
| | | |
| | | 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); |
| | | |
| | | |
| | | // 查询运营商下所有门店 所有场地 |
| | | if (objectType == 2){ |
| | | List<TStore> stores = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId)); |
| | | model.addAttribute("store", stores); |
| | | // 门店ids |
| | | List<Integer> storeIds = stores.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | List<TSite> sites = siteService.list(new QueryWrapper<TSite>().in("storeId", storeIds)); |
| | | model.addAttribute("site", sites); |
| | | } |
| | | model.addAttribute("objectType", objectType); |
| | | return PREFIX+"yuyue_info.html"; |
| | | } |
| | | |
| | |
| | | studentQeryDto.setStart(split[0]); |
| | | studentQeryDto.setEnd(split[1]); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 如果当前登陆人是运营商 只查询该运营商下的课包的数据 |
| | | if(UserExt.getUser().getObjectType() == 2){ |
| | | // 先查询这个运营商下的所有门店ids |
| | | List<Integer> storeIds = storeService.list(new QueryWrapper<TStore>().eq("operatorId", UserExt.getUser().getObjectId())) |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | | // 根据门店ids 查询所有课包ids |
| | | List<TCoursePackage> tCoursePackages = new ArrayList<>(); |
| | | for (Integer storeId : storeIds) { |
| | | List<TCoursePackage> coursePackageByStoreId = coursePackageClient.getCoursePackageByStoreId(storeId); |
| | | tCoursePackages.addAll(coursePackageByStoreId); |
| | | } |
| | | List<Integer> coursePackageByStoreIds = tCoursePackages.stream().distinct().map(TCoursePackage::getId).collect(Collectors.toList()); |
| | | studentQeryDto.setCoursePackageIds(coursePackageByStoreIds); |
| | | } |
| | | List<Map<String, Object>> pays = coursePackageClient.getStudentTotal(studentQeryDto); |
| | | |
| | | System.out.println("=========getStudentTotal======="+pays); |
| | |
| | | pacQueryDto.setStart(split[0]); |
| | | pacQueryDto.setEnd(split[1]); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | List<Integer> storeIds = storeService.list(new QueryWrapper<TStore>().eq("operatorId", UserExt.getUser().getObjectId())) |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | | pacQueryDto.setStoreIds(storeIds); |
| | | } |
| | | List<Map<String, Object>> pays = coursePackageClient.bypac(pacQueryDto); |
| | | |
| | | System.out.println("=========getStudentTotal======="+pays); |
| | | |
| | | return pays; |
| | | } |
| | | |
| | |
| | | @RequestMapping("/yuyuelist") |
| | | @ResponseBody |
| | | public List<Map<String,Object>> yuyuelist(BookingQuery bookingQuery) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | |
| | | if(objectType==2){ |
| | | List<Integer> operatorId = storeService.list(new QueryWrapper<TStore>() |
| | | .eq("operatorId", UserExt.getUser().getObjectId())) |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | | bookingQuery.setStoreIds(operatorId); |
| | | } |
| | | if(objectType==3){ |
| | | bookingQuery.setStoreId(UserExt.getUser().getObjectId()); |
| | | } |
| | | List<Map<String,Object>> orders = ballClient.listorder(bookingQuery); |
| | | System.out.println("=======ballQueryDto=========="+bookingQuery); |
| | | for (Map<String, Object> vo : orders) { |
| | | |
| | | |
| | | if (vo.get("payType")!=null && Integer.parseInt(vo.get("payType").toString()) == 1){ |
| | | vo.put("payType","微信"); |
| | | }else if (vo.get("payType")!=null && Integer.parseInt(vo.get("payType").toString()) == 2){ |
| | | vo.put("payType","支付宝"); |
| | | }else if (vo.get("payType")!=null && Integer.parseInt(vo.get("payType").toString()) == 3){ |
| | | vo.put("payType","玩湃币"); |
| | | }else if (vo.get("payType")!=null && Integer.parseInt(vo.get("payType").toString()) == 4){ |
| | | if (vo.get("payUserId")!=null){ |
| | | User payUserId = userService.getById(Integer.parseInt(vo.get("payUserId").toString())); |
| | | if(payUserId!=null){ |
| | | vo.put("payType","手动支付"+"-"+payUserId.getName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return orders; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/addjs") |
| | | @ResponseBody |
| | | public void addjs( @RequestBody JsDto jsDto) { |
| | | public ResultUtil addjs( @RequestBody JsDto jsDto) { |
| | | System.out.println("=======jsDto========"+jsDto); |
| | | storeService.insert(jsDto); |
| | | return new ResultUtil(0,0,"保存成功",null,null); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | String currentTime = appointmentStartTime; |
| | | while (currentTime.compareTo(appointmentEndTime) < 0) { |
| | | String nextTime = getNextTime(currentTime); |
| | | String nextTime = null; |
| | | if("智慧场地".equals(site.getTypeName())){ |
| | | nextTime=getNextTimeOne(currentTime); |
| | | }else { |
| | | nextTime= getNextTime(currentTime); |
| | | } |
| | | // String nextTime = getNextTime(currentTime); |
| | | |
| | | |
| | | String timeRange = currentTime + "-" + nextTime; |
| | |
| | | |
| | | return String.format("%02d:%02d", hour, minute); |
| | | |
| | | // String[] parts = currentTime.split(":"); |
| | | // int hour = Integer.parseInt(parts[0]); |
| | | // int minute = Integer.parseInt(parts[1]); |
| | | // |
| | | // if (minute == 45) { |
| | | // hour++; |
| | | // minute = 0; |
| | | // } else if (minute == 0){ |
| | | // minute = 15; |
| | | // }else if (minute == 15){ |
| | | // minute = 30; |
| | | // }else if (minute == 30){ |
| | | // minute = 45; |
| | | // } |
| | | // |
| | | // return String.format("%02d:%02d", hour, minute); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public static String getNextTimeOne(String currentTime) { |
| | | |
| | | String[] parts = currentTime.split(":"); |
| | | int hour = Integer.parseInt(parts[0]); |
| | | int minute = Integer.parseInt(parts[1]); |
| | | |
| | | if (minute == 45) { |
| | | hour++; |
| | | minute = 0; |
| | | } else if (minute == 0){ |
| | | minute = 15; |
| | | }else if (minute == 15){ |
| | | minute = 30; |
| | | }else if (minute == 30){ |
| | | minute = 45; |
| | | } |
| | | |
| | | return String.format("%02d:%02d", hour, minute); |
| | | |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/halfName/{id}") |
| | |
| | | public String yuyueadd(Model model) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | String cityCode = null; |
| | | 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 =new ArrayList<>(); |
| | | if(objectType==3){ |
| | | list2 = storeService.list(new QueryWrapper<TStore>().eq("id", objectId).eq("state", 1)); |
| | | }else { |
| | | 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<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); |
| | | model.addAttribute("objectType",objectType); |
| | | return PREFIX+"yuyue_add.html"; |
| | | } |
| | | |
| | |
| | | siteBooking.setInsertTime(new Date()); |
| | | siteBooking.setState(1); |
| | | siteBooking.setStatus(0); |
| | | // 查询当前预约人是否是会员 |
| | | String phone = siteBooking.getPhone(); |
| | | String booker = siteBooking.getBooker(); |
| | | TAppUser appUserByPhone = appUserClient.getAppUserByPhone(phone); |
| | | TStore byId1 = storeService.getById(siteBooking.getStoreId()); |
| | | if (appUserByPhone== null){ |
| | | // 则当前预约人不是会员 添加到会员表里 |
| | | TAppUser tAppUser = new TAppUser(); |
| | | tAppUser.setName(booker); |
| | | tAppUser.setPhone(phone); |
| | | tAppUser.setProvince(byId1.getProvince()); |
| | | tAppUser.setProvinceCode(byId1.getProvinceCode()); |
| | | tAppUser.setCity(byId1.getCity()); |
| | | tAppUser.setCityCode(byId1.getCityCode()); |
| | | tAppUser.setIsVip(0); |
| | | tAppUser.setInsertType(UserExt.getUser().getObjectType()); |
| | | tAppUser.setAddUserId(UserExt.getUser().getObjectId()); |
| | | tAppUser.setInsertTime(new Date()); |
| | | tAppUser.setPassword(MD5.md5("111111")); |
| | | appUserClient.addAppUser1(tAppUser); |
| | | TAppUser appUserByPhone1 = appUserClient.getAppUserByPhone(phone); |
| | | siteBooking.setAppUserId(appUserByPhone1.getId()); |
| | | }else{ |
| | | siteBooking.setAppUserId(appUserByPhone.getId()); |
| | | } |
| | | // 如果是运营商添加的话 根据门店的省市来存储 |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | TStore byId = storeService.getById(siteBooking.getStoreId()); |
| | | siteBooking.setProvince(byId.getProvince()); |
| | | siteBooking.setProvinceCode(byId.getProvinceCode()); |
| | | siteBooking.setCity(byId.getCity()); |
| | | siteBooking.setCityCode(byId.getCityCode()); |
| | | } |
| | | if (UserExt.getUser().getObjectType() == 3){ |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | siteBooking.setProvince(byId.getProvince()); |
| | | siteBooking.setProvinceCode(byId.getProvinceCode()); |
| | | siteBooking.setCity(byId.getCity()); |
| | | siteBooking.setCityCode(byId.getCityCode()); |
| | | } |
| | | |
| | | siteClient.addSiteBooking(siteBooking); |
| | | siteClient.addSiteBooking(siteBooking); |
| | | System.out.println("================="+siteBooking); |
| | | |
| | | return new ResultUtil<>(null,200,null,null,null); |
| | | } |
| | | |