Compare commits
4 Commits
4f07b22919
...
feat/app_i
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd4d9c639a | ||
|
|
1d21a1d9d5 | ||
|
|
714bd3ce06 | ||
|
|
a20cdc46fd |
@@ -0,0 +1,35 @@
|
||||
package com.xiang.app.module.jntyzx.pojo.req;
|
||||
|
||||
import com.xiang.xservice.basic.common.req.BaseRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-04-09 09:39
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class VenueInfoQueryRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@NotNull(message = "日期不能为空")
|
||||
private LocalDate date;
|
||||
/**
|
||||
* 时间段 例如 20:00-21:00
|
||||
*/
|
||||
private String sj;
|
||||
|
||||
/**
|
||||
* 场地名称
|
||||
*/
|
||||
private String placeName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xiang.app.module.jntyzx.pojo.req;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-04-09 10:00
|
||||
*/
|
||||
@Data
|
||||
public class VenueInfoSubscribeRequest {
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.xiang.app.module.jntyzx.pojo.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-04-09 09:42
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class VenueInfoQueryResp {
|
||||
|
||||
/**
|
||||
* 场地名称
|
||||
*/
|
||||
private String placeName;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private LocalDate date;
|
||||
|
||||
/**
|
||||
* 时间范围
|
||||
*/
|
||||
private String sjName;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contacts;
|
||||
|
||||
/**
|
||||
* 0:可订购 2:zlb 4:已订购
|
||||
*/
|
||||
private Integer type;
|
||||
private Long placeMainId;
|
||||
private Integer placeId;
|
||||
private Integer scheduleId;
|
||||
private String className;
|
||||
private String classCode;
|
||||
private String appointments;
|
||||
private String cTypeCode;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xiang.app.modules.jntyzx.converts;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xiang.app.module.jntyzx.pojo.resp.VenueInfoQueryResp;
|
||||
import com.xiang.app.modules.jntyzx.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,6 +1,8 @@
|
||||
package com.xiang.app.modules.jntyzx.manage;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@@ -15,4 +17,6 @@ public interface IVenueInfoManage extends IService<VenueInfoDO> {
|
||||
List<VenueInfoDO> queryByDate(LocalDate date);
|
||||
|
||||
List<VenueInfoDO> queryByType(LocalDate date, Integer type);
|
||||
|
||||
Page<VenueInfoDO> page(VenueInfoQueryRequest request);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,12 @@ 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.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||
import com.xiang.app.modules.jntyzx.mapper.JntyzxVenueInfoMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@@ -30,4 +33,18 @@ public class VenueInfoManageImpl extends ServiceImpl<JntyzxVenueInfoMapper, Venu
|
||||
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,9 +1,14 @@
|
||||
package com.xiang.app.modules.jntyzx.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||
import com.xiang.app.module.jntyzx.pojo.resp.VenueInfoQueryResp;
|
||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -31,4 +36,11 @@ public interface IVenueService {
|
||||
* @return
|
||||
*/
|
||||
boolean saveTomorrowVenueInfo(List<SitePositionList> sitePositionLists);
|
||||
|
||||
/**
|
||||
* 查询场地列表信息
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
Page<VenueInfoQueryResp> list(@NotNull(message = "请求参数不能为空") @Valid VenueInfoQueryRequest request);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
||||
public boolean updateTokenByName(String name, String token) {
|
||||
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(name);
|
||||
if (Objects.isNull(userTokenInfoDO)) {
|
||||
return false;
|
||||
throw new BusinessException("用户信息不存在!");
|
||||
}
|
||||
userTokenInfoDO.setToken(token);
|
||||
boolean flag = userTokenInfoManage.updateById(userTokenInfoDO);
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.xiang.app.modules.jntyzx.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.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||
import com.xiang.app.module.jntyzx.pojo.resp.VenueInfoQueryResp;
|
||||
import com.xiang.app.modules.jntyzx.converts.VenueInfoConverter;
|
||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||
import com.xiang.app.modules.jntyzx.manage.IVenueInfoManage;
|
||||
@@ -34,6 +38,7 @@ 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() {
|
||||
@@ -155,6 +160,12 @@ 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) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.xiang.app;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class HealthController {
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String env;
|
||||
|
||||
@GetMapping("/actuator/health")
|
||||
public Map<String, String> checkHealth() {
|
||||
Map<String, String> map = Maps.newHashMap();
|
||||
map.put("env", env);
|
||||
map.put("status", "UP");
|
||||
log.info("cornucopia application health check success! listening in env:{}, now:{}", env, System.currentTimeMillis());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,10 @@ public class JtVenueSubscribeTask {
|
||||
return;
|
||||
}
|
||||
List<VenueInfoDO> venueInfoDOS = venueService.queryTomorrowCanBuyVenue();
|
||||
Map<String, List<VenueInfoDO>> venueInfoMap = venueInfoDOS.stream().filter(VenueInfoUtils::get8210VenueInfo).collect(Collectors.groupingByConcurrent(VenueInfoDO::getPlaceName));
|
||||
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());
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.xiang.app.server.jntyzx;
|
||||
|
||||
import com.xiang.app.modules.jntyzx.service.IJtOrderService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-04-09 10:01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/private/apps/jntyzx/order")
|
||||
@RequiredArgsConstructor
|
||||
public class OrderServer {
|
||||
private final IJtOrderService orderService;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.xiang.app.server.jntyzx;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoSubscribeRequest;
|
||||
import com.xiang.app.module.jntyzx.pojo.resp.VenueInfoQueryResp;
|
||||
import com.xiang.app.modules.jntyzx.service.IVenueService;
|
||||
import com.xiang.xservice.basic.common.resp.Result;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Author: xiang
|
||||
* @Date: 2026-04-09 09:36
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/private/apps/jntyzx/venue")
|
||||
@RequiredArgsConstructor
|
||||
public class VenueInfoServer {
|
||||
|
||||
private final IVenueService venueService;
|
||||
|
||||
@PostMapping("/page")
|
||||
public Result<Page<VenueInfoQueryResp>> list(@RequestBody @NotNull(message = "请求参数不能为空") @Valid VenueInfoQueryRequest request) {
|
||||
return Result.data(venueService.list(request));
|
||||
}
|
||||
|
||||
@PostMapping("/subscribe")
|
||||
public Result<Boolean> subscribe(@RequestBody @NotNull(message = "请求参数不能为空") @Valid VenueInfoSubscribeRequest request) {
|
||||
return Result.data(null);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,10 @@ spring:
|
||||
discovery:
|
||||
group: DEFAULT_GROUP
|
||||
namespace: 00131110-3ecb-4a35-8bbb-624edde1d937
|
||||
server-addr: general.xiangtech.xyz:8848
|
||||
server-addr: http://192.168.1.10:8848
|
||||
|
||||
# 是否启用健康检查
|
||||
register-enabled: true
|
||||
username: nacos
|
||||
password: nacos
|
||||
datasource:
|
||||
47
xservice-server/src/main/resources/application-outside.yml
Normal file
47
xservice-server/src/main/resources/application-outside.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
group: DEFAULT_GROUP
|
||||
namespace: 00131110-3ecb-4a35-8bbb-624edde1d937
|
||||
server-addr: http://general.xiangtech.xyz:8848
|
||||
# 是否启用健康检查
|
||||
# register-enabled: false
|
||||
username: nacos
|
||||
password: nacos
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://120.27.153.87: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: 10
|
||||
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: 1
|
||||
|
||||
dingtalk:
|
||||
robot:
|
||||
properties:
|
||||
venue:
|
||||
name: 江南体育中心通知群
|
||||
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
|
||||
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
|
||||
users:
|
||||
- 450841600726084717
|
||||
@@ -4,7 +4,9 @@ spring:
|
||||
discovery:
|
||||
group: DEFAULT_GROUP
|
||||
namespace: 6f603892-e9f7-4ca4-acbc-538fa09ebec0
|
||||
server-addr: general.xiangtech.xyz:8848
|
||||
server-addr: http://192.168.32.3:8848
|
||||
# 是否启用健康检查
|
||||
register-enabled: true
|
||||
username: nacos
|
||||
password: nacos
|
||||
datasource:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: test
|
||||
active: outside
|
||||
application:
|
||||
name: xservice-cornucopia
|
||||
main:
|
||||
|
||||
Reference in New Issue
Block a user