New file |
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | import com.dsh.account.entity.CityManager; |
| | | import com.dsh.account.service.ICityManagerService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CityManagerController { |
| | | |
| | | private ICityManagerService cityManagerService; |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/cityManager/queryCityManagerById") |
| | | public CityManager queryCityManagerById(@RequestBody Integer id){ |
| | | return cityManagerService.getById(id); |
| | | } |
| | | } |
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.account.entity.Coach; |
| | | import com.dsh.account.service.CoachService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("") |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取城市下的所有教练 |
| | | * @param cityCode |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coach/queryCoachByCity") |
| | | public List<Coach> queryCoachByCity(@RequestBody String cityCode){ |
| | | return service.list(new QueryWrapper<Coach>().eq("cityCode", cityCode).eq("state", 1)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.account.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 lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:00 |
| | | */ |
| | | @Data |
| | | @TableName("t_city_manager") |
| | | public class CityManager { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 电话 |
| | | */ |
| | | @TableField("phone") |
| | | private String phone; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | } |
New file |
| | |
| | | package com.dsh.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.account.entity.CityManager; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:04 |
| | | */ |
| | | public interface CityManagerMapper extends BaseMapper<CityManager> { |
| | | } |
New file |
| | |
| | | package com.dsh.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.account.entity.CityManager; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:03 |
| | | */ |
| | | public interface ICityManagerService extends IService<CityManager> { |
| | | } |
New file |
| | |
| | | package com.dsh.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.CityManager; |
| | | import com.dsh.account.mapper.CityManagerMapper; |
| | | import com.dsh.account.service.ICityManagerService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:04 |
| | | */ |
| | | @Service |
| | | public class CityManagerServiceImpl extends ServiceImpl<CityManagerMapper, CityManager> implements ICityManagerService { |
| | | } |
New file |
| | |
| | | <?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.account.mapper.CityManagerMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | private Integer coursePackageTypeId; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | private Integer storeId; |
| | | /** |
| | | * 课程名称 |
| | | */ |
| | | private String name; |
| | |
| | | <if test="null != item.coursePackageTypeId"> |
| | | and a.coursePackageTypeId = #{item.coursePackageTypeId} |
| | | </if> |
| | | <if test="null != item.storeId"> |
| | | and a.storeId = #{item.storeId} |
| | | </if> |
| | | <if test="null != item.name and '' != item.name"> |
| | | and a.name line CONCAT('%', #{item.name}, '%') |
| | | </if> |
New file |
| | |
| | | package com.dsh.course.feignClient.account; |
| | | |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:07 |
| | | */ |
| | | @FeignClient("mb-cloud-account") |
| | | public interface CityManagerClient { |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/cityManager/queryCityManagerById") |
| | | CityManager queryCityManagerById(Integer id); |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account; |
| | | |
| | | import com.dsh.course.feignClient.account.model.Coach; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:58 |
| | | */ |
| | | @FeignClient("mb-cloud-account") |
| | | public interface CoachClient { |
| | | |
| | | |
| | | /** |
| | | * 获取城市下的所有教练 |
| | | * @param cityCode |
| | | * @return |
| | | */ |
| | | @PostMapping("/coach/queryCoachByCity") |
| | | List<Coach> queryCoachByCity(String cityCode); |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account.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; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:00 |
| | | */ |
| | | @Data |
| | | public class CityManager { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer id; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 电话 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account.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 com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 教练 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-05 |
| | | */ |
| | | @Data |
| | | public class Coach { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer id; |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 城市管理员id |
| | | */ |
| | | private Integer cityManagerId; |
| | | /** |
| | | * 教练类型id |
| | | */ |
| | | private Integer coachTypeId; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 生日 |
| | | */ |
| | | private Date birthday; |
| | | /** |
| | | * 性别(1=男,2=女) |
| | | */ |
| | | private Integer gender; |
| | | /** |
| | | * 电话 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | | private String idcard; |
| | | /** |
| | | * 身高(厘米) |
| | | */ |
| | | private Double height; |
| | | /** |
| | | * 体重(KG) |
| | | */ |
| | | private Double weight; |
| | | /** |
| | | * 毕业院校 |
| | | */ |
| | | private String graduateSchool; |
| | | /** |
| | | * 毕业证照片 |
| | | */ |
| | | private String diploma; |
| | | /** |
| | | * 资格证书(多个逗号分隔) |
| | | */ |
| | | private String certificate; |
| | | /** |
| | | * 证书照片 |
| | | */ |
| | | private String certificateImg; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | private Integer coursePackageTypeId; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | private Integer storeId; |
| | | /** |
| | | * 课程名称 |
| | | */ |
| | | private String name; |
| | |
| | | * 获取所有省 |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryProvince(); |
| | | List<Map<String, Object>> queryProvince(@Param("cityCode") String cityCode); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param provinceCode |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCity(@Param("provinceCode") Integer provinceCode); |
| | | List<Map<String, Object>> queryCity(@Param("provinceCode") String provinceCode, @Param("cityCode") String cityCode); |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:45 |
| | | */ |
| | | public interface TSiteMapper extends BaseMapper<TSite> { |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.CoursePackageTypeClient; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackageType; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | 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 org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/coursePackage") |
| | | public class TCoursePackageController { |
| | | public class TCoursePackageController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/coursePackage/"; |
| | | |
| | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | |
| | | @Resource |
| | | private CityManagerClient cityManagerClient; |
| | | |
| | | @Autowired |
| | | private ITSiteService siteService; |
| | | |
| | | @Resource |
| | | private CoachClient coachClient; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | @GetMapping("/openCoursePackageListPage") |
| | | public String openCoursePackageListPage(Model model){ |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType(); |
| | | model.addAttribute("coursePackageType", tCoursePackageTypes); |
| | | List<Map<String, Object>> list = storeService.queryProvince(); |
| | | 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); |
| | | model.addAttribute("objectType", objectType); |
| | | return PREFIX + "coursePackage.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/openAddCoursePackage") |
| | | public String openAddCoursePackage(Model model){ |
| | | 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); |
| | | List<Coach> coaches = coachClient.queryCoachByCity(code1); |
| | | model.addAttribute("coach", coaches); |
| | | return PREFIX + "coursePackage_add.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryCity") |
| | | public List<Map<String, Object>> queryCity(Integer code){ |
| | | return storeService.queryCity(code); |
| | | public List<Map<String, Object>> queryCity(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(); |
| | | } |
| | | return storeService.queryCity(code, cityCode); |
| | | } |
| | | |
| | | |
| | |
| | | @ResponseBody |
| | | @PostMapping("/queryCoursePackageLists") |
| | | public Object queryCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, String name, Integer status, Integer state){ |
| | | Page<Map<String, Object>> mapPage = coursePackageService.queryCoursePackageLists(provinceCode, cityCode, coursePackageTypeId, name, status, state); |
| | | return mapPage; |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | Integer storeId = null; |
| | | if(objectType == 2){//城市管理员 |
| | | CityManager cityManager = cityManagerClient.queryCityManagerById(objectId); |
| | | provinceCode = cityManager.getProvinceCode(); |
| | | cityCode = cityManager.getCityCode(); |
| | | } |
| | | if(objectType == 3) {//城市管理员 |
| | | storeId = objectId; |
| | | } |
| | | Page<Map<String, Object>> mapPage = coursePackageService.queryCoursePackageLists(provinceCode, cityCode, coursePackageTypeId, storeId, name, status, state); |
| | | return super.packForBT(mapPage); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | List<MenuNode> menus = menuService.getMenusByRoleIds(roleList); |
| | | List<MenuNode> titles = MenuNode.buildTitle(menus); |
| | | |
| | | |
| | | |
| | | |
| | | List<String> resUrlsByRoleId = menuService.getResUrlsByRoleId(Integer.valueOf(roleList.get(0))); |
| | | CacheUtil.menus.put(user.getAccount(), resUrlsByRoleId); |
| | | |
| | |
| | | super.getSession().setAttribute("username", user.getAccount()); |
| | | super.getSession().setAttribute("token", token); |
| | | super.getSession().setAttribute("language",language); |
| | | |
| | | return REDIRECT + "/"; |
| | | } |
| | | |
New file |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:43 |
| | | */ |
| | | @Data |
| | | @TableName("t_site") |
| | | public class TSite { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | /** |
| | | * 场地名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 场地类型id |
| | | */ |
| | | @TableField("siteTypeId") |
| | | private Integer siteTypeId; |
| | | /** |
| | | * 城市管理员id |
| | | */ |
| | | @TableField("cityManagerId") |
| | | private Integer cityManagerId; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 市名称 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * 预约开始时间 |
| | | */ |
| | | @TableField("appointmentStartTime") |
| | | private String appointmentStartTime; |
| | | /** |
| | | * 预约结束时间 |
| | | */ |
| | | @TableField("appointmentEndTime") |
| | | private String appointmentEndTime; |
| | | /** |
| | | * 现金价格(x/半小时) |
| | | */ |
| | | @TableField("cashPrice") |
| | | private Double cashPrice; |
| | | /** |
| | | * 玩湃币价格(x/半小时) |
| | | */ |
| | | @TableField("playPaiCoin") |
| | | private Integer playPaiCoin; |
| | | /** |
| | | * 场地责任险有效期 |
| | | */ |
| | | @TableField("insuranceEndTime") |
| | | private Date insuranceEndTime; |
| | | /** |
| | | * 场地责任险图片 |
| | | */ |
| | | @TableField("insuranceImg") |
| | | private String insuranceImg; |
| | | /** |
| | | * 消防应急管理方案 |
| | | */ |
| | | @TableField("managementPlan") |
| | | private String managementPlan; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | } |
| | |
| | | * 保留字段 |
| | | */ |
| | | private Integer version; |
| | | /** |
| | | * 对象类型(1=平台,2=城市管理员,3=门店) |
| | | */ |
| | | private Integer objectType; |
| | | /** |
| | | * objectId |
| | | */ |
| | | private Integer objectId; |
| | | |
| | | |
| | | public Integer getId() { |
| | |
| | | this.version = version; |
| | | } |
| | | |
| | | public Integer getObjectType() { |
| | | return objectType; |
| | | } |
| | | |
| | | public void setObjectType(Integer objectType) { |
| | | this.objectType = objectType; |
| | | } |
| | | |
| | | public Integer getObjectId() { |
| | | return objectId; |
| | | } |
| | | |
| | | public void setObjectId(Integer objectId) { |
| | | this.objectId = objectId; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | * @param state |
| | | * @return |
| | | */ |
| | | Page<Map<String, Object>> queryCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, String name, Integer status, Integer state); |
| | | Page<Map<String, Object>> queryCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, Integer storeId, String name, Integer status, Integer state); |
| | | } |
| | |
| | | * 获取所有省 |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryProvince(); |
| | | List<Map<String, Object>> queryProvince(String cityCode); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param provinceCode |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCity(Integer provinceCode); |
| | | List<Map<String, Object>> queryCity(String provinceCode, String cityCode); |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:49 |
| | | */ |
| | | public interface ITSiteService extends IService<TSite> { |
| | | } |
| | |
| | | import com.dsh.course.feignClient.course.CoursePackageClient; |
| | | import com.dsh.course.feignClient.course.model.QueryCoursePackageLists; |
| | | import com.dsh.guns.core.support.HttpKit; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Page<Map<String, Object>> queryCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, String name, Integer status, Integer state) { |
| | | public Page<Map<String, Object>> queryCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, Integer storeId, String name, Integer status, Integer state) { |
| | | QueryCoursePackageLists queryCoursePackageLists = new QueryCoursePackageLists(); |
| | | queryCoursePackageLists.setProvinceCode(provinceCode); |
| | | queryCoursePackageLists.setCityCode(cityCode); |
| | | queryCoursePackageLists.setCoursePackageTypeId(coursePackageTypeId); |
| | | queryCoursePackageLists.setStoreId(storeId); |
| | | queryCoursePackageLists.setName(name); |
| | | queryCoursePackageLists.setState(state); |
| | | queryCoursePackageLists.setStatus(status); |
| | |
| | | queryCoursePackageLists.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryCoursePackageLists.setSort(request.getParameter("sort")); |
| | | queryCoursePackageLists.setOrder(request.getParameter("order")); |
| | | return coursePackageClient.queryCoursePackageLists(queryCoursePackageLists); |
| | | Page<Map<String, Object>> mapPage = coursePackageClient.queryCoursePackageLists(queryCoursePackageLists); |
| | | List<Map<String, Object>> records = mapPage.getRecords(); |
| | | for (Map<String, Object> record : records) { |
| | | TStore store = storeService.getById(Integer.valueOf(record.get("storeId").toString())); |
| | | record.put("store", store.getName()); |
| | | } |
| | | return mapPage; |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryProvince() { |
| | | return this.baseMapper.queryProvince(); |
| | | public List<Map<String, Object>> queryProvince(String cityCode) { |
| | | return this.baseMapper.queryProvince(cityCode); |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryCity(Integer provinceCode) { |
| | | return this.baseMapper.queryCity(provinceCode); |
| | | public List<Map<String, Object>> queryCity(String provinceCode, String cityCode) { |
| | | return this.baseMapper.queryCity(provinceCode, cityCode); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.TSiteMapper; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | import com.dsh.guns.modular.system.service.ITSiteService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:50 |
| | | */ |
| | | @Service |
| | | public class TSiteServiceImpl extends ServiceImpl<TSiteMapper, TSite> implements ITSiteService { |
| | | } |
New file |
| | |
| | | <?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.TSiteMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.dsh.course.entity.TSite"> |
| | | <id column="id" property="id"/> |
| | | <result column="storeId" property="storeId"/> |
| | | <result column="name" property="name"/> |
| | | <result column="siteTypeId" property="siteTypeId"/> |
| | | <result column="cityManagerId" property="cityManagerId"/> |
| | | <result column="province" property="province"/> |
| | | <result column="provinceCode" property="provinceCode"/> |
| | | <result column="city" property="city"/> |
| | | <result column="cityCode" property="cityCode"/> |
| | | <result column="appointmentStartTime" property="appointmentStartTime"/> |
| | | <result column="appointmentEndTime" property="appointmentEndTime"/> |
| | | <result column="cashPrice" property="cashPrice"/> |
| | | <result column="playPaiCoin" property="playPaiCoin"/> |
| | | <result column="insuranceEndTime" property="insuranceEndTime"/> |
| | | <result column="insuranceImg" property="insuranceImg"/> |
| | | <result column="managementPlan" property="managementPlan"/> |
| | | <result column="state" property="state"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="queryProvince" resultType="map"> |
| | | select * from (select provinceCode as code, province as name from t_store where state = 1 group by provinceCode) as aa order by aa.code |
| | | select * from ( |
| | | select provinceCode as code, province as name from t_store where state = 1 |
| | | <if test="null != cityCode and '' != cityCode"> |
| | | and cityCode = #{cityCode} |
| | | </if> |
| | | group by provinceCode |
| | | ) as aa order by aa.code |
| | | </select> |
| | | |
| | | |
| | | <select id="queryCity" resultType="map"> |
| | | select * from (select cityCode as code, city as name from t_store where state = 1 and provinceCode = #{provinceCode} group by cityCode) as aa order by aa.code |
| | | select * from ( |
| | | select cityCode as code, city as name from t_store where state = 1 and provinceCode = #{provinceCode} |
| | | <if test="null != cityCode and '' != cityCode"> |
| | | and cityCode = #{cityCode} |
| | | </if> |
| | | group by cityCode |
| | | ) as aa order by aa.code |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="status" property="status" /> |
| | | <result column="createtime" property="createtime" /> |
| | | <result column="version" property="version" /> |
| | | <result column="objectType" property="objectType"/> |
| | | <result column="objectId" property="objectId"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | <div class="row"> |
| | | <div class="col-lg-10 col-sm-9"> |
| | | <div class="row"> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <div class="col-lg-4 col-sm-12" ${objectType == 3 ? 'style="display: none;"' : ''}> |
| | | <#SelectCon id="provinceCode" name="所在省"> |
| | | <option value="">全部</option> |
| | | @for(obj in province){ |
| | |
| | | @} |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <div class="col-lg-4 col-sm-12" ${objectType == 3 ? 'style="display: none;"' : ''}> |
| | | <#SelectCon id="cityCode" name="所在市"> |
| | | <option value="">全部</option> |
| | | </#SelectCon> |
| | |
| | | <option value="3">已结束</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <div class="col-lg-4 col-sm-12" ${objectType == 3 ? 'style="display: none;"' : ''}> |
| | | <#SelectCon id="state" name="售卖状态"> |
| | | <option value="">全部</option> |
| | | <option value="1">上架中</option> |
New file |
| | |
| | | @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="coursePackageTypeId" name="coursePackageTypeId"> |
| | | @for(obj in coursePackageType){ |
| | | <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"> |
| | | <input class="form-control" id="name" name="name"> |
| | | </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="form-group"> |
| | | <label class="col-sm-3 control-label">*授课教师:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="coachId" name="coachId"> |
| | | @for(obj in coach){ |
| | | <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"> |
| | | <input class="form-control" id="maxSubscribeNumber" name="maxSubscribeNumber" type="number" min="0"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">课程简介:</label> |
| | | <div class="col-sm-4"> |
| | | <textarea class="form-control" id="introduce" name="introduce" style="height: 200px;"></textarea> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*课程封面</label> |
| | | <div class="col-sm-2"> |
| | | <div id="coverDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${ctxPath}/img/NoPIC.png"></div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <div class="head-scu-btn upload-btn" id="coverDrawingBtnId"> |
| | | <i class="fa fa-upload"></i> 上传 |
| | | </div> |
| | | </div> |
| | | <input type="hidden" id="coverDrawing" value=""/> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:340 x 254px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*课程介绍</label> |
| | | <div class="col-sm-2"> |
| | | <div id="introductionDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${ctxPath}/img/NoPIC.png"></div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <div class="head-scu-btn upload-btn" id="introductionDrawingBtnId"> |
| | | <i class="fa fa-upload"></i> 上传 |
| | | </div> |
| | | </div> |
| | | <input type="hidden" id="introductionDrawing" value=""/> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:宽780px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*课程内容</label> |
| | | <div class="col-sm-2" style="padding-top: 30px;"> |
| | | <input type="file" id="upFile" name="upFile" style="display: none"> |
| | | <input class="form-control" id="courseVideo" readonly/> |
| | | </div> |
| | | <div class="col-sm-2" style="padding-top: 30px;"> |
| | | <button class="btn btn-outline btn-success" type="file" onclick="UploadFileFn()"><i class="fa fa-upload"></i>上传视频</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CourseInfo.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CourseInfo.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/course/course_info.js"></script> |
| | | <script type="text/javascript"> |
| | | var avatarUp = new $WebUpload("coverDrawing"); |
| | | avatarUp.setUploadBarId("progressBar"); |
| | | avatarUp.init(); |
| | | |
| | | var avatarUp1 = new $WebUpload("introductionDrawing"); |
| | | avatarUp1.setUploadBarId("progressBar"); |
| | | avatarUp1.init(); |
| | | |
| | | </script> |
| | | @} |
| | |
| | | Course.check = function () { |
| | | let selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | if(language==1){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select a record in the table first!"); |
| | | }else { |
| | | Feng.info("Pilih catatan di tabel terlebih dahulu!"); |
| | | } |
| | | return false; |
| | | } else { |
| | | Course.seItem = selected[0]; |
| | |
| | | let columns = [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '视频类型', field: 'type', align: 'center', valign: 'middle', |
| | | {title: '所在省市', field: 'city', align: 'center', valign: 'middle'}, |
| | | {title: '所属门店', field: 'store', align: 'center', valign: 'middle'}, |
| | | {title: '课包类型', field: 'coursePackageType', align: 'center', valign: 'middle'}, |
| | | {title: '课包名称', field: 'name', align: 'center', valign: 'middle'}, |
| | | {title: '最多预约人数', field: 'maxSubscribeNumber', align: 'center', valign: 'middle'}, |
| | | {title: '已报名人数', field: 'paymentNumber', align: 'center', valign: 'middle'}, |
| | | {title: '课程有效期', field: 'validDays', align: 'center', valign: 'middle'}, |
| | | {title: '支付方式', field: 'payType', align: 'center', valign: 'middle'}, |
| | | {title: '排序', field: 'sort', align: 'center', valign: 'middle'}, |
| | | {title: '课程封面', field: 'status', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | switch (v) { |
| | | case 1: |
| | | return '课后练习'; |
| | | return '未开始'; |
| | | case 2: |
| | | return '运动教学视频'; |
| | | return '售卖中'; |
| | | case 3: |
| | | return '器材教学视频'; |
| | | return '已结束'; |
| | | case 4: |
| | | return '已取消'; |
| | | } |
| | | |
| | | } |
| | | }, |
| | | {title: '课程封面', field: 'coverDrawing', align: 'center', valign: 'middle', |
| | | {title: '售卖状态', field: 'state', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | return '<img src="' + v + '" height="100px" onclick="lookBigImg(' + v + ')"/>' |
| | | switch (v) { |
| | | case 1: |
| | | return '已上架'; |
| | | case 2: |
| | | return '已下架'; |
| | | } |
| | | }, |
| | | {title: '课程名称', field: 'name', align: 'center', valign: 'middle'}, |
| | | {title: '课程简介', field: 'introduce', align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'state', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | return v == 1 ? '上架' : '下架'; |
| | | } |
| | | } |
| | | ]; |
| | |
| | | CoursePackage.check = function () { |
| | | let selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | if(language==1){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select a record in the table first!"); |
| | | }else { |
| | | Feng.info("Pilih catatan di tabel terlebih dahulu!"); |
| | | } |
| | | return false; |
| | | } else { |
| | | CoursePackage.seItem = selected[0]; |
| | |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/course/showAddCoursePackage' |
| | | content: Feng.ctxPath + '/coursePackage/openAddCoursePackage' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |