From 8803b7e84442b794f55b65db1d90a573162c822b Mon Sep 17 00:00:00 2001 From: wanghuayue Date: Fri, 23 Apr 2021 19:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=A5=96=E6=B4=BB=E5=8A=A8=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E5=BA=94=E7=94=A8=EF=BC=8C=E8=8E=B7=E5=8F=96openid?= =?UTF-8?q?=EF=BC=9B=E6=9F=A5=E8=AF=A2=E6=8A=BD=E5=A5=96=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/thread/DrawActivityThread.java | 5 ++++- .../ruoyi/web/controller/draw/DrawController.java | 6 +++++- sino-act-web/src/main/resources/application.yml | 14 ++++++-------- .../src/main/resources/public/draw/turntable.html | 3 ++- .../activity/mapper/DrawTaskNotifyMapper.java | 2 +- .../activity/service/IDrawTaskNotifyService.java | 2 +- .../service/impl/DrawTaskNotifyServiceImpl.java | 4 ++-- .../mapper/activity/DrawTaskNotifyMapper.xml | 4 ++-- 8 files changed, 23 insertions(+), 17 deletions(-) diff --git a/sino-act-web/src/main/java/com/ruoyi/thread/DrawActivityThread.java b/sino-act-web/src/main/java/com/ruoyi/thread/DrawActivityThread.java index c4fae90da..4aa4238e9 100644 --- a/sino-act-web/src/main/java/com/ruoyi/thread/DrawActivityThread.java +++ b/sino-act-web/src/main/java/com/ruoyi/thread/DrawActivityThread.java @@ -203,7 +203,10 @@ public class DrawActivityThread implements Callable { long point10 = System.currentTimeMillis(); logger.info("抽奖检查点10:" + request.getSerialNo() + "_" + tranSeqNo + "&时间:" + point10 + "&与前一个检查点时间差:" + (point10 - point9)); // 查询剩余抽奖次数 - int available = drawTaskNotifyService.selectDrawNumByUserId(request.getUserId(), gtDrawInfo.getDRAWCODE()); + DrawTaskNotify drawTaskNotify = new DrawTaskNotify(); + drawTaskNotify.setDRAWCODE(gtDrawInfo.getDRAWCODE()); + drawTaskNotify.setUSERID(request.getUserId()); + Integer available = drawTaskNotifyService.selectDrawNumByUserId(drawTaskNotify); long point11 = System.currentTimeMillis(); logger.info("抽奖检查点11:" + request.getSerialNo() + "_" + tranSeqNo + "&时间:" + point11 + "&与前一个检查点时间差:" + (point11 - point10)); response.setAvailable(available+""); 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 e203fa6c9..b909bab9e 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,6 +1,7 @@ package com.ruoyi.web.controller.draw; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.dto.DrawActivityRequest; import com.ruoyi.dto.*; import com.ruoyi.web.vo.Result; import com.ruoyi.web.vo.draw.*; @@ -133,7 +134,10 @@ public class DrawController { return result; } String userId = userInfo.getOpenid(); - int num = drawTaskNotifyService.selectDrawNumByUserId(userId, drawCode); + DrawTaskNotify drawTaskNotify = new DrawTaskNotify(); + drawTaskNotify.setDRAWCODE(drawCode); + drawTaskNotify.setUSERID(userId); + Integer num = drawTaskNotifyService.selectDrawNumByUserId(drawTaskNotify); //鏌ヨ鎶藉娆℃暟 result.setTotal(null); result.setNum(num+""); diff --git a/sino-act-web/src/main/resources/application.yml b/sino-act-web/src/main/resources/application.yml index 02c90fde5..324353dca 100644 --- a/sino-act-web/src/main/resources/application.yml +++ b/sino-act-web/src/main/resources/application.yml @@ -36,6 +36,7 @@ logging: org.springframework.web: INFO com.github.binarywang.demo.wx.mp: DEBUG me.chanjar.weixin: DEBUG + com.spring.jiminshiro.mapper: DEBUG # 鐢ㄦ埛閰嶇疆 user: @@ -82,6 +83,7 @@ mybatis: # 鍔犺浇鍏ㄥ眬鐨勯厤缃枃浠 configLocation: classpath:mybatis/mybatis-config.xml + # PageHelper鍒嗛〉鎻掍欢 pagehelper: helperDialect: mysql @@ -146,11 +148,7 @@ wx: host: 127.0.0.1 port: 6379 configs: - - appId: wx0afa27c03093f9e6 # 绗竴涓叕浼楀彿鐨刟ppid - secret: d4624c36b6795d1d99dcf0547af5443d # 鍏紬鍙风殑appsecret - token: qpComing # 鎺ュ彛閰嶇疆閲岀殑Token鍊 - aesKey: 111 # 鎺ュ彛閰嶇疆閲岀殑EncodingAESKey鍊 - - appId: 2222 # 绗簩涓叕浼楀彿鐨刟ppid锛屼互涓嬪悓涓 - secret: 1111 - token: 111 - aesKey: 111 + - appId: wxbb9badc4655d21a2 # 绗竴涓叕浼楀彿鐨刟ppid + secret: 12002584c28d2ce1d043b97b861af17d # 鍏紬鍙风殑appsecret + token: # 鎺ュ彛閰嶇疆閲岀殑Token鍊 + aesKey: # 鎺ュ彛閰嶇疆閲岀殑EncodingAESKey鍊 diff --git a/sino-act-web/src/main/resources/public/draw/turntable.html b/sino-act-web/src/main/resources/public/draw/turntable.html index 2cffc2d93..ead228965 100644 --- a/sino-act-web/src/main/resources/public/draw/turntable.html +++ b/sino-act-web/src/main/resources/public/draw/turntable.html @@ -46,11 +46,12 @@ turnplate.restaraunts = ["鍗庝负P40", "鐜伴噾绾㈠寘", "姹借溅鍔犳补鍗", "鐜伴噾绾㈠寘", "鐖卞鑹烘湀鍗", "鐜伴噾绾㈠寘", "鐜伴噾绾㈠寘", "鎴存.鍚稿皹鍣"]; turnplate.colors = ["#fffef8", "#ffdcae", "#fffef8", "#ffdcae", "#fffef8", "#ffdcae", "#fffef8", "#ffdcae"]; // + let code = getParameter('code'); $.ajax({ type: "POST", async:false, url: contextRootPath+"/draw/init.action", - data: {drawCode: drawCode}, + data: {drawCode: drawCode, code: code}, dataType: "json", success: function(data){ prizes = data.prizes; diff --git a/sino-activity/src/main/java/com/sinosoft/activity/mapper/DrawTaskNotifyMapper.java b/sino-activity/src/main/java/com/sinosoft/activity/mapper/DrawTaskNotifyMapper.java index a3172c98f..551708c3a 100644 --- a/sino-activity/src/main/java/com/sinosoft/activity/mapper/DrawTaskNotifyMapper.java +++ b/sino-activity/src/main/java/com/sinosoft/activity/mapper/DrawTaskNotifyMapper.java @@ -20,7 +20,7 @@ public interface DrawTaskNotifyMapper * @return 娲诲姩娆℃暟璁板綍淇℃伅 */ public DrawTaskNotify selectDrawTaskNotifyById(String USERID); - public int selectDrawNumByUserId(String userId, String drawCode); + public Integer selectDrawNumByUserId(DrawTaskNotify drawTaskNotify); /** * 鏌ヨ娲诲姩娆℃暟璁板綍淇℃伅鍒楄〃 diff --git a/sino-activity/src/main/java/com/sinosoft/activity/service/IDrawTaskNotifyService.java b/sino-activity/src/main/java/com/sinosoft/activity/service/IDrawTaskNotifyService.java index a5916ac49..53838661e 100644 --- a/sino-activity/src/main/java/com/sinosoft/activity/service/IDrawTaskNotifyService.java +++ b/sino-activity/src/main/java/com/sinosoft/activity/service/IDrawTaskNotifyService.java @@ -20,7 +20,7 @@ public interface IDrawTaskNotifyService * @return 娲诲姩娆℃暟璁板綍淇℃伅 */ public DrawTaskNotify selectDrawTaskNotifyById(String USERID); - int selectDrawNumByUserId(String userId, String drawCode); + Integer selectDrawNumByUserId(DrawTaskNotify drawTaskNotify); /** * 鏌ヨ娲诲姩娆℃暟璁板綍淇℃伅鍒楄〃 * diff --git a/sino-activity/src/main/java/com/sinosoft/activity/service/impl/DrawTaskNotifyServiceImpl.java b/sino-activity/src/main/java/com/sinosoft/activity/service/impl/DrawTaskNotifyServiceImpl.java index cd10295f2..fd4a24f56 100644 --- a/sino-activity/src/main/java/com/sinosoft/activity/service/impl/DrawTaskNotifyServiceImpl.java +++ b/sino-activity/src/main/java/com/sinosoft/activity/service/impl/DrawTaskNotifyServiceImpl.java @@ -54,9 +54,9 @@ public class DrawTaskNotifyServiceImpl implements IDrawTaskNotifyService return drawTaskNotifyMapper.selectDrawTaskNotifyById(USERID); } @Override - public int selectDrawNumByUserId(String userId, String drawCode) + public Integer selectDrawNumByUserId(DrawTaskNotify drawTaskNotify) { - return drawTaskNotifyMapper.selectDrawNumByUserId(userId, drawCode); + return drawTaskNotifyMapper.selectDrawNumByUserId(drawTaskNotify); } /** diff --git a/sino-activity/src/main/resources/mapper/activity/DrawTaskNotifyMapper.xml b/sino-activity/src/main/resources/mapper/activity/DrawTaskNotifyMapper.xml index be4e9e1ca..2b087aa1d 100644 --- a/sino-activity/src/main/resources/mapper/activity/DrawTaskNotifyMapper.xml +++ b/sino-activity/src/main/resources/mapper/activity/DrawTaskNotifyMapper.xml @@ -29,9 +29,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select TASKNOTIFYID, DRAWCODE, TASKID, USERID, TYPE, ADDNUMBER, STATE, CREATETIMESTAMP, LASTUPDATETIMESTAMP, AVAILABLENUMBER, CHECKINGDATE, PHONE, TASKTYPE, VSTATE, ULEVEL, SOURCE, ISSPECIALFLAG, REQUESTFLAG from draw_task_notify - SELECT SUM(dtn.`AVAILABLENUMBER`) FROM draw_task_notify dtn - WHERE dtn.`STATE`='1' AND dtn.`USERID`=#{userId} and dtn.`DRAWCODE`=#{drawCode} + WHERE dtn.`STATE`='1' AND dtn.`USERID`=#{USERID} and dtn.`DRAWCODE`=#{DRAWCODE} GROUP BY dtn.`DRAWCODE`, dtn.`USERID`