From 32e99e3bd2f3c00efff1a22894197dfcb296db7b Mon Sep 17 00:00:00 2001 From: xu0625 <1212> Date: Fri, 9 Apr 2021 11:18:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=AE=A1=E7=90=86-=E6=8A=BD?= =?UTF-8?q?=E5=A5=96=E6=B4=BB=E5=8A=A8=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DrawInfoController.java | 64 ++++++++++--------- .../templates/activity/info/add.html | 14 +--- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/sino-activity/src/main/java/com/sinosoft/activity/controller/DrawInfoController.java b/sino-activity/src/main/java/com/sinosoft/activity/controller/DrawInfoController.java index 454afdc1a..28f674b3c 100644 --- a/sino-activity/src/main/java/com/sinosoft/activity/controller/DrawInfoController.java +++ b/sino-activity/src/main/java/com/sinosoft/activity/controller/DrawInfoController.java @@ -76,39 +76,45 @@ public class DrawInfoController extends BaseController @ResponseBody public AjaxResult addSave(@RequestBody ActVO vo) { - logger.info("前台传参"+ JSON.toJSONString(vo)); - SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS"); - Date date = new Date(); - //新增基本信息 - vo.getDrawInfo().setCREATETIMESTAMP(date); - String code = format.format(date); - vo.getDrawInfo().setDRAWCODE(code); - drawInfoService.insertDrawInfo(vo.getDrawInfo()); + try{ + logger.info("前台传参"+ JSON.toJSONString(vo)); + SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + Date date = new Date(); + //新增基本信息 + vo.getDrawInfo().setCREATETIMESTAMP(date); + String code = format.format(date); + vo.getDrawInfo().setDRAWCODE(code); + drawInfoService.insertDrawInfo(vo.getDrawInfo()); - //新增展示内容 - vo.getActPageConfigGuide().setCreateTime(date); - vo.getActPageConfigGuide().setActCode(code); - iActPageConfigGuideService.insertActPageConfigGuide(vo.getActPageConfigGuide()); + //新增展示内容 + vo.getActPageConfigGuide().setCreateTime(date); + vo.getActPageConfigGuide().setActCode(code); + iActPageConfigGuideService.insertActPageConfigGuide(vo.getActPageConfigGuide()); - //新增选择玩法 - vo.getDrawRule().setCREATETIMESTAMP(date); - vo.getDrawRule().setDRAWCODE(code); - iDrawRuleService.insertDrawRule(vo.getDrawRule()); + //新增选择玩法 + vo.getDrawRule().setCREATETIMESTAMP(date); + vo.getDrawRule().setDRAWCODE(code); + iDrawRuleService.insertDrawRule(vo.getDrawRule()); - //新增收集信息 - vo.getActPageConfigUserinfo().setCreateTime(date); - vo.getActPageConfigUserinfo().setActCode(code); - iActPageConfigUserinfoService.insertActPageConfigUserinfo(vo.getActPageConfigUserinfo()); + //新增收集信息 + vo.getActPageConfigUserinfo().setCreateTime(date); + vo.getActPageConfigUserinfo().setActCode(code); + iActPageConfigUserinfoService.insertActPageConfigUserinfo(vo.getActPageConfigUserinfo()); - //新增分享信息 - vo.getActConfig().setCreateTime(date); - vo.getActConfig().setActCode(code); - iActConfigService.insertActConfig(vo.getActConfig()); - //新增二维码信息 - vo.getActPageConfigSubscribe().setCreateTime(date); - vo.getActPageConfigSubscribe().setActCode(code); - int i = iActPageConfigSubscribeService.insertActPageConfigSubscribe(vo.getActPageConfigSubscribe()); - return toAjax(i); + //新增分享信息 + vo.getActConfig().setCreateTime(date); + vo.getActConfig().setActCode(code); + iActConfigService.insertActConfig(vo.getActConfig()); + //新增二维码信息 + vo.getActPageConfigSubscribe().setCreateTime(date); + vo.getActPageConfigSubscribe().setActCode(code); + int i = iActPageConfigSubscribeService.insertActPageConfigSubscribe(vo.getActPageConfigSubscribe()); + return toAjax(i); + } + catch (Exception e){ + e.printStackTrace(); + return AjaxResult.error("系统繁忙"); + } } /** * 查询抽奖活动管理列表 diff --git a/sino-activity/src/main/resources/templates/activity/info/add.html b/sino-activity/src/main/resources/templates/activity/info/add.html index 0bbf2e171..c6c333f7a 100644 --- a/sino-activity/src/main/resources/templates/activity/info/add.html +++ b/sino-activity/src/main/resources/templates/activity/info/add.html @@ -1035,24 +1035,16 @@ .on('click', function () { //添加保存逻辑 var data = customSerialize("form-info-add", true); - alert(data); $.ajax({ url: prefix + "/add", data: data, type: "post", contentType: "application/json;charset=UTF-8", success: function (result) { - if (result.code == web_status.SUCCESS) { - layer.msg("保存成功,正在刷新数据请稍后……", { - icon: 1, - time: 500, - shade: [0.1, '#8F8F8F'] - }, function () { - location.reload(); - }); - } else { - alert(result.msg); + if (typeof callback == "function") { + callback(result); } + $.operate.successTabCallback(result); } }) });