no message
This commit is contained in:
parent
dfc1aaca91
commit
8766726189
|
|
@ -55,6 +55,9 @@ import javax.validation.Valid;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
|
import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
|
||||||
|
|
@ -758,18 +761,13 @@ public class OrderDetailController extends BaseController {
|
||||||
orderListResponse.setIsOnlyServ(Boolean.FALSE);
|
orderListResponse.setIsOnlyServ(Boolean.FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 售后记录
|
|
||||||
// AfterServiceRecord afterServiceRecord = new AfterServiceRecord();
|
|
||||||
// afterServiceRecord.setOrderDetailId(detail.getId());
|
|
||||||
// List<AfterServiceRecord> afterServiceRecordList =afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
|
||||||
|
|
||||||
// 编辑返回属性
|
// 编辑返回属性
|
||||||
orderListResponse.setGoodsBrand(orderMaster.getGoodsBrand());
|
|
||||||
orderListResponse.setGoodsSpecification(orderMaster.getGoodsSpecification());
|
|
||||||
orderListResponse.setOrderDetailId(detail.getId());
|
orderListResponse.setOrderDetailId(detail.getId());
|
||||||
orderListResponse.setOrderDetailCode(detail.getCode());
|
orderListResponse.setOrderDetailCode(detail.getCode());
|
||||||
orderListResponse.setOrderMasterId(detail.getOrderMasterId());
|
orderListResponse.setOrderMasterId(detail.getOrderMasterId());
|
||||||
orderListResponse.setOrderMasterCode(detail.getOrderMasterCode());
|
orderListResponse.setOrderMasterCode(detail.getOrderMasterCode());
|
||||||
|
orderListResponse.setGoods(goods);
|
||||||
orderListResponse.setGoodsName(goods.getGoodsName());
|
orderListResponse.setGoodsName(goods.getGoodsName());
|
||||||
orderListResponse.setGoodsLogoUrl(goods.getGoodsImgUrl());
|
orderListResponse.setGoodsLogoUrl(goods.getGoodsImgUrl());
|
||||||
orderListResponse.setDiscountMoney(financialDetail.getDiscountMoney());
|
orderListResponse.setDiscountMoney(financialDetail.getDiscountMoney());
|
||||||
|
|
@ -1310,20 +1308,27 @@ public class OrderDetailController extends BaseController {
|
||||||
orderAttachmentRecord.setFinancialChangeRecordId(fcr.getId());
|
orderAttachmentRecord.setFinancialChangeRecordId(fcr.getId());
|
||||||
List<OrderAttachmentRecord> orderAttachmentRecords = orderAttachmentRecordService.selectOrderAttachmentRecordList(orderAttachmentRecord);
|
List<OrderAttachmentRecord> orderAttachmentRecords = orderAttachmentRecordService.selectOrderAttachmentRecordList(orderAttachmentRecord);
|
||||||
|
|
||||||
for (OrderAttachmentRecord orderAttachmentRecord1 : orderAttachmentRecords) {
|
// 创建一个定时任务,延迟1分钟后执行退款操作
|
||||||
executor.execute(() -> {
|
ScheduledExecutorService scheduledExecutor = Executors.newScheduledThreadPool(1);
|
||||||
try {
|
scheduledExecutor.schedule(() -> {
|
||||||
JSONObject response = adapayService.payReverse(om.getDeptId(), orderAttachmentRecord1.getPaymentId(),
|
for (OrderAttachmentRecord orderAttachmentRecord1 : orderAttachmentRecords) {
|
||||||
String.valueOf(orderAttachmentRecord1.getAttachMoney()), RefundType.RCG);
|
executor.execute(() -> {
|
||||||
logger.info("配件退款成功: paymentId={}, amount={},response{}", orderAttachmentRecord1.getPaymentId(), orderAttachmentRecord1.getAttachMoney(),response);
|
try {
|
||||||
} catch (BaseAdaPayException e) {
|
JSONObject response = adapayService.payReverse(om.getDeptId(), orderAttachmentRecord1.getPaymentId(),
|
||||||
logger.error("配件退款失败: paymentId={}, amount={}, error={}",
|
String.valueOf(orderAttachmentRecord1.getAttachMoney()), RefundType.RCG);
|
||||||
orderAttachmentRecord1.getPaymentId(), orderAttachmentRecord1.getAttachMoney(), e.getMessage(), e);
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 关闭定时器
|
||||||
|
scheduledExecutor.shutdown();
|
||||||
|
}, 1, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
orderAttachmentRecordService.deleteOrderAttachmentRecordByOrderDetailId(orderDetail.getId());
|
||||||
// 退回旧商品
|
// 退回旧商品
|
||||||
// List<OrderGoods> goodsList = orderGoodsService.selectByOrderDetailId(orderDetail.getId());
|
// List<OrderGoods> goodsList = orderGoodsService.selectByOrderDetailId(orderDetail.getId());
|
||||||
// goodsList.forEach(orderGoods -> {
|
// goodsList.forEach(orderGoods -> {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue