Merge branch 'dev_local' into dev

# Conflicts:
#	jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java
#	jsowell-pile/src/main/java/com/jsowell/pile/service/IPileStationInfoService.java
#	jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java
#	jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml
This commit is contained in:
2023-11-21 11:31:42 +08:00
39 changed files with 578 additions and 148 deletions

View File

@@ -4,7 +4,6 @@ import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.dto.PlatformTesterDTO;
import com.jsowell.pile.dto.QueryMemberInfoDTO;
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.uniapp.MemberBalanceVO;
import com.jsowell.pile.vo.uniapp.MemberVO;
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
@@ -147,10 +146,4 @@ public interface IMemberBasicInfoService {
* @return
*/
List<MemberBalanceVO> getMemberRefundAmount(List<String> memberIds);
/**
* 获取当前会员中的运营商列表(带权限校验)
*/
List<MerchantInfoVO> getMerchantListByAuth(List<String> deptIds);
}

View File

@@ -76,7 +76,7 @@ public interface IPileMerchantInfoService {
*/
String getFirstLevelMerchantIdByAppId(String appId);
MerchantInfoVO getMerchantInfo(String merchantId);
MerchantInfoVO getMerchantInfoVO(String merchantId);
/**
* 根据运营商部门ids 查询所有站点id
@@ -87,6 +87,8 @@ public interface IPileMerchantInfoService {
PileMerchantInfo queryInfoByDeptId(String deptId);
MerchantInfoVO queryMerchantInfoVOByDeptId(String deptId);
/**
* 通过ids查询信息列表
* @param dto
@@ -122,4 +124,10 @@ public interface IPileMerchantInfoService {
* 通过merchantId获取一级运营商id
*/
String getFirstLevelMerchantIdByMerchantId(String merchantId);
// 查询全部生效的运营商
List<MerchantInfoVO> selectAll();
// 查询一级运营商下属的二级运营商
List<MerchantInfoVO> selectListByFirstMerchant(String firstMerchantId);
}

View File

@@ -12,7 +12,6 @@ import com.jsowell.pile.vo.ningxiajiaotou.NXJTStationInfoVO;
import com.jsowell.pile.vo.web.PileStationVO;
import java.util.List;
import java.util.Map;
/**
* 充电站信息Service接口
@@ -131,4 +130,7 @@ public interface IPileStationInfoService {
* @return
*/
List<NXJTStationInfoVO> NXJTQueryStationsInfo(NXJTQueryStationInfoDTO dto);
PileStationInfo queryInfoByDeptId(String valueOf);
}

View File

@@ -11,7 +11,7 @@ public interface MemberWalletInfoService {
MemberWalletInfo selectByPrimaryKey(Integer id);
MemberWalletInfo selectByMemberId(String memberId);
MemberWalletInfo selectByMemberId(String memberId, String merchantId);
int updateByPrimaryKeySelective(MemberWalletInfo record);

View File

@@ -2,27 +2,27 @@ package com.jsowell.pile.service.impl;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.enums.MemberWalletEnum;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.*;
import com.jsowell.common.util.id.IdUtils;
import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.domain.MemberPlateNumberRelation;
import com.jsowell.pile.domain.MemberWalletInfo;
import com.jsowell.pile.domain.MemberWalletLog;
import com.jsowell.pile.dto.PlatformTesterDTO;
import com.jsowell.pile.dto.QueryMemberInfoDTO;
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
import com.jsowell.pile.mapper.MemberBasicInfoMapper;
import com.jsowell.pile.mapper.MemberPlateNumberRelationMapper;
import com.jsowell.pile.mapper.MemberWalletInfoMapper;
import com.jsowell.pile.mapper.MemberWalletLogMapper;
import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IMemberTransactionRecordService;
import com.jsowell.pile.service.IPileBasicInfoService;
import com.jsowell.pile.service.IPileMerchantInfoService;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.service.*;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.LoginUserDetailVO;
import com.jsowell.pile.vo.uniapp.MemberBalanceVO;
import com.jsowell.pile.vo.uniapp.MemberVO;
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
@@ -33,11 +33,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
* 会员基础信息Service业务层处理
@@ -51,8 +51,11 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
@Autowired
private MemberBasicInfoMapper memberBasicInfoMapper;
// @Autowired
// private MemberWalletInfoMapper memberWalletInfoMapper;
@Autowired
private MemberWalletInfoMapper memberWalletInfoMapper;
private MemberWalletInfoService memberWalletInfoService;
@Autowired
private MemberWalletLogMapper memberWalletLogMapper;
@@ -72,6 +75,9 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
@Autowired
private IMemberTransactionRecordService memberTransactionRecordService;
@Autowired
private IPileStationInfoService pileStationInfoService;
/**
* 查询会员基础信息
*
@@ -177,10 +183,19 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
BigDecimal updatePrincipalBalance = dto.getUpdatePrincipalBalance();
log.info("修改用户余额 memberId:{}, updatePrincipalBalance:{}, updateGiftBalance:{}", memberId, updatePrincipalBalance, updateGiftBalance);
// 查询用户余额
MemberWalletInfo info = memberWalletInfoMapper.selectByMemberId(memberId);
if (info == null) {
log.warn("根据会员id:{}, 查询会员信息为空", memberId);
return 0;
MemberWalletInfo walletInfo = memberWalletInfoService.selectByMemberId(memberId, dto.getTargetMerchantId());
if (walletInfo == null) {
log.warn("根据会员id:{}, 目标运营商id:{}, 查询会员信息为空, 新建会员钱包", memberId, dto.getTargetMerchantId());
// 如果查询到钱包为空,就新建一个该运营商的钱包
walletInfo = MemberWalletInfo.builder()
.walletCode(IdUtils.get16UUID())
.memberId(memberId)
.merchantId(dto.getTargetMerchantId())
.giftBalance(BigDecimal.ZERO)
.principalBalance(BigDecimal.ZERO)
.version(0)
.build();
memberWalletInfoService.insertSelective(walletInfo);
}
// 记录流水
@@ -196,9 +211,9 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
updatePrincipalBalance = updatePrincipalBalance.negate();
}
// 会员老的余额
BigDecimal oldPrincipalBalance = info.getPrincipalBalance() == null
BigDecimal oldPrincipalBalance = walletInfo.getPrincipalBalance() == null
? BigDecimal.ZERO
: info.getPrincipalBalance();
: walletInfo.getPrincipalBalance();
newPrincipalBalance = oldPrincipalBalance.add(updatePrincipalBalance);
if (newPrincipalBalance.compareTo(BigDecimal.ZERO) < 0) {
log.warn("变更后本金余额不能为负数");
@@ -224,9 +239,9 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
// 扣款 转为负数
updateGiftBalance = updateGiftBalance.negate();
}
BigDecimal oldGiftBalance = info.getGiftBalance() == null
BigDecimal oldGiftBalance = walletInfo.getGiftBalance() == null
? BigDecimal.ZERO
: info.getGiftBalance();
: walletInfo.getGiftBalance();
newGiftBalance = oldGiftBalance.add(updateGiftBalance);
// 余额不能为负数
if (newGiftBalance.compareTo(BigDecimal.ZERO) < 0) {
@@ -250,7 +265,7 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
// 修改数据库
int i = 0;
if (newPrincipalBalance != null || newGiftBalance != null) {
i = memberBasicInfoMapper.updateMemberBalance(memberId, newPrincipalBalance, newGiftBalance, info.getVersion());
i = memberBasicInfoMapper.updateMemberBalance(memberId, newPrincipalBalance, newGiftBalance, walletInfo.getVersion());
if (i == 0) {
log.warn("修改余额失败, memberId:{}", memberId);
}
@@ -262,6 +277,16 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
return i;
}
public static void main(String[] args) {
Set<String> set = Sets.newHashSet();
for (int i = 0; i < 10000000; i++) {
String s = IdUtils.get16UUID();
System.out.println(s);
set.add(s);
}
System.out.println("set size:" + set.size());
}
@Override
public MemberVO queryMemberInfoByMemberId(String memberId) {
if (StringUtils.isBlank(memberId)) {
@@ -318,34 +343,33 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
*/
@Override
public List<MemberVO> selectMemberList(QueryMemberInfoDTO dto) {
StopWatch sw = new StopWatch("查询会员列表");
sw.start("获取登录账号信息");
// 获取登录账号信息
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
if (authorizedMap == null) {
return new ArrayList<>();
}
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
dto.setMerchantDeptIds(merchantDeptIds);
}
sw.stop();
// AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
// AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
// if (authorizedMap == null) {
// return new ArrayList<>();
// }
// List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
// if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
// dto.setMerchantDeptIds(merchantDeptIds);
// }
sw.start("获取一级运营商信息");
PileMerchantInfo pileMerchantInfo = pileMerchantInfoService.queryInfoByDeptId(authorizedMap.getDeptId());
if (pileMerchantInfo != null) {
String id = pileMerchantInfoService.getFirstLevelMerchantIdByMerchantId(pileMerchantInfo.getId() + "");
dto.setMerchantId(id);
}
sw.stop();
// PileMerchantInfo pileMerchantInfo = pileMerchantInfoService.queryInfoByDeptId(authorizedMap.getDeptId());
// if (pileMerchantInfo != null) {
// String id = pileMerchantInfoService.getFirstLevelMerchantIdByMerchantId(pileMerchantInfo.getId() + "");
// dto.setMerchantId(id);
// }
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
List<String> firstMerchantIdList = loginUserDetail.getFirstMerchantIdList();
if (CollectionUtils.isNotEmpty(firstMerchantIdList)) {
dto.setFirstMerchantIds(firstMerchantIdList);
}
sw.start("查询数据库会员信息");
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
List<MemberVO> memberVOS = memberBasicInfoMapper.selectMemberList(dto);
sw.stop();
log.info("查询耗时:{}", sw.prettyPrint());
return memberVOS;
}
@@ -419,13 +443,4 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
return memberWalletLogMapper.getMemberRefundAmount(memberIds);
}
/**
* 获取当前会员中的运营商列表(带权限校验)
*/
@Override
public List<MerchantInfoVO> getMerchantListByAuth(List<String> deptIds) {
return memberBasicInfoMapper.getMerchantListByAuth(deptIds);
}
}

View File

@@ -34,8 +34,8 @@ public class MemberWalletInfoServiceImpl implements MemberWalletInfoService {
}
@Override
public MemberWalletInfo selectByMemberId(String memberId) {
return memberWalletInfoMapper.selectByMemberId(memberId);
public MemberWalletInfo selectByMemberId(String memberId, String merchantId) {
return memberWalletInfoMapper.selectByMemberId(memberId, merchantId);
}
@Override

View File

@@ -48,6 +48,7 @@ import com.jsowell.pile.service.orderlogic.OrderLogicFactory;
import com.jsowell.pile.transaction.dto.ClearingBillTransactionDTO;
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
import com.jsowell.pile.transaction.service.TransactionService;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.PileInfoVO;
import com.jsowell.pile.vo.base.*;
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
@@ -197,7 +198,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
@Override
public List<OrderListVO> selectOrderBasicInfoListWithAuth(QueryOrderDTO dto) {
// 权限过滤
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return Lists.newArrayList();
@@ -1935,7 +1936,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
*/
@Override
public List<IndexOrderInfoVO> getIndexOrderInfo(IndexQueryDTO dto) {
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
return Lists.newArrayList();
}

View File

@@ -2,8 +2,6 @@ package com.jsowell.pile.service.impl;
import com.google.common.collect.Lists;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.pile.domain.OrderInvoiceRecord;
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
@@ -11,6 +9,7 @@ import com.jsowell.pile.mapper.OrderInvoiceRecordMapper;
import com.jsowell.pile.service.IMemberInvoiceTitleService;
import com.jsowell.pile.service.IOrderBasicInfoService;
import com.jsowell.pile.service.IOrderInvoiceRecordService;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
import com.jsowell.pile.vo.uniapp.InvoiceTitleVO;
import com.jsowell.pile.vo.web.InvoiceRecordVO;
@@ -96,7 +95,7 @@ public class OrderInvoiceRecordServiceImpl implements IOrderInvoiceRecordService
@Override
public List<OrderInvoiceRecordVO> getInvoiceListWithAuth(GetInvoiceInfoDTO dto) {
// 获取登录账号信息
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
return new ArrayList<>();
}

View File

@@ -26,6 +26,7 @@ import com.jsowell.pile.mapper.PileBasicInfoMapper;
import com.jsowell.pile.mapper.PileMerchantInfoMapper;
import com.jsowell.pile.mapper.PileSimInfoMapper;
import com.jsowell.pile.service.*;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.base.PileInfoVO;
import com.jsowell.pile.vo.uniapp.GroundLockInfoVO;
@@ -326,7 +327,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
*/
@Override
public List<PileDetailVO> queryPileInfoList(QueryPileDTO queryPileDTO) {
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return Lists.newArrayList();
@@ -422,7 +423,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
.merchantId(String.valueOf(basicInfo.getMerchantId()))
.build();
// 查站点信息
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(basicInfo.getMerchantId()));
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(basicInfo.getMerchantId()));
if (merchantInfo != null) {
pileInfoVO.setMerchantName(merchantInfo.getMerchantName());
}
@@ -700,7 +701,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
*/
@Override
public IndexGeneralSituationVO getGeneralSituation(IndexQueryDTO dto) {
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
return new IndexGeneralSituationVO();
}

View File

@@ -1,6 +1,5 @@
package com.jsowell.pile.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -24,6 +23,7 @@ import com.jsowell.pile.service.IPileBasicInfoService;
import com.jsowell.pile.service.IPileBillingTemplateService;
import com.jsowell.pile.transaction.dto.BillingTemplateTransactionDTO;
import com.jsowell.pile.transaction.service.TransactionService;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
import com.jsowell.pile.vo.uniapp.CurrentTimePriceDetails;
import com.jsowell.pile.vo.web.BillingDetailVO;
@@ -426,7 +426,7 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
if (StringUtils.isBlank(stationId)) {
return Lists.newArrayList();
}
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return Lists.newArrayList();

View File

@@ -9,13 +9,13 @@ import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.DictUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.PileMerchantInfo;
import com.jsowell.pile.dto.CreateMerchantDTO;
import com.jsowell.pile.dto.QueryMerchantInfoDTO;
import com.jsowell.pile.mapper.PileMerchantInfoMapper;
import com.jsowell.pile.service.IPileMerchantInfoService;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.web.MerchantSettleInfoVO;
import com.jsowell.system.service.SysDeptService;
@@ -74,7 +74,7 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
*/
@Override
public List<PileMerchantInfo> selectPileMerchantInfoListWithAuth(PileMerchantInfo pileMerchantInfo) {
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return Lists.newArrayList();
@@ -122,6 +122,7 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
dept.setDeptName(dto.getMerchantName());
dept.setLeader(dto.getManagerName());
dept.setPhone(dto.getManagerPhone());
dept.setDeptLevel("2");
dept.setStatus("0");
sysDeptService.insertDept(dept);
@@ -306,17 +307,34 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
}
@Override
public MerchantInfoVO getMerchantInfo(String merchantId) {
public MerchantInfoVO getMerchantInfoVO(String merchantId) {
PileMerchantInfo pileMerchantInfo = selectPileMerchantInfoById(Long.parseLong(merchantId));
if (pileMerchantInfo == null) {
return null;
}
// MerchantInfoVO vo = MerchantInfoVO.builder()
// .merchantId(merchantId)
// .merchantName(pileMerchantInfo.getMerchantName())
// .merchantTel(pileMerchantInfo.getServicePhone())
// .organizationCode(pileMerchantInfo.getOrganizationCode())
// .deptId(pileMerchantInfo.getDeptId())
// .build();
return conversion2MerchantInfoVO(pileMerchantInfo);
}
/**
* PileMerchantInfo 转换为 MerchantInfoVO
* @param pileMerchantInfo
* @return
*/
private MerchantInfoVO conversion2MerchantInfoVO(PileMerchantInfo pileMerchantInfo) {
MerchantInfoVO vo = MerchantInfoVO.builder()
.merchantId(merchantId)
.merchantId(String.valueOf(pileMerchantInfo.getId()))
.merchantName(pileMerchantInfo.getMerchantName())
.merchantTel(pileMerchantInfo.getServicePhone())
.organizationCode(pileMerchantInfo.getOrganizationCode())
.deptId(pileMerchantInfo.getDeptId())
.merchantLevel(pileMerchantInfo.getMerchantLevel())
.build();
return vo;
}
@@ -334,6 +352,15 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
return pileMerchantInfoMapper.queryInfoByDeptId(deptId);
}
@Override
public MerchantInfoVO queryMerchantInfoVOByDeptId(String deptId) {
PileMerchantInfo merchantInfo = queryInfoByDeptId(deptId);
if (Objects.isNull(merchantInfo)) {
return null;
}
return conversion2MerchantInfoVO(merchantInfo);
}
/**
* 通过ids查询信息列表
* @param dto
@@ -345,7 +372,7 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
dto.setDeptIds(Lists.newArrayList());
}
// 权限过滤
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return new ArrayList<>();
@@ -497,4 +524,32 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
return null;
}
/**
* 查询全部运营商信息
* @return
*/
@Override
public List<MerchantInfoVO> selectAll() {
List<MerchantInfoVO> resultList = Lists.newArrayList();
List<PileMerchantInfo> pileMerchantInfos = pileMerchantInfoMapper.selectPileMerchantInfoList(null);
for (PileMerchantInfo pileMerchantInfo : pileMerchantInfos) {
resultList.add(conversion2MerchantInfoVO(pileMerchantInfo));
}
return resultList;
}
@Override
public List<MerchantInfoVO> selectListByFirstMerchant(String firstMerchantId) {
List<MerchantInfoVO> resultList = Lists.newArrayList();
// 查询运营商下属的二级运营商
List<PileMerchantInfo> pileMerchantInfos = pileMerchantInfoMapper.selectListByFirstMerchant(firstMerchantId);
if (CollectionUtils.isEmpty(pileMerchantInfos)) {
return resultList;
}
for (PileMerchantInfo pileMerchantInfo : pileMerchantInfos) {
resultList.add(conversion2MerchantInfoVO(pileMerchantInfo));
}
return resultList;
}
}

View File

@@ -18,7 +18,6 @@ import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.ip.AddressUtils;
import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
import com.jsowell.pile.domain.ThirdpartyParkingConfig;
import com.jsowell.pile.dto.FastCreateStationDTO;
import com.jsowell.pile.dto.QueryStationDTO;
@@ -27,6 +26,7 @@ import com.jsowell.pile.dto.lutongyunting.BindParkingPlatformDTO;
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO;
import com.jsowell.pile.mapper.PileStationInfoMapper;
import com.jsowell.pile.service.*;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.base.PileInfoVO;
import com.jsowell.pile.vo.base.StationInfoVO;
@@ -261,7 +261,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public int fastCreateStation(FastCreateStationDTO dto) {
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(dto.getMerchantId());
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(dto.getMerchantId());
if (merchantInfo == null) {
return 0;
}
@@ -323,6 +323,8 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
sysDept.setLeader(pileStationInfo.getStationAdminName());
sysDept.setPhone(pileStationInfo.getStationTel());
sysDept.setUpdateTime(DateUtils.getNowDate());
sysDept.setDeptLevel("3");
// 修改站点对应的部门
sysDeptService.updateDept(sysDept);
}
}
@@ -353,7 +355,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
/*
修改组织部门
*/
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(newMerchantId);
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(newMerchantId);
if (merchantInfo != null) {
// 创建一个新的站点对应部门
SysDept dept = sysDeptService.createStationDept(Long.valueOf(merchantInfo.getDeptId()),
@@ -404,7 +406,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
@Override
// @DataScope(deptAlias = "t3")
public List<PileStationVO> queryStationInfos(QueryStationDTO dto) {
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return Lists.newArrayList();
@@ -564,7 +566,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
*/
@Override
public List<PileStationVO> getStationSelectList(QueryStationDTO dto) {
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
if (authorizedMap == null) {
// 为空表示没有权限,返回空数组
return Lists.newArrayList();
@@ -584,5 +586,14 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
public List<NXJTStationInfoVO> NXJTQueryStationsInfo(NXJTQueryStationInfoDTO dto) {
return pileStationInfoMapper.NXJTQueryStationsInfo(dto);
}
@Override
public PileStationInfo queryInfoByDeptId(String deptId) {
if (StringUtils.isBlank(deptId)) {
return null;
}
return pileStationInfoMapper.queryInfoByDeptId(deptId);
}
}