From 6fc23bd4555236b011ef0e9c3096afd0d123ab32 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期一, 11 三月 2024 17:50:08 +0800 Subject: [PATCH] bug修改 --- cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java | 16 +++ cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js | 26 +++--- cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java | 53 +++++++++---- cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/TSiteDTO.java | 3 cloud-server-other/src/main/java/com/dsh/other/model/dto/siteDto/TSiteDTO.java | 4 cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js | 103 +++++++++++-------------- 6 files changed, 114 insertions(+), 91 deletions(-) diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/TSiteDTO.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/TSiteDTO.java index 3b35d5b..db68777 100644 --- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/TSiteDTO.java +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/TSiteDTO.java @@ -23,6 +23,7 @@ */ private Integer storeId; + private Integer type; /** * 门店名称 */ @@ -67,6 +68,8 @@ */ @TableField("cityCode") private String cityCode; + @TableField("operatorId") + private Integer operatorId; /** * 预约开始时间 */ diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java index 5034ad5..0347a98 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java @@ -740,9 +740,8 @@ @ResponseBody - @PostMapping("/queryCity1/{code}/{$operationId}") - public ResultUtil queryCity1(@PathVariable("code") String code, - @PathVariable("$operationId") String operationId){ + @PostMapping("/queryCity1/{code}") + public ResultUtil queryCity1(@PathVariable("code") String code){ Integer objectType = UserExt.getUser().getObjectType(); Integer objectId = UserExt.getUser().getObjectId(); String cityCode = null; @@ -750,18 +749,9 @@ // CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); // cityCode = cityManager.getCityCode(); // } - Integer operatorId= 0; - Integer type= 0; - if (operationId.equals("平台")){ - type = 1; - operatorId = null; - }else{ - operatorId = Integer.valueOf(operationId); - type = 2; - } + // return storeService.queryCity(code, cityCode); - return new ResultUtil(0,null,null,storeService.queryCity2(code, cityCode - ,type,operatorId),null); + return new ResultUtil(0,null,null,storeService.queryCity(code, cityCode),null); } @ResponseBody @@ -781,6 +771,14 @@ return new ResultUtil(0,null,null,null,null); } + + @ResponseBody + @PostMapping("/queryStore1//{id}") + public ResultUtil queryCity6(){ + + return new ResultUtil(0,null,null,null,null); + } + /** * 根据城市code获取门店 * @param cityCode @@ -796,9 +794,30 @@ @ResponseBody - @PostMapping("/queryStore1/{cityCode}") - public ResultUtil queryStore1(@PathVariable("cityCode") String cityCode){ - List<TStore> list = storeService.list(new QueryWrapper<TStore>().select("id","name").eq("cityCode", cityCode).eq("state", 1)); + @PostMapping("/queryStore1/{cityCode}/{$operationId}") + public ResultUtil queryStore1(@PathVariable("cityCode") String cityCode, + @PathVariable("$operationId") String operationId){ + Integer operatorId= 0; + Integer type= 0; + if (operationId.equals("平台")){ + type = 1; + operatorId = null; + }else{ + operatorId = Integer.valueOf(operationId); + type = 2; + } + QueryWrapper<TStore> wrapper = new QueryWrapper<>(); + wrapper.select("id","name"); + wrapper.eq("cityCode", cityCode); + wrapper.eq("state", 1); + wrapper.eq("type", type); + if (type!=1){ + // 如果不是勾选的平台 是选择的运营商 那么筛选运营商id + wrapper.eq("operatorId",operatorId); + } + List<TStore> list = storeService.list( + wrapper + ); // Map<String,Integer> map = new LinkedHashMap<>(); List<SelectDto> selectDtos = new ArrayList<>(); Map<String,Integer> map = new HashMap<>(); diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java index 53fc4ec..212c273 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java @@ -598,7 +598,21 @@ vo.setObjectType(type); vo.setObjectId(objectId); vo.setOpId(opId); - return siteClient.listExipre(vo); + List<TSiteDTO> tSiteDTOS = siteClient.listExipre(vo); + for (TSiteDTO tSiteDTO : tSiteDTOS) { + Integer storeId = tSiteDTO.getStoreId(); + TStore byId = storeService.getById(storeId); + if (byId!=null){ + if (byId.getType()==1){ + tSiteDTO.setOperator("平台"); + }else{ + TOperator byId1 = tOperatorService.getById(tSiteDTO.getOperatorId()); + if (byId1!=null) + tSiteDTO.setOperator(byId1.getName()); + } + } + } + return tSiteDTOS; } @Autowired diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js index 864806e..d3ede42 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js @@ -24,13 +24,7 @@ {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, { title: '所属运营商', field: 'operator', visible: objectType==3?false:true, align: 'center', valign: 'middle', - formatter: function(value, row, index) { - if (!value || value.trim() === '' || value.trim() === 0) { - return '平台'; - } else { - return value; - } - } + }, { title: '省', field: 'province', visible: objectType === 1 ? true : false, align: 'center', valign: 'middle', width: '20%', @@ -178,9 +172,9 @@ oneId=0; console.log("选中是平台"); } else { + oneId = 1; console.log("运营商"); console.log(oneId) - } var ajax = new $ax(Feng.ctxPath + "/tSite/getChangeOne", function(data){ if(data!=null){ @@ -205,12 +199,11 @@ } }); - if (typeof(oneId) == "undefined"){ + if (oneId == "1"){ console.log("===============") oneId = $("#yys").val() var button = document.getElementById("yys"); button.removeAttribute("disabled"); - } ajax.set("oneId",oneId); @@ -447,6 +440,7 @@ imgs:"", reservation:"", isCanBeBooked:"", + type:"", }; data.province = $("#pCode").val() @@ -476,6 +470,15 @@ data.isCanBeBooked= reservation; console.log("看看是否可预约值") console.log(reservation); + var checkbox = document.querySelector('input[name="pt"]'); + if (checkbox.checked) { + data.type = 1 + console.log("选中是平台"); + data.operatorId = 0; + } else { + console.log("运营商"); + data.type = 2; + } if (reservation == 1) { if (data.typeName === "智慧场地") { console.log("===========这是智慧球场") @@ -548,9 +551,6 @@ SelectValue= yys } data.operatorId= SelectValue; - - - let num24 = $('input[name="name1"]'); var nextName=""; for (let i = 0; i < num24.length; i++) { diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js index 34ad6ba..860aeac 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js @@ -205,6 +205,7 @@ introduce:"", imgs:"", reservation:"", + isCanBeBooked:"", }; data.province = $("#pCode").val() data.id = $("#id").val() @@ -225,64 +226,51 @@ var sm =data.appointmentStartTime.split(':')[1]; var eh =data.appointmentEndTime.split(':')[0]; var em =data.appointmentEndTime.split(':')[1]; - - if (data.typeName === "智慧场地"){ - console.log("===========这是智慧球场") - - console.log("====="+data.appointmentStartTime) - - var value = data.appointmentStartTime; - var lastTwoDigits = value.slice(-2); - - if (lastTwoDigits === "00" || lastTwoDigits === "15" || lastTwoDigits === "30" || lastTwoDigits === "45") { - console.log("Last two digits are 00, 15, 30, or 45"); + var reservation= $("input[name='reservation']:checked").val(); + data.reservation= reservation; + data.isCanBeBooked= reservation; + if (reservation==1) { + if (data.typeName === "智慧场地") { + console.log("===========这是智慧球场") + console.log("=====" + data.appointmentStartTime) + var value = data.appointmentStartTime; + var lastTwoDigits = value.slice(-2); + if (lastTwoDigits === "00" || lastTwoDigits === "15" || lastTwoDigits === "30" || lastTwoDigits === "45") { + console.log("Last two digits are 00, 15, 30, or 45"); + } else { + Feng.error("智慧场地的可预约时间段是15分钟的倍数") + return; + } + var value1 = data.appointmentEndTime; + var lastTwoDigits1 = value1.slice(-2); + if (lastTwoDigits1 === "00" || lastTwoDigits1 === "15" || lastTwoDigits1 === "30" || lastTwoDigits1 === "45") { + console.log("Last two digits are 00, 15, 30, or 45"); + } else { + Feng.error("智慧场地的可预约时间段是15分钟的倍数") + return; + } } else { - Feng.error("智慧场地的可预约时间段是15分钟的倍数") - return; + console.log("===========这是普通球场") + console.log("=====" + data.appointmentStartTime) + var value = data.appointmentStartTime; + var lastTwoDigits = value.slice(-2); + if (lastTwoDigits === "00" || lastTwoDigits === "30") { + console.log("Last two digits are 00, 15, 30, or 45"); + } else { + Feng.info("普通场地可预约时间段需是30分钟的倍数") + return; + } + var value1 = data.appointmentEndTime; + var lastTwoDigits1 = value1.slice(-2); + if (lastTwoDigits1 === "00" || lastTwoDigits1 === "30") { + console.log("Last two digits are 00, 15, 30, or 45"); + } else { + Feng.info("普通场地可预约时间段需是30分钟的倍数") + return; + + } } - - - var value1 = data.appointmentEndTime; - var lastTwoDigits1 = value1.slice(-2); - - if (lastTwoDigits1 === "00" || lastTwoDigits1 === "15" || lastTwoDigits1 === "30" || lastTwoDigits1 === "45") { - console.log("Last two digits are 00, 15, 30, or 45"); - } else { - Feng.error("智慧场地的可预约时间段是15分钟的倍数") - return; - - } - - - }else { - console.log("===========这是普通球场") - - console.log("====="+data.appointmentStartTime) - var value = data.appointmentStartTime; - var lastTwoDigits = value.slice(-2); - - if (lastTwoDigits === "00" || lastTwoDigits === "30" ) { - console.log("Last two digits are 00, 15, 30, or 45"); - } else { - Feng.info("普通场地可预约时间段需是30分钟的倍数") - return; - } - - - var value1 = data.appointmentEndTime; - var lastTwoDigits1 = value1.slice(-2); - - if (lastTwoDigits1 === "00"|| lastTwoDigits1 === "30" ) { - console.log("Last two digits are 00, 15, 30, or 45"); - } else { - Feng.info("普通场地可预约时间段需是30分钟的倍数") - return; - - } - - - } @@ -322,12 +310,9 @@ var ishalf= $("input[name='ishalf']:checked").val(); data.ishalf= ishalf; - var reservation= $("input[name='reservation']:checked").val(); - data.reservation= reservation; + var halfName=""; if (reservation==1){ - - if(ishalf==1){ let cashPriceOne = $("#cashPriceOne").val() if(cashPriceOne=='' ){ diff --git a/cloud-server-other/src/main/java/com/dsh/other/model/dto/siteDto/TSiteDTO.java b/cloud-server-other/src/main/java/com/dsh/other/model/dto/siteDto/TSiteDTO.java index e1e95e8..5a4befc 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/model/dto/siteDto/TSiteDTO.java +++ b/cloud-server-other/src/main/java/com/dsh/other/model/dto/siteDto/TSiteDTO.java @@ -39,9 +39,11 @@ */ private String siteTypeName; /** - * 城市管理员id + * 城市管理员id 弃用了 */ private Integer cityManagerId; + // 运营商id + private Integer operatorId; /** * 省 */ -- Gitblit v1.7.1