Merge branch 'dev' into merge_adapay

# Conflicts:
#	jsowell-admin/src/main/java/com/jsowell/api/uniapp/PayController.java
#	jsowell-admin/src/main/resources/application-dev.yml
This commit is contained in:
2023-09-08 15:48:57 +08:00
35 changed files with 3083 additions and 168 deletions

View File

@@ -239,4 +239,11 @@ public interface OrderBasicInfoMapper {
* @return
*/
IndexOrderInfoVO getIndexOrderDetail(@Param("list") List<String> orderCodeList);
/**
* 通过站点id修改运营商id
* @param stationId
* @return
*/
int updateMerchantByStationId(@Param("stationId")Long stationId, @Param("newMerchantId")String newMerchantId);
}

View File

@@ -113,4 +113,13 @@ public interface OrderPileOccupyMapper {
* @return
*/
OrderPileOccupy queryUnPayOrderByMemberId(String memberId);
/**
* 查询占桩订单列表
*
* @param orderPileOccupy 占桩订单
* @return 占桩订单集合
*/
public List<OrderPileOccupy> selectOrderPileOccupyList(OrderPileOccupy orderPileOccupy);
}

View File

@@ -345,4 +345,11 @@ public interface IOrderBasicInfoService {
void returnUpdateOrderBasicInfo(OrderBasicInfo orderBasicInfo, TransactionRecordsData data);
OrderDetail returnUpdateOrderDetail(OrderBasicInfo orderBasicInfo, TransactionRecordsData data);
/**
* 通过站点id修改运营商id
* @param stationId
* @return
*/
int updateMerchantByStationId(Long stationId, String newMerchantId);
}

View File

