fix: 投资系统,茅台预约,自测问题修复。
This commit is contained in:
@@ -71,7 +71,7 @@ public class IUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping(value = "/reservation", name = "预约")
|
@GetMapping(value = "/reservation", name = "预约")
|
||||||
public R reservation(String mobile) {
|
public R reservation(String mobile) {
|
||||||
IUser user = iUserMapper.selectIUserByMobile(Long.parseLong(mobile));
|
IUser user = iUserMapper.selectIUserByMobile((mobile));
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
return R.fail("用户不存在");
|
return R.fail("用户不存在");
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ public class IUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping(value = "/travelReward", name = "旅行")
|
@GetMapping(value = "/travelReward", name = "旅行")
|
||||||
public R travelReward(String mobile) {
|
public R travelReward(String mobile) {
|
||||||
IUser user = iUserMapper.selectIUserByMobile(Long.parseLong(mobile));
|
IUser user = iUserMapper.selectIUserByMobile((mobile));
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
return R.fail("用户不存在");
|
return R.fail("用户不存在");
|
||||||
} else {
|
} else {
|
||||||
@@ -113,7 +113,7 @@ public class IUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@GetMapping(value = "/{mobile}", name = "获取I茅台用户详细信息")
|
@GetMapping(value = "/{mobile}", name = "获取I茅台用户详细信息")
|
||||||
public R getInfo(@PathVariable("mobile") Long mobile) {
|
public R getInfo(@PathVariable("mobile") String mobile) {
|
||||||
return R.ok(iUserMapper.selectIUserByMobile(mobile));
|
return R.ok(iUserMapper.selectIUserByMobile(mobile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class ILog extends BaseEntity
|
|||||||
/** 用户 */
|
/** 用户 */
|
||||||
@ApiModelProperty(value="用户")
|
@ApiModelProperty(value="用户")
|
||||||
@Excel(name = "用户")
|
@Excel(name = "用户")
|
||||||
private Long mobile;
|
private String mobile;
|
||||||
|
|
||||||
/** 日志记录内容 */
|
/** 日志记录内容 */
|
||||||
@ApiModelProperty(value="日志记录内容")
|
@ApiModelProperty(value="日志记录内容")
|
||||||
@@ -52,7 +52,7 @@ public class ILog extends BaseEntity
|
|||||||
/** 创建者id */
|
/** 创建者id */
|
||||||
@ApiModelProperty(value="创建者id")
|
@ApiModelProperty(value="创建者id")
|
||||||
@Excel(name = "创建者id")
|
@Excel(name = "创建者id")
|
||||||
private Long createUser;
|
private String createUser;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ public class IUser extends BaseEntity
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 手机号 */
|
/** 手机号 */
|
||||||
private Long mobile;
|
private String mobile;
|
||||||
|
|
||||||
/** 用户id */
|
/** 用户id */
|
||||||
@ApiModelProperty(value="用户id")
|
@ApiModelProperty(value="用户id")
|
||||||
@Excel(name = "用户id")
|
@Excel(name = "用户id")
|
||||||
private Long userId;
|
private String userId;
|
||||||
|
|
||||||
/** token */
|
/** token */
|
||||||
private String token;
|
private String token;
|
||||||
|
|||||||
@@ -21,12 +21,13 @@ public class ILogDto implements Serializable
|
|||||||
|
|
||||||
/** 用户 */
|
/** 用户 */
|
||||||
@ApiModelProperty(value="用户")
|
@ApiModelProperty(value="用户")
|
||||||
private Long mobile;
|
private String mobile;
|
||||||
|
|
||||||
/** 日志记录内容 */
|
/** 日志记录内容 */
|
||||||
@ApiModelProperty(value="日志记录内容")
|
@ApiModelProperty(value="日志记录内容")
|
||||||
private String logContent;
|
private String logContent;
|
||||||
|
|
||||||
|
|
||||||
/** 操作状态 */
|
/** 操作状态 */
|
||||||
@ApiModelProperty(value="操作状态")
|
@ApiModelProperty(value="操作状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class IUserDto implements Serializable
|
|||||||
|
|
||||||
/** 手机号 */
|
/** 手机号 */
|
||||||
@ApiModelProperty(value="手机号")
|
@ApiModelProperty(value="手机号")
|
||||||
private Long mobile;
|
private String mobile;
|
||||||
|
|
||||||
/** token */
|
/** token */
|
||||||
@ApiModelProperty(value="token")
|
@ApiModelProperty(value="token")
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public interface IUserMapper
|
|||||||
* @param mobile 用户管理主键
|
* @param mobile 用户管理主键
|
||||||
* @return 用户管理
|
* @return 用户管理
|
||||||
*/
|
*/
|
||||||
public IUserVo selectIUserByMobile(Long mobile);
|
public IUserVo selectIUserByMobile(String mobile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户管理列表
|
* 查询用户管理列表
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public interface IUserService {
|
|||||||
* @param body
|
* @param body
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int insertIUser(Long mobile, String deviceId, JSONObject body);
|
int insertIUser(String mobile, String deviceId, JSONObject body);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询预约用户列表
|
* 查询预约用户列表
|
||||||
|
|||||||
@@ -3,14 +3,15 @@ package com.ruoyi.invest.service.impl;
|
|||||||
|
|
||||||
import com.ruoyi.common.core.utils.IdWorker;
|
import com.ruoyi.common.core.utils.IdWorker;
|
||||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.invest.domain.ILog;
|
||||||
import com.ruoyi.invest.domain.dto.ILogDto;
|
import com.ruoyi.invest.domain.dto.ILogDto;
|
||||||
import com.ruoyi.invest.domain.vo.ILogVo;
|
import com.ruoyi.invest.domain.vo.ILogVo;
|
||||||
import com.ruoyi.invest.domain.ILog;
|
|
||||||
import com.ruoyi.invest.mapper.ILogMapper;
|
import com.ruoyi.invest.mapper.ILogMapper;
|
||||||
import com.ruoyi.invest.service.IMTLogService;
|
import com.ruoyi.invest.service.IMTLogService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -55,6 +56,7 @@ public class IMTLogServiceImpl implements IMTLogService {
|
|||||||
public int insertILog(ILog iLog)
|
public int insertILog(ILog iLog)
|
||||||
{
|
{
|
||||||
iLog.setCreateBy(SecurityUtils.getUsername());
|
iLog.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
iLog.setCreateTime(new Date());
|
||||||
iLog.setLogId(IdWorker.getId());
|
iLog.setLogId(IdWorker.getId());
|
||||||
return iLogMapper.insertILog(iLog);
|
return iLogMapper.insertILog(iLog);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class IMTServiceImpl implements IMTService {
|
|||||||
|
|
||||||
HttpRequest request = HttpUtil.createRequest(Method.POST,
|
HttpRequest request = HttpUtil.createRequest(Method.POST,
|
||||||
"https://app.moutai519.com.cn/xhr/front/user/register/login");
|
"https://app.moutai519.com.cn/xhr/front/user/register/login");
|
||||||
IUser user = iUserMapper.selectIUserByMobile(Long.parseLong(mobile));
|
IUser user = iUserMapper.selectIUserByMobile(mobile);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
deviceId = user.getDeviceId();
|
deviceId = user.getDeviceId();
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ public class IMTServiceImpl implements IMTService {
|
|||||||
|
|
||||||
if (body.getString("code").equals("2000")) {
|
if (body.getString("code").equals("2000")) {
|
||||||
// logger.info("「登录请求-成功」" + body.toJSONString());
|
// logger.info("「登录请求-成功」" + body.toJSONString());
|
||||||
iUserService.insertIUser(Long.parseLong(mobile), deviceId, body);
|
iUserService.insertIUser(mobile, deviceId, body);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
logger.error("「登录请求-失败」" + body.toJSONString());
|
logger.error("「登录请求-失败」" + body.toJSONString());
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ public class IUserServiceImpl implements IUserService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertIUser(Long mobile, String deviceId, JSONObject jsonObject) {
|
public int insertIUser(String mobile, String deviceId, JSONObject jsonObject) {
|
||||||
|
|
||||||
IUser user = iUserMapper.selectIUserByMobile(mobile);
|
IUser user = iUserMapper.selectIUserByMobile(mobile);
|
||||||
|
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
JSONObject result = jsonObject.getJSONObject("data");
|
JSONObject result = jsonObject.getJSONObject("data");
|
||||||
user.setUserId(result.getLong("userId"));
|
user.setUserId(result.getString("userId"));
|
||||||
user.setToken(result.getString("token"));
|
user.setToken(result.getString("token"));
|
||||||
user.setMobile(mobile);
|
user.setMobile(mobile);
|
||||||
|
|
||||||
@@ -45,6 +45,8 @@ public class IUserServiceImpl implements IUserService {
|
|||||||
Date thirtyDaysLater = calendar.getTime();
|
Date thirtyDaysLater = calendar.getTime();
|
||||||
user.setExpireTime(thirtyDaysLater);
|
user.setExpireTime(thirtyDaysLater);
|
||||||
user.setCreateUser(SecurityUtils.getUserId());
|
user.setCreateUser(SecurityUtils.getUserId());
|
||||||
|
user.setUpdateUser(SecurityUtils.getUsername());
|
||||||
|
user.setUpdateTime(new Date());
|
||||||
|
|
||||||
return iUserMapper.updateIUser(user);
|
return iUserMapper.updateIUser(user);
|
||||||
} else {
|
} else {
|
||||||
@@ -53,7 +55,7 @@ public class IUserServiceImpl implements IUserService {
|
|||||||
}
|
}
|
||||||
IUser iUser=new IUser();
|
IUser iUser=new IUser();
|
||||||
JSONObject result = jsonObject.getJSONObject("data");
|
JSONObject result = jsonObject.getJSONObject("data");
|
||||||
iUser.setUserId(result.getLong("userId"));
|
iUser.setUserId(result.getString("userId"));
|
||||||
iUser.setToken(result.getString("token"));
|
iUser.setToken(result.getString("token"));
|
||||||
iUser.setMobile(mobile);
|
iUser.setMobile(mobile);
|
||||||
|
|
||||||
@@ -68,6 +70,8 @@ public class IUserServiceImpl implements IUserService {
|
|||||||
iUser.setExpireTime(thirtyDaysLater);
|
iUser.setExpireTime(thirtyDaysLater);
|
||||||
|
|
||||||
iUser.setCreateUser(SecurityUtils.getUserId());
|
iUser.setCreateUser(SecurityUtils.getUserId());
|
||||||
|
iUser.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
iUser.setCreateTime(new Date());
|
||||||
return iUserMapper.insertIUser(iUser);
|
return iUserMapper.insertIUser(iUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +103,8 @@ public class IUserServiceImpl implements IUserService {
|
|||||||
iUser.setDeviceId(UUID.randomUUID().toString().toLowerCase());
|
iUser.setDeviceId(UUID.randomUUID().toString().toLowerCase());
|
||||||
}
|
}
|
||||||
iUser.setCreateUser(SecurityUtils.getUserId());
|
iUser.setCreateUser(SecurityUtils.getUserId());
|
||||||
|
iUser.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
iUser.setCreateTime(new Date());
|
||||||
return iUserMapper.insertIUser(iUser);
|
return iUserMapper.insertIUser(iUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
package com.ruoyi.task;
|
|
||||||
|
|
||||||
|
|
||||||
import com.ruoyi.invest.service.IMTService;
|
|
||||||
import com.ruoyi.invest.service.IUserService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.scheduling.annotation.Async;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* i茅台定时任务
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
@EnableScheduling
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class CampusIMTTask {
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(CampusIMTTask.class);
|
|
||||||
|
|
||||||
private final IMTService imtService;
|
|
||||||
|
|
||||||
private final IUserService iUserService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1:10 批量修改用户随机预约的时间
|
|
||||||
*/
|
|
||||||
@Async
|
|
||||||
@Scheduled(cron = "0 10 1 ? * * ")
|
|
||||||
public void updateUserMinuteBatch() {
|
|
||||||
iUserService.updateUserMinuteBatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 11点期间,每分钟执行一次批量获得旅行奖励
|
|
||||||
*/
|
|
||||||
@Async
|
|
||||||
@Scheduled(cron = "0 0/1 11 ? * *")
|
|
||||||
public void getTravelRewardBatch() {
|
|
||||||
imtService.getTravelRewardBatch();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 9点期间,每分钟执行一次
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 0/1 9 ? * *")
|
|
||||||
public void reservationBatchTask() {
|
|
||||||
imtService.reservationBatch();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 10,55 7,8 ? * * ")
|
|
||||||
public void refresh() {
|
|
||||||
logger.info("「刷新数据」开始刷新版本号,预约item,门店shop列表 ");
|
|
||||||
try {
|
|
||||||
imtService.refreshAll();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.info("「刷新数据执行报错」%s", e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 18.05分获取申购结果
|
|
||||||
*/
|
|
||||||
@Async
|
|
||||||
@Scheduled(cron = "0 5 18 ? * * ")
|
|
||||||
public void appointmentResults() {
|
|
||||||
imtService.appointmentResults();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -21,9 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectIItemVo"/>
|
<include refid="selectIItemVo"/>
|
||||||
<where>
|
<where>
|
||||||
a.del_flag='0'
|
a.del_flag='0'
|
||||||
<if test="itemCode != null and itemCode != ''"> and a.item_code = #{itemCode}</if>
|
<if test="itemCode != null and itemCode != ''"> and a.item_code like '%'|| #{itemCode}||'%'</if>
|
||||||
<if test="title != null and title != ''"> and a.title = #{title}</if>
|
<if test="title != null and title != ''"> and a.title like '%'|| #{title}||'%'</if>
|
||||||
<if test="content != null and content != ''"> and a.content = #{content}</if>
|
<if test="content != null and content != ''"> and a.content like '%'|| #{content}||'%'</if>
|
||||||
</where>
|
</where>
|
||||||
order by a.create_time desc
|
order by a.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
<include refid="selectILogVo"/>
|
<include refid="selectILogVo"/>
|
||||||
<where>
|
<where>
|
||||||
a.del_flag='0'
|
a.del_flag='0'
|
||||||
<if test="mobile != null "> and a.mobile = #{mobile}</if>
|
<if test="mobile != null and mobile != ''"> and a.mobile like '%'|| #{mobile}||'%'</if>
|
||||||
<if test="logContent != null and logContent != ''"> and a.log_content = #{logContent}</if>
|
<if test="logContent != null and logContent != ''"> and a.log_content like '%'|| #{logContent}||'%'</if>
|
||||||
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
||||||
<if test="operTime != null "> and a.oper_time = #{operTime}</if>
|
<if test="operTime != null "> and a.oper_time = #{operTime}</if>
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<include refid="selectIUserVo"/>
|
<include refid="selectIUserVo"/>
|
||||||
<where>
|
<where>
|
||||||
a.del_flag='0'
|
a.del_flag='0'
|
||||||
<if test="mobile != null "> and a.mobile = #{mobile}</if>
|
<if test="mobile != null and mobile != ''"> and a.mobile like '%'|| #{mobile}||'%'</if>
|
||||||
<if test="token != null and token != ''"> and a.token = #{token}</if>
|
<if test="token != null and token != ''"> and a.token = #{token}</if>
|
||||||
<if test="cookie != null and cookie != ''"> and a.cookie = #{cookie}</if>
|
<if test="cookie != null and cookie != ''"> and a.cookie = #{cookie}</if>
|
||||||
<if test="deviceId != null and deviceId != ''"> and a.device_id = #{deviceId}</if>
|
<if test="deviceId != null and deviceId != ''"> and a.device_id = #{deviceId}</if>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
order by a.create_time desc
|
order by a.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectIUserByMobile" parameterType="Long" resultMap="IUserResult">
|
<select id="selectIUserByMobile" parameterType="String" resultMap="IUserResult">
|
||||||
<include refid="selectIUserVo"/>
|
<include refid="selectIUserVo"/>
|
||||||
where a.mobile = #{mobile}
|
where a.mobile = #{mobile}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user