suochencheng 7 سال پیش
والد
کامیت
15f75ece48

+ 5 - 0
src/main/java/com/izouma/awesomeadmin/constant/AppConstant.java

@@ -437,6 +437,11 @@ public interface AppConstant {
          */
         Integer RECEIVE = 2;
 
+        /**
+         * 赛季奖金
+         */
+        Integer SEASON_BONUS = 3;
+
     }
 
     /**

+ 48 - 0
src/main/java/com/izouma/awesomeadmin/dao/CompetitionSeasonMapper.xml

@@ -17,6 +17,10 @@
         <result column="rank" property="rank" jdbcType="INTEGER"/>
         <result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
         <result column="game_id" property="gameId" jdbcType="INTEGER"/>
+        <result column="first_ratio" property="firstRatio" jdbcType="DECIMAL" />
+        <result column="second_ratio" property="secondRatio" jdbcType="DECIMAL" />
+        <result column="third_ratio" property="thirdRatio" jdbcType="DECIMAL" />
+        <result column="bonus_paid" property="bonusPaid" jdbcType="DECIMAL" />
     </resultMap>
     <sql id="Base_Column_List">
         <trim suffixOverrides=",">
@@ -50,6 +54,14 @@
 
             game_id,
 
+            first_ratio,
+
+            second_ratio,
+
+            third_ratio,
+
+            bonus_paid,
+
         </trim>
     </sql>
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
@@ -111,6 +123,18 @@
             <if test="gameId!= null">
                 game_id,
             </if>
+            <if test="firstRatio!= null" >
+                first_ratio,
+            </if>
+            <if test="secondRatio!= null" >
+                second_ratio,
+            </if>
+            <if test="thirdRatio!= null" >
+                third_ratio,
+            </if>
+            <if test="bonusPaid!= null" >
+                bonus_paid,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">
@@ -158,6 +182,18 @@
             <if test="gameId != null">
                 #{gameId,jdbcType=INTEGER},
             </if>
+            <if test="firstRatio != null" >
+                #{firstRatio,jdbcType=DECIMAL},
+            </if>
+            <if test="secondRatio != null" >
+                #{secondRatio,jdbcType=DECIMAL},
+            </if>
+            <if test="thirdRatio != null" >
+                #{thirdRatio,jdbcType=DECIMAL},
+            </if>
+            <if test="bonusPaid != null" >
+                #{bonusPaid,jdbcType=DECIMAL},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.CompetitionSeason">
@@ -208,6 +244,18 @@
             <if test="gameId != null">
                 game_id= #{gameId,jdbcType=INTEGER},
             </if>
+            <if test="firstRatio != null" >
+                first_ratio= #{firstRatio,jdbcType=DECIMAL},
+            </if>
+            <if test="secondRatio != null" >
+                second_ratio= #{secondRatio,jdbcType=DECIMAL},
+            </if>
+            <if test="thirdRatio != null" >
+                third_ratio= #{thirdRatio,jdbcType=DECIMAL},
+            </if>
+            <if test="bonusPaid != null" >
+                bonus_paid= #{bonusPaid,jdbcType=DECIMAL},
+            </if>
         </set>
         where
         <if test="id != null and !&quot;&quot;.equals(id)">

+ 13 - 0
src/main/java/com/izouma/awesomeadmin/dao/SystemNoticeMapper.xml

@@ -17,6 +17,8 @@
         <result column="content" property="content" jdbcType="VARCHAR"/>
         <result column="season_id" property="seasonId" jdbcType="INTEGER"/>
         <result column="player_id" property="playerId" jdbcType="INTEGER"/>
+        <result column="bonus" property="bonus" jdbcType="DECIMAL"/>
+
     </resultMap>
     <sql id="Base_Column_List">
         <trim suffixOverrides=",">
@@ -50,6 +52,8 @@
 
             player_id,
 
+            bonus,
+
         </trim>
     </sql>
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
@@ -111,6 +115,9 @@
             <if test="playerId!= null">
                 player_id,
             </if>
+            <if test="bonus!= null">
+                bonus,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">
@@ -158,6 +165,9 @@
             <if test="playerId != null">
                 #{playerId,jdbcType=INTEGER},
             </if>
+            <if test="bonus != null">
+                #{bonus},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.SystemNotice">
@@ -208,6 +218,9 @@
             <if test="playerId != null">
                 player_id= #{playerId,jdbcType=INTEGER},
             </if>
+            <if test="bonus != null">
+                bonus= #{bonus},
+            </if>
         </set>
         where
         <if test="id != null and !&quot;&quot;.equals(id)">

+ 41 - 0
src/main/java/com/izouma/awesomeadmin/model/CompetitionSeason.java

@@ -33,6 +33,15 @@ public class CompetitionSeason {
 
     private GameInfo gameInfo;
 
+
+    private BigDecimal firstRatio;
+    private BigDecimal secondRatio;
+    private BigDecimal thirdRatio;
+    /**
+     * 已发放奖金
+     */
+    private BigDecimal bonusPaid;
+
     /**
      * and,test_name,like,value;or,remark,=,123
      */
@@ -202,5 +211,37 @@ public class CompetitionSeason {
     public void setGameInfo(GameInfo gameInfo) {
         this.gameInfo = gameInfo;
     }
+
+    public BigDecimal getFirstRatio() {
+        return firstRatio;
+    }
+
+    public void setFirstRatio(BigDecimal firstRatio) {
+        this.firstRatio = firstRatio;
+    }
+
+    public BigDecimal getSecondRatio() {
+        return secondRatio;
+    }
+
+    public void setSecondRatio(BigDecimal secondRatio) {
+        this.secondRatio = secondRatio;
+    }
+
+    public BigDecimal getThirdRatio() {
+        return thirdRatio;
+    }
+
+    public void setThirdRatio(BigDecimal thirdRatio) {
+        this.thirdRatio = thirdRatio;
+    }
+
+    public BigDecimal getBonusPaid() {
+        return bonusPaid;
+    }
+
+    public void setBonusPaid(BigDecimal bonusPaid) {
+        this.bonusPaid = bonusPaid;
+    }
 }
 

+ 11 - 0
src/main/java/com/izouma/awesomeadmin/model/SystemNotice.java

@@ -1,5 +1,6 @@
 package com.izouma.awesomeadmin.model;
 