@@ -37,6 +37,14 @@ public interface OrderPileOccupyService{
OrderPileOccupy queryByOccupyCode(String occupyCode);
/**
* 查询占桩订单列表
*
* @param orderPileOccupy 占桩订单
* @return 占桩订单集合
*/
public List<OrderPileOccupy> selectOrderPileOccupyList(OrderPileOccupy orderPileOccupy);
List<OrderPileOccupy> queryOccupyOrderList(QueryOccupyOrderDTO dto);
/**

View File

@@ -295,16 +295,16 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
* @return
*/
@Override
public List<MemberVO> selectMemberList(QueryMemberInfoDTO dto) {
// 获取登录账号信息
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
if (authorizedMap == null) {
return new ArrayList<>();
}
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
dto.setMerchantDeptIds(merchantDeptIds);
}
public List<MemberVO> selectMemberList(QueryMemberInfoDTO dto) {
// // 获取登录账号信息
// AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
// if (authorizedMap == null) {
// return new ArrayList<>();
// }
// List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
// if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
// dto.setMerchantDeptIds(merchantDeptIds);
// }
return memberBasicInfoMapper.selectMemberList(dto);
}

View File

@@ -7,7 +7,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.jsowell.adapay.dto.QueryPaymentConfirmDTO;
import com.jsowell.adapay.operation.PaymentConfirmOperation;
import com.jsowell.adapay.operation.PaymentReverseOperation;
import com.jsowell.adapay.response.PaymentConfirmResponse;
import com.jsowell.adapay.response.PaymentReverseResponse;
@@ -1027,6 +1026,16 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
return orderDetail;
}
/**
* 通过站点id修改运营商id
* @param stationId
* @return
*/
@Override
public int updateMerchantByStationId(Long stationId, String newMerchantId) {
return orderBasicInfoMapper.updateMerchantByStationId(stationId, newMerchantId);
}
/**
* 卡状态解锁
*/
@@ -1442,22 +1451,24 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
BigDecimal deductionAmount = vo.getDeductionAmount();
// 延时分账使用确认交易API
// PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(paymentId, adapayMemberAccount, deductionAmount, orderCode, wechatAppId);
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(paymentId,
adapayMemberAccount, deductionAmount, orderCode, wechatAppId);
// 换新的方法,逻辑不变,参数封装了
PaymentConfirmOperation operation = new PaymentConfirmOperation();
operation.setPaymentId(paymentId);
operation.setConfirmAmt(deductionAmount);
operation.setOrderCode(orderCode);
operation.setAdapayMemberId(adapayMemberAccount.getAdapayMemberId());
operation.setMerchantKey(wechatAppId);
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(operation);
// PaymentConfirmOperation operation = new PaymentConfirmOperation();
// operation.setPaymentId(paymentId);
// operation.setConfirmAmt(deductionAmount);
// operation.setOrderCode(orderCode);
// operation.setAdapayMemberId(adapayMemberAccount.getAdapayMemberId());
// operation.setMerchantKey(wechatAppId);
// PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(operation);
if (paymentConfirmResponse != null && paymentConfirmResponse.isNotFailed()) {
confirmAmt = confirmAmt.add(new BigDecimal(paymentConfirmResponse.getConfirm_amt()));
feeAmt = feeAmt.add(new BigDecimal(paymentConfirmResponse.getFee_amt()));
status = paymentConfirmResponse.getStatus();
memberAdapayRecordService.updateSpendAmount(paymentId, deductionAmount);
// memberAdapayRecordService.updateSpendAmount(paymentId, deductionAmount);
memberAdapayRecordService.unfreezeAmountAndUpdateSpendAmount(paymentId, confirmAmt, confirmAmt);
}
}
@@ -1573,15 +1584,16 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
BigDecimal settleAmount = orderBasicInfo.getSettleAmount();
// 调汇付的分账接口 确认交易
// PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(paymentId, adapayMemberAccount, settleAmount, orderCode, wechatAppId);
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(paymentId,
adapayMemberAccount, settleAmount, orderCode, wechatAppId);
PaymentConfirmOperation operation = new PaymentConfirmOperation();
operation.setPaymentId(paymentId);
operation.setConfirmAmt(settleAmount);
operation.setOrderCode(orderCode);
operation.setAdapayMemberId(adapayMemberAccount.getAdapayMemberId());
operation.setMerchantKey(wechatAppId);
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(operation);
// PaymentConfirmOperation operation = new PaymentConfirmOperation();
// operation.setPaymentId(paymentId);
// operation.setConfirmAmt(settleAmount);
// operation.setOrderCode(orderCode);
// operation.setAdapayMemberId(adapayMemberAccount.getAdapayMemberId());
// operation.setMerchantKey(wechatAppId);
// PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(operation);
// 分账接口返回的信息
@@ -3335,11 +3347,13 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
throw new BusinessException(ReturnCodeEnum.CODE_STATION_IS_NOT_OPEN);
}
// 校验启动桩使用的小程序,和充电桩所属一级运营商是否一致
String merchantIdByAppId = pileMerchantInfoService.getFirstLevelMerchantIdByAppId(dto.getAppId());
String merchantIdByMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByMerchantId(stationInfo.getMerchantId());
if (!StringUtils.equals(merchantIdByAppId, merchantIdByMerchantId)) {
throw new BusinessException("", "当前桩运营商与小程序所属运营商不一致");
if (StringUtils.isNotBlank(dto.getAppId())) {
// 校验启动桩使用的小程序,和充电桩所属一级运营商是否一致
String merchantIdByAppId = pileMerchantInfoService.getFirstLevelMerchantIdByAppId(dto.getAppId());
String merchantIdByMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByMerchantId(stationInfo.getMerchantId());
if (!StringUtils.equals(merchantIdByAppId, merchantIdByMerchantId)) {
throw new BusinessException("", "当前桩运营商与小程序所属运营商不一致");
}
}
// 如果是鉴权卡或者vin启动不判断枪口状态

View File

@@ -1,5 +1,6 @@
package com.jsowell.pile.service.impl;
import com.alibaba.fastjson2.JSON;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Maps;
import com.jsowell.adapay.service.AdapayService;
@@ -138,6 +139,11 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
return orderPileOccupyMapper.queryByOccupyCode(occupyCode);
}
@Override
public List<OrderPileOccupy> selectOrderPileOccupyList(OrderPileOccupy orderPileOccupy) {
return orderPileOccupyMapper.selectOrderPileOccupyList(orderPileOccupy);
}
/**
* 查询占桩订单列表
*
@@ -190,6 +196,8 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
*/
@Override
public void stopOccupyPileOrder(String pileSn, String connectorCode) {
// 两种情况 1是没有停车地锁自动升起2是停车完成地锁升起
// 根据充电站sn和枪口号查询占桩中的占桩订单
OrderPileOccupy orderPileOccupy = getOccupiedOrder(pileSn, connectorCode);
if (orderPileOccupy == null) {
@@ -385,6 +393,7 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
@Override
public void remoteGroundLock(RemoteGroundLockDTO dto) {
log.info("控制地锁升降并生成占桩订单 params:{}", JSON.toJSONString(dto));
// 控制地锁升降
RemoteControlGroundLockCommand command = new RemoteControlGroundLockCommand();
command.setPileSn(dto.getPileSn());

View File

@@ -776,6 +776,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
}
lockInfoList.add(GroundLockInfoVO.LockInfo.builder()
.connectorCode(pileConnectorInfoVO.getPileConnectorCode())
.parkNo(pileConnectorInfoVO.getParkNo())
.lockStatus(parkingLockStatus)
.parkingStatus(data.getParkingStatus())
.build());

View File

@@ -81,6 +81,9 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
@Autowired
private IThirdPartyParkingConfigService parkingConfigService;
@Autowired
private IOrderBasicInfoService orderBasicInfoService;
/**
* 查询充电站信息
@@ -345,6 +348,11 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
pileStationInfo.setDeptId(String.valueOf(newDeptId));
}
/**
* 修改订单中的 merchantId
*/
orderBasicInfoService.updateMerchantByStationId(pileStationInfo.getId(), newMerchantId);
}
/**

View File

@@ -43,6 +43,11 @@ public class GroundLockInfoVO {
*/
private String connectorCode;
/**
* 车位号
*/
private String parkNo;
/**
* 地锁状态
*/