From adac148db7cefc6848933989d407b1827749a5a6 Mon Sep 17 00:00:00 2001 From: huliguo <2023611923@qq.com> Date: 星期一, 07 七月 2025 08:49:49 +0800 Subject: [PATCH] bug修改 --- pt-errand/src/main/java/com/ruoyi/errand/service/impl/AppUserServiceImpl.java | 41 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 36 insertions(+), 5 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..d152a3a 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 @@ -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