luoyisheng
2023-10-05 211d0336a75fb1af125fddd5205cc0f6b8632396
9.26。15
3个文件已修改
16个文件已添加
1809 ■■■■■ 已修改文件
.idea/workspace.xml 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/course/feignClient/other/BallClient.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Game.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/dto/BallQueryDto.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/HttpRequestUtil.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball.html 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_add.html 214 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add.html 243 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/static/modular/system/ball/ball.js 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/static/modular/system/ball/ball_info.js 534 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/entity/BallQueryDto.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/entity/Game.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/mapper/GameMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/service/GameService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/service/impl/GameServiceImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/resources/mapper/GameMapper.xml 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/workspace.xml
@@ -28,8 +28,7 @@
    <list default="true" id="cb08d02f-fd4f-4fa2-85fe-abd508fa83ac" name="Default Changelist" comment="9.26。14">
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/coursePackage/examineCoursePackage_info.html" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/WEB-INF/view/system/coursePackage/examineCoursePackage_info.html" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/examineCoursePackage.js" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/examineCoursePackage.js" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/HttpRequestUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/HttpRequestUtil.java" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -77,42 +76,43 @@
    <option name="hideEmptyMiddlePackages" value="true" />
    <option name="showLibraryContents" value="true" />
  </component>
  <component name="PropertiesComponent">{
  &quot;keyToString&quot;: {
    &quot;DefaultHtmlFileTemplate&quot;: &quot;HTML File&quot;,
    &quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
    &quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
    &quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
    &quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
    &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
    &quot;git-widget-placeholder&quot;: &quot;master&quot;,
    &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
    &quot;last_opened_file_path&quot;: &quot;D:/JavaTool/PlayPai1/cloud-server-management/src/main/webapp/static/modular/system/coursePackage&quot;,
    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
    &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
    &quot;project.structure.last.edited&quot;: &quot;模块&quot;,
    &quot;project.structure.proportion&quot;: &quot;0.15&quot;,
    &quot;project.structure.side.proportion&quot;: &quot;0.54367816&quot;,
    &quot;settings.editor.selected.configurable&quot;: &quot;MavenSettings&quot;,
    &quot;spring.configuration.checksum&quot;: &quot;b0c8222ba40624e179f539b98c2e8cad&quot;,
    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
  <component name="PropertiesComponent"><![CDATA[{
  "keyToString": {
    "DefaultHtmlFileTemplate": "HTML File",
    "RequestMappingsPanelOrder0": "0",
    "RequestMappingsPanelOrder1": "1",
    "RequestMappingsPanelWidth0": "75",
    "RequestMappingsPanelWidth1": "75",
    "RunOnceActivity.OpenProjectViewOnStart": "true",
    "RunOnceActivity.ShowReadmeOnStart": "true",
    "WebServerToolWindowFactoryState": "false",
    "git-widget-placeholder": "master",
    "ignore.virus.scanning.warn.message": "true",
    "last_opened_file_path": "D:/ttt/java/PlayPai/cloud-server-management/src/main/webapp/WEB-INF/view/system/ball",
    "node.js.detected.package.eslint": "true",
    "node.js.detected.package.tslint": "true",
    "node.js.selected.package.eslint": "(autodetect)",
    "node.js.selected.package.tslint": "(autodetect)",
    "nodejs_package_manager_path": "npm",
    "project.structure.last.edited": "模块",
    "project.structure.proportion": "0.15",
    "project.structure.side.proportion": "0.54367816",
    "service.view.auto.scroll.to.source": "true",
    "settings.editor.selected.configurable": "MavenSettings",
    "spring.configuration.checksum": "7fb6c6ffe49cf7315145a28a96be3d8f",
    "vue.rearranger.settings.migration": "true"
  }
}</component>
}]]></component>
  <component name="ReactorSettings">
    <option name="notificationShown" value="true" />
  </component>
  <component name="RecentsManager">
    <key name="CopyFile.RECENT_KEYS">
      <recent name="D:\ttt\java\PlayPai\cloud-server-management\src\main\webapp\WEB-INF\view\system\ball" />
      <recent name="D:\ttt\java\PlayPai\cloud-server-management\src\main\webapp\static\modular\system\ball" />
      <recent name="D:\ttt\java\PlayPai\cloud-server-other\src\main\resources\mapper" />
      <recent name="D:\JavaTool\PlayPai1\cloud-server-management\src\main\webapp\static\modular\system\coursePackage" />
      <recent name="D:\JavaTool\PlayPai1\cloud-server-management\src\main\webapp\WEB-INF\view\system\coursePackage" />
      <recent name="D:\JavaTool\PlayPai1\cloud-server-management\src\main\webapp\WEB-INF\view\system\tStudent" />
      <recent name="D:\JavaTool\PlayPai1\cloud-server-management\src\main\webapp\static\modular\system\tCoupon" />
      <recent name="D:\JavaTool\PlayPai1\cloud-server-management\src\main\webapp\WEB-INF\view\system" />
    </key>
    <key name="MoveFile.RECENT_KEYS">
      <recent name="D:\JavaTool\PlayPai1\cloud-server-management\src\main\webapp\static\modular\system\tStudent" />
@@ -120,11 +120,11 @@
      <recent name="D:\ttt\java\PlayPai\cloud-server-parent" />
    </key>
    <key name="CopyClassDialog.RECENTS_KEY">
      <recent name="com.dsh.course.mapper" />
      <recent name="com.dsh.course.service.impl" />
      <recent name="com.dsh.course.service" />
      <recent name="com.dsh.course.entity" />
      <recent name="com.dsh.course.entity.dto" />
      <recent name="com.dsh.other.mapper" />
      <recent name="com.dsh.other.service.impl" />
      <recent name="com.dsh.other.service" />
      <recent name="com.dsh.other.entity" />
      <recent name="com.dsh.other.controller" />
    </key>
  </component>
  <component name="RunDashboard">
@@ -300,6 +300,10 @@
      <workItem from="1695799021203" duration="5869000" />
      <workItem from="1695820563853" duration="56000" />
      <workItem from="1695863479059" duration="12419000" />
      <workItem from="1696427897814" duration="1362000" />
      <workItem from="1696433675086" duration="2211000" />
      <workItem from="1696462020097" duration="481000" />
      <workItem from="1696465598653" duration="12128000" />
    </task>
    <task id="LOCAL-00001" summary="后台代码删除">
      <created>1690249807612</created>
cloud-server-management/src/main/java/com/dsh/course/feignClient/other/BallClient.java
New file
@@ -0,0 +1,23 @@
package com.dsh.course.feignClient.other;
import com.dsh.course.dto.StudentSearch;
import com.dsh.course.dto.TStudentDto;
import com.dsh.course.feignClient.other.model.Banner;
import com.dsh.guns.modular.system.model.AdvertisementChangeStateDTO;
import com.dsh.guns.modular.system.model.AdvertisementQuery;
import com.dsh.guns.modular.system.model.Game;
import com.dsh.guns.modular.system.model.dto.BallQueryDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
@FeignClient(value = "mb-cloud-other")
public interface BallClient {
    @PostMapping("/student/webStudentList")
    List<Game> list(@RequestBody BallQueryDto ballQueryDto);
}
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java
@@ -16,6 +16,7 @@
import com.dsh.guns.core.util.ToolUtil;
import com.dsh.guns.modular.system.model.TSite;
import com.dsh.guns.modular.system.model.TStore;
import com.dsh.guns.modular.system.model.dto.SelectDto;
import com.dsh.guns.modular.system.service.ICoursePackageService;
import com.dsh.guns.modular.system.service.IStoreService;
import com.dsh.guns.modular.system.service.ITSiteService;
@@ -613,6 +614,7 @@
    @ResponseBody
    @PostMapping("/queryCity")
    public List<Map<String, Object>> queryCity(String code){
        Integer objectType = UserExt.getUser().getObjectType();
        Integer objectId = UserExt.getUser().getObjectId();
        String cityCode = null;
@@ -620,7 +622,24 @@
            CityManager cityManager = cityManagerClient.queryCityManagerById(objectId);
            cityCode = cityManager.getCityCode();
        }
        System.out.println("======="+storeService.queryCity(code, cityCode));
        return storeService.queryCity(code, cityCode);
    }
    @ResponseBody
    @PostMapping("/queryCity1/{code}")
    public ResultUtil queryCity1(@PathVariable("code") String code){
        Integer objectType = UserExt.getUser().getObjectType();
        Integer objectId = UserExt.getUser().getObjectId();
        String cityCode = null;
        if(objectType == 2){//城市管理员
            CityManager cityManager = cityManagerClient.queryCityManagerById(objectId);
            cityCode = cityManager.getCityCode();
        }
        System.out.println("======="+storeService.queryCity(code, cityCode));
//        return storeService.queryCity(code, cityCode);
        return new ResultUtil(0,null,null,storeService.queryCity(code, cityCode),null);
    }