+import java.math.BigDecimal;
 import java.util.*;
 
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
@@ -48,6 +49,8 @@ public class SystemNotice {
      */
     private String orderByStr;
 
+    private BigDecimal bonus;
+
     public Integer getId() {
         return this.id;
     }
@@ -231,5 +234,13 @@ public class SystemNotice {
     public void setPlayerInfo(PlayerInfo playerInfo) {
         this.playerInfo = playerInfo;
     }
+
+    public BigDecimal getBonus() {
+        return bonus;
+    }
+
+    public void setBonus(BigDecimal bonus) {
+        this.bonus = bonus;
+    }
 }
 

+ 3 - 0
src/main/java/com/izouma/awesomeadmin/service/CompetitionSeasonService.java

@@ -2,6 +2,7 @@ package com.izouma.awesomeadmin.service;
 
 import java.util.*;
 import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
 import com.izouma.awesomeadmin.model.CompetitionSeason;
 
 
@@ -23,5 +24,7 @@ public interface CompetitionSeasonService{
     boolean deleteCompetitionSeason(CompetitionSeason record);
 
     boolean updateCompetitionSeason(CompetitionSeason record);
+
+    Result bonusPayment(CompetitionSeason record);
 }
 

+ 3 - 0
src/main/java/com/izouma/awesomeadmin/service/SystemNoticeService.java

@@ -2,6 +2,7 @@ package com.izouma.awesomeadmin.service;
 
 import java.util.*;
 import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
 import com.izouma.awesomeadmin.model.SystemNotice;
 
 
@@ -25,5 +26,7 @@ public interface SystemNoticeService{
     boolean updateSystemNotice(SystemNotice record);
 
     int getUnreadSystemNotice(SystemNotice record);
+
+    Result receiveBonus(SystemNotice record);
 }
 

+ 154 - 19
src/main/java/com/izouma/awesomeadmin/service/impl/CompetitionSeasonServiceImpl.java

@@ -1,52 +1,70 @@
 package com.izouma.awesomeadmin.service.impl;
 
+import java.math.BigDecimal;
 import java.util.*;
+
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.*;
+import com.izouma.awesomeadmin.service.BonusRecordService;
+import com.izouma.awesomeadmin.service.PlayerInfoService;
+import com.izouma.awesomeadmin.service.SystemNoticeService;
+import com.izouma.awesomeadmin.util.DateTimeTool;
+import com.izouma.awesomeadmin.util.PushUtil;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.izouma.awesomeadmin.constant.AppConstant;
 import com.izouma.awesomeadmin.dto.Page;
-import com.izouma.awesomeadmin.model.CompetitionSeason;
 import com.izouma.awesomeadmin.service.CompetitionSeasonService;
 import com.izouma.awesomeadmin.dao.CompetitionSeasonMapper;
 
 /**
-*  service接口实现类
-*/
+ * service接口实现类
+ */
 @Service
-public class CompetitionSeasonServiceImpl implements CompetitionSeasonService{
+public class CompetitionSeasonServiceImpl implements CompetitionSeasonService {
 
     private static Logger logger = Logger.getLogger(CompetitionSeasonServiceImpl.class);
 
     @Autowired
     private CompetitionSeasonMapper competitionSeasonMapper;
 
+    @Autowired
+    private PlayerInfoService playerInfoService;
+
+    @Autowired
+    private SystemNoticeService systemNoticeService;
+    @Autowired
+    private BonusRecordService bonusRecordService;
+
     @Override
     public List<CompetitionSeason> getCompetitionSeasonList(CompetitionSeason record) {
 
         logger.info("getCompetitionSeasonList");
         try {
 
-        return competitionSeasonMapper.queryAllCompetitionSeason(record);
+            return competitionSeasonMapper.queryAllCompetitionSeason(record);
         } catch (Exception e) {
-        logger.error("getCompetitionSeasonList", e);
+            logger.error("getCompetitionSeasonList", e);
         }
 
         return null;
     }
+
     @Override
     public List<CompetitionSeason> getCompetitionSeasonByPage(Page page, CompetitionSeason record) {
 
         logger.info("getCompetitionSeasonByPage");
         try {
 
-        Map<String, Object> parameter = new HashMap<String, Object>();
-        parameter.put("record", record);
-        parameter.put(AppConstant.PAGE, page);
+            Map<String, Object> parameter = new HashMap<String, Object>();
+            parameter.put("record", record);
+            parameter.put(AppConstant.PAGE, page);
 
-        return competitionSeasonMapper.queryCompetitionSeasonByPage(parameter);
+            return competitionSeasonMapper.queryCompetitionSeasonByPage(parameter);
         } catch (Exception e) {
-        logger.error("getCompetitionSeasonByPage", e);
+            logger.error("getCompetitionSeasonByPage", e);
         }
 
         return null;
@@ -60,7 +78,7 @@ public class CompetitionSeasonServiceImpl implements CompetitionSeasonService{
 
             return competitionSeasonMapper.selectByPrimaryKey(Integer.valueOf(id));
         } catch (Exception e) {
-        logger.error("getCompetitionSeasonById", e);
+            logger.error("getCompetitionSeasonById", e);
         }
 
         return null;
@@ -74,7 +92,7 @@ public class CompetitionSeasonServiceImpl implements CompetitionSeasonService{
 
             return competitionSeasonMapper.queryCompetitionSeason(record);
         } catch (Exception e) {
-        logger.error("getCompetitionSeason", e);
+            logger.error("getCompetitionSeason", e);
         }
 
         return null;
@@ -89,7 +107,7 @@ public class CompetitionSeasonServiceImpl implements CompetitionSeasonService{
             int updates = competitionSeasonMapper.insertSelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
             logger.error("createCompetitionSeason", e);
@@ -104,13 +122,13 @@ public class CompetitionSeasonServiceImpl implements CompetitionSeasonService{
         logger.info("deleteCompetitionSeason");
         try {
 
-             int updates = competitionSeasonMapper.delete(record);
+            int updates = competitionSeasonMapper.delete(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
-             logger.error("deleteCompetitionSeason", e);
+            logger.error("deleteCompetitionSeason", e);
         }
 
         return false;
@@ -125,13 +143,130 @@ public class CompetitionSeasonServiceImpl implements CompetitionSeasonService{
             int updates = competitionSeasonMapper.updateByPrimaryKeySelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
-             logger.error("updateCompetitionSeason", e);
+            logger.error("updateCompetitionSeason", e);
         }
 
         return false;
     }
+
+
+    @Override
+    public Result bonusPayment(CompetitionSeason record) {
+
+        logger.info("bonusPayment");
+        try {
+
+            CompetitionSeason competitionSeason = competitionSeasonMapper.queryCompetitionSeason(record);
+
+            if (competitionSeason != null) {
+
+                BigDecimal firstRatio = competitionSeason.getFirstRatio();
+                BigDecimal secondRatio = competitionSeason.getSecondRatio();
+                BigDecimal thirdRatio = competitionSeason.getThirdRatio();
+
+                BigDecimal canUseBonus = competitionSeason.getBonus().subtract(competitionSeason.getBonusPaid());
+
+                Page page = new Page();
+                page.setPageNumber(3);
+                page.setCurrentPage(1);
+
+                PlayerInfo param = new PlayerInfo();
+                param.setSeasonId(competitionSeason.getId());
+
+                List<PlayerInfo> pp = playerInfoService.getPlayerInfoSeasonRankPageByPage(page, param);
+
+                if (CollectionUtils.isNotEmpty(pp) && canUseBonus.doubleValue() > 0) {
+
+                    String remark = competitionSeason.getSeason() + "赛季奖金发放,";
+
+                    for (int i = 0; i < pp.size(); i++) {
+
+                        String content = "";
+                        PlayerInfo playerInfo = pp.get(i);
+                        UserInfo userInfo = playerInfo.getUserInfo();
+                        BigDecimal bonus = BigDecimal.ZERO;
+                        if (playerInfo.getRank() == 1) {//第一名
+                            bonus = BigDecimal.valueOf((firstRatio.doubleValue() / 100) * canUseBonus.doubleValue());
+
+
+                        }
+                        if (playerInfo.getRank() == 2) {//第二名
+                            bonus = BigDecimal.valueOf((secondRatio.doubleValue() / 100) * canUseBonus.doubleValue());
+                        }
+                        if (playerInfo.getRank() == 3) {//第三名
+                            bonus = BigDecimal.valueOf((thirdRatio.doubleValue() / 100) * canUseBonus.doubleValue());
+                        }
+
+                        if (bonus.doubleValue() > 0) {
+
+
+                            remark += userInfo.getNickname() + "获得第" + playerInfo.getRank() + ",获得" + bonus + "积分;";
+                            content = "恭喜你,在" + competitionSeason.getSeason()
+                                    + " 取得第" + playerInfo.getRank()
+                                    + "名,获得" + bonus + "积分,赶快领取你的奖励吧。";
+                            SystemNotice systemNotice = new SystemNotice();
+                            systemNotice.setGameId(playerInfo.getGameId());
+                            systemNotice.setUserId(playerInfo.getUserId());
+                            systemNotice.setSeasonId(playerInfo.getSeasonId());
+                            systemNotice.setRemark("赛季奖金发放");
+                            systemNotice.setBonus(bonus);
+
+                            systemNotice.setContent(content);
+                            systemNotice.setTypeFlag(AppConstant.NoticeType.SEASON_BONUS);
+
+                            systemNoticeService.createSystemNotice(systemNotice);
+
+                            //推送
+                            try {
+                                if (userInfo != null) {
+                                    if ("Y".equals(userInfo.getNoticeFlag())) {
+                                        String[] ids = new String[]{userInfo.getId().toString()};
+
+                                        PushUtil.pushMsg(ids, content);
+                                    }
+
+                                }
+
+
+                            } catch (Exception e) {
+                                logger.error("发放赛季奖金推送消息异常。", e);
+                            }
+
+
+                        }
+
+
+                    }
+
+                    BonusRecord bonusRecord = new BonusRecord();
+
+                    bonusRecord.setRemark(remark);
+                    bonusRecord.setSeasonId(competitionSeason.getId());
+                    bonusRecord.setGameId(competitionSeason.getGameId());
+                    bonusRecord.setMoney(canUseBonus.multiply(new BigDecimal(-1)));
+                    bonusRecord.setBonus(BigDecimal.ZERO);
+                    bonusRecord.setTypeFlag(1);
+
+                    bonusRecordService.createBonusRecord(bonusRecord);
+
+                    competitionSeason.setBonusPaid(competitionSeason.getBonus());
+                    competitionSeasonMapper.updateByPrimaryKeySelective(competitionSeason);
+
+
+                }
+
+
+            }
+
+
+        } catch (Exception e) {
+            logger.error("bonusPayment", e);
+        }
+
+        return new Result(false, "发放失败");
+    }
 }
 

+ 108 - 20
src/main/java/com/izouma/awesomeadmin/service/impl/SystemNoticeServiceImpl.java

@@ -1,6 +1,15 @@
 package com.izouma.awesomeadmin.service.impl;
 
+import java.math.BigDecimal;
 import java.util.*;
+
+import com.izouma.awesomeadmin.dao.MemberCoinMapper;
+import com.izouma.awesomeadmin.dao.UserInfoMapper;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.MemberCoin;
+import com.izouma.awesomeadmin.model.PlayerInfo;
+import com.izouma.awesomeadmin.model.UserInfo;
+import com.izouma.awesomeadmin.util.PushUtil;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -11,42 +20,49 @@ import com.izouma.awesomeadmin.service.SystemNoticeService;
 import com.izouma.awesomeadmin.dao.SystemNoticeMapper;
 
 /**
-*  service接口实现类
-*/
+ * service接口实现类
+ */
 @Service
-public class SystemNoticeServiceImpl implements SystemNoticeService{
+public class SystemNoticeServiceImpl implements SystemNoticeService {
 
     private static Logger logger = Logger.getLogger(SystemNoticeServiceImpl.class);
 
     @Autowired
     private SystemNoticeMapper systemNoticeMapper;
 
+    @Autowired
+    private UserInfoMapper userInfoMapper;
+
+    @Autowired
+    private MemberCoinMapper memberCoinMapper;
+
     @Override
     public List<SystemNotice> getSystemNoticeList(SystemNotice record) {
 
         logger.info("getSystemNoticeList");
         try {
 
-        return systemNoticeMapper.queryAllSystemNotice(record);
+            return systemNoticeMapper.queryAllSystemNotice(record);
         } catch (Exception e) {
-        logger.error("getSystemNoticeList", e);
+            logger.error("getSystemNoticeList", e);
         }
 
         return null;
     }
+
     @Override
     public List<SystemNotice> getSystemNoticeByPage(Page page, SystemNotice record) {
 
         logger.info("getSystemNoticeByPage");
         try {
 
-        Map<String, Object> parameter = new HashMap<String, Object>();
-        parameter.put("record", record);
-        parameter.put(AppConstant.PAGE, page);
+            Map<String, Object> parameter = new HashMap<String, Object>();
+            parameter.put("record", record);
+            parameter.put(AppConstant.PAGE, page);
 
-        return systemNoticeMapper.querySystemNoticeByPage(parameter);
+            return systemNoticeMapper.querySystemNoticeByPage(parameter);
         } catch (Exception e) {
-        logger.error("getSystemNoticeByPage", e);
+            logger.error("getSystemNoticeByPage", e);
         }
 
         return null;
@@ -60,7 +76,7 @@ public class SystemNoticeServiceImpl implements SystemNoticeService{
 
             return systemNoticeMapper.selectByPrimaryKey(Integer.valueOf(id));
         } catch (Exception e) {
-        logger.error("getSystemNoticeById", e);
+            logger.error("getSystemNoticeById", e);
         }
 
         return null;
@@ -74,7 +90,7 @@ public class SystemNoticeServiceImpl implements SystemNoticeService{
 
             return systemNoticeMapper.querySystemNotice(record);
         } catch (Exception e) {
-        logger.error("getSystemNotice", e);
+            logger.error("getSystemNotice", e);
         }
 
         return null;
@@ -89,7 +105,7 @@ public class SystemNoticeServiceImpl implements SystemNoticeService{
             int updates = systemNoticeMapper.insertSelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
             logger.error("createSystemNotice", e);
@@ -104,13 +120,13 @@ public class SystemNoticeServiceImpl implements SystemNoticeService{
         logger.info("deleteSystemNotice");
         try {
 
-             int updates = systemNoticeMapper.delete(record);
+            int updates = systemNoticeMapper.delete(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
-             logger.error("deleteSystemNotice", e);
+            logger.error("deleteSystemNotice", e);
         }
 
         return false;
@@ -125,10 +141,10 @@ public class SystemNoticeServiceImpl implements SystemNoticeService{
             int updates = systemNoticeMapper.updateByPrimaryKeySelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
-             logger.error("updateSystemNotice", e);
+            logger.error("updateSystemNotice", e);
         }
 
         return false;
@@ -142,12 +158,84 @@ public class SystemNoticeServiceImpl implements SystemNoticeService{
 
             int unreads = systemNoticeMapper.getUnreadSystemNotice(record);
 
-                 return unreads;
+            return unreads;
         } catch (Exception e) {
-             logger.error("getUnreadSystemNotice", e);
+            logger.error("getUnreadSystemNotice", e);
         }
 
         return 0;
     }
+
+    @Override
+    public Result receiveBonus(SystemNotice record) {
+
+        logger.info("receiveBonus");
+        try {
+            SystemNotice systemNotice = systemNoticeMapper.querySystemNotice(record);
+            if (systemNotice != null) {
+                if (0 != systemNotice.getStatusFlag()) {//未领取
+                    return new Result(false, "邮件处于非领取状态,不能领取!");
+                }
+
+                double money = systemNotice.getBonus().doubleValue();
+                if (money > 0) {
+                    int userId = Integer.valueOf(systemNotice.getUserId());
+
+                    MemberCoin memberCoin = new MemberCoin();
+                    memberCoin.setUserId(userId);
+                    memberCoin.setMoney(BigDecimal.valueOf(money));
+
+                    UserInfo userInfo = userInfoMapper.selectByPrimaryKey(userId);
+
+
+                    double balance = userInfo.getMoneyCoin();
+                    double moneyCoin = balance + money;
+
+                    memberCoin.setGameId(systemNotice.getGameId());
+                    memberCoin.setSeasonId(systemNotice.getSeasonId());
+
+                    memberCoin.setCreateUser("奖金领取");
+                    memberCoin.setBalance(BigDecimal.valueOf(moneyCoin));
+                    memberCoin.setTypeFlag(AppConstant.CoinType.BONUS);
+                    memberCoin.setRemark("获得赛季奖励:" + money + "余额");
+                    memberCoinMapper.insertSelective(memberCoin);
+
+                    UserInfo updateUser = new UserInfo();
+                    updateUser.setId(userId);
+                    updateUser.setMoneyCoin(moneyCoin);
+                    userInfoMapper.updateByPrimaryKeySelective(updateUser);
+
+
+                    //推送
+                    try {
+                        if (userInfo != null) {
+                            if ("Y".equals(userInfo.getNoticeFlag())) {
+                                String[] ids = new String[]{userInfo.getId().toString()};
+
+                                PushUtil.pushMsg(ids, "获得赛季奖励:" + money + "余额");
+                            }
+
+                        }
+
+
+                    } catch (Exception e) {
+                        logger.error("推送消息异常。", e);
+                    }
+
+                }
+
+                systemNotice.setStatusFlag(2);
+                systemNoticeMapper.updateByPrimaryKeySelective(systemNotice);
+
+                return new Result(true, "领取成功");
+            }
+
+
+        } catch (Exception e) {
+            logger.error("receiveBonus", e);
+        }
+
+        return new Result(false, "领取失败");
+    }
 }
 

+ 60 - 46
src/main/java/com/izouma/awesomeadmin/web/CompetitionSeasonController.java

@@ -18,8 +18,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 /**
-*  controller类
-*/
+ * controller类
+ */
 @Controller
 @RequestMapping("/competitionSeason")
 public class CompetitionSeasonController {
@@ -28,8 +28,8 @@ public class CompetitionSeasonController {
     private CompetitionSeasonService competitionSeasonService;
 
     /**
-    * <p>获取全部记录。</p>
-    */
+     * <p>获取全部记录。</p>
+     */
     @RequiresAuthentication
     @RequestMapping(value = "/all", method = RequestMethod.GET)
     @ResponseBody
@@ -39,8 +39,8 @@ public class CompetitionSeasonController {
     }
 
     /**
-    * <p>根据Id。</p>
-    */
+     * <p>根据Id。</p>
+     */
     @RequestMapping(value = "/getCompetitionSeason", method = RequestMethod.GET)
     @ResponseBody
     public Result getCompetitionSeason(@RequestParam(required = false, value = "id") String id) {
@@ -49,8 +49,8 @@ public class CompetitionSeasonController {
     }
 
     /**
-    * <p>根据条件获取。</p>
-    */
+     * <p>根据条件获取。</p>
+     */
     @RequestMapping(value = "/getOne", method = RequestMethod.GET)
     @ResponseBody
     public Result getOne(CompetitionSeason record) {
@@ -60,14 +60,14 @@ public class CompetitionSeasonController {
 
 
     /**
-    * <p>分页查询。</p>
-    */
+     * <p>分页查询。</p>
+     */
     @RequestMapping(value = "/page", method = RequestMethod.GET)
     @ResponseBody
     public Result page(Page page, CompetitionSeason record) {
         Map<String, Object> result = new HashMap<>();
 
-        List<CompetitionSeason> pp =competitionSeasonService.getCompetitionSeasonByPage(page, record);
+        List<CompetitionSeason> pp = competitionSeasonService.getCompetitionSeasonByPage(page, record);
 
         result.put(AppConstant.PAGE, page);
         result.put("pp", pp);
@@ -76,90 +76,104 @@ public class CompetitionSeasonController {
 
 
     /**
-    * <p>保存。</p>
-    */
+     * <p>保存。</p>
+     */
     @RequestMapping(value = "/save", method = RequestMethod.POST)
     @ResponseBody
     public Result save(CompetitionSeason record) {
         boolean num = competitionSeasonService.createCompetitionSeason(record);
         if (num) {
-        return new Result(true, record.getId());
+            return new Result(true, record.getId());
         }
         return new Result(false, "保存异常");
     }
 
     /**
-    * <p>更新信息。</p>
-    */
+     * <p>更新信息。</p>
+     */
     @RequestMapping(value = "/update", method = RequestMethod.POST)
     @ResponseBody
     public Result updateCompetitionSeason(CompetitionSeason record) {
         boolean num = competitionSeasonService.updateCompetitionSeason(record);
         if (num) {
-        return new Result(true, "保存成功");
+            return new Result(true, "保存成功");
         }
         return new Result(false, "保存异常");
     }
 
     /**
-    * <p>删除。</p>
-    */
+     * <p>删除。</p>
+     */
     @RequestMapping(value = "/del", method = RequestMethod.POST)
     @ResponseBody
     public Result deleteCompetitionSeason(CompetitionSeason record) {
 
         boolean num = competitionSeasonService.deleteCompetitionSeason(record);
         if (num) {
-        return new Result(true, "删除成功");
+            return new Result(true, "删除成功");
         }
         return new Result(false, "删除异常");
     }
 
     /**
-    * 导出Excel
-    * @param request
-    * @param response
-    * @param record
-    * @throws Exception
-    */
+     * 发放奖金
+     *
+     * @param record
+     * @return
+     */
+    @RequestMapping(value = "/bonusPayment", method = RequestMethod.POST)
+    @ResponseBody
+    public Result bonusPayment(CompetitionSeason record) {
+
+        return competitionSeasonService.bonusPayment(record);
+    }
+
+    /**
+     * 导出Excel
+     *
+     * @param request
+     * @param response
+     * @param record
+     * @throws Exception
+     */
     @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
     @ResponseBody
     public void exportExcel(HttpServletRequest request, HttpServletResponse response, CompetitionSeason record) throws Exception {
 
-    List<CompetitionSeason> competitionSeasons = competitionSeasonService.getCompetitionSeasonList(record);
+        List<CompetitionSeason> competitionSeasons = competitionSeasonService.getCompetitionSeasonList(record);
 
 
         String sheetName = "competition_season";
         String titleName = "赛季数据表";
         String fileName = "赛季表";
         int columnNumber = 14;
-        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
-        String[] columnName = {  "" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "名称" ,   "简称" ,   "开始时间" ,   "结束时间" ,   "奖金数" ,   "备注" ,   "排序" ,   "状态"  };
+        int[] columnWidth = {20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20};
+        String[] columnName = {"", "删除标识", "更新时间", "更新人", "创建时间", "创建人", "名称", "简称", "开始时间", "结束时间", "奖金数", "备注", "排序", "状态"};
         String[][] dataList = new String[competitionSeasons.size()][14];
 
         for (int i = 0; i < competitionSeasons.size(); i++) {
 
-                        dataList[i][0] = String.valueOf(competitionSeasons.get(i).getId());
-                        dataList[i][1] = String.valueOf(competitionSeasons.get(i).getDelFlag());
-                        dataList[i][2] = String.valueOf(competitionSeasons.get(i).getUpdateTime());
-                        dataList[i][3] = String.valueOf(competitionSeasons.get(i).getUpdateUser());
-                        dataList[i][4] = String.valueOf(competitionSeasons.get(i).getCreateTime());
-                        dataList[i][5] = String.valueOf(competitionSeasons.get(i).getCreateUser());
-                        dataList[i][6] = String.valueOf(competitionSeasons.get(i).getSeason());
-                        dataList[i][7] = String.valueOf(competitionSeasons.get(i).getShortName());
-                        dataList[i][8] = String.valueOf(competitionSeasons.get(i).getBeginTime());
-                        dataList[i][9] = String.valueOf(competitionSeasons.get(i).getEndTime());
-                        dataList[i][10] = String.valueOf(competitionSeasons.get(i).getBonus());
-                        dataList[i][11] = String.valueOf(competitionSeasons.get(i).getRemark());
-                        dataList[i][12] = String.valueOf(competitionSeasons.get(i).getRank());
-                        dataList[i][13] = String.valueOf(competitionSeasons.get(i).getStatusFlag());
-                    }
+            dataList[i][0] = String.valueOf(competitionSeasons.get(i).getId());
+            dataList[i][1] = String.valueOf(competitionSeasons.get(i).getDelFlag());
+            dataList[i][2] = String.valueOf(competitionSeasons.get(i).getUpdateTime());
+            dataList[i][3] = String.valueOf(competitionSeasons.get(i).getUpdateUser());
+            dataList[i][4] = String.valueOf(competitionSeasons.get(i).getCreateTime());
+            dataList[i][5] = String.valueOf(competitionSeasons.get(i).getCreateUser());
+            dataList[i][6] = String.valueOf(competitionSeasons.get(i).getSeason());
+            dataList[i][7] = String.valueOf(competitionSeasons.get(i).getShortName());
+            dataList[i][8] = String.valueOf(competitionSeasons.get(i).getBeginTime());
+            dataList[i][9] = String.valueOf(competitionSeasons.get(i).getEndTime());
+            dataList[i][10] = String.valueOf(competitionSeasons.get(i).getBonus());
+            dataList[i][11] = String.valueOf(competitionSeasons.get(i).getRemark());
+            dataList[i][12] = String.valueOf(competitionSeasons.get(i).getRank());
+            dataList[i][13] = String.valueOf(competitionSeasons.get(i).getStatusFlag());
+        }
 
 
         ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
-        columnNumber, columnWidth, columnName, dataList, response);
+                columnNumber, columnWidth, columnName, dataList, response);
 
 
-        }
     }
+}
 

+ 11 - 0
src/main/java/com/izouma/awesomeadmin/web/SystemNoticeController.java

@@ -130,6 +130,17 @@ public class SystemNoticeController {
     }
 
 
+    /**
+     * <p>领取奖励。</p>
+     */
+    @RequestMapping(value = "/receive", method = RequestMethod.POST)
+    @ResponseBody
+    public Result receiveBonus(SystemNotice record) {
+
+        return systemNoticeService.receiveBonus(record);
+
+    }
+
     /**
      * 导出Excel
      *

+ 18 - 6
src/main/vue/src/pages/CompetitionSeason.vue

@@ -34,7 +34,7 @@
                     </div>
                 </template>
             </el-form-item>
-                                                                                                                                                                                                                                                                                                        <el-form-item prop="bonus" label="奖数">
+                                                                                                                                                                                                                                                                                                        <el-form-item prop="bonus" label="奖数">
                 <el-input type="number" v-model="formData.bonus" :disabled="'bonus'==subColumn"></el-input>
             </el-form-item>
                                                                                                                                                                                                                                                                                     <el-form-item prop="remark" label="备注">
@@ -67,7 +67,19 @@
                     </el-select>
                 </template>
             </el-form-item>
-                                                                                                                                                                                    <el-form-item>
+                                                                                                                                                                                                                                                                <el-form-item prop="firstRatio" label="第一比率">
+                <el-input type="number" v-model="formData.firstRatio" :disabled="'firstRatio'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="secondRatio" label="第二比率">
+                <el-input type="number" v-model="formData.secondRatio" :disabled="'secondRatio'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="thirdRatio" label="第三比率">
+                <el-input type="number" v-model="formData.thirdRatio" :disabled="'thirdRatio'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="bonusPaid" label="已发奖励">
+                <el-input type="number" v-model="formData.bonusPaid" :disabled="'bonusPaid'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
                 <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
                 <el-button @click="$router.go(-1)">取消</el-button>
@@ -94,7 +106,7 @@
                 }).then(res => {
                     if (res.success) {
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                         this.formData = res.data;
 
                     if (this.$route.query.column) {
@@ -123,13 +135,13 @@
                         }
                         }
                         });
-                                                        },
+                                                                                                                                                                        },
         data() {
             return {
                 saving: false,
                 formData: {},
                 rules: {
-                                                                                                                                                                                                                                                                                                                                                                                                                                                        },
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        },
                                                                                                                                 statusFlagOptions:[{
           value: 0,
           label: '准备'
@@ -144,7 +156,7 @@
           label: '结束'
         }],
                                             gameIdOptions:[],
-                                subColumn: '',
+                                                                subColumn: '',
             subValue: '',
         }
         },

+ 353 - 396
src/main/vue/src/pages/CompetitionSeasons.vue

@@ -1,25 +1,22 @@
 <template>
     <div>
         <div class="filters-container">
-        
+
             <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
             <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
             </el-button>
-            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small"
-                       icon="el-icon-search" class="filter-item">高级查询
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
             </el-button>
-            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small"
-                       icon="el-icon-sort" class="filter-item">排序
+            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small" icon="el-icon-sort" class="filter-item">排序
             </el-button>
-            <el-button @click="$router.push({path:'/competitionSeason',query:{column:$route.query.column}})" type="primary"
-                       size="small" icon="el-icon-edit"
-                       class="filter-item">添加
+            <el-button @click="$router.push({path:'/competitionSeason',query:{column:$route.query.column}})" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
             </el-button>
             <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
             </el-button>
             <el-dropdown trigger="click" size="medium" class="table-column-filter">
                 <span>
-                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
+                    筛选数据
+                    <i class="el-icon-arrow-down el-icon--right"></i>
                 </span>
                 <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
                     <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
@@ -27,103 +24,49 @@
                 </el-dropdown-menu>
             </el-dropdown>
         </div>
-        <el-table
-                :data="tableData"
-                :height="tableHeight"
-                row-key="id"
-                ref="table">
-            <el-table-column
-                    v-if="multipleMode"
-                    align="center"
-                    type="selection"
-                    width="50">
+        <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table">
+            <el-table-column v-if="multipleMode" align="center" type="selection" width="50">
+            </el-table-column>
+            <el-table-column type="index" min-width="50" align="center">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('id')" prop="id" label="" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('season')" prop="season" label="名称" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('shortName')" prop="shortName" label="简称" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('beginTime')" prop="beginTime" label="开始时间" :formatter="DateFormatter" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('endTime')" prop="endTime" label="结束时间" :formatter="DateFormatter" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('bonus')" prop="bonus" label="奖励数" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('remark')" prop="remark" label="备注" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('rank')" prop="rank" label="排序" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('statusFlag')" prop="statusFlag" label="状态" min-width="100">
+            </el-table-column>
+
+            <el-table-column v-if="isColumnShow('gameId')" prop="gameId" label="游戏" min-width="100">
             </el-table-column>
-            <el-table-column
-                    type="index"
-                    min-width="50"
-                    align="center">
+
+            <el-table-column v-if="isColumnShow('bonusPaid')" prop="bonusPaid" label="已发奖励" min-width="100">
             </el-table-column>
-                            
-                                            <el-table-column
-                                v-if="isColumnShow('id')"
-                                prop="id"
-                                label=""
-                                min-width="100">
-                        </el-table-column>
-                                                                                                                                                                                                            
-                                            <el-table-column
-                                v-if="isColumnShow('season')"
-                                prop="season"
-                                label="名称"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('shortName')"
-                                prop="shortName"
-                                label="简称"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('beginTime')"
-                                prop="beginTime"
-                                label="开始时间"
-                                :formatter="DateFormatter"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('endTime')"
-                                prop="endTime"
-                                label="结束时间"
-                                :formatter="DateFormatter"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('bonus')"
-                                prop="bonus"
-                                label="奖金数"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('remark')"
-                                prop="remark"
-                                label="备注"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('rank')"
-                                prop="rank"
-                                label="排序"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('statusFlag')"
-                                prop="statusFlag"
-                                label="状态"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('gameId')"
-                                prop="gameId"
-                                label="游戏"
-                                min-width="100">
-                        </el-table-column>
-                                                            <el-table-column
-                    label="操作"
-                    align="center"
-                    fixed="right"
-                    min-width="150"
-            >
+            <el-table-column label="操作" align="center" fixed="right" min-width="200">
                 <template slot-scope="scope">
-                            <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
-                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
+                    <el-button @click="bonusPayment(scope.row)" type="primary" size="mini" plain>发放奖励</el-button>
+                    <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <!-- <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button> -->
                 </template>
             </el-table-column>
         </el-table>
@@ -136,15 +79,7 @@
                     <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
                 </el-button-group>
             </div>
-            <el-pagination
-                    background
-                    @size-change="pageSizeChange"
-                    @current-change="currentPageChange"
-                    :current-page="currentPage"
-                    :page-sizes="[10, 20, 30, 40, 50]"
-                    :page-size="pageSize"
-                    layout="total, sizes, prev, pager, next, jumper"
-                    :total="totalNumber">
+            <el-pagination background @size-change="pageSizeChange" @current-change="currentPageChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalNumber">
             </el-pagination>
         </div>
         <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
@@ -165,16 +100,14 @@
                     <template slot-scope="{row}">
                         <el-select v-model="row.name">
 
-                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
-                                       :key="item.value"></el-option>
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
                 <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
                     <template slot-scope="{row}">
                         <el-select v-model="row.searchMethod">
-                            <el-option v-for="item in searchMethods" :label="item" :value="item"
-                                       :key="item"></el-option>
+                            <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
@@ -204,8 +137,7 @@
                     <template slot-scope="{row}">
                         <el-select v-model="row.name">
 
-                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
-                                       :key="item.value"></el-option>
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
@@ -239,315 +171,340 @@
     </div>
 </template>
 <script>
-    import {mapState} from 'vuex'
-    import {format} from 'date-fns'
-    import zh from 'date-fns/locale/zh_cn'
-
-    export default {
-        created() {
+import { mapState } from 'vuex'
+import { format } from 'date-fns'
+import zh from 'date-fns/locale/zh_cn'
+
+export default {
+    created() {
+        this.getData();
+    },
+    data() {
+        return {
+            totalNumber: 0,
+            totalPage: 10,
+            currentPage: 1,
+            pageSize: 20,
+            tableData: [],
+            filter1: '',
+            filter2: '',
+            tableColumns: [
+                {
+                    label: '',
+                    value: 'id',
+                    show: true
+                },
+                {
+                    label: '名称',
+                    value: 'season',
+                    show: true
+                },
+                {
+                    label: '简称',
+                    value: 'shortName',
+                    show: true
+                },
+                {
+                    label: '开始时间',
+                    value: 'beginTime',
+                    show: true
+                },
+                {
+                    label: '结束时间',
+                    value: 'endTime',
+                    show: true
+                },
+                {
+                    label: '奖励数',
+                    value: 'bonus',
+                    show: true
+                },
+                {
+                    label: '备注',
+                    value: 'remark',
+                    show: true
+                },
+                {
+                    label: '排序',
+                    value: 'rank',
+                    show: true
+                },
+                {
+                    label: '状态',
+                    value: 'statusFlag',
+                    show: true
+                },
+                {
+                    label: '游戏',
+                    value: 'gameId',
+                    show: true
+                },
+                {
+                    label: '已发奖励',
+                    value: 'bonusPaid',
+                    show: true
+                },
+            ],
+            multipleMode: false,
+            showAdvancedQueryDialog: false,
+            advancedQueryFields: [],
+            showTableSortDialog: false,
+            tableSortFields: [],
+            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+            advancedQueryColumns: [
+                {
+                    label: '',
+                    value: 'id'
+                },
+                {
+                    label: '名称',
+                    value: 'season'
+                },
+                {
+                    label: '简称',
+                    value: 'short_name'
+                },
+                {
+                    label: '开始时间',
+                    value: 'begin_time'
+                },
+                {
+                    label: '结束时间',
+                    value: 'end_time'
+                },
+                {
+                    label: '奖励数',
+                    value: 'bonus'
+                },
+                {
+                    label: '备注',
+                    value: 'remark'
+                },
+                {
+                    label: '排序',
+                    value: 'rank'
+                },
+                {
+                    label: '状态',
+                    value: 'status_flag'
+                },
+                {
+                    label: '游戏',
+                    value: 'game_id'
+                },
+                {
+                    label: '已发奖励',
+                    value: 'bonus_paid'
+                },
+            ],
+            advancedQuerySearchKey: '',
+            orderByStr: '',
+            imgSrc: '',
+            imageDialogVisible: false,
+        }
+    },
+    computed: {
+        ...mapState(['tableHeight']),
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        pageSizeChange(size) {
+            this.currentPage = 1;
+            this.pageSize = size;
             this.getData();
         },
-        data() {
-            return {
-                totalNumber: 0,
-                totalPage: 10,
-                currentPage: 1,
-                pageSize: 20,
-                tableData: [],
-                filter1: '',
-                filter2: '',
-                tableColumns: [
-                                                                        {
-                                label: '',
-                                value: 'id',
-                                show: true
-                            },
-                                                                                                                                                                                                                                                                                                                            {
-                                label: '名称',
-                                value: 'season',
-                                show: true
-                            },
-                                                                                                {
-                                label: '简称',
-                                value: 'shortName',
-                                show: true
-                            },
-                                                                                                {
-                                label: '开始时间',
-                                value: 'beginTime',
-                                show: true
-                            },
-                                                                                                {
-                                label: '结束时间',
-                                value: 'endTime',
-                                show: true
-                            },
-                                                                                                {
-                                label: '奖金数',
-                                value: 'bonus',
-                                show: true
-                            },
-                                                                                                {
-                                label: '备注',
-                                value: 'remark',
-                                show: true
-                            },
-                                                                                                {
-                                label: '排序',
-                                value: 'rank',
-                                show: true
-                            },
-                                                                                                {
-                                label: '状态',
-                                value: 'statusFlag',
-                                show: true
-                            },
-                                                                                                {
-                                label: '游戏',
-                                value: 'gameId',
-                                show: true
-                            },
-                                                            ],
-                multipleMode: false,
-                showAdvancedQueryDialog: false,
-                advancedQueryFields: [],
-                showTableSortDialog: false,
-                tableSortFields: [],
-                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
-                advancedQueryColumns: [
-                                                                        {
-                                label: '',
-                                value: 'id'
-                            },
-                                                                                                                                                                                                                                                                                                                            {
-                                label: '名称',
-                                value: 'season'
-                            },
-                                                                                                {
-                                label: '简称',
-                                value: 'short_name'
-                            },
-                                                                                                {
-                                label: '开始时间',
-                                value: 'begin_time'
-                            },
-                                                                                                {
-                                label: '结束时间',
-                                value: 'end_time'
-                            },
-                                                                                                {
-                                label: '奖金数',
-                                value: 'bonus'
-                            },
-                                                                                                {
-                                label: '备注',
-                                value: 'remark'
-                            },
-                                                                                                {
-                                label: '排序',
-                                value: 'rank'
-                            },
-                                                                                                {
-                                label: '状态',
-                                value: 'status_flag'
-                            },
-                                                                                                {
-                                label: '游戏',
-                                value: 'game_id'
-                            },
-                                                            ],
-                advancedQuerySearchKey: '',
-                orderByStr: '',
-                imgSrc: '',
-                imageDialogVisible: false,
-            }
+        currentPageChange(page) {
+            this.currentPage = page;
+            this.getData();
         },
-        computed: {
-            ...mapState(['tableHeight']),
-            selection() {
-                return this.$refs.table.selection.map(i => i.id);
+        getData() {
+
+            var data = {
+                currentPage: this.currentPage,
+                pageNumber: this.pageSize,
+                searchKey: this.filter1,
+                advancedQuery: this.advancedQuerySearchKey,
+                orderByStr: this.orderByStr,
             }
-        },
-        methods: {
-            pageSizeChange(size) {
-                this.currentPage = 1;
-                this.pageSize = size;
-                this.getData();
-            },
-            currentPageChange(page) {
-                this.currentPage = page;
-                this.getData();
-            },
-            getData() {
-
-                var data = {
-                    currentPage: this.currentPage,
-                    pageNumber: this.pageSize,
-                    searchKey: this.filter1,
-                    advancedQuery: this.advancedQuerySearchKey,
-                    orderByStr: this.orderByStr,
-                }
 
-                if (this.$route.query.column) {
-                    var tempColumn = this.$route.query.column;
-                    data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
-                }
+            if (this.$route.query.column) {
+                var tempColumn = this.$route.query.column;
+                data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
+            }
 
-                this.$http.get({
-                    url: '/competitionSeason/page',
-                    data: data
-                }).then(res => {
-                    if (res.success) {
-                        this.totalNumber = res.data.page.totalNumber;
-                        this.tableData = res.data.pp;
-                    }
-                })
-            },
-            isColumnShow(column) {
-                var row = this.tableColumns.find(i => i.value === column);
-                return row ? row.show : false;
-            },
-            toggleMultipleMode(multipleMode) {
-                this.multipleMode = multipleMode;
-                if (!multipleMode) {
-                    this.$refs.table.clearSelection();
+            this.$http.get({
+                url: '/competitionSeason/page',
+                data: data
+            }).then(res => {
+                if (res.success) {
+                    this.totalNumber = res.data.page.totalNumber;
+                    this.tableData = res.data.pp;
                 }
-            },
-            editRow(row) {
-                this.$router.push({
-                    path: '/competitionSeason',
-                    query: {
-                        id: row.id,
-                        column: this.$route.query.column,
-                    }
-                })
-            },
-            operation1() {
-                this.$notify({
-                    title: '提示',
-                    message: this.selection
-                });
-            },
-            operation2() {
-                this.$message('操作2');
-            },
-            addField() {
-                this.advancedQueryFields.push({
-                    link: 'AND',
-                    name: '',
-                    searchMethod: '=',
-                    value: '',
-                });
-            },
-            removeField(i) {
-                if (this.advancedQueryFields.length > 0) {
-                    this.advancedQueryFields.splice(i, 1);
+            })
+        },
+        isColumnShow(column) {
+            var row = this.tableColumns.find(i => i.value === column);
+            return row ? row.show : false;
+        },
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
+            }
+        },
+        editRow(row) {
+            this.$router.push({
+                path: '/competitionSeason',
+                query: {
+                    id: row.id,
+                    column: this.$route.query.column,
                 }
-            },
-            advancedQuery() {
+            })
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        addField() {
+            this.advancedQueryFields.push({
+                link: 'AND',
+                name: '',
+                searchMethod: '=',
+                value: '',
+            });
+        },
+        removeField(i) {
+            if (this.advancedQueryFields.length > 0) {
+                this.advancedQueryFields.splice(i, 1);
+            }
+        },
+        advancedQuery() {
 
-                this.advancedQuerySearchKey = '';
+            this.advancedQuerySearchKey = '';
 
-                if (this.advancedQueryFields.length > 0) {
+            if (this.advancedQueryFields.length > 0) {
 
-                    var templist = [];
+                var templist = [];
 
-                    this.advancedQueryFields.forEach(item => {
-                        if (item.link && item.name && item.searchMethod && item.value) {
-                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
-                            templist.push(tempItem);
-                        }
-                    })
+                this.advancedQueryFields.forEach(item => {
+                    if (item.link && item.name && item.searchMethod && item.value) {
+                        var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                        templist.push(tempItem);
+                    }
+                })
 
-                    if (templist.length > 0) {
+                if (templist.length > 0) {
 
-                        this.advancedQuerySearchKey = templist.join('_;');
-                    }
+                    this.advancedQuerySearchKey = templist.join('_;');
                 }
+            }
 
-                this.getData();
-                this.showAdvancedQueryDialog = false;
-            },
-            addSortField() {
-                this.tableSortFields.push({
-                    name: '',
-                    order: 'asc',
-                });
-            },
-            removeSortField(i) {
-                if (this.tableSortFields.length > 0) {
-                    this.tableSortFields.splice(i, 1);
-                }
-            },
-            tableSortQuery() {
+            this.getData();
+            this.showAdvancedQueryDialog = false;
+        },
+        addSortField() {
+            this.tableSortFields.push({
+                name: '',
+                order: 'asc',
+            });
+        },
+        removeSortField(i) {
+            if (this.tableSortFields.length > 0) {
+                this.tableSortFields.splice(i, 1);
+            }
+        },
+        tableSortQuery() {
 
-                this.orderByStr = '';
+            this.orderByStr = '';
 
-                if (this.tableSortFields.length > 0) {
+            if (this.tableSortFields.length > 0) {
 
-                    var templist = [];
+                var templist = [];
 
-                    this.tableSortFields.forEach(item => {
-                        if (item.name && item.order) {
-                            var tempItem = item.name + '_,' + item.order;
-                            templist.push(tempItem);
-                        }
-                    })
+                this.tableSortFields.forEach(item => {
+                    if (item.name && item.order) {
+                        var tempItem = item.name + '_,' + item.order;
+                        templist.push(tempItem);
+                    }
+                })
 
-                    if (templist.length > 0) {
+                if (templist.length > 0) {
 
-                        this.orderByStr = templist.join('_;');
-                    }
+                    this.orderByStr = templist.join('_;');
                 }
+            }
 
+            this.getData();
+            this.showTableSortDialog = false;
+        },
+        exportExcel() {
+            window.location.href = this.$baseUrl + "/competitionSeason/exportExcel?searchKey="
+                + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey + "&orderByStr=" + this.orderByStr;
+        },
+        searchData() {
+            this.currentPage = 1;
+            this.getData();
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
+                    url: '/competitionSeason/del',
+                    data: { id: row.id }
+                })
+            }).then(() => {
+                this.$message.success('删除成功');
                 this.getData();
-                this.showTableSortDialog = false;
-            },
-            exportExcel() {
-                window.location.href = this.$baseUrl + "/competitionSeason/exportExcel?searchKey="
-                        + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey+"&orderByStr=" + this.orderByStr;
-            },
-            searchData() {
-                this.currentPage = 1;
-                this.getData();
-            },
-            deleteRow(row) {
-                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
-                    return this.$http.post({
-                        url: '/competitionSeason/del',
-                        data: {id: row.id}
-                    })
-                }).then(() => {
-                    this.$message.success('删除成功');
-                    this.getData();
-                }).catch(action => {
-                    if (action === 'cancel') {
-                        this.$message.info('删除取消');
-                    } else {
-                        this.$message.error('删除失败');
-                    }
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
+                }
+            })
+        },
+        bonusPayment(row) {
+            this.$alert('发放后将无法恢复,确认要发放么?', '警告', { type: 'error' }).then(() => {
+                return this.$http.post({
+                    url: '/competitionSeason/bonusPayment',
+                    data: { id: row.id }
                 })
-            },
-            DateTimeFormatter(row, column, cellValue) {
-                if (cellValue) {
-                    return format(cellValue, 'YYYY/MM/DD HH:mm', {locale: zh})
+            }).then(() => {
+                this.$message.success('发放成功');
+                this.getData();
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('发放取消');
+                } else {
+                    this.$message.error('发放失败');
                 }
+            })
+        },
+        DateTimeFormatter(row, column, cellValue) {
+            if (cellValue) {
+                return format(cellValue, 'YYYY/MM/DD HH:mm', { locale: zh })
+            }
 
-            },
-            DateFormatter(row, column, cellValue) {
-                if (cellValue) {
-                    return format(cellValue, 'YYYY/MM/DD', {locale: zh})
-                }
+        },
+        DateFormatter(row, column, cellValue) {
+            if (cellValue) {
+                return format(cellValue, 'YYYY/MM/DD', { locale: zh })
+            }
 
-            },
-            showImg(img) {
-                this.imgSrc = img;
-                this.imageDialogVisible = true;
-            },
+        },
+        showImg(img) {
+            this.imgSrc = img;
+            this.imageDialogVisible = true;
+        },
 
-        }
     }
+}
 </script>
 <style lang="less" scoped>
-
 </style>