Browse Source

feat(lottery):增加中奖记录页面

wangyc 7 years ago
parent
commit
8f4aff8bd9

+ 12 - 0
src/main/java/com/uas/platform/b2c/common/lottery/controller/LotteryController.java

@@ -108,4 +108,16 @@ public class LotteryController {
     public ResultMap drawLottery(String activityCode, String itemCode) {
         return lotteryService.drawLottery(activityCode, itemCode);
     }
+
+    /**
+     * 兑奖
+     * @param id 中奖记录id
+     * @param userTel 用户手机号
+     * @param code 中奖码
+     * @return
+     */
+    @RequestMapping(value = "/redempte", method = RequestMethod.PUT, produces = "application/json")
+    public ResultMap redempte(Long id, String userTel, String code) {
+        return winningHistoryService.redempte(id, userTel, code);
+    }
 }

+ 1 - 0
src/main/java/com/uas/platform/b2c/common/lottery/service/LotteryService.java

@@ -16,4 +16,5 @@ public interface LotteryService {
      * @return
      */
     ResultMap drawLottery(String activityCode, String itemCode);
+
 }

+ 9 - 0
src/main/java/com/uas/platform/b2c/common/lottery/service/WinningHistoryService.java

@@ -37,4 +37,13 @@ public interface WinningHistoryService {
      * @return
      */
     JSONObject getWinningHistories(String activityCode, com.uas.platform.core.model.PageParams pageParams, String itemCode, String keyword, String prizeCode);
+
+    /**
+     * 兑奖
+     * @param id 中奖记录id
+     * @param userTel 用户手机号
+     * @param code 中奖码
+     * @return
+     */
+    ResultMap redempte(Long id, String userTel, String code);
 }

+ 1 - 0
src/main/java/com/uas/platform/b2c/common/lottery/service/impl/LotteryServiceImpl.java

@@ -52,4 +52,5 @@ public class LotteryServiceImpl implements LotteryService {
             throw new IllegalOperatorException("获取中奖信息错误,请重试");
         }
     }
+
 }

+ 23 - 0
src/main/java/com/uas/platform/b2c/common/lottery/service/impl/WinningHistoryServiceImpl.java

@@ -37,6 +37,9 @@ public class WinningHistoryServiceImpl implements WinningHistoryService {
     // 获取全部中奖记录路径
     private static final String GET_WINNING_HOSTORIES_URL = "/winninghistorys";
 
+    // 兑奖路径
+    private static final String REDEMPTE_URL = "/winninghistorys/redempte";
+
     @Autowired
     public WinningHistoryServiceImpl(SysConf sysConf) {
         this.sysConf = sysConf;
@@ -102,4 +105,24 @@ public class WinningHistoryServiceImpl implements WinningHistoryService {
             throw new IllegalOperatorException("获取中奖信息错误,请重试");
         }
     }
+
+    @Override
+    public ResultMap redempte(Long id, String userTel, String code) {
+        if (StringUtils.isEmpty(id) || StringUtils.isEmpty(userTel) || StringUtils.isEmpty(code)) {
+            throw new IllegalOperatorException("确认中奖信息不完全,请重新确认信息");
+        }
+
+        Map<String, Object> params = new HashMap<>();
+        params.put("id", id);
+        params.put("userTel", userTel);
+        params.put("code", code);
+
+        try {
+            Response response = HttpUtil
+                .sendPostRequest(sysConf.getLottery() + REDEMPTE_URL, params);
+            return JSON.parseObject(response.getResponseText(), ResultMap.class);
+        } catch (Exception e) {
+            throw new IllegalOperatorException("获取中奖信息错误,请重试");
+        }
+    }
 }

+ 211 - 0
src/main/webapp/resources/view/admin/ads/ads_winninghistories.html

@@ -0,0 +1,211 @@
+<style>
+    .checkout-steps {
+        background-color: #fff;
+        padding: 0 15px;
+        border: 1px solid #f0f0f0;
+        width: 990px;
+        margin: 10px auto;
+    }
+
+    .checkout-steps .basetop {
+        margin-bottom: 20px;
+    }
+
+    .checkout-steps .titletip {
+        height: 35px;
+        line-height: 35px;
+    }
+
+    .checkout-steps .smalltitle {
+        font-size: 14px;
+        font-weight: bold;
+        float: left;
+    }
+
+    .checkout-steps .in-right {
+        color: #005ea7;
+        float: right;
+    }
+
+    .checkout-steps .item-select {
+        margin-left: 20px;
+        border: 2px solid #e4393c;
+        cursor: pointer;
+        padding: 6px 15px;
+    }
+
+    .checkout-steps .item-noselect {
+        margin-left: 20px;
+        border: 2px solid #ddd;;
+        cursor: pointer;
+        padding: 6px 15px;
+    }
+
+    .checkout-steps .item-noselect:hover {
+        border: 2px solid #e4393c;
+        cursor: pointer;
+        padding: 6px 15px;
+    }
+
+    .checkout-steps .hr {
+        border-bottom: 1px solid #e6e6e6;
+        height: 0;
+    }
+
+    .addr-detail {
+        float: left;
+        line-height: 24px;
+    }
+
+    .addr-detail span {
+        margin-left: 10px
+    }
+
+    .address_more {
+        position: relative;
+        line-height: 30px;
+        text-align: center;
+        border-top: 1px solid #DDD;
+    }
+
+    .address_more a {
+        position: relative;
+        display: inline-block;
+        margin-top: -1px;
+        height: 30px;
+        line-height: 30px;
+        padding: 0 10px 0 10px;
+        border-width: 1px;
+        border-style: solid;
+        border-color: #FFF #DDD #DDD;
+        background: #fff;
+        cursor: pointer;
+         -webkit-transition: border-color .15s ease-in-out;
+         -moz-transition: border-color .15s ease-in-out;
+        transition: border-color .15s ease-in-out;
+    }
+
+    .audit-failure-modal {
+        display: block !important;
+        position: fixed;
+        background-color: white;
+        opacity: 1;
+        width: 300px;
+        height: 140px;
+        top: 250px;
+        left: 554px;
+        font-family: "microsoft yahei";
+        border: 1px solid #d9d5ce;
+        z-index: 10;
+    }
+
+    .audit-failure-modal .title {
+        line-height: 31px;
+        height: 31px;
+        font-size: 14px;
+        background-color: #3a76e4;
+        color: white;
+        text-align: left;
+        font-family: microsoft yahei;
+        padding-left: 15px;
+    }
+
+    .audit-failure-modal .content input {
+        width: 80%;
+        height: 31px;
+        line-height: 31px;
+        border-radius: 4px;
+        margin-top: 10px;
+        margin-left: 28px;
+        margin-bottom: 15px;
+    }
+
+    .audit-failure-modal  .footer .confirm {
+        width: 90px;
+        padding: 5px 10px;
+        background-color: #3A76E4;
+        border: none;
+        color: white;
+        font-size: 14px;
+    }
+
+    .audit-failure-modal .footer .cancle-button {
+        width: 90px;
+        padding: 5px 10px;
+        background-color: #D9D5CE;
+        border: none;
+        color: #333333;
+        font-size: 14px;
+    }
+</style>
+<div class="row-fluid sortable">
+    <div class="box">
+        <div class="box-header well" data-original-title>
+            <i class="icon-user"></i> 中奖记录
+        </div>
+        <div class="box-content">
+            <!-- ng-tableStart -->
+            <div class="fullscreen" style="padding: 10px;">
+                <div class="row">
+                    <div class="col-sm-1">
+                        共<span class="badge">{{winningTableParams.total()}} </span>条
+                    </div>
+                    <div class="col-sm-8">
+                        <div class="btn-group" role="group" aria-label="...">
+                            <button type="button" class="btn btn-default" ng-class="{'btn-primary':active=='tobereceived'}" ng-click="setActive('all')">全部</button>
+                            <button type="button" class="btn btn-default" ng-class="{'btn-primary':active=='moneyreceived'}" ng-click="setActive('bronze')">青铜</button>
+                            <button type="button" class="btn btn-default" ng-class="{'btn-primary':active=='tobeshipped'}" ng-click="setActive('gold')">黄金</button>
+                            <button type="button" class="btn btn-default" ng-class="{'btn-primary':active=='shippingin'}" ng-click="setActive('diamond')">钻石</button>
+                            <button type="button" class="btn btn-default" ng-class="{'btn-primary':active=='shipped'}" ng-click="setActive('king')">王者</button>
+                        </div>
+                    </div>
+                    <div class="col-sm-3">
+                        <div class="input-group">
+                            <input placeholder="请输入备注查询" class="form-control"
+                                   ng-model="keyword"  ng-search="onSearch()" size="16" type="text">
+                            <span class="input-group-btn">
+                                <button class="btn btn-primary" type="button" ng-click="onSearch()">搜索</button>
+                            </span>
+                        </div>
+                    </div>
+                </div>
+                <table ng-table="winningTableParams" class="table table-bordered table-striped" style="margin-top: 10px;">
+                    <thead>
+                    <tr>
+                        <th class="text-center" width="50">序号</th>
+                        <th class="text-center" width="auto">中奖码</th>
+                        <th class="text-center" width="75">等级</th>
+                        <th class="text-center" width="75">中奖人uu</th>
+                        <th class="text-center" width="100">中奖人姓名</th>
+                        <th class="text-center" width="75">中奖人企业uu</th>
+                        <th class="text-center" width="100">中奖人企业名称</th>
+                        <th class="text-center" width="100">奖品编号</th>
+                        <th class="text-center" width="100">奖品名称</th>
+                        <th class="text-center" width="100">抽奖时间</th>
+                        <th class="text-center" width="75">兑奖状态</th>
+                        <th class="text-center" width="100">兑奖时间</th>
+                        <th class="text-center">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody class="text-center">
+                    <tr class="text-center" ng-repeat="history in $data">
+                        <td class="text-center">{{$index+1}}</td>
+                        <td class="text-center" ng-bind="history.code"></td>
+                        <td class="text-center" ng-bind="history.itemName"></td>
+                        <td class="text-center" ng-bind="history.userUU"></td>
+                        <td class="text-center" ng-bind="history.userName"></td>
+                        <td class="text-center" ng-bind="history.enUU"></td>
+                        <td class="text-center" ng-bind="history.enName"></td>
+                        <td class="text-center" ng-bind="history.prizeCode"></td>
+                        <td class="text-center" ng-bind="history.prizeName"></td>
+                        <td class="text-center" ng-bind="history.drawnTime"></td>
+                        <td class="text-center"><span ng-show="history.status==100">已兑奖</span><span ng-show="history.status==101">待兑奖</span></td>
+                        <td class="text-center" ng-bind="history.redemptiveDate"></td>
+                        <td class="text-center"><button class="btn btn-primary" ng-show="history.status==101">兑奖</button></td>
+                    </tr>
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+</div>