@@ -633,7 +652,28 @@
    @PostMapping("/queryStore")
    public List<TStore> queryStore(String cityCode){
        List<TStore> list = storeService.list(new QueryWrapper<TStore>().eq("cityCode", cityCode).eq("state", 1));
        System.out.println("====list="+list);
        return list;
    }
    @ResponseBody
    @PostMapping("/queryStore1/{cityCode}")
    public ResultUtil queryStore1(@PathVariable("cityCode") String cityCode){
        List<TStore> list = storeService.list(new QueryWrapper<TStore>().select("id","name").eq("cityCode", cityCode).eq("state", 1));
//        Map<String,Integer> map = new LinkedHashMap<>();
        List<SelectDto>  selectDtos = new ArrayList<>();
        Map<String,Integer> map = new HashMap<>();
//        for (TStore store : list) {
//            SelectDto selectDto = new SelectDto();
//            selectDto.setId(Long.valueOf(store.getId()));
//            selectDto.setValue(store.getName());
//               selectDtos.add(selectDto);
//
//        }
//        map.put("options",selectDtos);
        return new ResultUtil(0,0,null,list,null);
    }
    /**
@@ -644,7 +684,8 @@
    @ResponseBody
    @PostMapping("/querySite")
    public List<TSite> querySite(Integer storeId){
        List<TSite> list = siteService.list(new QueryWrapper<TSite>().eq("storeId", storeId).eq("state", 1));
        System.out.println("==storeId==="+storeId);
        List<TSite> list = siteService.list(new QueryWrapper<TSite>().select("id","name").eq("storeId", storeId).eq("state", 1));
        return list;
    }
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/BallController.java
New file
@@ -0,0 +1,172 @@
package com.dsh.guns.modular.system.controller.system;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.course.feignClient.account.CityManagerClient;
import com.dsh.course.feignClient.account.CoachClient;
import com.dsh.course.feignClient.account.model.CityManager;
import com.dsh.course.feignClient.account.model.Coach;
import com.dsh.course.feignClient.course.CoursePackageClient;
import com.dsh.course.feignClient.course.CoursePackageDiscountClient;
import com.dsh.course.feignClient.course.CoursePackagePaymentConfigClient;
import com.dsh.course.feignClient.course.CoursePackageTypeClient;
import com.dsh.course.feignClient.course.model.TCoursePackageType;
import com.dsh.course.feignClient.other.BallClient;
import com.dsh.guns.config.UserExt;
import com.dsh.guns.core.base.controller.BaseController;
import com.dsh.guns.modular.system.model.*;
import com.dsh.guns.modular.system.model.dto.BallQueryDto;
import com.dsh.guns.modular.system.model.dto.ConsumeQuery;
import com.dsh.guns.modular.system.service.ICityService;
import com.dsh.guns.modular.system.service.ICoursePackageService;
import com.dsh.guns.modular.system.service.IStoreService;
import com.dsh.guns.modular.system.service.ITSiteService;
import com.dsh.guns.modular.system.util.HttpRequestUtil;
import com.dsh.guns.modular.system.util.ResultUtil;
import com.google.common.base.Ascii;
import com.google.gson.JsonObject;
import com.netflix.ribbon.proxy.annotation.Http;
import com.sun.org.apache.xerces.internal.impl.io.ASCIIReader;
import io.netty.util.AsciiString;
import io.rong.util.HttpUtil;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.logging.log4j.util.Base64Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.Base64Utils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.*;
@Controller
@RequestMapping("/ball")
public class BallController extends BaseController {
    private String PREFIX = "/system/ball/";
@Resource
private BallClient ballClient;
    @Autowired
    private ICityService cityService;
    @Autowired
    private ICoursePackageService coursePackageService;
    @Resource
    private CoursePackageTypeClient coursePackageTypeClient;
    @Autowired
    private IStoreService storeService;
    @Resource
    private CityManagerClient cityManagerClient;
    @Autowired
    private ITSiteService siteService;
    @Resource
    private CoachClient coachClient;
    @Resource
    private CoursePackagePaymentConfigClient coursePackagePaymentConfigClient;
    @Resource
    private CoursePackageDiscountClient coursePackageDiscountClient;
    @Resource
    private CoursePackageClient coursePackageClient;
    @RequestMapping("/tolist")
    public String tolist(Model model) {
        List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
        model.addAttribute("list",list);
        String roleid = UserExt.getUser().getRoleid();
        model.addAttribute("role",roleid);
        return PREFIX+"ball.html";
    }
    /**
     * 获取变更列表
     */
    /**
     * 获取有效期
     */
    @RequestMapping("/list")
    @ResponseBody
    public List<Game> changelist(BallQueryDto ballQueryDto) {
System.out.println("=======ballQueryDto=========="+ballQueryDto);
        return ballClient.list(ballQueryDto);
    }
    @RequestMapping("/pre_add")
    public String add(Model model) {
//        Map<String,String> map = new HashMap<>();
//        map.put("sign","0DB011836143EEE2C2E072967C9F4E4B");
//        map.put("space_id","1001");
//        map.put("sutu_id","1001");
//
//        String request = HttpRequestUtil.getRequest("https://try.daowepark.com/v7/user_api/general/gameList", map);
//        System.out.println("=======request=========="+request);
////
////        return ballClient.list(ballQueryDto);
//    }
Map<String,String> map =new HashMap<>();
map.put("sign","0DB011836143EEE2C2E072967C9F4E4B");
        map.put("space_id","1001");
        map.put("sutu_id","1001");
        String req = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/gameList", map);
    System.out.println("================"+req);
//        AsciiString cached = AsciiString.cached(req);
        String convertedString = StringEscapeUtils.unescapeJava(req);
System.out.println("-------------"+convertedString);
        JSONObject parse = JSONObject.parseObject(convertedString);
        JSONArray data = JSONObject.parseArray(parse.getString("data"));
        JSONObject jsonObject =data.getJSONObject(0);
        //
        Integer objectType = UserExt.getUser().getObjectType();
        Integer objectId = UserExt.getUser().getObjectId();
        List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType();
        model.addAttribute("coursePackageType", tCoursePackageTypes);
        String cityCode = null;
        if(objectType == 2){//城市管理员
            CityManager cityManager = cityManagerClient.queryCityManagerById(objectId);
            cityCode = cityManager.getCityCode();
        }
        List<Map<String, Object>> list = storeService.queryProvince(cityCode);
        model.addAttribute("province", list);
        Object code = list.get(0).get("code");
        List<Map<String, Object>> list1 = storeService.queryCity(code.toString(), cityCode);
        model.addAttribute("city", list1);
        String code1 = list1.get(0).get("code").toString();
        List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1));
        model.addAttribute("store", list2);
        TStore store = list2.get(0);
        List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", store.getId()).eq("state", 1));
        model.addAttribute("site", list3);
        return PREFIX+"ball_pre_add.html";
    }}
cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/Game.java
New file
@@ -0,0 +1,29 @@
package com.dsh.guns.modular.system.model;
import lombok.Data;
import java.util.Date;
@Data
public class Game {
    private Integer id;
    private Integer operationId;
    private String operation;
    private String province;
    private String provinceCode;
    private String city;
    private String cityCode;
    private Integer storeId;
    private String store;
    private Integer siteId;
    private String site;
    private String blue;
    private String red;
    private Date insertTime;
    // 获取和设置方法
}
cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/dto/BallQueryDto.java
New file
@@ -0,0 +1,12 @@
package com.dsh.guns.modular.system.model.dto;
import lombok.Data;
@Data
public class BallQueryDto {
    String provinceCode;
    String cityCode;
    String store;
    String site;
}
cloud-server-management/src/main/java/com/dsh/guns/modular/system/util/HttpRequestUtil.java
@@ -2,6 +2,8 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URISyntaxException;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
@@ -14,8 +16,46 @@
import org.apache.commons.httpclient.SimpleHttpConnectionManager;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
public class HttpRequestUtil {
    /***
     * get请求(带参数)
     * @param url
     * @return String
     */
    public static String getReq(String url, Map<String, String> params) {
        String result = null;
        try {
            URIBuilder uriBuilder = new URIBuilder(url);
            Iterator maplist = params.entrySet().iterator();
            while (maplist.hasNext()) {
                Map.Entry<String, String> map = (Map.Entry<String, String>) maplist.next();
                uriBuilder.addParameter(map.getKey(), map.getValue());
            }
            CloseableHttpClient client = HttpClientBuilder.create().build();
            HttpPost get = new HttpPost(uriBuilder.build());
            get.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36");
            HttpResponse response = client.execute(get);
            result = EntityUtils.toString(response.getEntity(), "UTF-8");
        } catch (URISyntaxException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }
    public static String postRequest(String url, Map<String, String> params) {
        // 构造HttpClient的实例
        HttpClient httpClient = new HttpClient();
cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball.html
New file
@@ -0,0 +1,81 @@
@layout("/common/_container.html"){
<div class="row" id = "ttt">
    <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">
                            @if(role=='1'){
                            <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="TCompetition.oneChange(this)">
                                        <option value="">全部</option>
                                        @for(obj in list){
                                        <option value="${obj.code}">${obj.name}</option>
                                        @}
                                    </select>
                                </div>
                            </div>
                            @}
                            @if(role=='1'){
                            <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">
                                    </select>
                                </div>
                            </div>
                            @}
                            <div class="col-sm-3">
                                <#NameCon id="store" name="门店名称" />
                            </div>
                            <div class="col-sm-3">
                                <#NameCon id="site" name="场地名称" />
                            </div>
                            <div class="col-sm-3">
                                <#NameCon id="userName" name="所属用户" />
                            </div>
                            <div class="col-sm-3">
                                <#button name="搜索" icon="fa-search" clickFun="TStudent.search()"/>
                            </div>
                        </div>
                        <div class="hidden-xs" id="TStudentTableToolbar" role="group">
                                <#button name="添加" icon="fa-plus" clickFun="TStudent.openAddTStudent()"/>
                                <#button name="修改" icon="fa-edit" clickFun="TStudent.openTStudentDetail()" space="true"/>
                            <#button name="查看详情" icon="fa-edit" clickFun="TStudent.openTStudentDetail1()" space="true"/>
                            @if(shiro.hasPermission("/tStudent/delete")){
                                <#button name="删除" icon="fa-remove" clickFun="TStudent.delete()" space="true"/>
                            @}
<!--                            <button id="exportButton">TTTTTTTTTT</button>-->
                        </div>
                        <#table id="TStudentTable"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/modular/system/ball/ball.js"></script>
<script src="${ctxPath}/modular/system/tShop/tShop.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js">
</script>
<script>
</script>
@}
cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_add.html
New file
@@ -0,0 +1,214 @@
@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label">*所在省:</label>
                    <div class="col-sm-4">
                        <select class="form-control" id="provinceCode" name="provinceCode">
                            @for(obj in province){
                            <option value="${obj.code}">${obj.name}</option>
                            @}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">*所在市:</label>
                    <div class="col-sm-4">
                        <select class="form-control" id="cityCode" name="cityCode">
                            @for(obj in city){
                            <option value="${obj.code}">${obj.name}</option>
                            @}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">*所属门店:</label>
                    <div class="col-sm-4">
                        <select class="form-control" id="storeId" name="storeId">
                            @for(obj in store){
                            <option value="${obj.id}">${obj.name}</option>
                            @}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">*上课场地:</label>
                    <div class="col-sm-4">
                        <select class="form-control" id="siteId" name="siteId">
                            @for(obj in site){
                            <option value="${obj.id}">${obj.name}</option>
                            @}
                        </select>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div id="config">
                    <div>
            <div class="col-sm-4">
                <div>游戏1*</div>
                <div id="pic">
                    <div id="headPic" class="headPic">
                    <label class="col-sm-3 control-label">所在省:</label>
                    <img src="${ctxPath}/img/NoPIC.png" id="img" style="width: 200px; height: 150px; border: 1px solid black;">
                </div>
                    <input type="file" id="fil" class="fil" hidden="hidden">
                </div>
                <input type="text" class="form-control">
                <input type="text" class="form-control">
                <input type="text" class="form-control">
            </div>
                        <div class="col-sm-4">
                            <div>游戏1*</div>
                            <div id="pic">
                                图片:<div id="headPic" class="headPic">
                                <img src="${ctxPath}/img/NoPIC.png" id="img" style="width: 200px; height: 150px; border: 1px solid black;">
                            </div>
                                <input type="file" id="fil"  class="fil" hidden="hidden">
                            </div>
                            <input type="text" class="form-control">
                            <input type="text" class="form-control">
                            <input type="text" class="form-control">
                        </div>
                    </div>
                </div>
                <h3>课时设置</h3>
                <div class="form-group">
                    <label class="col-sm-3 control-label">*支付方式:</label>
                    <div class="col-sm-4" style="margin-top: 6px;">
                        <input type="checkbox" name="payType" value="1"> 现金&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="checkbox" name="payType" value="2"> 玩湃币&nbsp;&nbsp;&nbsp;&nbsp;
                    </div>
                </div>
<!--                <input type="text" id = "counpons">-->
            </div>
            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.addSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CoursePackageInfo.close()"/>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/modular/system/ball/ball_info.js"></script>
<script type="text/javascript">
    laydate.render({
        elem: '#classStartTime'
        ,type: 'time'
        ,range: true
    });
    laydate.render({
        elem: '#holitime'
        ,range: true //或 range: '~' 来自定义分割字符
    });
    var avatarUp = new $WebUpload("coverDrawing");
    avatarUp.setUploadBarId("progressBar");
    avatarUp.init();
    var avatarUp1 = new $WebUpload("detailDrawing");
    avatarUp1.setUploadBarId("progressBar");
    avatarUp1.init();
    var avatarUp1 = new $WebUpload("introduceDrawing");
    avatarUp1.setUploadBarId("progressBar");
    avatarUp1.init();
    function addTime(){
        var i =  $('#dayTime > div').length
        let htmlStr ='           <div style="display:flex">\n' +
            '                                <input class="form-control" id="classStartTime'+i+'" name="classStartTime" placeholder="请选择" style="width: 200px;">\n' +
            '                                <i class="fa fa-trash-o" style="font-size:24px" onclick="removePrice1(this)"></i>\n' +
            '                            </div>'
        $('#dayTime').append(htmlStr);
        console.log("========="+i)
        laydate.render({
            elem: '#classStartTime'+i,
            type: 'time',
            range: true
        });
    }
    let fil = document.querySelector('#fil') // 文件框,只不过隐藏了起来
    let headPic = document.querySelector('#headPic') //图片上传框
    headPic.addEventListener('click', function () {
        fil.click()  //点击上传图片,文件上传框打开
    })
    //头像上传
    fil.addEventListener('change', function (e) {//注意,头像上传时用的时change事件
        // console.log(this.files[0]);  //文件的信息都放在files里
        let fd = new FormData()
        fd.append('file', this.files[0])
        //原生ajax实现实现图片上传
        let xhr = new XMLHttpRequest() //创建ajax对象
        xhr.open('post', Feng.ctxPath + '/mgr/uploadImg')
        xhr.send(fd)  //将格式处理好的数据,作为参数发送
        xhr.onreadystatechange = function () {
            // if (xhr.code != 1) {
                let data = xhr.responseText;
                console.log(data);
            $('#img').src = data;
                img.src = data
            // }
        }
    })
    // document.addEventListener('DOMContentLoaded', function() {
    //
    // let filList = document.querySelectorAll('.fil'); // 获取所有具有类名为 'fil' 的元素列表
    // let headPicList = document.querySelectorAll('.headPic'); // 获取所有具有类名为 'headPic' 的元素列表
    //
    // // 为每个元素添加事件监听器
    // filList.forEach(function(fil) {
    //     fil.addEventListener('change', function(e) {
    //         let fd = new FormData();
    //         fd.append('file', this.files[0]);
    //         let xhr = new XMLHttpRequest();
    //         xhr.open('post', Feng.ctxPath + '/mgr/uploadImg');
    //         xhr.send(fd);
    //         xhr.onreadystatechange = function() {
    //             // if (xhr.readyState === 4 && xhr.status === 200) {
    //                 let data = xhr.responseText;
    //                 console.log(data);
    //                 headPicList.forEach(function(headPic) {
    //                     headPic.querySelector('img').src = data;
    //                 });
    //             // }
    //         };
    //     });
    // });
    //
    // // 为每个元素添加点击事件监听器
    // headPicList.forEach(function(headPic) {
    //     headPic.addEventListener('click', function() {
    //         let fil = this.querySelector('.fil');
    //         fil.click();
    //     });
    // });
    // });
</script>
@}
cloud-server-management/src/main/webapp/WEB-INF/view/system/ball/ball_pre_add.html
New file
@@ -0,0 +1,243 @@
<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8" />
  <title>amis demo</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta
          name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1"
  />
  <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  <link rel="stylesheet" href="${ctxPath}/sdk/sdk.css" />
  <link rel="stylesheet" href="${ctxPath}/sdk/helper.css" />
  <link rel="stylesheet" href="${ctxPath}/sdk/iconfont.css" />
  <!-- 这是默认主题所需的,如果是其他主题则不需要 -->
  <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11,如果要支持 IE11 请引用这个 css,并把前面那个删了 -->
  <!-- <link rel="stylesheet" href="sdk-ie11.css" /> -->
  <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果,所以可能有细节功能用不了,如果发现请报 issue -->
  <style>
    html,
    body,
    .app-wrapper {
      position: relative;
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
    }
  </style>
</head>
<body>
<div id="root" class="app-wrapper"></div>
<script src="${ctxPath}/sdk/sdk.js"></script>
<script type="text/javascript">
  (function () {
    let amis = amisRequire('amis/embed');
    // 通过替换下面这个配置来生成不同页面
    let amisJSON = {
      "type": "form",
      "title": "测试页面2",
      "regions": [
        "body",
        "toolbar",
        "header"
      ],
      "body": [
        {
          "type": "select",
          "label": "所属运营商:",
          "name": "operator",
          "id": "u:970f68a2c4ee",
          "mode": "horizontal",
          "size": "lg",
          "multiple": false,
          "source": {
            "url": "/api/v1/rep/cus/",
            "method": "get",
            "messages": {
            }
          },
          "labelField": "customerName",
          "valueField": "id",
          "required": true,
          "showInvalidMatch": false,
          "searchable": true,
          "clearable": true,
          "horizontal": {
            "leftFixed": "lg"
          }
        },
        {
          "type": "input-city",
          "label": "所在省:",
          "name": "province",
          "id": "u:091b190331f6",
          "mode": "horizontal",
          "allowCity": false,
          "allowDistrict": false,
          "onEvent": {
            "change": {
              "weight": 0,
              "actions": [
                {
                  "componentId": "u:63c85c19f3aa",
                  "actionType": "reload",
                  "dataMergeMode": "merge"
                }
              ]
            }
          }
        },
        {
          "type": "select",
          "label": "所在市:",
          "name": "city",
          "id": "u:63c85c19f3aa",
          "multiple": false,
          "mode": "horizontal",
          "size": "md",
          "horizontal": {
            "leftFixed": "lg"
          },
          "source": {
            "url": "/coursePackage/queryCity1/$province",
            "method": "post",
            "messages": {
            },
            "sendOn": "this.province != null &&this.province != ' '"
          },
          "onEvent": {
            "change": {
              "weight": 0,
              "actions": [
                {
                  "componentId": "u:576899b1b531",
                  "actionType": "reload",
                  "dataMergeMode": "merge"
                }
              ]
            }
          },
          "labelField": "name",
          "valueField": "code"
        },
        {
          "type": "select",
          "label": "所属门店:",
          "name": "store",
          "id": "u:576899b1b531",
          "multiple": false,
          "mode": "horizontal",
          "size": "md",
          "horizontal": {
            "leftFixed": "lg"
          },
          "source": {
            "method": "post",
            "url": "/coursePackage/queryStore1/$city",
            "messages": {
            },
            "sendOn": "this.city != null &&this.city != ' '"
          },
          "labelField": "name",
          "valueField": "id",
          "onEvent": {
            "change": {
              "weight": 0,
              "actions": [
                {
                  "componentId": "u:0d288f4bdd8e",
                  "actionType": "reload",
                  "dataMergeMode": "merge"
                },
                {
                  "componentId": "u:0d288f4bdd8e",
                  "args": {
                    "value": " "
                  },
                  "actionType": "setValue"
                }
              ]
            }
          }
        },
        {
          "type": "select",
          "label": "所属场地:",
          "name": "site",
          "id": "u:0d288f4bdd8e",
          "multiple": false,
          "mode": "horizontal",
          "size": "md",
          "horizontal": {
            "leftFixed": "lg"
          },
          "source": {
            "url": "/coursePackage/querySite",
            "method": "post",
            "messages": {
            },
            "data": {
              "storeId": "$store"
            },
            "dataType": "form"
          },
          "labelField": "name",
          "valueField": "id"
        },
        {
          "type": "tpl",
          "tpl": "设备ID:",
          "inline": true,
          "wrapperComponent": "",
          "id": "u:587781d5d181",
          "style": {
            "marginLeft": "0"
          }
        },
        {
          "type": "input-text",
          "label": "蓝色方",
          "name": "blue",
          "id": "u:a4dbdeb9165e",
          "mode": "inline"
        },
        {
          "type": "input-text",
          "label": "红色方",
          "name": "red",
          "id": "u:b0544634a698",
          "mode": "inline"
        }
      ],
      "id": "u:44bc9a4182ef",
      "toolbar": [
        {
          "type": "button",
          "label": "按钮",
          "onEvent": {
            "click": {
              "actions": [
              ]
            }
          },
          "id": "u:e54b81466b5e"
        }
      ]
    };
    let amisScoped = amis.embed('#root', amisJSON);
  })();
  function test(){
    console.log("测试成功")
  }
  var myButton = document.getElementById("ttt");
  myButton.addEventListener("click",test);
</script>
</body>
</html>
cloud-server-management/src/main/webapp/static/modular/system/ball/ball.js
New file
@@ -0,0 +1,133 @@
/**
 * 管理初始化
 */
var TStudent = {
    id: "TStudentTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
/**
 * 初始化表格的列
 */
TStudent.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
            {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'},
            {title: '所属运营商', field: 'operation', visible: true, align: 'center', valign: 'middle'},
            {title: '省', field: 'province', visible: true, align: 'center', valign: 'middle'},
            {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: '设备类型', field: 'red', visible: true, align: 'center', valign: 'middle'},
        { title: '设备类型', field: 'red', visible: true, align: 'center', valign: 'middle'},
        { title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle'}
    ];
};
/**
 * 检查是否选中
 */
TStudent.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        TStudent.seItem = selected[0];
        return true;
    }
};
/**
 * 点击添加
 */
TStudent.openAddTStudent = function () {
    var index = layer.open({
        type: 2,
        title: '添加',
        area: ['100%', '100%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/ball/pre_add'
    });
    this.layerIndex = index;
};
/**
 * 打开修改
 */
TStudent.openTStudentDetail = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '详情',
            area: ['100%', '100%'],  //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tStudent/tStudent_update/' + TStudent.seItem.id
        });
        this.layerIndex = index;
    }
};
/**
 * 打开详情
 */
