feat:江体小程序
This commit is contained in:
@@ -23,7 +23,7 @@ public class DomainDynamicAnalysisTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.DOMAIN_DYNAMIC_ANALYSIS_TASK.getModeleCode();
|
||||
return ScheduleEnums.DOMAIN_DYNAMIC_ANALYSIS_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ public class GladosCheckInTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.GLADOS_CHECK_IN_TASK.getModeleCode();
|
||||
return ScheduleEnums.GLADOS_CHECK_IN_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.constants;
|
||||
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-16 10:43
|
||||
*/
|
||||
public class RedisKeyConstant {
|
||||
|
||||
public static final String JNTYZX_ORDER_CREATE_KEY = "jntyzx:order:create:orderId:";
|
||||
|
||||
public static final String JNTUZX_ORDER_PEEK_KEY = "jntyzx:order:peek:user:";
|
||||
|
||||
public static final String JNTYZX_VENUE_MSG_SEND_KEY = "jntyzx:order:venue:msg:send";
|
||||
|
||||
private static final String JNTYZX_VENUE_SUBSCRIBE_KEY = "jntyzx:venue:subscribe:";
|
||||
|
||||
private static final String JNTYZX_ORDER_CLOSE_CARD_KEY = "jntyzx:order:close:card:";
|
||||
|
||||
public static String getCloseCardKey(String username) {
|
||||
return JNTYZX_ORDER_CLOSE_CARD_KEY + username + ":" +getDate();
|
||||
}
|
||||
|
||||
public static String getVenueSubscribeKey(String placeName) {
|
||||
return JNTYZX_VENUE_SUBSCRIBE_KEY + placeName + ":" + getDate();
|
||||
}
|
||||
|
||||
public static String getDate() {
|
||||
LocalDate now = LocalDate.now();
|
||||
return ":" + DateUtils.getDateFromDate(now);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.constants;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-15 13:46
|
||||
*/
|
||||
public class UrlConstant {
|
||||
|
||||
/**
|
||||
* 江南体育中心基础URL
|
||||
*/
|
||||
private final static String GNTYZX_BASE_URL = "https://jntyzx.cn:8443";
|
||||
|
||||
/**
|
||||
* 查询当天的场地信息
|
||||
*/
|
||||
public final static String QUERY_TODAY_SUBSCRIBE_URL = GNTYZX_BASE_URL + "/GYM-JN/multi/Subscribe/getSubscribeByToday";
|
||||
/**
|
||||
* 查询明天场地信息
|
||||
*/
|
||||
public final static String QUERY_TOMORROW_SUBSCRIBE_URL = GNTYZX_BASE_URL + "/GYM-JN/multi/Subscribe/getSubscribeByTomorrow";
|
||||
|
||||
/**
|
||||
* 订阅场地
|
||||
*/
|
||||
public final static String ADD_SUBSCRIBE = GNTYZX_BASE_URL + "/GYM-JN/multi/Subscribe/addSubscribe";
|
||||
|
||||
/**
|
||||
* 订单信息
|
||||
*/
|
||||
public final static String ORDER_INFO = GNTYZX_BASE_URL + "/GYM-JN/multi/busiOrder/queryOrderInfo";
|
||||
|
||||
/**
|
||||
* 心跳监测接口
|
||||
*/
|
||||
public final static String HEALTH_DECLARATION = GNTYZX_BASE_URL + "/GYM-JN//busi/healthDeclaration/addUserPrivacy";
|
||||
|
||||
/**
|
||||
* 校验会员卡状态
|
||||
*/
|
||||
public final static String CHECK_NUM = GNTYZX_BASE_URL + "/GYM-JN/multi/Subscribe/checkDefaultsNum";
|
||||
|
||||
/**
|
||||
* 根据openId查询会员卡信息
|
||||
*/
|
||||
public final static String QUERY_BY_OPEN_ID = GNTYZX_BASE_URL + "/GYM-JN/multi/xfConsumer/queryByOpenId";
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.converts;
|
||||
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.JtUserVo;
|
||||
import com.xiang.service.module.jntyzx.miniapp.entity.pojo.UserTokenInfoDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Named;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface UserConverter {
|
||||
|
||||
UserConverter INSTANCE = Mappers.getMapper(UserConverter.class);
|
||||
@Mapping(source = "id", target = "userId")
|
||||
@Mapping(source = "isOrder", target = "isOrder", qualifiedByName = "isOrder")
|
||||
@Mapping(source = "isRestriction", target = "isRestriction", qualifiedByName = "isRestrict")
|
||||
JtUserVo convert(UserTokenInfoDO userTokenInfoDO);
|
||||
List<JtUserVo> convert(List<UserTokenInfoDO> userTokenInfoDOs);
|
||||
|
||||
@Named("isOrder")
|
||||
default Boolean isOrder(Integer value) {
|
||||
return Objects.nonNull(value) && Objects.equals(value, 1);
|
||||
}
|
||||
|
||||
@Named("isRestrict")
|
||||
default Boolean isRestrict(Integer value) {
|
||||
return Objects.nonNull(value) && Objects.equals(value, 0);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.converts;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.VenueInfoQueryResp;
|
||||
import com.xiang.service.module.jntyzx.miniapp.entity.pojo.VenueInfoDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-04-09 09:54
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface VenueInfoConverter {
|
||||
|
||||
Page<VenueInfoQueryResp> toPage(Page<VenueInfoDO> page);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.OrderInfoDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-16 10:59
|
||||
*/
|
||||
public interface IOrderCreateInfoManage extends IService<OrderInfoDO> {
|
||||
|
||||
|
||||
List<OrderInfoDO> queryNoPayOrder();
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserRestrictionInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IUserRestrictionManage extends IService<UserRestrictionInfo> {
|
||||
|
||||
UserRestrictionInfo queryByUserId(Long userId);
|
||||
|
||||
List<UserRestrictionInfo> queryByIdList(List<Long> idList);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.UserQueryReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-16 09:19
|
||||
*/
|
||||
public interface IUserTokenInfoManage extends IService<UserTokenInfoDO> {
|
||||
List<UserTokenInfoDO> listUser();
|
||||
UserTokenInfoDO getByName(String name);
|
||||
|
||||
List<UserTokenInfoDO> listCanOrder();
|
||||
|
||||
List<UserTokenInfoDO> queryByList(UserQueryReq req);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.VenueInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.VenueInfoQueryRequest;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-15 15:50
|
||||
*/
|
||||
public interface IVenueInfoManage extends IService<VenueInfoDO> {
|
||||
|
||||
List<VenueInfoDO> queryByDate(LocalDate date);
|
||||
|
||||
List<VenueInfoDO> queryByType(LocalDate date, Integer type);
|
||||
|
||||
Page<VenueInfoDO> page(VenueInfoQueryRequest request);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.OrderInfoDO;
|
||||
import com.xiang.service.module.jntyzx.miniapp.mapper.JntyzxOrderCreateInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-16 10:59
|
||||
*/
|
||||
@Service
|
||||
public class OrderCreateInfoManageImpl extends ServiceImpl<JntyzxOrderCreateInfoMapper, OrderInfoDO> implements IOrderCreateInfoManage {
|
||||
|
||||
|
||||
@Override
|
||||
public List<OrderInfoDO> queryNoPayOrder() {
|
||||
LambdaQueryWrapper<OrderInfoDO> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(OrderInfoDO::getOrderStatus, 0);
|
||||
return baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserRestrictionInfo;
|
||||
import com.xiang.service.module.jntyzx.miniapp.mapper.JntyzxUserRestrictionInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserRestrictionManageImpl extends ServiceImpl<JntyzxUserRestrictionInfoMapper, UserRestrictionInfo> implements IUserRestrictionManage {
|
||||
@Override
|
||||
public UserRestrictionInfo queryByUserId(Long userId) {
|
||||
LambdaQueryWrapper<UserRestrictionInfo> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(UserRestrictionInfo::getUserId, userId);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserRestrictionInfo> queryByIdList(List<Long> idList) {
|
||||
LambdaQueryWrapper<UserRestrictionInfo> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.in(UserRestrictionInfo::getUserId, idList);
|
||||
return baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.UserQueryReq;
|
||||
import com.xiang.service.module.jntyzx.miniapp.mapper.JntyzxUserTokenInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-16 09:19
|
||||
*/
|
||||
@Service
|
||||
public class UserTokenInfoManageImpl extends ServiceImpl<JntyzxUserTokenInfoMapper, UserTokenInfoDO> implements IUserTokenInfoManage {
|
||||
@Override
|
||||
public List<UserTokenInfoDO> listUser() {
|
||||
LambdaQueryWrapper<UserTokenInfoDO> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getStatus, 1);
|
||||
return baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserTokenInfoDO getByName(String name) {
|
||||
LambdaQueryWrapper<UserTokenInfoDO> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getStatus, 1);
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getName, name);
|
||||
lambdaQueryWrapper.last("limit 1");
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserTokenInfoDO> listCanOrder() {
|
||||
LambdaQueryWrapper<UserTokenInfoDO> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getStatus, 1);
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getIsOrder, 1);
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getIsRestriction, 0);
|
||||
return baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserTokenInfoDO> queryByList(UserQueryReq req) {
|
||||
LambdaQueryWrapper<UserTokenInfoDO> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotBlank(req.getName())) {
|
||||
lambdaQueryWrapper.like(UserTokenInfoDO::getName, req.getName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(req.getOpenId())) {
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getOpenId, req.getOpenId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(req.getMemberCardNo())) {
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getMemberCardNo, req.getMemberCardNo());
|
||||
}
|
||||
if (Objects.nonNull(req.getStatus())) {
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getStatus, req.getStatus());
|
||||
}
|
||||
if (Objects.nonNull(req.getIsRestriction())) {
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getIsRestriction, req.getIsRestriction());
|
||||
}
|
||||
if (Objects.nonNull(req.getIsOrder())) {
|
||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getIsOrder, req.getIsOrder());
|
||||
}
|
||||
return baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.VenueInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.VenueInfoQueryRequest;
|
||||
import com.xiang.service.module.jntyzx.miniapp.mapper.JntyzxVenueInfoMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-15 15:51
|
||||
*/
|
||||
@Service
|
||||
public class VenueInfoManageImpl extends ServiceImpl<JntyzxVenueInfoMapper, VenueInfoDO> implements IVenueInfoManage {
|
||||
|
||||
public List<VenueInfoDO> queryByDate(LocalDate date) {
|
||||
LambdaQueryWrapper<VenueInfoDO> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(VenueInfoDO::getDate, date);
|
||||
return baseMapper.selectList(lqw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VenueInfoDO> queryByType(LocalDate date, Integer type) {
|
||||
LambdaQueryWrapper<VenueInfoDO> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(VenueInfoDO::getDate, date);
|
||||
lqw.eq(VenueInfoDO::getType, type);
|
||||
return baseMapper.selectList(lqw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<VenueInfoDO> page(VenueInfoQueryRequest request) {
|
||||
Page<VenueInfoDO> page = new Page<>(request.getCurrent(), request.getPageSize());
|
||||
LambdaQueryWrapper<VenueInfoDO> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(VenueInfoDO::getDate, request.getDate());
|
||||
if (StringUtils.isNotBlank(request.getSj())) {
|
||||
lqw.eq(VenueInfoDO::getSjName, request.getSj());
|
||||
}
|
||||
if (StringUtils.isNotBlank(request.getPlaceName())) {
|
||||
lqw.like(VenueInfoDO::getPlaceName, request.getPlaceName());
|
||||
}
|
||||
return baseMapper.selectPage(page, lqw);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.OrderInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-16 10:58
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface JntyzxOrderCreateInfoMapper extends BaseMapper<OrderInfoDO> {
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserRestrictionInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface JntyzxUserRestrictionInfoMapper extends BaseMapper<UserRestrictionInfo> {
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-16 09:18
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface JntyzxUserTokenInfoMapper extends BaseMapper<UserTokenInfoDO> {
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.VenueInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2025-12-15 15:48
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface JntyzxVenueInfoMapper extends BaseMapper<VenueInfoDO> {
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.schedule;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-05-09 08:56
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
public class JntyzxMiniappScheduleConfig {
|
||||
|
||||
private final JtTokenRefreshTask jtTokenRefreshTask;
|
||||
private final JtVenuePullTask jtVenuePullTask;
|
||||
private final JtVenueSubscribeTask jtVenueSubscribeTask;
|
||||
private final JtVenueTomorrowPullTask jtVenueTomorrowPullTask;
|
||||
|
||||
|
||||
@Scheduled(cron = "0 20,50 * * * ?")
|
||||
@GetMapping("/jtTokenRefreshTask")
|
||||
public void jtTokenRefreshTask() {
|
||||
jtTokenRefreshTask.run();
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0/1 10-18 * * ?")
|
||||
@GetMapping("/jtVenuePullTask")
|
||||
public void jtVenuePullTask() {
|
||||
jtVenuePullTask.run();
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 30 8 * * ?")
|
||||
@GetMapping("/jtVenueTomorrowPullTask")
|
||||
public void jtVenueTomorrowPullTask() {
|
||||
jtVenueTomorrowPullTask.run();
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 40 8 * * ?")
|
||||
@GetMapping("/jtUserInfoConfig")
|
||||
public void jtUserInfoConfig() {
|
||||
|
||||
}
|
||||
|
||||
@Scheduled(cron = "5 0 9 * * ?")
|
||||
@GetMapping("/jtVenueSubscribeTask")
|
||||
public void jtVenueSubscribeTask() {
|
||||
jtVenueSubscribeTask.run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.schedule;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.xiang.common.enums.ScheduleEnums;
|
||||
import com.xiang.common.factory.JntyzxDingTalkFactory;
|
||||
import com.xiang.common.factory.schedule.BaseScheduleTaskTemplate;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.VenueInfoDO;
|
||||
import com.xiang.common.pojo.schedule.TaskResult;
|
||||
import com.xiang.common.service.IScheduleOpeningConfigService;
|
||||
import com.xiang.common.service.IScheduleRunLogService;
|
||||
import com.xiang.common.utils.DateUtils;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IUserInfoService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IUserTokenInfoService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IVenueService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.utils.VenueInfoUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-05-09 09:58
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class JntyzxUserInfoConfigTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
private final IUserTokenInfoService userTokenInfoService;
|
||||
private final IVenueService venueService;
|
||||
private final IUserInfoService userInfoService;
|
||||
private final JntyzxDingTalkFactory jntyzxDingTalkFactory;
|
||||
|
||||
public JntyzxUserInfoConfigTask(IScheduleOpeningConfigService scheduleOpeningConfigService,
|
||||
IScheduleRunLogService scheduleRunLogService,
|
||||
IUserTokenInfoService userTokenInfoService,
|
||||
IVenueService venueService,
|
||||
IUserInfoService userInfoService,
|
||||
JntyzxDingTalkFactory jntyzxDingTalkFactory) {
|
||||
super(scheduleOpeningConfigService, scheduleRunLogService);
|
||||
this.userTokenInfoService = userTokenInfoService;
|
||||
this.venueService = venueService;
|
||||
this.userInfoService = userInfoService;
|
||||
this.jntyzxDingTalkFactory = jntyzxDingTalkFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTaskName() {
|
||||
return ScheduleEnums.JNTYZX_USER_INFO_CONFIG.getTaskName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.JNTYZX_USER_INFO_CONFIG.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getModuleName() {
|
||||
return ScheduleEnums.JNTYZX_USER_INFO_CONFIG.getModule();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TaskResult doExecute(Object validatedParams) throws Exception {
|
||||
TaskResult taskResult = new TaskResult();
|
||||
taskResult.setSuccess(false);
|
||||
List<VenueInfoDO> venueInfoDOS = venueService.queryCanBuyVenue();
|
||||
if (CollectionUtils.isEmpty(venueInfoDOS)) {
|
||||
taskResult.setSummary("无可用场地");
|
||||
return taskResult;
|
||||
}
|
||||
venueInfoDOS = venueInfoDOS.stream().filter(VenueInfoUtils::get628VenueInfo).toList();
|
||||
if (CollectionUtils.isEmpty(venueInfoDOS)) {
|
||||
taskResult.setSummary("无可用场地");
|
||||
return taskResult;
|
||||
}
|
||||
|
||||
List<UserTokenInfoDO> users = userTokenInfoService.getCanOrderUser();
|
||||
if (CollectionUtils.isEmpty(users)) {
|
||||
taskResult.setSummary("无可用用户");
|
||||
return taskResult;
|
||||
}
|
||||
|
||||
List<UserInfoDO> list = Lists.newArrayList();
|
||||
int i = 0;
|
||||
for (UserTokenInfoDO user : users) {
|
||||
VenueInfoDO venueInfoDO = venueInfoDOS.get(i);
|
||||
UserInfoDO userInfoDO = new UserInfoDO();
|
||||
userInfoDO.setName(user.getName());
|
||||
userInfoDO.setWeek(DateUtils.getWeekDay(venueInfoDO.getDate()));
|
||||
userInfoDO.setType("1");
|
||||
userInfoDO.setPlaceName(venueInfoDO.getPlaceName());
|
||||
userInfoDO.setSiteTimeName(venueInfoDO.getSjName().split("-")[0]);
|
||||
userInfoDO.setIsBook(0);
|
||||
list.add(userInfoDO);
|
||||
i++;
|
||||
if (i == venueInfoDOS.size()) {
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
userInfoService.batchSave(list);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (UserInfoDO user : list) {
|
||||
stringBuilder.append(user.getName()).append("配置预约:").append(user.getPlaceName()).append("\n");
|
||||
}
|
||||
jntyzxDingTalkFactory.sendMsg(stringBuilder.toString());
|
||||
taskResult.setSuccess(Boolean.TRUE);
|
||||
taskResult.setSummary(stringBuilder.toString());
|
||||
}
|
||||
return taskResult;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.schedule;
|
||||
|
||||
import com.xiang.common.enums.ScheduleEnums;
|
||||
import com.xiang.common.factory.schedule.BaseScheduleTaskTemplate;
|
||||
import com.xiang.common.pojo.schedule.TaskResult;
|
||||
import com.xiang.common.service.IScheduleOpeningConfigService;
|
||||
import com.xiang.common.service.IScheduleRunLogService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IUserTokenInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-01-15 17:29
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RestController
|
||||
public class JtTokenRefreshTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
private final IUserTokenInfoService userTokenInfoService;
|
||||
|
||||
public JtTokenRefreshTask(IScheduleOpeningConfigService scheduleOpeningConfigService,
|
||||
IScheduleRunLogService scheduleRunLogService,
|
||||
IUserTokenInfoService userTokenInfoService) {
|
||||
super(scheduleOpeningConfigService, scheduleRunLogService);
|
||||
this.userTokenInfoService = userTokenInfoService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTaskName() {
|
||||
return ScheduleEnums.JNTYZX_TOKEN_REFRESH_TASK.getTaskName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.JNTYZX_TOKEN_REFRESH_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getModuleName() {
|
||||
return ScheduleEnums.JNTYZX_TOKEN_REFRESH_TASK.getModule();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TaskResult doExecute(Object validatedParams) throws Exception {
|
||||
TaskResult taskResult = new TaskResult();
|
||||
|
||||
log.info("【Token】江南体育中心token续期定时任务启动!!!time:{}", System.currentTimeMillis());
|
||||
userTokenInfoService.flushToken();
|
||||
|
||||
taskResult.setSuccess(true);
|
||||
taskResult.setSummary("江体小程序token刷新成功");
|
||||
return taskResult;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.schedule;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.xiang.common.enums.RedisKeyConstant;
|
||||
import com.xiang.common.enums.ScheduleEnums;
|
||||
import com.xiang.common.factory.schedule.BaseScheduleTaskTemplate;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.query.SitePositionList;
|
||||
import com.xiang.common.pojo.schedule.TaskResult;
|
||||
import com.xiang.common.service.IScheduleOpeningConfigService;
|
||||
import com.xiang.common.service.IScheduleRunLogService;
|
||||
import com.xiang.common.utils.DateUtils;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IJntyzxHttpService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IUserTokenInfoService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IVenueService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.utils.MsgSendUtils;
|
||||
import com.xiang.service.module.jntyzx.miniapp.utils.VenueInfoUtils;
|
||||
import com.xiang.service.module.jntyzx.miniapp.utils.WeekendUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 每日9:00-19:00场地更新信息查询
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class JtVenuePullTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
private final IUserTokenInfoService userTokenInfoService;
|
||||
private final IJntyzxHttpService jntyzxHttpService;
|
||||
private final IVenueService venueService;
|
||||
private final MsgSendUtils msgSendUtils;
|
||||
|
||||
public JtVenuePullTask(IScheduleOpeningConfigService scheduleOpeningConfigService,
|
||||
IScheduleRunLogService scheduleRunLogService,
|
||||
IUserTokenInfoService userTokenInfoService,
|
||||
IJntyzxHttpService jntyzxHttpService,
|
||||
IVenueService venueService,
|
||||
MsgSendUtils msgSendUtils) {
|
||||
super(scheduleOpeningConfigService, scheduleRunLogService);
|
||||
this.userTokenInfoService = userTokenInfoService;
|
||||
this.jntyzxHttpService = jntyzxHttpService;
|
||||
this.venueService = venueService;
|
||||
this.msgSendUtils = msgSendUtils;
|
||||
}
|
||||
|
||||
private List<SitePositionList> handleMsgSendList(List<SitePositionList> sitePositionLists, int dayOfWeek) {
|
||||
// 过滤出来8-10的未订购的场地信息
|
||||
sitePositionLists = sitePositionLists.stream()
|
||||
.filter(VenueInfoUtils::get8210VenueInfo)
|
||||
.filter(item -> StringUtils.equals(item.getContacts(), "0")).toList();
|
||||
// 周六周日过滤小馆,不查询当天小馆信息
|
||||
if (dayOfWeek == 6 || dayOfWeek == 7) {
|
||||
return sitePositionLists.stream()
|
||||
.filter(item -> !item.getPlaceName().contains("小馆"))
|
||||
.toList();
|
||||
}
|
||||
Map<String, SitePositionList> mapByName = Maps.newLinkedHashMap();
|
||||
for (SitePositionList sitePositionList : sitePositionLists) {
|
||||
if (!mapByName.containsKey(sitePositionList.getPlaceName())) {
|
||||
mapByName.put(sitePositionList.getPlaceName(), sitePositionList);
|
||||
}
|
||||
}
|
||||
return mapByName.values().stream().toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTaskName() {
|
||||
return ScheduleEnums.JNTYZX_VENUE_INFO_PULL_TASK.getTaskName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.JNTYZX_VENUE_INFO_PULL_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getModuleName() {
|
||||
return ScheduleEnums.JNTYZX_VENUE_INFO_PULL_TASK.getModule();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TaskResult doExecute(Object validatedParams) throws Exception {
|
||||
|
||||
TaskResult taskResult = new TaskResult();
|
||||
taskResult.setSuccess(false);
|
||||
log.info("【Venue】江体小程序场地数据拉取定时任务启动!!!time:{}", System.currentTimeMillis());
|
||||
List<UserTokenInfoDO> availableUser = userTokenInfoService.getAvailableUser();
|
||||
if (CollectionUtils.isEmpty(availableUser)) {
|
||||
log.info("当前无可用用户查询场地信息!");
|
||||
taskResult.setSuccess(true);
|
||||
taskResult.setSummary("当前无可用用户查询场地信息!");
|
||||
return taskResult;
|
||||
}
|
||||
String token;
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
int dayOfWeek = now.getDayOfWeek().getValue();
|
||||
|
||||
for (UserTokenInfoDO userTokenInfoDO : availableUser) {
|
||||
if (Objects.isNull(userTokenInfoDO)) {
|
||||
continue;
|
||||
}
|
||||
token = userTokenInfoDO.getToken();
|
||||
if (StringUtils.isBlank(token)) {
|
||||
continue;
|
||||
}
|
||||
List<SitePositionList> sitePositionLists = jntyzxHttpService.queryAvailable(WeekendUtils.isWeekend(), token);
|
||||
if (CollectionUtils.isEmpty(sitePositionLists)) {
|
||||
continue;
|
||||
}
|
||||
venueService.saveOrUpdateTodayVenueInfo(sitePositionLists);
|
||||
|
||||
sitePositionLists = handleMsgSendList(sitePositionLists, dayOfWeek);
|
||||
if (CollectionUtils.isEmpty(sitePositionLists)) {
|
||||
taskResult.setSuccess(true);
|
||||
taskResult.setSummary("当前无场地信息!");
|
||||
return taskResult;
|
||||
}
|
||||
|
||||
StringBuffer msg = new StringBuffer(
|
||||
"查询到20:00-22:00空闲场地信息=====>\n时间:" + DateUtils.getDateFromDate(LocalDate.now()) + "\n");
|
||||
sitePositionLists.forEach(item -> {
|
||||
msg.append(item.getPlaceName()).append("\n");
|
||||
});
|
||||
|
||||
String key = RedisKeyConstant.JNTYZX_VENUE_MSG_SEND_KEY + RedisKeyConstant.getDate();
|
||||
msgSendUtils.sendMsgRestrict1Hours(key, msg.toString());
|
||||
taskResult.setSuccess(true);
|
||||
taskResult.setSummary("查询场地信息成功!时间:" + now);
|
||||
return taskResult;
|
||||
}
|
||||
return taskResult;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.schedule;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.xiang.common.enums.RedisKeyConstant;
|
||||
import com.xiang.common.enums.ScheduleEnums;
|
||||
import com.xiang.common.factory.JntyzxDingTalkFactory;
|
||||
import com.xiang.common.factory.schedule.BaseScheduleTaskTemplate;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.VenueInfoDO;
|
||||
import com.xiang.common.pojo.schedule.TaskResult;
|
||||
import com.xiang.common.service.IScheduleOpeningConfigService;
|
||||
import com.xiang.common.service.IScheduleRunLogService;
|
||||
import com.xiang.common.utils.RedisService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IJtOrderService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IUserTokenInfoService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IVenueService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.utils.VenueInfoUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RestController
|
||||
public class JtVenueSubscribeTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
private final IUserTokenInfoService userTokenInfoService;
|
||||
private final IJtOrderService jtOrderService;
|
||||
private final IVenueService venueService;
|
||||
private final JntyzxDingTalkFactory jtDingTalkFactory;
|
||||
private final RedisService redisService;
|
||||
|
||||
public JtVenueSubscribeTask(IScheduleOpeningConfigService scheduleOpeningConfigService,
|
||||
IScheduleRunLogService scheduleRunLogService,
|
||||
IUserTokenInfoService userTokenInfoService,
|
||||
IJtOrderService jtOrderService,
|
||||
IVenueService venueService,
|
||||
JntyzxDingTalkFactory jtDingTalkFactory,
|
||||
RedisService redisService) {
|
||||
super(scheduleOpeningConfigService, scheduleRunLogService);
|
||||
this.userTokenInfoService = userTokenInfoService;
|
||||
this.jtOrderService = jtOrderService;
|
||||
this.venueService = venueService;
|
||||
this.jtDingTalkFactory = jtDingTalkFactory;
|
||||
this.redisService = redisService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTaskName() {
|
||||
return ScheduleEnums.JNTYZX_ORDER_SUBSCRIBE_TASK.getTaskName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.JNTYZX_ORDER_SUBSCRIBE_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getModuleName() {
|
||||
return ScheduleEnums.JNTYZX_ORDER_SUBSCRIBE_TASK.getModule();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TaskResult doExecute(Object validatedParams) throws Exception {
|
||||
TaskResult taskResult = new TaskResult();
|
||||
taskResult.setSuccess(false);
|
||||
|
||||
log.info("【Subscribe】 江体场地预定定时任务启动!!! time:{}", System.currentTimeMillis());
|
||||
List<UserTokenInfoDO> users = userTokenInfoService.getCanOrderUser();
|
||||
if (CollectionUtils.isEmpty(users)) {
|
||||
log.info("暂无可下单用户, time:{}", System.currentTimeMillis());
|
||||
jtDingTalkFactory.sendMsg("暂无可下单用户, time:" + System.currentTimeMillis());
|
||||
taskResult.setSummary("无可下单用户");
|
||||
return taskResult;
|
||||
}
|
||||
List<VenueInfoDO> venueInfoDOS = venueService.queryTomorrowCanBuyVenue();
|
||||
Map<String, List<VenueInfoDO>> venueInfoMap = venueInfoDOS.stream()
|
||||
.filter(VenueInfoUtils::get8210VenueInfo)
|
||||
.filter(item -> !StringUtils.contains(item.getPlaceName(), "小馆"))
|
||||
.collect(Collectors.groupingByConcurrent(VenueInfoDO::getPlaceName));
|
||||
if (MapUtils.isEmpty(venueInfoMap)) {
|
||||
log.info("暂无可下单场地,time:{}", System.currentTimeMillis());
|
||||
taskResult.setSummary("无下单场地");
|
||||
return taskResult;
|
||||
}
|
||||
|
||||
users.parallelStream().forEach(user -> {
|
||||
try {
|
||||
List<String> placeNameList = venueInfoMap.keySet().stream().sorted(Comparator.comparing(VenueInfoUtils::sortVenueInfo)).toList();
|
||||
log.info("场地排序后的集合:{}", JSON.toJSONString(placeNameList));
|
||||
for (String placeName : placeNameList) {
|
||||
List<VenueInfoDO> venueInfoDOList = venueInfoMap.get(placeName);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
String valid = (String) redisService.get(RedisKeyConstant.getVenueSubscribeKey(placeName));
|
||||
if (StringUtils.isNotBlank(valid)) {
|
||||
break;
|
||||
}
|
||||
boolean order = jtOrderService.createOrder(venueInfoDOList, user);
|
||||
if (order) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1250);
|
||||
} catch (InterruptedException e) {
|
||||
log.error("睡眠失败~~~");
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 关键点:异常只影响当前 user
|
||||
log.error("createOrder 异常,user={}", user.getId(), e);
|
||||
return; // 结束这个 user,不影响其他 user
|
||||
}
|
||||
});
|
||||
taskResult.setSuccess(true);
|
||||
taskResult.setSummary("下单执行成功!");
|
||||
return taskResult;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.schedule;
|
||||
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.xiang.common.enums.ScheduleEnums;
|
||||
import com.xiang.common.factory.JntyzxDingTalkFactory;
|
||||
import com.xiang.common.factory.schedule.BaseScheduleTaskTemplate;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.JntyzxResponse;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.query.SitePositionList;
|
||||
import com.xiang.common.pojo.schedule.TaskResult;
|
||||
import com.xiang.common.service.IScheduleOpeningConfigService;
|
||||
import com.xiang.common.service.IScheduleRunLogService;
|
||||
import com.xiang.common.utils.DateUtils;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IJntyzxHttpService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IUserTokenInfoService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IVenueService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.utils.VenueInfoUtils;
|
||||
import com.xiang.service.module.jntyzx.miniapp.utils.WeekendUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class JtVenueTomorrowPullTask extends BaseScheduleTaskTemplate {
|
||||
private final IUserTokenInfoService userTokenInfoService;
|
||||
private final IJntyzxHttpService jntyzxHttpService;
|
||||
private final JntyzxDingTalkFactory jtDingTalkFactory;
|
||||
private final IVenueService venueService;
|
||||
|
||||
public JtVenueTomorrowPullTask(IScheduleOpeningConfigService scheduleOpeningConfigService,
|
||||
IScheduleRunLogService scheduleRunLogService,
|
||||
IUserTokenInfoService userTokenInfoService,
|
||||
IJntyzxHttpService jntyzxHttpService,
|
||||
JntyzxDingTalkFactory jtDingTalkFactory,
|
||||
IVenueService venueService) {
|
||||
super(scheduleOpeningConfigService, scheduleRunLogService);
|
||||
this.userTokenInfoService = userTokenInfoService;
|
||||
this.jntyzxHttpService = jntyzxHttpService;
|
||||
this.jtDingTalkFactory = jtDingTalkFactory;
|
||||
this.venueService = venueService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTaskName() {
|
||||
return ScheduleEnums.JNTYZX_VENUE_TOMORROW_PULL_TASK.getTaskName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.JNTYZX_VENUE_TOMORROW_PULL_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getModuleName() {
|
||||
return ScheduleEnums.JNTYZX_VENUE_TOMORROW_PULL_TASK.getModule();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TaskResult doExecute(Object validatedParams) throws Exception {
|
||||
TaskResult taskResult = new TaskResult();
|
||||
taskResult.setSuccess(Boolean.FALSE);
|
||||
log.info("【Venue】江体小程序场地拉取定时任务启动!!!time:{}", System.currentTimeMillis());
|
||||
List<UserTokenInfoDO> availableUser = userTokenInfoService.getAvailableUser();
|
||||
if (CollectionUtils.isEmpty(availableUser)) {
|
||||
log.info("当前无可用用户查询场地信息!");
|
||||
taskResult.setSummary("当前无可用用户查询场地信息");
|
||||
return taskResult;
|
||||
}
|
||||
// 用户信息
|
||||
StringBuffer userMsg = new StringBuffer();
|
||||
availableUser.forEach(item -> {
|
||||
JntyzxResponse jntyzxResponse = jntyzxHttpService.checkDefaultNums(item.getToken(), item.getMemberCardNo());
|
||||
if (Objects.nonNull(jntyzxResponse)) {
|
||||
if (jntyzxResponse.getSuccess()) {
|
||||
userMsg.append("订购人:").append(item.getName()).append("正常下单\n");
|
||||
} else {
|
||||
userMsg.append("订购人:").append(item.getName()).append(jntyzxResponse.getMessage()).append("\n");
|
||||
}
|
||||
}
|
||||
});
|
||||
jtDingTalkFactory.sendMsg(userMsg.toString());
|
||||
|
||||
// 场地信息
|
||||
UserTokenInfoDO userTokenInfoDO = availableUser.get(0);
|
||||
String token = userTokenInfoDO.getToken();
|
||||
List<SitePositionList> sitePositionLists = jntyzxHttpService.queryAvailableTomorrow(WeekendUtils.isWeekend(), token);
|
||||
if (CollectionUtils.isEmpty(sitePositionLists)) {
|
||||
taskResult.setSummary("当前无可用场地信息");
|
||||
return taskResult;
|
||||
}
|
||||
venueService.saveTomorrowVenueInfo(sitePositionLists);
|
||||
sitePositionLists = sitePositionLists.stream().filter(VenueInfoUtils::get8210VenueInfo).toList();
|
||||
if (CollectionUtils.isEmpty(sitePositionLists)) {
|
||||
taskResult.setSummary("当前无可用场地信息");
|
||||
return taskResult;
|
||||
}
|
||||
Map<String, SitePositionList> map = Maps.newLinkedHashMap();
|
||||
for (SitePositionList sitePositionList : sitePositionLists) {
|
||||
if (map.containsKey(sitePositionList.getPlaceName())) {
|
||||
continue;
|
||||
}
|
||||
map.put(sitePositionList.getPlaceName(), sitePositionList);
|
||||
}
|
||||
StringBuffer msg = new StringBuffer("查询江体场地信息=====>\n时间:" + DateUtils.getDateFromDate(LocalDate.now().plusDays(1)) + " 20:00-22:00\n");
|
||||
map.forEach((placeName, sitePositionList) -> {
|
||||
msg.append(placeName).append("订购人:").append(sitePositionList.getContacts()).append("\n");
|
||||
});
|
||||
jtDingTalkFactory.sendMsg(msg.toString());
|
||||
|
||||
taskResult.setSuccess(Boolean.TRUE);
|
||||
taskResult.setSummary("场地信息获取成功!");
|
||||
return taskResult;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.service;
|
||||
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserInfoDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-05-09 10:00
|
||||
*/
|
||||
public interface IUserInfoService {
|
||||
|
||||
boolean delAll();
|
||||
|
||||
boolean batchSave(List<UserInfoDO> list);
|
||||
}
|
||||
@@ -2,9 +2,6 @@ package com.xiang.service.module.jntyzx.miniapp.service;
|
||||
|
||||
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.UserAddReq;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.UserQueryReq;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.JtUserVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,14 +17,4 @@ public interface IUserTokenInfoService {
|
||||
boolean flushSingleToken(String name);
|
||||
boolean flushToken();
|
||||
boolean updateTokenByName(String name, String token);
|
||||
|
||||
List<JtUserVo> list(UserQueryReq req);
|
||||
|
||||
Boolean updateStatusByUserName(String username, Integer status);
|
||||
|
||||
Boolean refreshToken(String username);
|
||||
|
||||
Boolean save(UserAddReq req);
|
||||
|
||||
JtUserVo info(Long userId);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.VenueInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.VenueInfoQueryRequest;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.VenueInfoQueryResp;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.query.SitePositionList;
|
||||
|
||||
import java.util.List;
|
||||
@@ -34,11 +31,4 @@ public interface IVenueService {
|
||||
* @return
|
||||
*/
|
||||
boolean saveTomorrowVenueInfo(List<SitePositionList> sitePositionLists);
|
||||
|
||||
/**
|
||||
* 查询场地列表信息
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
Page<VenueInfoQueryResp> list(VenueInfoQueryRequest request);
|
||||
}
|
||||
|
||||
@@ -13,9 +13,11 @@ import com.xiang.common.pojo.jntyzx.miniapp.resp.OrderCreateResp;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.query.SitePositionList;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.query.UserInfoResponse;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.query.VenueList;
|
||||
import com.xiang.common.utils.HttpService;
|
||||
import com.xiang.common.utils.JsonUtils;
|
||||
import com.xiang.common.utils.RedisService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.constants.UrlConstant;
|
||||
import com.xiang.service.module.jntyzx.miniapp.manage.IOrderCreateInfoManage;
|
||||
import com.xiang.common.enums.JntyzxUrlConstant;
|
||||
import com.xiang.common.manage.jntyzx.miniapp.IOrderCreateInfoManage;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IJntyzxHttpService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.utils.JntyzxSaltEncodeUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -43,7 +45,7 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
||||
|
||||
@Override
|
||||
public List<SitePositionList> queryAvailable(String isWeekend, String token) {
|
||||
String url = UrlConstant.QUERY_TODAY_SUBSCRIBE_URL;
|
||||
String url = JntyzxUrlConstant.QUERY_TODAY_SUBSCRIBE_URL;
|
||||
return querySitePositionInfo(isWeekend, token, url);
|
||||
}
|
||||
|
||||
@@ -56,7 +58,7 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
||||
params.put("gid", "03");
|
||||
params.put("isWeekend", isWeekend);
|
||||
try {
|
||||
resp = HttpHelper.doGet(url, header, params);
|
||||
resp = HttpService.doGet(url, header, params);
|
||||
} catch (Exception e) {
|
||||
log.error("[doGet] 江南体育中心查询当天场地 请求失败, url:{}", url);
|
||||
return Lists.newArrayList();
|
||||
@@ -98,7 +100,7 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
||||
|
||||
@Override
|
||||
public List<SitePositionList> queryAvailableTomorrow(String isWeekend, String token) {
|
||||
String url = UrlConstant.QUERY_TOMORROW_SUBSCRIBE_URL;
|
||||
String url = JntyzxUrlConstant.QUERY_TOMORROW_SUBSCRIBE_URL;
|
||||
return querySitePositionInfo(isWeekend, token, url);
|
||||
}
|
||||
|
||||
@@ -143,7 +145,7 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
||||
|
||||
Map<String, String> params = Maps.newHashMap();
|
||||
params.put("X-Access-Token", token);
|
||||
String resp = HttpHelper.doPost(UrlConstant.ADD_SUBSCRIBE, params, JsonUtils.toJsonString(subscribeRequest));
|
||||
String resp = HttpService.doPost(JntyzxUrlConstant.ADD_SUBSCRIBE, params, JsonUtils.toJsonString(subscribeRequest));
|
||||
log.info("[江体小程序] 羽毛球场地下单响应结果:{}", resp);
|
||||
if (StringUtils.isBlank(resp)) {
|
||||
log.info("[resp] 请求结果为空");
|
||||
@@ -164,7 +166,7 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
||||
Map<String, String> params = Maps.newHashMap();
|
||||
params.put("openId", openId);
|
||||
|
||||
String respStr = HttpHelper.doGet(UrlConstant.HEALTH_DECLARATION, headers, params);
|
||||
String respStr = HttpService.doGet(JntyzxUrlConstant.HEALTH_DECLARATION, headers, params);
|
||||
if (StringUtils.isBlank(respStr)) {
|
||||
return null;
|
||||
}
|
||||
@@ -178,7 +180,7 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
||||
Map<String, String> headers = Maps.newHashMap();
|
||||
headers.put("X-Access-Token", token);
|
||||
|
||||
String resp = HttpHelper.doGet(UrlConstant.QUERY_BY_OPEN_ID, headers, params);
|
||||
String resp = HttpService.doGet(JntyzxUrlConstant.QUERY_BY_OPEN_ID, headers, params);
|
||||
JntyzxResponse<UserInfoResponse> response = JSON.parseObject(resp, new TypeReference<JntyzxResponse<UserInfoResponse>>() {
|
||||
});
|
||||
if (Objects.isNull(response)) {
|
||||
@@ -195,7 +197,7 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
||||
Map<String, String> headers = Maps.newHashMap();
|
||||
headers.put("X-Access-Token", token);
|
||||
|
||||
String resp = HttpHelper.doGet(UrlConstant.CHECK_NUM, headers, params);
|
||||
String resp = HttpService.doGet(JntyzxUrlConstant.CHECK_NUM, headers, params);
|
||||
if (StringUtils.isBlank(resp)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2,14 +2,15 @@ package com.xiang.service.module.jntyzx.miniapp.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.xiang.common.exception.BusinessException;
|
||||
import com.xiang.common.factory.JntyzxDingTalkFactory;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.OrderInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.VenueInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.JntyzxResponse;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.OrderCreateResp;
|
||||
import com.xiang.common.utils.RedisService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.constants.RedisKeyConstant;
|
||||
import com.xiang.service.module.jntyzx.miniapp.manage.IOrderCreateInfoManage;
|
||||
import com.xiang.common.enums.RedisKeyConstant;
|
||||
import com.xiang.common.manage.jntyzx.miniapp.IOrderCreateInfoManage;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IJntyzxHttpService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IJtOrderService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -34,7 +35,7 @@ public class OrderInfoServiceImpl implements IJtOrderService {
|
||||
private final IOrderCreateInfoManage orderCreateInfoManage;
|
||||
private final IJntyzxHttpService jntyzxHttpService;
|
||||
private final RedisService redisService;
|
||||
private final JntyzxHttpServiceImpl dingTalkFactory;
|
||||
private final JntyzxDingTalkFactory dingTalkFactory;
|
||||
@Override
|
||||
public List<OrderInfoDO> queryNoPayOrder() {
|
||||
return orderCreateInfoManage.queryNoPayOrder();
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.service.impl;
|
||||
|
||||
import com.xiang.common.manage.jntyzx.miniapp.IUserInfoManage;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserInfoDO;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IUserInfoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-05-09 10:18
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class UserInfoServiceImpl implements IUserInfoService {
|
||||
|
||||
private final IUserInfoManage userInfoManage;
|
||||
|
||||
@Override
|
||||
public boolean delAll() {
|
||||
return userInfoManage.delAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean batchSave(List<UserInfoDO> list) {
|
||||
return userInfoManage.saveBatch(list);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,15 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.service.impl;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xiang.common.exception.BusinessException;
|
||||
import com.xiang.common.factory.JntyzxDingTalkFactory;
|
||||
import com.xiang.common.manage.jntyzx.miniapp.IUserRestrictionManage;
|
||||
import com.xiang.common.manage.jntyzx.miniapp.IUserTokenInfoManage;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserRestrictionInfo;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.UserTokenInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.UserAddReq;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.UserQueryReq;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.JntyzxResponse;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.JtUserVo;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.query.UserInfoResponse;
|
||||
import com.xiang.common.utils.DateUtils;
|
||||
import com.xiang.service.module.jntyzx.miniapp.converts.UserConverter;
|
||||
import com.xiang.service.module.jntyzx.miniapp.manage.IUserRestrictionManage;
|
||||
import com.xiang.service.module.jntyzx.miniapp.manage.IUserTokenInfoManage;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IJntyzxHttpService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IUserTokenInfoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -23,12 +18,8 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
@@ -43,7 +34,6 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
||||
private final IJntyzxHttpService jntyzxHttpService;
|
||||
private final JntyzxDingTalkFactory jtDingTalkFactory;
|
||||
private final IUserRestrictionManage userRestrictionManage;
|
||||
private final UserConverter userConverter;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -103,6 +93,10 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
||||
}
|
||||
|
||||
private boolean healthDeclaration(UserTokenInfoDO userTokenInfoDO) {
|
||||
if (StringUtils.isBlank(userTokenInfoDO.getToken()) || StringUtils.isBlank(userTokenInfoDO.getOpenId())) {
|
||||
log.info("用户信息异常:{}", JSONObject.toJSONString(userTokenInfoDO));
|
||||
return false;
|
||||
}
|
||||
JntyzxResponse jntyzxResponse = jntyzxHttpService.healthDeclaration(userTokenInfoDO.getToken(), userTokenInfoDO.getOpenId());
|
||||
if (Objects.isNull(jntyzxResponse)) {
|
||||
log.info("用户名:{}心跳监测失败!", userTokenInfoDO.getName());
|
||||
@@ -120,97 +114,6 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JtUserVo> list(UserQueryReq req) {
|
||||
List<UserTokenInfoDO> userTokenInfoDOS = userTokenInfoManage.queryByList(req);
|
||||
if (CollectionUtils.isEmpty(userTokenInfoDOS)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<Long> idList = userTokenInfoDOS.stream().map(UserTokenInfoDO::getId).toList();
|
||||
List<UserRestrictionInfo> userRestrictionInfos = userRestrictionManage.queryByIdList(idList);
|
||||
Map<Long, UserRestrictionInfo> userRestrictionInfoMap = Maps.newHashMap();
|
||||
if (CollectionUtils.isNotEmpty(userRestrictionInfos)) {
|
||||
userRestrictionInfoMap.putAll(
|
||||
userRestrictionInfos.stream().collect(Collectors.toMap(
|
||||
UserRestrictionInfo::getUserId, Function.identity(), (a, b) -> a)));
|
||||
}
|
||||
List<JtUserVo> jtUserVoList = userConverter.convert(userTokenInfoDOS);
|
||||
jtUserVoList.forEach(item -> {
|
||||
if (userRestrictionInfoMap.containsKey(item.getUserId())) {
|
||||
UserRestrictionInfo userRestrictionInfo = userRestrictionInfoMap.get(item.getUserId());
|
||||
if (Objects.nonNull(userRestrictionInfo)) {
|
||||
if (userRestrictionInfo.getRestrictionDeadline().isAfter(LocalDateTime.now())) {
|
||||
item.setRestrictionDeadline(userRestrictionInfo.getRestrictionDeadline());
|
||||
item.setRestrictionDesc(userRestrictionInfo.getRestrictionDesc());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return jtUserVoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateStatusByUserName(String username, Integer status) {
|
||||
if (StringUtils.isEmpty(username)) {
|
||||
log.error("用户名为空");
|
||||
return false;
|
||||
}
|
||||
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(username);
|
||||
if (Objects.isNull(userTokenInfoDO)) {
|
||||
throw new BusinessException("用户不存在!");
|
||||
}
|
||||
userTokenInfoDO.setStatus(status);
|
||||
return userTokenInfoManage.updateById(userTokenInfoDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean refreshToken(String username) {
|
||||
if (StringUtils.isEmpty(username)) {
|
||||
log.error("用户名为空");
|
||||
return false;
|
||||
}
|
||||
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(username);
|
||||
if (Objects.isNull(userTokenInfoDO)) {
|
||||
throw new BusinessException("用户不存在!");
|
||||
}
|
||||
return healthDeclaration(userTokenInfoDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean save(UserAddReq req) {
|
||||
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(req.getName());
|
||||
if (Objects.nonNull(userTokenInfoDO)) {
|
||||
throw new BusinessException("用户名已存在!");
|
||||
}
|
||||
userTokenInfoDO = new UserTokenInfoDO();
|
||||
userTokenInfoDO.setName(req.getName());
|
||||
userTokenInfoDO.setToken(req.getToken());
|
||||
userTokenInfoDO.setOpenId(req.getOpenId());
|
||||
userTokenInfoDO.setStatus(req.getStatus());
|
||||
userTokenInfoDO.setIsOrder(1);
|
||||
userTokenInfoDO.setMemberCardNo(req.getMemberCardNo());
|
||||
userTokenInfoDO.setIsRestriction(0);
|
||||
userTokenInfoDO.setUpdateTime(LocalDateTime.now());
|
||||
return userTokenInfoManage.save(userTokenInfoDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JtUserVo info(Long userId) {
|
||||
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getById(userId);
|
||||
if (Objects.isNull(userTokenInfoDO)) {
|
||||
throw new BusinessException("用户不存在!");
|
||||
}
|
||||
JtUserVo jtUserVo = userConverter.convert(userTokenInfoDO);
|
||||
UserRestrictionInfo userRestrictionInfo = userRestrictionManage.queryByUserId(userId);
|
||||
if (Objects.nonNull(userRestrictionInfo)) {
|
||||
if (userRestrictionInfo.getRestrictionDeadline().isAfter(LocalDateTime.now())) {
|
||||
jtUserVo.setRestrictionDeadline(userRestrictionInfo.getRestrictionDeadline());
|
||||
jtUserVo.setRestrictionDesc(userRestrictionInfo.getRestrictionDesc());
|
||||
}
|
||||
}
|
||||
return jtUserVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户信息
|
||||
*
|
||||
@@ -219,6 +122,10 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
||||
* @return
|
||||
*/
|
||||
private void queryMemberCardInfo(UserTokenInfoDO userTokenInfoDO) {
|
||||
if (StringUtils.isBlank(userTokenInfoDO.getToken()) || StringUtils.isBlank(userTokenInfoDO.getOpenId())) {
|
||||
log.info("用户信息异常:{}", JSONObject.toJSONString(userTokenInfoDO));
|
||||
return;
|
||||
}
|
||||
JntyzxResponse<UserInfoResponse> response = jntyzxHttpService.queryByOpenId(userTokenInfoDO.getToken(), userTokenInfoDO.getOpenId());
|
||||
if (Objects.isNull(response)) {
|
||||
return;
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
package com.xiang.service.module.jntyzx.miniapp.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.pojo.VenueInfoDO;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.req.VenueInfoQueryRequest;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.VenueInfoQueryResp;
|
||||
import com.xiang.common.pojo.jntyzx.miniapp.resp.query.SitePositionList;
|
||||
import com.xiang.common.utils.DateUtils;
|
||||
import com.xiang.service.module.jntyzx.miniapp.converts.VenueInfoConverter;
|
||||
import com.xiang.service.module.jntyzx.miniapp.manage.IVenueInfoManage;
|
||||
import com.xiang.common.manage.jntyzx.miniapp.IVenueInfoManage;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IJntyzxHttpService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IUserTokenInfoService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.service.IVenueService;
|
||||
@@ -38,7 +34,6 @@ public class VenueServiceImpl implements IVenueService {
|
||||
private final IJntyzxHttpService jntyzxHttpService;
|
||||
private final IVenueInfoManage venueInfoManage;
|
||||
private final IUserTokenInfoService userTokenInfoService;
|
||||
private final VenueInfoConverter venueInfoConverter;
|
||||
|
||||
@Override
|
||||
public List<SitePositionList> queryVenueService() {
|
||||
@@ -160,12 +155,6 @@ public class VenueServiceImpl implements IVenueService {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<VenueInfoQueryResp> list(VenueInfoQueryRequest request) {
|
||||
Page<VenueInfoDO> page = venueInfoManage.page(request);
|
||||
return venueInfoConverter.toPage(page);
|
||||
}
|
||||
|
||||
private void updateDatabase(List<SitePositionList> list, boolean isToday) {
|
||||
List<VenueInfoDO> venueInfoDOS = Lists.newArrayList();
|
||||
if (isToday) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.xiang.service.module.jntyzx.miniapp.utils;
|
||||
|
||||
import com.xiang.common.factory.JntyzxDingTalkFactory;
|
||||
import com.xiang.common.utils.RedisService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.constants.RedisKeyConstant;
|
||||
import com.xiang.common.enums.RedisKeyConstant;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -30,12 +30,18 @@ public class VenueInfoUtils {
|
||||
if (placeName.contains("十号")) {
|
||||
return 0;
|
||||
}
|
||||
if (placeName.contains("二号")) {
|
||||
if (placeName.contains("九号")) {
|
||||
return 1;
|
||||
}
|
||||
if (placeName.contains("九号")) {
|
||||
if (placeName.contains("二号")) {
|
||||
return 2;
|
||||
}
|
||||
return 3;
|
||||
if (placeName.contains("八号")) {
|
||||
return 3;
|
||||
}
|
||||
if (placeName.contains("七号")) {
|
||||
return 4;
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.xiang.common.pojo.jntyzx.zlb.ZlbTokenInfo;
|
||||
import com.xiang.common.pojo.schedule.TaskResult;
|
||||
import com.xiang.common.service.IScheduleOpeningConfigService;
|
||||
import com.xiang.common.service.IScheduleRunLogService;
|
||||
import com.xiang.service.module.jntyzx.zlb.service.ZlbTokenInfoService;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbTokenInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.OkHttpClient;
|
||||
@@ -53,7 +53,7 @@ public class ZlbLoginTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.ZLB_LOGIN_TASK.getModeleCode();
|
||||
return ScheduleEnums.ZLB_LOGIN_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,8 +17,8 @@ import com.xiang.common.utils.DateUtils;
|
||||
import com.xiang.common.utils.OkHttpUtil;
|
||||
import com.xiang.service.module.jntyzx.zlb.constants.ZlbUrlConstants;
|
||||
import com.xiang.service.module.jntyzx.zlb.service.ZlbService;
|
||||
import com.xiang.service.module.jntyzx.zlb.service.ZlbTokenInfoService;
|
||||
import com.xiang.service.module.jntyzx.zlb.service.ZlbUserInfoService;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbTokenInfoService;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbUserInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -63,7 +63,7 @@ public class ZlbOrderTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.ZLB_ORDER_CREATE_TASK.getModeleCode();
|
||||
return ScheduleEnums.ZLB_ORDER_CREATE_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,23 +108,33 @@ public class ZlbOrderTask extends BaseScheduleTaskTemplate {
|
||||
//计算9点到现在的时间差
|
||||
//获取江体当前时间
|
||||
LocalTime currentTime = LocalTime.now();
|
||||
LocalTime targetTime = LocalTime.parse("09:00:11.800");
|
||||
LocalTime targetTime = LocalTime.parse("09:00:12.500");
|
||||
Duration duration = Duration.between(currentTime, targetTime);
|
||||
long milliseconds = duration.toMillis();
|
||||
executorService.schedule(() -> {
|
||||
String response = null;
|
||||
try {
|
||||
response = client.postJson(ZlbUrlConstants.newOrderUrl, headers, newOrderJson);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
String response = null;
|
||||
try {
|
||||
response = client.postJson(ZlbUrlConstants.newOrderUrl, headers, newOrderJson);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
boolean b = buildOrder(name, response, placeName, siteTimeName);
|
||||
if (b) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1250);
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("线程暂停异常");
|
||||
}
|
||||
}
|
||||
buildOrder(name, response, placeName, siteTimeName);
|
||||
}, milliseconds, TimeUnit.MILLISECONDS);
|
||||
|
||||
return taskResult;
|
||||
}
|
||||
|
||||
private void buildOrder(String name, String response, String placeName, String siteTimeName) {
|
||||
private boolean buildOrder(String name, String response, String placeName, String siteTimeName) {
|
||||
log.info("订单接口返回结果==> \n {}", response);
|
||||
JSONObject jsonObject = JSONObject.parseObject(response);
|
||||
if (jsonObject.getInteger("code") == 200) {
|
||||
@@ -135,6 +145,14 @@ public class ZlbOrderTask extends BaseScheduleTaskTemplate {
|
||||
String redisKey = ZlbUrlConstants.REDIS_PREFIX + "_" + orderId + "_" + name;
|
||||
redisTemplate.opsForValue().set(redisKey, name);
|
||||
redisTemplate.expire(redisKey, 120, TimeUnit.SECONDS);
|
||||
return true;
|
||||
}
|
||||
if (jsonObject.getInteger("code") == 500) {
|
||||
if (jsonObject.getString("message").contains("已被售出")) {
|
||||
jntyzxDingTalkFactory.sendMsg(name + "订单接口下单返回失败❌❌❌场地号:" + placeName + "已被售出");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.xiang.common.utils.DateUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -40,7 +39,7 @@ public class ZlbSiteDayTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.ZLB_SITE_DAY_TASK.getModeleCode();
|
||||
return ScheduleEnums.ZLB_SITE_DAY_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ZlbSiteTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.ZLB_SITE_QUERY_TASK.getModeleCode();
|
||||
return ScheduleEnums.ZLB_SITE_QUERY_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ZlbTaskConfig {
|
||||
}
|
||||
|
||||
@GetMapping("/zlbOrderCreateTask")
|
||||
@Scheduled(cron = "55 59 8 * * ?")
|
||||
@Scheduled(cron = "2 0 9 * * ?")
|
||||
public void zlbOrderCreateTask() {
|
||||
zlbOrderTask.run();
|
||||
}
|
||||
|
||||
@@ -9,12 +9,11 @@ import com.xiang.common.pojo.jntyzx.zlb.ZlbTokenInfo;
|
||||
import com.xiang.common.pojo.schedule.TaskResult;
|
||||
import com.xiang.common.service.IScheduleOpeningConfigService;
|
||||
import com.xiang.common.service.IScheduleRunLogService;
|
||||
import com.xiang.service.module.jntyzx.zlb.service.ZlbTokenInfoService;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbTokenInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -41,7 +40,7 @@ public class ZlbTokenRefreshTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.ZLB_TOKEN_CHECK_TASK.getModeleCode();
|
||||
return ScheduleEnums.ZLB_TOKEN_CHECK_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,9 +13,10 @@ import com.xiang.common.pojo.schedule.TaskResult;
|
||||
import com.xiang.common.service.IScheduleOpeningConfigService;
|
||||
import com.xiang.common.service.IScheduleRunLogService;
|
||||
import com.xiang.common.utils.DateUtils;
|
||||
import com.xiang.service.module.jntyzx.zlb.service.ZlbSiteInfoService;
|
||||
import com.xiang.service.module.jntyzx.zlb.service.ZlbTokenInfoService;
|
||||
import com.xiang.service.module.jntyzx.zlb.service.ZlbUserInfoService;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbSiteInfoService;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbTokenInfoService;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbUserInfoService;
|
||||
import com.xiang.service.module.jntyzx.miniapp.utils.VenueInfoUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -59,7 +60,7 @@ public class ZlbUserConfigTask extends BaseScheduleTaskTemplate {
|
||||
|
||||
@Override
|
||||
protected Integer getModule() {
|
||||
return ScheduleEnums.ZLB_USER_CONFIG_TASK.getModeleCode();
|
||||
return ScheduleEnums.ZLB_USER_CONFIG_TASK.getModuleCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,26 +134,6 @@ public class ZlbUserConfigTask extends BaseScheduleTaskTemplate {
|
||||
if (CollectionUtils.isEmpty(siteInfoList)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return siteInfoList.stream().sorted(Comparator.comparing(this::sort)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private int sort(ZlbSiteInfo siteInfo) {
|
||||
String placeName = siteInfo.getPlaceName();
|
||||
if (placeName.contains("十号")) {
|
||||
return 0;
|
||||
}
|
||||
if (placeName.contains("九号")) {
|
||||
return 1;
|
||||
}
|
||||
if (placeName.contains("二号")) {
|
||||
return 2;
|
||||
}
|
||||
if (placeName.contains("八号")) {
|
||||
return 3;
|
||||
}
|
||||
if (placeName.contains("七号")) {
|
||||
return 4;
|
||||
}
|
||||
return 5;
|
||||
return siteInfoList.stream().sorted(Comparator.comparing(item -> VenueInfoUtils.sortVenueInfo(item.getPlaceName()))).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xiang.common.factory.JntyzxDingTalkFactory;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbSiteInfoService;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbTokenInfoService;
|
||||
import com.xiang.common.manage.jntyzx.zlb.ZlbUserInfoService;
|
||||
import com.xiang.common.pojo.jntyzx.zlb.ZlbCaptchaResp;
|
||||
import com.xiang.common.pojo.jntyzx.zlb.ZlbOrderInfo;
|
||||
import com.xiang.common.pojo.jntyzx.zlb.ZlbOrderJson;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.zlb.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xiang.common.pojo.jntyzx.zlb.ZlbSiteInfo;
|
||||
|
||||
/**
|
||||
* @author a123
|
||||
* @description 针对表【zlb_site_info】的数据库操作Service
|
||||
* @createDate 2025-06-19 23:32:29
|
||||
*/
|
||||
public interface ZlbSiteInfoService extends IService<ZlbSiteInfo> {
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.zlb.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xiang.common.mapper.ZlbSiteInfoMapper;
|
||||
import com.xiang.common.pojo.jntyzx.zlb.ZlbSiteInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author a123
|
||||
* @description 针对表【zlb_site_info】的数据库操作Service实现
|
||||
* @createDate 2025-06-19 23:32:29
|
||||
*/
|
||||
@Service
|
||||
public class ZlbSiteInfoServiceImpl extends ServiceImpl<ZlbSiteInfoMapper, ZlbSiteInfo>
|
||||
implements ZlbSiteInfoService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.zlb.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xiang.common.pojo.jntyzx.zlb.ZlbTokenInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author a123
|
||||
* @description 针对表【zlb_token_info】的数据库操作Service
|
||||
* @createDate 2025-06-20 23:51:24
|
||||
*/
|
||||
public interface ZlbTokenInfoService extends IService<ZlbTokenInfo> {
|
||||
|
||||
ZlbTokenInfo queryByName(String name);
|
||||
|
||||
List<ZlbTokenInfo> getAllUsers();
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.zlb.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xiang.common.mapper.ZlbTokenInfoMapper;
|
||||
import com.xiang.common.pojo.jntyzx.zlb.ZlbTokenInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author a123
|
||||
* @description 针对表【zlb_token_info】的数据库操作Service实现
|
||||
* @createDate 2025-06-20 23:51:24
|
||||
*/
|
||||
@Service
|
||||
public class ZlbTokenInfoServiceImpl extends ServiceImpl<ZlbTokenInfoMapper, ZlbTokenInfo>
|
||||
implements ZlbTokenInfoService {
|
||||
|
||||
@Override
|
||||
public ZlbTokenInfo queryByName(String name) {
|
||||
LambdaQueryWrapper<ZlbTokenInfo> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(ZlbTokenInfo::getName, name);
|
||||
return this.getOne(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZlbTokenInfo> getAllUsers() {
|
||||
LambdaQueryWrapper<ZlbTokenInfo> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(ZlbTokenInfo::getIsDel, 0);
|
||||
return baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.zlb.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xiang.common.pojo.jntyzx.zlb.ZlbUserInfo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
public interface ZlbUserInfoService extends IService<ZlbUserInfo> {
|
||||
|
||||
/**
|
||||
* 查询日期内未预订的用户
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
List<ZlbUserInfo> getNoBookUsers(LocalDate date);
|
||||
|
||||
int delAll();
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.xiang.service.module.jntyzx.zlb.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xiang.common.mapper.ZlbUserInfoMapper;
|
||||
import com.xiang.common.pojo.jntyzx.zlb.ZlbUserInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ZlbUserInfoServiceImpl extends ServiceImpl<ZlbUserInfoMapper, ZlbUserInfo>
|
||||
implements ZlbUserInfoService {
|
||||
|
||||
@Override
|
||||
public List<ZlbUserInfo> getNoBookUsers(LocalDate date) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delAll() {
|
||||
return baseMapper.deleteAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user