|
|
@@ -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);
|