TStudent.openTStudentDetail1 = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '详情',
            area: ['100%', '100%'],  //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tStudent/tStudent_info/' + TStudent.seItem.id
        });
        this.layerIndex = index;
    }
};
/**
 * 删除
 */
TStudent.delete = function () {
    if (this.check()) {
        var ajax = new $ax(Feng.ctxPath + "/tStudent/delete", function (data) {
            Feng.success("删除成功!");
            TStudent.table.refresh();
        }, function (data) {
            Feng.error("删除失败!" + data.responseJSON.message + "!");
        });
        ajax.set("tStudentId",this.seItem.id);
        ajax.start();
    }
};
/**
 * 查询列表
 */
TStudent.search = function () {
    var queryData = {};
    queryData['provinceCode'] = $("#pCode").val();
    queryData['cityCode'] = $("#cCode").val();
    queryData['store'] = $("#store").val();
    queryData['site'] = $("#site").val();
    TStudent.table.refresh({query: queryData});
};
$(function () {
    var defaultColunms = TStudent.initColumn();
    var table = new BSTable(TStudent.id, "/ball/list", defaultColunms);
    table.setPaginationType("client");
    TStudent.table = table.init();
});
cloud-server-management/src/main/webapp/static/modular/system/ball/ball_info.js
New file
@@ -0,0 +1,534 @@
/**
 * 用户详情对话框(可用于添加和修改对话框)
 */
var CoursePackageInfo = {
    userInfoData: {},
};
/**
 * 关闭此对话框
 */
CoursePackageInfo.close = function () {
    parent.layer.close(window.parent.CoursePackage.layerIndex);
};
CoursePackageInfo.openDia = function (i) {
        let index = layer.open({
            type: 2,
            title: '编辑',
            area: ['80%', '80%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/coursePackage/conpun/'+i
        });
        this.layerIndex = index;
};
CoursePackageInfo.openDia1 = function (i) {
    var ids = $("#counpons"+i).val()
        console.log($("#counpons"+i).val())
    let index = layer.open({
        type: 2,
        title: '编辑',
        area: ['80%', '80%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/coursePackage/conpun1'+'/'+i+'?conpunids='+ids
    });
    this.layerIndex = index;
};
/**
 * 提交添加用户
 */
CoursePackageInfo.addSubmit = function () {
    let province = $('#provinceCode option:checked').text();
    let provinceCode = $('#provinceCode').val();
    let city = $('#cityCode option:checked').text();
    let cityCode = $('#cityCode').val();
    let storeId = $('#storeId').val();
    let coursePackageTypeId = $('#coursePackageTypeId').val();
    let name = $('#name').val();
    let siteId = $('#siteId').val();
    let coachId = $('#coachId').val();
    let maxSubscribeNumber = $('#maxSubscribeNumber').val();
    let codeTime = $('#codeTime').val();
    let type = $('#type').val();
    let holitime = $('#holitime').val();
    // let classStartTime = JSON.stringify($('#classStartTime').val());
    var inputElements = document.querySelectorAll('input[name="classStartTime"]');
    let classStartTime =  JSON.stringify(Array.from(inputElements).map(function(element) {
        return element.value;
    }))
    let classWeeks = '';
    $('input[name="classWeeks"]:checked').each(function (index, e) {
        classWeeks += $(e).val() + ";";
    })
    let coverDrawing = $('#coverDrawing').val();
    let detailDrawing = $('#detailDrawing').val();
    let introduceDrawing = $('#introduceDrawing').val();
    let sort = $('#sort').val();
    let validDays = $('#validDays').val();
    let price = [];
    $('#price > .form-group').each(function (i, e) {
        let classHours = $($(e).find(".classNumber_span input[class='classNumber']")[0]).val();
        let cash = $($(e).find(".cash_span input[class='cash']")[0]).val();
        let paiCoin = $($(e).find(".paiCoin_span input[class='paiCoin']")[0]).val();
        let counpons = $($(e).find(".counpons")).val();
        price.push({
            classHours: classHours,
            cashPayment: typeof cash == "undefined" ? 0 : cash,
            playPaiCoin: typeof paiCoin == "undefined" ? 0 : paiCoin,
            couponIds: typeof counpons == "undefined" ? 0 : counpons
        });
    });
    if(null == provinceCode || '' == provinceCode){
        Feng.error("所在省不能为空");
        return
    }
    if(null == cityCode || '' == cityCode){
        Feng.error("所在市不能为空");
        return
    }
    if(null == storeId || '' == storeId){
        Feng.error("所属门店不能为空");
        return
    }
    if(null == coursePackageTypeId || '' == coursePackageTypeId){
        Feng.error("课程类型不能为空");
        return
    }
    if(null == name || '' == name){
        Feng.error("课包名称不能为空");
        return
    }
    if(null == siteId || '' == siteId){
        Feng.error("上课场地不能为空");
        return
    }
    if(null == coachId || '' == coachId){
        Feng.error("授课教师不能为空");
        return
    }
    // if(null == maxSubscribeNumber || '' == maxSubscribeNumber){
    //     Feng.error("最多预约人数不能为空");
    //     return
    // }
    // if(null == codeTime || '' == codeTime){
    //     Feng.error("扣除课时数不能为空不能为空");
    //     return
    // }
    // if(null == classStartTime || '' == classStartTime){
    //     Feng.error("上课时间不能为空");
    //     return
    // }
    // if(null == classWeeks || '' == classWeeks){
    //     Feng.error("上课时间不能为空");
    //     return
    // }
    classWeeks = classWeeks.substring(0, classWeeks.length - 1);
    if(null == coverDrawing || '' == coverDrawing){
        Feng.error("课包封面不能为空");
        return
    }
    if(null == detailDrawing || '' == detailDrawing){
        Feng.error("详情页不能为空");
        return
    }
    if(null == introduceDrawing || '' == introduceDrawing){
        Feng.error("课包介绍不能为空");
        return
    }
    // if(null == validDays || '' == validDays){
    //     Feng.error("课时有效期不能为空");
    //     return
    // }
    let obj = {
        province: province,
        provinceCode: provinceCode,
        city: city,
        cityCode: cityCode,
        storeId: storeId,
        coursePackageTypeId: coursePackageTypeId,
        name: name,
        siteId: siteId,
        coachId: coachId,
        maxSubscribeNumber: maxSubscribeNumber,
        classStartTime: classStartTime,
        codeTime:codeTime,
        // classStartTime: classStartTime.split(" - ")[0],
        // classEndTime: classStartTime.split(" - ")[1],
        classWeeks: classWeeks,
        coverDrawing: coverDrawing,
        detailDrawing: detailDrawing,
        introduceDrawing: introduceDrawing,
        sort: sort,
        validDays: validDays,
        coursePackagePaymentConfig: JSON.stringify(price),
        type:type,
        holitime:holitime
    }
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/coursePackage/addCoursePackage", function (data) {
        if(data.code == 200){
            Feng.success("添加成功!");
            CoursePackageInfo.close();
            window.parent.CoursePackage.table.refresh();
        }else{
            Feng.error(data.msg);
        }
    }, function (data) {
        Feng.error("添加失败!" + data.responseJSON.message + "!");
    });
    ajax.set(obj);
    ajax.start();
};
/**
 * 提交修改
 */
CoursePackageInfo.editSubmit = function () {
    let id = $('#id').val();
    let province = $('#provinceCode option:checked').text();
    let provinceCode = $('#provinceCode').val();
    let city = $('#cityCode option:checked').text();
    let cityCode = $('#cityCode').val();
    let storeId = $('#storeId').val();
    let coursePackageTypeId = $('#coursePackageTypeId').val();
    let name = $('#name').val();
    let siteId = $('#siteId').val();
    let coachId = $('#coachId').val();
    let maxSubscribeNumber = $('#maxSubscribeNumber').val();
    let codeTime = $('#codeTime').val();
    let type = $('#type').val();
    let holitime = $('#holitime').val();
    var inputElements = document.querySelectorAll('input[name="classStartTime"]');
    let classStartTime =  JSON.stringify(Array.from(inputElements).map(function(element) {
        return element.value;
    }))
    // let classStartTime = $('#classStartTime').val();
    let classWeeks = '';
    $('input[name="classWeeks"]:checked').each(function (index, e) {
        classWeeks += $(e).val() + ";";
    })
    let coverDrawing = $('#coverDrawing').val();
    let detailDrawing = $('#detailDrawing').val();
    let introduceDrawing = $('#introduceDrawing').val();
    let sort = $('#sort').val();
    let validDays = $('#validDays').val();
    // let counpons = $($(e).find(".counpons")).val();
    let price = [];
    $('#price>.form-group').each(function (i, e) {
        let classHours = $($(e).find(".classNumber_span input[class='classNumber']")[0]).val();
        let cash = $($(e).find(".cash_span input[class='cash']")[0]).val();
        let paiCoin = $($(e).find(".paiCoin_span input[class='paiCoin']")[0]).val();
        let counpons = $($(e).find(".counpons")).val();
        price.push({
            classHours: classHours,
            cashPayment: typeof cash == "undefined" ? 0 : cash,
            playPaiCoin: typeof paiCoin == "undefined" ? 0 : paiCoin,
            couponIds: typeof counpons == "undefined" ? 0 : counpons
        })
    });
    if(null == provinceCode || '' == provinceCode){
        Feng.error("所在省不能为空");
        return
    }
    if(null == cityCode || '' == cityCode){
        Feng.error("所在市不能为空");
        return
    }
    if(null == storeId || '' == storeId){
        Feng.error("所属门店不能为空");
        return
    }
    if(null == coursePackageTypeId || '' == coursePackageTypeId){
        Feng.error("课程类型不能为空");
        return
    }
    if(null == name || '' == name){
        Feng.error("课包名称不能为空");
        return
    }
    if(null == siteId || '' == siteId){
        Feng.error("上课场地不能为空");
        return
    }
    if(null == coachId || '' == coachId){
        Feng.error("授课教师不能为空");
        return
    }
    // if(null == maxSubscribeNumber || '' == maxSubscribeNumber){
    //     Feng.error("最多预约人数不能为空");
    //     return
    // }
    // if(null == codeTime || '' == codeTime){
    //     Feng.error("扣除课时不能为空");
    //     return
    // }
    // if(null == classStartTime || '' == classStartTime){
    //     Feng.error("上课时间不能为空");
    //     return
    // }
    // if(null == classWeeks || '' == classWeeks){
    //     Feng.error("周不能为空");
    //     return
    // }
    classWeeks = classWeeks.substring(0, classWeeks.length - 1);
    if(null == coverDrawing || '' == coverDrawing){
        Feng.error("课包封面不能为空");
        return
    }
    if(null == detailDrawing || '' == detailDrawing){
        Feng.error("详情页不能为空");
        return
    }
    if(null == introduceDrawing || '' == introduceDrawing){
        Feng.error("课包介绍不能为空");
        return
    }
    // if(null == validDays || '' == validDays){
    //     Feng.error("课时有效期不能为空");
    //     return
    // }
    let obj = {
        id: id,
        province: province,
        provinceCode: provinceCode,
        city: city,
        cityCode: cityCode,
        storeId: storeId,
        coursePackageTypeId: coursePackageTypeId,
        name: name,
        siteId: siteId,
        coachId: coachId,
        maxSubscribeNumber: maxSubscribeNumber,
        codeTime: codeTime,
        type:type,
        classStartTime: classStartTime,
        // classEndTime: classStartTime.split(" - ")[1],
        classWeeks: classWeeks,
        coverDrawing: coverDrawing,
        detailDrawing: detailDrawing,
        introduceDrawing: introduceDrawing,
        sort: sort,
        validDays: validDays,
        coursePackagePaymentConfig: JSON.stringify(price),
        holitime:holitime
    }
    console.log("======="+obj)
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/coursePackage/updateCoursePackage", function (data) {
        if(data.code == 200){
            Feng.success("编辑成功!");
            CoursePackageInfo.close();
            window.parent.CoursePackage.table.refresh();
        }else{
            Feng.error(data.msg);
        }
    }, function (data) {
        Feng.error("编辑失败!" + data.responseJSON.message + "!");
    });
    ajax.set(obj);
    ajax.start();
};
function queryStore() {
    let ajax = new $ax(Feng.ctxPath + "/coursePackage/queryStore", function (data) {
        let htmlStr = '';
        for (let i = 0; i < data.length; i++) {
            htmlStr += '<option value="' + data[i].id + '">' + data[i].name + '</option>'
        }
        $('#storeId').html(htmlStr);
        querySite();
    }, function (data) {
        Feng.error("获取失败!" + data.responseJSON.message + "!");
    });
    ajax.set("cityCode", $('#cityCode').val());
    ajax.start();
}
function querySite(){
    let ajax = new $ax(Feng.ctxPath + "/coursePackage/querySite", function (data) {
        let htmlStr = '';
        for (let i = 0; i < data.length; i++) {
            htmlStr += '<option value="' + data[i].id + '">' + data[i].name + '</option>'
        }
        $('#siteId').html(htmlStr);
    }, function (data) {
        Feng.error("获取失败!" + data.responseJSON.message + "!");
    });
    ajax.set("storeId", $('#storeId').val());
    ajax.start();
}
function queryCoach(){
    let ajax = new $ax(Feng.ctxPath + "/coursePackage/queryCoach", function (data) {
        let htmlStr = '';
        for (let i = 0; i < data.length; i++) {
            htmlStr += '<option value="' + data[i].id + '">' + data[i].name + '</option>'
        }
        $('#coachId').html(htmlStr);
    }, function (data) {
        Feng.error("获取失败!" + data.responseJSON.message + "!");
    });
    ajax.set("cityCode", $('#cityCode').val());
    ajax.start();
}
function addPrice(y){
    console.log("===="+y)
    let cash = false;
    let paiCoin = false;
    $('input[name="payType"]:checked').each(function (index, e) {
        let v = $(e).val();
        if(v == 1){
            cash = true;
        }
        if(v == 2){
            paiCoin = true;
        }
    })
    var i =  $('#price > div').length+1
    let htmlStr = ''
    if (y===1){
        htmlStr +=   '<div class="form-group">\n' +
            '                        <label class="col-sm-3 control-label">*课时数:</label>\n' +
            '                        <div class="col-sm-8">\n' +
            '                            <span class="classNumber_span"><input class="classNumber" type="number" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;">&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class="cash_span">\n';
    }
    if (y===2){
        htmlStr +=   '<div class="form-group">\n' +
            '                        <label class="col-sm-3 control-label"></label>\n' +
            '                        <div class="col-sm-8">\n' +
            '                            <span class="classNumber_span" hidden="hidden"><input class="classNumber" type="number" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;">&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class="cash_span">\n';
    }
        '<div class="form-group">\n' +
        '                        <label class="col-sm-3 control-label">*课时数:</label>\n' +
        '                        <div class="col-sm-8">\n' +
        '                            <span class="classNumber_span"><input class="classNumber" type="number" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;">&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class="cash_span">\n';
        if(cash){
            htmlStr += '现金支付:<input class="cash" type="number" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> ¥&nbsp;&nbsp;&nbsp;&nbsp;\n';
        }
        htmlStr += '</span> <span class="paiCoin_span">';
        if(paiCoin){
            htmlStr += '玩湃币支付:<input class="paiCoin" type="number" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 币&nbsp;&nbsp;&nbsp;&nbsp;\n';
        }
    htmlStr += '<button type="button" class="btn btn-info " onclick="CoursePackageInfo.openDia('+i+')" id="ensure">\n' +
        '    <i class="fa fa-check"></i>&nbsp;优惠卷\n' +
        '</button>';
    htmlStr += '</span> <i class="fa fa-trash-o" style="font-size:24px" onclick="removePrice(this)"></i>\n' +
        '</div>\n' +'<input type="text" hidden="hidden" class = "counpons" id = "counpons'+i+'" >'+i+
        '</div>';
    $('#price').append(htmlStr);
}
function removePrice(e){
    $(e).parent('div').parent('div').remove();
}
function removePrice1(e){
    $(e).parent('div').remove();
}
$(function () {
    $('#provinceCode').change(function () {
        let ajax = new $ax(Feng.ctxPath + "/coursePackage/queryCity", function (data) {
            let htmlStr = '';
            for (let i = 0; i < data.length; i++) {
                htmlStr += '<option value="' + data[i].code + '">' + data[i].name + '</option>'
            }
            $('#cityCode').html(htmlStr);
            queryStore();
            queryCoach();
        }, function (data) {
            Feng.error("获取失败!" + data.responseJSON.message + "!");
        });
        ajax.set("code", $(this).val());
        ajax.start();
    })
    $('#cityCode').change(function () {
        queryStore();
    })
    $('#storeId').change(function () {
        querySite();
    })
    $('input[name="payType"]').click(function () {
        $('input[name="payType"]').each(function (index, e) {
            let v = $(e).val();
            if(v == 1) {
                if (e.checked) {
                    $('span[class="cash_span"]').each(function (index, e) {
                        $(e).html('现金支付:<input class="cash" type="number" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> ¥&nbsp;&nbsp;&nbsp;&nbsp;');
                    })
                } else {
                    $('span[class="cash_span"]').each(function (index, e) {
                        $(e).html('');
                    })
                }
            }
            if(v == 2){
                if (e.checked) {
                    $('span[class="paiCoin_span"]').each(function (index, e) {
                        $(e).html('玩湃币支付:<input class="paiCoin" type="number" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 币&nbsp;&nbsp;&nbsp;&nbsp;')
                    })
                } else {
                    $('span[class="paiCoin_span"]').each(function (index, e) {
                        $(e).html('');
                    })
                }
            }
        })
    })
});
cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java
New file
@@ -0,0 +1,42 @@
package com.dsh.other.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.other.entity.*;
import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO;
import com.dsh.other.feignclient.model.AdvertisementQuery;
import com.dsh.other.model.BannerVo;
import com.dsh.other.service.GameService;
import com.dsh.other.service.IBannerService;
import com.dsh.other.util.ResultUtil;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * @author zhibing.pu
 * @date 2023/7/11 17:48
 */
