From 6af0c7434178ca41e727c700af8174201a865de9 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期四, 02 十一月 2023 11:55:29 +0800
Subject: [PATCH] 10.31.8
---
cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java | 60 +++++++++++++++---------------
cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java | 2
cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java | 3 +
cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java | 6 ++
4 files changed, 39 insertions(+), 32 deletions(-)
diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
index 8f43a50..b1a0865 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
@@ -960,7 +960,7 @@
if (request.getShopId()!=null){
if (goods.size() > 0 ){
goods = goods.stream()
- .filter( merchandise ->(merchandise.getGoodsType() == 4&&merchandise.getUseScope() == 1)||merchandise.getShopIds().contains(request.getShopId()))
+ .filter( merchandise ->(merchandise.getGoodsType() == 4&&merchandise.getUseScope() == 2)||(merchandise.getGoodsType() == 4&&merchandise.getUseScope() == 1)||merchandise.getShopIds().contains(request.getShopId()))
.collect(Collectors.toList());
}
}
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
index d9bac30..63da441 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
@@ -199,18 +199,18 @@
@PostMapping("/base/coupon/getAllCoupons")
public List<Coupon> getAllCoupons(@RequestBody CommodityRequest request){
List<Coupon> couponList = new ArrayList<>();
-// String provinceCode = "";
-// String cityCode = "";
-// if (ToolUtil.isEmpty(request.getLat()) && ToolUtil.isEmpty(request.getLon())){
-// return couponList;
-// }
-// try {
-// Map<String, String> geocode = gdMapGeocodingUtil.geocode(request.getLon(), request.getLat());
-// provinceCode = geocode.get("provinceCode");
-// cityCode = geocode.get("cityCode");
-// }catch (Exception e){
-// e.printStackTrace();
-// }
+ String provinceCode = "";
+ String cityCode = "";
+ if (ToolUtil.isEmpty(request.getLat()) && ToolUtil.isEmpty(request.getLon())){
+ return couponList;
+ }
+ try {
+ Map<String, String> geocode = gdMapGeocodingUtil.geocode(request.getLon(), request.getLat());
+ provinceCode = geocode.get("provinceCode");
+ cityCode = geocode.get("cityCode");
+ }catch (Exception e){
+ e.printStackTrace();
+ }
try {
LocalDateTime currentDate = LocalDateTime.now();
@@ -220,24 +220,24 @@
.eq("status",1)
.le("startTime", currentDate)
.ge("endTime", currentDate));
-// if (couponList.size() > 0 ){
-// Iterator<Coupon> iterator = couponList.iterator();
-// while (iterator.hasNext()) {
-// Coupon merchandise = iterator.next();
-// if (merchandise.getUseScope() == 2){
-// List<CouponCity> couponCities = cityService.list(new LambdaQueryWrapper<CouponCity>()
-// .eq(CouponCity::getCouponId,merchandise.getId()));
-// if (couponCities.size() > 0){
-// for (CouponCity couponCity : couponCities) {
-// if (!Objects.equals(couponCity.getCityCode(), cityCode) && !Objects.equals(couponCity.getProvinceCode(), provinceCode)){
-// iterator.remove(); // 移除符合条件的商品
-// break;
-// }
-// }
-// }
-// }
-// }
-// }
+ if (couponList.size() > 0 ){
+ Iterator<Coupon> iterator = couponList.iterator();
+ while (iterator.hasNext()) {
+ Coupon merchandise = iterator.next();
+ if (merchandise.getUseScope() == 2){
+ List<CouponCity> couponCities = cityService.list(new LambdaQueryWrapper<CouponCity>()
+ .eq(CouponCity::getCouponId,merchandise.getId()));
+ if (couponCities.size() > 0){
+ for (CouponCity couponCity : couponCities) {
+ if (!Objects.equals(couponCity.getCityCode(), cityCode) && !Objects.equals(couponCity.getProvinceCode(), provinceCode)){
+ iterator.remove(); // 移除符合条件的商品
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
return couponList;
} catch (Exception e) {
throw new RuntimeException(e);
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 e374344..e5ca82e 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
@@ -701,6 +701,9 @@
if (pointsMerchandises.size() > 0 ){
for (UserPointsMerchandise pointsMerchandise : pointsMerchandises) {
PointsMerchandise merchandise = pmdsService.getById(pointsMerchandise.getPointsMerchandiseId());
+ if (merchandise==null){
+ continue;
+ }
ExchangeDetailsResponse detailsResponse = new ExchangeDetailsResponse();
detailsResponse.setDetailsId(pointsMerchandise.getId());
detailsResponse.setGoodName(merchandise.getName());
diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java
index b7b81ff..baf6f33 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/controller/GameController.java
@@ -28,6 +28,7 @@
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
+import java.util.stream.Collectors;
@RestController
@RequestMapping("/api/game")
@@ -89,7 +90,10 @@
tGameConfigs = gameConfigService.listJs(id);
}
- return ResultUtil.success(tGameConfigs);
+ List<TGameConfig> filteredList = tGameConfigs.stream()
+ .filter(gameConfig -> !gameConfig.getImg().isEmpty())
+ .collect(Collectors.toList());
+ return ResultUtil.success(filteredList);
}catch (Exception e){
e.printStackTrace();
return ResultUtil.runErr();
--
Gitblit v1.7.1