Merge branch 'jieling' of http://60.1.1.230/backend/gm_tw_admin into jieling

master
lvxinran 2019-09-12 18:49:17 +08:00
commit f0033efaa5
10 changed files with 133 additions and 67 deletions

View File

@ -2,6 +2,7 @@ package com.jmfy.controller;
import com.jmfy.dao.CdkInfoDao; import com.jmfy.dao.CdkInfoDao;
import com.jmfy.dao.UserInfoDao; import com.jmfy.dao.UserInfoDao;
import com.jmfy.dao.impl.GSUserDaoImpl;
import com.jmfy.model.*; import com.jmfy.model.*;
import com.jmfy.model.vo.CDKInfoVo; import com.jmfy.model.vo.CDKInfoVo;
import com.jmfy.model.vo.UseCDKInfoVo; import com.jmfy.model.vo.UseCDKInfoVo;
@ -22,18 +23,18 @@ import javax.servlet.http.HttpSession;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
/**
* Created by huangds on 2017/10/24.
*/
@Controller @Controller
public class CdkInfoController { public class CdkInfoController {
@Resource @Resource
private CdkInfoDao cdkInfoDao; private CdkInfoDao cdkInfoDao;
@Resource @Resource
private UserInfoDao userInfoDao; private GSUserDaoImpl gsUserDao;
@Resource @Resource
private SeqUtils seqUtils; private SeqUtils seqUtils;
/**
*
*/
@RequestMapping(value = "/addCdkNumber", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/addCdkNumber", method = {RequestMethod.POST, RequestMethod.GET})
public @ResponseBody int addCdkNumber(HttpSession session, ModelMap map , HttpServletRequest request) throws Exception { public @ResponseBody int addCdkNumber(HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request); HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
@ -51,7 +52,7 @@ public class CdkInfoController {
} }
for (int i = 0; i < scdkInfo.getGoodsSum(); i++) { for (int i = 0; i < scdkInfo.getGoodsSum(); i++) {
long nowTime = System.currentTimeMillis(); long nowTime = System.currentTimeMillis();
String sdk = "YSJCDK" + goodsId + nowTime + UUID.randomUUID().toString(); String sdk = "JLCDK" + goodsId + nowTime + UUID.randomUUID().toString();
String id = MD5Util.encrypByMd5(sdk); String id = MD5Util.encrypByMd5(sdk);
CdkInfo cdkInfo = new CdkInfo(); CdkInfo cdkInfo = new CdkInfo();
cdkInfo.setId(id); cdkInfo.setId(id);
@ -63,6 +64,7 @@ public class CdkInfoController {
cdkInfoDao.updateCdkGoodsInfo(scdkInfo,goodsId); cdkInfoDao.updateCdkGoodsInfo(scdkInfo,goodsId);
return 0; return 0;
} }
@RequestMapping(value = "/findCdkInfo", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/findCdkInfo", method = {RequestMethod.POST, RequestMethod.GET})
public String findCdkInfo (HttpSession session, ModelMap map , HttpServletRequest request) throws Exception { public String findCdkInfo (HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request); HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
@ -70,11 +72,11 @@ public class CdkInfoController {
String cdkNum = parameterMap.get("cdkNum"); String cdkNum = parameterMap.get("cdkNum");
CdkInfo cdkInfo = cdkInfoDao.findCdkInfoBuyId(cdkNum); CdkInfo cdkInfo = cdkInfoDao.findCdkInfoBuyId(cdkNum);
if (cdkInfo == null){ if (cdkInfo == null){
return "404"; return "useCDKinfo";
} }
SCdkInfo scdkInfo = cdkInfoDao.getScdkInfo(cdkInfo.getGoodsId()); SCdkInfo scdkInfo = cdkInfoDao.getScdkInfo(cdkInfo.getGoodsId());
if (scdkInfo == null){ if (scdkInfo == null){
return "404"; return "useCDKinfo";
} }
List<CdkUseInfo> cdkUseInfoList = cdkInfoDao.findCdkUseInfoById(serverId,cdkNum); List<CdkUseInfo> cdkUseInfoList = cdkInfoDao.findCdkUseInfoById(serverId,cdkNum);
List<UseCDKInfoVo> useCDKInfoVoList = new ArrayList<>(); List<UseCDKInfoVo> useCDKInfoVoList = new ArrayList<>();
@ -82,10 +84,9 @@ public class CdkInfoController {
UseCDKInfoVo useCDKInfoVo = new UseCDKInfoVo(); UseCDKInfoVo useCDKInfoVo = new UseCDKInfoVo();
useCDKInfoVo.setIsData(1); useCDKInfoVo.setIsData(1);
useCDKInfoVo.setUserId(cdkUseInfo.getUid()); useCDKInfoVo.setUserId(cdkUseInfo.getUid());
CUser cUser = userInfoDao.findCuserInfo(cdkUseInfo.getServerId(), cdkUseInfo.getUid()); GSUser gsUser = gsUserDao.findUserInfo(cdkUseInfo.getServerId(), cdkUseInfo.getUid());
useCDKInfoVo.setUserName(cUser.getUserName()); useCDKInfoVo.setUserName(gsUser.getPlayerManager().getNickName());
CUserInfo cUserInfo = userInfoDao.findUserInfoByUserId(cdkUseInfo.getUid()); useCDKInfoVo.setOpenId(gsUser.getPlayerManager().getOpenId());
useCDKInfoVo.setOpenId(cUserInfo.getOpenId());
useCDKInfoVo.setGoodsName(scdkInfo.getGoodsName()); useCDKInfoVo.setGoodsName(scdkInfo.getGoodsName());
useCDKInfoVo.setUseTime(JsonUtil.timeStamp2Date(String.valueOf(cdkUseInfo.getCreateTime()))); useCDKInfoVo.setUseTime(JsonUtil.timeStamp2Date(String.valueOf(cdkUseInfo.getCreateTime())));
useCDKInfoVoList.add(useCDKInfoVo); useCDKInfoVoList.add(useCDKInfoVo);
@ -93,6 +94,10 @@ public class CdkInfoController {
map.put("useCDKinfo",useCDKInfoVoList); map.put("useCDKinfo",useCDKInfoVoList);
return "useCDKinfo"; return "useCDKinfo";
} }
/**
*
*/
@RequestMapping(value = "/toCDKBuild", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/toCDKBuild", method = {RequestMethod.POST, RequestMethod.GET})
public String toCDKBuild (HttpSession session, ModelMap map , HttpServletRequest request) throws Exception { public String toCDKBuild (HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
List<SCdkInfo> sCdkInfoList = cdkInfoDao.getScdkInfoList(); List<SCdkInfo> sCdkInfoList = cdkInfoDao.getScdkInfoList();
@ -108,22 +113,15 @@ public class CdkInfoController {
cdkInfoVo.setGoodsNum(sCdkInfo.getGoodsSum()); cdkInfoVo.setGoodsNum(sCdkInfo.getGoodsSum());
long useNum = cdkInfoDao.getUseCdkNumByGoodsId(sCdkInfo.getId()); long useNum = cdkInfoDao.getUseCdkNumByGoodsId(sCdkInfo.getId());
cdkInfoVo.setUseNum(useNum); cdkInfoVo.setUseNum(useNum);
cdkInfoVo.setType(getUsetype(sCdkInfo)); cdkInfoVo.setType(String.valueOf(sCdkInfo.getUsetype()));
cdkInfoVo.setPid(sCdkInfo.getPid());
cdkInfoVo.setRoleUseNum(sCdkInfo.getRoleUseNum());
sCdkInfoListVo.add(cdkInfoVo); sCdkInfoListVo.add(cdkInfoVo);
} }
map.put("sCdkInfoList",sCdkInfoListVo); map.put("sCdkInfoList",sCdkInfoListVo);
return "CDKBuild"; return "CDKBuild";
} }
private String getUsetype(SCdkInfo sCdkInfo) {
String type = "C";
if (sCdkInfo.getUsetype() ==0){
type = "A";
}else if (sCdkInfo.getUsetype() ==1){
type = "B";
}
return type ;
}
@RequestMapping(value = "/downloadFile", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/downloadFile", method = {RequestMethod.POST, RequestMethod.GET})
public ResponseEntity<byte[]> downloadFile (HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception { public ResponseEntity<byte[]> downloadFile (HttpSession session, HttpServletRequest request, HttpServletResponse response) throws Exception {
@ -146,9 +144,15 @@ public class CdkInfoController {
File file = new File(path); File file = new File(path);
return TXTUtils.buildResponseEntity(file); return TXTUtils.buildResponseEntity(file);
} }
/**
*
*/
@RequestMapping(value = "/addCdkGoodsInfo", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/addCdkGoodsInfo", method = {RequestMethod.POST, RequestMethod.GET})
public String addCdkGoodsInfo(HttpSession session, ModelMap map , HttpServletRequest request) throws Exception { public String addCdkGoodsInfo(HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request); HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
String pid = parameterMap.get("pid");
String roleUseNum = parameterMap.get("roleUseNum");
String goodsName = parameterMap.get("goodsName"); String goodsName = parameterMap.get("goodsName");
String addType = parameterMap.get("addType"); String addType = parameterMap.get("addType");
String goodsNum = parameterMap.get("goodsNum"); String goodsNum = parameterMap.get("goodsNum");
@ -169,6 +173,8 @@ public class CdkInfoController {
sCdkInfo.setStartTime(Long.parseLong(startTime)); sCdkInfo.setStartTime(Long.parseLong(startTime));
sCdkInfo.setEndTime(Long.parseLong(endTime)); sCdkInfo.setEndTime(Long.parseLong(endTime));
sCdkInfo.setIsAdd(0); sCdkInfo.setIsAdd(0);
sCdkInfo.setPid(Integer.parseInt(pid));
sCdkInfo.setRoleUseNum(Integer.parseInt(roleUseNum));
cdkInfoDao.addCDKGoodsInfo(sCdkInfo); cdkInfoDao.addCDKGoodsInfo(sCdkInfo);
return "redirect:/toCDKBuild"; return "redirect:/toCDKBuild";
} }

View File

@ -40,8 +40,7 @@ public class QuestionController {
private static final DateFormat ymdhmsFormat_new = new SimpleDateFormat("yyyyMMddHHmm"); private static final DateFormat ymdhmsFormat_new = new SimpleDateFormat("yyyyMMddHHmm");
@RequestMapping(value = "/updataQuest", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/updataQuest", method = {RequestMethod.POST, RequestMethod.GET})
public @ResponseBody public @ResponseBody int sendNotice(HttpSession session, HttpServletRequest request) throws Exception {
int sendNotice(HttpSession session, HttpServletRequest request) throws Exception {
List<ServerInfo> allServerInfo = serverInfoDao.getAllServerInfo(); List<ServerInfo> allServerInfo = serverInfoDao.getAllServerInfo();
List<String> serverList = new ArrayList<>(); List<String> serverList = new ArrayList<>();
@ -112,18 +111,14 @@ public class QuestionController {
return null; return null;
} }
for (int i = 0; i < questions.length; i++) { for (int i = 0; i < questions.length; i++) {
if (questiontype[i].equals("2")) { int j = i + 1;
continue; String index = "questiontype_" + j + "_select";
} else { CQuestionOptionBean cQuestionOptionBean = new CQuestionOptionBean();
int j = i + 1; cQuestionOptionBean.setType(Integer.valueOf(questiontype[i]));
String index = "questiontype_" + j + "_select"; cQuestionOptionBean.setAnswerType(Integer.valueOf(answertype[i]));
CQuestionOptionBean cQuestionOptionBean = new CQuestionOptionBean(); cQuestionOptionBean.setContent(questions[i]);
cQuestionOptionBean.setType(Integer.valueOf(questiontype[i])); cQuestionOptionBean.setOptions(paramMap.get(index));
cQuestionOptionBean.setAnswerType(Integer.valueOf(answertype[i])); cQuestion.getcQuestionOptionBeans().add(cQuestionOptionBean);
cQuestionOptionBean.setContent(questions[i]);
cQuestionOptionBean.setOptions(paramMap.get(index));
cQuestion.getcQuestionOptionBeans().add(cQuestionOptionBean);
}
} }
return cQuestion; return cQuestion;
} }

View File

@ -9,13 +9,18 @@ public class SCdkInfo {
@Id @Id
private int id; //所属的商品id private int id; //所属的商品id
/** /**
* 0: * 0:
* 1: * 1:
* 2: 使
*/ */
@Field(value = "usetype") @Field(value = "usetype")
private int usetype; private int usetype;
@Field(value = "pid")
private int pid;
@Field(value = "role_use_num")
private int roleUseNum;
@Field(value = "start_time") @Field(value = "start_time")
private long startTime; private long startTime;
@ -44,6 +49,7 @@ public class SCdkInfo {
public void setId(int id) { public void setId(int id) {
this.id = id; this.id = id;
} }
public int getUsetype() { public int getUsetype() {
return usetype; return usetype;
} }
@ -107,5 +113,21 @@ public class SCdkInfo {
public void setIsAdd(int isAdd) { public void setIsAdd(int isAdd) {
this.isAdd = isAdd; this.isAdd = isAdd;
} }
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public int getRoleUseNum() {
return roleUseNum;
}
public void setRoleUseNum(int roleUseNum) {
this.roleUseNum = roleUseNum;
}
} }

View File

@ -18,6 +18,10 @@ public class CDKInfoVo {
public String type ; // 类型 public String type ; // 类型
public long roleUseNum ; // 被使用数量
public int pid ; // pid
public void setId(int id) { public void setId(int id) {
this.id = id; this.id = id;
} }
@ -49,4 +53,12 @@ public class CDKInfoVo {
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
public void setPid(int pid) {
this.pid = pid;
}
public void setRoleUseNum(long roleUseNum) {
this.roleUseNum = roleUseNum;
}
} }

View File

@ -51,18 +51,18 @@ public class JsonUtil {
StringBuilder reward = new StringBuilder(); StringBuilder reward = new StringBuilder();
String[] itemIds = request.getParameterValues("itemIds[]"); String[] itemIds = request.getParameterValues("itemIds[]");
String[] itemNums = request.getParameterValues("itemNums[]"); String[] itemNums = request.getParameterValues("itemNums[]");
String[] itemTypes = request.getParameterValues("itemTypes[]");
if (itemIds.length ==0 || itemNums.length ==0 || itemTypes.length ==0){ if (itemIds.length ==0 || itemNums.length ==0 ){
return reward.toString(); return reward.toString();
} }
for (int i = 0; i < itemIds.length; i++){ for (int i = 0; i < itemIds.length; i++){
if (itemIds[i].isEmpty() || itemNums[i].isEmpty() || itemTypes[i].isEmpty()){ if (itemIds[i].isEmpty() || itemNums[i].isEmpty()){
return reward.toString(); return reward.toString();
} }
if (reward.length() == 0){ if (reward.length() == 0){
reward = new StringBuilder(itemIds[i] + "#" + itemNums[i] + "#" + itemTypes[i]); reward = new StringBuilder(itemIds[i] + "#" + itemNums[i] );
}else{ }else{
reward.append("|").append(itemIds[i]).append("#").append(itemNums[i]).append("#").append(itemTypes[i]); reward.append("|").append(itemIds[i]).append("#").append(itemNums[i]).append("#");
} }
} }
return reward.toString(); return reward.toString();

View File

@ -11,7 +11,7 @@ spring.data.gameMongodb.uri = mongodb://60.1.1.14:27017
# redis config # redis config
spring.redis.database=13 spring.redis.database=0
spring.redis.host = 60.1.1.21 spring.redis.host = 60.1.1.21
spring.redis.port = 6379 spring.redis.port = 6379
spring.redis.password = spring.redis.password =

View File

@ -36,7 +36,7 @@
</nav> </nav>
<div class="page-container"> <div class="page-container">
<form class="form form-horizontal" id="form-article-add" action="/publishMSG" method="post" target="updataQuest" <form class="form form-horizontal" id="form-article-add" action="/publishMSG" method="post" target="updataMSGQuest"
onsubmit="return sendCheck()"> onsubmit="return sendCheck()">
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
@ -68,7 +68,7 @@
</div> </div>
</div> </div>
</form> </form>
<iframe name='updataQuest' id="updataQuest" style='display: none'></iframe> <iframe name='updataMSGQuest' id="updataMSGQuest" style='display: none'></iframe>
</div> </div>
@ -95,7 +95,7 @@ $(function(){
}); });
}); });
$('#updataQuest').load(function () { $('#updataMSGQuest').load(function () {
// 根据后台返回值处理结果 // 根据后台返回值处理结果
var text=$(this).contents().find("body").text(); var text=$(this).contents().find("body").text();
if (text != 0) { if (text != 0) {

View File

@ -36,7 +36,7 @@
</nav> </nav>
<div class="page-container"> <div class="page-container">
<form class="form form-horizontal" id="form-article-add" action="/publishNotice" method="post" target="updataQuest" <form class="form form-horizontal" id="form-article-add" action="/publishNotice" method="post" target="updataSYSQuest"
onsubmit="return sendCheck()"> onsubmit="return sendCheck()">
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
@ -68,7 +68,7 @@
</div> </div>
</div> </div>
</form> </form>
<iframe name='updataQuest' id="updataQuest" style='display: none'></iframe> <iframe name='updataSYSQuest' id="updataSYSQuest" style='display: none'></iframe>
</div> </div>
@ -95,7 +95,7 @@ $(function(){
}); });
}); });
$('#updataQuest').load(function () { $('#updataSYSQuest').load(function () {
// 根据后台返回值处理结果 // 根据后台返回值处理结果
var text=$(this).contents().find("body").text(); var text=$(this).contents().find("body").text();
if (text != 0) { if (text != 0) {

View File

@ -39,6 +39,7 @@
<div class="tabBar cl"> <div class="tabBar cl">
<span>序列号礼包生成</span> <span>序列号礼包生成</span>
</div> </div>
<div class="tabCon"> <div class="tabCon">
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
@ -52,24 +53,52 @@
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span> <span class="c-red">*</span>
生成类型</label> 渠道id</label>
<div class="formControls col-xs-8 col-sm-9"> <div class="formControls col-xs-8 col-sm-9">
<select name="addType" class="input-text" id="contentType"><!--下拉列表--> <input type="text" name="pid" placeholder="pid" value="" class="input-text"/>
<option value="0" selected = "selected">A(同一批禮包序號,同角色不可重複兌換。每組序號限兌換一次)</option> <span class="PID"></span>
<option value="1" >B(同一批禮包序號,同角色可重複兌換。每組序號限兌換一次)</option>
<option value="2" >C(萬用序號,只出一組序號,可重複使用,每一帳號(一個賬號可能有多個角色)僅限兌換一次)</option>
</select>
</div> </div>
</div> </div>
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span> <span class="c-red">*</span>
礼包数量:</label> 使用属性:</label>
<div class="formControls col-xs-8 col-sm-9">
<select name="addType" class="input-text" id="contentType"><!--下拉列表-->
<option value="0" selected = "selected">不可重复</option>
<option value="1" >可重複使用</option>
</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">
<input type="text" name="roleUseNum" placeholder="" value="" class="input-text"/>
<span class="ROLEUSENUM"></span>
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span>
CDK数量</label>
<div class="formControls col-xs-8 col-sm-9"> <div class="formControls col-xs-8 col-sm-9">
<input type="text" name="goodsNum" placeholder="" value="" class="input-text"/> <input type="text" name="goodsNum" placeholder="" value="" class="input-text"/>
<span class="GOODSNUM"></span> <span class="GOODSNUM"></span>
</div> </div>
</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">
<input type="text" name="goodsInfo" placeholder=""class="input-text"/>
<span class="GOODSINFO"></span>
</div>
</div>
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span> <span class="c-red">*</span>
@ -86,15 +115,7 @@
<input type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'datemin\')}' })" id="datemax" class="input-text Wdate" style="width:180px;" name="endTime"> <input type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'datemin\')}' })" id="datemax" class="input-text Wdate" style="width:180px;" name="endTime">
</div> </div>
</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">
<input type="text" name="goodsInfo" placeholder=""class="input-text"/>
<span class="GOODSINFO"></span>
</div>
</div>
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span> <span class="c-red">*</span>
@ -104,7 +125,6 @@
<div> <div>
物品id:<input type="text" name="itemIds[]" id="itemId_1" style="width: 150px" /> 物品id:<input type="text" name="itemIds[]" id="itemId_1" style="width: 150px" />
物品数量:<input type="text" name="itemNums[]" id="itemNum_1" style="width: 150px" /> 物品数量:<input type="text" name="itemNums[]" id="itemNum_1" style="width: 150px" />
物品类型:<input type="text" name="itemTypes[]" id="itemType_1" style="width: 150px"/>
<a href="#" class="removeclass"></a> <a href="#" class="removeclass"></a>
<a href="#" id="AddMoreFileBox" class="btn btn-info">+</a> <a href="#" id="AddMoreFileBox" class="btn btn-info">+</a>
<span class="REWARD"></span> <span class="REWARD"></span>
@ -193,6 +213,8 @@ function toaddCDKInfo() {
var startTime = $("input[name='startTime']").val(); var startTime = $("input[name='startTime']").val();
var endTime = $("input[name='endTime']").val(); var endTime = $("input[name='endTime']").val();
var goodsInfo = $("input[name='goodsInfo']").val(); var goodsInfo = $("input[name='goodsInfo']").val();
var pid = $("input[name='pid']").val();
if (goodsName === '' || goodsName == null) { if (goodsName === '' || goodsName == null) {
erroCode.html('<span style="color: red; ">商品名称不能为空!</span>'); erroCode.html('<span style="color: red; ">商品名称不能为空!</span>');
return false; return false;
@ -215,6 +237,11 @@ function toaddCDKInfo() {
erroCode = $('.GOODSINFO'); erroCode = $('.GOODSINFO');
erroCode.html('<span style="color: red; ">商品信息不能为空!</span>'); erroCode.html('<span style="color: red; ">商品信息不能为空!</span>');
return false; return false;
}
if (pid === '' || pid == null) {
erroCode = $('.PID');
erroCode.html('<span style="color: red; ">渠道id不能为空!</span>');
return false;
} }
return true; return true;
} }

View File

@ -34,12 +34,14 @@
<!--<th width="25"><input type="checkbox" name="" value=""/></th>--> <!--<th width="25"><input type="checkbox" name="" value=""/></th>-->
<th width="200">礼包名称</th> <th width="200">礼包名称</th>
<th width="200">礼包id</th> <th width="200">礼包id</th>
<th width="200">pid</th>
<th width="200">礼包数量</th> <th width="200">礼包数量</th>
<th width="200">开始时间</th> <th width="200">开始时间</th>
<th width="200">结束时间</th> <th width="200">结束时间</th>
<th width="200">礼包内容</th> <th width="200">礼包内容</th>
<th width="200">礼包类型</th> <th width="200">礼包类型</th>
<th width="200">被使用数量</th> <th width="200">被使用数量</th>
<th width="200">角色使用数量</th>
<th width="200">操作</th> <th width="200">操作</th>
</tr> </tr>
</thead> </thead>
@ -48,12 +50,14 @@
<!--<td><input type="checkbox" value="" name=""/></td>--> <!--<td><input type="checkbox" value="" name=""/></td>-->
<td th:text="${obj.goodsName}" style="text-align: center;"></td> <td th:text="${obj.goodsName}" style="text-align: center;"></td>
<td th:text="${obj.id}" style="text-align: center;"></td> <td th:text="${obj.id}" style="text-align: center;"></td>
<td th:text="${obj.pid}" style="text-align: center;"></td>
<td th:text="${obj.goodsNum}" style="text-align: center;"></td> <td th:text="${obj.goodsNum}" style="text-align: center;"></td>
<td th:text="${obj.startTime}" style="text-align: center;"></td> <td th:text="${obj.startTime}" style="text-align: center;"></td>
<td th:text="${obj.endTime}" style="text-align: center;"></td> <td th:text="${obj.endTime}" style="text-align: center;"></td>
<td th:text="${obj.goodsInfo}" style="text-align: center;"></td> <td th:text="${obj.goodsInfo}" style="text-align: center;"></td>
<td th:text="${obj.type}" style="text-align: center;"></td> <td th:text="${obj.type}" style="text-align: center;"></td>
<td th:text="${obj.useNum}" style="text-align: center;"></td> <td th:text="${obj.useNum}" style="text-align: center;"></td>
<td th:text="${obj.roleUseNum}" style="text-align: center;"></td>
<td style="text-align: center; width: 300px"> <td style="text-align: center; width: 300px">
<button type="button" th:id="${obj.id}" class="btn btn-primary" onclick="return cdkAdd(this)"><i class="Hui-iconfont"></i> 序列號生成</button> <button type="button" th:id="${obj.id}" class="btn btn-primary" onclick="return cdkAdd(this)"><i class="Hui-iconfont"></i> 序列號生成</button>
<button type="button" th:id="${obj.id}" class="btn btn-success" onclick="return download(this)"><i class="Hui-iconfont"></i> 序列號导出</button> <button type="button" th:id="${obj.id}" class="btn btn-success" onclick="return download(this)"><i class="Hui-iconfont"></i> 序列號导出</button>