@RestController
@RequestMapping("")
public class BallController {
    @Autowired
    private GameService gameService;
    @ResponseBody
    @PostMapping("/student/webStudentList")
    public List<Game> list(@RequestBody BallQueryDto ballQueryDto){
        List<Game> games =   gameService.queryAll(ballQueryDto);
        return games;
    }
}
cloud-server-other/src/main/java/com/dsh/other/entity/BallQueryDto.java
New file
@@ -0,0 +1,16 @@
package com.dsh.other.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BallQueryDto {
    String provinceCode;
    String cityCode;
    String store;
    String site;
}
cloud-server-other/src/main/java/com/dsh/other/entity/Game.java
New file
@@ -0,0 +1,50 @@
package com.dsh.other.entity;
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 com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_game")
public class Game {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @TableField("operationId")
    private Integer operationId;
    private String operation;
    @TableField("province")
    private String province;
    @TableField("provinceCode")
    private String provinceCode;
    @TableField("city")
    private String city;
    @TableField("cityCode")
    private String cityCode;
    @TableField("storeId")
    private Integer storeId;
    private String store;
    @TableField("siteId")
    private Integer siteId;
    private String site;
    @TableField("blue")
    private String blue;
    @TableField("red")
    private String red;
    @TableField("insertTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date insertTime;
    // 获取和设置方法
}
cloud-server-other/src/main/java/com/dsh/other/mapper/GameMapper.java
New file
@@ -0,0 +1,21 @@
package com.dsh.other.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsh.other.entity.BallQueryDto;
import com.dsh.other.entity.Game;
import com.dsh.other.entity.Notice;
import java.util.List;
/**
 * <p>
 * 公告 Mapper 接口
 * </p>
 *
 * @author jqs
 * @since 2023-07-03
 */
public interface GameMapper extends BaseMapper<Game> {
    List<Game> queryAll(BallQueryDto ballQueryDto);
}
cloud-server-other/src/main/java/com/dsh/other/service/GameService.java
New file
@@ -0,0 +1,16 @@
package com.dsh.other.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsh.other.entity.BallQueryDto;
import com.dsh.other.entity.Game;
import com.dsh.other.entity.Protocol;
import java.util.List;
/**
 * @author zhibing.pu
 * @date 2023/6/14 15:04
 */
public interface GameService extends IService<Game> {
    List<Game> queryAll(BallQueryDto ballQueryDto);
}
cloud-server-other/src/main/java/com/dsh/other/service/impl/GameServiceImpl.java
New file
@@ -0,0 +1,30 @@
package com.dsh.other.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsh.other.entity.BallQueryDto;
import com.dsh.other.entity.Game;
import com.dsh.other.entity.Notice;
import com.dsh.other.mapper.GameMapper;
import com.dsh.other.mapper.NoticeMapper;
import com.dsh.other.service.GameService;
import com.dsh.other.service.NoticeService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
 * 公告 服务实现类
 * </p>
 *
 * @author jqs
 * @since 2023-07-03
 */
@Service
public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements GameService {
    @Override
    public List<Game> queryAll(BallQueryDto ballQueryDto) {
        return this.baseMapper.queryAll(ballQueryDto);
    }
}
cloud-server-other/src/main/resources/mapper/GameMapper.xml
New file
@@ -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.other.mapper.GameMapper">
    <select id="queryAll" resultType="com.dsh.other.entity.Game">
        SELECT
            ga.*,st.`name` as store,op.`name` as operation,si.`name` as site
        FROM
            t_game ga
                LEFT JOIN t_store st ON ga.storeId = st.id
                LEFT JOIN t_operator op ON ga.operationId = op.id
                LEFT JOIN t_site si on ga.siteId = si.id
        <where>
            <if test="provinceCode!=null and provinceCode!=''">
                ga.provinceCode = #{provinceCode}
            </if>
            <if test="cityCode!=null and cityCode!=''">
               and ga.cityCode = #{cityCode}
            </if>
            <if test="store!=null and store!=''">
               and  st.`name` = #{store}
            </if>
            <if test="site!=null and site!=''">
              and  si.`name` = #{site}
            </if>
        </where>
    </select>
</mapper>