From 1c7e22837254781947366d09282d48a45347d0e5 Mon Sep 17 00:00:00 2001
From: huliguo <2023611923@qq.com>
Date: 星期三, 06 八月 2025 10:20:45 +0800
Subject: [PATCH] 发送小程序订单数量
---
pt-errand/src/main/java/com/ruoyi/errand/service/impl/AppUserServiceImpl.java | 45 ++++++++++++++++++++++++++++++++++++++-------
1 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/pt-errand/src/main/java/com/ruoyi/errand/service/impl/AppUserServiceImpl.java b/pt-errand/src/main/java/com/ruoyi/errand/service/impl/AppUserServiceImpl.java
index 9cd135d..d1ee860 100644
--- a/pt-errand/src/main/java/com/ruoyi/errand/service/impl/AppUserServiceImpl.java
+++ b/pt-errand/src/main/java/com/ruoyi/errand/service/impl/AppUserServiceImpl.java
@@ -123,11 +123,11 @@
@Override
public R<LoginVO> mobileLogin(MobileLoginDTO mobileLogin) {
String code = redisService.getCacheObject(mobileLogin.getPhone());
- if(!"999999".equals(mobileLogin.getCode())){
+// if(!"999999".equals(mobileLogin.getCode())){
if(null == code || !code.equals(mobileLogin.getCode())){
throw new ServiceException("验证码错误");
}
- }
+// }
//查看用户是否存在
AppUser appUser = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, mobileLogin.getPhone())
.ne(AppUser::getStatus,AppUserStatusConstant.LOGOUT)
@@ -159,7 +159,13 @@
loginVO.setFailureTime(TimeUnit.MILLISECONDS.toSeconds((long)jwt.get("exp")));
loginVO.setPhone(appUser.getPhone());
loginVO.setSkipPage(1);
- loginVO.setIsCourier(appUser.getCourierId()!=null);
+ loginVO.setIsCourier(false);
+ if (appUser.getCourierId()!=null){
+ Courier courier = courierMapper.selectById(appUser.getCourierId());
+ if (courier!=null && courier.getDelFlag().equals(0) && courier.getStatus().equals(1)){
+ loginVO.setIsCourier(true);
+ }
+ }
return R.ok(loginVO);
}
@@ -207,7 +213,15 @@
loginVO.setFailureTime(TimeUnit.MILLISECONDS.toSeconds((long)jwt.get("exp")));
loginVO.setPhone(appUser.getPhone());
loginVO.setSkipPage(1);
- loginVO.setIsCourier(appUser.getCourierId()!=null);
+ loginVO.setIsCourier(false);
+ if (appUser.getCourierId()!=null){
+ Courier courier = courierMapper.selectById(appUser.getCourierId());
+ if (courier!=null && courier.getDelFlag().equals(0) && courier.getStatus().equals(1)){
+ loginVO.setIsCourier(true);
+ }
+ }
+
+
return R.ok(loginVO);
}
@@ -257,17 +271,28 @@
loginVO.setFailureTime(TimeUnit.MILLISECONDS.toSeconds((long)jwt.get("exp")));
loginVO.setPhone(appUser2.getPhone());
loginVO.setSkipPage(1);
- loginVO.setIsCourier(appUser2.getCourierId()!=null);
+
+ loginVO.setIsCourier(false);
+ if (appUser2.getCourierId()!=null){
+ Courier courier = courierMapper.selectById(appUser2.getCourierId());
+ if (courier!=null && courier.getDelFlag().equals(0) && courier.getStatus().equals(1)){
+ loginVO.setIsCourier(true);
+ }
+ }
return loginVO;
}
@Override
- public OrderPageVO getOrderPage(Integer communityId) {
+ public OrderPageVO getOrderPage(Integer communityId,String regionExtend) {
AppUser appUser = (AppUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
//更换绑定的小区
if (communityId!=null&& !Objects.equals(appUser.getCommunityId(), communityId)){
appUser.setCommunityId(communityId);
+ this.updateById(appUser);
+ }
+ if (regionExtend!=null&& !Objects.equals(appUser.getRegionExtend(), regionExtend)){
+ appUser.setRegionExtend(regionExtend);
this.updateById(appUser);
}
List<OrderPageVO> orderPage = this.getBaseMapper().getOrderPage(appUser.getId());
@@ -304,7 +329,13 @@
public AppUserInfoVO getMyInfo() {
AppUser appUser = (AppUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
AppUserInfoVO myInfo = this.getBaseMapper().getMyInfo(appUser.getId());
-
+ myInfo.setIsCourier(false);
+ if (myInfo.getCourierId()!=null){
+ Courier courier = courierMapper.selectById(myInfo.getCourierId());
+ if (courier!=null && courier.getDelFlag().equals(0) && courier.getStatus().equals(1)){
+ myInfo.setIsCourier(true);
+ }
+ }
myInfo.setEndTimeStamp(myInfo.getEndTime() != null ?
myInfo.getEndTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() :
null);
--
Gitblit v1.7.1