From c743f4413a00fc063bbbd9d851b6d0c3fff10581 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 31 七月 2023 10:04:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java |   67 +++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 1 deletions(-)

diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java
index 8d7026f..61958cd 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java
@@ -4,13 +4,17 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dsh.course.feignClient.competition.CompetitionClient;
 import com.dsh.course.feignClient.competition.model.Competition;
+import com.dsh.course.feignClient.competition.model.GetPeopleQuery;
 import com.dsh.course.feignClient.competition.model.ListQuery;
+import com.dsh.course.feignClient.competition.model.Participant;
 import com.dsh.guns.core.base.controller.BaseController;
 import com.dsh.guns.core.base.tips.SuccessTip;
 import com.dsh.guns.core.common.constant.factory.PageFactory;
 import com.dsh.guns.core.support.HttpKit;
 import com.dsh.guns.core.util.ToolUtil;
+import com.dsh.guns.modular.system.model.TCity;
 import com.dsh.guns.modular.system.model.TStore;
+import com.dsh.guns.modular.system.service.ICityService;
 import com.dsh.guns.modular.system.service.IStoreService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -38,6 +42,9 @@
 
     @Autowired
     private IStoreService storeService;
+
+    @Autowired
+    private ICityService cityService;
 
 
     /**
@@ -94,9 +101,67 @@
                 }
             }
         }
-
         return  super.packForBT(competitions);
     }
 
 
+    @RequestMapping(value = "/add")
+    public Object list(Competition competition) {
+        try {
+            competitionClient.add(competition);
+            return SUCCESS_TIP;
+        }catch (Exception e){
+            e.printStackTrace();
+            return ERROR;
+        }
+    }
+
+    @RequestMapping(value = "/update")
+    public Object update(Competition competition) {
+        try {
+            competitionClient.update(competition);
+            return SUCCESS_TIP;
+        }catch (Exception e){
+            e.printStackTrace();
+            return ERROR;
+        }
+    }
+
+
+    @RequestMapping(value = "/cancel")
+    public Object cancel(Integer id) {
+        try {
+            competitionClient.cancel(id);
+            return SUCCESS_TIP;
+        }catch (Exception e){
+            e.printStackTrace();
+            return ERROR;
+        }
+    }
+
+    @RequestMapping(value = "/getPeopleFromId")
+    public Object getPeopleFromId(Integer id,Integer state) {
+        try {
+            Page<Object> page = new PageFactory<>().defaultPage();
+            Page<Participant> data =   competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state));
+            return  super.packForBT(data);
+        }catch (Exception e){
+            e.printStackTrace();
+            return ERROR;
+        }
+    }
+
+    @RequestMapping(value = "/onChange")
+    @ResponseBody
+    public Object onChange(Integer oneId) {
+        try {
+            TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId));
+            return cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId()));
+        }catch (Exception e){
+            e.printStackTrace();
+            return ERROR;
+        }
+    }
+
+
 }

--
Gitblit v1.7.1