generated from root/miduo_server
订单列表添加渠道包查询
parent
7abc044d0c
commit
e6c2661110
|
|
@ -2,7 +2,9 @@ package com.jmfy.controller;
|
|||
|
||||
import com.jmfy.WebSecurityConfig;
|
||||
import com.jmfy.dao.CUserDao;
|
||||
import com.jmfy.dao.ChannelInfoDao;
|
||||
import com.jmfy.model.CAdmin;
|
||||
import com.jmfy.model.ChannelInfo;
|
||||
import com.jmfy.model.vo.IdentityEnum;
|
||||
import com.jmfy.model.vo.IdentityVo;
|
||||
import com.jmfy.model.vo.PowersEnum;
|
||||
|
|
@ -18,6 +20,7 @@ import javax.annotation.Resource;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by huangds on 2017/10/24.
|
||||
|
|
@ -26,6 +29,8 @@ import java.util.*;
|
|||
public class LoginController {
|
||||
@Resource
|
||||
private CUserDao cUserDao;
|
||||
@Resource
|
||||
private ChannelInfoDao channelInfoDao;
|
||||
|
||||
static final String ROOT = "root";
|
||||
|
||||
|
|
@ -96,9 +101,16 @@ public class LoginController {
|
|||
*/
|
||||
private void rootAccount(CAdmin admin) throws Exception {
|
||||
if (ROOT.equals(admin.getUserName())){
|
||||
// 权限
|
||||
Set<Integer> allPowers = PowersEnum.getAllPowers();
|
||||
// 渠道包
|
||||
List<ChannelInfo> infoList = channelInfoDao.getChannelInfoList();
|
||||
Set<String> collect = infoList.stream().map(ChannelInfo::getId).collect(Collectors.toSet());
|
||||
|
||||
// 赋予root账号全部权限
|
||||
admin.setPowers(allPowers);
|
||||
admin.setChannelPack(collect);
|
||||
|
||||
// 赋予root账号总管理员权限
|
||||
admin.setIdentity(IdentityEnum.SYSTEM_ADMIN.getId());
|
||||
cUserDao.updateUser(admin);
|
||||
|
|
@ -300,6 +312,40 @@ public class LoginController {
|
|||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户权限
|
||||
* @param request
|
||||
* @return
|
||||
* 0: 用户找不到
|
||||
* 1: 成功
|
||||
* 2: root账号不能修改
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/updateUserChannelPack", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public @ResponseBody int updateUserChannelPack(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String id = parameterMap.get("id");
|
||||
String[] packs = request.getParameterValues("pack[]");
|
||||
// 查找用户
|
||||
CAdmin cAdmin = cUserDao.findAdminById(id);
|
||||
if (cAdmin == null){
|
||||
return 0;
|
||||
}
|
||||
// 系统管理员账号不允许修改权限,默认拥有全部权限
|
||||
if (cAdmin.getUserName().equals(ROOT)){
|
||||
return 2;
|
||||
}
|
||||
TreeSet<String> set = new TreeSet<>();
|
||||
if (packs != null){
|
||||
// string数组转treeSet
|
||||
set.addAll(Arrays.asList(packs));
|
||||
}
|
||||
cAdmin.setChannelPack(set);
|
||||
// 修改
|
||||
cUserDao.updateUser(cAdmin);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户权限
|
||||
* @param map
|
||||
|
|
@ -324,6 +370,34 @@ public class LoginController {
|
|||
return "permission-setting";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户渠道包权限
|
||||
* @param map
|
||||
* @param request
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value ="/getUserChannelPack",method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public String getUserChannelPack(ModelMap map,HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
|
||||
String id = parameterMap.get("id");
|
||||
map.addAttribute("id",id);
|
||||
|
||||
// 赋予者的权限列表
|
||||
String userName = (String) request.getSession().getAttribute("username");
|
||||
CAdmin admin = cUserDao.findAdmin(userName);
|
||||
List<ChannelInfo> ids = channelInfoDao.getChannelInfoListByIds(admin.getChannelPack());
|
||||
map.addAttribute("channelPack", ids);
|
||||
|
||||
// 被赋予者的权限列表
|
||||
CAdmin cAdmin = cUserDao.findAdminById(id);
|
||||
List<ChannelInfo> ids1 = channelInfoDao.getChannelInfoListByIds(cAdmin.getChannelPack());
|
||||
request.setAttribute("channelPack2", ids1);
|
||||
|
||||
return "channelPack-setting";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
* @param request
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.jmfy.controller;
|
|||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.WebSecurityConfig;
|
||||
import com.jmfy.dao.*;
|
||||
import com.jmfy.model.*;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
|
|
@ -42,6 +43,8 @@ public class OrderInfoController {
|
|||
private GSUserDao gsUserDao;
|
||||
@Resource
|
||||
private ChannelInfoDao channelInfoDao;
|
||||
@Resource
|
||||
private CUserDao cUserDao;
|
||||
|
||||
@Resource
|
||||
private ServerInfoDao serverInfoDao;
|
||||
|
|
@ -54,6 +57,7 @@ public class OrderInfoController {
|
|||
long endTime = JsonUtil.getAppointTimeInXDay(Long.parseLong(JsonUtil.date3TimeStamp(request.getParameter("endTime"))), 0);
|
||||
int serverId1 = Integer.valueOf(parameterMap.get("serverId"));
|
||||
String userId = parameterMap.get("userId");
|
||||
String packId = parameterMap.get("packId");
|
||||
String startData = JsonUtil.timeStamp2Date(String.valueOf(startTime));
|
||||
|
||||
List<String> days = JsonUtil.getDays(startData,JsonUtil.timeStamp2Date(String.valueOf(endTime)));
|
||||
|
|
@ -71,11 +75,15 @@ public class OrderInfoController {
|
|||
Map<String, CGPayOrder> map1 = RedisUtil.getInstence().getMap(RedisUserKey.C_PAYORDER_MAP + ":" + date, CGPayOrder.class, -1);
|
||||
for (Map.Entry<String,CGPayOrder> entry: map1.entrySet()){
|
||||
CGPayOrder cgPayOrder = entry.getValue();
|
||||
String accountid = cgPayOrder.getUserId();
|
||||
int serverId = cgPayOrder.getServerId();
|
||||
if(serverId1 != 0 && serverId1 != serverId) {
|
||||
continue;
|
||||
}
|
||||
String ccId = cgPayOrder.getCc_id();
|
||||
if (ccId != null && !ccId.equals(packId)){
|
||||
continue;
|
||||
}
|
||||
String accountid = cgPayOrder.getUserId();
|
||||
if (userInfo!=null &&!accountid.equals(userInfo.getId())){
|
||||
continue;
|
||||
}
|
||||
|
|
@ -97,6 +105,8 @@ public class OrderInfoController {
|
|||
corder.setPayTime(payTime);
|
||||
corder.setProductid(cgPayOrder.getGoodsId());
|
||||
corder.setServerId(String.valueOf(serverId));
|
||||
corder.setPaySdk(cgPayOrder.getPaySdk());
|
||||
corder.setPlatform(cgPayOrder.getPlatform());
|
||||
|
||||
SRechargeCommodityConfig config;
|
||||
int goodsId;
|
||||
|
|
@ -135,8 +145,8 @@ public class OrderInfoController {
|
|||
corder.setOpenId(gsUser.getPlayerManager().getOpenId());
|
||||
}
|
||||
|
||||
ChannelInfo infoById = channelInfoDao.getChannelInfoById(cgPayOrder.getCc_id());
|
||||
corder.setCc_id(Optional.ofNullable(infoById).map(ChannelInfo::getName).orElse(cgPayOrder.getCc_id()));
|
||||
ChannelInfo infoById = channelInfoDao.getChannelInfoById(ccId);
|
||||
corder.setCc_id(Optional.ofNullable(infoById).map(ChannelInfo::getName).orElse(ccId));
|
||||
|
||||
cgPayOrders.add(corder);
|
||||
}
|
||||
|
|
@ -187,6 +197,8 @@ public class OrderInfoController {
|
|||
corder.setPayTime(payTime);
|
||||
corder.setProductid(cgPayOrder.getGoodsId());
|
||||
corder.setServerId(String.valueOf(serverId));
|
||||
corder.setPaySdk(cgPayOrder.getPaySdk());
|
||||
corder.setPlatform(cgPayOrder.getPlatform());
|
||||
|
||||
SRechargeCommodityConfig config;
|
||||
int goodsId;
|
||||
|
|
@ -379,13 +391,20 @@ public class OrderInfoController {
|
|||
}
|
||||
return JSON.parseObject(sb.toString());
|
||||
}
|
||||
|
||||
@RequestMapping(value = "toOrderPage",method = RequestMethod.GET)
|
||||
public String toOrderPage(ModelMap map){
|
||||
public String toOrderPage(ModelMap map,HttpSession session){
|
||||
String account = (String) session.getAttribute(WebSecurityConfig.SESSION_KEY);
|
||||
try {
|
||||
List<ServerInfo> allServerInfo = serverInfoDao.getAllServerInfo();
|
||||
List<gameName> allGameName =serverInfoDao.getAllGameInfo();
|
||||
map.addAttribute("serverInfo",allServerInfo);
|
||||
|
||||
List<gameName> allGameName =serverInfoDao.getAllGameInfo();
|
||||
map.addAttribute("allGameName",allGameName);
|
||||
|
||||
CAdmin admin = cUserDao.findAdmin(account);
|
||||
List<ChannelInfo> infos = channelInfoDao.getChannelInfoListByIds(admin.getChannelPack());
|
||||
map.addAttribute("channelPackInfo",infos);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ package com.jmfy.dao;
|
|||
import com.jmfy.model.ChannelInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public interface ChannelInfoDao {
|
||||
|
||||
|
|
@ -17,6 +18,13 @@ public interface ChannelInfoDao {
|
|||
*/
|
||||
List<ChannelInfo> getChannelInfoList() throws Exception;
|
||||
|
||||
/**
|
||||
* 获取全部
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<ChannelInfo> getChannelInfoListByIds(Set<String> ids) throws Exception;
|
||||
|
||||
/**
|
||||
* 单个查询,id
|
||||
* @param id
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public class CUserDaoImpl implements CUserDao {
|
|||
update.set("identity", cAdmin.getIdentity());
|
||||
update.set("subAccount", cAdmin.getSubAccount());
|
||||
update.set("power", cAdmin.getPowers());
|
||||
update.set("channelPack", cAdmin.getChannelPack());
|
||||
mongoTemplate.updateFirst(query,update,CAdmin.class);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ import org.springframework.data.mongodb.core.query.Query;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Component
|
||||
public class ChannelInfoDaoImpl implements ChannelInfoDao {
|
||||
|
|
@ -28,6 +30,13 @@ public class ChannelInfoDaoImpl implements ChannelInfoDao {
|
|||
return mongoTemplate.find(query, ChannelInfo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ChannelInfo> getChannelInfoListByIds(Set<String> ids) throws Exception {
|
||||
List<ChannelInfo> infoList = getChannelInfoList();
|
||||
infoList.removeIf(v->!ids.contains(v.getId()));
|
||||
return infoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelInfo getChannelInfoById(String id) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ public class CAdmin {
|
|||
*/
|
||||
@Field(value = "power")
|
||||
private Set<Integer> powers = new TreeSet<>();
|
||||
/**
|
||||
* 渠道包
|
||||
*/
|
||||
@Field(value = "channelPack")
|
||||
private Set<String> channelPack = new TreeSet<>();
|
||||
|
||||
/********************************************* setter and getter ***********************************************/
|
||||
|
||||
|
|
@ -115,4 +120,12 @@ public class CAdmin {
|
|||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Set<String> getChannelPack() {
|
||||
return channelPack;
|
||||
}
|
||||
|
||||
public void setChannelPack(Set<String> channelPack) {
|
||||
this.channelPack = channelPack;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,17 @@ public class CGPayOrder {
|
|||
@Field(value = "cc_id")
|
||||
private String cc_id;
|
||||
|
||||
/**
|
||||
* 支付sdk
|
||||
*/
|
||||
@Field(value = "pay_sdk")
|
||||
private String paySdk;
|
||||
|
||||
/**
|
||||
* 平台 Android or ios
|
||||
*/
|
||||
@Field(value = "platform")
|
||||
private String platform;
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
|
|
@ -142,4 +153,20 @@ public class CGPayOrder {
|
|||
public void setCc_id(String cc_id) {
|
||||
this.cc_id = cc_id;
|
||||
}
|
||||
|
||||
public String getPaySdk() {
|
||||
return paySdk;
|
||||
}
|
||||
|
||||
public void setPaySdk(String paySdk) {
|
||||
this.paySdk = paySdk;
|
||||
}
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ public class Corder {
|
|||
private String cc_id;
|
||||
@Fields("账号id")
|
||||
private String openId;
|
||||
@Fields(value = "支付sdk")
|
||||
private String paySdk;
|
||||
@Fields(value = "平台")
|
||||
private String platform;
|
||||
|
||||
public String getAccountid() {
|
||||
return accountid;
|
||||
|
|
@ -144,4 +148,20 @@ public class Corder {
|
|||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public String getPaySdk() {
|
||||
return paySdk;
|
||||
}
|
||||
|
||||
public void setPaySdk(String paySdk) {
|
||||
this.paySdk = paySdk;
|
||||
}
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body {
|
||||
/*background-color: #E4E1EA;*/
|
||||
font: normal 17px/1.5 Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
|
||||
color: #5E5F63;
|
||||
}
|
||||
.wrapper {
|
||||
width: 200px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
p {
|
||||
margin: 15px 0 5px 0;
|
||||
}
|
||||
li span {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
.radio-btn input[type="radio"], .check-box input[type="checkbox"] {
|
||||
visibility: hidden;
|
||||
}
|
||||
/*Custom checkbox*/
|
||||
.check-box {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
margin: 2px 7px 0 0;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 0 1px #ccc;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
background: rgb(255, 255, 255);
|
||||
background: -moz-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(47%, rgba(246, 246, 246, 1)), color-stop(100%, rgba(237, 237, 237, 1)));
|
||||
background: -webkit-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
background: -o-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
background: -ms-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed', GradientType=0);
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
.check-box i {
|
||||
background: url('../images/check_mark.png') no-repeat center center;
|
||||
position: absolute;
|
||||
left: 3px;
|
||||
bottom: -15px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
opacity: .5;
|
||||
-webkit-transition: all 400ms ease-in-out;
|
||||
-moz-transition: all 400ms ease-in-out;
|
||||
-o-transition: all 400ms ease-in-out;
|
||||
transition: all 400ms ease-in-out;
|
||||
-webkit-transform:rotateZ(-180deg);
|
||||
-moz-transform:rotateZ(-180deg);
|
||||
-o-transform:rotateZ(-180deg);
|
||||
transform:rotateZ(-180deg);
|
||||
}
|
||||
.checkedBox {
|
||||
-moz-box-shadow: inset 0 0 5px 1px #ccc;
|
||||
-webkit-box-shadow: inset 0 0 5px 1px #ccc;
|
||||
box-shadow: inset 0 0 5px 1px #ccc;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.checkedBox i {
|
||||
bottom: 2px;
|
||||
-webkit-transform:rotateZ(0deg);
|
||||
-moz-transform:rotateZ(0deg);
|
||||
-o-transform:rotateZ(0deg);
|
||||
transform:rotateZ(0deg);
|
||||
}
|
||||
/*Custom radio button*/
|
||||
.radio-btn {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
margin: 3px 7px 0 0;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
-webkit-border-radius: 100%;
|
||||
-moz-border-radius: 100%;
|
||||
border-radius: 100%;
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 0 0 1px #ccc;
|
||||
background: rgb(255, 255, 255);
|
||||
background: -moz-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(47%, rgba(246, 246, 246, 1)), color-stop(100%, rgba(237, 237, 237, 1)));
|
||||
background: -webkit-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
background: -o-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
background: -ms-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(246, 246, 246, 1) 47%, rgba(237, 237, 237, 1) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed', GradientType=0);
|
||||
}
|
||||
.checkedRadio {
|
||||
-moz-box-shadow: inset 0 0 5px 1px #ccc;
|
||||
-webkit-box-shadow: inset 0 0 5px 1px #ccc;
|
||||
box-shadow: inset 0 0 5px 1px #ccc;
|
||||
}
|
||||
.radio-btn i {
|
||||
border: 1px solid #E1E2E4;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
top: 4px;
|
||||
-webkit-border-radius: 100%;
|
||||
-moz-border-radius: 100%;
|
||||
border-radius: 100%;
|
||||
}
|
||||
.checkedRadio i {
|
||||
background-color: #898A8C;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 291 B |
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
Custom checkbox and radio button - Jun 18, 2013
|
||||
(c) 2013 @ElmahdiMahmoud
|
||||
license: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
// radio
|
||||
$('input[name="radio-btn"]').wrap('<div class="radio-btn"><i></i></div>');
|
||||
$(".radio-btn").on('click', function () {
|
||||
var _this = $(this),
|
||||
block = _this.parent().parent();
|
||||
block.find('input:radio').attr('checked', false);
|
||||
block.find(".radio-btn").removeClass('checkedRadio');
|
||||
_this.addClass('checkedRadio');
|
||||
_this.find('input:radio').attr('checked', true);
|
||||
});
|
||||
|
||||
// checkbox
|
||||
$('input[name="check-box"]').wrap('<div class="check-box"><i></i></div>');
|
||||
$.fn.toggleCheckbox = function () {
|
||||
this.attr('checked', !this.attr('checked'));
|
||||
};
|
||||
|
||||
$('.check-box').on('click', function () {
|
||||
$(this).find(':checkbox').toggleCheckbox();
|
||||
$(this).toggleClass('checkedBox');
|
||||
});
|
||||
|
||||
function checkClick(id) {
|
||||
var e = document.createEvent("MouseEvents");
|
||||
e.initEvent("click", true, true);
|
||||
document.getElementById(id).dispatchEvent(e); //只要id 就好
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,116 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="viewport"
|
||||
content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
||||
<link rel="Bookmark" href="/favicon.ico"/>
|
||||
<link rel="Shortcut Icon" href="/favicon.ico"/>
|
||||
<!--[if lt IE 9]>
|
||||
<script type="text/javascript" src="lib/html5shiv.js"></script>
|
||||
<script type="text/javascript" src="lib/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!-- 多选框 -->
|
||||
<link rel="stylesheet" type="text/css" href="../static/checkbox/css/style.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../static/checkbox/css/reset.css"/>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../static/lib/Hui-iconfont/1.0.8/iconfont.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin"/>
|
||||
<!-- <link rel="stylesheet" type="text/css" href="h-ui.admin/css/style.css"/>-->
|
||||
<!--[if IE 6]>
|
||||
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
|
||||
<script>DD_belatedPNG.fix('*');</script>
|
||||
<![endif]-->
|
||||
<title>用户渠道包设置</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-container">
|
||||
<div style="text-align: center">
|
||||
<h2><span style="color:red;">用户渠道包设置</span></h2>
|
||||
</div>
|
||||
<form class="form form-horizontal" id="form-article-add" method="post">
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<div th:each="list:${channelPack}" style="margin:0 0 10px 100px;">
|
||||
<li style="list-style: none">
|
||||
<input type="checkbox" th:name="check-box" th:id="${list.getId()}"/>
|
||||
<span style="font-size: 16px;" th:text="${list.getName()}"></span>
|
||||
</li>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" class="btn btn-success" style="margin: 0 0 30px 100px;" onclick="return updateChannelPackPower()" >保存设置</button>
|
||||
<a class="btn btn-primary radius" href="/findMemberList" style="margin-bottom: 30px">取消设置</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--_footer 作为公共模版分离出去-->
|
||||
<script type="text/javascript" src="../static/lib/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/layer/2.4/layer.js"></script>
|
||||
<script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
|
||||
|
||||
<!--请在下方写此页面业务相关的脚本-->
|
||||
<script type="text/javascript" src="../static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
|
||||
|
||||
<!-- 多选框 -->
|
||||
<script type="text/javascript" src="../static/checkbox/js/checkbox.js"></script>
|
||||
<script type="text/javascript" src="../static/checkbox/js/prefixfree.min.js"></script>
|
||||
<script th:inline="javascript">
|
||||
//当页面加载完成的时候,自动调用该方法
|
||||
window.onload = function () {
|
||||
//获得所要回显的值,此处为:100,1001,200,1400
|
||||
var checkeds = [[${channelPack2}]];
|
||||
//拆分为字符串数组
|
||||
$('[name="check-box"]').each(function(){
|
||||
for (var i = 0; i < checkeds.length; i++) {
|
||||
var webId = $(this).attr("id");
|
||||
var backId = checkeds[i].id;
|
||||
if (webId == backId){
|
||||
// $(this).find(':checkbox').toggleCheckbox();
|
||||
checkClick(webId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 修改权限
|
||||
function updateChannelPackPower() {
|
||||
var id = [[${id}]];
|
||||
var strSel = [];
|
||||
$("[name='check-box'][checked]").each(function () {
|
||||
strSel.push($(this).attr("id"));
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {
|
||||
"id": id,
|
||||
"pack[]": strSel
|
||||
},
|
||||
url: "/updateUserChannelPack",
|
||||
success: function (data) {
|
||||
if (data === 1) {
|
||||
window.location.href = '/findMemberList'
|
||||
}
|
||||
if (data === 0) {
|
||||
layer.msg('用户不存在,修改失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data === 2) {
|
||||
layer.msg('root账号默认拥有全部权限,不能修改!', {icon: 6, time: 1000});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -69,6 +69,16 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-2">
|
||||
<span class="c-red">*</span>
|
||||
游戏名称:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<select name="packId" class="input-text" id="packId"><!--下拉列表-->
|
||||
<option th:each="pack:${channelPackInfo}" th:value="${pack.id}" th:text="${pack.name}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-2">
|
||||
<span class="c-red"></span>
|
||||
|
|
@ -123,25 +133,29 @@
|
|||
});
|
||||
function findFlow() {
|
||||
var erroCode = $('.SERVERID');
|
||||
var serverId = $("#serverId").val();
|
||||
var startTime = $("input[name='startTime']").val();
|
||||
var endTime = $("input[name='endTime']").val();
|
||||
if (serverId === '' || serverId == null) {
|
||||
erroCode = $('.SERVERId');
|
||||
erroCode.html('<span style="color: red; ">区服id不能为空!</span>');
|
||||
|
||||
var serverId = $("#serverId").val();
|
||||
if (serverId === '' || serverId == null) {
|
||||
alert("区服id不能为空!!");
|
||||
return false;
|
||||
}
|
||||
|
||||
var startTime = $("input[name='startTime']").val();
|
||||
if (startTime === '' || startTime == null) {
|
||||
erroCode = $('.STARTTIME');
|
||||
erroCode.html('<span style="color: red; ">开始时间不能为空!</span>');
|
||||
return false;
|
||||
}
|
||||
var endTime = $("input[name='endTime']").val();
|
||||
if (endTime === '' || endTime == null) {
|
||||
erroCode = $('.ENDTIME');
|
||||
erroCode.html('<span style="color: red; ">结束时间不能为空!</span>');
|
||||
return false;
|
||||
}
|
||||
var packId = $("#packId").val();
|
||||
if (packId === '' || packId == null) {
|
||||
alert("游戏名称不能为空!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
onclick="return updateUserPower(this)"><i class="Hui-iconfont"></i>权限设置
|
||||
</button>
|
||||
<button type="button" th:id="${obj.id}" class="btn btn-primary"
|
||||
onclick="return districtServerPower()"><i class="Hui-iconfont"></i>区服权限
|
||||
onclick="return districtServerPower(this)"><i class="Hui-iconfont"></i>区服权限
|
||||
</button>
|
||||
<button type="button" th:id="${obj.id}" class="btn btn-primary"
|
||||
onclick="return deleteUser(this)"><i class="Hui-iconfont"></i>删除
|
||||
|
|
@ -154,8 +154,9 @@
|
|||
}
|
||||
|
||||
// 区服权限
|
||||
function districtServerPower(){
|
||||
alert("当前功能暂未完善,无法使用!")
|
||||
function districtServerPower(obj){
|
||||
var userId = $(obj).attr("id");
|
||||
location.href = "/getUserChannelPack?" + "id=" + encodeURI(userId);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@
|
|||
<th width="200">CC值</th>
|
||||
<th width="200">注册时间</th>
|
||||
<th width="200">账号id</th>
|
||||
<th width="200">平台</th>
|
||||
<th width="200">支付方式</th>
|
||||
<!--<th width="240">操作</th>-->
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -75,6 +77,8 @@
|
|||
<td th:text="${obj.cc_id}" style="text-align: center;"></td>
|
||||
<td th:text="${obj.registerTime}" style="text-align: center;"></td>
|
||||
<td th:text="${obj.openId}" style="text-align: center;"></td>
|
||||
<td th:text="${obj.platform}" style="text-align: center;"></td>
|
||||
<td th:text="${obj.paySdk}" style="text-align: center;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Reference in New Issue