zhangxin 1 天之前
父節點
當前提交
7eb4162b57
共有 29 個文件被更改,包括 734 次插入85 次删除
  1. 53 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/game/GameController.java
  2. 1 3
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/stadium/StadiumController.java
  3. 25 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/IGameService.java
  4. 5 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/DetailServiceImpl.java
  5. 109 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/GameServiceImpl.java
  6. 23 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/FindByGameIdPriceVo.java
  7. 63 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/FindByIdResponse.java
  8. 45 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/FindPagResponse.java
  9. 18 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/FindPageGameVO.java
  10. 22 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/GamePriceRulesTypeVO.java
  11. 32 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/GamePriceRulesVO.java
  12. 35 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/GameScheduleVO.java
  13. 4 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/stadium/StadiumFindById.java
  14. 0 16
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppGameController.java
  15. 4 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/dto/AppGameDTO.java
  16. 0 8
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppGame.java
  17. 8 15
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppGameSchedule.java
  18. 10 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppGameMapper.java
  19. 10 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppGamePriceRulesMapper.java
  20. 2 3
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppGameScheduleMapper.java
  21. 1 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppFeedbackMapper.xml
  22. 177 12
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppGameMapper.xml
  23. 18 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppGamePriceRulesMapper.xml
  24. 3 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppGameScheduleMapper.xml
  25. 0 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppGameService.java
  26. 39 25
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppGameServiceImpl.java
  27. 12 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java
  28. 2 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java
  29. 13 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java

+ 53 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/game/GameController.java

@@ -0,0 +1,53 @@
+package org.jeecg.modules.app.controller.game;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.app.service.IGameService;
+import org.jeecg.modules.app.vo.game.FindByGameIdPriceVo;
+import org.jeecg.modules.app.vo.game.FindByIdResponse;
+import org.jeecg.modules.app.vo.game.FindPagResponse;
+import org.jeecg.modules.app.vo.game.FindPageGameVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * app赛事
+ */
+@Slf4j
+@Tag(name = "App赛事相关接口")
+@RestController
+@RequestMapping("/app/game")
+public class GameController {
+
+    @Autowired
+    private IGameService iGameService;
+
+
+    @GetMapping("/findByList")
+    @Operation(summary = "赛事列表查询")
+    public Result<IPage<FindPagResponse>> findConcerts(@Valid FindPageGameVO findPageGame){
+
+        return iGameService.findConcerts(findPageGame);
+    }
+
+
+    @GetMapping("/findById")
+    @Operation(summary = "赛事详情查询缺少订单")
+    public Result<FindByIdResponse> findById(@RequestParam("id") String id,@RequestParam("longitude") String longitude,@RequestParam("latitude") String latitude){
+        return iGameService.findById(id,longitude,latitude);
+    }
+
+    @GetMapping("/findByGameId")
+    @Operation(summary = "根据赛事id查询比赛详情缺少保险部分")
+    public Result<FindByGameIdPriceVo> findByGameId(@RequestParam("id") String id){
+        return iGameService.findByGameId(id);
+    }
+}

+ 1 - 3
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/stadium/StadiumController.java

@@ -34,9 +34,7 @@ public class StadiumController {
     @GetMapping("/getPlaceInfo")
     @Operation(summary = "场次详情查询-缺少已定状态和可预约数逻辑 ")
     public Result<StadiumConcertsResponseVO> findConcerts(StadiumFindById stadiumFindById){
-        String site_id = "1942781931946946561";
-        String category_id = "1942391828774895617";
-        return iDetailService.findConcerts(site_id,category_id);
+        return iDetailService.findConcerts(stadiumFindById.getSiteId(),stadiumFindById.getCategoryId());
     }
 
 }

+ 25 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/IGameService.java

@@ -0,0 +1,25 @@
+package org.jeecg.modules.app.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.app.vo.game.FindByGameIdPriceVo;
+import org.jeecg.modules.app.vo.game.FindByIdResponse;
+import org.jeecg.modules.app.vo.game.FindPagResponse;
+import org.jeecg.modules.app.vo.game.FindPageGameVO;
+
+/**
+ * @Description: 赛事表
+ * @Author: jeecg-boot
+ * @Date:   2025-07-03
+ * @Version: V1.0
+ */
+public interface IGameService {
+
+
+    Result<IPage<FindPagResponse>> findConcerts(FindPageGameVO findPageGame);
+
+    Result<FindByIdResponse> findById(String id, String longitude, String latitude);
+
+
+    Result<FindByGameIdPriceVo> findByGameId(String id);
+}

+ 5 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/DetailServiceImpl.java

@@ -164,7 +164,11 @@ public class DetailServiceImpl implements IDetailService {
             courseInfoVO.setSalesYear(getCourseSales(appCourses.getId()));
             courseInfoVO.setPriceType(isFirstPurchase(user.getId()));
             courseInfoVO.setCover(list.get(0));
-            courseInfoVO.setAddress(appSiteMapper.selectById(appCourses.getSiteId()).getAddress());
+            AppSite appSite = appSiteMapper.selectById(appCourses.getSiteId());
+            if (appSite!=null){
+                courseInfoVO.setAddress(appSite.getAddress());
+            }
+
             courseInfoVOList.add(courseInfoVO);
         });
         return courseInfoVOList;

+ 109 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/GameServiceImpl.java

@@ -0,0 +1,109 @@
+package org.jeecg.modules.app.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.app.service.IGameService;
+import org.jeecg.modules.app.vo.game.*;
+import org.jeecg.modules.system.app.mapper.AppGameMapper;
+import org.jeecg.modules.system.app.mapper.AppGamePriceRulesMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @Description: 赛事表
+ * @Author: jeecg-boot
+ * @Date: 2025-07-03
+ * @Version: V1.0
+ */
+@Service
+public class GameServiceImpl  implements IGameService {
+
+
+    @Autowired
+    private AppGameMapper appGameMapper;
+    @Autowired
+    private AppGamePriceRulesMapper appGamePriceRulesMapper;
+
+
+    @Override
+    public Result<IPage<FindPagResponse>> findConcerts(FindPageGameVO findPageGame) {
+
+        if (StringUtils.isEmpty(findPageGame.getLatitude())||StringUtils.isEmpty(findPageGame.getLongitude())){
+            return Result.error("经纬度不能为空");
+        }
+        double latitude = 0;
+        double longitude = 0;
+        try {
+            latitude = Double.parseDouble(findPageGame.getLatitude());
+            longitude = Double.parseDouble(findPageGame.getLongitude());
+        } catch (NumberFormatException e) {
+            return Result.error("经纬度格式错误");
+        }
+        Page<FindPagResponse> page = new Page<>(findPageGame.getPageNo(), findPageGame.getPageSize());
+
+        return Result.OK(appGameMapper.findConcerts(page,longitude,latitude)) ;
+    }
+
+    @Override
+    public Result<FindByIdResponse> findById(String id,String longitude, String latitude) {
+        if (StringUtils.isEmpty(id)){
+            return Result.error("未选择赛事");
+        }
+        if (StringUtils.isEmpty(longitude)||StringUtils.isEmpty(latitude)){
+            return Result.error("经纬度不能为空");
+        }
+        double latitudeNew = 0;
+        double longitudeNew = 0;
+        try {
+            latitudeNew = Double.parseDouble(latitude);
+            longitudeNew = Double.parseDouble(longitude);
+        } catch (NumberFormatException e) {
+            return Result.error("经纬度格式错误");
+        }
+        FindByIdResponse findByIdResponse =  appGameMapper.findById(id,longitudeNew,latitudeNew);
+        if (findByIdResponse!=null&&StringUtils.isNotEmpty(findByIdResponse.getBackgroundImage())){
+            List<String> backgroundImageList = new ArrayList<>();
+            if (findByIdResponse.getBackgroundImage().indexOf(",")>0){
+                backgroundImageList= Arrays.asList(findByIdResponse.getBackgroundImage().split(","));
+            }else {
+                backgroundImageList.add(findByIdResponse.getBackgroundImage());
+            }
+            findByIdResponse.setBackgroundImageList(backgroundImageList);
+        }
+        return Result.OK(findByIdResponse);
+    }
+
+    @Override
+    public Result<FindByGameIdPriceVo> findByGameId(String id) {
+        FindByGameIdPriceVo findByGameIdPriceVo = appGameMapper.findByGameId(id);
+        if (findByGameIdPriceVo==null){
+            return Result.error("该赛事未查询到比赛");
+        }
+        if (StringUtils.isNotEmpty(findByGameIdPriceVo.getAptitudes())){
+            List<String> aptitudesList = new ArrayList<>();
+            if (findByGameIdPriceVo.getAptitudes().indexOf(",")>0){
+                aptitudesList =  Arrays.asList(findByGameIdPriceVo.getAptitudes().split(","));
+            }else {
+                aptitudesList.add(findByGameIdPriceVo.getAptitudes());
+            }
+            findByGameIdPriceVo.setAptitudesList(aptitudesList);
+        }
+        if (ObjectUtils.isNotEmpty(findByGameIdPriceVo.getGamePriceRulesTypeVOList())&&!findByGameIdPriceVo.getGamePriceRulesTypeVOList().isEmpty()){
+            for (GamePriceRulesTypeVO gamePriceRulesTypeVO : findByGameIdPriceVo.getGamePriceRulesTypeVOList()) {
+                if (ObjectUtils.isNotEmpty(gamePriceRulesTypeVO.getType())){
+                    List<GamePriceRulesVO> gamePriceRulesVOList=  appGamePriceRulesMapper.findByGameIdList(id,gamePriceRulesTypeVO.getType());
+                    gamePriceRulesTypeVO.setGamePriceRulesVOList(gamePriceRulesVOList);
+                }
+            }
+        }
+        return Result.OK(findByGameIdPriceVo);
+    }
+
+}

+ 23 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/FindByGameIdPriceVo.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.app.vo.game;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="比赛项目详情返回参数")
+public class FindByGameIdPriceVo {
+    @Schema(description = "赛事主键id")
+    private String id;
+    @Schema(description = "资质")
+    private String aptitudes;
+    @Schema(description = "资质集合")
+    private List<String> aptitudesList;
+    @Schema(description = "比赛项目")
+    private List<GamePriceRulesTypeVO> gamePriceRulesTypeVOList;
+}

+ 63 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/FindByIdResponse.java

@@ -0,0 +1,63 @@
+package org.jeecg.modules.app.vo.game;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="赛事详情返回参数")
+public class FindByIdResponse {
+    @Schema(description = "主键id")
+    private String id;
+    @Schema(description = "封面")
+    private String cover;
+    @Schema(description = "赛事名称")
+    private String name;
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @Schema(description = "开始时间")
+    private Date startTime;
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @Schema(description = "结束时间")
+    private Date endTime;
+    @Schema(description = "主办单位")
+    private String organizers;
+    @Schema(description = "图片说明")
+    private String reminder;
+    @Schema(description = "背景图")
+    private String backgroundImage;
+    @Schema(description = "背景图集合")
+    private List<String> backgroundImageList;
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "报名结束时间")
+    private Date applicationEndTime;
+    @Schema(description = "地址")
+    private String address;
+    @Schema(description = "产品类型 0-报名中 1-报名结束")
+    private String isEntry;
+    @Schema(description = "KM")
+    private Double km;
+    @Schema(description ="经度")
+    private BigDecimal longitude;
+    @Schema(description ="纬度")
+    private BigDecimal latitude;
+    @Schema(description ="手机号")
+    private String phone;
+    @Schema(description = "赛事类型 0-个人赛 1-团队赛 2-个人/团队赛")
+    private Integer  type;
+    @Schema(description = "比赛项目")
+    private List<GamePriceRulesVO> gamePriceRulesVOList;
+    @Schema(description = "赛程")
+    private List<GameScheduleVO> gameScheduleVOList;
+}

+ 45 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/FindPagResponse.java

@@ -0,0 +1,45 @@
+package org.jeecg.modules.app.vo.game;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="赛事分页返回参数")
+public class FindPagResponse {
+
+    @Schema(description = "主键id")
+    private String id;
+    @Schema(description = "封面")
+    private String cover;
+    @Schema(description = "赛事名称")
+    private String name;
+    @Schema(description = "最低价格")
+    private BigDecimal minPrice;
+    @JsonFormat(timezone = "GMT+8",pattern = "MM-dd")
+    @DateTimeFormat(pattern="MM-dd")
+    @Schema(description = "开始时间")
+    private Date startTime;
+    @JsonFormat(timezone = "GMT+8",pattern = "MM-dd")
+    @DateTimeFormat(pattern="MM-dd")
+    @Schema(description = "结束时间")
+    private Date endTime;
+    @Schema(description = "地址")
+    private String address;
+    @Schema(description = "产品类型 0-报名中 1-报名结束")
+    private String isEntry;
+    @Schema(description = "KM")
+    private Double km;
+    @Schema(description = "赛事类型 0-个人赛 1-团队赛 2-个人/团队赛")
+    private Integer  type;
+
+
+}

+ 18 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/FindPageGameVO.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.app.vo.game;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecg.modules.app.dto.PageDTO;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="赛事查询条件")
+public class FindPageGameVO extends PageDTO {
+    @Schema(description ="经度")
+    private String longitude;
+    @Schema(description ="纬度")
+    private String latitude;
+}

+ 22 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/GamePriceRulesTypeVO.java

@@ -0,0 +1,22 @@
+package org.jeecg.modules.app.vo.game;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="比赛项目详情返回参数")
+public class GamePriceRulesTypeVO {
+    @Schema(description = "比赛项目类型Int")
+    private Integer type;
+    @Schema(description = "比赛项目类型")
+    private String typeName;
+    @Schema(description = "比赛项目名称")
+    private List<GamePriceRulesVO> gamePriceRulesVOList;
+
+}

+ 32 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/GamePriceRulesVO.java

@@ -0,0 +1,32 @@
+package org.jeecg.modules.app.vo.game;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="比赛项目详情返回参数")
+public class GamePriceRulesVO {
+    @Schema(description = "主键id")
+    private String id;
+    @Schema(description = "比赛项目名称")
+    private String categoryName;
+    @Schema(description = "比赛项目id")
+    private String categoryId;
+    @Schema(description = "人数")
+    private Integer peopleNum;
+    @Schema(description = "价格")
+    private BigDecimal sellingPrice;
+    /**比赛类型;0个人1团队*/
+    @Schema(description = "比赛类型;0个人1团队")
+    private Integer type;
+    /**赛事id*/
+    @Schema(description = "赛事id")
+    private String gameId;
+
+}

+ 35 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/game/GameScheduleVO.java

@@ -0,0 +1,35 @@
+package org.jeecg.modules.app.vo.game;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="赛程详情返回参数")
+public class GameScheduleVO {
+
+    @Schema(description = "主键id")
+    private String id;
+    @Schema(description = "赛事名称")
+    private String name;
+    @JsonFormat(timezone = "GMT+8",pattern = "MM-dd HH:mm")
+    @DateTimeFormat(pattern="MM-dd HH:mm")
+    @Schema(description = "开始时间")
+    private Date startTime;
+    @JsonFormat(timezone = "GMT+8",pattern = "MM-dd HH:mm")
+    @DateTimeFormat(pattern="MM-dd HH:mm")
+    @Schema(description = "结束时间")
+    private Date endTime;
+    @Schema(description = "安排")
+    private String arrange;
+    @Schema(description = "赛事状态")
+    private String  startStatus;
+
+}

+ 4 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/stadium/StadiumFindById.java

