From b79d17d163a1f162190cb46d881ab1fd5957c602 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 06 三月 2024 17:02:07 +0800 Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/PlayPai into 2.0 --- cloud-server-management/src/main/resources/mapper/GateMapper.xml | 34 cloud-server-management/src/main/webapp/static/modular/system/tGoodsAudit/tGoods_info.js | 28 cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/QRCodeUtil.java | 50 cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IStoreService.java | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate_edit.html | 206 ++ cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit1.html | 6 cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/HomeModuleServiceImpl.java | 11 cloud-server-management/src/main/java/com/dsh/course/mapper/HomeModuleMapper.java | 7 cloud-server-other/src/main/resources/mapper/SiteMapper.xml | 2 cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js | 133 + cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Gate.java | 34 cloud-server-management/src/main/webapp/static/modular/system/ball/ball.js | 54 cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit2.html | 6 cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_add.html | 22 cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add.html | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_imgAll.html | 30 cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java | 39 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/HomeModule.java | 91 cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js | 11 cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_benefits.html | 88 cloud-server-other/src/main/java/com/dsh/other/entity/Game.java | 12 cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/Site.java | 5 cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add2.html | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate.html | 51 cloud-server-management/src/main/webapp/static/modular/system/tGoods/TSiteInfo.js | 153 + cloud-server-management/src/main/java/com/dsh/course/mapper/StoreMapper.java | 7 cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit.html | 6 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java | 162 + cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TSiteListOne.html | 123 + cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js | 132 cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_info.html | 6 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java | 58 cloud-server-management/src/main/webapp/WEB-INF/view/system/ticket/ticket_add.html | 42 cloud-server-management/src/main/webapp/static/modular/system/tGoods/TStoreInfo.js | 2 cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js | 168 cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop.html | 4 cloud-server-activity/src/main/java/com/dsh/activity/model/response/StoreVos.java | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_detail_one.html | 89 cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/StoreServiceImpl.java | 5 cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/MyQrCodeUtil.java | 95 + cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java | 38 cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_edit.html | 46 cloud-server-management/src/main/webapp/static/modular/system/tHomeModule/tHomeModule.js | 289 +++ cloud-server-other/src/main/java/com/dsh/other/entity/Site.java | 2 cloud-server-other/src/main/java/com/dsh/other/entity/TGame.java | 2 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java | 36 cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add.html | 2 cloud-server-management/pom.xml | 15 cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PointMercharsClient.java | 3 cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IGateService.java | 23 cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_edit.html | 301 +++ cloud-server-management/src/main/webapp/static/modular/system/tHomeModule/tHomeModule_info.js | 198 ++ cloud-server-management/src/main/resources/mapper/TStoreMapper.xml | 19 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/LoginController.java | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit.html | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate_add.html | 204 ++ cloud-server-management/src/main/webapp/static/modular/system/gate/gate_info.js | 793 ++++++++ cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop.js | 12 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/StoreVos.java | 2 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TSite.java | 2 cloud-server-activity/src/main/java/com/dsh/activity/entity/PointsMerchandiseStore.java | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add1.html | 2 cloud-server-management/src/main/webapp/static/modular/system/ticket/ticket.js | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball.html | 1 cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IHomeModuleService.java | 7 cloud-server-management/src/main/webapp/static/modular/system/gate/gate.js | 489 +++++ cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_config.html | 87 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/HomeModuleController.java | 57 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Game.java | 7 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGateController.java | 630 ++++++ cloud-server-management/src/main/webapp/WEB-INF/view/system/tHomeModule/tHomeModule.html | 311 +++ cloud-server-management/src/main/java/com/dsh/course/mapper/GateMapper.java | 27 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java | 59 cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/GateServiceImpl.java | 28 74 files changed, 5,366 insertions(+), 314 deletions(-) diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java index 97d4f5c..98b3825 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java @@ -10,11 +10,9 @@ import com.dsh.activity.feignclient.course.model.CoursePackagePaymentConfig; import com.dsh.activity.feignclient.model.*; import com.dsh.activity.feignclient.other.OperatorClient; +import com.dsh.activity.feignclient.other.SiteClient; import com.dsh.activity.feignclient.other.StoreClient; -import com.dsh.activity.feignclient.other.model.Store; -import com.dsh.activity.feignclient.other.model.StoreDetailOfCourse; -import com.dsh.activity.feignclient.other.model.StoreInfoDto; -import com.dsh.activity.feignclient.other.model.TOperatorCity; +import com.dsh.activity.feignclient.other.model.*; import com.dsh.activity.model.CoachChangeStateVO; import com.dsh.activity.model.PointMerchandiseIncomeVo; import com.dsh.activity.model.PointMerchandiseVo; @@ -27,6 +25,7 @@ import com.dsh.activity.util.*; import io.swagger.models.auth.In; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -78,6 +77,8 @@ @Resource private CouponCityService ccityService; + @Autowired + private SiteClient siteClient; @Resource @@ -1624,6 +1625,9 @@ case 3: infoOneVo.setExchangeArea("指定门店"); break; + case 4: + infoOneVo.setExchangeArea("指定场地"); + break; default: break; } @@ -1663,12 +1667,16 @@ .eq("pointsMerchandiseId", id)); if (list.size() > 0) { List<Integer> collect = list.stream().map(PointsMerchandiseStore::getStoreId).collect(Collectors.toList()); + List<Integer> collect1 = list.stream().map(PointsMerchandiseStore::getSiteId).collect(Collectors.toList()); List<Store> stores = stoClient.queryStoreByIds(collect); if (stores.size() > 0) { + int a = 0; for (Store store : stores) { StoreVos storeVos1 = new StoreVos(); storeVos1.setNum1(store.getProvince() + "省" + store.getCity() + "市"); - if (store.getOperatorId() == 0) { + if (store.getOperatorId()==null){ + storeVos1.setNum2("平台"); + }else if (store.getOperatorId() == 0) { storeVos1.setNum2("平台"); } else { @@ -1676,12 +1684,18 @@ } storeVos1.setNum3(store.getName()); storeVos1.setNum4(store.getIds()); + if (collect1.get(a)!=null){ + Site site = siteClient.querySiteById(collect1.get(a)); + storeVos1.setNum5(site.getName()); + } + storeVos1.setNum4(store.getIds()); storeVos.add(storeVos1); } } } return storeVos; } + @ResponseBody @@ -1744,6 +1758,20 @@ public Boolean addOther(@RequestBody String pam) { Boolean save = false; String[] split = pam.split("_"); + if (split.length>2){ + if (StringUtils.hasLength(split[2])){ + for (String s : split[2].split(",")) { + PointsMerchandiseStore pointsMerchandiseStore = new PointsMerchandiseStore(); + pointsMerchandiseStore.setPointsMerchandiseId(Integer.valueOf(split[0])); + pointsMerchandiseStore.setSiteId(Integer.valueOf(s)); + Site site = siteClient.querySiteById(Integer.valueOf(s)); + pointsMerchandiseStore.setStoreId(site.getStoreId()); + save = pmdstoService.save(pointsMerchandiseStore); + } + // 这个门票是选择的场地 + return save; + } + } for (String s : split[1].split(",")) { PointsMerchandiseStore pointsMerchandiseStore = new PointsMerchandiseStore(); pointsMerchandiseStore.setPointsMerchandiseId(Integer.valueOf(split[0])); @@ -1753,6 +1781,7 @@ return save; } + @PostMapping("/base/pointMerchars/addCitys") public Boolean addCitys(@RequestBody ArrayList<Map<String, String>> objects) { try { diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/entity/PointsMerchandiseStore.java b/cloud-server-activity/src/main/java/com/dsh/activity/entity/PointsMerchandiseStore.java index 85ed35d..3efebb7 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/entity/PointsMerchandiseStore.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/entity/PointsMerchandiseStore.java @@ -37,6 +37,8 @@ */ @TableField("pointsMerchandiseId") private Integer pointsMerchandiseId; + @TableField("siteId") + private Integer siteId; /** * 门店id */ diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/model/response/StoreVos.java b/cloud-server-activity/src/main/java/com/dsh/activity/model/response/StoreVos.java index 7311866..1756c23 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/model/response/StoreVos.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/model/response/StoreVos.java @@ -16,4 +16,6 @@ String num3; String num4; + // 场地名称 + String num5; } diff --git a/cloud-server-management/pom.xml b/cloud-server-management/pom.xml index eb3daa9..8568baa 100644 --- a/cloud-server-management/pom.xml +++ b/cloud-server-management/pom.xml @@ -14,6 +14,21 @@ <name>管理后台</name> <description>管理后台</description> <dependencies> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>5.3.9</version> + </dependency> + <dependency> + <groupId>com.google.zxing</groupId> + <artifactId>core</artifactId> + <version>3.4.1</version> + </dependency> + <dependency> + <groupId>com.google.zxing</groupId> + <artifactId>javase</artifactId> + <version>3.4.1</version> + </dependency> <!--处理json--> <dependency> <groupId>org.json</groupId> diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PointMercharsClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PointMercharsClient.java index 050a5a3..b29a0a4 100644 --- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PointMercharsClient.java +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/PointMercharsClient.java @@ -87,6 +87,9 @@ @PostMapping("/base/pointMerchars/addOther") Boolean addOther(@RequestBody String pam); + @PostMapping("/base/pointMerchars/addOther1") + Boolean addOther1(@RequestBody String pam1); + @PostMapping("/base/pointMerchars/addCitys") Boolean addCitys(@RequestBody List<Map<String, String>> objects); diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/Site.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/Site.java index d8d1dcf..177c8c0 100644 --- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/Site.java +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/Site.java @@ -129,6 +129,7 @@ private String imgs; @TableField("ids") private String ids; - - + // 是否可预约 0否1是 + @TableField("reservation") + private Integer reservation; } diff --git a/cloud-server-management/src/main/java/com/dsh/course/mapper/GateMapper.java b/cloud-server-management/src/main/java/com/dsh/course/mapper/GateMapper.java new file mode 100644 index 0000000..f2840ba --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/course/mapper/GateMapper.java @@ -0,0 +1,27 @@ +package com.dsh.course.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.dsh.course.dto.JsDto; +import com.dsh.guns.modular.system.model.*; +import com.dsh.guns.modular.system.model.dto.SelectDto; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @author zhibing.pu + * @date 2023/7/6 16:51 + */ +public interface GateMapper extends BaseMapper<Gate> { + + + List<Map<String, Object>> listAll(@Param("name")String name, + @Param("device")String device, + @Param("operatorName")String operatorId, + @Param("storeName")String storeId, + @Param("storeIds")List<Integer> storeIds, + @Param("page")Page<Map<String, Object>> page); + +} diff --git a/cloud-server-management/src/main/java/com/dsh/course/mapper/HomeModuleMapper.java b/cloud-server-management/src/main/java/com/dsh/course/mapper/HomeModuleMapper.java new file mode 100644 index 0000000..0183ede --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/course/mapper/HomeModuleMapper.java @@ -0,0 +1,7 @@ +package com.dsh.course.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dsh.guns.modular.system.model.HomeModule; + +public interface HomeModuleMapper extends BaseMapper<HomeModule> { +} diff --git a/cloud-server-management/src/main/java/com/dsh/course/mapper/StoreMapper.java b/cloud-server-management/src/main/java/com/dsh/course/mapper/StoreMapper.java index 3d5f97e..e5c79f1 100644 --- a/cloud-server-management/src/main/java/com/dsh/course/mapper/StoreMapper.java +++ b/cloud-server-management/src/main/java/com/dsh/course/mapper/StoreMapper.java @@ -85,4 +85,11 @@ List<Map<String, Object>> listStoreAllByIds(@Param("ids") List<Integer> ids); + List<Map<String, Object>> querySiteListOfpage(@Param("provinceCode") String provinceCode, + @Param("cityCode") String cityCode, + @Param("operatorId") Integer operatorId, + @Param("storeName") String storeName, + @Param("page") Page<Map<String, Object>> page); + + } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/HomeModuleController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/HomeModuleController.java new file mode 100644 index 0000000..5b3f135 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/HomeModuleController.java @@ -0,0 +1,57 @@ +package com.dsh.guns.modular.system.controller.code; + + +import com.dsh.course.feignClient.other.model.Banner; +import com.dsh.guns.config.UserExt; +import com.dsh.guns.modular.system.model.HomeModule; +import com.dsh.guns.modular.system.service.IHomeModuleService; +import com.dsh.guns.modular.system.service.IStoreService; +import com.dsh.guns.modular.system.util.ResultUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +@Controller +@RequestMapping("/tHomeModule") +public class HomeModuleController { + + @Autowired + private IHomeModuleService homeModuleService; + @Autowired + private IStoreService storeService; + + private String PREFIX = "/system/tHomeModule/"; + + + @RequestMapping("/tHomeModule_platformSet/{id}") + public String tHomeModulePlatformSet(@PathVariable Integer id, Model model) { + HomeModule data = homeModuleService.getById(id); + List<Map<String, Object>> pages = storeService.typeChange(data.getModel()); + List<Map<String, Object>> types = storeService.typeChangeOne(data.getJumpPage()); + // type=1 查看详情 type=2 编辑 + model.addAttribute("type",2); + Integer roleType = UserExt.getUser().getObjectType(); + model.addAttribute("roleType",roleType); + model.addAttribute("data",data); + model.addAttribute("pages",pages); + model.addAttribute("types",types); + return PREFIX + "tHomeModule.html"; + } + + @ResponseBody + @RequestMapping("/updateHomeModule") + public ResultUtil updateAdvertisement(@RequestBody HomeModule homeModule) { + if (homeModule.getType().equals("请选择")){ + homeModule.setType(null); + } + if (homeModule.getPage().equals("请选择")){ + homeModule.setPage(null); + } + return ResultUtil.success(homeModuleService.updateById(homeModule)); + } + +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java index d632d4f..1fe189b 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java @@ -213,8 +213,40 @@ } } } - - + } + } + return storeList; + } + // 查询场地列表 + @RequestMapping("/siteDetailsOfSearch") + @ResponseBody + public Object siteDetailsOfSearch(String provinceId,String cityId,Integer operatorId,String storeName){ + if (UserExt.getUser().getObjectType()== 2){ + // 筛选这个运营商下的门店 + operatorId = UserExt.getUser().getObjectId(); + } + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + List<Map<String,Object>> storeList = storeService.querySiteListOfpage(provinceId,cityId,operatorId,storeName,page); + if (storeList.size() > 0 ){ + for (Map<String, Object> stringObjectMap : storeList) { + String provinceName = (String) stringObjectMap.get("province"); + String cityName = (String) stringObjectMap.get("city"); + stringObjectMap.put("provinceCity",provinceName+cityName); + Integer managerId = (Integer) stringObjectMap.get("operatorId"); + if (managerId == null){ + stringObjectMap.put("accountName","平台"); + }else{ + if (managerId==0){ + stringObjectMap.put("accountName","平台"); + }else{ + TOperator operator = operatorService.getOne(new QueryWrapper<TOperator>().eq("id", managerId)); + if (ToolUtil.isNotEmpty(operator)){ + stringObjectMap.put("accountName",operator.getName()); + }else{ + stringObjectMap.put("accountName","平台"); + } + } + } } } return storeList; diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGateController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGateController.java new file mode 100644 index 0000000..2d955d3 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGateController.java @@ -0,0 +1,630 @@ +package com.dsh.guns.modular.system.controller.code; + + +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.AppUserClient; +import com.dsh.course.feignClient.account.CityManagerClient; +import com.dsh.course.feignClient.account.StoreStaffClient; +import com.dsh.course.feignClient.account.model.CityManager; +import com.dsh.course.feignClient.account.model.QueryByNamePhone; +import com.dsh.course.feignClient.account.model.TAppUser; +import com.dsh.course.feignClient.account.model.TStoreStaff; +import com.dsh.course.feignClient.activity.CouponClient; +import com.dsh.course.feignClient.activity.PointMercharsClient; +import com.dsh.course.feignClient.activity.model.*; +import com.dsh.guns.config.UserExt; +import com.dsh.guns.core.base.tips.SuccessTip; +import com.dsh.guns.core.common.constant.factory.PageFactory; +import com.dsh.guns.core.util.ToolUtil; +import com.dsh.guns.modular.system.model.*; +import com.dsh.guns.modular.system.service.*; +import com.dsh.guns.modular.system.util.HttpRequestUtil; +import com.dsh.guns.modular.system.util.OBSUploadUtil; +import com.dsh.guns.modular.system.util.ResultUtil; +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.sun.org.apache.bcel.internal.generic.NEW; +import io.swagger.models.auth.In; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + + +/** + * 闸机管理 控制器 + */ + +@Controller +@RequestMapping("/gate") +public class TGateController { + private String PREFIX = "/system/gate/"; + @Resource + private IRegionService regiService; + @Resource + private IStoreService storeService; + + @Resource + private CouponClient client; + + @Resource + private CityManagerClient cmgrClient; + + @Autowired + private AppUserClient appUserClient; + @Autowired + private ICityService cityService; + + @Resource + private PointMercharsClient pointMercharsClient; + @Autowired + private StoreStaffClient storeStaffClient; + @Autowired + private IGateService gateService; + @Autowired + private TOperatorService tOperatorService; + @Autowired + private ITSiteService siteService; + + /** + * 跳转到优惠券管理首页 + */ + @RequestMapping("") + public String index(Model model) { + return PREFIX + "gate.html"; + } + /** + * 跳转到添加 + */ + @RequestMapping("/add") + public String add(Model model) { + Integer objectType = UserExt.getUser().getObjectType(); + model.addAttribute("userType",objectType); + System.out.println(objectType); + List<TOperator> list1 = tOperatorService.list(); + model.addAttribute("yysList",list1); + if (UserExt.getUser().getObjectType()==1) { + List<TStore> list = storeService.list(new QueryWrapper<TStore>() + .eq("operatorId", 0) + .ne("state", 3)); + model.addAttribute("storeList",list); + } + if (UserExt.getUser().getObjectType()==2){ + List<TStore> list2 = storeService.list(new QueryWrapper<TStore>() + .eq("operatorId", UserExt.getUser().getObjectId()) + .ne("state", 3)); + model.addAttribute("storeList",list2); + model.addAttribute("operatorId",UserExt.getUser().getObjectId()); + } + if (UserExt.getUser().getObjectType()==3){ + List<TStore> list3 = new ArrayList<>(); + TStore byId = storeService.getById(UserExt.getUser().getObjectId()); + list3.add(byId); + Integer operatorId = byId.getOperatorId(); + if (operatorId==null){ + model.addAttribute("operatorId",0); + }else if (operatorId==0){ + model.addAttribute("operatorId",0); + }else{ + model.addAttribute("operatorId",byId.getOperatorId()); + } + model.addAttribute("storeList",list3); + model.addAttribute("storeId",UserExt.getUser().getObjectId()); + // 查询场地列表 + List<TSite> siteList = siteService.list(new QueryWrapper<TSite>() + .eq("storeId", UserExt.getUser().getObjectId()) + .ne("state",3)); + model.addAttribute("siteList",siteList); + } + + + return PREFIX + "gate_add.html"; + } + + /** + * 添加门禁接口 + */ + @RequestMapping("/addDevice") + @ResponseBody + public Object addDevice(String name,Integer operatorId,Integer storeId,Integer siteId,String device) { + Gate gate = new Gate(); + gate.setName(name); + gate.setDevice(device); + gate.setStoreId(storeId); + gate.setSiteId(siteId); + gate.setOperatorId(operatorId); + + HashMap<String, String> map = new HashMap<>(); + map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); + map.put("space_id",""+storeId); + map.put("device_id",device); + map.put("region_id",""+siteId); + // 添加门禁 + String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); + System.out.println(s1); + Gson gson = new Gson(); + // 解析请求结果,json: + JsonObject jsonObject = gson.fromJson(s1, JsonObject.class); + if (!jsonObject.get("code").toString().equals("200")){ + return ResultUtil.error(""+jsonObject.get("message").getAsString()); + } + JsonObject data = jsonObject.getAsJsonObject("data"); + int device_id = data.get("device_id").getAsInt(); + gate.setId(device_id); + gateService.save(gate); + return new SuccessTip<>(); + } + /** + * 编辑门禁接口 + */ + @RequestMapping("/updateDevice") + @ResponseBody + public Object updateDevice(Integer id,String name,Integer operatorId,Integer storeId,Integer siteId,String device) { + Gate gate = gateService.getById(id); + gate.setName(name); + gate.setDevice(device); + gate.setStoreId(storeId); + gate.setSiteId(siteId); + gate.setOperatorId(operatorId); + HashMap<String, String> map = new HashMap<>(); + map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); + map.put("space_id",""+storeId); + map.put("device_id",device); + map.put("region_id",""+siteId); + // 添加门禁 + String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/editDevice/ids/"+id, map); + System.out.println(s1); + Gson gson = new Gson(); + // 解析请求结果,json: + JsonObject jsonObject = gson.fromJson(s1, JsonObject.class); + if (!jsonObject.get("code").toString().equals("200")){ + return ResultUtil.error(""+jsonObject.get("message").getAsString()); + } + gateService.updateById(gate); + return new SuccessTip<>(); + } + /** + * 删除门禁接口 + */ + @RequestMapping("/deleteDevice") + @ResponseBody + public Object add(Integer gateId) { + Gate byId = gateService.getById(gateId); + byId.setIsDelete(1); + HashMap<String, String> map = new HashMap<>(); + map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); + // 添加门禁 + String s1 = HttpRequestUtil.postRequest + ("https://try.daowepark.com/v7/user_api/general/deleteDevice/ids/"+gateId, map); + + System.out.println(s1); + Gson gson = new Gson(); + // 解析请求结果,json: + JsonObject jsonObject = gson.fromJson(s1, JsonObject.class); + if (!jsonObject.get("code").toString().equals("200")){ + return ResultUtil.error(""+jsonObject.get("message").getAsString()); + } + gateService.updateById(byId); + return new SuccessTip<>(); + } + /** + * + * @param id + * @param model + * @return + */ + @RequestMapping("/update/{id}") + public String update(@PathVariable("id") Integer id,Model model) { + model.addAttribute("id",id); + Gate byId = gateService.getById(id); + model.addAttribute("id",id); + model.addAttribute("data",byId); + Integer objectType = UserExt.getUser().getObjectType(); + model.addAttribute("userType",objectType); + System.out.println(objectType); + List<TOperator> list1 = tOperatorService.list(); + model.addAttribute("yysList",list1); + if (UserExt.getUser().getObjectType()==1) { + List<TStore> list = storeService.list(new QueryWrapper<TStore>() + .eq("operatorId", 0) + .ne("state", 3)); + model.addAttribute("storeList",list); + List<TSite> siteList = siteService.list(new QueryWrapper<TSite>() + .eq("storeId", byId.getStoreId()) + .ne("state",3)); + model.addAttribute("siteList",siteList); + } + if (UserExt.getUser().getObjectType()==2){ + List<TStore> list2 = storeService.list(new QueryWrapper<TStore>() + .eq("operatorId", UserExt.getUser().getObjectId()) + .ne("state", 3)); + model.addAttribute("storeList",list2); + model.addAttribute("operatorId",UserExt.getUser().getObjectId()); + List<TSite> siteList = siteService.list(new QueryWrapper<TSite>() + .eq("storeId", byId.getStoreId()) + .ne("state",3)); + model.addAttribute("siteList",siteList); + } + if (UserExt.getUser().getObjectType()==3){ + List<TStore> list3 = new ArrayList<>(); + TStore byId1 = storeService.getById(UserExt.getUser().getObjectId()); + list3.add(byId1); + Integer operatorId = byId1.getOperatorId(); + if (operatorId==null){ + model.addAttribute("operatorId",0); + }else if (operatorId==0){ + model.addAttribute("operatorId",0); + }else{ + model.addAttribute("operatorId",byId1.getOperatorId()); + } + model.addAttribute("storeList",list3); + model.addAttribute("storeId",UserExt.getUser().getObjectId()); + // 查询场地列表 + List<TSite> siteList = siteService.list(new QueryWrapper<TSite>() + .eq("storeId", UserExt.getUser().getObjectId()) + .ne("state",3)); + model.addAttribute("siteList",siteList); + } + return PREFIX + "gate_edit.html"; + } + + + /** + * 获取闸机列表 + */ + @RequestMapping(value = "/listAll") + @ResponseBody + public Object listAll(String name,String device,String operatorName, + String storeName) { + Page<Map<String,Object>> page = new PageFactory<Map<String,Object>>().defaultPage(); + List<Integer> storeIds = new ArrayList<>(); + if (UserExt.getUser().getObjectType()==2){ + // 查询这个运营商下的所有门店 + List<Integer> ids = storeService.list(new QueryWrapper<TStore>() + .eq("operatorId", UserExt.getUser().getObjectId())).stream().map(TStore::getId) + .collect(Collectors.toList()); + if (ids.size()==0){ + storeIds.add(-1); + }else{ + storeIds.addAll(ids); + } + } + if (UserExt.getUser().getObjectType()==3){ + storeIds.add(UserExt.getUser().getObjectId()); + } + List<Map<String,Object>> res = gateService.listAll(name,device,operatorName,storeName,storeIds,page); + return res; + } + + /** + * 根据运营商id获取门店列表 + + */ + @RequestMapping(value = "/getStore") + @ResponseBody + public List<TStore> getStore(Integer operatorId) { + List<TStore> list = storeService.list(new QueryWrapper<TStore>() + .eq("operatorId", operatorId) + .ne("state", 3)); + return list; + + } + /** + * 根据门店id获取场地列表 + + */ + @RequestMapping(value = "/getSite") + @ResponseBody + public List<TSite> getSite(Integer storeId) { + List<TSite> list = siteService.list(new QueryWrapper<TSite>() + .eq("storeId", storeId) + .ne("state", 3)); + return list; + } + /** + * 跳转到门店管理列表页 + */ + @RequestMapping("/storeList") + public String storePage(Model model) { + return PREFIX + "TStoreList.html"; + } + @RequestMapping("/updateType") + @ResponseBody + public Object updateType(Long id) { + client.updateType(id); + return new SuccessTip<>(); + } + + @RequestMapping("/storeDetailsOfSearch") + @ResponseBody + public Object listOfStore(Integer provinceId,Integer cityId,Integer cityManagerId,String storeName){ + System.out.println("provinceId"+provinceId); + System.out.println("cityId"+cityId); + System.out.println("cityManagerId"+cityManagerId); + System.out.println("storeName"+storeName); + String provinceCode = null; + String cityCode = null; + if (ToolUtil.isNotEmpty(provinceId)){ + Region provinceRegion = regiService.getById(provinceId); + provinceCode = provinceRegion.getCode(); + } + if (ToolUtil.isNotEmpty(cityId)){ + Region cityRegion = regiService.getById(cityId); + cityCode = cityRegion.getCode(); + } + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + List<Map<String,Object>> storeList = storeService.queryListOfpage(provinceCode,cityCode,cityManagerId,storeName,page); + if (storeList.size() > 0 ){ + for (Map<String, Object> stringObjectMap : storeList) { + String provinceName = (String) stringObjectMap.get("province"); + String cityName = (String) stringObjectMap.get("city"); + stringObjectMap.put("provinceCity",provinceName+cityName); + Integer managerId = (Integer) stringObjectMap.get("cityManagerId"); + CityManager cityManager = cmgrClient.queryCityManagerById(managerId); + if (ToolUtil.isNotEmpty(cityManager)){ + stringObjectMap.put("accountName",cityManager.getName()+"+"+cityManager.getPhone()); + } + } + } + return storeList; + } + + @RequestMapping(value = "/listRecord") + @ResponseBody + public Object listRecord(Integer id,String name, Integer type, String phone) { + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + List<TAppUser> tAppUsers = appUserClient.queryByNamePhone(new QueryByNamePhone(name, phone)); + if(tAppUsers.size()==0){ + return new ArrayList<>(); + } + CouponRecordQuery ofSearch = new CouponRecordQuery(); + ofSearch.setId(id); + ofSearch.setLimit(page.getSize()); + ofSearch.setOffset(page.getCurrent()); + ofSearch.setIds(tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList())); + ofSearch.setType(type); + List<Map<String, Object>> maps = client.listRecord(ofSearch); + for (Map<String, Object> map : maps) { + map.put("id",map.get("id").toString()); + for (TAppUser tAppUser : tAppUsers) { + if(map.get("userId").equals(tAppUser.getId())){ + map.put("name",tAppUser.getName()); + map.put("phone",tAppUser.getPhone()); + } + } + } + return maps; + } + + @RequestMapping(value = "/getProvince") + @ResponseBody + public Object getProvince(){ + return regiService.list(new LambdaQueryWrapper<Region>() + .eq(Region::getParentId,0)); + } + + @RequestMapping(value = "/onShelf") + @ResponseBody + public Object onShelf(Integer id,Integer type){ + Coupon coupon = client.queryCouponById(id); + coupon.setState(type); + client.updateCouponData(coupon); + return new SuccessTip<>(); + } + + + @RequestMapping(value = "/getCity") + @ResponseBody + public Object getCity(Integer province){ + return regiService.list(new LambdaQueryWrapper<Region>() + .eq(Region::getParentId,province)); + } + + @RequestMapping(value = "/uploadPic") + @ResponseBody + public Object add(@RequestParam("file") MultipartFile imgFile) throws IOException { + String originalFilename = imgFile.getOriginalFilename(); + String newName = originalFilename.substring(imgFile.getOriginalFilename().lastIndexOf(".")); + String url = OBSUploadUtil.inputStreamUpload(imgFile); + Map<String, String> map = new HashMap<String, String>(); + //是否上传成功 + map.put("state", "SUCCESS"); + //现在文件名称 + map.put("title", newName); + //文件原名称 + map.put("original", originalFilename); + //文件类型 .+后缀名 + map.put("type", originalFilename.substring(imgFile.getOriginalFilename().lastIndexOf("."))); + //文件路径 + map.put("url", url); + //文件大小(字节数) + map.put("size", imgFile.getSize() + ""); + System.out.println(map); + return url; + } + + /** + * 提交添加 + */ + @PostMapping(value = "/commitData") + @ResponseBody + public Object commitData( CouponDataVo dataVo){ + System.out.println(dataVo); + Integer objectType = UserExt.getUser().getObjectType(); + dataVo.setUserType(objectType); + client.insertIntoData(dataVo); + return new SuccessTip<>(); + } + @PostMapping(value = "/update") + @ResponseBody + public Object update( Integer id,Integer num,Integer num1,String text){ + Coupon coupon = client.queryCouponById(id); + coupon.setQuantityIssued(num); + coupon.setPickUpQuantity(num1); + coupon.setIllustrate(text); + client.updateCouponData(coupon); + return new SuccessTip<>(); + } + + + /** + * 获取 积分商品列表 + */ + @RequestMapping(value = "/list") + @ResponseBody + public Object listOfIntegralGoods(String name, Integer type, Integer redemptionMethod , Integer userPopulation, Integer activeStatus, Integer state) { + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + + IntegralGoodsOfSearch ofSearch = new IntegralGoodsOfSearch(); + ofSearch.setPage(page); + ofSearch.setName(name); + ofSearch.setType(type); + ofSearch.setRedemptionMethod(redemptionMethod); + ofSearch.setUserPopulation(userPopulation); + ofSearch.setActiveStatus(activeStatus); + ofSearch.setState(state); + System.out.println(ofSearch); + return pointMercharsClient.getIntegralGoodsListOfSearch(ofSearch); + } + + + + /** + * 跳转到修改车辆管理 + */ + @RequestMapping("/tGoods_update/{id}") + public String tCityUpdate(@PathVariable Integer id, Model model) { + System.out.println("id:"+id); + PointMercharsVo pointMercharsVo = pointMercharsClient.queryPointMerchaseDetailOfId(id); + System.out.println("pointMercharsVo:"+pointMercharsVo); + String[] split = pointMercharsVo.getPics().split(","); + model.addAttribute("item",pointMercharsVo); + model.addAttribute("pictures",split); + return PREFIX + "TGoods_edit.html"; + } + + /** + * 上下架处理操作 + * @param id 商品id + * @param type 1=上架操作 2=下架操作 + * @return + */ + @RequestMapping("/grounding") + @ResponseBody + public Object updateGrounding(Integer id,Integer type) { + System.out.println(id); + System.out.println(type); + Map<String,Integer> map = new HashMap<>(); + map.put("id",id); + map.put("type",type); + boolean b = pointMercharsClient.updateGoodsGroudingStatus(map); + System.out.println(b); + return new SuccessTip<>(); + } + /** + * 上下架处理操作 + * @return + */ + @RequestMapping("/writeOff") + @ResponseBody + public Object writeOff(String id) { + Long aLong = Long.valueOf(id); + WriteOffDTO dto = new WriteOffDTO(); + // 核销人员id + Integer objectId = UserExt.getUser().getId(); + if (UserExt.getUser().getObjectType() == 1){ + dto.setVerifiStoreId(null); + }else if (UserExt.getUser().getObjectType() == 2){ + storeService.getOne(new QueryWrapper<TStore>().eq("cityManagerId",objectId)); + }else{ + TStoreStaff storeByStoreStaffId = storeStaffClient.getStoreByStoreStaffId(objectId); + dto.setVerifiStoreId(storeByStoreStaffId.getStoreId()); + } + dto.setId(aLong); + dto.setVerificationUserId(objectId); + pointMercharsClient.writeOff(dto); + return new SuccessTip<>(); + } + + /** + * 购买详情 + * @param id 商品id + * @return + */ + @RequestMapping("/tPay_detail/{id}") + public String payOfDetails(@PathVariable(value = "id") Integer id,Model model) { + System.out.println(id); + model.addAttribute("id",id); + return PREFIX + "TGoods_pay.html"; + } + + + /** + * 获取 购买记录列表 + */ + @ResponseBody + @RequestMapping(value = "/payList/{id}") + public Object payList(@PathVariable(value = "id") Integer id, String name, String phone, Integer status) { + PointMercharsPayedVo payedVo = new PointMercharsPayedVo(); + payedVo.setId(id); + payedVo.setName(name); + payedVo.setPhone(phone); + payedVo.setStatus(status); + List<Map<String,Object>> points = pointMercharsClient.queryUserPayedGoodsList(payedVo); + System.out.println(points); + if (points.size() > 0 ){ + for (Map<String, Object> point : points) { + Integer userId = (Integer) point.get("userId"); + TAppUser tAppUser = appUserClient.queryById(userId); + if (ToolUtil.isNotEmpty(tAppUser)){ + point.put("name",tAppUser.getName()); + point.put("phone",tAppUser.getPhone()); + } + } + if (ToolUtil.isNotEmpty(name)){ + points = points.stream() + .filter(data -> { + String obtName = (String) data.get("name"); + return obtName != null && obtName.contains(name); + }) + .collect(Collectors.toList()); + } + if (ToolUtil.isNotEmpty(phone)){ + points = points.stream() + .filter(data -> { + String obtPhone = (String) data.get("phone"); + return obtPhone != null && obtPhone.contains(phone); + }) + .collect(Collectors.toList()); + } + } + return points; + } + + /** + * 核销操作 + * @param id 商品id + * @return + */ + @RequestMapping("/write_off") + @ResponseBody + public Object GoodsWriteOff(Integer id){ + System.out.println(id); + return new SuccessTip<>(); + } + + +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java index d488504..51ed32e 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java @@ -27,10 +27,12 @@ import com.dsh.guns.modular.system.service.ICityService; import com.dsh.guns.modular.system.service.IRegionService; import com.dsh.guns.modular.system.service.IStoreService; +import com.dsh.guns.modular.system.service.ITSiteService; import com.dsh.guns.modular.system.util.OBSUploadUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -59,7 +61,8 @@ @Resource private IRegionService regiService; - + @Autowired + private ITSiteService siteService; @Resource private IStoreService storeService; @@ -168,25 +171,24 @@ List<StoreVos> storeVos = pointMercharsClient.getStoreList(id); model.addAttribute("store",storeVos); } + // 门票选的指定场地 + if (infoOneVo.getUseScope() == 4){ + List<StoreVos> storeVos = pointMercharsClient.getStoreList(id); + model.addAttribute("sites",storeVos); + } model.addAttribute("pictures",list); model.addAttribute("exchangeMethod",infoOneVo.getExchangeMethod()); return PREFIX + "TGoods_detail_one.html"; } - - } - @RequestMapping("/coupon_record/{id}") public String memberCouponAdd(@PathVariable Integer id,Model model) { Coupon coupon = client.queryCouponById(id); - model.addAttribute("id",id); model.addAttribute("type",coupon.getType()); return PREFIX + "TCouponRecord.html"; } - - @RequestMapping("/coupon_detail/{id}") public String memberCouponDetail(@PathVariable Integer id,Model model) { @@ -265,6 +267,13 @@ List<TCity> provinceList = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); model.addAttribute("list",provinceList); return PREFIX + "TStoreListOne.html"; + } + // 场地列表 + @RequestMapping("/siteList1") + public String storePage2(Model model) { + List<TCity> provinceList = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); + model.addAttribute("list",provinceList); + return PREFIX + "TSiteListOne.html"; } @RequestMapping("/updateType") @ResponseBody @@ -449,7 +458,7 @@ @ResponseBody public Object add( Integer typeAll,String provinceCode,String cityCode,Integer storeId,Integer coursePackageTypeId,Integer coursePackageId,Integer coursePackageConfigId, Double price,Integer type,Integer integral,Double cash,String cover,String imgOne,Integer userPopulation,Integer quantityIssued,Integer pickUpQuantity, - String startTime,String text,Integer sort,String name,Integer useScope,String cityIds,String storeIds,Integer cardType + String startTime,String text,Integer sort,String name,Integer useScope,String cityIds,String storeIds,String sites,Integer cardType ) throws ParseException { // 判断当前选择的课包 是不是假期课 然后判断选择的有效期是否在假期课有效期内 if (coursePackageId!=null){ @@ -528,10 +537,17 @@ objects.add(map); } pointMercharsClient.addCitys(objects); - }else if(useScope==3){ + }else if(useScope==3||useScope==4){ if(UserExt.getUser().getObjectType()==3){ storeIds=UserExt.getUser().getObjectId().toString(); } + if (useScope==4){ + storeIds =""; + } + if (useScope==3){ + sites =""; + } + if (StringUtils.hasLength(storeIds)){ Integer oid=null; String[] split = storeIds.split(","); for (int i = 0; i < split.length; i++) { @@ -544,11 +560,30 @@ return "5003"; } } + } + + if (StringUtils.hasLength(sites)){ + Integer oid=null; + String[] split = storeIds.split(","); + for (int i = 0; i < split.length; i++) { + if(i==0){ + Integer operatorId = siteService.getById(split[0]).getOperatorId(); + oid=operatorId; + } + Integer operatorId = siteService.getById(split[i]).getOperatorId(); + if(oid!=operatorId){ + return "5004"; + } + } + } + Integer id = pointMercharsClient.add(pointsMerchandise); - String pam = id+"_"+storeIds; - // 添加多个城市 门店 + + String pam = id+"_"+storeIds+"_"+sites; + // 添加多个城市 门店 场地 try{ pointMercharsClient.addOther(pam); + }catch (Exception e){ e.printStackTrace(); @@ -557,10 +592,8 @@ Integer id = pointMercharsClient.add(pointsMerchandise); } }else { - // ? pointsMerchandise.setShelves(storeId); pointsMerchandise.setUseScope(3); - Integer id = pointMercharsClient.add(pointsMerchandise); } return new SuccessTip<>(); diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java index e86fe36..0e5b648 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java @@ -29,6 +29,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -93,8 +94,10 @@ model.addAttribute("id",id); return PREFIX + "TShop_add_device.html"; } + @RequestMapping("/addDevice") public Object addDevice(Integer id,String device) { + // 应该是不用他了 HashMap<String, String> map = new HashMap<>(); map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); map.put("space_id",id.toString()); @@ -102,10 +105,30 @@ map.put("city_code",""); // 添加门禁 String s1 = HttpRequestUtil.postRequest - ("https://try.daowepark.com/v7/user_api/general/addSpaceSutu", map); + ("https://try.daowepark.c" + + "om/v7/user_api/general/addSpaceSutu", map); return SUCCESS_TIP; } + public static void main(String[] args) { +// HashMap<String, String> map = new HashMap<>(); +// map.put("page","1"); +// map.put("space_id","2010"); +// // 获取门禁列表 +// String s1 = HttpRequestUtil.getRequest +// ("https://try.daowepark.com/v7/user_api/general/getDevice", map); +// System.err.println(s1); + + HashMap<String, String> map = new HashMap<>(); + map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); + map.put("space_id","1"); + map.put("device_id","1"); + map.put("region_id","2010"); + // 获取门禁列表 + String s1 = HttpRequestUtil.getRequest + ("https://try.daowepark.com/v7/user_api/general/getDevice", map); + System.err.println(s1); + }; /** * 跳转到车辆管理首页 */ @@ -369,6 +392,7 @@ User byId1 = userMapper.selectById(byId.getStoreStaffId()); model.addAttribute("city",byId1); model.addAttribute("type",0); + return PREFIX + "TShop_edit.html"; } @RequestMapping("/tShop_gift/{id}") @@ -397,6 +421,8 @@ StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8)); model.addAttribute("c8",c8); model.addAttribute("id",id); + StoreConfig c9 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,9)); + model.addAttribute("c9",c9); return PREFIX + "TShop_imgAll.html"; } @@ -565,7 +591,7 @@ storeConfigs.add(storeConfig); } storeConfigService.saveBatch(storeConfigs); - + // 废弃添加门店时 添加闸机 // HashMap<String, String> mapSite = new HashMap<>(); // mapSite.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); // mapSite.put("name",tStore.getName()); @@ -686,9 +712,9 @@ } @RequestMapping(value = "/saveImgAll") @ResponseBody - public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8, - String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8, - Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8) { + public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8,Integer px9, + String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8,String c9, + Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8,Integer r9) { try { ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); StoreConfig collect1 = collect(id, px1, r1, c1, 1); @@ -707,6 +733,8 @@ storeConfigs.add(collect6); storeConfigs.add(collect7); storeConfigs.add(collect8); + StoreConfig collect9 = collect(id, px9, r9, c9, 9); + storeConfigs.add(collect9); storeConfigService.updateBatchById(storeConfigs); return new SuccessTip<>(); }catch (Exception e){ 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 afe92a2..53fc4ec 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 @@ -481,7 +481,6 @@ map.put("space_id",store.getId().toString()); String s = HttpRequestUtil.postRequest ("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); - // 添加门禁 JSONObject jsonObject = JSONObject.parseObject(s); JSONObject data = jsonObject.getJSONObject("data"); String area_id = data.getString("area_id"); @@ -489,17 +488,7 @@ site.setId(integer); Integer integer1 = siteClient.addSite1(site); // Integer integer = Integer.valueOf(spaceId); - if(StringUtils.hasLength( site.getIds())) { - for (String s1 : site.getIds().split(",")) { - HashMap<String, String> map1 = new HashMap<>(); - map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); - map1.put("space_id", store.getId().toString() + ""); - map1.put("device_id", s1); - map1.put("region_id", integer1 + ""); - String s2 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); - System.out.println("添加闸机:" + s2); - } - } + return ResultUtil.success("添加成功"); } /** @@ -532,27 +521,30 @@ site.setState(1); siteClient.addSite(site); - String ids = byId.getIds(); - HashMap<String, String> map = new HashMap<>(); - map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); - if(StringUtils.hasLength(ids)) { - for (String s : ids.split(",")) { - String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/deleteDevice/ids/" + s, map); - System.out.println(s1); - } - } - if(StringUtils.hasLength( site.getIds())) { - for (String s : site.getIds().split(",")) { - HashMap<String, String> map1 = new HashMap<>(); - map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); - map1.put("space_id", store.getId() + ""); - map1.put("device_id", s); - map1.put("region_id", site.getId() + ""); - // 添加门禁 - String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); - System.out.println(s1); - } - } + /** + * 取消闸机输入 新增模块闸机管理 + */ +// String ids = byId.getIds(); +// HashMap<String, String> map = new HashMap<>(); +// map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); +// if(StringUtils.hasLength(ids)) { +// for (String s : ids.split(",")) { +// String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/deleteDevice/ids/" + s, map); +// System.out.println(s1); +// } +// } +// if(StringUtils.hasLength( site.getIds())) { +// for (String s : site.getIds().split(",")) { +// HashMap<String, String> map1 = new HashMap<>(); +// map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); +// map1.put("space_id", store.getId() + ""); +// map1.put("device_id", s); +// map1.put("region_id", site.getId() + ""); +// // 添加门禁 +// String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); +// System.out.println(s1); +// } +// } 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 0f4ba14..904f26c 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 @@ -20,6 +20,7 @@ import com.dsh.course.feignClient.other.SiteClient; import com.dsh.course.feignClient.other.model.Site; import com.dsh.course.service.TGameConfigService; +import com.dsh.course.util.UUIDUtil; import com.dsh.guns.config.UserExt; import com.dsh.guns.core.base.controller.BaseController; import com.dsh.guns.core.util.ToolUtil; @@ -27,20 +28,38 @@ import com.dsh.guns.modular.system.model.*; import com.dsh.guns.modular.system.model.dto.*; import com.dsh.guns.modular.system.service.*; -import com.dsh.guns.modular.system.util.DateComparisonExample; -import com.dsh.guns.modular.system.util.HttpRequestUtil; -import com.dsh.guns.modular.system.util.ResultUtil; +import com.dsh.guns.modular.system.util.*; import com.dsh.course.entity.SiteLock; +import com.google.gson.Gson; +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.WriterException; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.QRCodeWriter; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import org.apache.commons.fileupload.FileItem; +import org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream; import org.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ByteArrayResource; +import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.commons.CommonsMultipartFile; import javax.annotation.Resource; +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; import java.math.BigDecimal; +import java.nio.file.FileSystems; +import java.nio.file.Path; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; @@ -215,7 +234,47 @@ return ResultUtil.success(); } +// public static void main(String[] args) { +// // 添加sutu编号 +// HashMap<String, String> map3 = new HashMap<>(); +// // 添加sutu编号 +// // 添加门禁 红蓝方 +// TSite si = siteService.getById(site); +// TStore st = storeService.getById(store); +// map3.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); +// map3.put("space_id", si.getId() + ""); +// map3.put("name", ToolUtil.isEmpty(sutuName) ? "" : sutuName); +// map3.put("city_code", ""); +// String s3 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map3); +// System.out.println("---------------------------"+s3); +// JSONObject jsonObject = new JSONObject(s3); +// // 获取 data 字段的值 +// JSONObject dataObject = jsonObject.getJSONObject("data"); +// // 获取 sutu_id 字段的值 +// String sutuIdValue = dataObject.getString("sutu_id"); +// Integer sutuId = Integer.valueOf(sutuIdValue); +// game.setSutuId(sutuId); +// } + public static MultipartFile convert(BufferedImage bufferedImage, String fileName) throws IOException { + // 将 BufferedImage 转换为字节数组 + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ImageIO.write(bufferedImage, "png", baos); + byte[] bytes = baos.toByteArray(); + + // 创建 ByteArrayResource + ByteArrayResource resource = new ByteArrayResource(bytes); + + // 创建 MockMultipartFile + MockMultipartFile multipartFile = new MockMultipartFile( + "file", + fileName, + "image/png", + resource.getInputStream() + ); + + return multipartFile; + } @RequestMapping("/save") @ResponseBody public ResultUtil save(Integer id, String operationId, String red, String blue, String province, String city, Integer site, Integer store @@ -231,12 +290,12 @@ , String ly, BigDecimal lyCoin, BigDecimal lyCash, String lyImage, BigDecimal lyInt, Integer lyId,Integer lyIId ,String sutuName - ) { + ) throws Exception { Game game = new Game(); - game.setRed(red); + game.setRedName(red); game.setState(0); - game.setBlue(blue); + game.setBlueName(blue); Integer objectType = UserExt.getUser().getObjectType(); @@ -269,23 +328,62 @@ // 添加sutu编号 HashMap<String, String> map3 = new HashMap<>(); + HashMap<String, String> map4 = new HashMap<>(); // 添加sutu编号 - // 添加门禁 红蓝方 + // 调用两次 创建sutu TSite si = siteService.getById(site); TStore st = storeService.getById(store); -// map3.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); -// map3.put("space_id", si.getId() + ""); -// map3.put("name", ToolUtil.isEmpty(sutuName) ? "" : sutuName); -// map3.put("city_code", ""); -// String s3 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map3); -// System.out.println("---------------------------"+s3); -// JSONObject jsonObject = new JSONObject(s3); -// // 获取 data 字段的值 -// JSONObject dataObject = jsonObject.getJSONObject("data"); -// // 获取 sutu_id 字段的值 -// String sutuIdValue = dataObject.getString("sutu_id"); -// Integer sutuId = Integer.valueOf(sutuIdValue); -// game.setSutuId(sutuId); + map3.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); + map4.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); + map3.put("space_id", st.getId() + ""); + map4.put("space_id", st.getId() + ""); + map3.put("name", blue); + map4.put("name", red); + map3.put("city_code", city); + map4.put("city_code", city); + String s3 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpaceSutu", map3); + String s4 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpaceSutu", map4); + System.out.println("---------------------------"+s3); + JSONObject jsonObject = new JSONObject(s3); + JSONObject jsonObject1 = new JSONObject(s4); + // 获取 data 字段的值 + JSONObject dataObject = jsonObject.getJSONObject("data"); + JSONObject dataObject1 = jsonObject1.getJSONObject("data"); + // 获取 sutu_id 字段的值 + String sutuIdValue = dataObject.getString("sutu_id"); + String sutuIdValue1 = dataObject1.getString("sutu_id"); + Integer sutuId = Integer.valueOf(sutuIdValue); + Integer sutuId1 = Integer.valueOf(sutuIdValue1); + game.setBlue(""+sutuId); + game.setRed(""+sutuId1); + + // 生成设备二维码 + HashMap<String, String> blueCode = new HashMap<>(); + blueCode.put("scan_type", "1000"); + blueCode.put("sutu_id", ""+sutuId); + blueCode.put("space_id", st.getId() + ""); + + HashMap<String, String> redCode = new HashMap<>(); + redCode.put("scan_type", "1000"); + redCode.put("sutu_id", sutuId1+""); + redCode.put("space_id", st.getId() + ""); + String blueS= "{\"scan_type\": 1000, \"space_id\": "+st.getId()+", \"sutu_id\": "+sutuId+"}"; + String redS= "{\"scan_type\": 1000, \"space_id\": "+st.getId()+", \"sutu_id\": "+sutuId1+"}"; + MyQrCodeUtil.createCodeToFile(blueS); + MyQrCodeUtil.createCodeToFile(redS); + BufferedImage blueImage = QRCodeUtil.createImage(blueS); + BufferedImage redImage = QRCodeUtil.createImage(redS); + MultipartFile blueFile = convert(blueImage, new Date().getTime()+UUIDUtil.getRandomCode(3)+".PNG"); + MultipartFile redFile = convert(redImage, new Date().getTime()+UUIDUtil.getRandomCode(3)+".PNG"); + String s = OssUploadUtil.ossUpload("img/", blueFile); + String s1 = OssUploadUtil.ossUpload("img/", redFile); +// MultipartFile multipartFile = convert(blueImage); +// MultipartFile multipartFile1 = convert(redImage); +// +// String s = OssUploadUtil.ossUpload("img/", multipartFile); +// String s1 = OssUploadUtil.ossUpload("img/", multipartFile1); + game.setBlueCode(s); + game.setRedCode(s1); Integer gameId = ballClient.save(game); List<TGameConfig> gameConfigList = new ArrayList<>(); @@ -419,18 +517,18 @@ HashMap<String, String> map2 = new HashMap<>(); - map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); - map1.put("space_id", si.getId() + ""); - map1.put("device_id", red); - map1.put("region_id", st.getId() + ""); - // 添加门禁 - String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); - map2.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); - map2.put("space_id", si.getId() + ""); - map2.put("device_id", blue); - map2.put("region_id", st.getId() + ""); - // 添加门禁 - String s2 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map2); +// map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); +// map1.put("space_id", si.getId() + ""); +// map1.put("device_id", red); +// map1.put("region_id", st.getId() + ""); +// // 添加门禁 +// String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); +// map2.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); +// map2.put("space_id", si.getId() + ""); +// map2.put("device_id", blue); +// map2.put("region_id", st.getId() + ""); +// // 添加门禁 +// String s2 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map2); diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/LoginController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/LoginController.java index baa67c5..6a533ee 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/LoginController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/LoginController.java @@ -329,7 +329,6 @@ super.getSession().setAttribute("language",language); return REDIRECT + "/"; } - /** * 退出登录 */ @@ -338,5 +337,4 @@ deleteAllCookie(); return REDIRECT + "/login"; } - } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Game.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Game.java index fd4489a..4229777 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Game.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Game.java @@ -27,6 +27,9 @@ private Integer state; // 获取和设置方法 - private Integer sutuId; - private String sutuName; + private String redName; + private String blueName; + private String blueCode; + private String redCode; + } \ No newline at end of file diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Gate.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Gate.java new file mode 100644 index 0000000..688d009 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Gate.java @@ -0,0 +1,34 @@ +package com.dsh.guns.modular.system.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +@TableName("t_gate") +@Data +public class Gate { + @TableId(value = "id", type = IdType.INPUT) + private Integer id; + // 闸机名称 + @TableField("name") + private String name; + // 硬件编号 + @TableField("device") + private String device; + // 门店id + @TableField("storeId") + private Integer storeId; + // 场地id + @TableField("siteId") + private Integer siteId; + // 运营商id 0为平台 + @TableField("operatorId") + private Integer operatorId; + // 是否删除 0否1是 + @TableField("isDelete") + private Integer isDelete; +} \ No newline at end of file diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/HomeModule.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/HomeModule.java new file mode 100644 index 0000000..8eda196 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/HomeModule.java @@ -0,0 +1,91 @@ +package com.dsh.guns.modular.system.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 平台首页模块配置 + */ +@Data +@TableName("t_home_module") +public class HomeModule { + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + /** + * 是否开通(0=否,1=是) + */ + @TableField("isOpen") + private Integer isOpen; + /** + * 标题 + */ + @TableField("title") + @ApiModelProperty("标题") + private String title; + @TableField(exist = false) + private String name; + /** + * 置顶(0=否,1=是) + */ + @TableField("isTop") + private Integer isTop; + /** + * 排序 + */ + @TableField("sort") + private Integer sort; + /** + * 背景图 + */ + @TableField("backgroundImage") + private String backgroundImage; + /** + * 按钮图片 + */ + @TableField("buttonImage") + @ApiModelProperty("按钮图片") + private String buttonImage; + /** + * 富文本内容 + */ + @TableField("content") + @ApiModelProperty("富文本内容") + private String content; + /** + * 跳转页面id + */ + @TableField("jumpPage") + private Integer jumpPage; + /** + * 跳转模块 + */ + @TableField("model") + private String model; + /** + * 跳转类型 + */ + @TableField("type") + private String type; + /** + * 跳转类型 + */ + @TableField("turnId") + private String turnId; + /** + * 跳转页面 + */ + @TableField("page") + private String page; + /** + * 跳转类型id + */ + @TableField("typeId") + private Integer typeId; +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/StoreVos.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/StoreVos.java index e41357d..58cf171 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/StoreVos.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/StoreVos.java @@ -16,4 +16,6 @@ String num3; String num4; + // 场地名称 + String num5; } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TSite.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TSite.java index d6249d0..61b39bc 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TSite.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TSite.java @@ -131,4 +131,6 @@ private String ids; @TableField("sign") private Integer sign; + @TableField("reservation") + private Integer reservation; } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IGateService.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IGateService.java new file mode 100644 index 0000000..37d282e --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IGateService.java @@ -0,0 +1,23 @@ +package com.dsh.guns.modular.system.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.dsh.course.dto.JsDto; +import com.dsh.guns.modular.system.model.*; +import com.dsh.guns.modular.system.model.dto.SelectDto; + +import java.util.List; +import java.util.Map; + + +/** + * 字典服务 + * + * @author fengshuonan + * @date 2017-04-27 17:00 + */ +public interface IGateService extends IService<Gate> { + + + List<Map<String, Object>> listAll(String name, String device, String operatorId, String storeId, List<Integer> storeIds, Page<Map<String, Object>> page); +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IHomeModuleService.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IHomeModuleService.java new file mode 100644 index 0000000..3749858 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IHomeModuleService.java @@ -0,0 +1,7 @@ +package com.dsh.guns.modular.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dsh.guns.modular.system.model.HomeModule; + +public interface IHomeModuleService extends IService<HomeModule> { +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IStoreService.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IStoreService.java index 1d093a5..e984f83 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IStoreService.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/IStoreService.java @@ -83,4 +83,6 @@ List<Map<String, Object>> listStoreAllByIds(List<Integer> ids); + List<Map<String, Object>> querySiteListOfpage(String provinceCode, String cityCode, Integer operatorId, String storeName, Page<Map<String, Object>> page); + } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/GateServiceImpl.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/GateServiceImpl.java new file mode 100644 index 0000000..e3df53f --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/GateServiceImpl.java @@ -0,0 +1,28 @@ +package com.dsh.guns.modular.system.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dsh.course.dto.JsDto; +import com.dsh.course.mapper.GateMapper; +import com.dsh.course.mapper.StoreMapper; +import com.dsh.guns.modular.system.model.*; +import com.dsh.guns.modular.system.model.dto.SelectDto; +import com.dsh.guns.modular.system.service.IGateService; +import com.dsh.guns.modular.system.service.IStoreService; +import org.omg.CORBA.PRIVATE_MEMBER; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service +public class GateServiceImpl extends ServiceImpl<GateMapper, Gate> implements IGateService { + @Autowired + private GateMapper gateMapper; + @Override + public List<Map<String, Object>> listAll(String name, String device, String operatorId, + String storeId, List<Integer> storeIds, Page<Map<String, Object>> page) { + return gateMapper.listAll(name,device,operatorId,storeId,storeIds,page); + } +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/HomeModuleServiceImpl.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/HomeModuleServiceImpl.java new file mode 100644 index 0000000..e43a089 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/HomeModuleServiceImpl.java @@ -0,0 +1,11 @@ +package com.dsh.guns.modular.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dsh.course.mapper.HomeModuleMapper; +import com.dsh.guns.modular.system.model.HomeModule; +import com.dsh.guns.modular.system.service.IHomeModuleService; +import org.springframework.stereotype.Service; + +@Service +public class HomeModuleServiceImpl extends ServiceImpl<HomeModuleMapper, HomeModule> implements IHomeModuleService { +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/StoreServiceImpl.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/StoreServiceImpl.java index b52ad11..4bc5fd2 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/StoreServiceImpl.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/service/impl/StoreServiceImpl.java @@ -29,6 +29,11 @@ return this.baseMapper.listAllStore(page,provinceCode,cityCode,name,phone,shopName,id); } + @Override + public List<Map<String, Object>> querySiteListOfpage(String provinceCode, String cityCode, Integer operatorId, String storeName, Page<Map<String, Object>> page) { + return this.baseMapper.querySiteListOfpage(provinceCode,cityCode,operatorId,storeName,page); + } + /** * 获取所有省 * @return diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/MyQrCodeUtil.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/MyQrCodeUtil.java new file mode 100644 index 0000000..c0c05c2 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/MyQrCodeUtil.java @@ -0,0 +1,95 @@ +package com.dsh.guns.modular.system.util; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.WriterException; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; + +import javax.imageio.ImageIO; +import javax.swing.filechooser.FileSystemView; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map; + +public class MyQrCodeUtil { + //CODE_WIDTH:二维码宽度,单位像素 + private static final int CODE_WIDTH = 400; + //CODE_HEIGHT:二维码高度,单位像素 + private static final int CODE_HEIGHT = 400; + //FRONT_COLOR:二维码前景色,0x000000 表示黑色 + private static final int FRONT_COLOR = 0x000000; + //BACKGROUND_COLOR:二维码背景色,0xFFFFFF 表示白色 + //演示用 16 进制表示,和前端页面 CSS 的取色是一样的,注意前后景颜色应该对比明显,如常见的黑白 + private static final int BACKGROUND_COLOR = 0xFFFFFF; + public static BufferedImage createCodeToFile(String content) { + try { + content = content.trim(); + //核心代码-生成二维码 + BufferedImage bufferedImage = getBufferedImage(content); + + return bufferedImage; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + /** + * 生成二维码并输出到输出流, 通常用于输出到网页上进行显示,输出到网页与输出到磁盘上的文件中,区别在于最后一句 ImageIO.write + * write(RenderedImage im,String formatName,File output):写到文件中 + * write(RenderedImage im,String formatName,OutputStream output):输出到输出流中 + * @param content :二维码内容 + * @param outputStream :输出流,比如 HttpServletResponse 的 getOutputStream + */ + public static void createCodeToOutputStream(String content, OutputStream outputStream) { + try { + if (StringUtils.isBlank(content)) { + return; + } + content = content.trim(); + //核心代码-生成二维码 + BufferedImage bufferedImage = getBufferedImage(content); + //区别就是这一句,输出到输出流中,如果第三个参数是 File,则输出到文件中 + ImageIO.write(bufferedImage, "png", outputStream); + System.out.println("二维码图片生成到输出流成功..."); + } catch (Exception e) { + e.printStackTrace(); + } + } + //核心代码-生成二维码 + private static BufferedImage getBufferedImage(String content) throws WriterException { + //com.google.zxing.EncodeHintType:编码提示类型,枚举类型 + Map<EncodeHintType, Object> hints = new HashMap(); + //EncodeHintType.CHARACTER_SET:设置字符编码类型 + hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); + //EncodeHintType.ERROR_CORRECTION:设置误差校正 + //ErrorCorrectionLevel:误差校正等级,L = ~7% correction、M = ~15% correction、Q = ~25% correction、H = ~30% correction + //不设置时,默认为 L 等级,等级不一样,生成的图案不同,但扫描的结果是一样的 + hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); + //EncodeHintType.MARGIN:设置二维码边距,单位像素,值越小,二维码距离四周越近 + hints.put(EncodeHintType.MARGIN, 1); + MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); + BitMatrix bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, CODE_WIDTH, CODE_HEIGHT, hints); + BufferedImage bufferedImage = new BufferedImage(CODE_WIDTH, CODE_HEIGHT, BufferedImage.TYPE_INT_BGR); + for (int x = 0; x < CODE_WIDTH; x++) { + for (int y = 0; y < CODE_HEIGHT; y++) { + bufferedImage.setRGB(x, y, bitMatrix.get(x, y) ? FRONT_COLOR : BACKGROUND_COLOR); + } + } + return bufferedImage; + } + + public static void main(String[] args) { + String param = "{\n" + + " \"scan_type\": 1,\n" + + " \"space_id\": 2,\n" + + " \"sutu_id\": 3\n" + + "}"; + createCodeToFile(param); + } + +} \ No newline at end of file diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/QRCodeUtil.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/QRCodeUtil.java new file mode 100644 index 0000000..45c99c7 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/QRCodeUtil.java @@ -0,0 +1,50 @@ +package com.dsh.guns.modular.system.util; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; + +import java.awt.image.BufferedImage; +import java.util.Hashtable; + +/** + * @author chengst + * @date 2019/11/4 + **/ +public class QRCodeUtil{ + + private final static String CHARSET = "utf-8"; + + private final static int QRSIZEE = 300; + + // 二维码颜色 + private static final int BLACK = 0xFF000000; + // 二维码颜色 + private static final int WHITE = 0xFFFFFFFF; + + public static BufferedImage createImage(String content){ + Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>(); + hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); + hints.put(EncodeHintType.CHARACTER_SET, CHARSET); + hints.put(EncodeHintType.MARGIN, 1); + BitMatrix bitMatrix = null; + try { + bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, QRSIZEE, QRSIZEE,hints); + }catch (Exception e){ + e.printStackTrace(); + } + int width = bitMatrix.getWidth(); + int height = bitMatrix.getHeight(); + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + image.setRGB(x, y, bitMatrix.get(x, y) ? BLACK : WHITE); + } + } + return image; + } +} + diff --git a/cloud-server-management/src/main/resources/mapper/GateMapper.xml b/cloud-server-management/src/main/resources/mapper/GateMapper.xml new file mode 100644 index 0000000..1920d1b --- /dev/null +++ b/cloud-server-management/src/main/resources/mapper/GateMapper.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.dsh.course.mapper.GateMapper"> + + <select id="listAll" resultType="java.util.Map"> + select t1.id as id,t1.name as name,t1.device as device, + ifNull(CONCAT(t5.name,'-',t5.phone),'平台闸机') as operatorName, + t2.name as storeName,t3.name as siteName + from t_gate t1 + left join t_store t2 on t2.id = t1.storeId + left join t_site t3 on t3.id = t1.siteId + left join t_operator t4 on t4.id = t1.operatorId + left join sys_user t5 on t5.id = t4.userId + where 1=1 and t1.isDelete = 0 + <if test="name != null and name!=''"> + and t1.name like CONCAT('%',#{name},'%') + </if> + <if test="device != null and device!=''"> + and t1.device like CONCAT('%',#{device},'%') + </if> + <if test="operatorName != null and operatorName!=''"> + and t4.name like CONCAT('%',#{operatorName},'%') + </if> + <if test="storeName != null and storeName!=''"> + and t2.name like CONCAT('%',#{storeName},'%') + </if> + <if test="storeIds != null and storeIds.size()>0"> + AND t1.storeId IN + <foreach collection="storeIds" separator="," item="id" open="(" close=")"> + #{id} + </foreach> + </if> + </select> +</mapper> \ No newline at end of file diff --git a/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml b/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml index 24ef43b..3dae29d 100644 --- a/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml +++ b/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml @@ -171,6 +171,25 @@ and t1.name like concat("%",#{shopName},"%") </if> </select> + <select id="querySiteListOfpage" resultType="java.util.Map"> + SELECT t1.id, t1.operatorId, t1.province, t1.city, t2.name,t1.ids,t1.name as siteName + from t_site t1 + left join t_store t2 on t1.storeId =t2.id + where t1.state=1 and t2.state=1 + <if test="provinceCode != null and provinceCode!=''"> + and t1.provinceCode = #{provinceCode} + </if> + <if test="cityCode != null and cityCode!=''"> + and t1.cityCode = #{cityCode} + </if> + <if test="operatorId != null and operatorId!=''"> + and t1.operatorId = #{operatorId} + </if> + <if test="storeName != null and storeName != ''"> + and t1.name like CONCAT('%',#{storeName},'%') + </if> + + </select> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball.html index 418d4f7..693d3b1 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball.html @@ -5,6 +5,7 @@ <div class="ibox-title"> <h5>管理</h5> </div> + <div class="ibox-content"> <div class="row row-lg"> <div class="col-sm-12"> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add.html index 7af2b05..1f4080d 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add.html @@ -250,7 +250,7 @@ }, { "type": "tpl", - "tpl": "                       设备ID:", + "tpl": "                       SUTU名称:", "inline": true, "wrapperComponent": "", "id": "u:587781d5d181", diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add1.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add1.html index 35d4293..344e797 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add1.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add1.html @@ -177,7 +177,7 @@ }, { "type": "tpl", - "tpl": "                       设备ID:", + "tpl": "                       SUTU名称:", "inline": true, "wrapperComponent": "", "id": "u:587781d5d181", diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add2.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add2.html index 65be1b7..fb2f0b3 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add2.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add2.html @@ -229,7 +229,7 @@ }, { "type": "tpl", - "tpl": "                       设备ID:", + "tpl": "                       SUTU名称:", "inline": true, "wrapperComponent": "", "id": "u:587781d5d181", diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit.html index c11737b..0a8ecd4 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit.html @@ -249,7 +249,7 @@ }, { "type": "tpl", - "tpl": "                       设备ID:", + "tpl": "                       SUTU名称:", "inline": true, "wrapperComponent": "", "id": "u:587781d5d181", @@ -272,7 +272,7 @@ "value": "", "required": true , - "value":`${game.blue}` + "value":`${game.blueName}` }, { "type": "input-text", @@ -284,7 +284,7 @@ "hidden": false, "required": true , - "value":`${game.red}` + "value":`${game.redName}` }, { diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit1.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit1.html index a30b2fa..b5254be 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit1.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit1.html @@ -256,7 +256,7 @@ }, { "type": "tpl", - "tpl": "                       设备ID:", + "tpl": "                       SUTU名称:", "inline": true, "wrapperComponent": "", "id": "u:587781d5d181", @@ -279,7 +279,7 @@ "value": "", "required": true , - "value":`${game.blue}` + "value":`${game.blueName}` }, { "type": "input-text", @@ -291,7 +291,7 @@ "hidden": false, "required": true , - "value":`${game.red}` + "value":`${game.redName}` }, { "type": "button", diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit2.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit2.html index bfa70f0..c8ae33b 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit2.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_edit2.html @@ -229,7 +229,7 @@ }, { "type": "tpl", - "tpl": "                       设备ID:", + "tpl": "                       SUTU名称:", "inline": true, "wrapperComponent": "", "id": "u:587781d5d181", @@ -252,7 +252,7 @@ "value": "", "required": true , - "value":`${game.blue}` + "value":`${game.blueName}` }, { "type": "input-text", @@ -264,7 +264,7 @@ "hidden": false, "required": true , - "value":`${game.red}` + "value":`${game.redName}` }, { "type": "button", diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_info.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_info.html index 0454216..f239a30 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_info.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_info.html @@ -256,7 +256,7 @@ }, { "type": "tpl", - "tpl": "                       设备ID:", + "tpl": "                       SUTU名称:", "inline": true, "wrapperComponent": "", "id": "u:587781d5d181", @@ -280,7 +280,7 @@ "value": "", "required": true , - "value":`${game.blue}` + "value":`${game.blueName}` }, { "type": "input-text", @@ -293,7 +293,7 @@ "hidden": false, "required": true , - "value":`${game.red}` + "value":`${game.redName}` }, { "type": "button", diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_benefits.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_benefits.html new file mode 100644 index 0000000..90a1a57 --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_benefits.html @@ -0,0 +1,88 @@ +@layout("/common/_container.html"){ +<style> + .avatar-uploader .el-upload { + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + height: 100px; + width: 100px; + overflow: hidden; + } + + .avatar-uploader .el-upload:hover { + border-color: #409EFF; + } + .avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 100px; + height: 100px; + line-height: 100px; + margin-top: 32px; + text-align: center; + } + .avatar { + width: 100px; + height: 100px; + display: block; + } + + .col-sm-12 { + margin-top: 20px; + } + + .col-sm-12 select { + height: 33px; + } + #app1{ + margin-left: 255px; + } + + +</style> +<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> +<div class="ibox float-e-margins"> + <input hidden id="roleType" value="${roleType}"> + <div class="ibox-content"> + <div class="form-horizontal" id="carInfoForm"> + <#avatar id="cover3" name="*我的券包(推荐像素:780x560px):" avatarImg="${c3}"/><span></span> + <#avatar id="cover4" name="*线上商城(推荐像素:780x560px):" avatarImg="${c4}"/><span ></span> + <#avatar id="cover5" name="*本周福利(推荐像素:616x402px):" avatarImg="${c5}"/><span></span> + <#avatar id="cover6" name="*今日免费(推荐像素:616x402px):" avatarImg="${c6}"/><span></span> +<div class="row btn-group-m-t"> + <div class="col-sm-10 col-sm-offset-5" > + <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSite.addBenefits()"/> + <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TSite.close()"/> + </div> +</div> + + </div> + </div> + + </div> + +</div> + +<script src="${ctxPath}/modular/system/advertisement/advertisement.js"></script> +<script src="${ctxPath}/js/vue/vue.js"></script> +<script src="${ctxPath}/js/elementui/index.js"></script> +<link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> + +<script> + $(function(){ + var carPhoto1 = new $WebUpload("cover3"); + carPhoto1.setUploadBarId("progressBar"); + carPhoto1.init(); + var carPhoto2 = new $WebUpload("cover4"); + carPhoto2.setUploadBarId("progressBar"); + carPhoto2.init(); + var carPhoto7 = new $WebUpload("cover5"); + carPhoto7.setUploadBarId("progressBar"); + carPhoto7.init(); + var carPhoto8 = new $WebUpload("cover6"); + carPhoto8.setUploadBarId("progressBar"); + carPhoto8.init(); + }); +</script> +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_config.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_config.html new file mode 100644 index 0000000..5f20b2e --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_config.html @@ -0,0 +1,87 @@ +@layout("/common/_container.html"){ +<link href="${ctxPath}/static/css/plugins/switchery/switchery.css" rel="stylesheet"> +<style> + .table1{ + display: inline; + width: 33.333333333333333333333333333333333333%; + float:left; + text-align:center; + border-collapse:collapse; + font-size: 18px; + } + .table2{ + display: inline; + width: 50%; + float:left; + text-align:center; + border-collapse:collapse; + font-size: 18px; + } + .table3{ + display: inline; + width: 50%; + float:left; + text-align:center; + border-collapse:collapse; + font-size: 18px; + } + .table1:hover{ + background-color: rgba(255,0,0,.3); + } + .newWidth, .single-line{ + max-width:150px !important;display: initial !important; + } + .companyValueClass td:first-child { + display: flex; + align-items: center; + justify-content: center; + } +</style> +<div class="ibox float-e-margins"> + <div class="ibox-content"> + <div class="form-horizontal"> + <#avatar id="cover1" name="*无学员配置(推荐像素:宽度780px):" avatarImg="${c1}"/> + <#avatar id="cover2" name="*成为会员(推荐像素:宽度780px):" avatarImg="${c2}" /> + <#avatar id="cover7" name="*启动页配置(推荐像素:宽度780px):" avatarImg="${c7}"/> + </div> + <div class="row btn-group-m-t"> + <div class="col-sm-10 col-sm-offset-5" > + <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSite.addConfig()"/> + </div> + </div> + </div> +</div> + + +<script src="${ctxPath}/modular/system/dataStatistics/echarts.min.js"></script> +<script src="${ctxPath}/modular/system/advertisement/advertisement.js"></script> +<script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> +<script> + $(function(){ + + + getContent(1); + }); + function getContent(type){ + + //设置点击字体颜色效果 + for(var i=1;i<4;i++){ + document.getElementById("div"+i).style.color="#888888";// + document.getElementById("div"+i).style.backgroundColor =""; + $("#content"+i).hide(); + } + //设置点击背景颜色效果 + document.getElementById("div"+type).style.color="white";// + document.getElementById("div"+type).style.backgroundColor ="rgb(26, 179, 148)"; + $("#type").val(type); + $("#content"+type).show(); + if(type!=3){ + $("#ensure").hide(); + $("#nextB").show(); + }else{ + $("#ensure").show(); + $("#nextB").hide(); + } + } +</script> +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_edit.html new file mode 100644 index 0000000..3f374b1 --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/advertisement_edit.html @@ -0,0 +1,301 @@ +@layout("/common/_container.html"){ +<style> + .avatar-uploader .el-upload { + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + height: 100px; + width: 100px; + overflow: hidden; + } + + .avatar-uploader .el-upload:hover { + border-color: #409EFF; + } + .avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 100px; + height: 100px; + line-height: 100px; + margin-top: 32px; + text-align: center; + } + .avatar { + width: 100px; + height: 100px; + display: block; + } + + .col-sm-12 { + margin-top: 20px; + } + + .col-sm-12 select { + height: 33px; + } + #app1{ + margin-left: 255px; + } + + +</style> +<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> +<div class="ibox float-e-margins"> + <input hidden id="roleType" value="${roleType}"> + <input hidden id="type1" value="${type}"> + <input hidden id="turnId" value="${data.turnId}"> + <input hidden id="id" value="${data.id}"> + <input hidden id="img1" value="${data.img}"> + <div class="ibox-content"> + <div class="form-horizontal" id="carInfoForm"> + @if(roleType==1){ + <div class="form-group"> + <label class="col-sm-3 control-label">*广告类型:</label> + <div class="col-sm-9"> + <select style="width: 300px" class="form-control" id="position" onchange="updatePosition(this)" name = "position"> + <option value="">选择类型</option> + <option value="1" ${data.position == 1 ? 'selected=selected' : ''}>首页banner</option> + <option value="2" ${data.position == 2 ? 'selected=selected' : ''}>线上课得积分</option> + <option value="3" ${data.position == 3 ? 'selected=selected' : ''}>看视频得奖励</option> + <option value="4" ${data.position == 4 ? 'selected=selected' : ''}>常见问题</option> + </select> + </div> + </div> + @} + <div class="form-group" > + <label class="col-sm-3 control-label">*广告名称:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${data.name}" id="name" name="name" placeholder="请输入广告名称" type="text"> + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label">*广告图片:</label> + <div class="col-sm-9" style="display: flex;"> + <#avatar id="img" name="" avatarImg="${data.img}"/><span id = "imgPX">推荐像素:</span> + </div> + </div> + @if(roleType == 1){ + <div class="form-group"> + <label class="col-sm-3 control-label">*跳转模块:</label> + <div class="col-sm-9"> + <select style="width: 300px" class="form-control" id="model" name = "model" onchange="updateType(this)"> + <option value="">请选择</option> + <option value="0"${data.model == '不跳转' ? 'selected=selected' : ''}>不跳转</option> + <option value="1"${data.model == '加入玩湃' ? 'selected=selected' : ''}>加入玩湃</option> + <option value="2"${data.model == '开始课程' ? 'selected=selected' : ''}>开始课程</option> + <option value="3"${data.model == '使用福利' ? 'selected=selected' : ''}>使用福利</option> + <option value="4"${data.model == '探索玩湃' ? 'selected=selected' : ''}>探索玩湃</option> + </select> + </div> + </div> + @} + <div class="form-group" id="t1"> + <label class="col-sm-3 control-label">*跳转页面:</label> + <div class="col-sm-9"> + <select style="width: 300px" class="form-control" id="page" name = "page" onchange="updateOne(this)"> + <option value="">请选择</option> + @for(obj in pages){ + <option value="${obj.id}" ${obj.id == data.jumpPage ? 'selected=selected' : ''}>${obj.name}</option> + @} + </select> + </div> + </div> + @if(roleType == 1){ + <div class="form-group" id="t2"> + <label class="col-sm-3 control-label">*跳转类型:</label> + <div class="col-sm-9"> + <select style="width: 300px" class="form-control" id="type" name = "page" onchange="updateT(this)"> + <option value="">请选择</option> + @for(obj in types){ + <option value="${obj.id}" ${obj.id == data.typeId ? 'selected=selected' : ''}>${obj.name}</option> + @} + </select> + </div> + </div> + + <div class="form-group" id="t3"> + <label class="col-sm-3 control-label">*跳转ID:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" value="${data.turnId}" class="form-control" id="pageId" name="name" placeholder="请输入跳转id" type="number"> + </div> + </div> + + @} + <div class="form-group" > + <label class="col-sm-3 control-label">*排序:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${data.sort}" id="sort" name="sort" placeholder="请输入排序" type="number"> + <span style="margin-left: 5px;margin-top: 5px">数字越大 权重越大</span> + </div> + </div> + + <div class="row btn-group-m-t"> + <div class="col-sm-10 col-sm-offset-5" > + @if(type==2){ + <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSite.updateSubmit()"/> + @} + <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TSite.close()"/> + </div> + </div> + + </div> + </div> + +</div> + +</div> + +<script src="${ctxPath}/modular/system/advertisement/advertisement.js"></script> +<script src="${ctxPath}/js/vue/vue.js"></script> +<script src="${ctxPath}/js/elementui/index.js"></script> +<link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> + +<script> + laydate.render({ + elem: '#time', + range:true + }); + + + + + function updateType(e) { + let name = $("#model").val(); + console.log(name); + if(name =='0'){ + $("#t1").hide() + $("#t2").hide() + $("#t3").hide() + $("#t1").val("") + $("#t2").val("") + $("#t3").val("") + $("#page").val("") + $("#type").val("") + $("#pageId").val("") + }else { + $("#t1").show() + $("#t2").show() + $("#t3").show() + + var oneId = $('#model option:selected').text(); + var ajax = new $ax(Feng.ctxPath + "/tShop/typeChange", function(data){ + if(data!=null){ + var content = '<option value="">请选择</option>'; + $.each(data, function(k,v) { + + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#page").empty().append(content); + } + }); + ajax.set("name",oneId); + ajax.start(); + } + + + } + + + function updateOne(e) { + console.log($('#page option:selected').text()) + var page= $('#page option:selected').text(); + if (page=="门店列表" || page=="主页" || page=="充值中心"){ + $("#t3").hide(); + $("#t2").hide(); + $("#t2").val("") + $("#t3").val("") + $("#type").val("") + $("#pageId").val("") + } + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tShop/typeChangeOne", function(data){ + if(data!=null&&data.length>0){ + $("#t2").show() + var content1 = '<option value="">请选择</option>'; + $.each(data, function(k,v) { + content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#type").empty().append(content1); + }else{ + console.log("=-======0000") + $("#t2").val("") + $("#t2").hide() + $("#type").val("") + + } + }); + if (oneId==2 || oneId==25|| oneId==27){ + $("#t3").val("") + $("#t3").hide() + + $("#pageId").val("") + } + ajax.set("id",oneId); + ajax.start(); + updateT(document.getElementById("type")); + + } + + function updatePosition(e) { + var oneId=$(e).val(); + var res= document.getElementById("imgPX"); + console.log(res) + if (oneId == "1"){ + res.innerHTML ="推荐像素:780x472px"; + }else{ + res.innerHTML ="推荐像素:780x440px"; + } + console.log(oneId) + } + function updateT(e) { + var oneId = $('#type option:selected').text(); + console.log(oneId); + if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ + $("#t3").hide() + $("#t3").val("") + $("#pageId").val("") + + }else{ + $("#t3").show() + } + var page = $('#page option:selected').text(); + if (page=="线上课得积分" || page=="看视频得奖励"){ + if (oneId == "列表"){ + $("#t3").show() + } + } + } + window.onload = function() { + if ($('#model option:selected').text()=="不跳转"){ + $("#t1").hide(); + $("#t2").hide(); + $("#t3").hide(); + $("#page").val("") + $("#type").val("") + $("#pageId").val("") + } + + var temp = $("#turnId").val(); + var res= document.getElementById("imgPX"); + res.innerHTML ="推荐像素:780x472px"; + if (temp==""){ + $("#t3").hide(); + $("#t3").val("") + $("#pageId").val("") + } + // 查看跳转页面 有没有跳转类型 + var page = $('#page option:selected').text(); + if (page=="门店列表" || page=="主页" || page=="充值中心" ){ + $("#t2").hide(); + $("#t3").hide(); + $("#t2").val("") + $("#t3").val("") + $("#type").val("") + $("#pageId").val("") + } + } +</script> +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate.html new file mode 100644 index 0000000..111b302 --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate.html @@ -0,0 +1,51 @@ +@layout("/common/_container.html"){ +<div class="row"> + <div class="col-sm-12"> + <div class="ibox float-e-margins"> + <div class="ibox-title"> + <h5>闸机管理</h5> + </div> + <div class="ibox-content"> + <div class="row row-lg"> + <div class="col-sm-12"> + <div class="row"> + <div class="col-sm-3"> + <#NameCon id="name" name="闸机名称" /> + </div> + <div class="col-sm-3"> + <#NameCon id="device" name="硬件编号" /> + </div> + <div class="col-sm-3"> + <#NameCon id="operatorName" name="所属运营商" /> + </div> + <div class="col-sm-3"> + <#NameCon id="storeName" name="所属门店" /> + </div> + <div class="col-sm-3"> + <#button name="搜索" icon="fa-search" clickFun="TSite.search()"/> + <#button name="重置" icon="fa-trash" clickFun="TSite.resetSearch()" space="true"/> + </div> + </div> + <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> + @if(shiro.hasPermission("/gate/add")){ + <#button name="添加" icon="fa-plus" clickFun="TSite.openAddTSite()"/> + @} + @if(shiro.hasPermission("/gate/update")){ + <#button name="编辑" icon="fa-edit" clickFun="TSite.openEditTSite()" space="true"/> + @} + @if(shiro.hasPermission("/gate/delete")){ + <#button name="删除" icon="fa-check" clickFun="TSite.delete()" space="true"/> + @} + </div> + <#table id="TSiteTable"/> + </div> + </div> + </div> + </div> + </div> +</div> +<script src="${ctxPath}/modular/system/gate/gate.js"></script> +<script> + +</script> +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate_add.html new file mode 100644 index 0000000..b9a9294 --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate_add.html @@ -0,0 +1,204 @@ +@layout("/common/_container.html"){ +<style> + .avatar-uploader .el-upload { + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + height: 100px; + width: 100px; + overflow: hidden; + } + + .avatar-uploader .el-upload:hover { + border-color: #409EFF; + } + .avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 100px; + height: 100px; + line-height: 100px; + margin-top: 32px; + text-align: center; + } + .avatar { + width: 100px; + height: 100px; + display: block; + } + + .col-sm-12 { + margin-top: 20px; + } + + .col-sm-12 select { + height: 33px; + } + #app1{ + margin-left: 255px; + } + + +</style> +<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> +<div class="ibox float-e-margins"> + <input hidden id="userType" value="${userType}"> + @if(userType!=1){ + <input hidden id="operatorId" value="${operatorId}"> + @} + @if(userType==3){ + <input hidden id="storeId" value="${storeId}"> + @} + <div class="ibox-content"> + <div class="form-horizontal" id="carInfoForm"> + @if(userType==1){ + <div class="form-group"> + <label class="col-sm-3 control-label">*闸机类型:</label> + <div class="col-sm-9"> + <input type="radio" name="type" value="0" checked onclick="updateType(0)"> 平台闸机 + <input type="radio" name="type" value="1" onclick="updateType(1)" id="radio1" > 运营商闸机 + </div> + </div> + @} + <div class="form-group" > + <label class="col-sm-3 control-label">*闸机名称:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" id="name" name="name" placeholder="请输入闸机名称" > + </div> + </div> + @if(userType==1){ + <div id = "yys" class="form-group" > + <label class="col-sm-3 control-label">*所属运营商:</label> + <div class="col-sm-9"> + <select class="form-control" disabled id="account" name="account" onchange="TCarInfoDlg.getStore(this)" > + <option value="">选择运营商</option> + @for(i in yysList){ + <option value="${i.id}">${i.name}</option> + @} + </select> + </div> + </div> + @} + @if(userType!=3){ + <div class="form-group"> + <label class="col-sm-3 control-label">*所属门店:</label> + <div class="col-sm-9"> + <select class="form-control" id="store" name="account" onchange="TCarInfoDlg.getSite(this)" > + <option value="">选择门店</option> + @for(i in storeList){ + <option value="${i.id}">${i.name}</option> + @} + </select> + </div> + </div> + @} + @if(userType!=3){ + <div class="form-group"> + <label class="col-sm-3 control-label">*所属场地:</label> + <div class="col-sm-9"> + <select class="form-control" id="site" name="account" > + <option value="">选择场地</option> + </select> + </div> + </div> + @} + @if(userType==3){ + <div class="form-group"> + <label class="col-sm-3 control-label">*所属场地:</label> + <div class="col-sm-9"> + <select class="form-control" id="site" name="account" > + <option value="">选择场地</option> + @for(i in siteList){ + <option value="${i.id}">${i.name}</option> + @} + </select> + </div> + </div> + @} + <div class="form-group" > + <label class="col-sm-3 control-label">*硬件编号:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" id="device" name="device" placeholder="请输入硬件编号" > + </div> + </div> + <div class="row btn-group-m-t"> + <div class="col-sm-10 col-sm-offset-5" > + <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.addSubmit()"/> + <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> + </div> + </div> + </div> + </div> +</div> +<script src="${ctxPath}/modular/system/gate/gate_info.js"></script> +<script src="${ctxPath}/js/vue/vue.js"></script> +<script src="${ctxPath}/js/elementui/index.js"></script> +<link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> + +<script> + laydate.render({ + elem: '#time', + range:true + }); + + function updateType(e) { + var selectElement = document.getElementById('account'); + var storeSelect = document.getElementById("store"); + var siteSelect = document.getElementById("site"); + + // $("#store").empty(); + // $("#site").empty(); + if(e =='0'){ + selectElement.innerHTML = '<option value="">请选择运营商</option>'; + storeSelect.innerHTML = '<option value="">请选择门店</option>'; + siteSelect.innerHTML = '<option value="">请选择场地</option>'; + selectElement.disabled = true; + var ajax = new $ax(Feng.ctxPath + "/gate/getStore", function(data){ + if(data!=null){ + var content="<option value=''>选择门店</option>"; + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#store").empty().append(content); + } + }); + ajax.set("operatorId",e); + ajax.start(); + + }else { + selectElement.disabled = false; + var ajax = new $ax(Feng.ctxPath + "/tShop/typeChange", function(data){ + if(data!=null){ + var content = '<option value="">请选择</option>'; + $.each(data, function(k,v) { + + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#page").empty().append(content); + } + }); + ajax.set("name",oneId); + ajax.start(); + } + var pageElement = document.getElementById('page'); + var event = new Event('change'); + pageElement.dispatchEvent(event); + } + + + + function updatePosition(e) { + var oneId=$(e).val(); + var res= document.getElementById("imgPX"); + console.log(res) + if (oneId == "1"){ + res.innerHTML ="推荐像素:780x472px"; + }else{ + res.innerHTML ="推荐像素:780x440px"; + } + console.log(oneId) + } + +</script> +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate_edit.html new file mode 100644 index 0000000..0ec3e9d --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/gate/gate_edit.html @@ -0,0 +1,206 @@ +@layout("/common/_container.html"){ +<style> + .avatar-uploader .el-upload { + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + height: 100px; + width: 100px; + overflow: hidden; + } + + .avatar-uploader .el-upload:hover { + border-color: #409EFF; + } + .avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 100px; + height: 100px; + line-height: 100px; + margin-top: 32px; + text-align: center; + } + .avatar { + width: 100px; + height: 100px; + display: block; + } + + .col-sm-12 { + margin-top: 20px; + } + + .col-sm-12 select { + height: 33px; + } + #app1{ + margin-left: 255px; + } + + +</style> +<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> +<div class="ibox float-e-margins"> + <input hidden id="userType" value="${userType}"> + <input hidden id="id" value="${id}"> + @if(userType!=1){ + <input hidden id="operatorId" value="${operatorId}"> + @} + @if(userType==3){ + <input hidden id="storeId" value="${storeId}"> + @} + <div class="ibox-content"> + <div class="form-horizontal" id="carInfoForm"> + @if(userType==1){ + <div class="form-group"> + <label class="col-sm-3 control-label">*闸机类型:</label> + <div class="col-sm-9"> + <input type="radio" name="type" value="0" checked onclick="updateType(0)"> 平台闸机 + <input type="radio" name="type" value="1" onclick="updateType(1)" id="radio1" > 运营商闸机 + </div> + </div> + @} + <div class="form-group" > + <label class="col-sm-3 control-label">*闸机名称:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" id="name" value="${data.name}" name="name" placeholder="请输入闸机名称" > + </div> + </div> + @if(userType==1){ + <div id = "yys" class="form-group" > + <label class="col-sm-3 control-label">*所属运营商:</label> + <div class="col-sm-9"> + <select class="form-control" disabled id="account" name="account" onchange="TCarInfoDlg.getStore(this)" > + @for(obj in yysList){ + <option value="${obj.id}" ${obj.id == data.operatorId ? 'selected=selected' : ''}>${obj.name}</option> + @} + </select> + </div> + </div> + @} + @if(userType!=3){ + <div class="form-group"> + <label class="col-sm-3 control-label">*所属门店:</label> + <div class="col-sm-9"> + <select class="form-control" id="store" name="account" onchange="TCarInfoDlg.getSite(this)" > + @for(obj in storeList){ + <option value="${obj.id}" ${obj.id == data.storeId ? 'selected=selected' : ''}>${obj.name}</option> + @} + </select> + </div> + </div> + @} + <div class="form-group"> + <label class="col-sm-3 control-label">*所属场地:</label> + <div class="col-sm-9"> + <select class="form-control" id="site" name="account" > + @for(obj in siteList){ + <option value="${obj.id}" ${obj.id == data.siteId ? 'selected=selected' : ''}>${obj.name}</option> + @} + </select> + </div> + </div> + <div class="form-group" > + <label class="col-sm-3 control-label">*硬件编号:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${data.device}" id="device" name="device" placeholder="请输入硬件编号" > + </div> + </div> + <div class="row btn-group-m-t"> + <div class="col-sm-10 col-sm-offset-5" > + <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> + <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> + </div> + </div> + </div> + </div> +</div> +<script src="${ctxPath}/modular/system/gate/gate_info.js"></script> +<script src="${ctxPath}/js/vue/vue.js"></script> +<script src="${ctxPath}/js/elementui/index.js"></script> +<link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> + +<script> + laydate.render({ + elem: '#time', + range:true + }); + + function updateType(e) { + var selectElement = document.getElementById('account'); + var storeSelect = document.getElementById("store"); + var siteSelect = document.getElementById("site"); + + // $("#store").empty(); + // $("#site").empty(); + if(e =='0'){ + selectElement.innerHTML = '<option value="">请选择运营商</option>'; + storeSelect.innerHTML = '<option value="">请选择门店</option>'; + siteSelect.innerHTML = '<option value="">请选择场地</option>'; + selectElement.disabled = true; + var ajax = new $ax(Feng.ctxPath + "/gate/getStore", function(data){ + if(data!=null){ + var content="<option value=''>选择门店</option>"; + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#store").empty().append(content); + } + }); + ajax.set("operatorId",e); + ajax.start(); + }else { + selectElement.disabled = false; + var ajax = new $ax(Feng.ctxPath + "/tShop/typeChange", function(data){ + if(data!=null){ + var content = '<option value="">请选择</option>'; + $.each(data, function(k,v) { + + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#page").empty().append(content); + } + }); + ajax.set("name",oneId); + ajax.start(); + } + var pageElement = document.getElementById('page'); + var event = new Event('change'); + pageElement.dispatchEvent(event); + } + + + + function updatePosition(e) { + var oneId=$(e).val(); + var res= document.getElementById("imgPX"); + console.log(res) + if (oneId == "1"){ + res.innerHTML ="推荐像素:780x472px"; + }else{ + res.innerHTML ="推荐像素:780x440px"; + } + console.log(oneId) + } + window.onload = function(){ + // 如果是0则是平台闸机 + var temp = $("#operatorId").val(); + console.log("看看运营商id") + console.log(temp) + // 如果不是平台闸机 + if (temp!=0){ + var selectElement = document.getElementById('account'); + selectElement.disabled = false; + } + var OBJradio1=document.getElementsByName("type") + if($("#operatorId").val()==OBJradio1[0].value){//判断是否与radio的值相同 + OBJradio1[0].checked=true//修改选中状态 + }else{ + OBJradio1[1].checked=true//修改选中状态 + } + + } +</script> +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_detail_one.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_detail_one.html index b1aa18b..fd50b51 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_detail_one.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_detail_one.html @@ -45,9 +45,9 @@ <div id="b1"> <#input id="name" name="*商品名称:" type="text" value="${item.name}" readonly="true" /> - <#input id="cover" name="*原价:" avatarImg="${item.price}" readonly="true" /> + <#input id="cover" name="*原价:" value="${item.price}" readonly="true" /> <div class="form-group"> - <label class="col-sm-3 control-label head-scu-label">*兑换方式:</label> + <label class="col-sm-3 control-label head-scu-label">*发放方式:</label> <div class="col-sm-4"> @if(exchangeMethod == 1){ <input class="col-sm-1 control-label" name="userGroup" type="radio" @@ -88,9 +88,28 @@ </div> </div> - <#input id="cover" name="*所需现金:" avatarImg="${item.cash}" readonly="true" /> - <#input id="cover" name="*所需积分:" avatarImg="${item.integral}" readonly="true" /> + <div class="form-group"> + <label class="col-sm-3 control-label">兑换方式:</label> + <div class="col-sm-9"> + <input type="radio" name="redemptionMethod" value="1" checked onclick="updateMethod(1)"> 积分 + <input type="radio" name="redemptionMethod" value="2" onclick="updateMethod(2)"> 现金+积分 + </div> + </div> + <div class="form-group" id="y3" hidden> + <label class="col-sm-3 control-label">所需现金:</label> + <div class="col-sm-9"> + <input class="form-control" id="cash1" name="cash" type="text" value="${item.cash}"> + + </div> + </div> + <div class="form-group" id="y4"> + <label class="col-sm-3 control-label">所需积分:</label> + <div class="col-sm-9"> + <input class="form-control" id="integral1" name="integral" type="text" value="${item.integral}"> + + </div> + </div> <div class="form-group"> <label class="col-sm-3 control-label head-scu-label">*商品封面:</label> <div class="col-sm-4"> @@ -131,6 +150,26 @@ <td>${s.num1}</td> <td>${s.num2}</td> <td>${s.num3}</td> + <td>${s.num4}</td> + @} + </table> + @} + @if(item.useScope == 4){ + <table class="table table-bordered" style="width: 70%;margin-left: 228px;" > + <thead> + <tr> + <td>所在省市</td> + <td>所属账号</td> + <td>门店名称</td> + <td>场地名称</td> + <td>闸机id</td> + </tr> + </thead> + @for(s in sites){ + <td>${s.num1}</td> + <td>${s.num2}</td> + <td>${s.num3}</td> + <td>${s.num5}</td> <td>${s.num4}</td> @} </table> @@ -179,6 +218,48 @@ <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> <script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script> <script> + function updateMethod(e) { + console.log(e) + if(e==1){ + $("#y3").hide() + $("#y4").show() + }else if(e==2){ + $("#y4").show() + $("#y3").show() + }else if(e==3){ + $("#y1").hide() + $("#y2").show() + }else if(e==4){ + $("#y1").show() + $("#y2").show() + }else if(e==5) { + $("#y2").hide() + $("#y1").show() + } + + } + window.onload = function(){ + var OBJradio=document.getElementsByName("redemptionMethod") + if(OBJradio==1){ + $("#y4").show() + $("#y3").hide() + } + if(OBJradio==2){ + $("#y4").show() + $("#y3").show() + } + for(i=0;i<OBJradio.length;i++){//循环查找这个radio + if($("#s1").val()==OBJradio[i].value){//判断是否与radio的值相同 + OBJradio[i].checked=true//修改选中状态 + } + } + var OBJradio=document.getElementsByName("userPopulation") + for(i=0;i<OBJradio.length;i++){//循环查找这个radio + if($("#s2").val()==OBJradio[i].value){//判断是否与radio的值相同 + OBJradio[i].checked=true//修改选中状态 + } + } + } var vue2 = new Vue({ el: '#app', data: { diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TSiteListOne.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TSiteListOne.html new file mode 100644 index 0000000..f622916 --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TSiteListOne.html @@ -0,0 +1,123 @@ +@layout("/common/_container.html"){ +<div class="row"> + <div class="col-sm-12"> + <div class="ibox float-e-margins"> + <div class="ibox-title"> + <h5>所在门店</h5> + </div> + <div class="ibox-content"> + <div class="row row-lg"> + <div class="col-sm-12"> + <div class="row"> + <div class="col-sm-3"> + <div class="input-group"> + <div class="input-group-btn open"> + <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> + 所在省 + </button> + </div> + <select class="form-control" id="pCode" onchange="oneChange(this)"> + <option value="">全部</option> + @for(obj in list){ + <option value="${obj.code}">${obj.name}</option> + @} + </select> + </div> + </div> + <div class="col-sm-3"> + <div class="input-group"> + <div class="input-group-btn open"> + <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> + 所在市 + </button> + </div> + <select class="form-control" id="cCode" onchange="getAccount()"> + </select> + </div> + </div> + <div class="col-sm-3"> + <div class="input-group"> + <div class="input-group-btn open"> + <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> + 所属运营商 + </button> + </div> + <select class="form-control" id="account"> + </select> + </div> + </div> + + <div class="col-sm-3"> + <#NameCon id="storeName" name="门店名称" placeholder="请输入门店名称"/> + </div> + <div class="col-sm-3"> + <#button name="搜索" icon="fa-search" clickFun="TStoreProvince.search()"/> + <#button name="重置" icon="fa-trash" clickFun="TStoreProvince.resetSearch()"/> + </div> + </div> + <div class="hidden-xs" id="TStoreProvinceTableToolbar" role="group"> + </div> + <#table id="TStoreProvinceTable"/> + <div style="margin-left: 30%"> + <button type="button" class="btn btn-info button-margin" onclick="TStoreProvince.storeOfClosePage()" + id="closePage" style="width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;"> + <i class="fa fa-check"></i> 关闭 + </button> + + <button type="button" class="btn btn-info button-margin" onclick="TStoreProvince.saveSelectSites()" + id="submit" style="margin-left: 5%;width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;"> + <i class="fa fa-check"></i> 保存 + </button> + </div> + </div> + </div> +</div> + +</div> +</div> +</div> +<script src="${ctxPath}/modular/system/tGoods/TCouponInfo.js"></script> +<script src="${ctxPath}/modular/system/tGoods/TSiteInfo.js"></script> +<script> + function oneChange(e) { + var citySelect= document.getElementById("cCode"); + var accountSelect= document.getElementById("account"); + var oneId=$(e).val(); + var content = "<option value=''>请选择</option>"; + var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ + if(data!=null){ + + $.each(data, function(k,v) { + content += "<option value='"+v.name+"'>"+v.name+"</option>"; + }); + $("#cCode").empty().append(content); + } + }); + accountSelect.innerHTML = '<option style="width: 300px" value="">请先选择省/市</option>'; + if(oneId==""){ + citySelect.innerHTML = '<option style="width: 300px" value="">请先选择省/市</option>'; + accountSelect.innerHTML = '<option style="width: 300px" value="">请先选择省/市</option>'; + } + ajax.set("oneId",oneId); + ajax.start(); + } + function getAccount() { + var oneId= $("#cCode option:selected").text(); + var accountSelect= document.getElementById("account"); + var content = "<option value=''>请选择</option>"; + var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getOperator", function(data){ + if(data!=null){ + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#account").empty().append(content); + } + }); + if(oneId==""){ + accountSelect.innerHTML = '<option style="width: 300px" value="">请先选择省/市</option>'; + } + ajax.set("city",oneId); + ajax.start(); + } +</script> +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHomeModule/tHomeModule.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHomeModule/tHomeModule.html new file mode 100644 index 0000000..adb1358 --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tHomeModule/tHomeModule.html @@ -0,0 +1,311 @@ +@layout("/common/_container.html"){ +<style> + .avatar-uploader .el-upload { + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + height: 100px; + width: 100px; + overflow: hidden; + } + + .avatar-uploader .el-upload:hover { + border-color: #409EFF; + } + .avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 100px; + height: 100px; + line-height: 100px; + margin-top: 32px; + text-align: center; + } + .avatar { + width: 100px; + height: 100px; + display: block; + } + + .col-sm-12 { + margin-top: 20px; + } + + .col-sm-12 select { + height: 33px; + } + #app1{ + margin-left: 255px; + } + + +</style> +<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> +<div class="ibox float-e-margins"> + <input hidden id="roleType" value="${roleType}"> + <input hidden id="turnId" value="${data.turnId}"> + <input hidden id="type1" value="${type}"> + <input hidden id="id" value="${data.id}"> + <input hidden id="isOpen" value="${data.isOpen}"> + <input hidden id="isTop" value="${data.isTop}"> + <input hidden id="backgroundImage1" value="${data.backgroundImage}"> + <input hidden id="buttonImage1" value="${data.buttonImage}"> + <div class="ibox-content"> + <div class="form-horizontal" id="carInfoForm"> + + <div class="form-group" style="margin-left: 96px"> + <label class="col-sm-3 control-label" > + 开启状态:<input type="radio" name="isOpen" value="1">开启 <input type="radio" name="isOpen" value="0">关闭 + </label> + </div> + + <div class="form-group" > + <label class="col-sm-3 control-label">*标题:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${data.title}" id="title" name="title" placeholder="请输入标题" type="text"> + </div> + </div> + + <div class="form-group" style="margin-left: 96px"> + <label class="col-sm-3 control-label" > + 是否置顶:<input type="radio" name="isTop" value="1">是 <input type="radio" name="isTop" value="0">否 + </label> + </div> + + <div class="form-group" > + <label class="col-sm-3 control-label">排序:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${data.sort}" id="sort" name="sort" placeholder="请输入排序" type="number"> + <span style="margin-left: 5px;margin-top: 5px">数字越大 权重越大</span> + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label">背景图:</label> + <div class="col-sm-9" style="display: flex;"> + <#avatar id="backgroundImage" name="" value ="${data.backgroundImage}" avatarImg="${data.backgroundImage}"/> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">按钮样式:</label> + <div class="col-sm-9" style="display: flex;"> + <#avatar id="buttonImage" name="" value ="${data.buttonImage}" avatarImg="${data.buttonImage}"/> + </div> + </div> + @if(roleType == 1){ + <div class="form-group"> + <label class="col-sm-3 control-label">*跳转模块:</label> + <div class="col-sm-9"> + <select style="width: 300px" class="form-control" id="model" name = "model" onchange="updateType(this)"> + <option value="">请选择</option> + <option value="0"${data.model == '不跳转' ? 'selected=selected' : ''}>不跳转</option> + <option value="1"${data.model == '加入玩湃' ? 'selected=selected' : ''}>加入玩湃</option> + <option value="2"${data.model == '开始课程' ? 'selected=selected' : ''}>开始课程</option> + <option value="3"${data.model == '使用福利' ? 'selected=selected' : ''}>使用福利</option> + <option value="4"${data.model == '探索玩湃' ? 'selected=selected' : ''}>探索玩湃</option> + </select> + </div> + </div> + @} + <div class="form-group" id="t1"> + <label class="col-sm-3 control-label">*跳转页面:</label> + <div class="col-sm-9"> + <select style="width: 300px" class="form-control" id="page" name = "page" onchange="updateOne(this)"> + <option value="">请选择</option> + @for(obj in pages){ + <option value="${obj.id}" ${obj.id == data.jumpPage ? 'selected=selected' : ''}>${obj.name}</option> + @} + </select> + </div> + </div> + @if(roleType == 1){ + <div class="form-group" id="t2"> + <label class="col-sm-3 control-label">*跳转类型:</label> + <div class="col-sm-9"> + <select style="width: 300px" class="form-control" id="type" name = "page" onchange="updateT(this)"> + <option value="">请选择</option> + @for(obj in types){ + <option value="${obj.id}" ${obj.id == data.typeId ? 'selected=selected' : ''}>${obj.name}</option> + @} + </select> + </div> + </div> + + <div class="form-group" id="t3"> + <label class="col-sm-3 control-label">*跳转ID:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" value="${data.turnId}" class="form-control" id="pageId" name="name" placeholder="请输入跳转id" type="number"> + </div> + </div> + @} + <div class="form-group" style="margin-left: 13%;display: inline-flex;margin-top: 16px;" > + <label class="col-sm-2 control-label">*内容设置:</label> + <div class="col-sm-5" style="margin-left: -35px;"> + <textarea type="text/plain" id="editor" style="height: 300px;width: 800px;">${data.content}</textarea> + </div> + </div> + <div class="row btn-group-m-t"> + <div class="col-sm-10 col-sm-offset-5" > + <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THomeModule.updateSubmit()"/> + </div> + </div> + </div> + </div> +</div> + +<script src="${ctxPath}/modular/system/tHomeModule/tHomeModule_info.js"></script> +<script src="${ctxPath}/modular/system/tHomeModule/tHomeModule.js"></script> +<script src="${ctxPath}/js/vue/vue.js"></script> +<script src="${ctxPath}/js/elementui/index.js"></script> +<link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> +<script> + laydate.render({ + elem: '#time', + range:true + }); + + function updateType(e) { + let name = $("#model").val(); + console.log(name); + if(name =='0'){ + $("#t1").hide() + $("#t2").hide() + $("#t3").hide() + $("#t1").val("") + $("#t2").val("") + $("#t3").val("") + $("#page").val("") + $("#type").val("") + $("#pageId").val("") + }else { + $("#t1").show() + $("#t2").show() + $("#t3").show() + + var oneId = $('#model option:selected').text(); + var ajax = new $ax(Feng.ctxPath + "/tShop/typeChange", function(data){ + if(data!=null){ + var content = '<option value="">请选择</option>'; + $.each(data, function(k,v) { + + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#page").empty().append(content); + } + }); + ajax.set("name",oneId); + ajax.start(); + } + + + } + + + function updateOne(e) { + console.log($('#page option:selected').text()) + var page= $('#page option:selected').text(); + if (page=="门店列表" || page=="主页" || page=="充值中心"){ + $("#t3").hide(); + $("#t2").hide(); + $("#t2").val("") + $("#t3").val("") + $("#type").val("") + $("#pageId").val("") + } + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tShop/typeChangeOne", function(data){ + if(data!=null&&data.length>0){ + $("#t2").show() + var content1 = '<option value="">请选择</option>'; + $.each(data, function(k,v) { + content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#type").empty().append(content1); + }else{ + console.log("=-======0000") + $("#t2").val("") + $("#t2").hide() + $("#type").val("") + + } + }); + if (oneId==2 || oneId==25|| oneId==27){ + $("#t3").val("") + $("#t3").hide() + + $("#pageId").val("") + } + ajax.set("id",oneId); + ajax.start(); + updateT(document.getElementById("type")); + + } + + function updateT(e) { + var oneId = $('#type option:selected').text(); + console.log(oneId); + if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ + $("#t3").hide() + $("#t3").val("") + $("#pageId").val("") + + }else{ + $("#t3").show() + } + var page = $('#page option:selected').text(); + if (page=="线上课得积分" || page=="看视频得奖励"){ + if (oneId == "列表"){ + $("#t3").show() + } + } + } + window.onload = function() { + + + } + + + $(function(){ + + if ($('#model option:selected').text()=="不跳转"){ + $("#t1").hide(); + $("#t2").hide(); + $("#t3").hide(); + $("#page").val("") + $("#type").val("") + $("#pageId").val("") + } + + var temp = $("#turnId").val(); + if (temp==""){ + $("#t3").hide(); + $("#t3").val("") + $("#pageId").val("") + } + // 查看跳转页面 有没有跳转类型 + var page = $('#page option:selected').text(); + if (page=="门店列表" || page=="主页" || page=="充值中心" ){ + $("#t2").hide(); + $("#t3").hide(); + $("#t2").val("") + $("#t3").val("") + $("#type").val("") + $("#pageId").val("") + } + + var OBJradio=document.getElementsByName("isOpen") + for(i=0;i<OBJradio.length;i++){//循环查找这个radio + if($("#isOpen").val()==OBJradio[i].value){//判断是否与radio的值相同 + OBJradio[i].checked=true//修改选中状态 + } + } + var OBJradio=document.getElementsByName("isTop") + for(i=0;i<OBJradio.length;i++){//循环查找这个radio + if($("#isTop").val()==OBJradio[i].value){//判断是否与radio的值相同 + OBJradio[i].checked=true//修改选中状态 + } + } + }) +</script> +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop.html index ea2c6a4..069df13 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop.html @@ -70,7 +70,9 @@ <#button name="免费福利" icon="fa-remove" clickFun="TCompetition.gift()" space="true"/> <#button name="首页设置" icon="fa-remove" clickFun="TCompetition.indexSet()" space="true"/> <#button name="SUTU设置" icon="fa-plus" clickFun="TCompetition.addDevice()" space="true"/> - + @if(role == '1'){ + <#button name="平台首页设置" icon="fa-edit" clickFun="TCompetition.platformSet()" space="true"/> + @} </div> <#table id="TCompetitionTable"/> </div> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add.html index 82e3767..8c141cb 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add.html @@ -156,7 +156,7 @@ </div> </div> - <#input id="ids" name="添加入园闸机" placeholder= "请输入入园闸机id,多个用逗号分隔" type="text"/> + <!--<#input id="ids" name="添加入园闸机" placeholder= "请输入入园闸机id,多个用逗号分隔" type="text"/>--> </div> </div> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit.html index 5ba1c62..d179f30 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit.html @@ -136,7 +136,7 @@ </div> </div> - <#input id="ids" name="添加入园闸机" type="text" value="${item.ids}"/> + <!--<#input id="ids" name="添加入园闸机" type="text" value="${item.ids}"/>--> </div> <div class="row btn-group-m-t"> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_imgAll.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_imgAll.html index 2df1d24..2f346f1 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_imgAll.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_imgAll.html @@ -12,6 +12,7 @@ <input hidden id="s6" value="${c6.isOpen}"> <input hidden id="s7" value="${c7.isOpen}"> <input hidden id="s8" value="${c8.isOpen}"> + <input hidden id="s9" value="${c9.isOpen}"> <div class="row"> <div class="col-lg-6" style=""> <div class="form-group" style="margin-left: 96px"> @@ -181,6 +182,28 @@ </div> </div> + <div style="font-size: x-large;">社区世界杯板块</div> + <div class="row"> + <div class="col-lg-6" style=""> + <div class="form-group" style="margin-left: 96px"> + <label class="col-sm-4 control-label" > + 社区世界杯:<input type="radio" name="r9" value="1">开启 <input type="radio" name="r9" value="0">关闭 + </label> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">排序:</label> + <div class="col-sm-9"> + <input class="form-control" style="width: 200px;" type="text" id="px9" value="${c9.sort}"> + </div> + </div> + @if(c9==null){ + <#avatar id="c9" name="背景图" /> + @} + @if(c9!=null){ + <#avatar id="c9" name="背景图" avatarImg="${c9.backgroundImage}"/> + @} + </div> + </div> <div style="font-size: x-large;">首页其他板块设置</div> <#button name="添加" icon="fa-plus" clickFun="TCompetition.openAddTCompetition(id)"/> @@ -256,6 +279,13 @@ } } + var OBJradio=document.getElementsByName("r9") + for(i=0;i<OBJradio.length;i++){//循环查找这个radio + if($("#s9").val()==OBJradio[i].value){//判断是否与radio的值相同 + OBJradio[i].checked=true//修改选中状态 + } + } + } </script> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_add.html index dcb9589..74fa8f6 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_add.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_add.html @@ -94,6 +94,14 @@ </div> <#input style="width: 300px" id="name" name="*场地名称" type="text"/> + <div class="form-group"> + <label class="col-sm-3 control-label">是否可预约:</label> + <div class="col-sm-9"> + <input type="radio" name="reservation" value="1" checked onclick="updateHtml(1)"> 是 + <input type="radio" name="reservation" value="0" onclick="updateHtml(0)"> 否 + </div> + </div> + <div id = reservation> <div class="form-group" > <label class="col-sm-3 control-label">*可预约时间段:</label> <!-- <input style="width: 300px" class="form-control" type="time">--> @@ -154,6 +162,7 @@ </div> </div> </div> + </div> <div class="form-group"> <label class="col-sm-3 control-label">*场地责任险有效期:</label> <div class="col-sm-9"> @@ -192,7 +201,7 @@ </div> </div> </div> - <#input style="width: 300px" id="ids" name="*添加闸机:" placeholder="请输入闸机ID" type="text"/> + @if(objectType==1){ <div class="form-group" style=" margin-left: 17%;" > <label class="col-sm-1 control-label">场地说明:</label> @@ -320,8 +329,8 @@ }else { $("#halfCode").show() } - } + var vue2 = new Vue({ el: '#app1', @@ -371,6 +380,15 @@ endTime.disabled = true; } }); + function updateHtml(e) { + console.log("进入看看") + console.log(e) + if(e==0){ + $("#reservation").hide() + }else { + $("#reservation").show() + } + } function updateTime1() { var selectedValue = document.getElementById("siteTypeOne").value; var priceLabel = document.getElementById("priceLabel"); diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_edit.html index b8c7926..17b1cf6 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_edit.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tSite/TSite_edit.html @@ -47,6 +47,7 @@ <div class="form-horizontal" id="carInfoForm"> <input id="type_" value="${list.ishalf}" hidden> + <input id="reservation" value="${list.reservation}" hidden> <input id="objectType" value="${objectType}" hidden> @if(objectType == 1){ @@ -102,6 +103,14 @@ <input style="width: 300px" class="form-control" id="name" name="name" type="text" value="${list.name}"> </div> </div> + <div class="form-group"> + <label class="col-sm-3 control-label">是否可预约:</label> + <div class="col-sm-9"> + <input type="radio" name="reservation" value="1" onclick="updateHtml(1)"> 是 + <input type="radio" name="reservation" value="0" onclick="updateHtml(0)"> 否 + </div> + </div> + <div id = reservation1> <div class="form-group" > <label class="col-sm-3 control-label">*可预约时间段:</label> <div class="col-sm-9" style="display: flex"> @@ -183,7 +192,7 @@ </div> @} </div> - + </div> <div class="form-group"> <label class="col-sm-3 control-label">*场地责任险有效期:</label> @@ -225,12 +234,12 @@ </div> </div> </div> - <div class="form-group" style="margin-left: 205px;"> - <label class="col-sm-1 control-label">*添加闸机:</label> - <div class="col-sm-9"> - <input class="form-control" id="ids" name="ids" value="${list.ids}" type="text" style="width: 300px" placeholder="请输入闸机ID"> - </div> - </div> +<!-- <div class="form-group" style="margin-left: 205px;">--> +<!-- <label class="col-sm-1 control-label">*添加闸机:</label>--> +<!-- <div class="col-sm-9">--> +<!-- <input class="form-control" id="ids" name="ids" value="${list.ids}" type="text" style="width: 300px" placeholder="请输入闸机ID">--> +<!-- </div>--> +<!-- </div>--> @if(objectType==1){ <div class="form-group" style="margin-left: 13%;display: inline-flex;margin-top: 16px;" > <label class="col-sm-2 control-label">场地说明:</label> @@ -358,7 +367,15 @@ } }); - + function updateHtml(e) { + console.log("进入看看") + console.log(e) + if(e==0){ + $("#reservation1").hide() + }else { + $("#reservation1").show() + } + } window.onload = function(){ var siteTypeOne = document.getElementById('siteTypeOne'); siteTypeOne.onchange(); // Trigger the onchange event @@ -381,8 +398,19 @@ } } - + var OBJradio1=document.getElementsByName("reservation") + if($("#reservation").val()==1){ + $("#reservation1").show() + }else{ + $("#reservation1").hide() + } + for(j=0;j<OBJradio1.length;j++){//循环查找这个radio + if($("#reservation").val()==OBJradio1[j].value){//判断是否与radio的值相同 + OBJradio1[j].checked=true//修改选中状态 + } + } } + // 选择了不可预约 可预约时间段、价格、多场地配置、半场配置,都不展示。 function addBox1() { var a=" <div class=\"col-sm-8 control-label\" id=\"far\" style=\"margin-left: 210px;\">\n" + diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ticket/ticket_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ticket/ticket_add.html index 84a4b05..18b7785 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/ticket/ticket_add.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/ticket/ticket_add.html @@ -150,13 +150,17 @@ value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 38%;margin-top: 6px;">指定门店</label> </div> + <div class="col-sm-2" id="belongsSite" > + <input class="col-sm-1" name="company" onclick="scopeOfApplication4()" type="radio" + value="4" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> + <label class="col-sm-1" style="width: 38%;margin-top: 6px;">指定场地</label> + </div> </div> </div> </div> </div> @} - <div class="row" id="citySelect" hidden="hidden"> <div class="form-group"> <div class="form-group"> @@ -201,6 +205,37 @@ </tr> </thead> <tbody id="coun"></tbody> + </table> + </div> + </div> + + </div> + </div> + @} + @if(userType!=3){ + <div class="row" id="siteSelect" hidden > + <div class="form-group"> + <div class="form-group"> + <div class="col-sm-12"> + <label class="col-sm-3 control-label">*指定场地: </label> + <button onclick="siteList1()" + style="height: 22px;width: 82px;background-color: #4a8ff1;color: white;z-index: 15;position:relative;border: none;margin-top: 1%"> + 选择场地 + </button> + </div> + <div class="col-sm-12" style="margin-left: -57px;margin-top: 20px"> + <table class="table table-bordered" style="width: 70%;margin-left: 228px;" id="siteTable"> + <thead> + <tr> + <td>所在省市</td> + <td>所属账号</td> + <td>门店名称</td> + <td>场地名称</td> + <td>闸机id</td> + <td>操作</td> + </tr> + </thead> + <tbody id="coun1"></tbody> </table> </div> </div> @@ -350,6 +385,11 @@ function scopeOfApplication3() { $("#storeSelect").show(); $("#citySelect").hide(); + $("#siteSelect").hide(); + } + function scopeOfApplication4() { + $("#siteSelect").show(); + $("#storeSelect").hide(); } function updateMethod(e) { diff --git a/cloud-server-management/src/main/webapp/static/modular/system/ball/ball.js b/cloud-server-management/src/main/webapp/static/modular/system/ball/ball.js index 3ba40bc..d88e64c 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/ball/ball.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/ball/ball.js @@ -29,8 +29,26 @@ {title: '市', field: 'city', visible: true, align: 'center', valign: 'middle'}, { title: '门店名称', field: 'store', visible: true, align: 'center', valign: 'middle'}, { title: '所属场地', field: 'site', visible: true, align: 'center', valign: 'middle'}, - { title: '蓝方设备ID', field: 'blue', visible: true, align: 'center', valign: 'middle'}, - { title: '红方设备ID', field: 'red', visible: true, align: 'center', valign: 'middle'}, + { title: '红方设备二维码', field: 'redCode', visible: false, align: 'center', valign: 'middle'}, + { title: '蓝方设备二维码', field: 'blueCode', visible: false, align: 'center', valign: 'middle'}, + { title: '蓝方设备ID', field: 'blue', visible: true, align: 'center', valign: 'middle', + formatter: function (data,row) { + // row.redCode存储的设备二维码连接 + var temp = row.blueCode; + var str = '<button class="btn btn-outline btn-primary" onclick="TStudent.openDetail(\'' + temp + '\')" >'+row.blue+'</button>' + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>'] + return btn; + } + }, + { title: '红方设备ID', field: 'red', visible: true, align: 'center', valign: 'middle', + formatter: function (data,row) { + // row.redCode存储的设备二维码连接 + var temp = row.redCode; + var str = '<button class="btn btn-outline btn-primary" onclick="TStudent.openDetail(\'' + temp + '\')" >'+row.red+'</button>' + btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>'] + return btn; + } + }, { title: '设备类型', field: 'deviceType', @@ -72,7 +90,39 @@ } }; +TStudent.openDetail = function (e) { + console.log("看看") + console.log(e) + var index = layer.load(1,{ + type: 1 + , title: '设备二维码' + , area: ['100%', '100%'] + , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset + , id: 'layerDemo' //防止重复弹出cge + , content: '<div class="form-horizontal">' + + ' <img src='+ e +'>' + + '</img>'+ + '</div>' + , btn: ['关闭', '下载'] + , btnAlign: 'c' //按钮居中 + , shade: 0.5 //不显示遮罩 + ,load:1 + , yes: function () { + layer.closeAll(); + }, + btn2:function () { + var a = document.createElement('a'); + a.href = e; + a.download = '设备二维码.jpg'; // 设置下载文件的名称 + a.style.display = 'none'; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + } + }); + this.layerIndex = index; +}; TStudent.editCoursePackageState = function (state) { if (this.check()) { diff --git a/cloud-server-management/src/main/webapp/static/modular/system/gate/gate.js b/cloud-server-management/src/main/webapp/static/modular/system/gate/gate.js new file mode 100644 index 0000000..b3436bf --- /dev/null +++ b/cloud-server-management/src/main/webapp/static/modular/system/gate/gate.js @@ -0,0 +1,489 @@ +/** + * 跨城站点管理管理初始化 + */ +var TSite = { + id: "TSiteTable", //表格id + seItem: null, //选中的条目 + table: null, + layerIndex: -1, + picture:"", + fileUrl:"", + img:"", + plan:"", + goodsPicArray:[], + validateFields: { + } +}; +var objectType =$("#objectType").val() +/** + * 初始化表格的列 + */ +TSite.initColumn = function () { + return [ + {field: 'selectItem', checkbox: true}, + {title: '主键id', field: 'id', visible: false, align: 'center', valign: 'middle'}, + {title: '闸机名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:'20%'}, + {title: '硬件编号', field: 'device', visible: true, align: 'center', valign: 'middle'}, + {title: '所属运营商', field: 'operatorName', visible: true, align: 'center', valign: 'middle'}, + {title: '所属门店', field: 'storeName', visible: true, align: 'center', valign: 'middle',}, + {title: '所属场地', field: 'siteName', visible: true, align: 'center', valign: 'middle',}, + ]; +}; + +/** + * 检查是否选中 + */ +TSite.check = function () { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length == 0){ + Feng.info("请先选中表格中的某一记录!"); + return false; + }else{ + TSite.seItem = selected[0]; + return true; + } +}; +/** + * 上架 + */ +TSite.onShelf = function () { + if (this.check()){ + var selected = $('#' + this.id).bootstrapTable('getSelections'); + const data1 = { + ids:[], + state:null + }; + selected.forEach(function(obj) { + var id = obj.id; + data1.ids.push(id); + }); + data1.state = 1; + $.ajax({ + url: Feng.ctxPath + "/advertisement/changeState", + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + success: function(response) { + Feng.success("上架成功!"); + TSite.search(); + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; + Feng.error("您的网络异常!"); + } + }); + } +}; + +/** + * 下架 + */ +TSite.offShelf = function () { + if (this.check()){ + var selected = $('#' + this.id).bootstrapTable('getSelections'); + const data1 = { + ids:[], + state:null + }; + selected.forEach(function(obj) { + var id = obj.id; + data1.ids.push(id); + }); + data1.state = 2; + $.ajax({ + url: Feng.ctxPath + "/advertisement/changeState", + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + success: function(response) { + Feng.success("下架成功!"); + TSite.search(); + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "下架失败!"; + } + }); + } +}; + +/** + * 跳转添加广告页面 + */ +TSite.openAddTSite = function () { + var index = layer.open({ + type: 2, + title: "添加广告", + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/gate/add' + }); + this.layerIndex = index; +}; +/** + * 跳转基础页面配置 + */ +TSite.basic = function () { + var index = layer.open({ + type: 2, + title: "基础页面配置", + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/gate/config' + }); + this.layerIndex = index; +}; +/** + * 跳转福利页面配置 + */ +TSite.benefits = function () { + var index = layer.open({ + type: 2, + title: "福利页面配置", + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/advertisement/benefits' + }); + this.layerIndex = index; +}; + +/** + * 打开查看详情页面 + */ +TSite.openInfo = function () { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length >1 ){ + Feng.info("只能选择一个广告进行查看!"); + }else { + if (this.check()) { + var index = layer.open({ + type: 2, + title: "查看详情", + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/advertisement/update/' + TSite.seItem.id+'/1' + }); + this.layerIndex = index; + } + } +}; +/** + * 跳转编辑页面 + */ +TSite.openEditTSite = function () { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length >1 ){ + Feng.info("只能选择一个闸机进行编辑!"); + }else { + if (this.check()) { + var index = layer.open({ + type: 2, + title: "编辑广告", + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/gate/update/' + TSite.seItem.id + }); + this.layerIndex = index; + } + } +}; + +/** + * 关闭此对话框 + */ +TSite.close = function() { + parent.layer.close(window.parent.TSite.layerIndex); +}; +TSite.oneChange = function () { + var modelId = $('#model option:selected').val(); + var pageSelect = document.getElementById("page"); + var typeSelect = document.getElementById("type"); + var ajax = new $ax(Feng.ctxPath + "/tSite/getCity", function(data){ + if(data!=null){ + var content='<option value="">选择跳转页面</option>'; + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#cCode").empty().append(content); + } + }); + if (modelId === ""){ + pageSelect.innerHTML = '<option value="">请先选择跳转模块</option>'; + typeSelect.innerHTML = '<option value="">请先选择跳转模块</option>'; + } + ajax.set("province",province); + ajax.start(); +}; +TSite.addConfig = function(){ + $("#cover1").val(); + $("#cover2").val(); + $("#cover7").val(); + var ajax = new $ax(Feng.ctxPath + "/advertisement/updateConfig", function (data) { + Feng.success("基础页面设置成功") + }); + ajax.set("p1",$("#cover1").val()) + ajax.set("p2",$("#cover2").val()) + ajax.set("p7",$("#cover7").val()) + ajax.start(); +} +TSite.addBenefits = function(){ + $("#cover3").val(); + $("#cover4").val(); + $("#cover5").val(); + $("#cover6").val(); + var ajax = new $ax(Feng.ctxPath + "/advertisement/updateBenefits", function (data) { + Feng.success("基础页面设置成功") + }); + ajax.set("p3",$("#cover3").val()) + ajax.set("p4",$("#cover4").val()) + ajax.set("p5",$("#cover5").val()) + ajax.set("p6",$("#cover6").val()) + ajax.start(); +} +TSite.delete = function () { + if (this.check()) { + let id = this.seItem.id + var operation = function(){ + var ajax = new $ax(Feng.ctxPath + "/gate/deleteDevice", function (data) { + if (data.code!=200){ + Feng.error(data.msg) + return + }else{ + TSite.resetSearch(); + Feng.success("删除成功") + } + + }, function (data) { + Feng.error("删除失败!" + data.responseJSON.message + "!"); + }); + ajax.set("gateId",id); + ajax.start(); + } + Feng.confirm("确认删除该闸机?", operation); + } +}; + +TSite.addSubmit = function(){ + var data1 = { + id:null, + position:null, + img:"", + jumpPage:null, + sort:null, + state:1, + name:"", + type:"", + page:"", + model:null, + typeId:null, + turnId:null, + }; + let name = $("#model").val(); + data1.name = $("#name").val(); + data1.position = $("#position").val(); + data1.img = $("#img").val(); + data1.model = $('#model option:selected').text(); + data1.page = $('#page option:selected').text(); + data1.jumpPage = $("#page").val(); + data1.typeId = $("#type").val(); + data1.type = $('#type option:selected').text(); + data1.turnId = $("#pageId").val(); + data1.sort = $("#sort").val(); + + if ( $("#roleType").val()==1){ + if($("#position").val()==''){ + data1.position = $("#position").val(); + Feng.info("请选择广告类型") + return; + } + } + if($("#name").val()==''){ + + Feng.info("请输入广告名称") + return; + } + if($("#img").val()=='' ){ + Feng.info("请上传广告图片") + return; + } + if ( $("#roleType").val()==1) { + if ($("#model").val() == '') { + Feng.info("请选择跳转模块") + return; + } + } + if(name !='0'){ + if($("#page").val()=='' ){ + Feng.info("请选择跳转页面") + return; + } + } + console.log("====pagepagepage==============="+$("#page").val()) + if(name !='0'){ + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { + Feng.info("请选择跳转类型") + return; + } + + } + if(name !='0') { + if ($("#roleType").val() == 1) { + if ($('#type option:selected').text() == "详情"&&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { + if ($("#pageId").val() == '') { + Feng.info("请输入跳转ID") + return; + } + } + } + } + if($("#sort").val()=='' ){ + Feng.info("请输入排序") + return; + } + $.ajax({ + url: Feng.ctxPath + "/advertisement/addAdvertisement", + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + success: function(response) { + window.parent.TSite.table.refresh(); + TSite.close(); + Feng.success("添加成功!"); + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "下架失败!"; + Feng.error("您的网络异常!"); + } + }); +}; + + +TSite.updateSubmit = function(){ + + console.log("kankan") + console.log($("#img").val()) + var data1 = { + id:null, + position:null, + img:"", + jumpPage:null, + sort:null, + state:1, + name:"", + type:"", + page:"", + model:null, + typeId:null, + turnId:null, + }; + let name = $("#model").val(); + data1.name = $("#name").val(); + data1.id = $("#id").val(); + data1.position = $("#position").val(); + data1.img = $("#img").val(); + data1.model = $('#model option:selected').text(); + data1.page = $('#page option:selected').text(); + data1.jumpPage = $("#page").val(); + data1.typeId = $("#type").val(); + data1.type = $('#type option:selected').text(); + data1.turnId = $("#pageId").val(); + data1.sort = $("#sort").val(); + + if ( $("#roleType").val()==1){ + if($("#position").val()==''){ + data1.position = $("#position").val(); + Feng.info("请选择广告类型") + return; + } + } + if($("#name").val()==''){ + Feng.info("请输入广告名称") + return; + } + + if ( $("#roleType").val()==1) { + if ($("#model").val() == '') { + Feng.info("请选择跳转模块") + return; + } + } + if(name !='0'){ + if($("#page").val()=='' ){ + Feng.info("请选择跳转页面") + return; + } + } + if(name !='0') { + if ($("#roleType").val() == 1) { + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { + Feng.info("请选择跳转类型") + return; + } + } + } + if(name !='0') { + if ($("#roleType").val() == 1) { + if ($('#type option:selected').text() == "详情"&&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { + if ($("#pageId").val() == '') { + Feng.info("请输入跳转ID") + return; + } + } + } + } + if($("#sort").val()=='' ){ + Feng.info("请输入排序") + return; + } + $.ajax({ + url: Feng.ctxPath + "/advertisement/updateAdvertisement", + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + success: function(response) { + window.parent.TSite.table.refresh(); + TSite.close(); + Feng.success("添加成功!"); + + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "下架失败!"; + Feng.error("您的网络异常!"); + } + }); +}; + +TSite.search = function () { + var queryData = {}; + // 广告名称 + queryData['name'] = $("#name").val(); + // 跳转页面 + queryData['device'] = $("#device").val(); + // 状态 + queryData['operatorName'] = $("#operatorName").val(); + queryData['storeName'] = $("#storeName").val(); + TSite.table.refresh({query: queryData}); +}; + +TSite.resetSearch = function () { + $("#name").val(""); + $("#device").val(""); + $("#operatorName").val(""); + $("#storeName").val(""); + TSite.search(); +}; + +function UploadFileFn(){ + $('#upFile').click(); +} + +$(function () { + var defaultColunms = TSite.initColumn(); + var table = new BSTable(TSite.id, "/gate/listAll", defaultColunms); + table.setPaginationType("client"); + TSite.table = table.init(); +}); diff --git a/cloud-server-management/src/main/webapp/static/modular/system/gate/gate_info.js b/cloud-server-management/src/main/webapp/static/modular/system/gate/gate_info.js new file mode 100644 index 0000000..f953202 --- /dev/null +++ b/cloud-server-management/src/main/webapp/static/modular/system/gate/gate_info.js @@ -0,0 +1,793 @@ +/** + * 初始化车辆管理详情对话框 + */ +var language=1; +var TCarInfoDlg = { + goodsPicArray: [], + tCarInfoData : {}, + validateFields: { + } +}; + +/** + * 验证数据是否为空 + */ +TCarInfoDlg.validate = function () { + $('#carInfoForm').data("bootstrapValidator").resetForm(); + $('#carInfoForm').bootstrapValidator('validate'); + return $("#carInfoForm").data('bootstrapValidator').isValid(); +}; + +/** + * 清除数据 + */ +TCarInfoDlg.clearData = function() { + this.tCarInfoData = {}; +} + +/** + * 设置对话框中的数据 + * + * @param key 数据的名称 + * @param val 数据的具体值 + */ +TCarInfoDlg.set = function(key, val) { + this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; + return this; +} + +/** + * 设置对话框中的数据 + * + * @param key 数据的名称 + * @param val 数据的具体值 + */ +TCarInfoDlg.get = function(key) { + return $("#" + key).val(); +} + +/** + * 关闭此对话框 + */ +TCarInfoDlg.close = function() { + parent.layer.close(window.parent.TSite.layerIndex); +} + +/** + * 收集数据 + */ +TCarInfoDlg.collectData = function() { + this + .set('id') + .set('isPlatCar') + .set('companyId') + .set('franchiseeId') + .set('carColor') + .set('carModelId') + .set('carBrandId') + .set('carLicensePlate') + .set('carPhoto') + .set('drivingLicenseNumber') + .set('drivingLicensePhoto') + .set('annualInspectionTime') + .set('commercialInsuranceTime') + .set('createTime') + .set('state') + .set('addType') + .set('addObjectId') + .set('plateColor') + .set('vehicleType') + .set('ownerName') + .set('engineId') + .set('VIN') + .set('certifyDateA') + .set('fuelType') + .set('engineDisplace') + .set('certificate') + .set('transAgency') + .set('transArea') + .set('transDateStart') + .set('transDateStop') + .set('certifyDateB') + .set('fixState') + .set('nextFixDate') + .set('checkState') + .set('feePrintId') + .set('GPSBrand') + .set('GPSModel') + .set('GPSIMEI') + .set('GPSInstallDate') + .set('registerDate') + .set('commercialType'); +} +TCarInfoDlg.addSubmit = function() { + if ($("#userType").val()==1){ + var type= $("input[name='type']:checked").val(); + console.log("看看选择类型") + console.log(type) + } + + + var ajax = new $ax(Feng.ctxPath + "/gate/addDevice", function(data){ + console.log("状态码") + console.log(data.code) + if (data.code!=200){ + Feng.error(data.msg) + return + } + console.log("调用方法") + Feng.success("添加成功") + window.parent.TSite.table.refresh(); + TCarInfoDlg.close(); + }); + if ($("#userType").val()==1) { + if (type == 0) { + ajax.set("operatorId", type); + } else { + if ($("#account").val() == null || $("#account").val() == '') { + Feng.error("请选择运营商") + return; + } + ajax.set("operatorId", $("#account").val()); + } + ajax.set("storeId",$("#store").val()); + }else if ($("#userType").val()==2){ + ajax.set("operatorId", $("#operatorId").val()); + ajax.set("storeId",$("#store").val()); + }else{ + ajax.set("storeId",$("#storeId").val()); + ajax.set("operatorId", $("#operatorId").val()); + } + if ($("#name").val()==null || $("#name").val()==''){ + console.log("名称") + Feng.error("请输入闸机名称") + return; + } + if ($("#userType").val()!=3){ + if ($("#store").val()==null || $("#store").val()==''){ + console.log("门店") + Feng.error("请选择门店") + return; + } + } + if ($("#site").val()==null || $("#site").val()==''){ + Feng.error("请选择场地") + return; + } + if ($("#device").val()==null || $("#device").val()==''){ + Feng.error("请输入硬件编号") + return; + } + ajax.set("name",$("#name").val()); + + ajax.set("siteId",$("#site").val()); + ajax.set("device",$("#device").val()); + ajax.start(); +} +TCarInfoDlg.editSubmit = function() { + if ($("#userType").val()==1){ + var type= $("input[name='type']:checked").val(); + console.log("看看选择类型") + console.log(type) + } + var ajax = new $ax(Feng.ctxPath + "/gate/updateDevice", function(data){ + console.log("状态码") + console.log(data.code) + if (data.code!=200){ + Feng.error(data.msg) + return + } + console.log("调用方法") + Feng.success("修改成功") + window.parent.TSite.table.refresh(); + TCarInfoDlg.close(); + }); + if ($("#userType").val()==1) { + if (type == 0) { + ajax.set("operatorId", type); + } else { + if ($("#account").val() == null || $("#account").val() == '') { + Feng.error("请选择运营商") + return; + } + ajax.set("operatorId", $("#account").val()); + } + ajax.set("storeId",$("#store").val()); + }else if ($("#userType").val()==2){ + ajax.set("operatorId", $("#operatorId").val()); + ajax.set("storeId",$("#store").val()); + }else{ + ajax.set("storeId",$("#storeId").val()); + ajax.set("operatorId", $("#operatorId").val()); + } + if ($("#name").val()==null || $("#name").val()==''){ + console.log("名称") + Feng.error("请输入闸机名称") + return; + } + if ($("#userType").val()!=3){ + if ($("#store").val()==null || $("#store").val()==''){ + console.log("门店") + Feng.error("请选择门店") + return; + } + } + + if ($("#site").val()==null || $("#site").val()==''){ + Feng.error("请选择场地") + return; + } + if ($("#device").val()==null || $("#device").val()==''){ + Feng.error("请输入硬件编号") + return; + } + ajax.set("name",$("#name").val()); + ajax.set("id",$("#id").val()); + ajax.set("siteId",$("#site").val()); + ajax.set("device",$("#device").val()); + ajax.start(); +} +TCarInfoDlg.oneChange = function (e) { + console.log(111) + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择市</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.code+"'>"+v.name+"</option>"; + }); + $("#cCode").empty().append(content); + } + }); + ajax.set("oneId",oneId); + ajax.start(); +} +TCarInfoDlg.oneChange9 = function (e) { + console.log(111) + var oneId=$(e).val(); + var operatorId = $("#account").val(); + var ajax = new $ax(Feng.ctxPath + "/tShop/getCityYys", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择市</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.code+"'>"+v.name+"</option>"; + }); + $("#cCode1").empty().append(content); + $("#cCode").empty().append(content); + } + }); + ajax.set("province",oneId); + ajax.set("operatorId",operatorId); + ajax.start(); +} +TCarInfoDlg.oneChangeNext = function (e) { + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tShop/oneChangeNext", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择账号</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#account").empty().append(content); + } + }); + ajax.set("oneId",oneId); + ajax.start(); +} +TCarInfoDlg.saveImg = function () { + var id=$("#id").val(); + var img=$("#welfarePicture").val(); + var ajax = new $ax(Feng.ctxPath + "/tShop/saveImg", function(data){ + if(data.code == 200){ + Feng.success("保存成功") + TCarInfoDlg.close(); + + } + }); + ajax.set("id",id); + ajax.set("img",img); + ajax.start(); +} + +/** + * 提交添加 + */ + +var map = new AMap.Map('container', { + resizeEnable: true, // 允许缩放 + zoom: 15 // 设置地图的缩放级别,0 - 20 +}); +var marker; +//搜索地图 +TCarInfoDlg.searchByStationName = function(e,type){ + console.log("调用") + var keyword=""; + if(type==2){ + keyword = $(e).parent().prev().find("input").val(); + }else { + if($("#address").val()!=null && $("#address").val()!=''){ + keyword = $("#address").val(); + } + } + type=1; + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder(); + console.log(geocoder) + console.log(keyword) + geocoder.getLocation(keyword, function(status, result) { + console.log(status,result) + if (status === 'complete' && result.info === 'OK') { + // 经纬度 + var lng = result.geocodes[0].location.lng; + var lat = result.geocodes[0].location.lat; + $("#longitude").val(lng) + $("#latitude").val(lat) + // 地图实例 + map = new AMap.Map('container', { + resizeEnable: true, // 允许缩放 + center: [lng, lat], // 设置地图的中心点 + zoom: 15 // 设置地图的缩放级别,0 - 20 + }); + //地图画点 + //addMarker(lng,lat); + if(type==1 || type==2){ + showInfoClick(); + if(lng == null){ + }else{ + addMarker(lng,lat); + } + }else{ + addMarker(lng,lat); + } + } else { + console.log('定位失败!'); + } + }); + }); +}; +//地图点击事件 +function showInfoClick(){ + map.on('click', function (e) { + addMarker(e.lnglat.getLng(),e.lnglat.getLat()); + }); +} +//删除点 +function removeMarkers(){ + if(marker!=null){ + map.remove(marker); + } + +} +// 实例化点标记 +function addMarker(lon,lat) { + removeMarkers(); + marker = new AMap.Marker({ + map: map, + position: new AMap.LngLat(lon, lat), // 经纬度 + }); + //加经纬度 + $("#lon").val(lon); + $("#lat").val(lat); + var lnglatXY = [lon, lat];//地图上所标点的坐标 + AMap.service('AMap.Geocoder',function() {//回调函数 + geocoder = new AMap.Geocoder({ + }); + geocoder.getAddress(lnglatXY, function (status, result) { + if (status === 'complete' && result.info === 'OK') { + //获得了有效的地址信息: + //即,result.regeocode.formattedAddress + // alert(result.regeocode.formattedAddress) + //document.getElementById("address").value=result.regeocode.formattedAddress;//将获取到的地址信息赋值给文本框,保存进数据库 + var address = result.regeocode.formattedAddress; + var city = result.regeocode.addressComponent.city; + var province = result.regeocode.addressComponent.province; + var district = result.regeocode.addressComponent.district; + $("#address").val(address); + } else { + //获取地址失败 + } + }); + }) +} + + + +$(function() { + Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); + // 初始化图片上传 + var carPhoto = new $WebUpload("c1"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var carPhoto = new $WebUpload("c2"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var carPhoto = new $WebUpload("c3"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var carPhoto = new $WebUpload("c4"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var carPhoto = new $WebUpload("c5"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var carPhoto = new $WebUpload("c6"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var carPhoto = new $WebUpload("c7"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var carPhoto = new $WebUpload("c8"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var carPhoto = new $WebUpload("img"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var carPhoto = new $WebUpload("welfarePicture"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); + drivingLicensePhoto.setUploadBarId("progressBar"); + drivingLicensePhoto.init(); + + //地图搜索 + TCarInfoDlg.searchByStationName(); +}); + +/** + * 选择分公司后执行 + */ +TCarInfoDlg.oneChange = function (e) { + if ($("#objectType").val()==2){ + + }else{ + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择市</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.code+"'>"+v.name+"</option>"; + }); + $("#cCode1").empty().append(content); + } + }); + ajax.set("oneId",oneId); + ajax.start(); + } + +} + +/** + * 类型改变执行 + * @param e + */ +TCarInfoDlg.companyTypeClick = function (e) { + if (1 == e){ + $(".companyDiv").hide(); + } else if (2 == e){ + $(".companyDiv").show(); + } +} + +/** + * 车辆品牌改变时执行 + */ +TCarInfoDlg.saveAllImg = function (e) { + var id = $("#id").val() + var px1 = $("#px1").val() + var px2 = $("#px2").val() + var px3 = $("#px3").val() + var px4 = $("#px4").val() + var px5 = $("#px5").val() + var px6 = $("#px6").val() + var px7 = $("#px7").val() + var px8 = $("#px8").val() + var c1 = $("#c1").val() + var c2 = $("#c2").val() + var c3 = $("#c3").val() + var c4 = $("#c4").val() + var c5 = $("#c5").val() + var c6 = $("#c6").val() + var c7 = $("#7").val() + var c8 = $("#c8").val() + var r1 = document.querySelector('input[name="r1"]').checked; + var r2 = document.querySelector('input[name="r2"]').checked; + var r3 = document.querySelector('input[name="r3"]').checked; + var r4 = document.querySelector('input[name="r4"]').checked; + var r5 = document.querySelector('input[name="r5"]').checked; + var r6 = document.querySelector('input[name="r6"]').checked; + var r7 = document.querySelector('input[name="r7"]').checked; + var r8 = document.querySelector('input[name="r8"]').checked; + if(r1){ + r1 =1 + }else{ + r1=0 + } + if(r2){ + r2 =1 + }else{ + r2=0 + } + if(r3){ + r3 =1 + }else{ + r3=0 + } + if(r4){ + r4 =1 + }else{ + r4=0 + } + if(r5){ + r5 =1 + }else{ + r5=0 + } + if(r6){ + r6 =1 + }else{ + r6=0 + } + if(r7){ + r7 =1 + }else{ + r7=0 + } + if(r8){ + r8 =1 + }else{ + r8=0 + } + + var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ + if(data.code == 200){ + Feng.success("保存成功!"); + }else{ + Feng.error(data.msg); + } + },function(data){ + Feng.error("保存失败!" + data.responseJSON.message + "!"); + + }); + ajax.set("id",id); + ajax.set("px1",px1); + ajax.set("px2",px2); + ajax.set("px3",px3); + ajax.set("px4",px4); + ajax.set("px5",px5); + ajax.set("px6",px6); + ajax.set("px7",px7); + ajax.set("px8",px8); + ajax.set("c1",c1); + ajax.set("c2",c2); + ajax.set("c3",c3); + ajax.set("c4",c4); + ajax.set("c5",c5); + ajax.set("c6",c6); + ajax.set("c7",c7); + ajax.set("c8",c8); + ajax.set("r1",r1); + ajax.set("r2",r2); + ajax.set("r3",r3); + ajax.set("r4",r4); + ajax.set("r5",r5); + ajax.set("r6",r6); + ajax.set("r7",r7); + ajax.set("r8",r8); + ajax.start(); +} + +/** + * 专车服务被点击 + */ +TCarInfoDlg.zcServerClick = function () { + var serverBox1 = $('#serverBox1').prop('checked'); + if (serverBox1){ + $("#zcModelDiv").show(); + } else { + $("#zcModelDiv").hide(); + } +} + +/** + * 跨城服务被点击 + */ +TCarInfoDlg.kcServerClick = function () { + var serverBox3 = $('#serverBox3').prop('checked'); + if (serverBox3){ + $("#kcModelDiv").show(); + } else { + $("#kcModelDiv").hide(); + } +} + + +TCarInfoDlg.oneChange1 = function (e) { + console.log(111) + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tShop/onChange1", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择省</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.code+"'>"+v.name+"</option>"; + }); + $("#pCode").empty().append(content); + } + }); + ajax.set("oneId",oneId); + ajax.start(); +} +TCarInfoDlg.oneChange1Next = function (e) { + console.log(111) + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tShop/onChange1", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择省</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#pCode").empty().append(content); + } + }); + ajax.set("oneId",e); + ajax.start(); +} +TCarInfoDlg.oneChange2 = function (e) { + console.log(111) + var oneId=$(e).val(); + var elementById = document.getElementById("radio1"); + // 如果选中了运营商门店 那就查询这个运营商下的市 + if (elementById.checked){ + var operatorId = $("#account").val(); + console.log("我看看运营商id") + var ajax = new $ax(Feng.ctxPath + "/tShop/getCityYys", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择市</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.code+"'>"+v.name+"</option>"; + }); + $("#cCode1").empty().append(content); + $("#cCode").empty().append(content); + } + }); + ajax.set("province",oneId); + ajax.set("operatorId",operatorId); + ajax.start(); + }else{ + var ajax = new $ax(Feng.ctxPath + "/tShop/onChange2", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择市</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.code+"'>"+v.name+"</option>"; + }); + $("#cCode").empty().append(content); + } + }); + ajax.set("oneId",oneId); + ajax.start(); + } + +} +TCarInfoDlg.getStore = function (e) { + var operatorId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/gate/getStore", function(data){ + if(data!=null){ + var content="<option value=''>选择门店</option>"; + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#store").empty().append(content); + } + }); + ajax.set("operatorId",operatorId); + ajax.start(); +}; +TCarInfoDlg.getSite = function (e) { + var storeId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/gate/getSite", function(data){ + if(data!=null){ + var content="<option value=''>选择场地</option>";; + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#site").empty().append(content); + } + }); + ajax.set("storeId",storeId); + ajax.start(); +} + + + + + + +TCarInfoDlg.oneChangeNext1 = function (e) { + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tCompetition/oneChangeNext", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择门店</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#shopId").empty().append(content); + } + }); + ajax.set("oneId",oneId); + ajax.start(); +} + + +TCarInfoDlg.oneChangeNext3 = function (e) { + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tCompetition/oneChangeNext", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择门店</option>'; + }else if(language==2){ + var content='<option value="">Choose your franchisee</option>'; + }else { + var content='<option value="">Pilih franchisee Anda</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.code+"'>"+v.name+"</option>"; + }); + $("#shopId").empty().append(content); + } + }); + ajax.set("oneId",oneId); + ajax.start(); +} \ No newline at end of file diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TSiteInfo.js b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TSiteInfo.js new file mode 100644 index 0000000..f8b2538 --- /dev/null +++ b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TSiteInfo.js @@ -0,0 +1,153 @@ +/** + * 管理初始化 + */ +var TStoreProvince = { + id: "TStoreProvinceTable", //表格id + seItem: null, //选中的条目 + table: null, + layerIndex: -1, + storeList: [] +}; + +/** + * 初始化表格的列 + */ +TStoreProvince.initColumn = function () { + return [ + {field: 'selectItem', checkbox: true}, + {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, + {title: '所在省市', field: 'provinceCity', visible: true, align: 'center', valign: 'middle'}, + {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, + {title: '场地名称', field: 'siteName', visible: true, align: 'center', valign: 'middle'}, + ]; +}; + +/** + * 检查是否选中 + */ +TStoreProvince.check = function () { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length == 0){ + Feng.info("请先选中表格中的某一记录!"); + return false; + }else{ + TStoreProvince.seItem = selected[0]; + return true; + } +}; + + +TStoreProvince.storeOfClosePage = function (){ + parent.layer.close(parent.layer.getFrameIndex(window.frameElement.id)); +} + + +TStoreProvince.saveSelectSites = function (){ + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if (selected.length == 0) { + Feng.info("请先选中表格中的某一记录!"); + return false; + } + var arr = []; + var name =''; + for(var i in selected){ + if(typeof selected[i].id != "undefined"){ + console.log( selected[i].ids,55555) + name = selected[0].accountName + if(name!=selected[i].accountName){ + Feng.info("请选择相同运营商场地") + return ; + } + arr.push({ + id: selected[i].id, + provinceCity: typeof selected[i].provinceCity != "undefined" ? selected[i].provinceCity : "", + accountName: typeof selected[i].accountName != "undefined" ? selected[i].accountName : "", + name: typeof selected[i].name != "undefined" ? selected[i].name : "", + siteName: typeof selected[i].siteName != "undefined" ? selected[i].siteName : "", + ids:typeof selected[i].ids != "undefined" ? selected[i].ids : "", + }) + } + } + window.parent.TGoodsInfoDlg.selecUserOpt1(arr); + TStoreProvince.storeOfClosePage(); +} + + + +/** + * 查询列表 + */ +TStoreProvince.search = function () { + var queryData = {}; + queryData['provinceId'] = $("#pCode").val(); + queryData['cityId'] = $("#cCode").val(); + queryData['operatorId'] = $("#account").val(); + queryData['storeName'] = $("#storeName").val(); + TStoreProvince.table.refresh({query: queryData}); +}; + + +/** + * 重置搜索 + */ +TStoreProvince.resetSearch = function () { + $("#pCode").val('') + $("#cCode").val('') + $("#storeName").val('') + $("#account").val('') + TStoreProvince.search(); +}; + +function queryProvince(){ + // 发送AJAX请求到后台获取省份数据 + // 假设后台返回的数据格式为一个包含省份ID和名称的数组 + var provinceSelect = document.getElementById("province"); + + var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getProvince", function(data){ + data.forEach(province => { + var option = document.createElement("option"); + option.value = province.code; // 根据你的数据结构确定省份的id字段 + option.text = province.name; // 根据你的数据结构确定省份的name字段 + provinceSelect.appendChild(option); + }); + },function(data){ + Feng.error("下拉失败!" + data.responseJSON.message + "!"); + }); + ajax.start(); + provinceSelect.addEventListener("change", queryCity); +} + + +// 获取城市数据 +function queryCity() { + var selectedProvinceId = this.value; // 获取选择的省份ID + // 发送AJAX请求到后台获取对应省份的城市数据 + // 假设后台返回的数据格式为一个包含城市ID和名称的数组 + + var citySelect = document.getElementById("city"); + citySelect.innerHTML = ""; + var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getCity1", function(data){ + + data.forEach(province => { + var content='<option value="">选择市</option>'; + $.each(data, function(k,v) { + content += "<option value='"+v.code+"'>"+v.name+"</option>"; + }); + $("#city").empty().append(content); + + }); + },function(data){ + console.log('data:',data) + Feng.error("获取失败!" + data.responseJSON.message + "!"); + }); + ajax.set('province',selectedProvinceId); + ajax.start(); +} + +$(function () { + var defaultColunms = TStoreProvince.initColumn(); + var table = new BSTable(TStoreProvince.id, "/tCouponManage/siteDetailsOfSearch", defaultColunms); + table.setPaginationType("client"); + TStoreProvince.table = table.init(); + queryProvince(); +}); diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TStoreInfo.js b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TStoreInfo.js index f72e818..90e7cb9 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TStoreInfo.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TStoreInfo.js @@ -18,6 +18,7 @@ {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, {title: '所在省市', field: 'provinceCity', visible: true, align: 'center', valign: 'middle'}, {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, + ]; }; @@ -145,6 +146,5 @@ var table = new BSTable(TStoreProvince.id, "/tCouponManage/storeDetailsOfSearch", defaultColunms); table.setPaginationType("client"); TStoreProvince.table = table.init(); - queryProvince(); }); diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js index 1a40591..e9fd6df 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js @@ -9,6 +9,7 @@ goodsPicArray:[], goodsPicArray1:[], storeIds: [], + siteIds: [], }; @@ -113,6 +114,18 @@ }); this.layerIndex = index; } +function siteList1(){ + var index = layer.open({ + type: 2, + title: '门店列表', + area: ['80%', '80%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/tGoods/siteList1' + }); + this.layerIndex = index; +} + function storeList(){ var index = layer.open({ type: 2, @@ -125,7 +138,6 @@ this.layerIndex = index; } TGoodsInfoDlg.selecUserOpt = function (arrays){ - //获取所有的值 var subArr= this.storeIds; console.log(subArr) @@ -152,6 +164,36 @@ } } $("#coun").append(str); +} +TGoodsInfoDlg.selecUserOpt1 = function (arrays){ + console.log("进入") + //获取所有的值 + var subArr= this.siteIds; + console.log(subArr) + $(".timeClass").each(function () { + subArr.push($(this).find("input[name*='id']").val()); + }); + var str = ''; + for(var i in arrays){ + var b = true; + for(var j in subArr){ + if(arrays[i].id === Number(subArr[j])){ + b = false; + break + } + } + if(b){ + this.siteIds.push(arrays[i].id) + str += '<tr class="timeClass">' + + '<td><input type="hidden" id="id" name="id" value="'+arrays[i].id+'"><input type="hidden" id="provinceCity" name="provinceCity" value="'+arrays[i].provinceCity+'">' + arrays[i].provinceCity + '</td>' + + '<td><input type="hidden" id="accountName" name="accountName" value="'+arrays[i].accountName+'">' + arrays[i].accountName + '</td>' + + '<td><input type="hidden" id="name" name="name" value="'+arrays[i].name+'">' + arrays[i].name + + '<td><input type="hidden" id="siteName" name="siteName" value="'+arrays[i].siteName+'">' + arrays[i].siteName + + '<td><input type="hidden" id="ids" name="ids" value="'+arrays[i].ids+'">' + arrays[i].ids + + '</td><td><button onclick="deleteSub(this)">移除</button></td></tr>'; + } + } + $("#coun1").append(str); } function deleteSub(e) { console.log(e); @@ -626,39 +668,46 @@ } TGoodsInfoDlg.addSubmit1 = function() { - let company = 3; + var company = 3; + var radioButtons = document.getElementsByName("company"); + for (var i = 0; i < radioButtons.length; i++) { + if (radioButtons[i].checked) { + company = radioButtons[i].value; + break; + } + } + console.log("看看作用域") + console.log(company) this.clearData(); this.collectData(); var cityIds = []; var cts = ""; - if (company === '2'){ - var myselect=document.getElementById('cityData'); - var seCity = myselect.options[myselect.selectedIndex].value; - if (seCity === null || seCity === undefined || seCity === ''){ - return Feng.error('请选中一个省市'); - } - cityIds.push(seCity); - console.log("看看num") - console.log(num) - if (num > 0){ - for (let i = 1; i <= num; i++) { - var insSelect=document.getElementById('cityData'+i); - var inData = insSelect.options[insSelect.selectedIndex].value; - if (inData !== undefined || inData !== null || inData !== ''){ - cityIds.push(inData); - } - } - - - }else { - // 如果只有一个城市,则将cts设置为字符串 - if (cityIds.length === 1) { - cts = cityIds[0]; - } else { - cts = cityIds.join(','); - } - } - } + // if (company === '2'){ + // var myselect=document.getElementById('cityData'); + // var seCity = myselect.options[myselect.selectedIndex].value; + // if (seCity === null || seCity === undefined || seCity === ''){ + // return Feng.error('请选中一个省市'); + // } + // cityIds.push(seCity); + // console.log("看看num") + // console.log(num) + // if (num > 0){ + // for (let i = 1; i <= num; i++) { + // var insSelect=document.getElementById('cityData'+i); + // var inData = insSelect.options[insSelect.selectedIndex].value; + // if (inData !== undefined || inData !== null || inData !== ''){ + // cityIds.push(inData); + // } + // } + // }else { + // // 如果只有一个城市,则将cts设置为字符串 + // if (cityIds.length === 1) { + // cts = cityIds[0]; + // } else { + // cts = cityIds.join(','); + // } + // } + // } let type = document.querySelector('input[name="redemptionMethod"]:checked').value; let name = $("#name").val() @@ -763,15 +812,24 @@ const commaSeparatedString = this.goodsPicArray.join(','); - var stores = ""; - if (company === 3 && $("#userType").val()!="3"){ + var sites = ""; + + if (company == "3" && $("#userType").val()!="3"){ console.log('3---this.storeIds',this.storeIds); if (TGoodsInfoDlg.storeIds.length === 0 ){ return Feng.error('请至少选择一个门店'); } stores = this.storeIds.join(','); console.log('stores--===--',stores) + } + if (company == "4" && $("#userType").val()!="3"){ + console.log('3---this.siteIds',this.siteIds); + if (TGoodsInfoDlg.siteIds.length === 0 ){ + return Feng.error('请至少选择一个场地'); + } + sites = this.siteIds.join(','); + console.log('sites--===--',sites) } let text = TGoodsInfoDlg.editor.getContent(); console.log(text) @@ -793,8 +851,10 @@ }else if(data=="5003"){ Feng.info("请选择相同运营商门店"); - }else - if(data.code == 200){ + }else if(data=="5004"){ + Feng.info("请选择相同运营商场地"); + } + else if(data.code == 200){ if(language==1){ Feng.success("添加成功!"); }else if(language==2){ @@ -811,11 +871,12 @@ },function(data){ Feng.error("添加失败!" + data.responseJSON.message + "!"); }); - console.log("看看城市ids") - console.log(cts); + console.log("看看场地ids") + console.log(sites); ajax.set("typeAll",3); ajax.set("name",name); ajax.set("price",price); + ajax.set("sites",sites); ajax.set("type",type); ajax.set("integral",integral); ajax.set("cash",cash); diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tGoodsAudit/tGoods_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tGoodsAudit/tGoods_info.js index 6bb63f6..ef69ee5 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tGoodsAudit/tGoods_info.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tGoodsAudit/tGoods_info.js @@ -142,6 +142,34 @@ $("#coun").append(str); console.log('storeIds',this.storeIds) } +TGoodsInfoDlg.selecUserOpt1 = function (arrays){ + console.log(arrays) + //获取所有的值 + var subArr= this.storeIds; + $(".timeClass").each(function () { + subArr.push($(this).find("input[name*='id']").val()); + }); + var str = ''; + for(var i in arrays){ + var b = true; + for(var j in subArr){ + if(arrays[i].id === Number(subArr[j])){ + b = false; + break + } + } + if(b){ + this.storeIds.push(arrays[i].id) + str += '<tr class="timeClass">' + + '<td><input type="hidden" id="id" name="id" value="'+arrays[i].id+'"><input type="hidden" id="provinceCity" name="provinceCity" value="'+arrays[i].provinceCity+'">' + arrays[i].provinceCity + '</td>' + + '<td><input type="hidden" id="accountName" name="accountName" value="'+arrays[i].accountName+'">' + arrays[i].accountName + '</td>' + + '<td><input type="hidden" id="name" name="name" value="'+arrays[i].name+'">' + arrays[i].name + '</td>' + + '<td><input type="hidden" id="siteName" name="siteName" value="'+arrays[i].siteName+'">' + arrays[i].siteName + '</td>' + + '<td><button onclick="deleteSub(this)">移除</button></td></tr>'; + } + } + $("#coun1").append(str); +} function deleteSub(e) { console.log(e); var row = $(e).closest('tr'); diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tHomeModule/tHomeModule.js b/cloud-server-management/src/main/webapp/static/modular/system/tHomeModule/tHomeModule.js new file mode 100644 index 0000000..855baa9 --- /dev/null +++ b/cloud-server-management/src/main/webapp/static/modular/system/tHomeModule/tHomeModule.js @@ -0,0 +1,289 @@ +/** + * 跨城站点管理管理初始化 + */ +var THomeModule = { + id: "THomeModule", //表格id + seItem: null, //选中的条目 + table: null, + layerIndex: -1, + picture:"", + fileUrl:"", + backgroundImage:"", + buttonImage:"", + plan:"", + goodsPicArray:[], + validateFields: { + } +}; +var objectType =$("#objectType").val() +// /** +// * 初始化表格的列 +// */ +// THomeModule.initColumn = function () { +// return [ +// {field: 'selectItem', checkbox: true}, +// {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, +// {title: '广告类型', field: 'position', visible: true, align: 'center', valign: 'middle',width:'20%', +// formatter:function (data) { +// return {1:"首页banner",2:"线上课得积分",3:"看视频得奖励",4:"常见问题"}[data] +// } +// }, +// {title: '广告名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, +// {title: '广告图片', field: 'img', visible: true, align: 'center', valign: 'middle', +// formatter: function (value, row, index) { +// value = typeof value == "undefined" || value == '' ? '/static/img/NoPIC.png' : value; +// return '<img src="' + value + '" style="height: 100px;"/>' +// } +// }, +// {title: '跳转模块', field: 'model', visible: true, align: 'center', valign: 'middle', +// }, +// {title: '跳转页面', field: 'page', visible: true, align: 'center', valign: 'middle', +// }, +// {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle', +// }, +// {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle', +// formatter:function (data) { +// return {1:"上架中",2:"下架中"}[data] +// } +// } +// ]; +// }; + +/** + * 检查是否选中 + */ +THomeModule.check = function () { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length == 0){ + Feng.info("请先选中表格中的某一记录!"); + return false; + }else{ + THomeModule.seItem = selected[0]; + return true; + } +}; + +/** + * 打开查看详情页面 + */ +THomeModule.openInfo = function () { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length >1 ){ + Feng.info("只能选择一个广告进行查看!"); + }else { + if (this.check()) { + var index = layer.open({ + type: 2, + title: "查看详情", + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/advertisement/update/' + THomeModule.seItem.id+'/1' + }); + this.layerIndex = index; + } + } +}; +/** + * 跳转编辑页面 + */ +THomeModule.openEditTHomeModule = function () { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length >1 ){ + Feng.info("只能选择一个广告进行编辑!"); + }else { + if (this.check()) { + var index = layer.open({ + type: 2, + title: "编辑广告", + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/advertisement/update/' + THomeModule.seItem.id+'/2' + }); + this.layerIndex = index; + } + } +}; +/** + * 关闭此对话框 + */ +THomeModule.close = function() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); +}; +THomeModule.oneChange = function () { + var modelId = $('#model option:selected').val(); + var pageSelect = document.getElementById("page"); + var typeSelect = document.getElementById("type"); + var ajax = new $ax(Feng.ctxPath + "/THomeModule/getCity", function(data){ + if(data!=null){ + var content='<option value="">选择跳转页面</option>'; + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#cCode").empty().append(content); + } + }); + if (modelId === ""){ + pageSelect.innerHTML = '<option value="">请先选择跳转模块</option>'; + typeSelect.innerHTML = '<option value="">请先选择跳转模块</option>'; + } + ajax.set("province",province); + ajax.start(); +}; +THomeModule.addConfig = function(){ + $("#cover1").val(); + $("#cover2").val(); + $("#cover7").val(); + var ajax = new $ax(Feng.ctxPath + "/advertisement/updateConfig", function (data) { + Feng.success("基础页面设置成功") + }); + ajax.set("p1",$("#cover1").val()) + ajax.set("p2",$("#cover2").val()) + ajax.set("p7",$("#cover7").val()) + ajax.start(); +} +THomeModule.addBenefits = function(){ + $("#cover3").val(); + $("#cover4").val(); + $("#cover5").val(); + $("#cover6").val(); + var ajax = new $ax(Feng.ctxPath + "/advertisement/updateBenefits", function (data) { + Feng.success("基础页面设置成功") + }); + ajax.set("p3",$("#cover3").val()) + ajax.set("p4",$("#cover4").val()) + ajax.set("p5",$("#cover5").val()) + ajax.set("p6",$("#cover6").val()) + ajax.start(); +} + +THomeModule.updateSubmit = function(){ + + console.log("kankan") + console.log($("#backgroundImage").val()) + var data1 = { + id:null, + isOpen:null, + title:"", + isTop:null, + sort:null, + backgroundImage:"", + buttonImage:"", + model:null, + page:"", + jumpPage:null, + type:"", + typeId:null, + turnId:null, + content:"", + }; + let name = $("#model").val(); + data1.id = $("#id").val(); + if(document.querySelector('input[name="isOpen"]').checked){ + data1.isOpen = 1; + }else { + data1.isOpen = 0; + } + if(document.querySelector('input[name="isTop"]').checked){ + data1.isTop = 1; + }else { + data1.isTop = 0; + } + data1.title = $("#title").val(); + data1.sort = $("#sort").val(); + if($("#backgroundImage").val() == null || $("#backgroundImage").val() == ""){ + data1.backgroundImage = $("#backgroundImage1").val(); + }else { + data1.backgroundImage = $("#backgroundImage").val(); + } + if($("#buttonImage").val() == null || $("#buttonImage").val() == ""){ + data1.buttonImage = $("#buttonImage1").val(); + }else { + data1.buttonImage = $("#buttonImage").val(); + } + data1.model = $('#model option:selected').text(); + data1.page = $('#page option:selected').text(); + data1.jumpPage = $("#page").val(); + data1.type = $('#type option:selected').text(); + data1.typeId = $("#type").val(); + data1.turnId = $("#pageId").val(); + data1.content = jQuery.trim(THomeModuleDlg.editor.getContent()); + + if ( $("#roleType").val()==1){ + if($("#title").val()==''){ + data1.title = $("#title").val(); + Feng.info("请填写标题") + return; + } + } + + if ( $("#roleType").val()==1) { + if ($("#model").val() == '') { + Feng.info("请选择跳转模块") + return; + } + } + if(name !='0'){ + if($("#page").val()=='' ){ + Feng.info("请选择跳转页面") + return; + } + } + if(name !='0') { + if ($("#roleType").val() == 1) { + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { + Feng.info("请选择跳转类型") + return; + } + } + } + if(name !='0') { + if ($("#roleType").val() == 1) { + if ($('#type option:selected').text() == "详情"&&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { + if ($("#pageId").val() == '') { + Feng.info("请输入跳转ID") + return; + } + } + } + } + if ( $("#roleType").val()==1){ + if($("#content").val()==''){ + data1.content = $("#content").val(); + Feng.info("请填写内容设置") + return; + } + } + $.ajax({ + url: Feng.ctxPath + "/tHomeModule/updateHomeModule", + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + success: function(response) { + // window.parent.THomeModule.table.refresh(); + THomeModule.close(); + Feng.success("编辑成功!"); + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "下架失败!"; + Feng.error("您的网络异常!"); + } + }); +}; + +THomeModule.resetSearch = function () { + $("#advertisementName").val(""); + $("#cCode").val(""); + $("#page").val(""); + $("#state").val(""); + THomeModule.search(); +}; + +function UploadFileFn(){ + $('#upFile').click(); +} + +$(function () { + +}); diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tHomeModule/tHomeModule_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tHomeModule/tHomeModule_info.js new file mode 100644 index 0000000..1f4ae79 --- /dev/null +++ b/cloud-server-management/src/main/webapp/static/modular/system/tHomeModule/tHomeModule_info.js @@ -0,0 +1,198 @@ +/** + * 初始化详情对话框 + */ +var THomeModuleDlg = { + tHomeModuleData : {} +}; +var language=$("#language").val(); +/** + * 清除数据 + */ +THomeModuleDlg.clearData = function() { + this.tHomeModuleData = {}; +} + +/** + * 设置对话框中的数据 + * + * @param key 数据的名称 + * @param val 数据的具体值 + */ +THomeModuleDlg.set = function(key, val) { + this.tHomeModuleData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; + return this; +} + +/** + * 设置对话框中的数据 + * + * @param key 数据的名称 + * @param val 数据的具体值 + */ +THomeModuleDlg.get = function(key) { + return $("#" + key).val(); +} + +/** + * 关闭此对话框 + */ +THomeModuleDlg.close = function() { + parent.layer.close(window.parent.THomeModule.layerIndex); +} + +THomeModuleDlg.provinceChange = function () { + var provinceId = $("#cityId").val(); + var ajax = new $ax(Feng.ctxPath + "/THomeModule/change", function(data){ + if(data!=null){ + if(language==1){ + var content='<option value="">选择市</option>'; + }else if(language==2){ + var content='<option value="">Please select a city</option>'; + }else { + var content='<option value="">Pilih Kota</option>'; + } + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.chineseName+"</option>"; + }); + $("#cityId1").empty().append(content); + } + }); + ajax.set("id",provinceId); + ajax.start(); +} +/** + * 收集数据 + */ +THomeModuleDlg.collectData = function() { + this + .set('id') + .set('isOpen') + .set('title') + .set('isTop') + .set('sort') + .set('backgroundImage') + .set('buttonImage') + .set('model') + .set('page') + .set('jumpPage') + .set('type') + .set('typeId') + .set('turnId') + .set('content'); +} + +THomeModuleDlg.updateSubmit = function(){ + + console.log("kankan") + console.log($("#backgroundImage").val()) + var data1 = { + id:null, + isOpen:null, + title:"", + isTop:null, + sort:null, + backgroundImage:"", + buttonImage:"", + model:null, + page:"", + jumpPage:null, + type:"", + typeId:null, + turnId:null, + content:"", + }; + let name = $("#model").val(); + data1.id = $("#id").val(); + if(document.querySelector('input[name="isOpen"]').checked){ + data1.isOpen = 1; + }else { + data1.isOpen = 0; + } + if(document.querySelector('input[name="isTop"]').checked){ + data1.isTop = 1; + }else { + data1.isTop = 0; + } + data1.title = $("#title").val(); + data1.sort = $("#sort").val(); + data1.backgroundImage = $("#backgroundImage").val(); + data1.buttonImage = $("#buttonImage").val(); + data1.model = $('#model option:selected').text(); + data1.page = $('#page option:selected').text(); + data1.jumpPage = $("#page").val(); + data1.type = $('#type option:selected').text(); + data1.typeId = $("#type").val(); + data1.turnId = $("#pageId").val(); + data1.content = jQuery.trim(THomeModuleDlg.editor.getContent()); + + if ( $("#roleType").val()==1){ + if($("#title").val()==''){ + data1.title = $("#title").val(); + Feng.info("请填写标题") + return; + } + } + + if ( $("#roleType").val()==1) { + if ($("#model").val() == '') { + Feng.info("请选择跳转模块") + return; + } + } + if(name !='0'){ + if($("#page").val()=='' ){ + Feng.info("请选择跳转页面") + return; + } + } + if(name !='0') { + if ($("#roleType").val() == 1) { + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { + Feng.info("请选择跳转类型") + return; + } + } + } + if(name !='0') { + if ($("#roleType").val() == 1) { + if ($('#type option:selected').text() == "详情"&&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { + if ($("#pageId").val() == '') { + Feng.info("请输入跳转ID") + return; + } + } + } + } + if ( $("#roleType").val()==1){ + if($("#content").val()==''){ + data1.content = $("#content").val(); + Feng.info("请填写内容设置") + return; + } + } + $.ajax({ + url: Feng.ctxPath + "/tHomeModule/updateHomeModule", + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + success: function(response) { + // window.parent.THomeModule.table.refresh(); + THomeModuleDlg.close(); + Feng.success("编辑成功!"); + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "下架失败!"; + Feng.error("您的网络异常!"); + } + }); +}; + +$(function() { + THomeModuleDlg.editor = UE.getEditor('editor'); + var backgroundImage = new $WebUpload("backgroundImage"); + backgroundImage.setUploadBarId("progressBar"); + backgroundImage.init(); + var buttonImage = new $WebUpload("buttonImage"); + buttonImage.setUploadBarId("progressBar"); + buttonImage.init(); +}); \ No newline at end of file diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop.js b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop.js index cf98d95..ed4fb3f 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop.js @@ -178,6 +178,18 @@ } }; +TCompetition.platformSet = function () { + var index = layer.open({ + type: 2, + title:'平台首页设置', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/tHomeModule/tHomeModule_platformSet/' + 1 + }); + this.layerIndex = index; +}; + /** * 删除车辆管理 */ diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js index f12ca42..62f6cfe 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js @@ -322,6 +322,7 @@ var px6 = $("#px6").val() var px7 = $("#px7").val() var px8 = $("#px8").val() + var px9 = $("#px9").val() var c1 = $("#c1").val() var c2 = $("#c2").val() var c3 = $("#c3").val() @@ -330,6 +331,7 @@ var c6 = $("#c6").val() var c7 = $("#7").val() var c8 = $("#c8").val() + var c9 = $("#c9").val() var r1 = document.querySelector('input[name="r1"]').checked; var r2 = document.querySelector('input[name="r2"]').checked; var r3 = document.querySelector('input[name="r3"]').checked; @@ -338,6 +340,7 @@ var r6 = document.querySelector('input[name="r6"]').checked; var r7 = document.querySelector('input[name="r7"]').checked; var r8 = document.querySelector('input[name="r8"]').checked; + var r9 = document.querySelector('input[name="r9"]').checked; if(r1){ r1 =1 }else{ @@ -378,6 +381,11 @@ }else{ r8=0 } + if(r9){ + r9 =1 + }else{ + r9=0 + } var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ if(data.code == 200){ @@ -398,6 +406,7 @@ ajax.set("px6",px6); ajax.set("px7",px7); ajax.set("px8",px8); + ajax.set("px9",px9); ajax.set("c1",c1); ajax.set("c2",c2); ajax.set("c3",c3); @@ -406,6 +415,7 @@ ajax.set("c6",c6); ajax.set("c7",c7); ajax.set("c8",c8); + ajax.set("c9",c9); ajax.set("r1",r1); ajax.set("r2",r2); ajax.set("r3",r3); @@ -414,6 +424,7 @@ ajax.set("r6",r6); ajax.set("r7",r7); ajax.set("r8",r8); + ajax.set("r9",r9); ajax.start(); } 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 5251cd8..5dbf961 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 @@ -171,19 +171,22 @@ }; TSite.oneChangeYys = function(e){ - var oneId; + var oneId = $(e).val(); var checkbox = document.querySelector('input[name="pt"]'); if (checkbox.checked) { oneId=0; console.log("选中是平台"); } else { - oneId = $("#yys").val(); console.log("运营商"); + console.log(oneId) + } var ajax = new $ax(Feng.ctxPath + "/tSite/getChangeOne", function(data){ if(data!=null){ // var content1 = '<option value="0">平台</option>'; + console.log("看看oneId") + console.log(oneId) if (oneId == 0) { console.log("锁住") $("#yys").prop('disabled', true); @@ -442,8 +445,8 @@ halfName:"", introduce:"", imgs:"", - introduce:"", - ids:"" + reservation:"", + }; data.province = $("#pCode").val() data.city = $("#cCode").val() @@ -466,6 +469,12 @@ console.log(data.typeName) + + var reservation= $("input[name='reservation']:checked").val(); + data.reservation= reservation; + console.log("看看是否可预约值") + console.log(reservation); + if (reservation==1){ if (data.typeName === "智慧场地"){ @@ -522,11 +531,8 @@ return; } - - - } - + } var SelectValue=""; var getSelectValueMenbers = $("input[name='pt']:checked").each(function(j) { if (j >= 0) { @@ -559,43 +565,44 @@ } } data.nextName= nextName; - - var ishalf= $("input[name='ishalf']:checked").val(); data.ishalf= ishalf; + var halfName=""; - if(ishalf==1){ - let cashPriceOne = $("#cashPriceOne").val() - if(cashPriceOne=='' ){ - Feng.info("请填写现金价格") - return; - } - data.cashPriceOne= cashPriceOne; - - let playPaiCoinOne = $("#playPaiCoinOne").val() - if(playPaiCoinOne=='' ){ - Feng.info("请填写玩湃币价格") - return; - } - - data.playPaiCoinOne= playPaiCoinOne; - let num2 = $('input[name="name2"]'); - for (let i = 0; i < num2.length; i++) { - if($(num2[i]).val()==''){ - Feng.info("请填写半场名称") + if (reservation==1) { + if (ishalf == 1) { + let cashPriceOne = $("#cashPriceOne").val() + if (cashPriceOne == '') { + Feng.info("请填写现金价格") return; } - if(i==num2.length-1){ - halfName += $(num2[i]).val() - }else { - halfName += $(num2[i]).val()+"," + data.cashPriceOne = cashPriceOne; + + let playPaiCoinOne = $("#playPaiCoinOne").val() + if (playPaiCoinOne == '') { + Feng.info("请填写玩湃币价格") + return; + } + + data.playPaiCoinOne = playPaiCoinOne; + let num2 = $('input[name="name2"]'); + for (let i = 0; i < num2.length; i++) { + if ($(num2[i]).val() == '') { + Feng.info("请填写半场名称") + return; + } + if (i == num2.length - 1) { + halfName += $(num2[i]).val() + } else { + halfName += $(num2[i]).val() + "," + } } } } data.halfName= halfName; - data.ids= $("#ids").val(); + let introduce ; if (objectType==1){ introduce = TSite.editor.getContent(); @@ -642,6 +649,8 @@ Feng.info("请输入场地名称") return; } + + if (reservation==1){ if($("#start-time").val()=='' ){ Feng.info("请输入可预约时间段 开始时间") return; @@ -657,6 +666,7 @@ if($("#playPaiCoin").val()==''){ Feng.info("请输入玩湃币价格") return; + } } if($("#insuranceEndTime").val()==''){ Feng.info("请输入场地责任险有效期") @@ -680,56 +690,58 @@ type: "GET", contentType: "application/json", // 设置请求头的 Content-Type success: function (response) { - rStime = response.startTime; - sh = rStime.split(':')[0];// 门店经营开始时间:小时 - sm = rStime.split(':')[1];// 门店经营开始时间:分钟 + if (reservation==1) { + rStime = response.startTime; + sh = rStime.split(':')[0];// 门店经营开始时间:小时 + sm = rStime.split(':')[1];// 门店经营开始时间:分钟 - rEtime = response.endTime; - eh = rEtime.split(':')[0];// 门店经营结束时间:小时 - em = rEtime.split(':')[1];// 门店经营结束时间:分钟 + rEtime = response.endTime; + eh = rEtime.split(':')[0];// 门店经营结束时间:小时 + em = rEtime.split(':')[1];// 门店经营结束时间:分钟 - var start = sTime.value; - var startHour = start.split(':')[0]; // 输入的可预约开始时间:小时 - var startMinute = start.split(':')[1];// 输入的可预约开始时间:分钟 - if (Number(sh)>Number(startHour)){ - Feng.error("预约的开始时间不应小于营业开始时间!") - return false; - }else if(Number(sh) === Number(startHour) ){ - if (Number(sm)>Number(startMinute)){ - Feng.error("预约的开始时间不应大于营业开始时间!") + var start = sTime.value; + var startHour = start.split(':')[0]; // 输入的可预约开始时间:小时 + var startMinute = start.split(':')[1];// 输入的可预约开始时间:分钟 + if (Number(sh) > Number(startHour)) { + Feng.error("预约的开始时间不应小于营业开始时间!") + return false; + } else if (Number(sh) === Number(startHour)) { + if (Number(sm) > Number(startMinute)) { + Feng.error("预约的开始时间不应大于营业开始时间!") + return false; + } + } else if (Number(eh) < Number(startHour)) { + Feng.error("预约的开始时间不应大于营业结束时间!") + return false; + } else if (Number(eh) === Number(startHour)) { + Feng.error("预约的开始时间不应大于等于营业结束时间!") return false; } - }else if (Number(eh)<Number(startHour)){ - Feng.error("预约的开始时间不应大于营业结束时间!") - return false; - }else if(Number(eh)===Number(startHour)){ - Feng.error("预约的开始时间不应大于等于营业结束时间!") - return false; - } - var end = eTime.value; - var endHour = end.split(':')[0]; // 输入的可预约结束时间:小时 - var endMinute = end.split(':')[1];// 输入的可预约结束时间:分钟 - if (Number(eh)<Number(endHour)){ - Feng.error("预约的结束时间不应大于营业结束时间!") - return ; - }else if(Number(eh) === Number(endHour) ){ - if (Number(em)<Number(endMinute)){ - Feng.error("预约的开始时间不应大于开始营业时间!") - return ; - } - }else if(Number(sh)>Number(endHour)){ - Feng.error("预约的结束时间不应小于营业开始时间!") - return ; - } - if (Number(endHour)===Number(sh)){ - if(Number(endMinute) < Number(sm)){ - Feng.error("预约结束时间不应小于营业开始时间"); + var end = eTime.value; + var endHour = end.split(':')[0]; // 输入的可预约结束时间:小时 + var endMinute = end.split(':')[1];// 输入的可预约结束时间:分钟 + if (Number(eh) < Number(endHour)) { + Feng.error("预约的结束时间不应大于营业结束时间!") + return; + } else if (Number(eh) === Number(endHour)) { + if (Number(em) < Number(endMinute)) { + Feng.error("预约的开始时间不应大于开始营业时间!") + return; + } + } else if (Number(sh) > Number(endHour)) { + Feng.error("预约的结束时间不应小于营业开始时间!") return; } - } - if (Number(startHour)===Number(endHour) && Number(startMinute)===Number(endMinute)){ - Feng.error("至少预约半个小时"); - return; + if (Number(endHour) === Number(sh)) { + if (Number(endMinute) < Number(sm)) { + Feng.error("预约结束时间不应小于营业开始时间"); + return; + } + } + if (Number(startHour) === Number(endHour) && Number(startMinute) === Number(endMinute)) { + Feng.error("至少预约半个小时"); + return; + } } $.ajax({ url: Feng.ctxPath + "/tSite/addSite" , 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 f0cd5cd..34ad6ba 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 @@ -204,7 +204,7 @@ halfName:"", introduce:"", imgs:"", - ids:"" + reservation:"", }; data.province = $("#pCode").val() data.id = $("#id").val() @@ -322,7 +322,12 @@ 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=='' ){ @@ -351,10 +356,10 @@ } } } + } var objectType =$("#objectType").val() data.halfName= halfName; - data.ids= $("#ids").val(); if (objectType==1){ introduce = TSiteInfo.editor.getContent(); } @@ -403,21 +408,23 @@ Feng.info("请输入场地名称") return; } - if($("#start-time").val()=='' ){ - Feng.info("请输入可预约时间段 开始时间") - return; - } - if($("#end-time").val()==''){ - Feng.info("请输入可预约时间段 结束时间") - return; - } - if($("#cashPrice").val()==''){ - Feng.info("请输入现金价格") - return; - } - if($("#playPaiCoin").val()==''){ - Feng.info("请输入玩湃币价格") - return; + if (reservation==1) { + if ($("#start-time").val() == '') { + Feng.info("请输入可预约时间段 开始时间") + return; + } + if ($("#end-time").val() == '') { + Feng.info("请输入可预约时间段 结束时间") + return; + } + if ($("#cashPrice").val() == '') { + Feng.info("请输入现金价格") + return; + } + if ($("#playPaiCoin").val() == '') { + Feng.info("请输入玩湃币价格") + return; + } } if($("#insuranceEndTime").val()==''){ Feng.info("请输入场地责任险有效期") @@ -432,6 +439,7 @@ Feng.info("请上传消防及应急管理方案") return; } + var sTime = document.getElementById("start-time"); //获取输入的开始时间 var eTime = document.getElementById("end-time"); // 获取输入的结束时间 var rStime = ""; //门店的经营开始时间 @@ -442,56 +450,58 @@ type: "GET", contentType: "application/json", // 设置请求头的 Content-Type success: function (response) { - rStime = response.startTime; - sh = rStime.split(':')[0];// 门店经营开始时间:小时 - sm = rStime.split(':')[1];// 门店经营开始时间:分钟 + if (reservation==1) { + rStime = response.startTime; + sh = rStime.split(':')[0];// 门店经营开始时间:小时 + sm = rStime.split(':')[1];// 门店经营开始时间:分钟 - rEtime = response.endTime; - eh = rEtime.split(':')[0];// 门店经营结束时间:小时 - em = rEtime.split(':')[1];// 门店经营结束时间:分钟 + rEtime = response.endTime; + eh = rEtime.split(':')[0];// 门店经营结束时间:小时 + em = rEtime.split(':')[1];// 门店经营结束时间:分钟 - var start = sTime.value; - var startHour = start.split(':')[0]; // 输入的可预约开始时间:小时 - var startMinute = start.split(':')[1];// 输入的可预约开始时间:分钟 - if (Number(sh)>Number(startHour)){ - Feng.error("预约的开始时间不应小于营业开始时间!") - return false; - }else if(Number(sh) === Number(startHour) ){ - if (Number(sm)>Number(startMinute)){ - Feng.error("预约的开始时间不应大于营业开始时间!") + var start = sTime.value; + var startHour = start.split(':')[0]; // 输入的可预约开始时间:小时 + var startMinute = start.split(':')[1];// 输入的可预约开始时间:分钟 + if (Number(sh) > Number(startHour)) { + Feng.error("预约的开始时间不应小于营业开始时间!") + return false; + } else if (Number(sh) === Number(startHour)) { + if (Number(sm) > Number(startMinute)) { + Feng.error("预约的开始时间不应大于营业开始时间!") + return false; + } + } else if (Number(eh) < Number(startHour)) { + Feng.error("预约的开始时间不应大于营业结束时间!") + return false; + } else if (Number(eh) === Number(startHour)) { + Feng.error("预约的开始时间不应大于等于营业结束时间!") return false; } - }else if (Number(eh)<Number(startHour)){ - Feng.error("预约的开始时间不应大于营业结束时间!") - return false; - }else if(Number(eh)===Number(startHour)){ - Feng.error("预约的开始时间不应大于等于营业结束时间!") - return false; - } - var end = eTime.value; - var endHour = end.split(':')[0]; // 输入的可预约结束时间:小时 - var endMinute = end.split(':')[1];// 输入的可预约结束时间:分钟 - if (Number(eh)<Number(endHour)){ - Feng.error("预约的结束时间不应大于营业结束时间!") - return ; - }else if(Number(eh) === Number(endHour) ){ - if (Number(em)<Number(endMinute)){ - Feng.error("预约的开始时间不应大于开始营业时间!") - return ; - } - }else if(Number(sh)>Number(endHour)){ - Feng.error("预约的结束时间不应小于营业开始时间!") - return ; - } - if (Number(endHour)===Number(sh)){ - if(Number(endMinute) < Number(sm)){ - Feng.error("预约结束时间不应小于营业开始时间"); + var end = eTime.value; + var endHour = end.split(':')[0]; // 输入的可预约结束时间:小时 + var endMinute = end.split(':')[1];// 输入的可预约结束时间:分钟 + if (Number(eh) < Number(endHour)) { + Feng.error("预约的结束时间不应大于营业结束时间!") + return; + } else if (Number(eh) === Number(endHour)) { + if (Number(em) < Number(endMinute)) { + Feng.error("预约的开始时间不应大于开始营业时间!") + return; + } + } else if (Number(sh) > Number(endHour)) { + Feng.error("预约的结束时间不应小于营业开始时间!") return; } - } - if (Number(startHour)===Number(endHour) && Number(startMinute)===Number(endMinute)){ - Feng.error("至少预约半个小时"); - return; + if (Number(endHour) === Number(sh)) { + if (Number(endMinute) < Number(sm)) { + Feng.error("预约结束时间不应小于营业开始时间"); + return; + } + } + if (Number(startHour) === Number(endHour) && Number(startMinute) === Number(endMinute)) { + Feng.error("至少预约半个小时"); + return; + } } $.ajax({ url: Feng.ctxPath + "/tSite/updateSite" , diff --git a/cloud-server-management/src/main/webapp/static/modular/system/ticket/ticket.js b/cloud-server-management/src/main/webapp/static/modular/system/ticket/ticket.js index 5d64418..936a40a 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/ticket/ticket.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/ticket/ticket.js @@ -30,7 +30,7 @@ }, {title: '兑换地点', field: 'useScope', visible: true, align: 'center', valign: 'middle', formatter: function (value, row, index) { - return {1: "全国", 2: "指定城市", 3: "指定门店"}[value] + return {1: "全国", 2: "指定城市", 3: "指定门店",4:"指定场地"}[value] } }, {title: '用户人群', field: 'userPopulation', visible: true, align: 'center', valign: 'middle', diff --git a/cloud-server-other/src/main/java/com/dsh/other/entity/Game.java b/cloud-server-other/src/main/java/com/dsh/other/entity/Game.java index 88dc0af..0bea284 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/entity/Game.java +++ b/cloud-server-other/src/main/java/com/dsh/other/entity/Game.java @@ -48,9 +48,13 @@ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date insertTime; private Integer state; - @TableField("sutuId") - private Integer sutuId; - @TableField("sutuName") - private String sutuName; + @TableField("blueName") + private String blueName; + @TableField("redName") + private String redName; + @TableField("blueCode") + private String blueCode; + @TableField("redCode") + private String redCode; // 获取和设置方法 } \ No newline at end of file diff --git a/cloud-server-other/src/main/java/com/dsh/other/entity/Site.java b/cloud-server-other/src/main/java/com/dsh/other/entity/Site.java index ec100db..6891cc2 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/entity/Site.java +++ b/cloud-server-other/src/main/java/com/dsh/other/entity/Site.java @@ -135,4 +135,6 @@ private String ids; @TableField("sign") private Integer sign; + @TableField("reservation") + private Integer reservation; } diff --git a/cloud-server-other/src/main/java/com/dsh/other/entity/TGame.java b/cloud-server-other/src/main/java/com/dsh/other/entity/TGame.java index 8a566c1..67acf05 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/entity/TGame.java +++ b/cloud-server-other/src/main/java/com/dsh/other/entity/TGame.java @@ -80,6 +80,8 @@ * 红方id */ private String red; + private String blueName; + private String redName; private Integer state; diff --git a/cloud-server-other/src/main/resources/mapper/SiteMapper.xml b/cloud-server-other/src/main/resources/mapper/SiteMapper.xml index d87e266..6b4d3e7 100644 --- a/cloud-server-other/src/main/resources/mapper/SiteMapper.xml +++ b/cloud-server-other/src/main/resources/mapper/SiteMapper.xml @@ -28,7 +28,7 @@ from t_site a left join t_store b on (a.storeId = b.id) left join t_site_type c on (a.siteTypeId = c.id) - where a.state = 1 and a.isCanBeBooked = 1 + where a.state = 1 and a.reservation = 1 and a.isCanBeBooked = 1 <if test="null != item.startTime and '' != item.startTime and null != item.endTime and '' != item.endTime"> and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentStartTime) <= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', #{item.startTime}) and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentEndTime) -- Gitblit v1.7.1