mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update
This commit is contained in:
@@ -169,49 +169,6 @@ public class OrderService {
|
||||
*/
|
||||
public Map<String, Object> payOrder(PayOrderDTO dto) throws Exception {
|
||||
Map<String, Object> resultMap = orderBasicInfoService.payOrder(dto);
|
||||
|
||||
// OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(dto.getOrderCode());
|
||||
// if (orderInfo == null) {
|
||||
// throw new BusinessException(ReturnCodeEnum.CODE_QUERY_ORDER_NULL_ERROR);
|
||||
// }
|
||||
// if (!StringUtils.equals(orderInfo.getPayStatus(), "0")) {
|
||||
// // 订单已支付
|
||||
// throw new BusinessException(ReturnCodeEnum.CODE_ORDER_IS_NOT_TO_BE_PAID_ERROR);
|
||||
// }
|
||||
// Map<String, Object> resultMap = Maps.newHashMap();
|
||||
// if (StringUtils.equals(dto.getPayMode(), OrderPayModeEnum.PAYMENT_OF_BALANCE.getValue())) {
|
||||
// // 余额支付
|
||||
// balancePayOrder(dto);
|
||||
// } else if (StringUtils.equals(dto.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) {
|
||||
// // 微信支付
|
||||
// dto.setOrderBasicInfo(orderInfo);
|
||||
//
|
||||
// // 从字典中获取使用汇付支付的站点
|
||||
// List<SysDictData> adapay_station = DictUtils.getDictCache("adapay_station");
|
||||
// List<String> stationIdList = Lists.newArrayList();
|
||||
// if (CollectionUtils.isNotEmpty(adapay_station)) {
|
||||
// for (SysDictData sysDictData : adapay_station) {
|
||||
// stationIdList.add(sysDictData.getDictValue());
|
||||
// }
|
||||
// }
|
||||
// Map<String, Object> weixinMap;
|
||||
// if (stationIdList.contains(orderInfo.getStationId())) {
|
||||
// log.info("该站点:{}在字典中配置了使用汇付支付", orderInfo.getStationId());
|
||||
// weixinMap = adapayPayOrder(dto);
|
||||
// } else {
|
||||
// log.info("该站点:{}使用微信支付", orderInfo.getStationId());
|
||||
// weixinMap = wechatPayOrder(dto);
|
||||
// }
|
||||
//
|
||||
// // 返回微信支付参数
|
||||
// resultMap.put("weixinMap", weixinMap);
|
||||
// } else if (StringUtils.equals(dto.getPayMode(), OrderPayModeEnum.PAYMENT_OF_ALIPAY.getValue())) { // 支付宝支付
|
||||
// // TODO 返回支付宝支付参数
|
||||
// } else if (StringUtils.equals(dto.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WHITELIST.getValue())) { // 白名单支付
|
||||
// // 白名单支付可以直接调支付回调方法
|
||||
// dto.setPayAmount(new BigDecimal("500"));
|
||||
// whiteListPayOrder(dto);
|
||||
// }
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@@ -1114,6 +1114,17 @@ public class SpringBootTestController {
|
||||
// } else {
|
||||
// System.out.println("更新余额失败");
|
||||
// }
|
||||
|
||||
Map<String, Object> refundParams = new HashMap<>(2);
|
||||
refundParams.put("payment_id", "002212023071011321210524320114191904768");
|
||||
// refundParams.put("refund_id", refund_id);
|
||||
// refundParams.put("refund_order_no", refund_order_no);
|
||||
try {
|
||||
Map<String, Object> refund = Refund.query(refundParams);
|
||||
System.out.println(refund);
|
||||
} catch (BaseAdaPayException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.huifu.adapay.model.Refund;
|
||||
import com.jsowell.adapay.common.CreateAdaPaymentParam;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.domain.entity.SysDictData;
|
||||
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
@@ -158,6 +159,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
@Autowired
|
||||
private PileRemoteService pileRemoteService;
|
||||
|
||||
/**
|
||||
* 条件查询订单基本信息
|
||||
*
|
||||
@@ -194,7 +196,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
if (StringUtils.equals(PaymentInstitutionsEnum.ADAPAY.getValue(), orderListVO.getPaymentInstitutions())) {
|
||||
AdapayCallbackRecord adapayCallbackRecord = adapayCallbackRecordService.selectByOrderCode(orderListVO.getOrderCode());
|
||||
orderListVO.setOutTradeNo(adapayCallbackRecord.getPaymentId());
|
||||
} else if (StringUtils.equals(PaymentInstitutionsEnum.WECHAT_PAY.getValue(), orderListVO.getPaymentInstitutions())){
|
||||
} else if (StringUtils.equals(PaymentInstitutionsEnum.WECHAT_PAY.getValue(), orderListVO.getPaymentInstitutions())) {
|
||||
WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderListVO.getOrderCode());
|
||||
orderListVO.setOutTradeNo(wxpayCallbackRecord.getOutTradeNo());
|
||||
}
|
||||
@@ -321,7 +323,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
: new BigDecimal(orderListVO.getChargingDegree());
|
||||
sumUsedElectricity = sumUsedElectricity.add(chargingDegree);
|
||||
|
||||
BigDecimal settleAmount = StringUtils.isBlank(orderListVO.getSettleAmount())
|
||||
BigDecimal settleAmount = StringUtils.isBlank(orderListVO.getSettleAmount())
|
||||
? BigDecimal.ZERO
|
||||
: new BigDecimal(orderListVO.getSettleAmount());
|
||||
sumSettleAmount = sumSettleAmount.add(settleAmount);
|
||||
@@ -528,7 +530,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
redisCache.setCacheObject(redisKey, orderBasicInfo, 5, TimeUnit.MINUTES);
|
||||
}
|
||||
}
|
||||
logger.info("通过订单号:{}, 查询订单信息:{}", orderCode, JSON.toJSONString(orderBasicInfo));
|
||||
// logger.info("通过订单号:{}, 查询订单信息:{}", orderCode, JSON.toJSONString(orderBasicInfo));
|
||||
return orderBasicInfo;
|
||||
}
|
||||
|
||||
@@ -547,7 +549,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
redisCache.setCacheObject(redisKey, orderBasicInfo, 5, TimeUnit.MINUTES);
|
||||
}
|
||||
}
|
||||
logger.info("通过交易流水号:{}, 查询订单信息:{}", transactionCode, JSON.toJSONString(orderBasicInfo));
|
||||
// logger.info("通过交易流水号:{}, 查询订单信息:{}", transactionCode, JSON.toJSONString(orderBasicInfo));
|
||||
return orderBasicInfo;
|
||||
}
|
||||
|
||||
@@ -1643,7 +1645,6 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
return map;
|
||||
|
||||
|
||||
|
||||
// String pileSn = dto.getPileSn();
|
||||
// String connectorCode = dto.getConnectorCode();
|
||||
// String startMode = dto.getStartMode();
|
||||
@@ -1945,23 +1946,6 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
refundParams.put("refund_order_no", SnowflakeIdWorker.getSnowflakeId());
|
||||
refundParams.put("notify_url", ADAPAY_REFUND_CALLBACK_URL);
|
||||
|
||||
// 分账对象信息
|
||||
// OrderBasicInfo orderBasicInfo = getOrderInfoByOrderCode(dto.getOrderCode());
|
||||
// if (orderBasicInfo != null) {
|
||||
// String adapayMemberId = adapayMemberAccountService.selectAdapayMemberIdByStationId(orderBasicInfo.getStationId());
|
||||
// if (StringUtils.isNotBlank(adapayMemberId)) {
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("member_id", adapayMemberId);
|
||||
// jsonObject.put("amount", amount);
|
||||
// jsonObject.put("fee_flag", Constants.Y);
|
||||
//
|
||||
// // 分账对象信息列表,最多仅支持7个分账方,json 数组形式
|
||||
// JSONArray jsonArray = new JSONArray();
|
||||
// jsonArray.add(jsonObject);
|
||||
// // 分账对象信息
|
||||
// refundParams.put("div_members", jsonArray.toString());
|
||||
// }
|
||||
// }
|
||||
try {
|
||||
Map<String, Object> response = Refund.create(id, refundParams);
|
||||
logger.info("汇付支付创建退款对象:{}", JSON.toJSONString(response));
|
||||
@@ -2060,6 +2044,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 获取运营商订单列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@@ -2118,6 +2103,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 支付订单
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
* @throws Exception
|
||||
@@ -2140,22 +2126,22 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
// 微信支付
|
||||
dto.setOrderBasicInfo(orderInfo);
|
||||
|
||||
Map<String, Object> weixinMap = adapayPayOrder(dto);
|
||||
Map<String, Object> weixinMap = null;
|
||||
// 从字典中获取使用汇付支付的站点
|
||||
// List<SysDictData> adapay_station = DictUtils.getDictCache("adapay_station");
|
||||
// List<String> stationIdList = Lists.newArrayList();
|
||||
// if (CollectionUtils.isNotEmpty(adapay_station)) {
|
||||
// for (SysDictData sysDictData : adapay_station) {
|
||||
// stationIdList.add(sysDictData.getDictValue());
|
||||
// }
|
||||
// }
|
||||
// if (stationIdList.contains(orderInfo.getStationId())) {
|
||||
// logger.info("该站点:{}在字典中配置了使用汇付支付", orderInfo.getStationId());
|
||||
// weixinMap = adapayPayOrder(dto);
|
||||
// } else {
|
||||
// logger.info("该站点:{}使用微信支付", orderInfo.getStationId());
|
||||
// weixinMap = wechatPayOrder(dto);
|
||||
// }
|
||||
List<SysDictData> adapay_station = DictUtils.getDictCache("adapay_station");
|
||||
List<String> stationIdList = Lists.newArrayList();
|
||||
if (CollectionUtils.isNotEmpty(adapay_station)) {
|
||||
for (SysDictData sysDictData : adapay_station) {
|
||||
stationIdList.add(sysDictData.getDictValue());
|
||||
}
|
||||
}
|
||||
if (stationIdList.contains(orderInfo.getStationId())) {
|
||||
logger.info("该站点:{}在字典中配置了使用汇付支付", orderInfo.getStationId());
|
||||
weixinMap = adapayPayOrder(dto);
|
||||
} else {
|
||||
logger.info("该站点:{}使用微信支付", orderInfo.getStationId());
|
||||
weixinMap = wechatPayOrder(dto);
|
||||
}
|
||||
|
||||
// 返回微信支付参数
|
||||
resultMap.put("weixinMap", weixinMap);
|
||||
@@ -2171,6 +2157,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 白名单支付订单逻辑
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
private void whiteListPayOrder(PayOrderDTO dto) {
|
||||
@@ -2222,6 +2209,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 微信支付订单逻辑 获取支付参数
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
* @throws Exception
|
||||
@@ -2263,6 +2251,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 使用汇付支付
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@@ -2299,9 +2288,9 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
map.put("type", ScenarioEnum.ORDER.getValue());
|
||||
map.put("orderCode", dto.getOrderCode());
|
||||
createAdaPaymentParam.setDescription(JSON.toJSONString(map));
|
||||
//异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
|
||||
// 异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
|
||||
createAdaPaymentParam.setNotify_url(ADAPAY_CALLBACK_URL);
|
||||
createAdaPaymentParam.setExpend(JSONObject.toJSONString( ImmutableMap.of("open_id", openId)));
|
||||
createAdaPaymentParam.setExpend(JSONObject.toJSONString(ImmutableMap.of("open_id", openId)));
|
||||
|
||||
// 分账对象信息
|
||||
// String adapayMemberId = adapayMemberAccountService.selectAdapayMemberIdByStationId(orderInfo.getStationId());
|
||||
@@ -2341,6 +2330,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
/**
|
||||
* 余额支付订单逻辑
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
private void balancePayOrder(PayOrderDTO dto) {
|
||||
|
||||
Reference in New Issue
Block a user