| Pass |
- 15:11:23 |
+ 10:15:14 |
Test passed
|
@@ -128,13 +128,13 @@
Started
-
02, 2026 15:11:22
+
09, 2026 10:15:14
Ended
-
02, 2026 15:11:23
+
09, 2026 10:15:14
diff --git a/hiver-core/src/main/java/cc/hiver/core/common/constant/DealingsRecordConstant.java b/hiver-core/src/main/java/cc/hiver/core/common/constant/DealingsRecordConstant.java
index c0475b36..74fb2b74 100644
--- a/hiver-core/src/main/java/cc/hiver/core/common/constant/DealingsRecordConstant.java
+++ b/hiver-core/src/main/java/cc/hiver/core/common/constant/DealingsRecordConstant.java
@@ -15,7 +15,7 @@ public interface DealingsRecordConstant {
/**
*
*/
- String[] TYPE_REMARK = {"配送订单佣金","售后退款","配送排名奖励","商家提现","配送员提现","免单奖励","商家结算","用户提现","白嫖中奖","学院排位赛排名奖励","配送员原因退款扣款","商家原因退款补发配送佣金","商家退款/售后扣款","二级代理返佣"};
+ String[] TYPE_REMARK = {"配送订单佣金","售后退款","配送排名奖励","商家提现","配送员提现","免单奖励","商家结算","用户提现","白嫖中奖","排位赛排名奖励","配送员原因退款扣款","商家原因退款补发配送佣金","商家退款/售后扣款","二级代理返佣"};
/**
*交易类型:0:增加 1 提现 2消费 3售后
diff --git a/hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java b/hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java
index faeb9fd2..49ba54f0 100644
--- a/hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java
+++ b/hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java
@@ -4,9 +4,15 @@ import cc.hiver.core.service.JPushService;
import cn.jpush.api.JPushClient;
import cn.jpush.api.push.PushResult;
import cn.jpush.api.push.model.Message;
+import cn.jpush.api.push.model.Options;
+import cn.jpush.api.push.model.Platform;
import cn.jpush.api.push.model.PushPayload;
+import cn.jpush.api.push.model.audience.Audience;
+import cn.jpush.api.push.model.notification.AndroidNotification;
+import cn.jpush.api.push.model.notification.IosNotification;
import cn.jpush.api.push.model.notification.Notification;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.PreDestroy;
@@ -22,6 +28,9 @@ public class JPushServiceImpl implements JPushService {
@Autowired
private JPushClient jPushClient;
+ @Value("${jpush.apnsProduction:false}")
+ private Boolean apnsProduction;
+
private final ScheduledExecutorService pushScheduler = Executors.newSingleThreadScheduledExecutor();
@Autowired
@@ -43,16 +52,35 @@ public class JPushServiceImpl implements JPushService {
private void doSendPushNotification(String registrationId, String message, String orderId) {
try {
+ String timestamp = String.valueOf(System.currentTimeMillis());
PushPayload payload = PushPayload.newBuilder()
- .setPlatform(cn.jpush.api.push.model.Platform.all())
- .setAudience(cn.jpush.api.push.model.audience.Audience.registrationId(registrationId))
- .setNotification(Notification.alert(message))
+ .setPlatform(Platform.all())
+ .setAudience(Audience.registrationId(registrationId))
+ .setNotification(Notification.newBuilder()
+ .addPlatformNotification(AndroidNotification.newBuilder()
+ .setAlert(message)
+ .addExtra("type", "订单通知")
+ .addExtra("order_id", orderId)
+ .addExtra("timestamp", timestamp)
+ .build())
+ .addPlatformNotification(IosNotification.newBuilder()
+ .setAlert(message)
+ .setSound("default")
+ .incrBadge(1)
+ .addExtra("type", "订单通知")
+ .addExtra("order_id", orderId)
+ .addExtra("timestamp", timestamp)
+ .build())
+ .build())
.setMessage(Message.newBuilder()
.setMsgContent("消息内容")
.addExtra("custom_key", "custom_value") // 额外参数
.addExtra("type", "订单通知")
.addExtra("order_id",orderId)
- .addExtra("timestamp", System.currentTimeMillis())
+ .addExtra("timestamp", timestamp)
+ .build())
+ .setOptions(Options.newBuilder()
+ .setApnsProduction(Boolean.TRUE.equals(apnsProduction))
.build())
.build();
PushResult result = jPushClient.sendPush(payload);
diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
index 44a95fac..7480cafd 100644
--- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
+++ b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
@@ -335,6 +335,52 @@ public class AuthController {
return ResultUtil.data(result);
}
+ @RequestMapping(value = "/updateClientId", method = RequestMethod.POST)
+ @ApiOperation("更新当前登录用户推送ID")
+ public Result updateClientId(@RequestParam(value = "clientId", required = false) String clientId) {
+ if (StringUtils.isEmpty(clientId)) {
+ return ResultUtil.error("clientId不能为空");
+ }
+ final User user = securityUtil.getCurrUser();
+ if (user == null || StringUtils.isEmpty(user.getId())) {
+ return ResultUtil.error("用户未登录");
+ }
+ updateClientIdByUserId(user.getId(), clientId);
+ return ResultUtil.success("修改成功");
+ }
+
+ private void updateClientIdByUserId(String userId, String clientId) {
+ if (StringUtils.isEmpty(userId) || StringUtils.isEmpty(clientId)) {
+ return;
+ }
+ List shop = shopService.getShopByUserid(userId);
+ if (shop != null && !shop.isEmpty()) {
+ for (Shop item : shop) {
+ item.setClientId(clientId);
+ shopService.update(item);
+ shopService.refreshShopCache(item.getId(), item.getRegionId());
+ }
+ }
+ Worker worker = workerService.findByUserId(userId);
+ if (worker != null) {
+ worker.setClientId(clientId);
+ workerService.update(worker);
+ String oldRegion = worker.getRegion();
+ WorkerRedisVo workerRedisVo = StrUtil.isNotBlank(oldRegion) ? workerRedisCacheUtil.get(oldRegion, worker.getWorkerId()) : null;
+ if (workerRedisVo != null) {
+ workerRedisVo.setWorker(worker);
+ if (Objects.equals(oldRegion, worker.getRegion())) {
+ workerRedisCacheUtil.update(worker.getRegion(), workerRedisVo);
+ } else {
+ workerRedisCacheUtil.remove(oldRegion, worker.getWorkerId());
+ if (StrUtil.isNotBlank(worker.getRegion())) {
+ workerRedisCacheUtil.put(worker.getRegion(), workerRedisVo);
+ }
+ }
+ }
+ }
+ }
+
@RequestMapping(value = "/getLoginQRCode", method = RequestMethod.GET)
@ApiOperation("获取扫码登录二维码")
@RateLimiter(rate = 1, ipLimit = true)
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/AdminDataStatisticsController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/AdminDataStatisticsController.java
index 9a09ae0c..7779cbf8 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/AdminDataStatisticsController.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/AdminDataStatisticsController.java
@@ -46,7 +46,7 @@ public class AdminDataStatisticsController {
private static final BigDecimal CONTENT_AUDIT_PACKAGE_PRICE = new BigDecimal("0.05");
private static final BigDecimal REAL_NAME_UNIT_PRICE = BigDecimal.ONE;
- private static final String REWARD_COLLEGE_RANK = "学院排位赛排名奖励";
+ private static final String REWARD_COLLEGE_RANK = "排位赛排名奖励";
private static final String REWARD_DELIVERY_RANK = "配送排名奖励";
private static final String REWARD_DRAW_POOL = "白嫖中奖";
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopAreaController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopAreaController.java
index 7ee76b6a..05a25797 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopAreaController.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopAreaController.java
@@ -272,6 +272,20 @@ public class ShopAreaController {
return new ResultUtil>().setData(list);
}
+ @RequestMapping(value = "/matchByLocation", method = RequestMethod.GET)
+ @ApiOperation(value = "根据经纬度匹配一级区域")
+ public Result matchByLocation(@ApiParam(value = "纬度", required = true) @RequestParam Double lat,
+ @ApiParam(value = "经度", required = true) @RequestParam Double lng) {
+ if (lat == null || lng == null) {
+ return ResultUtil.error("经纬度不能为空");
+ }
+ if (lat < -90 || lat > 90 || lng < -180 || lng > 180) {
+ return ResultUtil.error("经纬度不合法");
+ }
+ ShopArea matched = shopAreaService.matchByLocation(lat, lng);
+ return new ResultUtil().setData(matched);
+ }
+
public void setInfo(List list) {
// lambda表达式
list.forEach(item -> {
@@ -290,16 +304,35 @@ public class ShopAreaController {
shopArea.setParentAgentId(null);
shopArea.setParentAgentName(null);
shopArea.setCommissionRatio(0);
+ shopArea.setCenterLng(null);
+ shopArea.setCenterLat(null);
+ shopArea.setRadiusMeters(null);
+ shopArea.setAreaKind(1);
return null;
}
+ Integer areaKind = shopArea.getAreaKind();
+ if (areaKind == null) {
+ shopArea.setAreaKind(1);
+ } else if (areaKind != 1 && areaKind != 2) {
+ return ResultUtil.error("区域类型仅支持:1校园区域,2社会区域");
+ }
Integer commissionRatio = shopArea.getCommissionRatio();
if (commissionRatio == null) {
shopArea.setCommissionRatio(0);
- return null;
- }
- if (commissionRatio < 0 || commissionRatio > 100) {
+ } else if (commissionRatio < 0 || commissionRatio > 100) {
return ResultUtil.error("返佣比例需为0或1-100之间的整数");
}
+ boolean hasLng = shopArea.getCenterLng() != null;
+ boolean hasLat = shopArea.getCenterLat() != null;
+ boolean hasRadius = shopArea.getRadiusMeters() != null;
+ if (hasLng || hasLat || hasRadius) {
+ if (!hasLng || !hasLat) {
+ return ResultUtil.error("区域中心经纬度需同时设置");
+ }
+ if (!hasRadius || shopArea.getRadiusMeters() <= 0) {
+ return ResultUtil.error("匹配半径需为正整数(米)");
+ }
+ }
return null;
}
}
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/WorkerController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/WorkerController.java
index 539ed6f5..0b400ea2 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/WorkerController.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/WorkerController.java
@@ -242,7 +242,7 @@ public class WorkerController {
@ApiOperation(value = "修改配送员信息-APP", notes = "需要通过下单编号获取订单信息")
public Result editApp(WorkerAppVO u) {
//修改配送员信息时如涉及到充值押金情况,需要更新余额且重置应缴
- Worker worker = workerService.get(u.getWorkerId());
+ Worker worker = workerService.findByWorkerId(u.getWorkerId());
if (u.getDepoNum() != null && u.getDepoNum().compareTo(BigDecimal.ZERO) > 0) {
Recharge recharge = new Recharge();
@@ -268,7 +268,7 @@ public class WorkerController {
@RequestMapping(value = "/admin/disable/{workerId}", method = RequestMethod.POST)
@ApiOperation(value = "后台人工禁用配送员")
public Result disable(@ApiParam("用户唯一id标识") @PathVariable String workerId) {
- Worker worker = workerService.get(workerId);
+ Worker worker = workerService.findByWorkerId(workerId);
if (worker == null) {
return ResultUtil.error("配送员不存在");
}
@@ -284,7 +284,7 @@ public class WorkerController {
@RequestMapping(value = "/admin/enable/{workerId}", method = RequestMethod.POST)
@ApiOperation(value = "后台人工启用配送员")
public Result enable(@ApiParam("配送员唯一id标识") @PathVariable String workerId) {
- Worker worker = workerService.get(workerId);
+ Worker worker = workerService.findByWorkerId(workerId);
if (worker == null) {
return ResultUtil.error("配送员不存在");
}
@@ -300,7 +300,8 @@ public class WorkerController {
@ApiOperation(value = "后台设置配送员全职状态")
public Result changeFullTime(@ApiParam("配送员唯一id标识") @PathVariable String workerId,
@RequestParam("isFullTime") Integer isFullTime) {
- Worker worker = workerService.get(workerId);
+ // 注意:不要用 workerService.get()(底层 getById 返回懒加载代理,仅有主键)
+ Worker worker = workerService.findByWorkerId(workerId);
if (worker == null) {
return ResultUtil.error("配送员不存在");
}
@@ -308,7 +309,12 @@ public class WorkerController {
return ResultUtil.error("全职状态参数错误");
}
workerService.changeFullTime(workerId, isFullTime);
+ // 批量更新后重新查询完整对象,避免把残缺数据写入配送员缓存
+ worker = workerService.findByWorkerId(workerId);
worker.setIsFullTime(isFullTime);
+ if (worker == null) {
+ return ResultUtil.error("配送员不存在");
+ }
if (StrUtil.isNotBlank(worker.getRegion())) {
WorkerRedisVo workerRedisVo = workerRedisCacheUtil.get(worker.getRegion(), worker.getWorkerId());
if (workerRedisVo != null) {
@@ -331,7 +337,7 @@ public class WorkerController {
@ApiOperation(value = "配送员上线")
public Result