fix: 投资系统,茅台预约,自测问题修复。

This commit is contained in:
tianyongbao
2024-12-07 23:54:15 +08:00
parent 6d363c3d92
commit 3eee4db432
14 changed files with 33 additions and 105 deletions

View File

@@ -71,7 +71,7 @@ public class IUserController extends BaseController {
*/
@GetMapping(value = "/reservation", name = "预约")
public R reservation(String mobile) {
IUser user = iUserMapper.selectIUserByMobile(Long.parseLong(mobile));
IUser user = iUserMapper.selectIUserByMobile((mobile));
if (user == null) {
return R.fail("用户不存在");
}
@@ -88,7 +88,7 @@ public class IUserController extends BaseController {
*/
@GetMapping(value = "/travelReward", name = "旅行")
public R travelReward(String mobile) {
IUser user = iUserMapper.selectIUserByMobile(Long.parseLong(mobile));
IUser user = iUserMapper.selectIUserByMobile((mobile));
if (user == null) {
return R.fail("用户不存在");
} else {
@@ -113,7 +113,7 @@ public class IUserController extends BaseController {
*/
@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));
}

View File

@@ -31,7 +31,7 @@ public class ILog extends BaseEntity
/** 用户 */
@ApiModelProperty(value="用户")
@Excel(name = "用户")
private Long mobile;
private String mobile;
/** 日志记录内容 */
@ApiModelProperty(value="日志记录内容")
@@ -52,7 +52,7 @@ public class ILog extends BaseEntity
/** 创建者id */
@ApiModelProperty(value="创建者id")
@Excel(name = "创建者id")
private Long createUser;
private String createUser;
@Override
public String toString() {

View File

@@ -23,12 +23,12 @@ public class IUser extends BaseEntity
private static final long serialVersionUID = 1L;
/** 手机号 */
private Long mobile;
private String mobile;
/** 用户id */
@ApiModelProperty(value="用户id")
@Excel(name = "用户id")
private Long userId;
private String userId;
/** token */
private String token;

View File

@@ -21,12 +21,13 @@ public class ILogDto implements Serializable
/** 用户 */
@ApiModelProperty(value="用户")
private Long mobile;
private String mobile;
/** 日志记录内容 */
@ApiModelProperty(value="日志记录内容")
private String logContent;
/** 操作状态 */
@ApiModelProperty(value="操作状态")
private String status;

View File

@@ -21,7 +21,7 @@ public class IUserDto implements Serializable
/** 手机号 */
@ApiModelProperty(value="手机号")
private Long mobile;
private String mobile;
/** token */
@ApiModelProperty(value="token")

View File

@@ -20,7 +20,7 @@ public interface IUserMapper
* @param mobile 用户管理主键
* @return 用户管理
*/
public IUserVo selectIUserByMobile(Long mobile);
public IUserVo selectIUserByMobile(String mobile);
/**
* 查询用户管理列表

View File

@@ -17,7 +17,7 @@ public interface IUserService {
* @param body
* @return
*/
int insertIUser(Long mobile, String deviceId, JSONObject body);
int insertIUser(String mobile, String deviceId, JSONObject body);
/**
* 查询预约用户列表

View File

@@ -3,14 +3,15 @@ package com.ruoyi.invest.service.impl;
import com.ruoyi.common.core.utils.IdWorker;
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.vo.ILogVo;
import com.ruoyi.invest.domain.ILog;
import com.ruoyi.invest.mapper.ILogMapper;
import com.ruoyi.invest.service.IMTLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
@@ -55,6 +56,7 @@ public class IMTLogServiceImpl implements IMTLogService {
public int insertILog(ILog iLog)
{
iLog.setCreateBy(SecurityUtils.getUsername());
iLog.setCreateTime(new Date());
iLog.setLogId(IdWorker.getId());
return iLogMapper.insertILog(iLog);
}

View File

@@ -148,7 +148,7 @@ public class IMTServiceImpl implements IMTService {
HttpRequest request = HttpUtil.createRequest(Method.POST,
"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) {
deviceId = user.getDeviceId();
}
@@ -163,7 +163,7 @@ public class IMTServiceImpl implements IMTService {
if (body.getString("code").equals("2000")) {
// logger.info("「登录请求-成功」" + body.toJSONString());
iUserService.insertIUser(Long.parseLong(mobile), deviceId, body);
iUserService.insertIUser(mobile, deviceId, body);
return true;
} else {
logger.error("「登录请求-失败」" + body.toJSONString());

View File

@@ -25,13 +25,13 @@ public class IUserServiceImpl implements IUserService {
@Override
public int insertIUser(Long mobile, String deviceId, JSONObject jsonObject) {
public int insertIUser(String mobile, String deviceId, JSONObject jsonObject) {
IUser user = iUserMapper.selectIUserByMobile(mobile);
if (user != null) {
JSONObject result = jsonObject.getJSONObject("data");
user.setUserId(result.getLong("userId"));
user.setUserId(result.getString("userId"));
user.setToken(result.getString("token"));
user.setMobile(mobile);
@@ -45,6 +45,8 @@ public class IUserServiceImpl implements IUserService {
Date thirtyDaysLater = calendar.getTime();
user.setExpireTime(thirtyDaysLater);
user.setCreateUser(SecurityUtils.getUserId());
user.setUpdateUser(SecurityUtils.getUsername());
user.setUpdateTime(new Date());
return iUserMapper.updateIUser(user);
} else {
@@ -53,7 +55,7 @@ public class IUserServiceImpl implements IUserService {
}
IUser iUser=new IUser();
JSONObject result = jsonObject.getJSONObject("data");
iUser.setUserId(result.getLong("userId"));
iUser.setUserId(result.getString("userId"));
iUser.setToken(result.getString("token"));
iUser.setMobile(mobile);
@@ -68,6 +70,8 @@ public class IUserServiceImpl implements IUserService {
iUser.setExpireTime(thirtyDaysLater);
iUser.setCreateUser(SecurityUtils.getUserId());
iUser.setCreateBy(SecurityUtils.getUsername());
iUser.setCreateTime(new Date());
return iUserMapper.insertIUser(iUser);
}
@@ -99,6 +103,8 @@ public class IUserServiceImpl implements IUserService {
iUser.setDeviceId(UUID.randomUUID().toString().toLowerCase());
}
iUser.setCreateUser(SecurityUtils.getUserId());
iUser.setCreateBy(SecurityUtils.getUsername());
iUser.setCreateTime(new Date());
return iUserMapper.insertIUser(iUser);
}

View File

@@ -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;
/**
* 110 批量修改用户随机预约的时间
*/
@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();
}
}

View File

@@ -21,9 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectIItemVo"/>
<where>
a.del_flag='0'
<if test="itemCode != null and itemCode != ''"> and a.item_code = #{itemCode}</if>
<if test="title != null and title != ''"> and a.title = #{title}</if>
<if test="content != null and content != ''"> and a.content = #{content}</if>
<if test="itemCode != null and itemCode != ''"> and a.item_code like '%'|| #{itemCode}||'%'</if>
<if test="title != null and title != ''"> and a.title like '%'|| #{title}||'%'</if>
<if test="content != null and content != ''"> and a.content like '%'|| #{content}||'%'</if>
</where>
order by a.create_time desc
</select>

View File

@@ -22,8 +22,8 @@
<include refid="selectILogVo"/>
<where>
a.del_flag='0'
<if test="mobile != null "> and a.mobile = #{mobile}</if>
<if test="logContent != null and logContent != ''"> and a.log_content = #{logContent}</if>
<if test="mobile != null and mobile != ''"> and a.mobile like '%'|| #{mobile}||'%'</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="operTime != null "> and a.oper_time = #{operTime}</if>
</where>

View File

@@ -40,7 +40,7 @@
<include refid="selectIUserVo"/>
<where>
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="cookie != null and cookie != ''"> and a.cookie = #{cookie}</if>
<if test="deviceId != null and deviceId != ''"> and a.device_id = #{deviceId}</if>
@@ -63,7 +63,7 @@
order by a.create_time desc
</select>
<select id="selectIUserByMobile" parameterType="Long" resultMap="IUserResult">
<select id="selectIUserByMobile" parameterType="String" resultMap="IUserResult">
<include refid="selectIUserVo"/>
where a.mobile = #{mobile}
</select>