suochencheng 6 лет назад
Родитель
Сommit
65898936fc

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

@@ -31,5 +31,7 @@ public interface CompetitionSeasonMapper{
     CompetitionSeason queryStartCompetitionSeason(CompetitionSeason record);
 
     List<CompetitionSeason> query(CompetitionSeason record);
+
+    int addBonus(CompetitionSeason addBonus);
 }
 

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

@@ -218,6 +218,23 @@
             id in (${idStr})
         </if>
 
+    </update>
+    <update id="addBonus" parameterType="com.izouma.awesomeadmin.model.CompetitionSeason">
+        update competition_season
+        <set>
+            <if test="bonus != null">
+                bonus = bonus + #{bonus,jdbcType=DECIMAL},
+            </if>
+        </set>
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+
     </update>
     <select id="queryCompetitionSeasonByPage" parameterType="java.util.Map"
             resultMap="PageCompetitionSeasonResult">

+ 2 - 0
src/main/java/com/izouma/awesomeadmin/dao/PlayerInfoMapper.java

@@ -38,6 +38,8 @@ public interface PlayerInfoMapper {
 
     int userRank(PlayerInfo record);
 
+    int endNum(PlayerInfo record);
+
     PlayerInfo seasonUserRank(PlayerInfo record);
 
     List<PlayerInfo> queryNoStartPlayer(HouseInfo record);

+ 89 - 0
src/main/java/com/izouma/awesomeadmin/dao/PlayerInfoMapper.xml

@@ -1232,6 +1232,95 @@
 
         </where>
     </select>
+    <select id="endNum" parameterType="java.util.Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(player_info.id)
+        FROM
+        player_info
+        <where>
+            and del_flag = 'N'
+            <![CDATA[  and status_flag  >= 3 ]]>
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+                and update_time = #{updateTime}
+            </if>
+            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
+                and update_user = #{updateUser}
+            </if>
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+                and create_user = #{createUser}
+            </if>
+            <if test="gameId != null and !&quot;&quot;.equals(gameId)">
+                and game_id = #{gameId}
+            </if>
+            <if test="houseId != null and !&quot;&quot;.equals(houseId)">
+                and house_id = #{houseId}
+            </if>
+            <if test="joinTime != null and !&quot;&quot;.equals(joinTime)">
+                and join_time = #{joinTime}
+            </if>
+            <if test="principal != null and !&quot;&quot;.equals(principal)">
+                and principal = #{principal}
+            </if>
+            <if test="bonus != null and !&quot;&quot;.equals(bonus)">
+                and bonus = #{bonus}
+            </if>
+            <if test="userId != null and !&quot;&quot;.equals(userId)">
+                and user_id = #{userId}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="image != null and !&quot;&quot;.equals(image)">
+                and image = #{image}
+            </if>
+            <if test="killNumber != null and !&quot;&quot;.equals(killNumber)">
+                and kill_number = #{killNumber}
+            </if>
+            <if test="ranking != null and !&quot;&quot;.equals(ranking)">
+                and ranking = #{ranking}
+            </if>
+            <if test="beginTime != null and !&quot;&quot;.equals(beginTime)">
+                and begin_time = #{beginTime}
+            </if>
+            <if test="endTime != null and !&quot;&quot;.equals(endTime)">
+                and end_time = #{endTime}
+            </if>
+            <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
+                and status_flag = #{statusFlag}
+            </if>
+            <if test="examineUser != null and !&quot;&quot;.equals(examineUser)">
+                and examine_user = #{examineUser}
+            </if>
+            <if test="examineTime != null and !&quot;&quot;.equals(examineTime)">
+                and examine_time = #{examineTime}
+            </if>
+            <if test="examineType != null and !&quot;&quot;.equals(examineType)">
+                and examine_type = #{examineType}
+            </if>
+            <if test="video != null and !&quot;&quot;.equals(video)">
+                and video = #{video}
+            </if>
+            <if test="liveTime != null and !&quot;&quot;.equals(liveTime)">
+                and live_time = #{liveTime}
+            </if>
+            <if test="gameType != null and !&quot;&quot;.equals(gameType)">
+                and game_type = #{gameType}
+            </if>
+            <if test="seasonId != null and !&quot;&quot;.equals(seasonId)">
+                and season_id = #{seasonId}
+            </if>
+
+        </where>
+    </select>
 
 
     <select id="queryNoStartPlayer" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.PlayerInfo">

+ 11 - 1
src/main/java/com/izouma/awesomeadmin/dao/UserInfoMapper.xml

@@ -32,6 +32,7 @@
         <result column="company_flag" property="companyFlag" jdbcType="CHAR"/>
         <result column="approve_step" property="approveStep" jdbcType="INTEGER"/>
         <result column="notice_flag" property="noticeFlag" jdbcType="CHAR"/>
+        <result column="remind_flag" property="remindFlag" jdbcType="CHAR"/>
         <association property="departId" javaType="string" column="id"
                      select="com.izouma.awesomeadmin.dao.DepartInfoMapper.getUserDepartId"/>
         <association property="roleId" javaType="string" column="id"
@@ -41,7 +42,7 @@
         id, username, nickname, icon, birthday, sex, open_id, union_id, phone, mail,
         country, province, city, district, create_time, del_flag, money_coin, money_point,
         contacter, contact_phone, company_name, company_type, admin_flag, cash_pledge,
-        approve_flag, store_flag, company_flag, approve_step, notice_flag
+        approve_flag, store_flag, company_flag, approve_step, notice_flag, remind_flag
     </sql>
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
         select
@@ -151,6 +152,9 @@
             <if test="noticeFlag != null">
                 notice_flag,
             </if>
+            <if test="remindFlag != null">
+                remind_flag,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">
@@ -246,6 +250,9 @@
             <if test="noticeFlag != null">
                 #{noticeFlag},
             </if>
+            <if test="remindFlag != null">
+                #{remindFlag},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.UserInfo">
@@ -341,6 +348,9 @@
             <if test="noticeFlag != null">
                 notice_flag = #{noticeFlag},
             </if>
+            <if test="remindFlag != null">
+                remind_flag = #{remindFlag},
+            </if>
         </set>
         where id = #{id,jdbcType=INTEGER}
     </update>

+ 10 - 0
src/main/java/com/izouma/awesomeadmin/model/UserInfo.java

@@ -77,6 +77,8 @@ public class UserInfo {
 
     private String noticeFlag;
 
+    private String remindFlag;
+
 
     public String getDepartId() {
         return departId;
@@ -333,5 +335,13 @@ public class UserInfo {
     public void setNoticeFlag(String noticeFlag) {
         this.noticeFlag = noticeFlag;
     }
+
+    public String getRemindFlag() {
+        return remindFlag;
+    }
+
+    public void setRemindFlag(String remindFlag) {
+        this.remindFlag = remindFlag;
+    }
 }
 

+ 2 - 0
src/main/java/com/izouma/awesomeadmin/service/PlayerInfoService.java

@@ -42,5 +42,7 @@ public interface PlayerInfoService {
     List<PlayerInfo> getSettlementPlayer(PlayerInfo record);
 
     Result receiveBonus(PlayerInfo record);
+
+    int endNum(PlayerInfo record);
 }
 

+ 39 - 2
src/main/java/com/izouma/awesomeadmin/service/impl/HouseInfoServiceImpl.java

@@ -3,6 +3,7 @@ package com.izouma.awesomeadmin.service.impl;
 import java.math.BigDecimal;
 import java.util.*;
 
+import com.izouma.awesomeadmin.dao.BonusRecordMapper;
 import com.izouma.awesomeadmin.dao.CompetitionSeasonMapper;
 import com.izouma.awesomeadmin.dto.Result;
 import com.izouma.awesomeadmin.model.*;
@@ -44,6 +45,9 @@ public class HouseInfoServiceImpl implements HouseInfoService {
     @Autowired
     private SystemNoticeService systemNoticeService;
 
+    @Autowired
+    private BonusRecordService bonusRecordService;
+
     @Override
     public List<HouseInfo> getHouseInfoList(HouseInfo record) {
 
@@ -290,9 +294,42 @@ public class HouseInfoServiceImpl implements HouseInfoService {
                     }
 
                     if (poolRatio.doubleValue() > 0) {
-                        BigDecimal pool = BigDecimal.valueOf((poolRatio.doubleValue() / 100) * houseInfo.getBonus().doubleValue());
+                        //加入到赛季奖金池中
+                        try {
+
+                            BigDecimal pool = BigDecimal.valueOf((poolRatio.doubleValue() / 100) * houseInfo.getBonus().doubleValue());
+
+                            CompetitionSeason competitionSeason = competitionSeasonMapper.selectByPrimaryKey(houseInfo.getSeasonId());
+
+                            if (competitionSeason != null) {
+
+
+                                double balance = competitionSeason.getBonus().doubleValue();
+                                double moneyCoin = balance + pool.doubleValue();
+
+                                BonusRecord bonusRecord = new BonusRecord();
+                                bonusRecord.setMoney(pool);
+                                bonusRecord.setBonus(BigDecimal.valueOf(moneyCoin));
+                                bonusRecord.setSeasonId(houseInfo.getSeasonId());
+                                bonusRecord.setGameId(houseInfo.getGameId());
+                                bonusRecord.setHouseId(houseInfo.getId());
+                                bonusRecord.setTypeFlag(0);
+                                bonusRecord.setRemark(houseInfo.getHouseName() + "比赛结算," + pool.doubleValue() + " 积分");
+                                bonusRecordService.createBonusRecord(bonusRecord);
+
+                                CompetitionSeason addBonus = new CompetitionSeason();
+                                addBonus.setId(houseInfo.getId());
+                                addBonus.setBonus(pool);
+
+                                competitionSeasonMapper.addBonus(addBonus);
+
+
+                            }
+
+                        } catch (Exception e) {
+                            logger.error("赛季奖金池添加奖金异常!", e);
+                        }
 
-                        //TODO 加入到赛季奖金池中
                     }
 
 

+ 15 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/PlayerInfoServiceImpl.java

@@ -176,6 +176,21 @@ public class PlayerInfoServiceImpl implements PlayerInfoService {
         return 0;
     }
 
+    @Override
+    public int endNum(PlayerInfo record) {
+
+        logger.info("endNum");
+        try {
+
+            return playerInfoMapper.endNum(record);
+
+        } catch (Exception e) {
+            logger.error("endNum", e);
+        }
+
+        return 0;
+    }
+
     @Override
     public PlayerInfo seasonUserRank(PlayerInfo record) {
 

+ 15 - 0
src/main/java/com/izouma/awesomeadmin/web/PlayerInfoController.java

@@ -126,6 +126,21 @@ public class PlayerInfoController {
         return new Result(true, rank);
     }
 
+    /**
+     * 查询已完成数量
+     *
+     * @param record
+     * @return
+     */
+    @RequestMapping(value = "/endNum", method = RequestMethod.GET)
+    @ResponseBody
+    public Result endNum(PlayerInfo record) {
+
+        int rank = playerInfoService.endNum(record);
+
+        return new Result(true, rank);
+    }
+
     @RequestMapping(value = "/seasonUserRank", method = RequestMethod.GET)
     @ResponseBody
     public Result seasonUserRank(PlayerInfo record) {