Bladeren bron

产品经理和采购员

tjxt 3 maanden geleden
bovenliggende
commit
c8b56272bb

+ 12 - 0
ruoyi-api/ruoyi-api-customer/src/main/java/org/dromara/customer/api/RemoteSupplierProcurementService.java

@@ -0,0 +1,12 @@
+package org.dromara.customer.api;
+
+import java.util.Set;
+
+/**
+ * author
+ * 时间:2026/1/14,19:21
+ */
+public interface RemoteSupplierProcurementService {
+
+    Set<Long> selectSupplierProcurementIds(Long id);
+}

+ 4 - 3
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/dubbo/RemoteSupplierProcurementServiceImpl.java

@@ -2,6 +2,7 @@ package org.dromara.customer.dubbo;
 
 import lombok.RequiredArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboService;
+import org.dromara.customer.api.RemoteSupplierProcurementService;
 import org.dromara.customer.service.ISupplierProcurementService;
 import org.springframework.stereotype.Service;
 
@@ -14,12 +15,12 @@ import java.util.Set;
 @RequiredArgsConstructor
 @Service
 @DubboService
-public class RemoteSupplierProcurementServiceImpl  {
+public class RemoteSupplierProcurementServiceImpl  implements RemoteSupplierProcurementService {
 
     private final ISupplierProcurementService supplierProcurementService;
 
-
-    public Set<Long> selectSupplierIds(Long id){
+    @Override
+    public Set<Long> selectSupplierProcurementIds(Long id){
         Set<Long> supplierIds =supplierProcurementService.selectSupplierId(id);
 
         return supplierIds;

+ 7 - 5
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/ComStaffController.java

@@ -10,6 +10,8 @@ import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.constraints.*;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 //import org.dromara.customer.api.RemoteSupplierProcurementService;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.dromara.customer.api.RemoteSupplierProcurementService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.web.bind.annotation.*;
@@ -46,8 +48,8 @@ public class ComStaffController extends BaseController {
 
     private final IComStaffService comStaffService;
 
-
-    //private final RemoteSupplierProcurementService remoteSupplierProcurementService;
+    @DubboReference
+    private final RemoteSupplierProcurementService remoteSupplierProcurementService;
 
     /**
      * 查询人员信息列表
@@ -64,15 +66,15 @@ public class ComStaffController extends BaseController {
      */
     @GetMapping("/informationById")
     public R<List<ComStaffVo>> informationById(@RequestParam Long supplierId) {
-            //Set<Long> staffIds = remoteSupplierProcurementService.selectSupplierIds(supplierId);
-        Set<Long> ids= null;
-            List<ComStaff> list = comStaffService.lambdaQuery().in(ComStaff::getStaffId, ids).list();
+            Set<Long> staffIds = remoteSupplierProcurementService.selectSupplierProcurementIds(supplierId);
+            List<ComStaff> list = comStaffService.lambdaQuery().in(ComStaff::getStaffId, staffIds).list();
 
             // 使用Stream流只返回staffCode和staffName字段的VO对象
             List<ComStaffVo> voList = list.stream().map(staff -> {
                 ComStaffVo vo = new ComStaffVo();
                 vo.setStaffCode(staff.getStaffCode());
                 vo.setStaffName(staff.getStaffName());
+                vo.setStaffId(staff.getStaffId());
                 return vo;
             }).collect(Collectors.toList());
             return R.ok(voList);