mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
update
This commit is contained in:
@@ -21,10 +21,8 @@ import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.TitleTypeEnum;
|
||||
import com.jsowell.common.enums.adapay.MerchantDelayModeEnum;
|
||||
import com.jsowell.common.enums.uniapp.BalanceChangesEnum;
|
||||
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.enums.ykc.ScenarioEnum;
|
||||
import com.jsowell.common.enums.ykc.StartModeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.AdapayUtil;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
@@ -38,7 +36,10 @@ import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.transaction.dto.MemberTransactionDTO;
|
||||
import com.jsowell.pile.transaction.service.TransactionService;
|
||||
import com.jsowell.pile.vo.base.MemberWalletVO;
|
||||
import com.jsowell.pile.vo.uniapp.*;
|
||||
import com.jsowell.pile.vo.uniapp.InvoiceTitleVO;
|
||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||
import com.jsowell.pile.vo.uniapp.MemberWalletInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
|
||||
import com.jsowell.wxpay.service.WxAppletRemoteService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
@@ -659,43 +660,43 @@ public class MemberService {
|
||||
* @param dto
|
||||
* @throws ParseException
|
||||
*/
|
||||
public void rechargeOrderAmount(RechargeOrderAmountDTO dto) throws ParseException {
|
||||
// 根据memberId查询出当前用户正在充电的 vin启动订单 或 卡启动订单
|
||||
UniAppQueryOrderDTO orderDTO = new UniAppQueryOrderDTO();
|
||||
orderDTO.setOrderStatus("4"); // 4-正在充电中
|
||||
PageResponse pageResponse = orderService.getListByMemberIdAndOrderStatus(dto.getMemberId(), orderDTO);
|
||||
if (pageResponse == null) {
|
||||
return;
|
||||
}
|
||||
List<OrderVO> list = (List<OrderVO>) pageResponse.getList();
|
||||
List<OrderVO> chargingList = list.stream()
|
||||
.filter(orderVO -> orderVO.getOrderStatus().equals(OrderStatusEnum.IN_THE_CHARGING.getValue()))
|
||||
.collect(Collectors.toList());
|
||||
for (OrderVO orderVO : chargingList) {
|
||||
if (StringUtils.equals(orderVO.getStartMode(), StartModeEnum.AUTH_CARD.getValue())
|
||||
|| StringUtils.equals(orderVO.getStartMode(), StartModeEnum.OFFLINE_CARD.getValue())
|
||||
|| StringUtils.equals(orderVO.getStartMode(), StartModeEnum.VIN_CODE.getValue())) {
|
||||
// 将充值后的余额计算出来
|
||||
BigDecimal rechargeAmount = new BigDecimal(dto.getRechargeAmount());
|
||||
BigDecimal payAmount = orderVO.getPayAmount().add(rechargeAmount);
|
||||
orderVO.setPayAmount(payAmount);
|
||||
// 发送0x41指令更新账户余额
|
||||
RemoteAccountBalanceUpdateDTO remoteDTO = new RemoteAccountBalanceUpdateDTO();
|
||||
remoteDTO.setPileSn(orderVO.getPileSn());
|
||||
remoteDTO.setConnectorCode(orderVO.getConnectorCode());
|
||||
remoteDTO.setAccountBalance(String.valueOf(orderVO.getPayAmount()));
|
||||
|
||||
pileRemoteService.remoteAccountBalanceUpdate(remoteDTO);
|
||||
|
||||
// 将支付金额修改数据库
|
||||
OrderBasicInfo basicInfo = new OrderBasicInfo();
|
||||
basicInfo.setId(Integer.parseInt(orderVO.getId()));
|
||||
basicInfo.setPayAmount(payAmount);
|
||||
|
||||
orderBasicInfoService.updateOrderBasicInfo(basicInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
// public void rechargeOrderAmount(RechargeOrderAmountDTO dto) throws ParseException {
|
||||
// // 根据memberId查询出当前用户正在充电的 vin启动订单 或 卡启动订单
|
||||
// UniAppQueryOrderDTO orderDTO = new UniAppQueryOrderDTO();
|
||||
// orderDTO.setOrderStatus("4"); // 4-正在充电中
|
||||
// PageResponse pageResponse = orderService.getListByMemberIdAndOrderStatus(dto.getMemberId(), orderDTO);
|
||||
// if (pageResponse == null) {
|
||||
// return;
|
||||
// }
|
||||
// List<OrderVO> list = (List<OrderVO>) pageResponse.getList();
|
||||
// List<OrderVO> chargingList = list.stream()
|
||||
// .filter(orderVO -> orderVO.getOrderStatus().equals(OrderStatusEnum.IN_THE_CHARGING.getValue()))
|
||||
// .collect(Collectors.toList());
|
||||
// for (OrderVO orderVO : chargingList) {
|
||||
// if (StringUtils.equals(orderVO.getStartMode(), StartModeEnum.AUTH_CARD.getValue())
|
||||
// || StringUtils.equals(orderVO.getStartMode(), StartModeEnum.OFFLINE_CARD.getValue())
|
||||
// || StringUtils.equals(orderVO.getStartMode(), StartModeEnum.VIN_CODE.getValue())) {
|
||||
// // 将充值后的余额计算出来
|
||||
// BigDecimal rechargeAmount = new BigDecimal(dto.getRechargeAmount());
|
||||
// BigDecimal payAmount = orderVO.getPayAmount().add(rechargeAmount);
|
||||
// orderVO.setPayAmount(payAmount);
|
||||
// // 发送0x41指令更新账户余额
|
||||
// RemoteAccountBalanceUpdateDTO remoteDTO = new RemoteAccountBalanceUpdateDTO();
|
||||
// remoteDTO.setPileSn(orderVO.getPileSn());
|
||||
// remoteDTO.setConnectorCode(orderVO.getConnectorCode());
|
||||
// remoteDTO.setAccountBalance(String.valueOf(orderVO.getPayAmount()));
|
||||
//
|
||||
// pileRemoteService.remoteAccountBalanceUpdate(remoteDTO);
|
||||
//
|
||||
// // 将支付金额修改数据库
|
||||
// OrderBasicInfo basicInfo = new OrderBasicInfo();
|
||||
// basicInfo.setId(Integer.parseInt(orderVO.getId()));
|
||||
// basicInfo.setPayAmount(payAmount);
|
||||
//
|
||||
// orderBasicInfoService.updateOrderBasicInfo(basicInfo);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public List<MemberWalletVO> queryMemberWalletList(String memberId) {
|
||||
return memberWalletInfoService.selectByMemberWalletList(memberId);
|
||||
|
||||
Reference in New Issue
Block a user