Memory_LG 5 ヶ月 前
コミット
7af3c502bb

+ 36 - 5
qmjszx-admin/src/main/java/beilv/web/controller/competition/CompetitionController.java

@@ -1,18 +1,18 @@
 package beilv.web.controller.competition;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 import beilv.competition.domain.Competition;
 import beilv.competition.service.ICompetitionService;
+import beilv.stadium.domain.Stadium;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import beilv.common.annotation.Log;
 import beilv.common.enums.BusinessType;
 import beilv.common.core.controller.BaseController;
@@ -141,4 +141,35 @@ public class CompetitionController extends BaseController {
     public AjaxResult getCompetitionList(){
         return AjaxResult.success(competitionService.getCompetitionList());
     }
+
+    @RequiresPermissions("system:competition:view")
+    @GetMapping("/openDetails/{id}")
+    public String openDetails(@PathVariable("id") Integer id, ModelMap mmap) {
+        mmap.put("id", id);
+        return prefix + "/details";
+    }
+
+    /**
+     * 修改赛事发布
+     */
+    @PostMapping("/getTakePartList")
+    @ResponseBody
+    public TableDataInfo getTakePartList(Competition competition) {
+
+        startPage();
+        //通过id获取参赛集合
+        List<Stadium> stadiumList = competitionService.getTakePartList(competition.getId());
+        return getDataTable(stadiumList);
+        /*List<Stadium> takePartList = stadiumList.stream()
+                .filter(stadium -> Objects.equals(stadium.getOrderType(), "1"))
+                .collect(Collectors.toList());
+
+        List<Stadium> watchList = stadiumList.stream()
+                .filter(stadium -> Objects.equals(stadium.getOrderType(), "2"))
+                .collect(Collectors.toList());
+
+        mmap.put("takePartList", takePartList);
+        mmap.put("watchList", watchList);
+        return prefix + "/detail";*/
+    }
 }

+ 16 - 0
qmjszx-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -1214,6 +1214,22 @@ var table = {
                     $.modal.openFull("修改" + table.options.modalName, $.operate.editUrl(id));
                 }
             },
+            detailToSet: function(id){
+                table.set();
+                if ($.common.isEmpty(id) && table.options.type == table_type.bootstrapTreeTable) {
+                    var row = $("#" + table.options.id).bootstrapTreeTable('getSelections')[0];
+                    if ($.common.isEmpty(row)) {
+                        $.modal.alertWarning("请至少选择一条记录");
+                        return;
+                    }
+                    var url = table.options.updateUrl.replace("{id}", row[table.options.uniqueId]);
+                    // alert(url)
+                    $.modal.openFull("修改" + table.options.modalName, url);
+                } else {
+                    alert($.operate.editUrl(id))
+                    $.modal.openFull("修改" + table.options.modalName, $.operate.editUrl(id));
+                }
+            },
             publish: function(id, dataName){
                 table.set();
                 $.modal.confirm("确定发布该条" + dataName + "信息吗?<br/>发布后赛事信息无法修改!", function() {

+ 6 - 2
qmjszx-admin/src/main/resources/templates/competition/competition.html

@@ -142,7 +142,8 @@
                         } else if(row.competitionState === 'competiton_state_4'){
 
                         }else {
-                            actions.push('<a class="btn btn-success btn-xs ' + publisFlag + '" href="javascript:void(0)" onclick="closeCompetition(\'' + row.id + '\')"><i class="fa fa-close"></i>关闭</a> ')
+                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="getTakePartList(\'' + row.id + '\')"><i class="fa fa-edit"></i>参赛名单</a> ')
+                            // actions.push('<a class="btn btn-success btn-xs ' + publisFlag + '" href="javascript:void(0)" onclick="closeCompetition(\'' + row.id + '\')"><i class="fa fa-close"></i>关闭</a> ')
                         }
 
                         return actions.join('');
@@ -153,7 +154,6 @@
     });
 
     function closeCompetition(id){
-        alert(id);
         $.ajax({
             url: prefix + "/close",
             type: "GET",
@@ -167,6 +167,10 @@
         })
     }
 
+    function getTakePartList(id){
+        $.modal.open("参赛人员名单", prefix+"/openDetails/"+id);
+    }
+
 </script>
 </body>
 </html>

+ 80 - 0
qmjszx-admin/src/main/resources/templates/competition/details.html

