Kaynağa Gözat

优化代码

1098226878@qq.com 4 yıl önce
ebeveyn
işleme
92fca4e48b

+ 6 - 6
service-api/src/main/java/com/java110/api/smo/payment/adapt/wechatPay/WechatTempCarFeeToNotifyAdapt.java

@@ -132,14 +132,14 @@ public class WechatTempCarFeeToNotifyAdapt extends DefaultAbstractComponentSMO i
         }
 
         String orderId = map.get("out_trade_no").toString();
-        String order = CommonCache.getAndRemoveValue(FeeDto.REDIS_PAY_TEMP_CAR_FEE + orderId);
-
-        if (StringUtil.isEmpty(order)) {
-            return 1;// 说明已经处理过了 再不处理
-        }
+//        String order = CommonCache.getAndRemoveValue(FeeDto.REDIS_PAY_TEMP_CAR_FEE + orderId);
+//
+//        if (StringUtil.isEmpty(order)) {
+//            return 1;// 说明已经处理过了 再不处理
+//        }
 
         //查询用户ID
-        JSONObject paramIn = JSONObject.parseObject(order);
+        JSONObject paramIn = new JSONObject();
         paramIn.put("oId", orderId);
         String url = "tempCarFee.notifyTempCarFeeOrder";
         /**

+ 5 - 1
service-fee/src/main/java/com/java110/fee/cmd/tempCarFee/NotifyTempCarFeeOrderCmd.java

@@ -17,6 +17,7 @@ import com.java110.po.couponUserDetail.CouponUserDetailPo;
 import com.java110.utils.cache.CommonCache;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 
@@ -50,7 +51,10 @@ public class NotifyTempCarFeeOrderCmd extends AbstractServiceCmdListener {
 
     @Override
     public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-        String paramIn = CommonCache.getAndRemoveValue("getTempCarFeeOrder" + reqJson.getString("oId"));
+        String paramIn = CommonCache.getAndRemoveValue("queryTempCarFeeOrder" + reqJson.getString("oId"));
+        if (StringUtil.isEmpty(paramIn)) {
+            throw new CmdException("已经处理过了 再不处理");
+        }
         JSONObject paramObj = JSONObject.parseObject(paramIn);
         System.out.println("获取到内存中的数据了++++++++++++==》"+paramObj.toJSONString());
         modifyCouponUser(paramObj);

+ 1 - 1
service-fee/src/main/java/com/java110/fee/cmd/tempCarFee/QueryTempCarFeeOrderCmd.java

@@ -86,7 +86,7 @@ public class QueryTempCarFeeOrderCmd extends AbstractServiceCmdListener {
         outParm.put("msg","成功");
         ResponseEntity<String> responseEntitys = new ResponseEntity<>(outParm.toJSONString(), HttpStatus.OK);
         fee.putAll(reqJson);
-        CommonCache.setValue("getTempCarFeeOrder" + fee.getString("oId"), fee.toJSONString(), 24 * 60 * 60);
+        CommonCache.setValue("queryTempCarFeeOrder" + fee.getString("oId"), fee.toJSONString(), 24 * 60 * 60);
         cmdDataFlowContext.setResponseEntity(responseEntitys);
     }