Skip to content

Commit

Permalink
后台管理增加追号记录,导航栏改为二级菜单
Browse files Browse the repository at this point in the history
  • Loading branch information
zohar committed Jun 1, 2019
1 parent 5494785 commit 40505fc
Show file tree
Hide file tree
Showing 35 changed files with 1,240 additions and 303 deletions.
20 changes: 20 additions & 0 deletions lottery-admin/src/main/java/me/zohar/lottery/PageController.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,24 @@ public String lotteryInformation() {
return "lottery-information";
}

/**
* 登录日志
*
* @return
*/
@GetMapping("/login-log")
public String loginLog() {
return "login-log";
}

/**
* 追号记录
*
* @return
*/
@GetMapping("/tracking-number-record")
public String trackingNumberRecord() {
return "tracking-number-record";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
Expand All @@ -14,6 +15,7 @@
import me.zohar.lottery.betting.param.ChangeOrderParam;
import me.zohar.lottery.betting.service.BettingService;
import me.zohar.lottery.common.vo.Result;
import me.zohar.lottery.config.security.UserAccountDetails;

@Controller
@RequestMapping("/betting")
Expand Down Expand Up @@ -45,7 +47,7 @@ public Result findBettingOrderDetails(String id) {
public Result findBettingOrderInfoByPage(BettingOrderQueryCondParam param) {
return Result.success().setData(bettingService.findBettingOrderInfoByPage(param));
}

/**
* 改单
*
Expand All @@ -57,7 +59,23 @@ public Result changeOrder(@RequestBody List<ChangeOrderParam> changeOrderParams)
bettingService.changeOrder(changeOrderParams);
return Result.success();
}



@GetMapping("/cancelOrder")
@ResponseBody
public Result cancelOrder(String orderId) {
UserAccountDetails user = (UserAccountDetails) SecurityContextHolder.getContext().getAuthentication()
.getPrincipal();
bettingService.cancelOrder(orderId, user.getUserAccountId());
return Result.success();
}

@PostMapping("/batchCancelOrder")
@ResponseBody
public Result batchCancelOrder(@RequestBody List<String> orderIds) {
UserAccountDetails user = (UserAccountDetails) SecurityContextHolder.getContext().getAuthentication()
.getPrincipal();
bettingService.batchCancelOrder(orderIds, user.getUserAccountId());
return Result.success();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package me.zohar.lottery.betting.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import me.zohar.lottery.betting.param.TrackingNumberSituationQueryCondParam;
import me.zohar.lottery.betting.service.TrackingNumberService;
import me.zohar.lottery.common.vo.Result;
import me.zohar.lottery.config.security.UserAccountDetails;

@Controller
@RequestMapping("/trackingNumber")
public class TrackingNumberController {

@Autowired
private TrackingNumberService trackingNumberService;

@GetMapping("/findTrackingNumberSituationByPage")
@ResponseBody
public Result findTrackingNumberSituationByPage(TrackingNumberSituationQueryCondParam param) {
return Result.success().setData(trackingNumberService.findTrackingNumberSituationByPage(param));
}

@GetMapping("/findTrackingNumberOrderDetails")
@ResponseBody
public Result findTrackingNumberOrderDetails(String id) {
return Result.success().setData(trackingNumberService.findTrackingNumberOrderDetails(id));
}

@GetMapping("/cancelOrder")
@ResponseBody
public Result cancelOrder(String orderId) {
UserAccountDetails user = (UserAccountDetails) SecurityContextHolder.getContext().getAuthentication()
.getPrincipal();
trackingNumberService.cancelOrder(orderId, user.getUserAccountId());
return Result.success();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
import me.zohar.lottery.useraccount.param.AccountChangeLogQueryCondParam;
import me.zohar.lottery.useraccount.param.AddUserAccountParam;
import me.zohar.lottery.useraccount.param.BindBankInfoParam;
import me.zohar.lottery.useraccount.param.LoginLogQueryCondParam;
import me.zohar.lottery.useraccount.param.UserAccountEditParam;
import me.zohar.lottery.useraccount.param.UserAccountQueryCondParam;
import me.zohar.lottery.useraccount.service.LoginLogService;
import me.zohar.lottery.useraccount.service.UserAccountService;
import me.zohar.lottery.useraccount.vo.UserAccountInfoVO;

Expand All @@ -24,13 +26,22 @@ public class UserAccountController {

@Autowired
private UserAccountService userAccountService;


@Autowired
private LoginLogService loginLogService;

@GetMapping("/findLoginLogByPage")
@ResponseBody
public Result findLoginLogByPage(LoginLogQueryCondParam param) {
return Result.success().setData(loginLogService.findLoginLogByPage(param));
}

@GetMapping("/findAccountChangeLogByPage")
@ResponseBody
public Result findAccountChangeLogByPage(AccountChangeLogQueryCondParam param) {
return Result.success().setData(userAccountService.findAccountChangeLogByPage(param));
}

@GetMapping("/findUserAccountDetailsInfoById")
@ResponseBody
public Result findUserAccountDetailsInfoById(String userAccountId) {
Expand Down Expand Up @@ -69,14 +80,14 @@ public Result modifyMoneyPwd(String userAccountId, String newMoneyPwd) {
userAccountService.modifyMoneyPwd(userAccountId, newMoneyPwd);
return Result.success();
}

@PostMapping("/updateUserAccount")
@ResponseBody
public Result updateUserAccount(UserAccountEditParam param) {
userAccountService.updateUserAccount(param);
return Result.success();
}

@GetMapping("/getUserAccountInfo")
@ResponseBody
public Result getUserAccountInfo() {
Expand All @@ -88,20 +99,19 @@ public Result getUserAccountInfo() {
UserAccountInfoVO userAccountInfo = userAccountService.getUserAccountInfo(user.getUserAccountId());
return Result.success().setData(userAccountInfo);
}

@GetMapping("/delUserAccount")
@ResponseBody
public Result delUserAccount(String userAccountId) {
userAccountService.delUserAccount(userAccountId);
return Result.success();
}

@PostMapping("/addUserAccount")
@ResponseBody
public Result addUserAccount(AddUserAccountParam param) {
userAccountService.addUserAccount(param);
return Result.success();
}


}
55 changes: 54 additions & 1 deletion lottery-admin/src/main/resources/static/css/common/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,57 @@ a {
word-wrap: break-word;
text-align: start;
}
/*bootstrap table插件detailView样式end*/
/*bootstrap table插件detailView样式end*/

/*表单详情样式start*/
.form-details-summary-title {
margin-bottom: 20px;
padding-left: 10px;
border-left: 3px solid #3080fe;
}

.form-details-item label {
color: #9a9898;
padding-right: 4px;
}

.form-details-item-highlight {
color: #E37D23 !important;
}

.form-details-table thead th {
border-top: 0;
border-bottom: 0;
text-align: center;
color: #666;
font-size: 14px;
font-weight: normal;
background-color: #dedede;
}

.form-details-table tbody tr {
background-color: #EEEEEE;
}

.form-details-table tr td {
text-align: center;
border-top: 0;
color: #666;
border-bottom: 0;
border-left: 0;
}

.form-details-table .custom-checkbox {
min-height: unset;
padding-left: 0;
}

.form-details-table .custom-checkbox .custom-control-label::before {
background-color: #0000004d;
}

.form-details-table .custom-checkbox .custom-control-input:checked ~.custom-control-label::before
{
background-color: #dc3545;
}
/*表单详情样式end*/
41 changes: 35 additions & 6 deletions lottery-admin/src/main/resources/static/js/betting-record.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ var bettingRecordVM = new Vue({
startTime : dayjs().format('YYYY-MM-DD'),
endTime : dayjs().format('YYYY-MM-DD'),
bettingOrderStateDictItems : [],
state : '',
bettingRecords : []
state : ''
},
computed : {},
created : function() {
Expand Down Expand Up @@ -78,12 +77,12 @@ var bettingRecordVM = new Vue({
cellStyle : {
classes : 'betting-record-order-no'
}
}, {
field : 'bettingTime',
title : '投注时间'
}, {
field : 'gameName',
title : '游戏'
}, {
field : 'bettingTime',
title : '投注时间'
}, {
field : 'issueNum',
title : '期号'
Expand Down Expand Up @@ -114,13 +113,21 @@ var bettingRecordVM = new Vue({
}, {
title : '操作',
formatter : function(value, row, index) {
var btns = [];
if (row.state == '1') {
return '<button type="button" class="change-order-btn btn btn-outline-info btn-sm">改单</button>';
btns.push('<button type="button" class="change-order-btn btn btn-outline-info btn-sm" style="margin-right: 4px;">改单</button>');
}
if (row.cancelOrderFlag) {
btns.push('<button type="button" class="cancel-order-btn btn btn-outline-danger btn-sm" style="margin-right: 4px;">撤单</button>');
}
return btns.join('');
},
events : {
'click .change-order-btn' : function(event, value, row, index) {
changeOrderModalVM.show(row.id, row.gameCode);
},
'click .cancel-order-btn' : function(event, value, row, index) {
that.cancelOrder(row.id);
}
}
} ],
Expand All @@ -135,6 +142,28 @@ var bettingRecordVM = new Vue({
$('.betting-record-table').bootstrapTable('refreshOptions', {
pageNumber : 1
});
},

cancelOrder : function(orderId) {
var that = this;
layer.confirm('确定要撤单吗?', {
icon : 7,
title : '提示'
}, function(index) {
layer.close(index);
that.$http.get('/betting/cancelOrder', {
params : {
orderId : orderId
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.refreshTable();
});
});
}
}
});
Loading

0 comments on commit 40505fc

Please sign in to comment.