@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('赛事发布列表')"/>
+</head>
+<body class="gray-bg">
+<div class="container-div">
+    <input type="hidden" name="id" th:value="${id}"/>
+    <div class="row">
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
+        </div>
+    </div>
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var paymentStatus = [[${@dict.getType('payment_status')}]];
+    var prefix = ctx + "competition";
+
+    $(function () {
+        var id = $("input[name='id']").val();
+        var options = {
+            id: id,
+            url: prefix + "/getTakePartList",
+            modalName: "赛事",
+            columns: [{
+                field: 'id',
+                title: 'id',
+                visible: false
+            }, {
+                field: 'contactPerple',
+                title: '联系人'
+            }, {
+                field: 'contactNumber',
+                title: '联系电话'
+            }, {
+                field: 'registrationTime',
+                title: '下单时间'
+            }, {
+                field: 'cancellationTime',
+                title: '取消时间'
+            }, {
+                field: 'paymentTime',
+                title: '支付时间'
+            }, {
+                field: 'refundTime',
+                title: '退款时间',
+            }, {
+                field: 'paymentStatus',
+                title: '支付状态',
+                formatter: function (value, row, index) {
+                    return $.table.selectDictLabel(paymentStatus, value);
+                }
+            },
+            /*{
+                title: '操作',
+                align: 'center',
+                formatter: function (value, row, index) {
+                    var actions = [];
+                    if (row.competitionState === 'competiton_state_1') {
+                        actions.push('<a class="btn btn-success btn-xs ' + publisFlag + '" href="javascript:void(0)" onclick="$.operate.publish(\'' + row.id + '\', \'' + row.competitionTitle + '\')"><i class="fa fa-edit"></i>发布</a> ')
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editToSet(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
+                    } else if (row.competitionState === 'competiton_state_4') {
+
+                    } else {
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="getTakePartList(\'' + row.id + '\')"><i class="fa fa-edit"></i>参赛名单</a> ')
+                        // actions.push('<a class="btn btn-success btn-xs ' + publisFlag + '" href="javascript:void(0)" onclick="closeCompetition(\'' + row.id + '\')"><i class="fa fa-close"></i>关闭</a> ')
+                    }
+                    return actions.join('');
+                }
+            }*/
+            ]
+        };
+        $.table.init(options);
+    });
+
+</script>
+</body>
+</html>

+ 2 - 0
qmjszx-business/src/main/java/beilv/competition/mapper/CompetitionMapper.java

@@ -1,6 +1,7 @@
 package beilv.competition.mapper;
 
 import beilv.competition.domain.Competition;
+import beilv.stadium.domain.Stadium;
 
 import java.util.List;
 
@@ -62,4 +63,5 @@ public interface CompetitionMapper {
     int publishCompetition(Competition competition);
 
     List<Competition> getCompetitionList();
+
 }

+ 3 - 0
qmjszx-business/src/main/java/beilv/competition/service/ICompetitionService.java

@@ -1,6 +1,7 @@
 package beilv.competition.service;
 
 import beilv.competition.domain.Competition;
+import beilv.stadium.domain.Stadium;
 
 import java.util.List;
 
@@ -65,4 +66,6 @@ public interface ICompetitionService {
     int closeCompetitionById(String id);
 
     List<Competition> getCompetitionList();
+
+    List<Stadium> getTakePartList(Integer id);
 }

+ 10 - 0
qmjszx-business/src/main/java/beilv/competition/service/impl/CompetitionServiceImpl.java

@@ -5,6 +5,8 @@ import beilv.common.utils.ShiroUtils;
 import beilv.competition.domain.Competition;
 import beilv.competition.mapper.CompetitionMapper;
 import beilv.competition.service.ICompetitionService;
+import beilv.stadium.domain.Stadium;
+import beilv.stadium.mapper.StadiumMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -22,6 +24,9 @@ public class CompetitionServiceImpl implements ICompetitionService {
     @Autowired
     private CompetitionMapper competitionMapper;
 
+    @Autowired
+    private StadiumMapper stadiumMapper;
+
     private final static String DAI_FA_BU = "competiton_state_1";
     private final static String BAO_MING_ZHONG = "competiton_state_2";
     private final static String BAO_MING_JIE_SHU = "competiton_state_3";
@@ -124,4 +129,9 @@ public class CompetitionServiceImpl implements ICompetitionService {
     public List<Competition> getCompetitionList() {
         return competitionMapper.getCompetitionList();
     }
+
+    @Override
+    public List<Stadium> getTakePartList(Integer id) {
+        return stadiumMapper.getTakePartList(id);
+    }
 }

+ 3 - 0
qmjszx-business/src/main/java/beilv/stadium/mapper/StadiumMapper.java

@@ -2,6 +2,7 @@ package beilv.stadium.mapper;
 
 import beilv.stadium.domain.Stadium;
 import beilv.stadium.domain.StadiumBO;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -16,4 +17,6 @@ public interface StadiumMapper {
     List<Stadium> getStadimList(StadiumBO stadiumBO);
 
     boolean paymentVerification(Stadium stadium);
+
+    List<Stadium> getTakePartList(@Param("competitionId")Integer id);
 }

+ 6 - 0
qmjszx-business/src/main/resources/mapper/stadium/StadiumMapper.xml

@@ -90,4 +90,10 @@
                 (SELECT COUNT(id) AS isPay FROM beilv_book_a_race WHERE competition_id = #{competitionId} AND (payment_status = 'payment_status_have_paid' OR payment_status = 'payment_status_to_be_paid	')  and order_type = '1') b;
     </select>
 
+    <select id="getTakePartList" parameterType="integer" resultMap="StadiumResult">
+        select * from beilv_book_a_race
+        where competition_id = #{competitionId}
+        order by registration_time desc
+    </select>
+
 </mapper>