|
|
@@ -65,12 +65,13 @@ public class ClientRoomInfoService {
|
|
|
private final MemberRepo memberRepo;
|
|
|
private final AlipayClient alipayClient;
|
|
|
private final AmmeterService ammeterService;
|
|
|
+ private final StoreInfoRepo storeInfoRepo;
|
|
|
|
|
|
public ClientRoomInfoService(UserRepo userRepo, CheckinInfoRepo checkinInfoRepo, WxPayService wxPayService,
|
|
|
WxMpService wxMpService, Environment environment, PersonalFeeRepo personalFeeRepo,
|
|
|
PersonalFeeTypeRepo personalFeeTypeRepo, ContractRepo contractRepo,
|
|
|
RoomFeeRepo roomFeeRepo, FeeTypeRepo feeTypeRepo, UserMoneyRecordRepo userMoneyRecordRepo,
|
|
|
- MemberRepo memberRepo, AlipayClient alipayClient, AmmeterService ammeterService) {
|
|
|
+ MemberRepo memberRepo, AlipayClient alipayClient, AmmeterService ammeterService, StoreInfoRepo storeInfoRepo) {
|
|
|
this.userRepo = userRepo;
|
|
|
this.checkinInfoRepo = checkinInfoRepo;
|
|
|
this.wxPayService = wxPayService;
|
|
|
@@ -82,6 +83,7 @@ public class ClientRoomInfoService {
|
|
|
this.memberRepo = memberRepo;
|
|
|
this.alipayClient = alipayClient;
|
|
|
this.ammeterService = ammeterService;
|
|
|
+ this.storeInfoRepo = storeInfoRepo;
|
|
|
}
|
|
|
|
|
|
public ClientRoomInfoDTO getClientRoomInfoDTO(Long userId) {
|
|
|
@@ -145,14 +147,8 @@ public class ClientRoomInfoService {
|
|
|
|
|
|
public Object payDeposit(Long userId, Long checkinInfoId, PayMethod payMethod) throws WxPayException, AlipayApiException {
|
|
|
CheckinInfo checkinInfo = checkinInfoRepo.findById(checkinInfoId).orElseThrow(new BusinessException("无记录"));
|
|
|
- List<Long> storeIds = new ArrayList<>();
|
|
|
- storeIds.add(44496L);
|
|
|
- storeIds.add(38585L);
|
|
|
- storeIds.add(2619152L);
|
|
|
- storeIds.add(5708L);
|
|
|
- storeIds.add(27086608L);
|
|
|
- storeIds.add(90225L);
|
|
|
- storeIds.add(15272L);
|
|
|
+ List<Long> storeIds = storeInfoRepo.findAllByCanPay(false).stream().map(StoreInfo::getId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
if (storeIds.stream().anyMatch(storeId -> storeId.equals(checkinInfo.getStoreId()))) {
|
|
|
throw new BusinessException("本门店交易功能已被关闭.");
|
|
|
}
|
|
|
@@ -239,14 +235,8 @@ public class ClientRoomInfoService {
|
|
|
User user = userRepo.findById(userId).orElseThrow(new BusinessException("无记录"));
|
|
|
CheckinInfo checkinInfo = checkinInfoRepo.findFirstByIdNoOrderByCheckinTimeDescCreatedAtDesc(user.getIdNo())
|
|
|
.orElseThrow(new BusinessException("无记录"));
|
|
|
- List<Long> storeIds = new ArrayList<>();
|
|
|
- storeIds.add(44496L);
|
|
|
- storeIds.add(38585L);
|
|
|
- storeIds.add(2619152L);
|
|
|
- storeIds.add(5708L);
|
|
|
- storeIds.add(27086608L);
|
|
|
- storeIds.add(90225L);
|
|
|
- storeIds.add(15272L);
|
|
|
+ List<Long> storeIds = storeInfoRepo.findAllByCanPay(false).stream().map(StoreInfo::getId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
if (storeIds.stream().anyMatch(storeId -> storeId.equals(checkinInfo.getStoreId()))) {
|
|
|
throw new BusinessException("本门店交易功能已被关闭.");
|
|
|
}
|