|
|
|
@@ -47,10 +47,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
@Autowired |
|
|
|
WxOrderMapper wxOrderMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
WxPayOrderMapper wxPayOrderMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
WxOrderService wxOrderService; |
|
|
|
|
|
|
|
JSONObject errorMap = JSON.parseObject("{\"NOAUTH\":{\"detail\":\"商户无此接口权限\",\"reason\":\"商户未开通此接口权限\",\"resolution\":\"请商户前往申请此接口权限\"}," + |
|
|
|
@@ -77,82 +77,98 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
// 1. check 订单 |
|
|
|
WxOrder order = wxOrderMapper.selectByPrimaryKey(record.getOrderId()); |
|
|
|
if (order == null) { |
|
|
|
logger.warn("pay order, order not allow, repaymentReq: " + record.toString() +", payWay: " + payWay.toString()); |
|
|
|
logger.error("pay order, order not allow, repaymentReq: " + record.toString() + ", payWay: " + payWay.toString()); |
|
|
|
throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); |
|
|
|
} |
|
|
|
if (order.getOrderStatus() != EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode()) { |
|
|
|
logger.warn("pay order, order status not allow, repaymentReq: " + order.toString() + " , payWay: " + payWay.toString()); |
|
|
|
logger.error("pay order, order status not allow, repaymentReq: " + order.toString() + " , payWay: " + payWay.toString()); |
|
|
|
throw new MallinkException(ErrorCode.ORDER_IS_NOT_PAY); |
|
|
|
} |
|
|
|
// 2. check 是否有支付订单 |
|
|
|
List<WxPayOrder> list = wxPayOrderMapper.findList(record); |
|
|
|
if (list.size() > 0) { |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_EXIST); |
|
|
|
} |
|
|
|
// 3. 创建支付订单 |
|
|
|
Long id = idworker.nextId(); |
|
|
|
Date currentDate = new Date(); |
|
|
|
|
|
|
|
record.setId(id); |
|
|
|
record.setTenantId(user.getTenantId()); |
|
|
|
record.setCUserId(user.getId()); |
|
|
|
record.setCreateTime(currentDate); |
|
|
|
record.setUpdateTime(currentDate); |
|
|
|
int currentTime = Utility.convertDate2TimeStamp(currentDate); |
|
|
|
record.setPayTimeStart(currentTime); |
|
|
|
record.setPayTimeEnd(currentTime); |
|
|
|
// 支付单号 |
|
|
|
record.setPayOrderNo(String.valueOf(id)); |
|
|
|
record.setPayAmount(order.getPayment()); |
|
|
|
record.setPayVendor(EnumPayWay.PAY_WAY_WEAPP.getCode()); |
|
|
|
record.setPayOrderStatus(EnumPayStatus.PAY_WAY_WAIT.getCode()); |
|
|
|
|
|
|
|
int sqlRow = wxPayOrderMapper.insertSelective(record); |
|
|
|
if(sqlRow != 1) { |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
List<WxPayOrder> list = wxPayOrderMapper.findList(record); |
|
|
|
String payOrderNo = ""; |
|
|
|
if (list.size() <= 0) { |
|
|
|
// 3. 创建支付订单 |
|
|
|
Long id = idworker.nextId(); |
|
|
|
payOrderNo = String.valueOf(id); |
|
|
|
record.setId(id); |
|
|
|
record.setTenantId(user.getTenantId()); |
|
|
|
record.setCUserId(user.getId()); |
|
|
|
record.setCreateTime(currentDate); |
|
|
|
record.setUpdateTime(currentDate); |
|
|
|
record.setPayTimeStart(currentTime); |
|
|
|
record.setPayTimeEnd(currentTime); |
|
|
|
// 支付单号 |
|
|
|
record.setPayOrderNo(payOrderNo); |
|
|
|
record.setPayAmount(order.getPayment()); |
|
|
|
record.setPayVendor(EnumPayWay.PAY_WAY_WEAPP.getCode()); |
|
|
|
record.setPayOrderStatus(EnumPayStatus.PAY_WAY_WAIT.getCode()); |
|
|
|
|
|
|
|
int sqlRow = wxPayOrderMapper.insertSelective(record); |
|
|
|
if (sqlRow != 1) { |
|
|
|
logger.error("pay order insert error: " + record.toString()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
} |
|
|
|
} else { |
|
|
|
record = list.get(0); |
|
|
|
payOrderNo = String.valueOf(record.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(appInfo.getPayId()); |
|
|
|
{ |
|
|
|
// 统一下单 |
|
|
|
String noncestr = Utility.generate32UUID(); |
|
|
|
WxPayOrderP wxPayOrderP = new WxPayOrderP(); |
|
|
|
wxPayOrderP.setOpenid(user.getOpenId()); |
|
|
|
wxPayOrderP.setAppid(user.getAppId()); |
|
|
|
wxPayOrderP.setMch_id(payAccount.getMchId()); |
|
|
|
wxPayOrderP.setNonce_str(noncestr); |
|
|
|
wxPayOrderP.setBody(order.getDetail()); |
|
|
|
wxPayOrderP.setOut_trade_no(record.getPayOrderNo()); |
|
|
|
wxPayOrderP.setTotal_fee(order.getPayment()); |
|
|
|
wxPayOrderP.setSpbill_create_ip(record.getIp()); // 终端IP |
|
|
|
wxPayOrderP.setNotify_url(payAccount.getPayNotifyUrl()); |
|
|
|
wxPayOrderP.setTrade_type(WxPay.TradeType.JSAPI.name()); // 终端类型 |
|
|
|
wxPayOrderP.setProduct_id(String.valueOf(order.getId())); // 订单ID |
|
|
|
wxPayOrderP.setTime_start(Utility.getDataFormatStringYYYYMMDDHHmmss(currentTime)); |
|
|
|
wxPayOrderP.setTime_expire(Utility.getDataFormatStringYYYYMMDDHHmmss(currentTime + 15 * 60)); // 15分钟结束 |
|
|
|
wxPayOrderP.setSign(WxPayment.createSign(BeanUtils.toStringMap(wxPayOrderP), payAccount.getApiKey())); |
|
|
|
String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderP)); |
|
|
|
logger.info("pay order, wechat pushOrder, wxPayOrder:" + wxPayOrderP.toString() + ", response: " + response.toString()); |
|
|
|
Map<String, String> returnMap = WxPayment.xmlToMap(response); |
|
|
|
String result_no = returnMap.get("result_code"); |
|
|
|
if ("SUCCESS".equals(result_no)) { |
|
|
|
String prepay_id = returnMap.get("prepay_id"); |
|
|
|
String timestamp = String.valueOf(Utility.getCurrentTimeStamp()); |
|
|
|
Map<String, String> sighMap = MapUtil.getOrderMap(); |
|
|
|
sighMap.put("appId", returnMap.get("appid")); |
|
|
|
sighMap.put("timeStamp", timestamp); |
|
|
|
sighMap.put("nonceStr", noncestr); |
|
|
|
sighMap.put("package", "prepay_id="+prepay_id); |
|
|
|
sighMap.put("signType", "MD5"); |
|
|
|
String signAgent = WxPayment.createSign(sighMap, payAccount.getApiKey()); |
|
|
|
returnMap.put("timeStamp", timestamp); |
|
|
|
returnMap.put("nonceStr", noncestr); |
|
|
|
returnMap.put("package", "prepay_id="+prepay_id); |
|
|
|
returnMap.put("paySign", signAgent); |
|
|
|
return new ResultData(200, "创建支付订单成功", returnMap); |
|
|
|
} else { |
|
|
|
JSONObject errObj = errorMap.getJSONObject(result_no); |
|
|
|
return new ResultData(ErrorCode.PAY_ORDER_ERROR.getCode(), errObj.toJSONString(), returnMap); |
|
|
|
} |
|
|
|
|
|
|
|
// 统一下单 |
|
|
|
String noncestr = Utility.generate32UUID(); |
|
|
|
WxPayOrderP wxPayOrderP = new WxPayOrderP(); |
|
|
|
wxPayOrderP.setOpenid(user.getOpenId()); |
|
|
|
wxPayOrderP.setAppid(user.getAppId()); |
|
|
|
wxPayOrderP.setMch_id(payAccount.getMchId()); |
|
|
|
wxPayOrderP.setNonce_str(noncestr); |
|
|
|
wxPayOrderP.setBody(order.getDetail()); |
|
|
|
wxPayOrderP.setOut_trade_no(record.getPayOrderNo()); |
|
|
|
wxPayOrderP.setTotal_fee(order.getPayment()); |
|
|
|
wxPayOrderP.setSpbill_create_ip(record.getIp()); // 终端IP |
|
|
|
wxPayOrderP.setNotify_url(payAccount.getPayNotifyUrl()); |
|
|
|
wxPayOrderP.setTrade_type(WxPay.TradeType.JSAPI.name()); // 终端类型 |
|
|
|
wxPayOrderP.setProduct_id(String.valueOf(order.getId())); // 订单ID |
|
|
|
wxPayOrderP.setTime_start(Utility.getDataFormatStringYYYYMMDDHHmmss(currentTime)); |
|
|
|
wxPayOrderP.setTime_expire(Utility.getDataFormatStringYYYYMMDDHHmmss(currentTime + 15 * 60)); // 15分钟结束 |
|
|
|
wxPayOrderP.setSign(WxPayment.createSign(BeanUtils.toStringMap(wxPayOrderP), payAccount.getApiKey())); |
|
|
|
String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderP)); |
|
|
|
logger.info("pay order, wechat pushOrder, " + wxPayOrderP.toString() + ", response: " + response.toString()); |
|
|
|
Map<String, String> returnMap = WxPayment.xmlToMap(response); |
|
|
|
returnMap.put("payOrderId", payOrderNo); |
|
|
|
String result_code = returnMap.get("result_code"); |
|
|
|
if ("SUCCESS".equals(result_code)) { |
|
|
|
/* |
|
|
|
Map<String, String> signMap = WxPayment.buildWeappSecondSignMap(returnMap.get("appid"), |
|
|
|
String.valueOf(Utility.getCurrentTimeStamp()), |
|
|
|
returnMap.get("prepay_id"), |
|
|
|
payAccount.getApiKey()); |
|
|
|
|
|
|
|
String signAgent = signMap.remove("sign"); |
|
|
|
returnMap.putAll(signMap); |
|
|
|
returnMap.put("paySign", signAgent); |
|
|
|
*/ |
|
|
|
String prepay_id = returnMap.get("prepay_id"); |
|
|
|
String timestamp = String.valueOf(Utility.getCurrentTimeStamp()); |
|
|
|
Map<String, String> sighMap = MapUtil.getOrderMap(); |
|
|
|
sighMap.put("appId", returnMap.get("appid")); |
|
|
|
sighMap.put("timeStamp", timestamp); |
|
|
|
sighMap.put("nonceStr", noncestr); |
|
|
|
sighMap.put("package", "prepay_id=" + prepay_id); |
|
|
|
sighMap.put("signType", "MD5"); |
|
|
|
String signAgent = WxPayment.createSign(sighMap, payAccount.getApiKey()); |
|
|
|
returnMap.put("timeStamp", timestamp); |
|
|
|
returnMap.put("nonceStr", noncestr); |
|
|
|
returnMap.put("package", "prepay_id=" + prepay_id); |
|
|
|
returnMap.put("paySign", signAgent); |
|
|
|
logger.info("back to UI: " +returnMap.toString()); |
|
|
|
return new ResultData(200, "创建支付订单成功", returnMap); |
|
|
|
} else { |
|
|
|
JSONObject errObj = errorMap.getJSONObject(result_code); |
|
|
|
return new ResultData(ErrorCode.PAY_ORDER_ERROR.getCode(), errObj.toJSONString(), returnMap); |
|
|
|
} |
|
|
|
} catch (RuntimeException e) { |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(), e.getMessage()); |
|
|
|
@@ -167,8 +183,9 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 提供微信支付回调调用 |
|
|
|
* @param paramMap 异步通知参数 |
|
|
|
* @param payWay 支付方式 |
|
|
|
* |
|
|
|
* @param paramMap 异步通知参数 |
|
|
|
* @param payWay 支付方式 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@@ -188,16 +205,14 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
try { |
|
|
|
if (payWay == EnumPayWay.PAY_WAY_WEAPP) { |
|
|
|
boolean signVerified = false; |
|
|
|
if (payWay == EnumPayWay.PAY_WAY_WECHAT) { |
|
|
|
// 微信支付 |
|
|
|
signVerified = WxPayment.verifyNotify(paramMap, partnerKey); |
|
|
|
} |
|
|
|
// 微信支付 |
|
|
|
signVerified = WxPayment.verifyNotify(paramMap, partnerKey); |
|
|
|
if (!signVerified) { |
|
|
|
logger.warn("notify order, wxpay checksign error, paramMap: "+paramMap.toString()+ ", payWay:" + payWay.toString()); |
|
|
|
logger.warn("notify order, wxpay checksign error, paramMap: " + paramMap.toString() + ", payWay:" + payWay.toString()); |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_NOTIFY_CHECK_SIGN_ERROR); |
|
|
|
} |
|
|
|
if (!"SUCCESS".equals(paramMap.get("return_code"))) { |
|
|
|
logger.warn("notify order, wxpay status not success, paramMap: "+paramMap.toString()+ ", payWay:" + payWay.toString()); |
|
|
|
logger.warn("notify order, wxpay status not success, paramMap: " + paramMap.toString() + ", payWay:" + payWay.toString()); |
|
|
|
Map<String, String> resultMap = new LinkedHashMap<>(); |
|
|
|
resultMap.put("return_code", "FAIL"); |
|
|
|
resultMap.put("return_msg", "订单状态码非SUCCESS"); |
|
|
|
@@ -208,15 +223,15 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
Long payOrderId = Long.valueOf(payOrderNo); |
|
|
|
WxPayOrder payOrder = wxPayOrderMapper.selectByPrimaryKey(payOrderId); |
|
|
|
if (payOrder == null) { |
|
|
|
logger.warn("notify order, wxpay check pay order not exists, paramMap: "+paramMap.toString()+ ", payWay:" + payWay.toString()); |
|
|
|
logger.warn("notify order, wxpay check pay order not exists, paramMap: " + paramMap.toString() + ", payWay:" + payWay.toString()); |
|
|
|
Map<String, String> resultMap = new LinkedHashMap<>(); |
|
|
|
resultMap.put("return_code", "FAIL"); |
|
|
|
resultMap.put("return_msg", "订单不存在"); |
|
|
|
return XmlUtil.parseDto2Xml(resultMap, ""); |
|
|
|
} |
|
|
|
// 验证支付金额 |
|
|
|
if(!paramMap.get("total_fee").equals(payOrder.getPayAmount().toString())) { |
|
|
|
logger.warn("notify order, wxpay check total_fee is invalid, paramMap: "+paramMap.toString()+ ", payWay:" + payWay.toString()); |
|
|
|
if (!paramMap.get("total_fee").equals(payOrder.getPayAmount().toString())) { |
|
|
|
logger.warn("notify order, wxpay check total_fee is invalid, paramMap: " + paramMap.toString() + ", payWay:" + payWay.toString()); |
|
|
|
Map<String, String> resultMap = new LinkedHashMap<>(); |
|
|
|
resultMap.put("return_code", "FAIL"); |
|
|
|
resultMap.put("return_msg", "订单总金额不一致"); |
|
|
|
@@ -225,14 +240,14 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
|
|
|
|
// 处理支付成功 |
|
|
|
handleOrderPaySuccess(payOrder, paramMap.get("transaction_id")); |
|
|
|
logger.info("notify order, wxpay checksign success, paramMap:{}, paramMap: "+paramMap.toString()+ ", payWay:" + payWay.toString()); |
|
|
|
logger.info("notify order, wxpay checksign success, paramMap:{}, paramMap: " + paramMap.toString() + ", payWay:" + payWay.toString()); |
|
|
|
Map<String, String> resultMap = new LinkedHashMap<>(); |
|
|
|
resultMap.put("return_code", "SUCCESS"); |
|
|
|
resultMap.put("return_msg", "OK"); |
|
|
|
return XmlUtil.parseDto2Xml(resultMap, ""); |
|
|
|
} |
|
|
|
} catch (RuntimeException e) { |
|
|
|
logger.warn("notify order, alipay checksign error, paramMap: "+paramMap.toString()+ ", payWay:" + payWay.toString() + ", e:" + e.getMessage()); |
|
|
|
logger.warn("notify order, alipay checksign error, paramMap: " + paramMap.toString() + ", payWay:" + payWay.toString() + ", e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.PAY_ORDER_NOTIFY_CHECK_SIGN_ERROR); |
|
|
|
} |
|
|
|
return ""; |
|
|
|
@@ -246,8 +261,21 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
@Override |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
public void handleOrderPaySuccess(WxPayOrder record, String transactionId) { |
|
|
|
Date currentDate = new Date(); |
|
|
|
EnumPayStatus payStatus = EnumPayStatus.getEnum(record.getPayOrderStatus()); |
|
|
|
// 判断支付状态 |
|
|
|
if (payStatus == EnumPayStatus.PAY_WAY_SUCCESS) { |
|
|
|
// 已经是成功状态,只更新transactionId |
|
|
|
try { |
|
|
|
record.setUpdateTime(currentDate); |
|
|
|
record.setTransactionId(transactionId); |
|
|
|
wxPayOrderMapper.updateByPrimaryKeySelective(record); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
if (payStatus != EnumPayStatus.PAY_WAY_WAIT) { |
|
|
|
logger.error("pay success handle, payOrder " + record.getPayOrderNo() + |
|
|
|
"is paid success , orderId : " + record.getOrderId()); |
|
|
|
@@ -255,11 +283,11 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
} |
|
|
|
WxOrder order = wxOrderMapper.selectByPrimaryKey(record.getOrderId()); |
|
|
|
if (order == null) { |
|
|
|
logger.error("pay success handle, order " + record.getOrderId() +" not found , payOrderGid : " + record.getPayOrderNo()); |
|
|
|
logger.error("pay success handle, order " + record.getOrderId() + " not found , payOrderGid : " + record.getPayOrderNo()); |
|
|
|
throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); |
|
|
|
} |
|
|
|
|
|
|
|
Date currentDate = new Date(); |
|
|
|
|
|
|
|
// 修改支付订单状态 |
|
|
|
try { |
|
|
|
WxPayOrder updateOrder = new WxPayOrder(); |
|
|
|
@@ -297,6 +325,65 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
*/ |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void handlePayOrderStatusUpdate(WxPayOrder record) { |
|
|
|
// 判断支付状态 |
|
|
|
if (record.getPayOrderStatus() != EnumPayStatus.PAY_WAY_WAIT.getCode()) { |
|
|
|
logger.error("pay handle, payOrder " + record.getPayOrderNo() + |
|
|
|
"is complete s , orderId : " + record.getOrderId()); |
|
|
|
return; |
|
|
|
} |
|
|
|
WxOrder order = wxOrderMapper.selectByPrimaryKey(record.getOrderId()); |
|
|
|
if (order == null) { |
|
|
|
logger.error("pay success handle, order " + record.getOrderId() + " not found , payOrderGid : " + record.getPayOrderNo()); |
|
|
|
throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); |
|
|
|
} |
|
|
|
|
|
|
|
Date currentDate = new Date(); |
|
|
|
// 修改支付订单状态 |
|
|
|
try { |
|
|
|
WxPayOrder updateOrder = new WxPayOrder(); |
|
|
|
updateOrder.setId(record.getId()); |
|
|
|
updateOrder.setOrderId(record.getOrderId()); |
|
|
|
updateOrder.setUpdateTime(currentDate); |
|
|
|
updateOrder.setPayOrderStatus(record.getPayOrderStatus()); |
|
|
|
wxPayOrderMapper.updateByPrimaryKeySelective(updateOrder); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
} |
|
|
|
|
|
|
|
// 修改订单状态 |
|
|
|
if (record.getPayOrderStatus() == EnumPayStatus.PAY_WAY_SUCCESS.getCode()) { |
|
|
|
try { |
|
|
|
wxOrderService.updateOrderStatus(order.getId(), EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
} |
|
|
|
} else if (record.getPayOrderStatus() == EnumPayStatus.PAY_WAY_CANCEL.getCode()) { |
|
|
|
try { |
|
|
|
wxOrderService.updateOrderStatus(order.getId(), EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
} |
|
|
|
} |
|
|
|
/* |
|
|
|
Map<String, String> msgMap = new HashMap<>(); |
|
|
|
try { |
|
|
|
msgMap.put("name", String.valueOf(order.getCouponId())); |
|
|
|
msgMap.put("orderNo", String.valueOf(order.getId())); |
|
|
|
msgMap.put("createTime", Utility.getDataFormatString3(order.getCreateDate())); |
|
|
|
msgMap.put("standingTime", order.getCreateDate() + "-" + currentDate ); |
|
|
|
// 短信 通知 商户 |
|
|
|
//smsSenderHandler.sendSms("SMS_18195394", order.getMobile(), msgMap); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("pay success handle, sms send exception, payOrderi: " + updatePayOrder+ ", msgMap: " + msgMap.toString() + ", e: " + e.getMessage()); |
|
|
|
} |
|
|
|
*/ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxPayOrder> listAsPage(WxPayOrder record, Integer pageIndex, Integer pageSize) { |
|
|
|
@@ -313,7 +400,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
if (record.getId() == null) { |
|
|
|
//record.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
|
|
|
IdWorker idWorker = new IdWorker(0, 0); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
wxPayOrderMapper.insertSelective(record); |
|
|
|
} else { |
|
|
|
wxPayOrderMapper.updateByPrimaryKeySelective(record); |
|
|
|
@@ -324,12 +411,6 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { |
|
|
|
public void deleteById(Long id) { |
|
|
|
wxPayOrderMapper.deleteByPrimaryKey(id); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |