From 431929338a9ef0cefa3435042287fe40529d8ef8 Mon Sep 17 00:00:00 2001 From: "shuo.wang" Date: Fri, 6 Jun 2025 09:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=93=E5=82=A8=E6=89=BE?= =?UTF-8?q?=E5=89=AF=E6=80=BB=E8=A3=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BuildInformationServiceImpl.java | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java index 4a9ca2637..29cfc0a68 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java @@ -4,10 +4,7 @@ package com.cool.store.service.impl; import com.cool.store.constants.CommonConstants; import com.cool.store.dao.*; import com.cool.store.entity.*; -import com.cool.store.enums.ErrorCodeEnum; -import com.cool.store.enums.MessageEnum; -import com.cool.store.enums.OrderSysTypeEnum; -import com.cool.store.enums.UserRoleEnum; +import com.cool.store.enums.*; import com.cool.store.enums.point.ShopSubStageEnum; import com.cool.store.enums.point.ShopSubStageStatusEnum; import com.cool.store.exception.ServiceException; @@ -16,12 +13,14 @@ import com.cool.store.request.BuildInformationRequest; import com.cool.store.response.BuildInformationResponse; import com.cool.store.service.BuildInformationService; import com.cool.store.mapper.BuildInformationMapper; +import com.cool.store.service.EnumInfoService; import com.cool.store.service.PreparationService; import com.cool.store.service.UserAuthMappingService; import com.cool.store.utils.RedisConstantUtil; import com.cool.store.utils.RedisUtilPool; import com.cool.store.utils.poi.StringUtils; import io.lettuce.core.ZAddArgs; +import org.apache.commons.collections4.CollectionUtils; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -30,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * @author EDY @@ -38,7 +38,8 @@ import java.util.stream.Collectors; */ @Service public class BuildInformationServiceImpl implements BuildInformationService { - + @Resource + private EnumInfoService enumInfoService; @Resource private RedisConstantUtil redisConstantUtil; @Resource @@ -116,9 +117,17 @@ public class BuildInformationServiceImpl implements BuildInformationService { response.setDeclareGoodsType(orderSysInfoDO.getDeclareGoodsType()); } if (StringUtils.isBlank(response.getXgjVicePresident())) { - EnterpriseUserDO user = userAuthMappingService.getUserByRoleEnumAndRegionId(UserRoleEnum.VICE_PRESIDENT_IN_CHARGE, shopInfo.getRegionId()); - if (Objects.nonNull(user)) { - response.setXgjVicePresident(user.getName()); + List userList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.VICE_PRESIDENT_IN_CHARGE, shopInfo.getRegionId()); + if (CollectionUtils.isNotEmpty(userList)) { + List xgjVicePresidentList = enumInfoService.getByTypeCode(ZxjpEnum.XGJ_VICE_PRESIDENT.getCode()); + List userNameSet = userList.stream().map(EnterpriseUserDO::getName).collect(Collectors.toList()); + List xgjVicePresidentNameList = xgjVicePresidentList.stream().map(EnumInfoDO::getSysValue).collect(Collectors.toList()); + List resultUserNameList = userNameSet.stream() + .filter(xgjVicePresidentNameList::contains) + .collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(resultUserNameList)){ + response.setXgjVicePresident(resultUserNameList.get(0)); + } } } //根据映射关系默认带出新管家组织