Merge remote-tracking branch 'origin/activity' into activity

This commit is contained in:
dy 2021-04-25 09:27:30 +08:00
commit 6fc057f2c9
8 changed files with 23 additions and 17 deletions

View File

@ -203,7 +203,10 @@ public class DrawActivityThread implements Callable<DrawResult> {
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+"");

View File

@ -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+"");

View File

@ -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 # 第一个公众号的appid
secret: d4624c36b6795d1d99dcf0547af5443d # 公众号的appsecret
token: qpComing # 接口配置里的Token值
aesKey: 111 # 接口配置里的EncodingAESKey值
- appId: 2222 # 第二个公众号的appid以下同上
secret: 1111
token: 111
aesKey: 111
- appId: wxbb9badc4655d21a2 # 第一个公众号的appid
secret: 12002584c28d2ce1d043b97b861af17d # 公众号的appsecret
token: # 接口配置里的Token值
aesKey: # 接口配置里的EncodingAESKey值

View File

@ -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;

View File

@ -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);
/**
* 查询活动次数记录信息列表

View File

@ -20,7 +20,7 @@ public interface IDrawTaskNotifyService
* @return 活动次数记录信息
*/
public DrawTaskNotify selectDrawTaskNotifyById(String USERID);
int selectDrawNumByUserId(String userId, String drawCode);
Integer selectDrawNumByUserId(DrawTaskNotify drawTaskNotify);
/**
* 查询活动次数记录信息列表
*

View File

@ -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);
}
/**

View File

@ -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
</sql>
<select id="selectDrawNumByUserId" parameterType="String" resultType="Integer">
<select id="selectDrawNumByUserId" parameterType="DrawTaskNotify" resultType="Integer">
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`
</select>