|
@@ -14,6 +14,7 @@ import com.miaxis.common.core.domain.entity.UserInfo;
|
|
|
import com.miaxis.common.exception.CustomException;
|
|
|
import com.miaxis.common.utils.RSAUtils;
|
|
|
import com.miaxis.common.utils.SecurityUtils;
|
|
|
+import com.miaxis.common.utils.StringUtils;
|
|
|
import com.miaxis.common.utils.XmlUtil;
|
|
|
import com.miaxis.extension.service.IWxExtensionIncomeService;
|
|
|
import com.miaxis.feign.dto.WxGzhMini;
|
|
@@ -213,13 +214,17 @@ public class WxOrderServiceImpl extends ServiceImpl<WxOrderMapper, WxOrder> impl
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public String writeNotifyDataToDb(JSONObject jsonObject) {
|
|
|
+ public void writeNotifyDataToDb(JSONObject jsonObject) {
|
|
|
//更新订单
|
|
|
String outTradeNo = jsonObject.getString("out_trade_no");
|
|
|
WxOrder wxOrder = this.getByOutTradeNo(outTradeNo);
|
|
|
if (wxOrder == null) {
|
|
|
throw new CustomException("该订单不存在");
|
|
|
}
|
|
|
+ //幂等性判定
|
|
|
+ if (StringUtils.isEmpty(wxOrder.getTradeState())){
|
|
|
+ return ;
|
|
|
+ }
|
|
|
wxOrder.setTransactionId(jsonObject.getString("transaction_id"));
|
|
|
JSONObject amount = jsonObject.getJSONObject("amount");
|
|
|
wxOrder.setPayerTotal(amount.getInteger("payer_total"));
|