Compare commits
17 Commits
cef2662302
...
fix/userin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e599ad5ae | ||
|
|
59ebe2b349 | ||
|
|
7f35a9960d | ||
|
|
963e03c5c9 | ||
|
|
211cca9a4b | ||
|
|
94b46737da | ||
|
|
0d2ae54678 | ||
|
|
8514eac031 | ||
|
|
1a7569d1a1 | ||
|
|
14f64e94ad | ||
|
|
286190ff0b | ||
|
|
ec8826508a | ||
|
|
906a1d84fa | ||
|
|
ed59385672 | ||
|
|
d295cbd04c | ||
|
|
e43af1fe94 | ||
|
|
934749f5c0 |
8
pom.xml
8
pom.xml
@@ -29,7 +29,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang.starter</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
<artifactId>xmc-common</artifactId>
|
<artifactId>xmc-common</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang.starter</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang.starter</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
<artifactId>xmc-http-starter</artifactId>
|
<artifactId>xmc-http-starter</artifactId>
|
||||||
<version>2.0-SNAPSHOT</version>
|
<version>2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang.starter</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
@@ -54,12 +54,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang.starter</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
<artifactId>xservice-quartz-core</artifactId>
|
<artifactId>xservice-quartz-core</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang.starter</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
<artifactId>xmc-logger-starter</artifactId>
|
<artifactId>xmc-logger-starter</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.xiang.app.modules.jntyzx.constants;
|
package com.xiang.app.modules.jntyzx.constants;
|
||||||
|
|
||||||
|
import com.xiang.xservice.basic.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: xiang
|
* @Author: xiang
|
||||||
* @Date: 2025-12-16 10:43
|
* @Date: 2025-12-16 10:43
|
||||||
@@ -9,4 +13,11 @@ public class RedisKeyConstant {
|
|||||||
public static final String JNTYZX_ORDER_CREATE_KEY = "jntyzx:order:create:orderId:";
|
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 JNTUZX_ORDER_PEEK_KEY = "jntyzx:order:peek:user:";
|
||||||
|
|
||||||
|
public static final String JNTYZX_VENUE_MSG_SEND_KEY = "jntyzx:order:venue:msg:send";
|
||||||
|
|
||||||
|
public static String getDate() {
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
return ":" + DateUtils.getDateFromDate(now);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ public class UrlConstant {
|
|||||||
* 查询当天的场地信息
|
* 查询当天的场地信息
|
||||||
*/
|
*/
|
||||||
public final static String QUERY_TODAY_SUBSCRIBE_URL = GNTYZX_BASE_URL + "/GYM-JN/multi/Subscribe/getSubscribeByToday";
|
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 QUERY_TOMORROW_SUBSCRIBE_URL = GNTYZX_BASE_URL + "/GYM-JN/multi/Subscribe/getSubscribeByTomorrow";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,4 +35,13 @@ public class UrlConstant {
|
|||||||
*/
|
*/
|
||||||
public final static String HEALTH_DECLARATION = GNTYZX_BASE_URL + "/GYM-JN//busi/healthDeclaration/addUserPrivacy";
|
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";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.xiang.app.modules.jntyzx.entity.pojo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName("jntyzx_user_restriction")
|
||||||
|
public class UserRestrictionInfo {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 封禁截止时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime restrictionDeadline;
|
||||||
|
/**
|
||||||
|
* 封禁原因
|
||||||
|
*/
|
||||||
|
private String restrictionDesc;
|
||||||
|
}
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
package com.xiang.app.modules.jntyzx.entity.pojo;
|
package com.xiang.app.modules.jntyzx.entity.pojo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: xiang
|
* @Author: xiang
|
||||||
* @Date: 2025-12-16 09:18
|
* @Date: 2025-12-16 09:18
|
||||||
@@ -34,4 +37,21 @@ public class UserTokenInfoDO {
|
|||||||
* 状态(0:禁用 1:启用)
|
* 状态(0:禁用 1:启用)
|
||||||
*/
|
*/
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可以下单 (0:否 1:是)
|
||||||
|
*/
|
||||||
|
private Integer isOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员卡号
|
||||||
|
*/
|
||||||
|
@TableField("member_card_no")
|
||||||
|
private String memberCardNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否封禁 0:否 1:是
|
||||||
|
*/
|
||||||
|
@TableField("is_restriction")
|
||||||
|
private Integer isRestriction;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.xiang.app.modules.jntyzx.entity.resp.query;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class UserInfoResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 会员卡号
|
||||||
|
*/
|
||||||
|
private String consCard;
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
private String consName;
|
||||||
|
/**
|
||||||
|
* 性别
|
||||||
|
*/
|
||||||
|
private String consSex;
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
private String consIdCard;
|
||||||
|
/**
|
||||||
|
* 固定电话
|
||||||
|
*/
|
||||||
|
private String consTel;
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String consHandSet;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String consUnit;
|
||||||
|
/**
|
||||||
|
* 照片
|
||||||
|
*/
|
||||||
|
private String consPhoto;
|
||||||
|
private Integer consWaste;
|
||||||
|
/**
|
||||||
|
* 会员卡号
|
||||||
|
*/
|
||||||
|
private String consNumber;
|
||||||
|
private BigDecimal consMin;
|
||||||
|
private Integer consProp;
|
||||||
|
/**
|
||||||
|
* 注册年
|
||||||
|
*/
|
||||||
|
private String consYear;
|
||||||
|
/**
|
||||||
|
* 注册月
|
||||||
|
*/
|
||||||
|
private String consMonth;
|
||||||
|
/**
|
||||||
|
* 注册日
|
||||||
|
*/
|
||||||
|
private String consDay;
|
||||||
|
private boolean consIflag;
|
||||||
|
/**
|
||||||
|
* 注册时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime consTimes;
|
||||||
|
/**
|
||||||
|
* openId
|
||||||
|
*/
|
||||||
|
private String openId;
|
||||||
|
/**
|
||||||
|
* 头像
|
||||||
|
*/
|
||||||
|
private String photoUrl;
|
||||||
|
/**
|
||||||
|
* 会员
|
||||||
|
*/
|
||||||
|
private Integer consVip;
|
||||||
|
/**
|
||||||
|
* 会员等级号
|
||||||
|
*/
|
||||||
|
private String consVipCode;
|
||||||
|
|
||||||
|
private String eleCardNum;
|
||||||
|
private Integer appointmentEligibility;
|
||||||
|
/**
|
||||||
|
* 封禁截止日期
|
||||||
|
*/
|
||||||
|
@JSONField(name = "restrictionDeadline")
|
||||||
|
private String restrictionDeadline;
|
||||||
|
/**
|
||||||
|
* 封禁原因
|
||||||
|
*/
|
||||||
|
private String restrictionDescription;
|
||||||
|
/**
|
||||||
|
* 封禁截止日期
|
||||||
|
*/
|
||||||
|
@JSONField(name = "RestrictionDeadline")
|
||||||
|
private String RestrictionDeadline2;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.xiang.app.modules.jntyzx.manage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserRestrictionInfo;
|
||||||
|
|
||||||
|
public interface IUserRestrictionManage extends IService<UserRestrictionInfo> {
|
||||||
|
|
||||||
|
UserRestrictionInfo queryByUserId(Long userId);
|
||||||
|
}
|
||||||
@@ -10,7 +10,9 @@ import java.util.List;
|
|||||||
* @Date: 2025-12-16 09:19
|
* @Date: 2025-12-16 09:19
|
||||||
*/
|
*/
|
||||||
public interface IUserTokenInfoManage extends IService<UserTokenInfoDO> {
|
public interface IUserTokenInfoManage extends IService<UserTokenInfoDO> {
|
||||||
|
|
||||||
List<UserTokenInfoDO> listUser();
|
List<UserTokenInfoDO> listUser();
|
||||||
UserTokenInfoDO getByName(String name);
|
UserTokenInfoDO getByName(String name);
|
||||||
|
|
||||||
|
List<UserTokenInfoDO> listCanOrder();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.xiang.app.modules.jntyzx.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.app.modules.jntyzx.entity.pojo.UserRestrictionInfo;
|
||||||
|
import com.xiang.app.modules.jntyzx.mapper.JntyzxUserRestrictionInfoMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,4 +29,13 @@ public class UserTokenInfoManageImpl extends ServiceImpl<JntyzxUserTokenInfoMapp
|
|||||||
lambdaQueryWrapper.eq(UserTokenInfoDO::getName, name);
|
lambdaQueryWrapper.eq(UserTokenInfoDO::getName, name);
|
||||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.xiang.app.modules.jntyzx.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserRestrictionInfo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Repository
|
||||||
|
public interface JntyzxUserRestrictionInfoMapper extends BaseMapper<UserRestrictionInfo> {
|
||||||
|
}
|
||||||
@@ -3,7 +3,9 @@ package com.xiang.app.modules.jntyzx.service;
|
|||||||
|
|
||||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
import com.xiang.app.modules.jntyzx.entity.resp.JntyzxResponse;
|
import com.xiang.app.modules.jntyzx.entity.resp.JntyzxResponse;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.OrderCreateResp;
|
||||||
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.query.UserInfoResponse;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -30,7 +32,7 @@ public interface IJntyzxHttpService {
|
|||||||
* 订单创建
|
* 订单创建
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean createOrder(List<VenueInfoDO> venueInfos, String token);
|
JntyzxResponse<OrderCreateResp> createOrder(List<VenueInfoDO> venueInfos, String token, String openId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 心跳监测
|
* 心跳监测
|
||||||
@@ -39,4 +41,20 @@ public interface IJntyzxHttpService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
JntyzxResponse healthDeclaration(String token, String openId);
|
JntyzxResponse healthDeclaration(String token, String openId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据openid查询
|
||||||
|
* @param token token
|
||||||
|
* @param openId openId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JntyzxResponse<UserInfoResponse> queryByOpenId(String token, String openId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验会员卡状态
|
||||||
|
* @param token token
|
||||||
|
* @param cardNo 会员卡号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JntyzxResponse checkDefaultNums(String token, String cardNo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.xiang.app.modules.jntyzx.service;
|
|||||||
|
|
||||||
|
|
||||||
import com.xiang.app.modules.jntyzx.entity.pojo.OrderInfoDO;
|
import com.xiang.app.modules.jntyzx.entity.pojo.OrderInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserTokenInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -11,5 +13,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface IJtOrderService {
|
public interface IJtOrderService {
|
||||||
|
|
||||||
|
boolean createOrder(List<VenueInfoDO> venueInfoDOS, UserTokenInfoDO userTokenInfoDO);
|
||||||
|
|
||||||
List<OrderInfoDO> queryNoPayOrder();
|
List<OrderInfoDO> queryNoPayOrder();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package com.xiang.app.modules.jntyzx.service;
|
package com.xiang.app.modules.jntyzx.service;
|
||||||
|
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserTokenInfoDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: xiang
|
* @Author: xiang
|
||||||
* @Date: 2025-12-16 09:22
|
* @Date: 2025-12-16 09:22
|
||||||
*/
|
*/
|
||||||
public interface IUserTokenInfoService {
|
public interface IUserTokenInfoService {
|
||||||
|
|
||||||
|
List<UserTokenInfoDO> getAvailableUser();
|
||||||
|
List<UserTokenInfoDO> getCanOrderUser();
|
||||||
String getToken(String name);
|
String getToken(String name);
|
||||||
boolean flushSingleToken(String name);
|
boolean flushSingleToken(String name);
|
||||||
boolean flushToken();
|
boolean flushToken();
|
||||||
|
|||||||
@@ -15,5 +15,20 @@ public interface IVenueService {
|
|||||||
List<SitePositionList> queryVenueService();
|
List<SitePositionList> queryVenueService();
|
||||||
List<SitePositionList> queryTomorrowVenue();
|
List<SitePositionList> queryTomorrowVenue();
|
||||||
List<VenueInfoDO> queryCanBuyVenue();
|
List<VenueInfoDO> queryCanBuyVenue();
|
||||||
|
List<VenueInfoDO> queryTomorrowCanBuyVenue();
|
||||||
List<VenueInfoDO> queryToday6210VenueInfo();
|
List<VenueInfoDO> queryToday6210VenueInfo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新场地信息
|
||||||
|
* @param sitePositionLists
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean saveOrUpdateTodayVenueInfo(List<SitePositionList> sitePositionLists);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新第二天的场地信息
|
||||||
|
* @param sitePositionLists
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean saveTomorrowVenueInfo(List<SitePositionList> sitePositionLists);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,15 @@ import com.xiang.app.modules.jntyzx.entity.req.SubscribeVo;
|
|||||||
import com.xiang.app.modules.jntyzx.entity.resp.JntyzxResponse;
|
import com.xiang.app.modules.jntyzx.entity.resp.JntyzxResponse;
|
||||||
import com.xiang.app.modules.jntyzx.entity.resp.OrderCreateResp;
|
import com.xiang.app.modules.jntyzx.entity.resp.OrderCreateResp;
|
||||||
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.query.UserInfoResponse;
|
||||||
import com.xiang.app.modules.jntyzx.entity.resp.query.VenueList;
|
import com.xiang.app.modules.jntyzx.entity.resp.query.VenueList;
|
||||||
import com.xiang.app.modules.jntyzx.manage.IOrderCreateInfoManage;
|
import com.xiang.app.modules.jntyzx.manage.IOrderCreateInfoManage;
|
||||||
import com.xiang.app.modules.jntyzx.service.IJntyzxHttpService;
|
import com.xiang.app.modules.jntyzx.service.IJntyzxHttpService;
|
||||||
|
import com.xiang.app.modules.jntyzx.utils.JntyzxSaltEncodeUtils;
|
||||||
import com.xiang.xmc.service.cache.service.IRedisService;
|
import com.xiang.xmc.service.cache.service.IRedisService;
|
||||||
|
import com.xiang.xmc.service.http.helper.BaseHttpHelp;
|
||||||
import com.xiang.xmc.service.http.helper.HttpHelper;
|
import com.xiang.xmc.service.http.helper.HttpHelper;
|
||||||
|
import com.xiang.xmc.service.http.helper.HttpHelperFactory;
|
||||||
import com.xiang.xservice.basic.utils.Base64;
|
import com.xiang.xservice.basic.utils.Base64;
|
||||||
import com.xiang.xservice.basic.utils.JsonUtils;
|
import com.xiang.xservice.basic.utils.JsonUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -109,8 +113,7 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean createOrder(List<VenueInfoDO> venueInfos, String token) {
|
public JntyzxResponse<OrderCreateResp> createOrder(List<VenueInfoDO> venueInfos, String token, String openId) {
|
||||||
|
|
||||||
List<SubscribeVo> vos = Lists.newArrayList();
|
List<SubscribeVo> vos = Lists.newArrayList();
|
||||||
for (VenueInfoDO venueInfo : venueInfos) {
|
for (VenueInfoDO venueInfo : venueInfos) {
|
||||||
SubscribeVo subscribeVo = new SubscribeVo();
|
SubscribeVo subscribeVo = new SubscribeVo();
|
||||||
@@ -139,13 +142,13 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
|||||||
vos.add(subscribeVo);
|
vos.add(subscribeVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject jsonObject = buildParamJsonObj();
|
JSONObject jsonObject = buildParamJsonObj(openId);
|
||||||
SubscribeRequest subscribeRequest = new SubscribeRequest();
|
SubscribeRequest subscribeRequest = new SubscribeRequest();
|
||||||
|
|
||||||
subscribeRequest.setSubscribeVos(vos);
|
subscribeRequest.setSubscribeVos(vos);
|
||||||
subscribeRequest.setBookTime(venueInfos.get(0).getAppointments());
|
subscribeRequest.setBookTime(venueInfos.get(0).getAppointments());
|
||||||
subscribeRequest.setPaymentMethod(1);
|
subscribeRequest.setPaymentMethod(1);
|
||||||
subscribeRequest.setSvCiphertext(sonAddSalt(JsonUtils.toJsonString(vos)));
|
subscribeRequest.setSvCiphertext(JntyzxSaltEncodeUtils.sonAddSalt(JsonUtils.toJsonString(vos)));
|
||||||
subscribeRequest.setJsonObject(jsonObject);
|
subscribeRequest.setJsonObject(jsonObject);
|
||||||
|
|
||||||
Map<String, String> params = Maps.newHashMap();
|
Map<String, String> params = Maps.newHashMap();
|
||||||
@@ -153,32 +156,15 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
|||||||
String resp = HttpHelper.doPost(UrlConstant.ADD_SUBSCRIBE, params, JsonUtils.toJsonString(subscribeRequest));
|
String resp = HttpHelper.doPost(UrlConstant.ADD_SUBSCRIBE, params, JsonUtils.toJsonString(subscribeRequest));
|
||||||
if (StringUtils.isBlank(resp)) {
|
if (StringUtils.isBlank(resp)) {
|
||||||
log.info("请求结果为空");
|
log.info("请求结果为空");
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
JntyzxResponse<OrderCreateResp> response = JSON.parseObject(resp, new TypeReference<JntyzxResponse<OrderCreateResp>>() {
|
JntyzxResponse<OrderCreateResp> response = JSON.parseObject(resp, new TypeReference<JntyzxResponse<OrderCreateResp>>() {
|
||||||
});
|
});
|
||||||
if (Objects.isNull(response)) {
|
if (Objects.isNull(response)) {
|
||||||
log.info("请求结果为空");
|
log.info("请求结果为空");
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
if (response.getSuccess()) {
|
return response;
|
||||||
OrderCreateResp createResp = response.getResult();
|
|
||||||
if (Objects.nonNull(createResp)) {
|
|
||||||
String orderId = createResp.getId();
|
|
||||||
redisService.set(RedisKeyConstant.JNTYZX_ORDER_CREATE_KEY + orderId, String.valueOf(System.currentTimeMillis()));
|
|
||||||
OrderInfoDO orderInfoDO = new OrderInfoDO();
|
|
||||||
orderInfoDO.setOrderId(orderId);
|
|
||||||
orderInfoDO.setParams(JsonUtils.toJsonString(subscribeRequest));
|
|
||||||
orderInfoDO.setCreateTime(LocalDateTime.now());
|
|
||||||
orderInfoDO.setUsername(token);
|
|
||||||
orderInfoDO.setPlaceName(vos.get(0).getPlaceName());
|
|
||||||
orderInfoDO.setDate(LocalDate.now());
|
|
||||||
orderInfoDO.setOrderStatus(0);
|
|
||||||
orderCreateInfoManage.save(orderInfoDO);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public JntyzxResponse healthDeclaration(String token, String openId) {
|
public JntyzxResponse healthDeclaration(String token, String openId) {
|
||||||
@@ -194,7 +180,38 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
|||||||
return JSON.parseObject(respStr, JntyzxResponse.class);
|
return JSON.parseObject(respStr, JntyzxResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static JSONObject buildParamJsonObj() {
|
@Override
|
||||||
|
public JntyzxResponse<UserInfoResponse> queryByOpenId(String token, String openId) {
|
||||||
|
Map<String, String> params = Maps.newHashMap();
|
||||||
|
params.put("openId", openId);
|
||||||
|
Map<String, String> headers = Maps.newHashMap();
|
||||||
|
headers.put("X-Access-Token", token);
|
||||||
|
|
||||||
|
String resp = HttpHelper.doGet(UrlConstant.QUERY_BY_OPEN_ID, headers, params);
|
||||||
|
JntyzxResponse<UserInfoResponse> response = JSON.parseObject(resp, new TypeReference<JntyzxResponse<UserInfoResponse>>() {
|
||||||
|
});
|
||||||
|
if (Objects.isNull(response)) {
|
||||||
|
log.info("请求结果为空!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JntyzxResponse checkDefaultNums(String token, String cardNo) {
|
||||||
|
Map<String, String> params = Maps.newHashMap();
|
||||||
|
params.put("consNumber", cardNo);
|
||||||
|
Map<String, String> headers = Maps.newHashMap();
|
||||||
|
headers.put("X-Access-Token", token);
|
||||||
|
|
||||||
|
String resp = HttpHelper.doGet(UrlConstant.CHECK_NUM, headers, params);
|
||||||
|
if (StringUtils.isBlank(resp)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return JSON.parseObject(resp, JntyzxResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static JSONObject buildParamJsonObj(String openId) {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("id", "1702581215097257986");
|
jsonObject.put("id", "1702581215097257986");
|
||||||
jsonObject.put("createBy", null);
|
jsonObject.put("createBy", null);
|
||||||
@@ -202,7 +219,7 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
|||||||
jsonObject.put("updateBy", null);
|
jsonObject.put("updateBy", null);
|
||||||
jsonObject.put("updateTime", null);
|
jsonObject.put("updateTime", null);
|
||||||
jsonObject.put("sysOrgCode", null);
|
jsonObject.put("sysOrgCode", null);
|
||||||
jsonObject.put("openId", "o21MX4y7whXCGjvUTGP6CTz2HbD8");
|
jsonObject.put("openId", openId);
|
||||||
jsonObject.put("nickName", "1");
|
jsonObject.put("nickName", "1");
|
||||||
jsonObject.put("unionId", null);
|
jsonObject.put("unionId", null);
|
||||||
jsonObject.put("avatarUrl", "https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132");
|
jsonObject.put("avatarUrl", "https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132");
|
||||||
@@ -214,30 +231,4 @@ public class JntyzxHttpServiceImpl implements IJntyzxHttpService {
|
|||||||
jsonObject.put("default05", null);
|
jsonObject.put("default05", null);
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int[] getMonthAndDay() {
|
|
||||||
LocalDate currentDate = LocalDate.now();
|
|
||||||
int month = currentDate.getMonthValue();
|
|
||||||
int day = currentDate.getDayOfMonth();
|
|
||||||
return new int[]{month, day};
|
|
||||||
}
|
|
||||||
|
|
||||||
private String sonAddSalt(String json) {
|
|
||||||
String svCiphertext = "";
|
|
||||||
String suiji = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
||||||
String token1 = String.valueOf(suiji.charAt((int) (Math.random() * (double) suiji.length())));
|
|
||||||
String token2 = String.valueOf(suiji.charAt((int) (Math.random() * (double) suiji.length())));
|
|
||||||
svCiphertext = Base64.encode(json.getBytes(StandardCharsets.UTF_8));
|
|
||||||
int[] monthAndDay = getMonthAndDay();
|
|
||||||
int month = monthAndDay[0];
|
|
||||||
int day = monthAndDay[1];
|
|
||||||
if (month == 1) {
|
|
||||||
svCiphertext = (svCiphertext = token1 + svCiphertext).substring(0, day - 1) + token2 + svCiphertext.substring(day - 1);
|
|
||||||
} else if (day == 1) {
|
|
||||||
svCiphertext = token2 + svCiphertext.substring(0, month - 1) + token1 + svCiphertext.substring(month - 1);
|
|
||||||
} else {
|
|
||||||
svCiphertext = (svCiphertext = svCiphertext.substring(0, month - 1) + token1 + svCiphertext.substring(month - 1)).substring(0, day - 1) + token2 + svCiphertext.substring(day - 1);
|
|
||||||
}
|
|
||||||
return svCiphertext;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,88 @@
|
|||||||
package com.xiang.app.modules.jntyzx.service.impl;
|
package com.xiang.app.modules.jntyzx.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.xiang.app.common.service.dingtalk.JtDingTalkFactory;
|
||||||
|
import com.xiang.app.modules.jntyzx.constants.RedisKeyConstant;
|
||||||
import com.xiang.app.modules.jntyzx.entity.pojo.OrderInfoDO;
|
import com.xiang.app.modules.jntyzx.entity.pojo.OrderInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserTokenInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.JntyzxResponse;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.OrderCreateResp;
|
||||||
import com.xiang.app.modules.jntyzx.manage.IOrderCreateInfoManage;
|
import com.xiang.app.modules.jntyzx.manage.IOrderCreateInfoManage;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IJntyzxHttpService;
|
||||||
import com.xiang.app.modules.jntyzx.service.IJtOrderService;
|
import com.xiang.app.modules.jntyzx.service.IJtOrderService;
|
||||||
|
import com.xiang.xmc.service.cache.service.IRedisService;
|
||||||
|
import com.xiang.xservice.basic.exception.BusinessException;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: xiang
|
* @Author: xiang
|
||||||
* @Date: 2025-12-16 16:17
|
* @Date: 2025-12-16 16:17
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class OrderInfoServiceImpl implements IJtOrderService {
|
public class OrderInfoServiceImpl implements IJtOrderService {
|
||||||
|
|
||||||
private final IOrderCreateInfoManage orderCreateInfoManage;
|
private final IOrderCreateInfoManage orderCreateInfoManage;
|
||||||
|
private final IJntyzxHttpService jntyzxHttpService;
|
||||||
|
private final IRedisService redisService;
|
||||||
|
private final JtDingTalkFactory dingTalkFactory;
|
||||||
@Override
|
@Override
|
||||||
public List<OrderInfoDO> queryNoPayOrder() {
|
public List<OrderInfoDO> queryNoPayOrder() {
|
||||||
return orderCreateInfoManage.queryNoPayOrder();
|
return orderCreateInfoManage.queryNoPayOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean createOrder(List<VenueInfoDO> venueInfoDOS, UserTokenInfoDO userTokenInfoDO) {
|
||||||
|
|
||||||
|
String order = (String) redisService.get(RedisKeyConstant.JNTYZX_ORDER_CREATE_KEY + userTokenInfoDO.getName() + LocalDate.now());
|
||||||
|
if (StringUtils.isNotBlank(order)) {
|
||||||
|
log.info("用户:{}已经有成功预订了场地", userTokenInfoDO.getName());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
JntyzxResponse<OrderCreateResp> orderResp = jntyzxHttpService.createOrder(venueInfoDOS, userTokenInfoDO.getToken(), userTokenInfoDO.getOpenId());
|
||||||
|
if (Objects.isNull(orderResp)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (orderResp.getSuccess()) {
|
||||||
|
OrderCreateResp result = orderResp.getResult();
|
||||||
|
if (Objects.nonNull(result)) {
|
||||||
|
String orderId = result.getId();
|
||||||
|
if (StringUtils.isNotBlank(orderId)) {
|
||||||
|
redisService.set(RedisKeyConstant.JNTYZX_ORDER_CREATE_KEY + userTokenInfoDO.getName() + LocalDate.now(), orderId);
|
||||||
|
OrderInfoDO orderInfoDO = new OrderInfoDO();
|
||||||
|
orderInfoDO.setOrderId(orderId);
|
||||||
|
orderInfoDO.setCreateTime(LocalDateTime.now());
|
||||||
|
orderInfoDO.setUsername(userTokenInfoDO.getName());
|
||||||
|
orderInfoDO.setPlaceName(venueInfoDOS.get(0).getPlaceName());
|
||||||
|
orderInfoDO.setDate(LocalDate.now());
|
||||||
|
orderInfoDO.setOrderStatus(0);
|
||||||
|
orderCreateInfoManage.save(orderInfoDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dingTalkFactory.sendMsg("用户" + userTokenInfoDO.getName() + "预订场地号:" + venueInfoDOS.get(0).getPlaceName() + "结果返回:" + JSON.toJSONString(orderResp));
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
dingTalkFactory.sendMsg("用户" + userTokenInfoDO.getName() + "预订场地号:" + venueInfoDOS.get(0).getPlaceName() + "结果返回:" + JSON.toJSONString(orderResp));
|
||||||
|
if (orderResp.getMessage().contains("锁卡")) {
|
||||||
|
log.info("有锁卡风险,不在请求,用户:{}", userTokenInfoDO.getName());
|
||||||
|
throw new BusinessException("即将锁卡,不再请求");
|
||||||
|
}
|
||||||
|
if (orderResp.getMessage().contains("限制")) {
|
||||||
|
log.info("改会员卡被限制,不在请求,用户:{}", userTokenInfoDO.getName());
|
||||||
|
throw new BusinessException("会员卡被限制,不在请求");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
package com.xiang.app.modules.jntyzx.service.impl;
|
package com.xiang.app.modules.jntyzx.service.impl;
|
||||||
|
|
||||||
import com.xiang.app.common.service.dingtalk.JtDingTalkFactory;
|
import com.xiang.app.common.service.dingtalk.JtDingTalkFactory;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserRestrictionInfo;
|
||||||
import com.xiang.app.modules.jntyzx.entity.pojo.UserTokenInfoDO;
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserTokenInfoDO;
|
||||||
import com.xiang.app.modules.jntyzx.entity.resp.JntyzxResponse;
|
import com.xiang.app.modules.jntyzx.entity.resp.JntyzxResponse;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.query.UserInfoResponse;
|
||||||
|
import com.xiang.app.modules.jntyzx.manage.IUserRestrictionManage;
|
||||||
import com.xiang.app.modules.jntyzx.manage.IUserTokenInfoManage;
|
import com.xiang.app.modules.jntyzx.manage.IUserTokenInfoManage;
|
||||||
import com.xiang.app.modules.jntyzx.service.IJntyzxHttpService;
|
import com.xiang.app.modules.jntyzx.service.IJntyzxHttpService;
|
||||||
import com.xiang.app.modules.jntyzx.service.IUserTokenInfoService;
|
import com.xiang.app.modules.jntyzx.service.IUserTokenInfoService;
|
||||||
|
import com.xiang.xservice.basic.utils.DateUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
@@ -27,8 +31,14 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
|||||||
private final IUserTokenInfoManage userTokenInfoManage;
|
private final IUserTokenInfoManage userTokenInfoManage;
|
||||||
private final IJntyzxHttpService jntyzxHttpService;
|
private final IJntyzxHttpService jntyzxHttpService;
|
||||||
private final JtDingTalkFactory jtDingTalkFactory;
|
private final JtDingTalkFactory jtDingTalkFactory;
|
||||||
|
private final IUserRestrictionManage userRestrictionManage;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserTokenInfoDO> getAvailableUser() {
|
||||||
|
return userTokenInfoManage.listUser();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getToken(String name) {
|
public String getToken(String name) {
|
||||||
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(name);
|
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(name);
|
||||||
@@ -38,6 +48,11 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
|||||||
return userTokenInfoDO.getToken();
|
return userTokenInfoDO.getToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserTokenInfoDO> getCanOrderUser() {
|
||||||
|
return userTokenInfoManage.listCanOrder();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean flushSingleToken(String name) {
|
public boolean flushSingleToken(String name) {
|
||||||
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(name);
|
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(name);
|
||||||
@@ -51,12 +66,15 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean flushToken() {
|
public boolean flushToken() {
|
||||||
List<UserTokenInfoDO> userTokenInfoDOS = userTokenInfoManage.listUser();
|
List<UserTokenInfoDO> userTokenInfoDOS = userTokenInfoManage.list();
|
||||||
if (CollectionUtils.isEmpty(userTokenInfoDOS)) {
|
if (CollectionUtils.isEmpty(userTokenInfoDOS)) {
|
||||||
log.info("【心跳监测】查询用户信息为空,无需操作");
|
log.info("【心跳监测】查询用户信息为空,无需操作");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
userTokenInfoDOS.parallelStream().forEach(this::healthDeclaration);
|
userTokenInfoDOS.forEach(this::healthDeclaration);
|
||||||
|
// 信息更新
|
||||||
|
userTokenInfoDOS = userTokenInfoManage.list();
|
||||||
|
userTokenInfoDOS.forEach(this::queryMemberCardInfo);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +85,9 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
userTokenInfoDO.setToken(token);
|
userTokenInfoDO.setToken(token);
|
||||||
return userTokenInfoManage.updateById(userTokenInfoDO);
|
boolean flag = userTokenInfoManage.updateById(userTokenInfoDO);
|
||||||
|
jtDingTalkFactory.sendMsg("用户:" + name + ",token更新成功!");
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean healthDeclaration(UserTokenInfoDO userTokenInfoDO) {
|
private boolean healthDeclaration(UserTokenInfoDO userTokenInfoDO) {
|
||||||
@@ -78,9 +98,51 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
|||||||
boolean flag = StringUtils.contains(jntyzxResponse.getMessage(), "已存在");
|
boolean flag = StringUtils.contains(jntyzxResponse.getMessage(), "已存在");
|
||||||
if (flag) {
|
if (flag) {
|
||||||
log.info("用户名:{}心跳成功✅✅✅✅✅✅", userTokenInfoDO.getName());
|
log.info("用户名:{}心跳成功✅✅✅✅✅✅", userTokenInfoDO.getName());
|
||||||
|
userTokenInfoDO.setStatus(1);
|
||||||
|
userTokenInfoManage.updateById(userTokenInfoDO);
|
||||||
} else {
|
} else {
|
||||||
jtDingTalkFactory.sendMsg("用户名:" + userTokenInfoDO.getName() + "心跳失败,消息:" + jntyzxResponse.getMessage());
|
jtDingTalkFactory.sendMsg("用户名:" + userTokenInfoDO.getName() + "心跳失败,消息:" + jntyzxResponse.getMessage());
|
||||||
|
userTokenInfoDO.setStatus(0);
|
||||||
|
userTokenInfoManage.updateById(userTokenInfoDO);
|
||||||
}
|
}
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户信息
|
||||||
|
*
|
||||||
|
* @param userTokenInfoDO 用户
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void queryMemberCardInfo(UserTokenInfoDO userTokenInfoDO) {
|
||||||
|
JntyzxResponse<UserInfoResponse> response = jntyzxHttpService.queryByOpenId(userTokenInfoDO.getToken(), userTokenInfoDO.getOpenId());
|
||||||
|
if (Objects.isNull(response)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (response.getSuccess()) {
|
||||||
|
UserInfoResponse userInfoResponse = response.getResult();
|
||||||
|
userTokenInfoDO.setMemberCardNo(userInfoResponse.getConsCard());
|
||||||
|
if (StringUtils.isNotBlank(userInfoResponse.getRestrictionDeadline2())) {
|
||||||
|
userTokenInfoDO.setIsRestriction(1);
|
||||||
|
userTokenInfoDO.setIsOrder(0);
|
||||||
|
UserRestrictionInfo userRestrictionInfo = userRestrictionManage.queryByUserId(userTokenInfoDO.getId());
|
||||||
|
if (Objects.isNull(userRestrictionInfo)) {
|
||||||
|
userRestrictionInfo = new UserRestrictionInfo();
|
||||||
|
userRestrictionInfo.setUserId(userTokenInfoDO.getId());
|
||||||
|
userRestrictionInfo.setRestrictionDeadline(DateUtils.getDateTimeFromStr(userInfoResponse.getRestrictionDeadline2()));
|
||||||
|
userRestrictionInfo.setRestrictionDesc(userInfoResponse.getRestrictionDescription());
|
||||||
|
userRestrictionManage.save(userRestrictionInfo);
|
||||||
|
} else {
|
||||||
|
userRestrictionInfo.setRestrictionDeadline(DateUtils.getDateTimeFromStr(userInfoResponse.getRestrictionDeadline2()));
|
||||||
|
userRestrictionInfo.setRestrictionDesc(userInfoResponse.getRestrictionDescription());
|
||||||
|
userRestrictionManage.updateById(userRestrictionInfo);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
userTokenInfoDO.setIsRestriction(0);
|
||||||
|
userTokenInfoDO.setIsOrder(1);
|
||||||
|
}
|
||||||
|
userTokenInfoManage.updateById(userTokenInfoDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,12 +68,93 @@ public class VenueServiceImpl implements IVenueService {
|
|||||||
return venueInfoManage.queryByType(LocalDate.now(), 0);
|
return venueInfoManage.queryByType(LocalDate.now(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<VenueInfoDO> queryTomorrowCanBuyVenue() {
|
||||||
|
return venueInfoManage.queryByType(LocalDate.now().plusDays(1), 0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<VenueInfoDO> queryToday6210VenueInfo() {
|
public List<VenueInfoDO> queryToday6210VenueInfo() {
|
||||||
List<VenueInfoDO> venueInfoDOS = venueInfoManage.queryByDate(LocalDate.now());
|
List<VenueInfoDO> venueInfoDOS = venueInfoManage.queryByDate(LocalDate.now());
|
||||||
return venueInfoDOS.stream().filter(item -> VenueInfoUtils.get628VenueInfo(item) || VenueInfoUtils.get8210VenueInfo(item)).toList();
|
return venueInfoDOS.stream().filter(item -> VenueInfoUtils.get628VenueInfo(item) || VenueInfoUtils.get8210VenueInfo(item)).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean saveOrUpdateTodayVenueInfo(List<SitePositionList> sitePositionLists) {
|
||||||
|
List<VenueInfoDO> venueInfoDOS = venueInfoManage.queryByDate(LocalDate.now());
|
||||||
|
Map<String, Map<String, VenueInfoDO>> map = Maps.newHashMap();
|
||||||
|
if (CollectionUtils.isNotEmpty(sitePositionLists)) {
|
||||||
|
Map<String, List<VenueInfoDO>> map1 = venueInfoDOS.stream().collect(Collectors.groupingBy(VenueInfoDO::getPlaceName));
|
||||||
|
map1.forEach((placeName, venueInfos) -> {
|
||||||
|
Map<String, VenueInfoDO> venueInfoDOMap = venueInfoDOS.stream().collect(Collectors.toMap(VenueInfoDO::getSjName, Function.identity(), (a, b) -> a));
|
||||||
|
map.put(placeName, venueInfoDOMap);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (SitePositionList sitePositionList : sitePositionLists) {
|
||||||
|
if (map.containsKey(sitePositionList.getPlaceName())) {
|
||||||
|
Map<String, VenueInfoDO> venueInfoDOMap = map.get(sitePositionList.getPlaceName());
|
||||||
|
if (venueInfoDOMap.containsKey(sitePositionList.getSjName())) {
|
||||||
|
VenueInfoDO venueInfoDO = venueInfoDOMap.get(sitePositionList.getSjName());
|
||||||
|
venueInfoDO.setPlaceName(sitePositionList.getPlaceName());
|
||||||
|
venueInfoDO.setPlaceMainId(sitePositionList.getId());
|
||||||
|
venueInfoDO.setPlaceId(sitePositionList.getPlaceId());
|
||||||
|
venueInfoDO.setScheduleId(Integer.valueOf(sitePositionList.getScheduleId()));
|
||||||
|
venueInfoDO.setSjName(sitePositionList.getSjName());
|
||||||
|
venueInfoDO.setContacts(sitePositionList.getContacts());
|
||||||
|
venueInfoDO.setType(sitePositionList.getType());
|
||||||
|
venueInfoDO.setMoney(sitePositionList.getMoney());
|
||||||
|
venueInfoDO.setClassName(sitePositionList.getClassName());
|
||||||
|
venueInfoDO.setClassCode(sitePositionList.getClassCode());
|
||||||
|
venueInfoDO.setAppointments(sitePositionList.getAppointments());
|
||||||
|
venueInfoDO.setCTypeCode(sitePositionList.getCtypeCode());
|
||||||
|
venueInfoManage.updateById(venueInfoDO);
|
||||||
|
} else {
|
||||||
|
VenueInfoDO venueInfoDO = new VenueInfoDO();
|
||||||
|
venueInfoDO.setDate(LocalDate.now());
|
||||||
|
venueInfoDO.setCreateTime(LocalDateTime.now());
|
||||||
|
venueInfoDO.setPlaceName(sitePositionList.getPlaceName());
|
||||||
|
venueInfoDO.setPlaceMainId(sitePositionList.getId());
|
||||||
|
venueInfoDO.setPlaceId(sitePositionList.getPlaceId());
|
||||||
|
venueInfoDO.setScheduleId(Integer.valueOf(sitePositionList.getScheduleId()));
|
||||||
|
venueInfoDO.setSjName(sitePositionList.getSjName());
|
||||||
|
venueInfoDO.setContacts(sitePositionList.getContacts());
|
||||||
|
venueInfoDO.setType(sitePositionList.getType());
|
||||||
|
venueInfoDO.setMoney(sitePositionList.getMoney());
|
||||||
|
venueInfoDO.setClassName(sitePositionList.getClassName());
|
||||||
|
venueInfoDO.setClassCode(sitePositionList.getClassCode());
|
||||||
|
venueInfoDO.setAppointments(sitePositionList.getAppointments());
|
||||||
|
venueInfoDO.setCTypeCode(sitePositionList.getCtypeCode());
|
||||||
|
venueInfoManage.save(venueInfoDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean saveTomorrowVenueInfo(List<SitePositionList> sitePositionLists) {
|
||||||
|
for (SitePositionList sitePositionList : sitePositionLists) {
|
||||||
|
VenueInfoDO venueInfoDO = new VenueInfoDO();
|
||||||
|
venueInfoDO.setDate(LocalDate.now().plusDays(1));
|
||||||
|
venueInfoDO.setCreateTime(LocalDateTime.now());
|
||||||
|
venueInfoDO.setPlaceName(sitePositionList.getPlaceName());
|
||||||
|
venueInfoDO.setPlaceMainId(sitePositionList.getId());
|
||||||
|
venueInfoDO.setPlaceId(sitePositionList.getPlaceId());
|
||||||
|
venueInfoDO.setScheduleId(Integer.valueOf(sitePositionList.getScheduleId()));
|
||||||
|
venueInfoDO.setSjName(sitePositionList.getSjName());
|
||||||
|
venueInfoDO.setContacts(sitePositionList.getContacts());
|
||||||
|
venueInfoDO.setType(sitePositionList.getType());
|
||||||
|
venueInfoDO.setMoney(sitePositionList.getMoney());
|
||||||
|
venueInfoDO.setClassName(sitePositionList.getClassName());
|
||||||
|
venueInfoDO.setClassCode(sitePositionList.getClassCode());
|
||||||
|
venueInfoDO.setAppointments(sitePositionList.getAppointments());
|
||||||
|
venueInfoDO.setCTypeCode(sitePositionList.getCtypeCode());
|
||||||
|
venueInfoManage.save(venueInfoDO);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void updateDatabase(List<SitePositionList> list, boolean isToday) {
|
private void updateDatabase(List<SitePositionList> list, boolean isToday) {
|
||||||
List<VenueInfoDO> venueInfoDOS = Lists.newArrayList();
|
List<VenueInfoDO> venueInfoDOS = Lists.newArrayList();
|
||||||
if (isToday) {
|
if (isToday) {
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.xiang.app.modules.jntyzx.utils;
|
||||||
|
|
||||||
|
import com.xiang.xservice.basic.utils.Base64;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class JntyzxSaltEncodeUtils {
|
||||||
|
|
||||||
|
private static int[] getMonthAndDay() {
|
||||||
|
LocalDate currentDate = LocalDate.now();
|
||||||
|
int month = currentDate.getMonthValue();
|
||||||
|
int day = currentDate.getDayOfMonth();
|
||||||
|
return new int[]{month, day};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String sonAddSalt(String json) {
|
||||||
|
String svCiphertext = "";
|
||||||
|
String suiji = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
String token1 = String.valueOf(suiji.charAt((int) (Math.random() * (double) suiji.length())));
|
||||||
|
String token2 = String.valueOf(suiji.charAt((int) (Math.random() * (double) suiji.length())));
|
||||||
|
svCiphertext = Base64.encode(json.getBytes(StandardCharsets.UTF_8));
|
||||||
|
int[] monthAndDay = getMonthAndDay();
|
||||||
|
int month = monthAndDay[0];
|
||||||
|
int day = monthAndDay[1];
|
||||||
|
if (month == 1) {
|
||||||
|
svCiphertext = (svCiphertext = token1 + svCiphertext).substring(0, day - 1) + token2 + svCiphertext.substring(day - 1);
|
||||||
|
} else if (day == 1) {
|
||||||
|
svCiphertext = token2 + svCiphertext.substring(0, month - 1) + token1 + svCiphertext.substring(month - 1);
|
||||||
|
} else {
|
||||||
|
svCiphertext = (svCiphertext = svCiphertext.substring(0, month - 1) + token1 + svCiphertext.substring(month - 1)).substring(0, day - 1) + token2 + svCiphertext.substring(day - 1);
|
||||||
|
}
|
||||||
|
return svCiphertext;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.xiang.app.modules.jntyzx.utils;
|
||||||
|
|
||||||
|
import com.xiang.app.common.service.dingtalk.JtDingTalkFactory;
|
||||||
|
import com.xiang.app.modules.jntyzx.constants.RedisKeyConstant;
|
||||||
|
import com.xiang.xmc.service.cache.service.IRedisService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-01-26 09:14
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class MsgSendUtils {
|
||||||
|
|
||||||
|
private final IRedisService redisService;
|
||||||
|
private final JtDingTalkFactory jtDingTalkFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 限制钉钉消息发送 1小时最多5次
|
||||||
|
* @param redisKey redis缓存的key
|
||||||
|
* @param msgContent 消息内容
|
||||||
|
*/
|
||||||
|
public void sendMsgRestrict1Hours(String redisKey, String msgContent) {
|
||||||
|
String key = RedisKeyConstant.JNTYZX_VENUE_MSG_SEND_KEY + RedisKeyConstant.getDate();
|
||||||
|
String cache = (String) redisService.get(redisKey);
|
||||||
|
if (StringUtils.isNotBlank(cache)) {
|
||||||
|
int sendNum = Integer.parseInt(cache);
|
||||||
|
if (sendNum >= 0 && sendNum <= 5) {
|
||||||
|
jtDingTalkFactory.sendMsg(msgContent);
|
||||||
|
redisService.set(key, String.valueOf(++sendNum), 1, TimeUnit.HOURS);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
jtDingTalkFactory.sendMsg(msgContent);
|
||||||
|
redisService.set(key, "0", 1, TimeUnit.HOURS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.xiang.app.modules.jntyzx.utils;
|
package com.xiang.app.modules.jntyzx.utils;
|
||||||
|
|
||||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,4 +22,7 @@ public class VenueInfoUtils {
|
|||||||
public static boolean get8210VenueInfo(VenueInfoDO venueInfoDO) {
|
public static boolean get8210VenueInfo(VenueInfoDO venueInfoDO) {
|
||||||
return StringUtils.equals(venueInfoDO.getSjName(), "20:00-21:00") || StringUtils.equals(venueInfoDO.getSjName(), "21:00-22:00");
|
return StringUtils.equals(venueInfoDO.getSjName(), "20:00-21:00") || StringUtils.equals(venueInfoDO.getSjName(), "21:00-22:00");
|
||||||
}
|
}
|
||||||
|
public static boolean get8210VenueInfo(SitePositionList sitePositionList) {
|
||||||
|
return StringUtils.equals(sitePositionList.getSjName(), "20:00-21:00") || StringUtils.equals(sitePositionList.getSjName(), "21:00-22:00");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.xiang.app.modules.jntyzx.utils;
|
||||||
|
|
||||||
|
import java.time.DayOfWeek;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class WeekendUtils {
|
||||||
|
|
||||||
|
public static String isWeekend() {
|
||||||
|
LocalDate tomorrow = LocalDate.now().plusDays(1);
|
||||||
|
DayOfWeek dayOfWeek = tomorrow.getDayOfWeek();
|
||||||
|
String isWeekend = "0";
|
||||||
|
if (dayOfWeek.getValue() == 6 || dayOfWeek.getValue() == 7 ) {
|
||||||
|
isWeekend = "1";
|
||||||
|
}
|
||||||
|
return isWeekend;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,4 +25,27 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>2.3.0.RELEASE</version>
|
||||||
|
<configuration>
|
||||||
|
<classifier>exec</classifier>
|
||||||
|
<!-- 指定该Main Class为全局的唯一入口 -->
|
||||||
|
<mainClass>com.xiang.app.Application</mainClass>
|
||||||
|
<layout>ZIP</layout>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -17,7 +17,6 @@ import org.springframework.context.annotation.ComponentScan;
|
|||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@ConfigurationPropertiesScan(basePackages = {
|
@ConfigurationPropertiesScan(basePackages = {
|
||||||
"com.xiang.xservice.logger",
|
"com.xiang.xservice.logger",
|
||||||
"com.xiang.app.common.config",
|
|
||||||
})
|
})
|
||||||
@MapperScan(basePackages = {
|
@MapperScan(basePackages = {
|
||||||
"com.xiang.app.modules.*.mapper"
|
"com.xiang.app.modules.*.mapper"
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package com.xiang.app.debugger;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-02-25 10:23
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class OrderTest {
|
||||||
|
private static final UserTest userA = new UserTest(1L, "123");
|
||||||
|
private static final UserTest userB = new UserTest(2L, "234");
|
||||||
|
private static final UserTest userC = new UserTest(3L, "345");
|
||||||
|
private static final List<UserTest> users = Lists.newArrayList(userA, userB, userC);
|
||||||
|
|
||||||
|
private static final VenueInfoTest v1 = new VenueInfoTest(1L, "一号场地");
|
||||||
|
private static final VenueInfoTest v2 = new VenueInfoTest(2L, "二号场地");
|
||||||
|
private static final VenueInfoTest v3 = new VenueInfoTest(3L, "三号场地");
|
||||||
|
private static final Map<String, VenueInfoTest> venueInfoMap = Maps.newHashMap();
|
||||||
|
static {
|
||||||
|
venueInfoMap.put(v1.getPlaceName(), v1);
|
||||||
|
venueInfoMap.put(v2.getPlaceName(), v2);
|
||||||
|
venueInfoMap.put(v3.getPlaceName(), v3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
OrderTest orderTest = new OrderTest();
|
||||||
|
orderTest.test();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void test() {
|
||||||
|
users.parallelStream().forEach(user -> {
|
||||||
|
try {
|
||||||
|
for (String placeName : venueInfoMap.keySet()) {
|
||||||
|
VenueInfoTest venueInfoTest = venueInfoMap.get(placeName);
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
boolean order = createOrder(venueInfoTest, user);
|
||||||
|
if (order) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
log.info("睡眠中 1.25s");
|
||||||
|
Thread.sleep(1250);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.error("睡眠失败~~~");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 关键点:异常只影响当前 user
|
||||||
|
log.error("createOrder 异常,user={}", user.getId(), e);
|
||||||
|
return; // 结束这个 user,不影响其他 user
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean createOrder(VenueInfoTest venueInfoTest, UserTest userTest) {
|
||||||
|
log.info("用户:{}======>请求三方接口中", userTest.getUsername());
|
||||||
|
String order = order(venueInfoTest, userTest);
|
||||||
|
log.info("用户:{}======>请求结果::{}", userTest.getUsername(), order);
|
||||||
|
if (order.contains("成功")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (order.contains("锁卡")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String order(VenueInfoTest venueInfoTest, UserTest userTest) {
|
||||||
|
String msg = "~~~";
|
||||||
|
if (venueInfoTest.getId() == 1L && userTest.getId() == 2L) {
|
||||||
|
msg = "用户" + userTest.getUsername() + "预定成功!";
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
if (userTest.getId() == 1L) {
|
||||||
|
msg = "用户" + userTest.getUsername() + "频繁请求接口,将锁卡";
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
if (venueInfoTest.getId() == 2L) {
|
||||||
|
msg = "场地" + venueInfoTest.getPlaceName() + "已被预订";
|
||||||
|
}
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.xiang.app.debugger;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-02-25 10:24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserTest {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String username;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.xiang.app.debugger;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-02-25 10:28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VenueInfoTest {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String placeName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.xiang.app.schedule.jntyzx;
|
package com.xiang.app.schedule.jntyzx;
|
||||||
|
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IUserTokenInfoService;
|
||||||
import com.xiang.core.quartz.annotation.XxzJob;
|
import com.xiang.core.quartz.annotation.XxzJob;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: xiang
|
* @Author: xiang
|
||||||
@@ -10,10 +14,16 @@ import org.springframework.stereotype.Component;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
public class JtTokenRefreshTask {
|
public class JtTokenRefreshTask {
|
||||||
|
|
||||||
|
private final IUserTokenInfoService userTokenInfoService;
|
||||||
|
|
||||||
@XxzJob(name = "jtTokenRefreshHandler")
|
@XxzJob(name = "jtTokenRefreshHandler")
|
||||||
|
@GetMapping("/jtTokenRefreshHandler")
|
||||||
public void handle() {
|
public void handle() {
|
||||||
log.info("【Token】江南体育中心token续期定时任务启动!!!");
|
log.info("【Token】江南体育中心token续期定时任务启动!!!time:{}", System.currentTimeMillis());
|
||||||
|
userTokenInfoService.flushToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
package com.xiang.app.schedule.jntyzx;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.xiang.app.modules.jntyzx.constants.RedisKeyConstant;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserTokenInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IJntyzxHttpService;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IUserTokenInfoService;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IVenueService;
|
||||||
|
import com.xiang.app.modules.jntyzx.utils.MsgSendUtils;
|
||||||
|
import com.xiang.app.modules.jntyzx.utils.VenueInfoUtils;
|
||||||
|
import com.xiang.app.modules.jntyzx.utils.WeekendUtils;
|
||||||
|
import com.xiang.core.quartz.annotation.XxzJob;
|
||||||
|
import com.xiang.xservice.basic.utils.DateUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
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.GetMapping;
|
||||||
|
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
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
public class JtVenuePullTask {
|
||||||
|
|
||||||
|
private final IUserTokenInfoService userTokenInfoService;
|
||||||
|
private final IJntyzxHttpService jntyzxHttpService;
|
||||||
|
private final IVenueService venueService;
|
||||||
|
private final MsgSendUtils msgSendUtils;
|
||||||
|
|
||||||
|
@XxzJob(name = "jtVenueInfoPullTask")
|
||||||
|
@GetMapping("/jtVenueInfoPullTask")
|
||||||
|
public void handler() {
|
||||||
|
log.info("【Venue】江体小程序场地数据拉取定时任务启动!!!time:{}", System.currentTimeMillis());
|
||||||
|
List<UserTokenInfoDO> availableUser = userTokenInfoService.getAvailableUser();
|
||||||
|
if (CollectionUtils.isEmpty(availableUser)) {
|
||||||
|
log.info("当前无可用用户查询场地信息!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
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)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
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());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.xiang.app.schedule.jntyzx;
|
||||||
|
|
||||||
|
import com.xiang.app.common.service.dingtalk.JtDingTalkFactory;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserTokenInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IJtOrderService;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IUserTokenInfoService;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IVenueService;
|
||||||
|
import com.xiang.app.modules.jntyzx.utils.VenueInfoUtils;
|
||||||
|
import com.xiang.core.quartz.annotation.XxzJob;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Component
|
||||||
|
@RestController
|
||||||
|
public class JtVenueSubscribeTask {
|
||||||
|
|
||||||
|
private final IUserTokenInfoService userTokenInfoService;
|
||||||
|
private final IJtOrderService jtOrderService;
|
||||||
|
private final IVenueService venueService;
|
||||||
|
private final JtDingTalkFactory jtDingTalkFactory;
|
||||||
|
|
||||||
|
@XxzJob(name = "jtVenueSubscribeTask")
|
||||||
|
@GetMapping("/jtVenueSubscribeTask")
|
||||||
|
public void handle() {
|
||||||
|
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());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<VenueInfoDO> venueInfoDOS = venueService.queryTomorrowCanBuyVenue();
|
||||||
|
Map<String, List<VenueInfoDO>> venueInfoMap = venueInfoDOS.stream().filter(VenueInfoUtils::get8210VenueInfo).collect(Collectors.groupingByConcurrent(VenueInfoDO::getPlaceName));
|
||||||
|
if (MapUtils.isEmpty(venueInfoMap)) {
|
||||||
|
log.info("暂无可下单场地,time:{}", System.currentTimeMillis());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
users.parallelStream().forEach(user -> {
|
||||||
|
try {
|
||||||
|
for (String placeName : venueInfoMap.keySet()) {
|
||||||
|
List<VenueInfoDO> venueInfoDOList = venueInfoMap.get(placeName);
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.xiang.app.schedule.jntyzx;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.xiang.app.common.service.dingtalk.JtDingTalkFactory;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IJntyzxHttpService;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IUserTokenInfoService;
|
||||||
|
import com.xiang.app.modules.jntyzx.utils.VenueInfoUtils;
|
||||||
|
import com.xiang.app.modules.jntyzx.utils.WeekendUtils;
|
||||||
|
import com.xiang.core.quartz.annotation.XxzJob;
|
||||||
|
import com.xiang.xservice.basic.utils.DateUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
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.GetMapping;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-01-19 14:00
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class JtVenueTodaySubscribeTask {
|
||||||
|
|
||||||
|
private final IJntyzxHttpService jntyzxHttpService;
|
||||||
|
private final IUserTokenInfoService userTokenInfoService;
|
||||||
|
private final JtDingTalkFactory jtDingTalkFactory;
|
||||||
|
|
||||||
|
@XxzJob(name = "jtVenueTodaySubscribeTask")
|
||||||
|
@GetMapping("/jtVenueTodaySubscribeTask")
|
||||||
|
public void handle() {
|
||||||
|
String token = userTokenInfoService.getToken("Xiang");
|
||||||
|
if (StringUtils.isBlank(token)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<SitePositionList> sitePositionLists = jntyzxHttpService.queryAvailable(WeekendUtils.isWeekend(), token);
|
||||||
|
if (CollectionUtils.isEmpty(sitePositionLists)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sitePositionLists = sitePositionLists.stream().filter(VenueInfoUtils::get8210VenueInfo).toList();
|
||||||
|
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()) + " 20:00-22:00\n");
|
||||||
|
map.forEach((placeName, sitePositionList) -> {
|
||||||
|
msg.append(placeName).append("订购人:").append(sitePositionList.getContacts()).append("\n");
|
||||||
|
});
|
||||||
|
jtDingTalkFactory.sendMsg(msg.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.xiang.app.schedule.jntyzx;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.xiang.app.common.service.dingtalk.JtDingTalkFactory;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.UserTokenInfoDO;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.JntyzxResponse;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IJntyzxHttpService;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IUserTokenInfoService;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IVenueService;
|
||||||
|
import com.xiang.app.modules.jntyzx.utils.VenueInfoUtils;
|
||||||
|
import com.xiang.app.modules.jntyzx.utils.WeekendUtils;
|
||||||
|
import com.xiang.core.quartz.annotation.XxzJob;
|
||||||
|
import com.xiang.xservice.basic.utils.DateUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
public class JtVenueTomorrowPullTask {
|
||||||
|
private final IUserTokenInfoService userTokenInfoService;
|
||||||
|
private final IJntyzxHttpService jntyzxHttpService;
|
||||||
|
private final JtDingTalkFactory jtDingTalkFactory;
|
||||||
|
private final IVenueService venueService;
|
||||||
|
|
||||||
|
@XxzJob(name = "jtVenueTomorrowPullTask")
|
||||||
|
@GetMapping("/jtVenueTomorrowPullTask")
|
||||||
|
public void handle() {
|
||||||
|
log.info("【Venue】江体小程序场地拉取定时任务启动!!!time:{}", System.currentTimeMillis());
|
||||||
|
List<UserTokenInfoDO> availableUser = userTokenInfoService.getAvailableUser();
|
||||||
|
if (CollectionUtils.isEmpty(availableUser)) {
|
||||||
|
log.info("当前无可用用户查询场地信息!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 用户信息
|
||||||
|
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)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
venueService.saveTomorrowVenueInfo(sitePositionLists);
|
||||||
|
sitePositionLists = sitePositionLists.stream().filter(VenueInfoUtils::get8210VenueInfo).toList();
|
||||||
|
if (CollectionUtils.isEmpty(sitePositionLists)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,5 +24,4 @@ public class JtTokenServer {
|
|||||||
userTokenInfoService.updateTokenByName(username, token);
|
userTokenInfoService.updateTokenByName(username, token);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
namespace: 6f603892-e9f7-4ca4-acbc-538fa09ebec0
|
||||||
|
server-addr: general.xiangtech.xyz:8848
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
datasource:
|
||||||
|
dynamic:
|
||||||
|
primary: master
|
||||||
|
datasource:
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://rm-bp15t34gqx62jm069ro.mysql.rds.aliyuncs.com:3306/xservice_cornucopia?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
|
username: cornucopia
|
||||||
|
password: cornucopia@123
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
sshConnect: false
|
||||||
|
redis:
|
||||||
|
host: r-bp1wt59a6nfyt4e3ltpd.redis.rds.aliyuncs.com
|
||||||
|
port: 6379
|
||||||
|
password: Xiang0000 # 如果无密码可以省略
|
||||||
|
database: 0
|
||||||
|
timeout: 5000
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 8
|
||||||
|
max-idle: 8
|
||||||
|
min-idle: 0
|
||||||
|
max-wait: 1000
|
||||||
|
xxz-job:
|
||||||
|
app-name: xservice-cornucopia
|
||||||
|
admin-address: http://192.168.1.10:10001
|
||||||
|
namespace: 17029199820391402
|
||||||
|
|
||||||
|
dingtalk:
|
||||||
|
robot:
|
||||||
|
properties:
|
||||||
|
venue:
|
||||||
|
name: 江南体育中心通知群
|
||||||
|
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
|
||||||
|
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
|
||||||
|
users:
|
||||||
|
- 450841600726084717
|
||||||
@@ -17,12 +17,6 @@ spring:
|
|||||||
password: cornucopia@123
|
password: cornucopia@123
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
sshConnect: false
|
sshConnect: false
|
||||||
xxz-job:
|
|
||||||
url: jdbc:mysql://120.27.153.87:3306/xservice_quartz?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
|
||||||
username: quartz
|
|
||||||
password: quartz@123
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
sshConnect: false
|
|
||||||
redis:
|
redis:
|
||||||
host: r-bp1wt59a6nfyt4e3ltpd.redis.rds.aliyuncs.com
|
host: r-bp1wt59a6nfyt4e3ltpd.redis.rds.aliyuncs.com
|
||||||
port: 6379
|
port: 6379
|
||||||
@@ -37,7 +31,7 @@ spring:
|
|||||||
max-wait: 1000
|
max-wait: 1000
|
||||||
xxz-job:
|
xxz-job:
|
||||||
app-name: xservice-cornucopia
|
app-name: xservice-cornucopia
|
||||||
admin-address: http://127.0.0.1:30030
|
admin-address: http://192.168.1.10:10001
|
||||||
namespace: 1
|
namespace: 1
|
||||||
|
|
||||||
dingtalk:
|
dingtalk:
|
||||||
|
|||||||
Reference in New Issue
Block a user