diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/MemberBasicInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/MemberBasicInfoController.java index 137513fd5..5460dfb64 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/MemberBasicInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/MemberBasicInfoController.java @@ -108,8 +108,6 @@ public class MemberBasicInfoController extends BaseController { @GetMapping("/getMerchantListByAuth") public RestApiResponse getMerchantListByAuth() { RestApiResponse response = null; - // LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail(); - // logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail)); List list = UserUtils.getMerchantInfoVOList(); if (CollectionUtils.isEmpty(list)) { list = new ArrayList<>(); diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileMerchantInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileMerchantInfoController.java index ca78727d9..cb4b52977 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileMerchantInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileMerchantInfoController.java @@ -6,17 +6,22 @@ import com.jsowell.common.core.domain.AjaxResult; import com.jsowell.common.core.page.TableDataInfo; import com.jsowell.common.enums.BusinessType; import com.jsowell.common.exception.BusinessException; +import com.jsowell.common.response.RestApiResponse; import com.jsowell.common.util.PageUtils; import com.jsowell.common.util.poi.ExcelUtil; import com.jsowell.pile.domain.PileMerchantInfo; import com.jsowell.pile.dto.CreateMerchantDTO; import com.jsowell.pile.dto.QueryMerchantInfoDTO; import com.jsowell.pile.service.PileMerchantInfoService; +import com.jsowell.pile.util.UserUtils; +import com.jsowell.pile.vo.base.MerchantInfoVO; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; /** diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMerchantInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMerchantInfoMapper.java index 6bb938dc8..622ff8a8a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMerchantInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMerchantInfoMapper.java @@ -25,6 +25,13 @@ public interface PileMerchantInfoMapper { */ public PileMerchantInfo selectPileMerchantInfoById(Long id); + /** + * 查询运营商列表 + * @param merchantIdList + * @return + */ + List selectPileMerchantInfoListByIdList(@Param("merchantIdList") List merchantIdList); + /** * 通过appid查询充电桩运营商信息 * @param appId @@ -127,4 +134,5 @@ public interface PileMerchantInfoMapper { * @return */ PileMerchantInfoVO queryMerchantInfoByStationId(String stationId); + } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java index 04a6cbf48..88465ccec 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java @@ -36,6 +36,8 @@ public interface PileMerchantInfoService { List selectPileMerchantInfoList(PileMerchantInfo pileMerchantInfo); + List selectPileMerchantInfoListByIdList(List merchantIdList); + /** * 新增充电桩运营商信息 * @@ -72,11 +74,16 @@ public interface PileMerchantInfoService { /** * 通过微信小程序appId查询一级运营商merchantId - * @param appId 微信小程序appId + * @param wechatAppId 微信小程序appId * @return 一级运营商merchantId */ String getFirstLevelMerchantIdByWxAppId(String wechatAppId); + /** + * 通过支付宝小程序appId查询一级运营商merchantId + * @param alipayAppId 微信小程序appId + * @return 一级运营商merchantId + */ String getFirstLevelMerchantIdByAliAppId(String alipayAppId); MerchantInfoVO getMerchantInfoVO(String merchantId); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java index 887908e56..98fa4ca43 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; /** * 充电桩运营商信息Service业务层处理 @@ -81,7 +82,13 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService { return Lists.newArrayList(); } pileMerchantInfo.setStationDeptIds(authorizedMap.getStationDeptIds()); - pileMerchantInfo.setMerchantDeptIds(authorizedMap.getMerchantDeptIds()); + + // 当前登录用户的运营商权限列表 + List list = UserUtils.getMerchantInfoVOList(); + if (CollectionUtils.isNotEmpty(list)) { + List collect = list.stream().map(MerchantInfoVO::getDeptId).collect(Collectors.toList()); + pileMerchantInfo.setMerchantDeptIds(collect); + } return selectPileMerchantInfoList(pileMerchantInfo); } @@ -104,6 +111,11 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService { return list; } + @Override + public List selectPileMerchantInfoListByIdList(List merchantIdList) { + return pileMerchantInfoMapper.selectPileMerchantInfoListByIdList(merchantIdList); + } + /** * 新增充电桩运营商信息 * diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileMerchantInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileMerchantInfoMapper.xml index 9080204f0..3fa417743 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileMerchantInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileMerchantInfoMapper.xml @@ -100,6 +100,17 @@ where id = #{id} + + + insert into pile_merchant_info @@ -428,4 +439,5 @@ t1.del_flag = '0' AND t1.id = #{stationId,jdbcType=VARCHAR} + \ No newline at end of file