From e030255c23c7ba3e2cbad1036a810d6d72fa864f Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期四, 26 十月 2023 18:04:58 +0800 Subject: [PATCH] 修改bug --- cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java | 386 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 314 insertions(+), 72 deletions(-) diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java index 4efb025..423bbaf 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java @@ -14,10 +14,12 @@ 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.feignClient.other.model.Site; +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.model.*; @@ -31,6 +33,7 @@ import com.sun.org.apache.xerces.internal.impl.io.ASCIIReader; import io.netty.util.AsciiString; import io.rong.util.HttpUtil; +import io.swagger.models.auth.In; import org.apache.commons.lang.StringEscapeUtils; import org.apache.logging.log4j.util.Base64Util; import org.springframework.beans.factory.annotation.Autowired; @@ -38,10 +41,7 @@ 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; @@ -57,6 +57,7 @@ import java.time.LocalTime; import java.time.format.DateTimeFormatter; import java.util.*; +import java.util.stream.Collectors; @Controller @RequestMapping("/ball") @@ -172,6 +173,20 @@ return new ResultUtil<>(0,0,"到店成功",null,null); } + @RequestMapping("/confirm/{id}") + @ResponseBody + public ResultUtil confirm(@PathVariable("id") Integer id) { + + System.out.println("============"+id); + SiteBooking siteBooking = new SiteBooking(); + siteBooking.setId(id); + siteBooking.setStatus(1); + iSiteBookingService.updateById(siteBooking); + + return new ResultUtil<>(0,0,"手动支付成功",null,null); + } + + /** * 获取变更列表 */ @@ -182,37 +197,65 @@ @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 - public ResultUtil save(String operationId,String red, String blue, String province, String city, Integer site, Integer store - , String kuacheng, BigDecimal kuachengCoin, BigDecimal kuachengCash,String kuachengImage,BigDecimal kuachengInt,Integer kuachengId - , String shequ, BigDecimal shequCoin, BigDecimal shequCash,String shequImage,BigDecimal shequInt,Integer shequId - , String shemen, BigDecimal shemenCoin, BigDecimal shemenCash,String shemenImage,BigDecimal shemenInt,Integer shemenId - , String sudu, BigDecimal suduCoin, BigDecimal suduCash,String suduImage,BigDecimal suduInt,Integer suduId - , String fangkuai, BigDecimal fangkuaiCoin, BigDecimal fangkuaiCash,String fangkuaiImage,BigDecimal fangkuaiInt,Integer fangkuaiId - , String jx, BigDecimal jxCoin, BigDecimal jxCash,String jxImage,BigDecimal jxInt,Integer jxId - , String sq, BigDecimal sqCoin, BigDecimal sqCash,String sqImage,BigDecimal sqInt,Integer sqId - , String zs, BigDecimal zsCoin, BigDecimal zsCash,String zsImage,BigDecimal zsInt,Integer zsId - , String zs2, BigDecimal zs2Coin, BigDecimal zs2Cash,String zs2Image,BigDecimal zs2Int,Integer zs2Id - , String ly, BigDecimal lyCoin, BigDecimal lyCash,String lyImage,BigDecimal lyInt,Integer lyId - - - - + public ResultUtil save(Integer id, String operationId, String red, String blue, String province, String city, Integer site, Integer store + , String kuacheng, BigDecimal kuachengCoin, BigDecimal kuachengCash, String kuachengImage, BigDecimal kuachengInt, Integer kuachengId,Integer kcId + , String shequ, BigDecimal shequCoin, BigDecimal shequCash, String shequImage, BigDecimal shequInt, Integer shequId,Integer shequIId + , String shemen, BigDecimal shemenCoin, BigDecimal shemenCash, String shemenImage, BigDecimal shemenInt, Integer shemenId,Integer smId + , String sudu, BigDecimal suduCoin, BigDecimal suduCash, String suduImage, BigDecimal suduInt, Integer suduId,Integer sdId + , String fangkuai, BigDecimal fangkuaiCoin, BigDecimal fangkuaiCash, String fangkuaiImage, BigDecimal fangkuaiInt, Integer fangkuaiId,Integer fkId + , String jx, BigDecimal jxCoin, BigDecimal jxCash, String jxImage, BigDecimal jxInt, Integer jxId,Integer jxIId + , String sq, BigDecimal sqCoin, BigDecimal sqCash, String sqImage, BigDecimal sqInt, Integer sqId,Integer qwId + , String zs, BigDecimal zsCoin, BigDecimal zsCash, String zsImage, BigDecimal zsInt, Integer zsId,Integer zsIId + , 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); if (!operationId.equals("平台")){ @@ -230,6 +273,7 @@ //玩湃跨城赛 TGameConfig gameConfigkuacheng = new TGameConfig(); + gameConfigkuacheng.setId(kcId); gameConfigkuacheng.setGameId(kuachengId); gameConfigkuacheng.setCash(kuachengCash); gameConfigkuacheng.setImg(kuachengImage); @@ -244,72 +288,77 @@ //社区冠军赛 TGameConfig gameConfigshequ = new TGameConfig(); + gameConfigshequ.setId(shequIId); gameConfigshequ.setGameId(shequId); gameConfigshequ.setCash(shequCash); gameConfigshequ.setImg(shequImage); gameConfigshequ.setName(shequ); gameConfigshequ.setPlayCoin(shequCoin); gameConfigshequ.setIntegral(shequInt); - gameConfigshequ.setOtherId(shequId); + gameConfigshequ.setOtherId(gameId); gameConfigList.add(gameConfigshequ); //射门速度-玩湃熊之力 TGameConfig gameConfigshemen = new TGameConfig(); gameConfigshemen.setGameId(shemenId); + gameConfigshemen.setId(smId); gameConfigshemen.setCash(shemenCash); gameConfigshemen.setImg(shemenImage); gameConfigshemen.setName(shemen); gameConfigshemen.setPlayCoin(shemenCoin); gameConfigshemen.setIntegral(shemenInt); - gameConfigshemen.setOtherId(shemenId); + gameConfigshemen.setOtherId(gameId); gameConfigList.add(gameConfigshemen); //玩湃熊之力-速度 TGameConfig gameConfigsudu = new TGameConfig(); - gameConfigsudu.setGameId(suduId); + gameConfigsudu.setGameId(suduId);gameConfigsudu.setId(sdId); gameConfigsudu.setCash(suduCash); gameConfigsudu.setImg(suduImage); gameConfigsudu.setName(sudu); gameConfigsudu.setPlayCoin(suduCoin); gameConfigsudu.setIntegral(suduInt); - gameConfigsudu.setOtherId(suduId); + gameConfigsudu.setOtherId(gameId); gameConfigList.add(gameConfigsudu); //方块球王 TGameConfig gameConfigfangkuai = new TGameConfig(); gameConfigfangkuai.setGameId(fangkuaiId); + gameConfigfangkuai.setId(fkId); gameConfigfangkuai.setCash(fangkuaiCash); gameConfigfangkuai.setImg(fangkuaiImage); gameConfigfangkuai.setName(fangkuai); gameConfigfangkuai.setPlayCoin(fangkuaiCoin); gameConfigfangkuai.setIntegral(fangkuaiInt); - gameConfigfangkuai.setOtherId(fangkuaiId); + gameConfigfangkuai.setOtherId(gameId); gameConfigList.add(gameConfigfangkuai); //镜像阵容 TGameConfig gameConfigjx = new TGameConfig(); gameConfigjx.setGameId(jxId); + gameConfigjx.setId(jxIId); gameConfigjx.setCash(jxCash); gameConfigjx.setImg(jxImage); gameConfigjx.setName(jx); gameConfigjx.setPlayCoin(jxCoin); gameConfigjx.setIntegral(jxInt); - gameConfigjx.setOtherId(jxId); + gameConfigjx.setOtherId(gameId); gameConfigList.add(gameConfigjx); //社区小球王 TGameConfig gameConfigsq = new TGameConfig(); gameConfigsq.setGameId(sqId); + gameConfigsq.setId(qwId); gameConfigsq.setCash(sqCash); gameConfigsq.setImg(sqImage); gameConfigsq.setName(sq); gameConfigsq.setPlayCoin(sqCoin); gameConfigsq.setIntegral(sqInt); - gameConfigsq.setOtherId(sqId); + gameConfigsq.setOtherId(gameId); gameConfigList.add(gameConfigsq); @@ -317,34 +366,36 @@ //涨姿势 TGameConfig gameConfigzs = new TGameConfig(); gameConfigzs.setGameId(zsId); + gameConfigzs.setId(zsIId); gameConfigzs.setCash(zsCash); gameConfigzs.setImg(zsImage); gameConfigzs.setName(zs); gameConfigzs.setPlayCoin(zsCoin); gameConfigzs.setIntegral(zsInt); - gameConfigzs.setOtherId(zsId); + gameConfigzs.setOtherId(gameId); gameConfigList.add(gameConfigzs); //涨姿势2 TGameConfig gameConfigzs2 = new TGameConfig(); - gameConfigzs2.setGameId(zs2Id); + gameConfigzs2.setGameId(zs2Id);gameConfigzs2.setId(zs2IId); gameConfigzs2.setCash(zs2Cash); gameConfigzs2.setImg(zs2Image); gameConfigzs2.setName(zs2); gameConfigzs2.setPlayCoin(zs2Coin); gameConfigzs2.setIntegral(zs2Int); - gameConfigzs2.setOtherId(zs2Id); + gameConfigzs2.setOtherId(gameId); gameConfigList.add(gameConfigzs2); //绿茵密码 TGameConfig gameConfigly = new TGameConfig(); gameConfigly.setGameId(lyId); + gameConfigly.setId(lyIId); gameConfigly.setCash(lyCash); gameConfigly.setImg(lyImage); gameConfigly.setName(ly); gameConfigly.setPlayCoin(lyCoin); gameConfigly.setIntegral(lyInt); - gameConfigly.setOtherId(lyId); + gameConfigly.setOtherId(gameId); gameConfigList.add(gameConfigly); @@ -357,13 +408,40 @@ @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"; } + @Autowired + private TGameConfigService gameConfigService; @RequestMapping("/pre_edit/{id}") public String pre_edit(@PathVariable("id") Integer id,Model model) { @@ -371,7 +449,117 @@ 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); + + + 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); + + + + return PREFIX+"ball_pre_info.html"; } @Autowired @@ -415,8 +603,6 @@ List<OrderDto> timeRanges = new ArrayList<>(); - - Site site = siteClient.listById(book.getSiteId()); System.out.println("================"+site); String appointmentStartTime = site.getAppointmentStartTime(); @@ -428,7 +614,12 @@ 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; @@ -455,9 +646,6 @@ if (strings1.contains(timeRange)){ orderDto.setState(1); } - - - timeRanges.add(orderDto); currentTime = nextTime; @@ -487,10 +675,14 @@ 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()); return PREFIX+"yuyue_edit.html"; @@ -712,6 +904,17 @@ @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); @@ -721,9 +924,10 @@ @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); } @@ -790,7 +994,13 @@ 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; @@ -832,26 +1042,30 @@ 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}") @@ -871,20 +1085,42 @@ 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"; } @@ -896,10 +1132,16 @@ siteBooking.setInsertTime(new Date()); siteBooking.setState(1); siteBooking.setStatus(0); - - siteClient.addSiteBooking(siteBooking); + // 如果是运营商添加的话 根据门店的省市来存储 + 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()); + } + siteClient.addSiteBooking(siteBooking); System.out.println("================="+siteBooking); - return new ResultUtil<>(null,200,null,null,null); } -- Gitblit v1.7.1