no message

This commit is contained in:
cb 2025-06-04 18:01:21 +08:00
parent ca4530ce84
commit dfc1aaca91
2 changed files with 39 additions and 19 deletions

View File

@ -1,5 +1,6 @@
package com.ghy.web.controller.order;
import com.alibaba.fastjson.JSONObject;
import com.ghy.common.annotation.Log;
import com.ghy.common.constant.UserConstants;
import com.ghy.common.core.controller.BaseController;
@ -20,6 +21,7 @@ import com.ghy.order.service.*;
import com.ghy.payment.domain.FinancialChangeRecord;
import com.ghy.payment.domain.FinancialDetail;
import com.ghy.payment.domain.FinancialMaster;
import com.ghy.payment.service.AdapayService;
import com.ghy.payment.service.FinancialChangeRecordService;
import com.ghy.payment.service.FinancialDetailService;
import com.ghy.payment.service.FinancialMasterService;
@ -55,6 +57,8 @@ import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
/**
* 详细订单API
*
@ -119,6 +123,9 @@ public class OrderDetailController extends BaseController {
@Resource
private IOrderAttachmentRecordService orderAttachmentRecordService;
@Resource
private AdapayService adapayService;
@RequiresPermissions("order:detail:view")
@GetMapping()
public String orderDetail() {
@ -817,7 +824,7 @@ public class OrderDetailController extends BaseController {
orderListResponse.setProvinceName(array[0]);
orderListResponse.setCityName(array[1]);
orderListResponse.setCountryName(array[2]);
orderListResponse.setStreetName(array.length>3?array[3]:null);
orderListResponse.setStreetName(array[3]);
orderListResponse.setProvinceId(customerAddress.getProvinceId());
orderListResponse.setCityId(customerAddress.getCityId());
orderListResponse.setCountryId(customerAddress.getCountryId());
@ -1299,11 +1306,24 @@ public class OrderDetailController extends BaseController {
for (FinancialChangeRecord fcr : fcrList) {
if (PayStatus.PAID.getCode().equals(fcr.getPayStatus()) || PayStatus.PAYED_ADD.getCode().equals(fcr.getPayStatus())) {
executor.execute(() -> financialChangeRecordService.refund(om.getDeptId(), fcr.getId()));
payMoney = payMoney.subtract(fcr.getChangeMoney());
OrderAttachmentRecord orderAttachmentRecord = new OrderAttachmentRecord();
orderAttachmentRecord.setFinancialChangeRecordId(fcr.getId());
List<OrderAttachmentRecord> orderAttachmentRecords = orderAttachmentRecordService.selectOrderAttachmentRecordList(orderAttachmentRecord);
for (OrderAttachmentRecord orderAttachmentRecord1 : orderAttachmentRecords) {
executor.execute(() -> {
try {
JSONObject response = adapayService.payReverse(om.getDeptId(), orderAttachmentRecord1.getPaymentId(),
String.valueOf(orderAttachmentRecord1.getAttachMoney()), RefundType.RCG);
logger.info("配件退款成功: paymentId={}, amount={}response{}", orderAttachmentRecord1.getPaymentId(), orderAttachmentRecord1.getAttachMoney(),response);
} catch (BaseAdaPayException e) {
logger.error("配件退款失败: paymentId={}, amount={}, error={}",
orderAttachmentRecord1.getPaymentId(), orderAttachmentRecord1.getAttachMoney(), e.getMessage(), e);
}
});
}
}
}
financialMaster.setPayMoney(payMoney);
financialMasterService.updateFinancialMaster(financialMaster);
// 退回旧商品
// List<OrderGoods> goodsList = orderGoodsService.selectByOrderDetailId(orderDetail.getId());
// goodsList.forEach(orderGoods -> {