|
|
@@ -1,12 +1,17 @@
|
|
|
package org.dromara.system.controller.system;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.constraints.*;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
-import org.dromara.system.domain.bo.ComPostBo;
|
|
|
+//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.*;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
|
@@ -22,6 +27,7 @@ import org.dromara.system.domain.vo.ComStaffVo;
|
|
|
import org.dromara.system.domain.bo.ComStaffBo;
|
|
|
import org.dromara.system.service.IComStaffService;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
+import org.dromara.system.domain.ComStaff;
|
|
|
|
|
|
/**
|
|
|
* 人员信息
|
|
|
@@ -34,10 +40,15 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
@RequiredArgsConstructor
|
|
|
@RestController
|
|
|
@RequestMapping("/comStaff")
|
|
|
+@Slf4j
|
|
|
+@RefreshScope
|
|
|
public class ComStaffController extends BaseController {
|
|
|
|
|
|
private final IComStaffService comStaffService;
|
|
|
|
|
|
+
|
|
|
+ //private final RemoteSupplierProcurementService remoteSupplierProcurementService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询人员信息列表
|
|
|
*/
|
|
|
@@ -46,6 +57,28 @@ public class ComStaffController extends BaseController {
|
|
|
return comStaffService.queryPageList(bo, pageQuery);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据供应商ID查询客户经理和采购员
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @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();
|
|
|
+
|
|
|
+ // 使用Stream流只返回staffCode和staffName字段的VO对象
|
|
|
+ List<ComStaffVo> voList = list.stream().map(staff -> {
|
|
|
+ ComStaffVo vo = new ComStaffVo();
|
|
|
+ vo.setStaffCode(staff.getStaffCode());
|
|
|
+ vo.setStaffName(staff.getStaffName());
|
|
|
+ return vo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return R.ok(voList);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 导出人员信息列表
|
|
|
*/
|