支付订单增加remark字段
This commit is contained in:
parent
f768f7f473
commit
1ad6aa3de7
|
|
@ -293,7 +293,7 @@ public class PayController {
|
|||
public Result createOrder(HttpServletRequest request, @RequestBody PaymentReq paymentReq) {
|
||||
try {
|
||||
return payService.createOrder(IpUtil.getIpAddr(request), paymentReq.getUserId(), paymentReq.getPayType(),
|
||||
paymentReq.getShopId(), paymentReq.getOrderId(), paymentReq.getPayAmount());
|
||||
paymentReq.getShopId(), paymentReq.getOrderId(), paymentReq.getPayAmount(), paymentReq.getRemark());
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,4 +27,6 @@ public class PaymentReq implements Serializable {
|
|||
private String userId;
|
||||
|
||||
private String shopId;
|
||||
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1854,7 +1854,8 @@ public class PayService {
|
|||
return "QR" + date + randomNum;
|
||||
}
|
||||
|
||||
public Result createOrder(String ip, String userId, String payType, String shopId, String orderId, BigDecimal amount) throws JsonProcessingException {
|
||||
public Result createOrder(String ip, String userId, String payType, String shopId, String orderId,
|
||||
BigDecimal amount, String remark) throws JsonProcessingException {
|
||||
|
||||
if (ObjectUtil.isNull(userId) || ObjectUtil.isEmpty(userId) || ObjectUtil.isEmpty(payType) ||
|
||||
ObjectUtil.isNull(payType) || ObjectUtil.isNull(shopId) || ObjectUtil.isEmpty(shopId) ||
|
||||
|
|
@ -1872,6 +1873,13 @@ public class PayService {
|
|||
|
||||
if (StrUtil.isNotBlank(orderId)) {
|
||||
orderInfo = tbOrderInfoMapper.selectByPrimaryKey(Integer.valueOf(orderId));
|
||||
if (ObjectUtil.isNull(orderInfo)) {
|
||||
return Result.fail(CodeEnum.ORDERNOEXIST);
|
||||
}
|
||||
if (StrUtil.isNotBlank(remark)) {
|
||||
orderInfo.setRemark(remark);
|
||||
tbOrderInfoMapper.updateByPrimaryKey(orderInfo);
|
||||
}
|
||||
} else {
|
||||
orderInfo = new TbOrderInfo();
|
||||
|
||||
|
|
@ -1895,11 +1903,11 @@ public class PayService {
|
|||
orderInfo.setCreatedAt(System.currentTimeMillis());
|
||||
orderInfo.setIsAccepted(Byte.valueOf("1"));
|
||||
orderInfo.setTradeDay(DateUtils.getDay());
|
||||
orderInfo.setRemark(remark);
|
||||
|
||||
tbOrderInfoMapper.insert(orderInfo);
|
||||
}
|
||||
|
||||
|
||||
TbOrderPayment payment = tbOrderPaymentMapper.selectByOrderId(orderInfo.getId().toString());
|
||||
if (ObjectUtil.isEmpty(payment) || payment == null) {
|
||||
payment = new TbOrderPayment();
|
||||
|
|
|
|||
Loading…
Reference in New Issue