From 0c0a2a89a5a51008dabc4e3a6d3eccc79cc4c85b Mon Sep 17 00:00:00 2001 From: dy <1197793912@qq.com> Date: Thu, 15 Apr 2021 15:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=AC=A2=E8=BF=8E=E9=A1=B5?= =?UTF-8?q?=E7=BC=96=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/draw/DrawController.java | 53 ++++++- .../com/ruoyi/web/vo/draw/ActGuideResult.java | 25 ++++ .../main/resources/public/draw/actGuide.html | 139 ++++++++++++++++++ 3 files changed, 212 insertions(+), 5 deletions(-) create mode 100644 sino-act-web/src/main/java/com/ruoyi/web/vo/draw/ActGuideResult.java create mode 100644 sino-act-web/src/main/resources/public/draw/actGuide.html diff --git a/sino-act-web/src/main/java/com/ruoyi/web/controller/draw/DrawController.java b/sino-act-web/src/main/java/com/ruoyi/web/controller/draw/DrawController.java index 6f63937ed..eb539034f 100644 --- a/sino-act-web/src/main/java/com/ruoyi/web/controller/draw/DrawController.java +++ b/sino-act-web/src/main/java/com/ruoyi/web/controller/draw/DrawController.java @@ -1,17 +1,20 @@ package com.ruoyi.web.controller.draw; -import com.ruoyi.common.utils.DateUtils; import com.ruoyi.web.vo.Const; import com.ruoyi.web.vo.Result; import com.ruoyi.web.vo.draw.*; +import com.sinosoft.activity.domain.ActConfig; +import com.sinosoft.activity.domain.ActPageConfigGuide; import com.sinosoft.activity.domain.DrawConfig; import com.sinosoft.activity.domain.DrawInfo; -import com.sinosoft.activity.service.IDrawConfigService; -import com.sinosoft.activity.service.IDrawInfoService; -import com.sinosoft.activity.service.IDrawTaskNotifyService; +import com.sinosoft.activity.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; import me.chanjar.weixin.common.bean.WxOAuth2UserInfo; import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken; import me.chanjar.weixin.mp.api.WxMpService; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,13 +29,13 @@ import javax.servlet.http.HttpSession; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.Map; /** * 抽奖Controller * @author huayue * @since 2020-08-13 */ +@Api("活动管理") @Controller @RequestMapping("/draw") public class DrawController { @@ -46,6 +49,10 @@ public class DrawController { private IDrawInfoService drawInfoService; @Autowired private WxMpService wxService; + @Autowired + private IActPageConfigGuideService actPageConfigGuideService; + @Autowired + private IActConfigService actConfigService; private WxOAuth2UserInfo getUserInfo(HttpServletRequest request, String code) throws Exception { // if (!this.wxService.switchover(appid)) { @@ -341,4 +348,40 @@ public class DrawController { return result; } + /** + * 获取活动配置展示信息,根据活动编码 + * todo 判断活动状态 + * @param request + * @param actCode + * @return + */ + @ApiOperation("获取活动配置展示信息") + @ApiImplicitParam(name = "actCode", value = "活动编码", required = true, dataType = "string", paramType = "path") + @RequestMapping(value="/guide", method = RequestMethod.POST) + @ResponseBody + public Result getActGuide(HttpServletRequest request, String actCode) { + ActGuideResult result = new ActGuideResult(); + try { + //查询活动内容 + DrawInfo drawInfo = new DrawInfo(); + drawInfo.setDRAWCODE(actCode); + drawInfo.setSTATUS("1"); + List drawInfos = drawInfoService.selectDrawInfoList(drawInfo); + result.setDrawInfo(drawInfos.get(0)); + //查询获取风格 + ActConfig actConfig = actConfigService.selectActConfigByCode(actCode); + result.setPageStyle(actConfig.getPageStyle()); + result.setActType(actConfig.getActType()); + //获取页面展示内容配置 + ActPageConfigGuide actPageConfigGuide = actPageConfigGuideService.selectActPageConfigGuideByCode(actCode); + result.setActPageConfigGuide(actPageConfigGuide); + }catch (Exception e){ + result.setRespCode("-1"); + result.setRespMsg("系统异常,请稍后再试"); + logger.error("DrawController.saveAddress ex: ", e); + } + return result; + } + + } diff --git a/sino-act-web/src/main/java/com/ruoyi/web/vo/draw/ActGuideResult.java b/sino-act-web/src/main/java/com/ruoyi/web/vo/draw/ActGuideResult.java new file mode 100644 index 000000000..b2b03cb9b --- /dev/null +++ b/sino-act-web/src/main/java/com/ruoyi/web/vo/draw/ActGuideResult.java @@ -0,0 +1,25 @@ +package com.ruoyi.web.vo.draw; + +import com.ruoyi.web.vo.Result; +import com.sinosoft.activity.domain.ActPageConfigGuide; +import com.sinosoft.activity.domain.DrawInfo; +import lombok.Data; + +/** + * TODO + * + * @author dy + * @version 1.0 + * @date 2021/4/14 14:38 + */ +@Data +public class ActGuideResult extends Result { + private ActPageConfigGuide actPageConfigGuide; + + private DrawInfo drawInfo; + + private Integer pageStyle; + + private Integer actType; + +} diff --git a/sino-act-web/src/main/resources/public/draw/actGuide.html b/sino-act-web/src/main/resources/public/draw/actGuide.html new file mode 100644 index 000000000..a2052961e --- /dev/null +++ b/sino-act-web/src/main/resources/public/draw/actGuide.html @@ -0,0 +1,139 @@ + + + + + + + 活动 + + + + + + + + + + + + + + + + + + + +
+

+

+ +

+

+ +
+ + + + + + + + \ No newline at end of file