@@ -5,13 +5,17 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import javax.validation.constraints.NotNull;
+
 @Data
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = false)
 @Schema(description="体育馆场次请求")
 public class StadiumFindById {
+    @NotNull(message = "场所不能为空")
     @Schema(description = "场所id")
     private String siteId;
+    @NotNull(message = "运动类型不能为空")
     @Schema(description = "运动类型id")
     private String categoryId;
 

+ 0 - 16
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppGameController.java

@@ -13,13 +13,11 @@ import org.jeecg.modules.system.app.dto.AppGamePageDTO;
 import org.jeecg.modules.system.app.entity.AppGame;
 import org.jeecg.modules.system.app.service.IAppGameService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.util.concurrent.TimeUnit;
 
 /**
  * @Description: 赛事表
@@ -136,20 +134,6 @@ public class AppGameController extends JeecgController<AppGame, IAppGameService>
 		 return Result.OK("上传成绩成功");
 	 }
 
-	 /**
-	  *
-	  *伪删除 将需要删除的数据保存到redis
-	  * @param id
-	  * @return
-	  */
-	 @Operation(summary="赛事表-发布成绩")
-	 @DeleteMapping(value = "/feignDelete")
-	 public Result<String> feignDelete(@RequestParam(name="id") String  id) {
-		 appGameService.redisSave(id);
-
-		 return Result.OK();
-	 }
-
     /**
     * 导出excel
     *

+ 4 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/dto/AppGameDTO.java

@@ -28,6 +28,10 @@ public class AppGameDTO {
     private List<AppGameRuleDTO> gamePriceRules;
     @ArraySchema(schema = @Schema(implementation = AppGameScheduleDTO.class), minItems = 1)
     private List<AppGameScheduleDTO> scheduleDTOS;
+    @Schema(description = "删除比赛项目id")
+    private String gamePriceRulesList;
+    @Schema(description = "删除课程安排id")
+    private String scheduleDTOSList;
 
 
     public AppGameDTO(AppGameCuDTO game, List<AppGameRuleDTO> gamePriceRules, List<AppGameScheduleDTO> scheduleDTOS) {

+ 0 - 8
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppGame.java

@@ -96,14 +96,6 @@ public class AppGame implements Serializable {
 	@Excel(name = "赛事成绩", width = 15)
     @Schema(description = "赛事成绩")
     private String gameResults;
-	/**排序*/
-	@Excel(name = "排序", width = 15)
-    @Schema(description = "排序")
-    private Integer sort;
-	/**系统状态;状态(0-正常,1-冻结)*/
-	@Excel(name = "系统状态;状态(0-正常,1-冻结)", width = 15)
-    @Schema(description = "系统状态;状态(0-正常,1-冻结)")
-    private Integer status;
 	/**删除标志;删除状态(0-正常,1-已删除)*/
 	@Excel(name = "删除标志;删除状态(0-正常,1-已删除)", width = 15)
     @Schema(description = "删除标志;删除状态(0-正常,1-已删除)")

+ 8 - 15
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppGameSchedule.java

@@ -1,23 +1,19 @@
 package org.jeecg.modules.system.app.entity;
 
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.util.Date;
-import java.math.BigDecimal;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableLogic;
-import org.jeecg.common.constant.ProvinceCityArea;
-import org.jeecg.common.util.SpringContextUtils;
-import lombok.Data;
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.jeecg.common.aspect.annotation.Dict;
 import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
 
 /**
  * @Description: 赛程安排表
@@ -84,10 +80,7 @@ public class AppGameSchedule implements Serializable {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @Schema(description = "更新时间;更新时间")
     private Date updateTime;
-	/**系统状态;状态(0-正常,1-冻结)*/
-	@Excel(name = "系统状态;状态(0-正常,1-冻结)", width = 15)
-    @Schema(description = "系统状态;状态(0-正常,1-冻结)")
-    private Integer status;
+
 	/**删除标志;删除状态(0-正常,1-已删除)*/
 	@Excel(name = "删除标志;删除状态(0-正常,1-已删除)", width = 15)
     @Schema(description = "删除标志;删除状态(0-正常,1-已删除)")

+ 10 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppGameMapper.java

@@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.app.dto.SearchDTO;
 import org.jeecg.modules.app.vo.SearchVO;
+import org.jeecg.modules.app.vo.game.FindByGameIdPriceVo;
+import org.jeecg.modules.app.vo.game.FindByIdResponse;
+import org.jeecg.modules.app.vo.game.FindPagResponse;
 import org.jeecg.modules.system.app.dto.AppGameDTO;
 import org.jeecg.modules.system.app.dto.AppGamePageDTO;
 import org.jeecg.modules.system.app.entity.AppGame;
@@ -27,4 +30,11 @@ public interface AppGameMapper extends BaseMapper<AppGame> {
     Page<SearchVO.SearchRaceVO> convertSearchCompetitionVOPage(@Param("page")Page<SearchVO.SearchRaceVO> page,@Param("searchDTO")SearchDTO searchDTO);
 
     IPage<AppGameDTO> findPage(@Param("page")Page<AppGame> page, @Param("appGamePageDTO")AppGamePageDTO appGamePageDTO);
+
+    IPage<FindPagResponse> findConcerts(@Param("page") Page<FindPagResponse> page,@Param("longitude")  double longitude,@Param("latitude")  double latitude);
+
+
+    FindByIdResponse findById(@Param("id") String id,@Param("longitude")  double longitude,@Param("latitude")  double latitude);
+
+    FindByGameIdPriceVo findByGameId(@Param("id") String id);
 }

+ 10 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppGamePriceRulesMapper.java

@@ -1,8 +1,13 @@
 package org.jeecg.modules.system.app.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.app.vo.game.GamePriceRulesVO;
+import org.jeecg.modules.system.app.dto.AppGameRuleDTO;
 import org.jeecg.modules.system.app.entity.AppGamePriceRules;
 
+import java.util.List;
+
 /**
  * @Description: 赛事价格规则表
  * @Author: jeecg-boot
@@ -11,4 +16,9 @@ import org.jeecg.modules.system.app.entity.AppGamePriceRules;
  */
 public interface AppGamePriceRulesMapper extends BaseMapper<AppGamePriceRules> {
 
+    int updateByIdDel(@Param("id") String id);
+
+    List<AppGameRuleDTO> findByGameId(@Param("gameId")String gameId);
+
+    List<GamePriceRulesVO> findByGameIdList(@Param("gameId")String gameId, @Param("type") Integer type);
 }

+ 2 - 3
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppGameScheduleMapper.java

@@ -1,10 +1,8 @@
 package org.jeecg.modules.system.app.mapper;
 
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.system.app.entity.AppGameSchedule;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * @Description: 赛程安排表
@@ -14,4 +12,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface AppGameScheduleMapper extends BaseMapper<AppGameSchedule> {
 
+    int updateByIdDel(@Param("id") String id);
 }

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppFeedbackMapper.xml

@@ -4,7 +4,7 @@
 
 
     <select id="findPage" resultType="org.jeecg.modules.system.app.dto.FindResponseDTO">
-        select  f.id,f.feedback_type,f.feedback_described,f.feedback_img,f.reply_status,f.reply_content,f.create_time,su.username,su.phone from nm_feedback f left join  sys_user su on f.user_id =su.id
+        select  f.id,f.feedback_type,f.feedback_described,f.feedback_img,f.reply_status,f.reply_content,f.create_time,su.username,su.phone,su.avatar from nm_feedback f left join  sys_user su on f.user_id =su.id
         where f.del_flag =0
         <if test="findPageRequestDTO.phone != null and findPageRequestDTO.phone != ''">
             and su.phone=#{findPageRequestDTO.phone}

+ 177 - 12
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppGameMapper.xml

@@ -45,6 +45,54 @@
         </collection>
     </resultMap>
 
+    <resultMap id="gameResultMap" type="org.jeecg.modules.app.vo.game.FindByIdResponse">
+        <id property="id" column="id"/>
+        <result property="cover" column="cover"/>
+        <result property="name" column="name"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
+        <result property="organizers" column="organizers"/>
+        <result property="reminder" column="reminder"/>
+        <result property="backgroundImage" column="background_image"/>
+        <result property="applicationEndTime" column="application_end_time"/>
+        <result property="address" column="address"/>
+        <result property="isEntry" column="is_entry"/>
+        <result property="km" column="km"/>
+        <result property="type" column="type"/>
+        <result property="phone" column="mobile"/>
+        <result property="latitude" column="latitude"/>
+        <result property="longitude" column="longitude"/>
+
+        <!-- 关联查询 - 赛程安排 -->
+        <collection property="gameScheduleVOList" ofType="org.jeecg.modules.app.vo.game.GameScheduleVO" javaType="java.util.List" columnPrefix="c_">
+            <id property="id" column="id"/>
+            <result property="arrange" column="arrange"/>
+            <result property="name" column="name"/>
+            <result property="startTime" column="start_time"/>
+            <result property="endTime" column="end_time"/>
+            <result property="startStatus" column="startStatus"/>
+        </collection>
+        <!-- 关联查询 - 比赛项目价格规则 -->
+        <collection property="gamePriceRulesVOList" ofType="org.jeecg.modules.app.vo.game.GamePriceRulesVO" javaType="java.util.List" columnPrefix="b_">
+            <id property="id" column="id"/>
+            <result property="categoryName" column="category_name"/>
+            <result property="categoryId" column="category_id"/>
+            <result property="sellingPrice" column="selling_price" javaType="java.math.BigDecimal"/>
+            <result property="peopleNum" column="people_num"/>
+        </collection>
+    </resultMap>
+
+
+    <resultMap id="findByGameIdPriceVoMap" type="org.jeecg.modules.app.vo.game.FindByGameIdPriceVo">
+        <id property="id" column="id"/>
+        <result property="aptitudes" column="aptitudes"/>
+        <!-- 关联查询 - 比赛项目安排 -->
+        <collection property="gamePriceRulesTypeVOList" ofType="org.jeecg.modules.app.vo.game.GamePriceRulesTypeVO" javaType="java.util.List">
+            <id property="type" column="type"/>
+            <result property="typeName" column="type_name"/>
+        </collection>
+    </resultMap>
+
     <select id="convertSearchCompetitionVOPage" resultType="org.jeecg.modules.app.vo.SearchVO$SearchRaceVO" parameterType="org.jeecg.modules.app.dto.SearchDTO">
         SELECT
         a.id,
@@ -68,20 +116,52 @@
         </if>
         ORDER BY a.end_time ASC;
     </select>
+<!--    <select id="findPage" resultMap="appGameDTOResult">-->
+<!--        select  a.id as a_id, a.org_code as a_org_code, a.tenant_id as a_tenant_id, a.name as a_name, a.cover as a_cover,-->
+<!--                a.background_image as a_background_image, a.organizers as a_organizers, a.site_type as a_site_type,-->
+<!--                a.site_id as a_site_id, a.province_code as a_province_code,a.city_code as a_city_code,-->
+<!--                a.area_code as a_area_code, IFNULL(b.name, a.address) as a_address, IFNULL(b.latitude, a.latitude) as a_latitude,IFNULL(b.longitude, a.longitude) as a_longitude,-->
+<!--                a.application_end_time as a_application_end_time, a.insure_ids as a_insure_ids, a.start_time as a_start_time,-->
+<!--                a.end_time as a_end_time, a.reminder as  a_reminder, a.aptitudes as a_aptitudes, a.game_results as a_game_results,a.create_time as a_create_time,-->
+<!--                c.id AS c_id,c.game_id as c_game_id,c.type as c_type,d.name as c_category_name,c.category_id as c_category_id,c.selling_price as  c_selling_price-->
+<!--                ,c.people_num as c_people_num,c.type as c_type,e.id as e_id,e.name as e_scheduleName,e.start_time as e_eStartTime,e.end_time as e_eEndTime, e.arrange as e_arrange-->
+<!--                from nm_game a-->
+<!--                 left join nm_site b on  a.site_id = b.id and b.del_flag=0-->
+<!--                 left join  nm_game_price_rules c on  c.game_id = a.id and c.del_flag=0-->
+<!--                 left join nm_game_schedule e on e.game_id =a.id-->
+<!--                 left join nm_category d on  c.category_id = d.id and d.del_flag=0-->
+<!--        where a.del_flag = 0-->
+<!--        <if test="appGamePageDTO != null and appGamePageDTO != ''">-->
+<!--            <if test="appGamePageDTO.name != null and appGamePageDTO.name != ''">-->
+<!--                AND a.name LIKE CONCAT('%',#{appGamePageDTO.name},'%')-->
+<!--            </if>-->
+<!--            <if test="appGamePageDTO.categoryId != null and appGamePageDTO.categoryId != ''">-->
+<!--                AND a.id in (select game_id from nm_game_price_rules where category_id  = #{appGamePageDTO.categoryId}  )-->
+<!--            </if>-->
+<!--            <if test="appGamePageDTO.endTime!=null  and staffRequestVO.endTime!=''">-->
+<!--                <![CDATA[   AND DATE_FORMAT(a.application_end_time, '%Y-%m-%d')<=  DATE_FORMAT(#{appGamePageDTO.endTime}, '%Y-%m-%d') ]]>-->
+<!--            </if>-->
+<!--            <if test="appGamePageDTO.startTime!=null  and appGamePageDTO.startTime!=''">-->
+<!--                <![CDATA[   AND DATE_FORMAT(a.application_end_time, '%Y-%m-%d')<=  DATE_FORMAT(#{appGamePageDTO.startTime}, '%Y-%m-%d') ]]>-->
+<!--            </if>-->
+<!--            <if test="appGamePageDTO.orgCode != null and appGamePageDTO.orgCode != ''">-->
+<!--                AND a.org_code LIKE CONCAT(#{appGamePageDTO.orgCode},'%')-->
+<!--            </if>-->
+<!--        </if>-->
+<!--    </select>-->
+
     <select id="findPage" resultMap="appGameDTOResult">
         select  a.id as a_id, a.org_code as a_org_code, a.tenant_id as a_tenant_id, a.name as a_name, a.cover as a_cover,
-                a.background_image as a_background_image, a.organizers as a_organizers, a.site_type as a_site_type,
-                a.site_id as a_site_id, a.province_code as a_province_code,a.city_code as a_city_code,
-                a.area_code as a_area_code, IFNULL(b.name, a.address) as a_address, IFNULL(b.latitude, a.latitude) as a_latitude,IFNULL(b.longitude, a.longitude) as a_longitude,
-                a.application_end_time as a_application_end_time, a.insure_ids as a_insure_ids, a.start_time as a_start_time,
-                a.end_time as a_end_time, a.reminder as  a_reminder, a.aptitudes as a_aptitudes, a.game_results as a_game_results,a.create_time as a_create_time,
-                c.id AS c_id,c.game_id as c_game_id,c.type as c_type,d.name as c_category_name,c.category_id as c_category_id,c.selling_price as  c_selling_price
-                ,c.people_num as c_people_num,c.type as c_type,e.id as e_id,e.name as e_scheduleName,e.start_time as e_eStartTime,e.end_time as e_eEndTime, e.arrange as e_arrange
-                from nm_game a
-                 left join nm_site b on  a.site_id = b.id and b.del_flag=0
-                 left join  nm_game_price_rules c on  c.game_id = a.id and c.del_flag=0
-                 left join nm_game_schedule e on e.game_id =a.id
-                 left join nm_category d on  c.category_id = d.id and d.del_flag=0
+        a.background_image as a_background_image, a.organizers as a_organizers, a.site_type as a_site_type,
+        a.site_id as a_site_id, a.province_code as a_province_code,a.city_code as a_city_code,
+        a.area_code as a_area_code, IFNULL(b.name, a.address) as a_address, IFNULL(b.latitude, a.latitude) as a_latitude,IFNULL(b.longitude, a.longitude) as a_longitude,
+        a.application_end_time as a_application_end_time, a.insure_ids as a_insure_ids, a.start_time as a_start_time,
+        a.end_time as a_end_time, a.reminder as  a_reminder, a.aptitudes as a_aptitudes, a.game_results as a_game_results,a.create_time as a_create_time
+        from nm_game a
+        left join nm_site b on  a.site_id = b.id and b.del_flag=0
+        left join  nm_game_price_rules c on  c.game_id = a.id and c.del_flag=0
+        left join nm_game_schedule e on e.game_id =a.id
+        left join nm_category d on  c.category_id = d.id and d.del_flag=0
         where a.del_flag = 0
         <if test="appGamePageDTO != null and appGamePageDTO != ''">
             <if test="appGamePageDTO.name != null and appGamePageDTO.name != ''">
@@ -100,5 +180,90 @@
                 AND a.org_code LIKE CONCAT(#{appGamePageDTO.orgCode},'%')
             </if>
         </if>
+        group by  a.id
+        order by a.application_end_time desc
+    </select>
+    <select id="findConcerts" resultType="org.jeecg.modules.app.vo.game.FindPagResponse">
+        <![CDATA[
+        select
+        a.id,a.cover,a.name,a.start_time,a.end_time,MIN(b.selling_price) as min_price,
+        IFNULL(d.name, a.address) as address
+        ,a.application_end_time
+        ,CASE
+        WHEN a.application_end_time <= NOW()
+        THEN 1
+        ELSE 0
+        END AS is_entry
+        , ST_Distance_Sphere(
+        POINT(#{longitude}, #{latitude}),
+        POINT(IFNULL(d.longitude, a.longitude),IFNULL(d.latitude, a.latitude))
+        ) /1000 AS km,
+        CASE
+        WHEN EXISTS (SELECT 1 FROM nm_game_price_rules WHERE game_id = a.id AND del_flag = 0 AND type = 0)
+        AND EXISTS (SELECT 1 FROM nm_game_price_rules WHERE game_id = a.id AND del_flag = 0 AND type = 1)
+        THEN 2
+        ELSE MAX(b.type)
+        END AS type
+        from nm_game a
+        left JOIN nm_game_price_rules b on a.id = b.game_id and b.del_flag=0
+        LEFT JOIN nm_game_schedule c on a.id = c.game_id and c.del_flag=0
+        left join nm_site d on  a.site_id = d.id and d.del_flag=0
+        where a.del_flag=0
+        GROUP BY  a.id
+        ORDER BY a.application_end_time DESC
+        ]]>
+    </select>
+
+    <select id="findById" resultMap="gameResultMap">
+        <![CDATA[
+        select
+            a.id ,a.cover ,a.name,a.start_time ,a.end_time ,a.organizers,a.reminder,
+            a.background_image,f.mobile,IFNULL(d.longitude, a.longitude) as longitude,IFNULL(d.latitude, a.latitude) as latitude,
+            IFNULL(d.name, a.address) as address
+            ,a.application_end_time as application_end_time,
+            CASE
+                WHEN a.application_end_time < NOW() THEN 1
+                ELSE 0
+                END AS is_entry,
+            ST_Distance_Sphere(
+                    POINT(#{longitude}, #{latitude}),
+                    POINT(IFNULL(d.longitude, a.longitude),IFNULL(d.latitude, a.latitude))
+                ) /1000 AS km,
+            CASE
+                WHEN EXISTS (SELECT 1 FROM nm_game_price_rules WHERE game_id = a.id AND del_flag = 0 AND type = 0)
+                    AND EXISTS (SELECT 1 FROM nm_game_price_rules WHERE game_id = a.id AND del_flag = 0 AND type = 1)
+                    THEN 3
+                ELSE MAX(b.type)
+                END AS type,
+            c.name as c_name ,c.start_time as c_start_time,c.end_time as c_end_time,c.arrange as c_arrange,
+            CASE
+                WHEN NOW() < c.start_time THEN '未开始'
+                WHEN NOW() >= c.end_time THEN '已结束'
+                ELSE '进行中'
+                END AS c_startStatus,c.id as c_id,
+        e.name as b_category_name,b.category_id as b_category_id,b.id as b_id,b.selling_price as b_selling_price,b.people_num as b_people_num
+        from nm_game a
+        left JOIN nm_game_price_rules b on a.id = b.game_id and b.del_flag=0
+        LEFT JOIN nm_game_schedule c on a.id = c.game_id and c.del_flag=0
+        left join nm_site d on  a.site_id = d.id and d.del_flag=0
+        left join nm_category e on  b.category_id = e.id and e.del_flag=0
+        left join sys_depart f on  a.org_code = f.org_code and f.del_flag=0
+        WHERE a.del_flag=0 and a.id =#{id}
+        GROUP BY  a.id,b.id,c.id
+        ORDER BY a.application_end_time DESC
+        ]]>
+    </select>
+
+    <select id="findByGameId" resultMap="findByGameIdPriceVoMap">
+        select a.id,a.aptitudes,b.type,
+        CASE
+        WHEN b.type = 0 THEN '个人赛项目'
+        WHEN b.type = 1 THEN '团队赛项目'
+        ELSE '未知类型项目'
+        END AS type_name
+        from  nm_game a
+        LEFT JOIN nm_game_price_rules b on a.id = b.game_id and b.del_flag=0
+        where a.del_flag=0 and a.id=#{id}
+        group by a.id, b.type
     </select>
 </mapper>

+ 18 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppGamePriceRulesMapper.xml

@@ -2,4 +2,22 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.system.app.mapper.AppGamePriceRulesMapper">
 
+    <update id="updateByIdDel">
+        UPDATE nm_game_price_rules SET del_flag=1 WHERE id=#{id}
+    </update>
+    <select id="findByGameId" resultType="org.jeecg.modules.system.app.dto.AppGameRuleDTO">
+        select a.id,a.game_id,a.category_id,a.selling_price,a.people_num,a.type,a.del_flag,b.name AS category_name
+        from  nm_game_price_rules a
+        LEFT JOIN nm_category b   ON a.category_id  =b.id AND b.del_flag = 0
+        where  a.del_flag = 0  and a.game_id =#{gameId}
+    </select>
+    <select id="findByGameIdList" resultType="org.jeecg.modules.app.vo.game.GamePriceRulesVO">
+        select a.id,a.game_id,a.category_id,a.selling_price,a.people_num,a.type,b.name AS category_name
+        from  nm_game_price_rules a
+        LEFT JOIN nm_category b   ON a.category_id  =b.id AND b.del_flag = 0
+        where  a.del_flag = 0  and a.game_id =#{gameId}
+        <if test="type!= null">
+            AND a.type =#{type}
+        </if>
+    </select>
 </mapper>

+ 3 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppGameScheduleMapper.xml

@@ -2,4 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.system.app.mapper.AppGameScheduleMapper">
 
+    <update id="updateByIdDel">
+        UPDATE nm_game_schedule SET del_flag=1 WHERE id=#{id}
+    </update>
 </mapper>

+ 0 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppGameService.java

@@ -40,5 +40,4 @@ public interface IAppGameService extends IService<AppGame> {
 
     IPage<AppGameDTO> queryWitchPriceRulesPage(AppGamePageDTO dto);
 
-    void redisSave(String id);
 }

+ 39 - 25
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppGameServiceImpl.java

@@ -26,7 +26,6 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 
 import static org.jeecg.common.constant.CommonConstant.SC_INTERNAL_SERVER_ERROR_500;
 
@@ -108,6 +107,37 @@ public class AppGameServiceImpl extends ServiceImpl<AppGameMapper, AppGame> impl
         if (updateGameResult < 1) {
             throw new JeecgBootException("赛事信息保存失败");
         }
+        if (StringUtils.isNotEmpty(gameDTO.getGamePriceRulesList())){
+            if (gameDTO.getGamePriceRulesList().indexOf(",")>0){
+                for (String id : gameDTO.getGamePriceRulesList().split(",")) {
+                    int i =rulesMapper.updateByIdDel(id);
+                    if (i<1){
+                        throw new JeecgBootException("删除赛程安排失败");
+                    }
+                }
+            }else {
+                int i = rulesMapper.updateByIdDel(gameDTO.getGamePriceRulesList());
+                if (i<1){
+                    throw new JeecgBootException("删除赛程安排失败");
+                }
+            }
+
+        }
+        if (StringUtils.isNotEmpty(gameDTO.getScheduleDTOSList())){
+            if (gameDTO.getScheduleDTOSList().indexOf(",")>0){
+                for (String id : gameDTO.getScheduleDTOSList().split(",")) {
+                    int i =  scheduleMapper.updateByIdDel(id);
+                    if (i<1){
+                        throw new JeecgBootException("删除比赛项目失败");
+                    }
+                }
+            }else {
+                int i =  scheduleMapper.updateByIdDel(gameDTO.getScheduleDTOSList());
+                if (i<1){
+                    throw new JeecgBootException("删除比赛项目失败");
+                }
+            }
+        }
         gameDTO.getGamePriceRules().forEach(gameRuleDTO -> {
             AppGamePriceRules appGamePriceRules = new AppGamePriceRules();
             BeanUtils.copyProperties(gameRuleDTO, appGamePriceRules);
@@ -193,32 +223,16 @@ public class AppGameServiceImpl extends ServiceImpl<AppGameMapper, AppGame> impl
 //                .like(StringUtils.isNotBlank(dto.getName()), AppGame::getName, dto.getName());
 //                .eq(AppGame::getOrgCode, loginUser.getOrgCode());
         dto.setOrgCode(loginUser.getOrgCode());
-        return  appGameMapper.findPage(page,dto);
-//        IPage<AppGame> resultPage = baseMapper.selectPage(page, wrapper);
-//        return resultPage.convert(record -> {
-//            AppGameCuDTO cuDTO = new AppGameCuDTO();
-//            BeanUtils.copyProperties(cuDTO, record);
-//            List<AppGameRuleDTO> priceRulesDTOList = new ArrayList<>();
-//            rulesMapper.selectList(Wrappers.<AppGamePriceRules>lambdaQuery().eq(AppGamePriceRules::getGameId, record.getId())).forEach(rule-> {
-//                AppGameRuleDTO appGameRuleDTO = new AppGameRuleDTO();
-//                BeanUtils.copyProperties(rule, appGameRuleDTO);
-//                priceRulesDTOList.add(appGameRuleDTO);
-//            });
-//            List<AppGameScheduleDTO> scheduleDTOS = new ArrayList<>();
-//            scheduleMapper.selectList(Wrappers.<AppGameSchedule>lambdaQuery().eq(AppGameSchedule::getGameId, record.getId())).forEach(schedule-> {
-//                AppGameScheduleDTO appGameScheduleDTO = new AppGameScheduleDTO();
-//                BeanUtils.copyProperties(schedule, appGameScheduleDTO);
-//                scheduleDTOS.add(appGameScheduleDTO);
-//            });
-//            return new AppGameDTO(cuDTO, priceRulesDTOList, scheduleDTOS);
-//        });
+        IPage<AppGameDTO> pageGame = appGameMapper.findPage(page, dto);
+        if (pageGame!=null&&!pageGame.getRecords().isEmpty()){
+            for (AppGameDTO record : pageGame.getRecords()) {
+                List<AppGameRuleDTO> priceRulesDTOList =  rulesMapper.findByGameId(record.getId());
+                record.setGamePriceRules(priceRulesDTOList);
+            }
+        }
+        return  pageGame;
     }
 
-    @Override
-    public void redisSave(String id) {
-        redisTemplate.opsForSet().add(feignDelete, id);
-        redisTemplate.expire(feignDelete, 600, TimeUnit.SECONDS);
-    }
 
     /**
      * 校验权限

+ 12 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.system.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import io.swagger.v3.oas.annotations.Operation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
@@ -692,5 +693,16 @@ public class SysDepartController {
 		LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 		return sysDepartService.findByDeptList(loginUser.getOrgCode());
 	}
+
+	/**
+	 * 查询当前用户所拥有的部门信息数状结构
+	 * @return
+	 */
+	@Operation(summary="查询当前用户所拥有的部门信息数状结构")
+	@GetMapping("findByDepTree")
+	public Result<List<SysDepartTreeModel>> findByDepTree() {
+		LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+		return sysDepartService.findByDepTree(loginUser.getOrgCode());
+	}
 	
 }

+ 2 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java

@@ -255,4 +255,6 @@ public interface ISysDepartService extends IService<SysDepart>{
     Result<String> resetPassword(String id);
 
     Result<List<SysDepart>> findByDeptList(String orgCode);
+
+    Result<List<SysDepartTreeModel>> findByDepTree(String orgCode);
 }

+ 13 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java

@@ -1653,6 +1653,19 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
 		return Result.ok(departMapper.findByDeptList(orgCode));
 	}
 
+    @Override
+    public Result<List<SysDepartTreeModel>> findByDepTree(String orgCode) {
+        List<SysDepart> byDeptList = departMapper.findByDeptList(orgCode);
+        for (SysDepart sysDepart : byDeptList) {
+            if (sysDepart.getOrgCode().equals(orgCode)) {
+                sysDepart.setParentId(null);
+            }
+        }
+        // 调用wrapTreeDataToTreeList方法生成树状数据
+        List<SysDepartTreeModel> listResult = FindsDepartsChildrenUtil.wrapTreeDataToTreeList(byDeptList);
+        return  Result.ok(listResult);
+    }
+
     /**
      * 寻找部门路径
      *