退款订单添加退款备注
This commit is contained in:
@@ -31,13 +31,14 @@ public class NotifyController {
|
|||||||
public Object fstPay(@RequestBody Map<String, String> req) {
|
public Object fstPay(@RequestBody Map<String, String> req) {
|
||||||
log.info("接收到福商通支付回调: {}", req);
|
log.info("接收到福商通支付回调: {}", req);
|
||||||
orderInfoService.successPay(req);
|
orderInfoService.successPay(req);
|
||||||
return null;
|
return "ok";
|
||||||
}
|
}
|
||||||
|
|
||||||
@AnonymousAccess
|
@AnonymousAccess
|
||||||
@RequestMapping("/fstReturn")
|
@RequestMapping("/fstReturn")
|
||||||
public Object fstReturn(@RequestBody Map<String, String> req) {
|
public Object fstReturn(@RequestBody Map<String, String> req) {
|
||||||
log.info("接收到福商通退款回调: {}", req);
|
log.info("接收到福商通退款回调: {}", req);
|
||||||
return null;
|
orderInfoService.successReturn(req);
|
||||||
|
return "ok";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,6 +237,9 @@ public class TbOrderInfo implements Serializable {
|
|||||||
|
|
||||||
@Column(name = "`seat_count`")
|
@Column(name = "`seat_count`")
|
||||||
private Integer seatCount;
|
private Integer seatCount;
|
||||||
|
|
||||||
|
@Column(name = "`refund_remark`")
|
||||||
|
private String refundRemark;
|
||||||
public void copy(TbOrderInfo source){
|
public void copy(TbOrderInfo source){
|
||||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -597,4 +597,21 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
|||||||
payService.checkPayState(orderInfo);
|
payService.checkPayState(orderInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void successReturn(Map<String, String> req) {
|
||||||
|
JSONObject bizData = JSONObject.parseObject(req.get("bizData"));
|
||||||
|
if ("000000".equals(req.get("code")) &&
|
||||||
|
"SUCCESS".equals(bizData.getString("state"))) {
|
||||||
|
String payOrderId = bizData.get("payOrderId").toString();
|
||||||
|
TbOrderInfo orderInfo = orderInfoMapper.selectOne(new LambdaQueryWrapper<TbOrderInfo>()
|
||||||
|
.eq(TbOrderInfo::getPayOrderNo, payOrderId));
|
||||||
|
if (orderInfo == null) {
|
||||||
|
log.warn("订单信息不存在: {}", payOrderId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
orderInfo.setStatus("refund");
|
||||||
|
orderInfoMapper.updateById(orderInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1980,6 +1980,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
returnOrder.setCreatedAt(DateUtil.current());
|
returnOrder.setCreatedAt(DateUtil.current());
|
||||||
returnOrder.setPayOrderNo(null);
|
returnOrder.setPayOrderNo(null);
|
||||||
returnOrder.setSource(oldOrderInfo.getId());
|
returnOrder.setSource(oldOrderInfo.getId());
|
||||||
|
returnOrder.setRefundRemark(returnOrderDTO.getNote());
|
||||||
orderInfoMapper.insert(returnOrder);
|
orderInfoMapper.insert(returnOrder);
|
||||||
|
|
||||||
updateStockAndRecord(detailList);
|
updateStockAndRecord(detailList);
|
||||||
@@ -2047,16 +2048,17 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
String payType = orderInfo.getPayType();
|
String payType = orderInfo.getPayType();
|
||||||
|
|
||||||
// // 线上退款
|
// // 线上退款
|
||||||
|
orderInfo.setRefundAmount(returnOrderInfo.getRefundAmount());
|
||||||
|
orderInfo.setRefundRemark(returnOrderDTO.getNote());
|
||||||
if ("scanCode".equals(payType) || "wx_lite".equals(payType)) {
|
if ("scanCode".equals(payType) || "wx_lite".equals(payType)) {
|
||||||
payService.returnOrder(Integer.valueOf(shopId), orderInfo, returnOrderInfo);
|
payService.returnOrder(Integer.valueOf(shopId), orderInfo, returnOrderInfo);
|
||||||
|
orderInfo.setStatus("refunding");
|
||||||
// 储值卡支付退款
|
// 储值卡支付退款
|
||||||
} else if ("deposit".equals(payType)) {
|
} else if ("deposit".equals(payType)) {
|
||||||
orderInfoService.depositReturn(Integer.valueOf(orderInfo.getUserId()), Integer.valueOf(orderInfo.getShopId()), returnOrderInfo.getRefundAmount());
|
orderInfoService.depositReturn(Integer.valueOf(orderInfo.getUserId()), Integer.valueOf(orderInfo.getShopId()), returnOrderInfo.getRefundAmount());
|
||||||
|
orderInfo.setStatus("refund");
|
||||||
}
|
}
|
||||||
|
|
||||||
orderInfo.setStatus("refund");
|
|
||||||
orderInfoMapper.updateById(orderInfo);
|
orderInfoMapper.updateById(orderInfo);
|
||||||
|
|
||||||
// 打印退款小票
|
// 打印退款小票
|
||||||
// producer.printMechine(newOrderInfo.getId().toString());
|
// producer.printMechine(newOrderInfo.getId().toString());
|
||||||
|
|
||||||
|
|||||||
@@ -102,4 +102,10 @@ public interface TbOrderInfoService {
|
|||||||
* @param req
|
* @param req
|
||||||
*/
|
*/
|
||||||
void successPay(Map<String, String> req);
|
void successPay(Map<String, String> req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款成功回调
|
||||||
|
* @param req
|
||||||
|
*/
|
||||||
|
void successReturn(Map<String, String> req);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user