From de9eec46896c4e7ad5786801b0b1418a4a6e02dc Mon Sep 17 00:00:00 2001 From: Vinjor Date: Thu, 17 Oct 2024 15:22:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=AF=AD=E9=9F=B3?= =?UTF-8?q?=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/NotifyMessageSocket.java | 100 ++++++++++++++++++ .../admin/RepairWorkerController.java | 38 +++++++ 2 files changed, 138 insertions(+) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/controller/admin/NotifyMessageSocket.java diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/controller/admin/NotifyMessageSocket.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/controller/admin/NotifyMessageSocket.java new file mode 100644 index 00000000..4acfc31c --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/controller/admin/NotifyMessageSocket.java @@ -0,0 +1,100 @@ +package cn.iocoder.yudao.module.app.controller.admin; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Component; + +import javax.websocket.*; +import javax.websocket.server.PathParam; +import javax.websocket.server.ServerEndpoint; +import java.io.IOException; +import java.util.concurrent.ConcurrentHashMap; + + +/** + * 维修APP消息监听 + * @author vinjor-M + * @date 10:22 2024/10/17 +**/ +@ServerEndpoint(value = "/websocket/message/{tenantId}/{userId}") +@Component +public class NotifyMessageSocket { + private final static Logger log = LoggerFactory.getLogger(NotifyMessageSocket.class); + // 保存链接的session,key为用户名,value为对应的session名 + public static ConcurrentHashMap sessionMap = new ConcurrentHashMap<>(); + //关键代码,设置一个静态上下文属性appcontext + private static ApplicationContext appcontext; + public static void setAppcontext(ApplicationContext appcontext) { + NotifyMessageSocket.appcontext = appcontext; + } + public static ApplicationContext getAppcontext() { + return appcontext; + } + + + /** + * 创建连接 + * 用于监听建立连接,当有客户端与该服务端点建立连接时,将会自回调该注解标注的方法 + * @param session + * @param userId + */ + @OnOpen + public void onOpen(Session session, @PathParam(value = "tenantId") String tenantId,@PathParam(value = "userId") String userId) { + this.sessionMap.put(tenantId+"_"+userId,session); + log.info("{}租户下用户{}已创建连接", tenantId,userId); + } + + + /** + * 用于监听客户端向服务端发送消息,当客户端与服务端发送消息时,将会回调该注解标注的方法 + * { + * Stringitude:124.11, + * latitude:125.33, + * positionInfo:"山东省济南市市中区八一立交桥" + * } + * @param msg + * @param userId + */ + @OnMessage + public void onMessage(String msg,@PathParam(value = "userId") String userId){ + System.out.println("消息通知+"+userId); + } + + + /** + * 用于监听连接关闭,当客户端与该服务端点断开连接时,将会回调该注解标注的方法 + * @param session + * @param userId + */ + @OnClose + public void onClose(Session session,@PathParam(value = "tenantId") String tenantId,@PathParam(value = "userId") String userId){ + this.sessionMap.remove(tenantId+"_"+userId); + } + + + /** + * 用于监听该连接上的任何错误,当客户端与该服务端点的连接发生任何异常,都将回调该注解标注的方法 + * 注意该方法的参数必选Throwable,可选Sessiion以及0-n个String参数,且String参数需要使用@PathParam注解标注 + * @param throwable + * @param tenantId 租户id + * @param userId 用户id + */ + @OnError + public void onError(Throwable throwable,@PathParam(value = "tenantId") String tenantId,@PathParam(value = "userId") String userId){ + log.error("{}租户下用户{}已创建连接", tenantId,userId); + } + + /** + * 发送给指定的用户 + * @param message + */ + public void sendMessage(String message, String tenantId,String userId) throws IOException { + if (sessionMap.containsKey(tenantId+"_"+userId)){ + Session session = sessionMap.get(tenantId+"_"+userId); + session.getAsyncRemote().sendText(message); + } + } + + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java index d4dfc183..b6516a80 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java @@ -1,7 +1,10 @@ package cn.iocoder.yudao.module.base.controller.admin; +import cn.iocoder.yudao.common.MessageSend; +import cn.iocoder.yudao.common.dto.MessageDTO; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.app.controller.admin.NotifyMessageSocket; import cn.iocoder.yudao.module.base.entity.RepairWorker; import cn.iocoder.yudao.module.base.service.RepairWorkerService; import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO; @@ -13,12 +16,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.io.IOException; +import java.util.ArrayList; import java.util.List; +import static cn.iocoder.yudao.common.BaseConstants.QUALS_INTERIM_PERIOD; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.ok; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - 维修工人") @@ -29,6 +37,10 @@ public class RepairWorkerController { @Resource private RepairWorkerService workerService; + @Autowired + private NotifyMessageSocket notifyMessageSocket; + @Autowired + private MessageSend messageSend; /** @@ -124,4 +136,30 @@ public class RepairWorkerController { } + /** + * 测试给维修工发送消息---测试 + * @author vinjor-M + * @date 18:08 2024/10/16 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @GetMapping("/sendMessage") + @Operation(summary = "测试给维修工发送消息") + public CommonResult sendMessage(Long userId) { + try { + MessageDTO messageDTO = new MessageDTO(); + List userIds = new ArrayList<>(); + userIds.add(userId); + messageDTO.setUserIds(userIds); + messageDTO.setTemplateCode(QUALS_INTERIM_PERIOD); + List paramList = new ArrayList<>(); + paramList.add("测试"); + paramList.add("3"); + messageDTO.setParamList(paramList); + messageSend.send(messageDTO); + notifyMessageSocket.sendMessage("11","180",userId.toString()); + } catch (IOException e) { + e.printStackTrace(); + } + return ok(); + } } \ No newline at end of file From d3783b1de9d92dbcdb9ff13aef1dd8dc750e60d4 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Thu, 17 Oct 2024 16:18:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=B4=E4=BF=AE?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/DlRepairTicketsService.java | 2 +- .../impl/DlRepairTicketsServiceImpl.java | 80 +++++++++---------- .../impl/DlTicketWaresServiceImpl.java | 43 +++++----- 3 files changed, 63 insertions(+), 62 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java index 58fc85d7..e835c805 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java @@ -97,7 +97,7 @@ public interface DlRepairTicketsService extends IService { * @author 小李 * @date 9:28 2024/10/14 **/ - Integer getUserRole(); + String getUserRole(); /** * 接单 diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 00e45845..280272a0 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.tickets.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; -import cn.iocoder.yudao.common.RepairConstants; import cn.iocoder.yudao.common.RepairErrorCodeConstants; +import cn.iocoder.yudao.common.RepairRoleEnum; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.base.entity.RepairWorker; import cn.iocoder.yudao.module.base.service.RepairWorkerService; @@ -51,21 +51,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.deepoove.poi.XWPFTemplate; import org.springframework.context.annotation.Lazy; -import org.springframework.security.core.Authentication; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import javax.print.Doc; import javax.servlet.http.HttpServletResponse; import java.io.FileOutputStream; import java.io.InputStream; import java.math.BigDecimal; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; import static cn.iocoder.yudao.common.BaseConstants.ORDER_TENANT_NAME; @@ -138,6 +131,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl getPageType(DlRepairTicketsReqVO repairTicketsReqVO, Page page){ - Integer userRole = getUserRole(); - switch (userRole){ - case 1: - break; - case 2: - repairTicketsReqVO.setAdviserId(String.valueOf(SecurityFrameworkUtils.getLoginUserId())); - break; - case 3: - // 查自己是什么班组的组长 + String userRoleCode = getUserRole(); + if(userRoleCode.equals(RepairRoleEnum.ADMIN.getCode())|| userRoleCode.equals(RepairRoleEnum.INSPECTION.getCode())){ + //维修管理员和总检,看所有数据 + }else if(userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())){ + //服务顾问看自己的 + repairTicketsReqVO.setAdviserId(String.valueOf(SecurityFrameworkUtils.getLoginUserId())); + }else if(userRoleCode.equals(RepairRoleEnum.REPAIR_STAFF.getCode())){ + //维修工,进一步判断是否是班组长 + boolean ifLeader = workerService.getIfLeader(); + if(ifLeader){ + //班组长,看本班组所有数据 RepairWorker one = repairWorkerService.getOne(new LambdaQueryWrapper().eq(RepairWorker::getUserId, SecurityFrameworkUtils.getLoginUserId())); // 查自己班组的员工信息 List list = repairWorkerService.list(new LambdaQueryWrapper().eq(RepairWorker::getWorkType, one.getWorkType())); // 所有的员工信息 List userIds = list.stream().map(RepairWorker::getUserId).collect(Collectors.toList()); repairTicketsReqVO.setUserIds(userIds); - break; - case 4: + }else{ + //普通维修工 repairTicketsReqVO.setUserIds(Collections.singletonList(SecurityFrameworkUtils.getLoginUserId())); - break; - case -1: - default: - return null; + } + }else{ + return null; } return baseMapper.getPageType(repairTicketsReqVO, page); } @@ -426,7 +422,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl byUserId = permissionApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId()); @@ -435,29 +431,33 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl collect = roleList.stream().filter(item -> byUserId.contains(item.getId())).collect(Collectors.toList()); // 取出角色名称 - List names = collect.stream().map(RoleReqDTO::getName).collect(Collectors.toList()); + List codes = collect.stream().map(RoleReqDTO::getCode).collect(Collectors.toList()); + // 维修业务管理员--可以看所有数据,但不能做操作 + if (codes.contains(RepairRoleEnum.ADMIN.getCode())){ + return RepairRoleEnum.ADMIN.getCode(); + } // 总检 - if (names.contains(RepairConstants.GENERAL_INSPECTION)){ - return 1; + if (codes.contains(RepairRoleEnum.INSPECTION.getCode())){ + return RepairRoleEnum.INSPECTION.getCode(); } // 服务顾问 - if (names.contains(RepairConstants.SERVICE_ADVISOR)){ - return 2; + if (codes.contains(RepairRoleEnum.ADVISOR.getName())){ + return RepairRoleEnum.ADVISOR.getName(); } - // 班组长 - if (names.contains(RepairConstants.TEAM_LEADER)){ - return 3; - } - // 维修工 - if (names.contains(RepairConstants.REPAIR_STAFF)){ - return 4; + // 维修工(或班组长) + if (codes.contains(RepairRoleEnum.REPAIR_STAFF.getCode())){ + return RepairRoleEnum.REPAIR_STAFF.getCode(); } // 维修仓库管理员 - if(names.contains(RepairConstants.REPAIR_WAREHOUSE)){ - return 5; + if(codes.contains(RepairRoleEnum.WAREHOUSE.getCode())){ + return RepairRoleEnum.WAREHOUSE.getCode(); + } + // 维修财务 + if(codes.contains(RepairRoleEnum.WXCW.getCode())){ + return RepairRoleEnum.WXCW.getCode(); } // 啥也不是 - return -1; + return null; } /** diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java index 50c14dab..fb818e61 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.tickets.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.common.RepairRoleEnum; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.base.entity.RepairWorker; import cn.iocoder.yudao.module.base.service.RepairWorkerService; @@ -75,6 +76,8 @@ public class DlTicketWaresServiceImpl extends ServiceImpl getPage(DlTicketWaresReqVO reqVO, Page page){ // 确认查看者身份 - Integer userRole = repairTicketsService.getUserRole(); - // 啥也不是 - if (userRole == -1){ - return null; - } - switch (userRole){ - // 服务顾问 - case 2: - reqVO.setAdviserId(SecurityFrameworkUtils.getLoginUserId()); - break; - // 班组长 - case 3: - // 查自己是什么班组的组长 + String userRoleCode = repairTicketsService.getUserRole(); + if(userRoleCode.equals(RepairRoleEnum.ADMIN.getCode())|| userRoleCode.equals(RepairRoleEnum.INSPECTION.getCode())){ + //维修管理员和总检,看所有数据 + }else if(userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())){ + //服务顾问 + reqVO.setAdviserId(SecurityFrameworkUtils.getLoginUserId()); + }else if(userRoleCode.equals(RepairRoleEnum.REPAIR_STAFF.getCode())){ + //维修工,进一步判断是否是班组长 + boolean ifLeader = workerService.getIfLeader(); + if(ifLeader){ + //班组长,看本班组所有数据 RepairWorker one = repairWorkerService.getOne(new LambdaQueryWrapper().eq(RepairWorker::getUserId, SecurityFrameworkUtils.getLoginUserId())); // 查自己班组的员工信息 List list = repairWorkerService.list(new LambdaQueryWrapper().eq(RepairWorker::getWorkType, one.getWorkType())); // 所有的员工信息 List userIds = list.stream().map(RepairWorker::getUserId).collect(Collectors.toList()); reqVO.setUserIds(userIds); - break; - // 维修工 - case 4: + }else{ + //普通维修工 reqVO.setUserIds(Collections.singletonList(SecurityFrameworkUtils.getLoginUserId())); - break; + } + }else if(userRoleCode.equals(RepairRoleEnum.WAREHOUSE.getCode())){ // 维修仓库管理员 - case 5: - reqVO.setStatus(null); - reqVO.setUserRole(5); - break; + reqVO.setStatus(null); + reqVO.setUserRole(5); + }else{ + return null; } return baseMapper.getPage(reqVO, page); } From d7c1ac245d09e5b418e13d330ca540439f743155 Mon Sep 17 00:00:00 2001 From: lzttt <1803073139@qq.com> Date: Thu, 17 Oct 2024 17:18:17 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AF=86=E5=88=AB=E4=BB=A3=E5=8A=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionMallPartnersController.java | 6 ++++++ .../partner/controller/PartnerCustomerInfoController.java | 8 +------- .../yudao/module/partner/entity/PartnerCustomerInfo.java | 3 +++ .../module/partner/mapper/PartnerCustomerInfoMapper.java | 4 ++-- .../partner/service/IPartnerCustomerInfoService.java | 5 +++-- .../service/impl/PartnerCustomerInfoServiceImpl.java | 6 ++++++ .../yudao/module/payment/service/OrderInfoService.java | 4 ++++ .../module/payment/service/impl/OrderInfoServiceImpl.java | 1 + .../mapper/partner/PartnerCustomerInfoMapper.xml | 8 +++++++- 9 files changed, 33 insertions(+), 12 deletions(-) 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 d7aeea84..cecc8251 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 @@ -13,6 +13,8 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.core.text.Convert; import cn.iocoder.yudao.module.core.text.ServletUtils; import cn.iocoder.yudao.module.label.vo.LabelRespVO; +import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo; +import cn.iocoder.yudao.module.partner.service.IPartnerCustomerInfoService; import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService; import cn.iocoder.yudao.module.payment.service.OrderInfoService; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; @@ -57,6 +59,8 @@ public class InspectionMallPartnersController extends BaseController { private PermissionService permissionService; @Autowired private RoleService roleService; + @Autowired + private IPartnerCustomerInfoService partnerCustomerInfoService; /** * 查询合作商管理列表 @@ -128,6 +132,8 @@ public class InspectionMallPartnersController extends BaseController { return CommonResult.success(list); } + + @GetMapping("/delWorkOrder") public CommonResult> delWorkOrder(String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime,Integer pageSize,Integer pageNum) { diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/controller/PartnerCustomerInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/controller/PartnerCustomerInfoController.java index 330004e1..571e076d 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/controller/PartnerCustomerInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/controller/PartnerCustomerInfoController.java @@ -2,14 +2,9 @@ package cn.iocoder.yudao.module.partner.controller; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.core.controller.BaseController; -import cn.iocoder.yudao.module.core.page.TableDataInfo; -import cn.iocoder.yudao.module.core.text.Convert; -import cn.iocoder.yudao.module.core.text.ServletUtils; import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; -import cn.iocoder.yudao.module.label.vo.LabelRespVO; import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo; import cn.iocoder.yudao.module.partner.service.IPartnerCustomerInfoService; -import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; import cn.iocoder.yudao.util.ExcelUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -18,8 +13,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; - /** * 客户信息Controller * @@ -51,6 +44,7 @@ public class PartnerCustomerInfoController extends BaseController // return getDataTable(list); } + /** * 导出客户信息列表 */ diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/entity/PartnerCustomerInfo.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/entity/PartnerCustomerInfo.java index 2af569bf..a266d71f 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/entity/PartnerCustomerInfo.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/entity/PartnerCustomerInfo.java @@ -43,6 +43,7 @@ public class PartnerCustomerInfo extends TenantBaseDO @Excel(name = "性别") private String sex; + /** 年龄 */ @Excel(name = "年龄") private Integer userAge; @@ -57,5 +58,7 @@ public class PartnerCustomerInfo extends TenantBaseDO private String roleCode; @TableField(exist = false) private String roleName; + @TableField(exist = false) + private int orderCount; } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/mapper/PartnerCustomerInfoMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/mapper/PartnerCustomerInfoMapper.java index f4f94db2..ea401145 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/mapper/PartnerCustomerInfoMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/mapper/PartnerCustomerInfoMapper.java @@ -1,8 +1,6 @@ package cn.iocoder.yudao.module.partner.mapper; -import cn.iocoder.yudao.module.label.vo.LabelPageReqVO; -import cn.iocoder.yudao.module.label.vo.LabelRespVO; import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -56,4 +54,6 @@ public interface PartnerCustomerInfoMapper extends BaseMapper { **/ IPage queryListPage(OrderInfo orderInfo, Page page); + + + Long createOrder(OrderInfo orderInfo) throws Exception; JSONObject pickCarDetail(Long pickCarId); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/impl/OrderInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/impl/OrderInfoServiceImpl.java index c6c9208d..bb9278b2 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/impl/OrderInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/payment/service/impl/OrderInfoServiceImpl.java @@ -181,6 +181,7 @@ public class OrderInfoServiceImpl extends ServiceImpl select pci.*, sr.name as roleName, - sr.code as roleCode + sr.code as roleCode, + COUNT(ins.id) AS orderCount from partner_customer_info pci left join shop_user_car suc on suc.user_id = pci.user_id left join system_users su on su.id = pci.user_id left join system_user_role sur on sur.user_id = su.id left join system_role sr on sr.id = sur.role_id + LEFT JOIN inspection_info ins ON ins.user_id = pci.user_id AND YEAR(ins.create_time) =YEAR(NOW()) and suc.car_no like concat('%', #{vo.carNum}, '%') and pci.customer_name like concat('%', #{vo.customerName}, '%') @@ -126,4 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + + +