From cabda12d788eeb6e056113ac8352dfaf972490d9 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期一, 20 十月 2025 17:10:44 +0800
Subject: [PATCH] bug修改,后台新增预约记录,玩湃惠民卡修改二维码参数规则,启动游戏取消校验是否订场校验
---
cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java | 83 ++++++++++++++++++++++++++---------------
1 files changed, 53 insertions(+), 30 deletions(-)
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
index dda3d22..6bf789c 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
@@ -834,15 +834,18 @@
private ICouponService couponService;
+
@ResponseBody
@PostMapping("/base/pointMerchars/getDetailsOfExchange")
- public ExchangeDetailsVo getIntegralExchangeDetails(@RequestBody Integer appUserId) {
+ public ExchangeDetailsVo getIntegralExchangeDetails(@RequestBody Integer appUserId) throws ParseException {
ExchangeDetailsVo detailsVo = new ExchangeDetailsVo();
List<ExchangeDetailsResponse> responses = new ArrayList<>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
List<UserPointsMerchandise> pointsMerchandises = upmseService.list(new QueryWrapper<UserPointsMerchandise>()
.eq("userId", appUserId).eq("payStatus", 2));
-
+ List<PointsMerchandiseStore> pointsMerchandiseStoreList = pointsMerchandiseStoreService.list();
+ Map<Integer, List<PointsMerchandiseStore>> pointsMerchandiseStoreMap = pointsMerchandiseStoreList.stream().collect(Collectors.groupingBy(PointsMerchandiseStore::getPointsMerchandiseId));
List<Coupon> list1 = couponService.list();
List<Integer> ids = new ArrayList<>();
@@ -862,6 +865,7 @@
if (merchandise == null) {
continue;
}
+
ExchangeDetailsResponse detailsResponse = new ExchangeDetailsResponse();
detailsResponse.setDetailsId(pointsMerchandise.getId());
detailsResponse.setGoodName(merchandise.getName());
@@ -966,36 +970,47 @@
if (merchandise.getCardType() == 1) {
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(pointsMerchandise.getInsertTime());
- calendar.add(Calendar.DAY_OF_MONTH, 1);
- Date end = calendar.getTime();
- String startDate = dateFormat.format(pointsMerchandise.getInsertTime());
- String endDate = dateFormat.format(end);
- detailsResponse.setStartTime(startDate);
- detailsResponse.setEndTime(startDate);
- Date now = new Date();
- Calendar cal1 = Calendar.getInstance();
- cal1.setTime(pointsMerchandise.getInsertTime());
- Calendar cal2 = Calendar.getInstance();
- cal2.setTime(now);
- // Compare the year, month, and day of the two Calendar instances
- boolean isSameDate = cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&
- cal1.get(Calendar.MONTH) == cal2.get(Calendar.MONTH) &&
- cal1.get(Calendar.DAY_OF_MONTH) == cal2.get(Calendar.DAY_OF_MONTH);
+ // 日卡开始时间和结束时间根据门店营业时间来
+ // 查询门店
+ List<Integer> storeIds = pointsMerchandiseStoreMap.get(merchandise.getId()).stream().map(PointsMerchandiseStore::getStoreId)
+ .collect(Collectors.toList());
+ List<Store> stores = storeClient.queryStoreByIds(storeIds);
+ String startTime = "";
+ String endTime = "";
- // Print the result
- if (isSameDate) {
- } else {
- System.out.println("The two dates do not have the same date.");
- detailsResponse.setUseStatus(3);
+ if (stores != null && !stores.isEmpty()) {
+ // 初始化为第一个门店的时间
+ startTime = stores.get(0).getStartTime();
+ endTime = stores.get(0).getEndTime();
+ // 遍历所有门店,找出最早的开始时间和最晚的结束时间
+ for (Store store : stores) {
+ String storeStartTime = store.getStartTime();
+ String storeEndTime = store.getEndTime();
+ if (storeStartTime != null && startTime != null) {
+ // 比较开始时间,找出最早的
+ if (storeStartTime.compareTo(startTime) < 0) {
+ startTime = storeStartTime;
+ }
+ }
+
+ if (storeEndTime != null && endTime != null) {
+ // 比较结束时间,找出最晚的
+ if (storeEndTime.compareTo(endTime) > 0) {
+ endTime = storeEndTime;
+ }
+ }
+ }
}
-
-
+ String format = simpleDateFormat1.format(pointsMerchandise.getInsertTime());
+ detailsResponse.setStartTime(format+" "+startTime+":00");
+ detailsResponse.setEndTime(format+" "+endTime+":00");
+ if (simpleDateFormat.parse(format+" "+endTime+":00").before(new Date())){
+ System.err.println("过期了,当前门店中最晚营业时间为"+format+" "+endTime+":00");
+ detailsResponse.setUseStatus(3);
+ }
} else if (merchandise.getCardType() == 2) {
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.setTime(pointsMerchandise.getInsertTime());
calendar.add(Calendar.DAY_OF_MONTH, 31);
@@ -1011,7 +1026,7 @@
}
} else if (merchandise.getCardType() == 3) {
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.setTime(pointsMerchandise.getInsertTime());
calendar.add(Calendar.DAY_OF_MONTH, 93);
@@ -1027,7 +1042,7 @@
}
} else if (merchandise.getCardType() == 4) {
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.setTime(pointsMerchandise.getInsertTime());
calendar.add(Calendar.DAY_OF_MONTH, 372);
@@ -1495,6 +1510,14 @@
upmseService.save(merchandise);
return merchandise.getId();
}
+ @PostMapping("/base/pointMerchars/saveDetailsUserPointMercaseList")
+ public Boolean saveDetailsUserPointMercaseList(@RequestBody List<UserPointsMerchandise> merchandises) {
+ for (UserPointsMerchandise merchandise : merchandises) {
+ merchandise.setInsertTime(new Date());
+ }
+
+ return upmseService.saveBatch(merchandises);
+ }
@PostMapping("/base/pointMerchars/updateDetailsUserPointMercase")
--
Gitblit v1.7.1