mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
处理OrderSplitRecord中值为0的数据
This commit is contained in:
@@ -979,4 +979,20 @@ public class TempController extends BaseController {
|
||||
SmsResponse smsResponse = smsBlend.sendMessage("18521561107","888888");
|
||||
logger.info("发送短信结果:{}, 详情:{}", smsResponse.isSuccess(), JSON.toJSONString(smsResponse));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理OrderSplitRecord中值为0的数据
|
||||
*/
|
||||
@PostMapping("/handleOrderSplitRecord")
|
||||
public RestApiResponse<?> handleOrderSplitRecord(@RequestBody QueryOrderDTO dto) {
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
tempService.handleOrderSplitRecord(dto.getOrderCode());
|
||||
response = new RestApiResponse<>();
|
||||
} catch (Exception e) {
|
||||
logger.error("处理OrderSplitRecord中值为0的数据 error,", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1396,5 +1396,33 @@ public class TempService {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理OrderSplitRecord中值为0的数据
|
||||
* @throws BaseAdaPayException
|
||||
*/
|
||||
public void handleOrderSplitRecord(String orderCode) {
|
||||
// 根据订单号查询订单信息
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
|
||||
// 组装after参数
|
||||
AfterSettleOrderDTO afterSettleOrderDTO = AfterSettleOrderDTO.builder()
|
||||
.orderCode(orderBasicInfo.getOrderCode())
|
||||
.merchantId(orderBasicInfo.getMerchantId())
|
||||
.stationId(orderBasicInfo.getStationId())
|
||||
.orderPayAmount(orderBasicInfo.getPayAmount()) // 支付金额
|
||||
.orderConsumeAmount(orderBasicInfo.getOrderAmount()) // 消费金额
|
||||
.orderSettleAmount(orderBasicInfo.getSettleAmount()) // 结算金额
|
||||
.orderElectricityAmount(orderDetail.getTotalElectricityAmount()) // 电费金额
|
||||
.orderElectricityDiscountAmount(orderDetail.getDiscountElectricityAmount()) // 电费折扣金额
|
||||
.orderServiceAmount(orderDetail.getTotalServiceAmount()) // 服务费金额
|
||||
.orderServiceDiscountAmount(orderDetail.getDiscountServiceAmount()) // 服务费折扣金额
|
||||
.orderRefundAmount(orderBasicInfo.getRefundAmount()) // 退款金额
|
||||
.orderBasicInfo(orderBasicInfo)
|
||||
.build();
|
||||
|
||||
orderBasicInfoService.splittingMethodTemp(afterSettleOrderDTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,10 @@ import com.jsowell.common.enums.ykc.ScenarioEnum;
|
||||
import com.jsowell.common.util.AdapayUtil;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.domain.OrderUnsplitRecord;
|
||||
import com.jsowell.pile.dto.AfterSettleOrderDTO;
|
||||
import com.jsowell.pile.dto.DebugOrderDTO;
|
||||
import com.jsowell.pile.service.OrderBasicInfoService;
|
||||
import com.jsowell.pile.service.OrderUnsplitRecordService;
|
||||
@@ -52,7 +55,7 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* 专用处理汇付支付相关
|
||||
*/
|
||||
@ActiveProfiles("dev")
|
||||
@ActiveProfiles("pre")
|
||||
@SpringBootTest(classes = JsowellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@RunWith(SpringRunner.class)
|
||||
public class PaymentTestController {
|
||||
@@ -422,6 +425,21 @@ public class PaymentTestController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询支付确认对象列表
|
||||
*/
|
||||
@Test
|
||||
public void queryPaymentConfirmListTest() {
|
||||
String paymentId = "002212025092806193010818137979319861248";
|
||||
// 查询支付确认id
|
||||
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
||||
dto.setPaymentId(paymentId);
|
||||
dto.setWechatAppId(wechatAppId1);
|
||||
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
||||
System.out.println("查询支付确认对象列表:{}" + JSON.toJSONString(response));
|
||||
System.out.println("支付确认id:" + response.getPaymentConfirms().get(0).getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款信息
|
||||
*/
|
||||
@@ -570,11 +588,11 @@ public class PaymentTestController {
|
||||
|
||||
// 查询支付确认id
|
||||
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
||||
dto.setPaymentId("002212023102515344310563156645282902016");
|
||||
dto.setPaymentConfirmId("0022120251010134711990822599294813462528");
|
||||
dto.setWechatAppId(wechatAppId1);
|
||||
// 查询分账信息
|
||||
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
||||
System.out.println(JSON.toJSONString(response));
|
||||
PaymentConfirmInfo paymentConfirmInfo = adapayService.queryPaymentConfirmDetail(dto);
|
||||
System.out.println(JSON.toJSONString(paymentConfirmInfo));
|
||||
}
|
||||
|
||||
private List<String> getAdapayMemberIds() {
|
||||
@@ -809,4 +827,36 @@ public class PaymentTestController {
|
||||
logger.info("关单接口调用结果:{}", close);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理OrderSplitRecord中值为0的数据
|
||||
* @throws BaseAdaPayException
|
||||
*/
|
||||
@Test
|
||||
public void handleOrderSplitRecord() throws BaseAdaPayException {
|
||||
String orderCode = "C48131824908";
|
||||
|
||||
// 根据订单号查询订单信息
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
|
||||
// 组装after参数
|
||||
AfterSettleOrderDTO afterSettleOrderDTO = AfterSettleOrderDTO.builder()
|
||||
.orderCode(orderBasicInfo.getOrderCode())
|
||||
.merchantId(orderBasicInfo.getMerchantId())
|
||||
.stationId(orderBasicInfo.getStationId())
|
||||
.orderPayAmount(orderBasicInfo.getPayAmount()) // 支付金额
|
||||
.orderConsumeAmount(orderBasicInfo.getOrderAmount()) // 消费金额
|
||||
.orderSettleAmount(orderBasicInfo.getSettleAmount()) // 结算金额
|
||||
.orderElectricityAmount(orderDetail.getTotalElectricityAmount()) // 电费金额
|
||||
.orderElectricityDiscountAmount(orderDetail.getDiscountElectricityAmount()) // 电费折扣金额
|
||||
.orderServiceAmount(orderDetail.getTotalServiceAmount()) // 服务费金额
|
||||
.orderServiceDiscountAmount(orderDetail.getDiscountServiceAmount()) // 服务费折扣金额
|
||||
.orderRefundAmount(orderBasicInfo.getRefundAmount()) // 退款金额
|
||||
.orderBasicInfo(orderBasicInfo)
|
||||
.build();
|
||||
|
||||
orderBasicInfoService.splittingMethodTemp(afterSettleOrderDTO);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user