From e4d1ea9d84e6fb32af170cc0ca16d78f3305dd68 Mon Sep 17 00:00:00 2001 From: nyoung <12190070+nyoungo@user.noreply.gitee.com> Date: Tue, 3 Sep 2024 08:50:49 +0800 Subject: [PATCH] 1 --- .../controller/PartnerOwnController.java | 4 ++-- .../mapper/InspectionAppointmentMapper.java | 3 ++- .../service/AppInspectionPartnerService.java | 2 +- .../IInspectionAppointmentService.java | 3 ++- .../impl/AppInspectionPartnerServiceImpl.java | 4 ++-- .../InspectionAppointmentServiceImpl.java | 5 +++-- .../inspection/AppInspectionPartnerMapper.xml | 6 +++--- .../controller/admin/SysLoginController.java | 20 +++++++++++++++++++ 8 files changed, 35 insertions(+), 12 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java index 554f2f16..8549e8ba 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java @@ -396,8 +396,8 @@ public class PartnerOwnController extends BaseController { if (!partnersTmp.getUserId().equals(user.getId())){ return null; } - PageHelper.startPage(pageNum,pageSize); - List appointments = partnerList.getAppointmentList(partnerId,phoneNum); + Page page = new Page<>(pageNum,pageSize); + List appointments = partnerList.getAppointmentList(page,partnerId,phoneNum); return getDataTable(appointments); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionAppointmentMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionAppointmentMapper.java index 375d0b16..d5af610f 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionAppointmentMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionAppointmentMapper.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -63,7 +64,7 @@ public interface InspectionAppointmentMapper extends BaseMapper getAppointmentList(@Param("partnerId") Long partnerId,@Param("phoneNum")String phoneNum); + List getAppointmentList(Page page,@Param("partnerId") Long partnerId, @Param("phoneNum")String phoneNum); List getAppointmentOwn(@Param("userId") Long userId); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java index 074e1952..f67e55aa 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java @@ -64,7 +64,7 @@ public interface AppInspectionPartnerService extends IService void addStepInfo(InspectionStepInfo stepInfo); void stopInspection(InspectionInfo info) throws Exception; void makeCertOk(Long inspectionId); - List getAppointmentList(Long partnerId,String phoneNum); + List getAppointmentList(Page page,Long partnerId,String phoneNum); List validationList(Long partnerId,String searchValue); void sendCoupon(ShopCouponTemplate template) throws Exception; List listCoupon(Long partnerId,String searchValue); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionAppointmentService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionAppointmentService.java index a230820a..3ad5e154 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionAppointmentService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionAppointmentService.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.inspection.service; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment; import cn.iocoder.yudao.module.inspection.entity.InspectionPickCar; @@ -72,6 +73,6 @@ public interface IInspectionAppointmentService extends IService getAppointmentList(Long partnerId,String phoneNum); + public List getAppointmentList(Page page,Long partnerId, String phoneNum); List getAppointmentOwn(); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index e54f5b93..23143b24 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -1214,8 +1214,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl getAppointmentList(Long partnerId,String phoneNum) { - return appointmentService.getAppointmentList(partnerId,phoneNum); + public List getAppointmentList(Page page,Long partnerId,String phoneNum) { + return appointmentService.getAppointmentList(page,partnerId,phoneNum); } @Override diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionAppointmentServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionAppointmentServiceImpl.java index 01a59f19..aa52b592 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionAppointmentServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionAppointmentServiceImpl.java @@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.util.SendSmsUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import cn.iocoder.yudao.util.DateUtils; import cn.iocoder.yudao.util.StringUtils; @@ -346,8 +347,8 @@ public class InspectionAppointmentServiceImpl extends ServiceImpl getAppointmentList(Long partnerId,String phoneNum) { - return baseMapper.getAppointmentList(partnerId,phoneNum); + public List getAppointmentList(Page page,Long partnerId, String phoneNum) { + return baseMapper.getAppointmentList(page,partnerId,phoneNum); } @Override diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml index 95700471..e80204ed 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml @@ -346,7 +346,7 @@ FROM FROM order_info oi INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id - left join sys_dict_data sdd on sdd.dict_value = ii.customer_source and sdd.dict_type = concat('customer_source-',#{partnerId}) + left join system_dict_data sdd on sdd.value = ii.customer_source and sdd.dict_type = concat('customer_source-',#{partnerId}) WHERE oi.partner_id =#{partnerId} and ii.create_time BETWEEN #{startTime} and #{endTime} GROUP BY sdd.remark @@ -359,7 +359,7 @@ FROM FROM order_info oi INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id - left join sys_dict_data sdd on sdd.dict_value = ii.customer_source and sdd.dict_type = concat('customer_source-',#{partnerId}) + left join system_dict_data sdd on sdd.value = ii.customer_source and sdd.dict_type = concat('customer_source-',#{partnerId}) WHERE oi.partner_id =#{partnerId} @@ -392,7 +392,7 @@ FROM FROM order_info oi INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id - inner join system_user su on su.id = oi.user_id + inner join system_users su on su.id = oi.user_id WHERE oi.partner_id ='19' and ii.create_time BETWEEN #{startTime} and #{endTime} and oi.validation_time is null and ii.`status`='1' and ii.is_pass = '1' diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java index 6737a1f1..534eb39e 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java @@ -2,8 +2,10 @@ package cn.iocoder.yudao.module.rescue.app.controller.admin; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.common.CommonErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.security.config.SecurityProperties; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.rescue.core.redis.RedisCache; @@ -39,6 +41,7 @@ import javax.annotation.Resource; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; +import javax.servlet.http.HttpServletRequest; import java.security.spec.AlgorithmParameterSpec; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; @@ -90,6 +93,10 @@ public class SysLoginController { @Resource private RestTemplate restTemplate; + + @Resource + private SecurityProperties securityProperties; + // @Autowired // private IUserBalanceService balanceService; // @Autowired @@ -650,4 +657,17 @@ public class SysLoginController { driverInfoService.syncData(); return CommonResult.ok(); } + + + @PostMapping("/logout") + @Operation(summary = "登出系统") + public CommonResult logout(HttpServletRequest request) { + String token = SecurityFrameworkUtils.obtainAuthorization(request, + securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); + if (StrUtil.isNotBlank(token)) { + loginService.logout(token,1); + } + return success(true); + } + }