From 6a75c68a5dd596cfd9d977a98405ae91bb124fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Mon, 18 Nov 2024 17:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AppSwiperController.java | 2 +- .../InspectionEquInfoController.java | 5 +++++ .../controller/InspectionInfoController.java | 4 ++++ .../InspectionMallPartnersController.java | 2 +- .../inspection/entity/InspectionInfo.java | 2 ++ .../service/IInspectionInfoService.java | 7 +++++++ .../impl/AppInspectionPartnerServiceImpl.java | 3 +++ .../impl/InspectionInfoServiceImpl.java | 11 ++++++++++ .../impl/InspectionWorkNodeServiceImpl.java | 2 +- .../inspection/vo/InspectionInfoVo.java | 2 ++ .../inspection/InspectionInfoMapper.xml | 21 ++++++++++++------- .../main/resources/mapper/UserRoleMapper.xml | 6 +++--- 12 files changed, 53 insertions(+), 14 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/AppSwiperController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/AppSwiperController.java index c4c0152f..61b29578 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/AppSwiperController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/appBase/controller/AppSwiperController.java @@ -141,7 +141,7 @@ public class AppSwiperController extends BaseController { LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); LoginUser user = SecurityFrameworkUtils.getLoginUser(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); ShopMallPartners partner = partnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return error("信息有误"); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionEquInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionEquInfoController.java index 39bfe0fc..3c428f50 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionEquInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionEquInfoController.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.inspection.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; @@ -43,6 +44,10 @@ public class InspectionEquInfoController extends BaseController public CommonResult list(Integer pageNum,Integer pageSize,InspectionEquInfo inspectionEquInfo) throws Exception { Page page =new Page(pageNum,pageSize); + if (ObjectUtil.isNull(inspectionEquInfo.getPartnerId())) { + ShopMallPartners partners = partnerService.shopInfoByUserId(); + inspectionEquInfo.setPartnerId(partners.getPartnerId()); + } IPage list = inspectionEquInfoService.selectInspectionEquInfoList(page,inspectionEquInfo); return success(list); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java index b275071d..a42fb464 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java @@ -92,6 +92,10 @@ public class InspectionInfoController extends BaseController { public CommonResult edit(@RequestBody InspectionInfo inspectionInfo) throws Exception { return toAjax(inspectionInfoService.updateInspectionInfo(inspectionInfo)); } + @PostMapping("/updateLeadMan") + public CommonResult updateLeadMan(@RequestBody InspectionInfo inspectionInfo){ + return toAjax(inspectionInfoService.updateLeadMan(inspectionInfo)); + } @PostMapping("/del") diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java index bb16d0e2..67e6885a 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java @@ -183,7 +183,7 @@ public class InspectionMallPartnersController extends BaseController { ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return; diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionInfo.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionInfo.java index a7778deb..12c1ddf9 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionInfo.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionInfo.java @@ -163,4 +163,6 @@ public class InspectionInfo extends TenantBaseDO private String selectType; @TableField(exist = false) private String projectName; + @TableField(exist = false) + private String leadManName; } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java index ef2fb65e..948ad93e 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionInfoService.java @@ -49,6 +49,13 @@ public interface IInspectionInfoService extends IService * @return 结果 */ public int updateInspectionInfo(InspectionInfo inspectionInfo) throws Exception; + /** + * 修改引车员 + * + * @param inspectionInfo 【请填写功能名称】 + * @return 结果 + */ + public int updateLeadMan(InspectionInfo inspectionInfo); /** * 批量删除【请填写功能名称】 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 69bb9f37..07dc376f 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 @@ -184,6 +184,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl queryWrapperWork =new LambdaQueryWrapper<>(); queryWrapperWork.eq(PartnerWorker::getUserId,user.getId()); + queryWrapperWork.orderByAsc(PartnerWorker::getPartnerId); + queryWrapperWork.last("limit 1"); PartnerWorker worker = partnerWorkerService.getOne(queryWrapperWork); if (ObjectUtil.isEmpty(worker)){ throw new Exception("信息有误"); @@ -1467,6 +1469,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl workNodes; + @TableField(exist = false) + private Long leadManId; } diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml index 44c4c981..ac6ee032 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml @@ -275,7 +275,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" iwn.status AS workNodeStatus, oi.order_no AS orderNo, oi.phonenumber AS buyPhone, - ip.project_name AS projectName + ip.project_name AS projectName, + su.nickname AS leadManName FROM inspection_info ii LEFT JOIN @@ -284,36 +285,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order_info oi ON ii.inspection_order_id = oi.id LEFT JOIN inspection_project ip ON iwn.project_id = ip.id + LEFT JOIN + system_users su ON ii.lead_man_id = su.id - - (ii.lead_man_id = #{inspectionInfo.leadManId} - OR iwn.role_id IN - - #{roleId} - ) AND ii.car_num LIKE CONCAT('%', #{inspectionInfo.carNum}, '%') + AND + (ii.lead_man_id = #{inspectionInfo.leadManId} + OR iwn.role_id IN + + #{roleId} + ) AND ii.status = '0' AND iwn.status = '0' -- AND ii.now_order_num = iwn.order_num + ORDER BY ii.create_time DESC AND ii.status = '0' AND iwn.status = '1' AND iwn.deal_user_id = #{inspectionInfo.dealUserId} + ORDER BY iwn.update_time DESC AND iwn.status = '2' AND iwn.deal_user_id = #{inspectionInfo.dealUserId} + ORDER BY iwn.update_time DESC - ORDER BY ii.create_time DESC diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/UserRoleMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/UserRoleMapper.xml index 7525388f..7e1c4ae1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/UserRoleMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/UserRoleMapper.xml @@ -21,9 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"