Authored by bblu

时间修改

... ... @@ -151,7 +151,7 @@
activity_id, sort, status,
create_time, update_time)
select #{uid,jdbcType=INTEGER},
#{userType,jdbcType=TINYINT}, #{activityId,jdbcType=INTEGER}, ifnull(max(sort), 0) + 1, #{status,jdbcType=TINYINT}, UNIX_TIMESTAMP(), UNIX_TIMESTAMP() from
#{userType,jdbcType=TINYINT}, #{activityId,jdbcType=INTEGER}, ifnull(max(sort), 0) + 1, #{status,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER} from
drawline_user_queue where activity_id = #{activityId,jdbcType=INTEGER}
</insert>
<select id="selectCountBy" resultType="java.lang.Integer">
... ...
... ... @@ -164,6 +164,7 @@ public class AddVirtualUserTimer {
//需要加入的马甲数量
int num = 0, n = 0;
DrawlineUserQueue queueUser = null;
int currentTime = (int) (System.currentTimeMillis() / 1000);
for (DrawlineActivity activity : activityList) {
n = 0;
// if (realUserCountMap.get(activity.getId()) == null || realUserCountMap.get(activity.getId()) == 0) {
... ... @@ -193,6 +194,8 @@ public class AddVirtualUserTimer {
queueUser.setUid(waitList.get(i).getUid());
queueUser.setUserType((byte) UserTypeEnum.VIRTUAL_USER.getValue());
queueUser.setStatus((byte) 1);
queueUser.setCreateTime(currentTime);
queueUser.setUpdateTime(currentTime);
//插入排队表,因为排队字段sort必须要连续,为了避免锁表到导致真实用户插入问题,这里需要在循环里面插入数据库
drawlineUserQueueDAO.insertAutoSort(queueUser);
//插入成功后,需要从等待排队的马甲中删除
... ...