支付订单增加remark字段
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user