From b6fe76cff320c4f267c32e42bab60c7887fc9d80 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 5 Dec 2023 21:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=9C=BA=E7=AB=AF=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/DistributionStockArticleVO.java | 7 +++++++ .../DistributionStockArticleController.java | 16 ++++++++++++++++ .../mapper/DistributionStockArticleMapper.java | 2 +- .../mapper/DistributionStockArticleMapper.xml | 14 +++++++++----- .../DistributionStockArticleServiceImpl.java | 3 +-- 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java index 19ca855a8..a3bc07721 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java @@ -153,6 +153,13 @@ public class DistributionStockArticleVO extends DistributionStockArticleEntity { private List warehouseIdList; + /** + * ids + */ + @ApiModelProperty(value = "ids") + private List clientIds; + + public Map toMap() throws IllegalAccessException { Map map = new HashMap<>(); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java index 9303c4e4a..07c60f664 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java @@ -18,7 +18,9 @@ package com.logpm.distribution.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.basicdata.entity.BasicdataClientUserEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataClientClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.dto.DistributionStockArticleDTO; import com.logpm.distribution.entity.DistributionStockArticleEntity; @@ -40,6 +42,7 @@ import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; @@ -54,6 +57,7 @@ import javax.validation.Valid; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 配送在库订单 控制器 @@ -78,6 +82,9 @@ public class DistributionStockArticleController extends BladeController { // private final IBasicdataWarehouseClient warehouseClient; + private final IBasicdataClientClient basicdataClientClient; + + /** * 配送在库订单 详情 */ @@ -269,6 +276,15 @@ public class DistributionStockArticleController extends BladeController { // .map(BasicdataWarehouseEntity::getId) // .collect(Collectors.toList()); // distributionStockArticle.setWarehouseIdList(collect); + // 得到当前登录用户的Id + List basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId()); + List clientIds =null; + if(Func.isNotEmpty(basicdataClientUserEntityListByUserIds)){ + clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList()); + distributionStockArticle.setClientIds(clientIds); + }else { + return null; + } IPage pages = distributionStockArticleService.selectClientListPage(Condition.getPage(query), distributionStockArticle); return R.data(DistributionStockArticleWrapper.build().pageVO(pages)); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java index 02d418fbb..bf8d02a2f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java @@ -69,7 +69,7 @@ public interface DistributionStockArticleMapper extends BaseMapper selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticleVO,@Param("loginUserId") Long loginUserId); + List selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticleVO); List getAllReservationStockArticleInfo(@Param("ew") Map query); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index 731fe738a..5fc6bb56b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -71,11 +71,7 @@ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 7ee127052..59918aa13 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -554,8 +554,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticle) { // 获取当前登陆人 - BladeUser user = AuthUtil.getUser(); - List result = baseMapper.selectClientListPage(page, distributionStockArticle, user.getUserId()); + List result = baseMapper.selectClientListPage(page, distributionStockArticle); return page.setRecords(result); }