filter data except H5 data

This commit is contained in:
Carl 2022-02-18 16:09:53 +08:00
parent a6860b3c3e
commit bafd4c0120

View File

@ -89,9 +89,10 @@ public class OrderController {
JSONObject jsonObject = JSONObject.parseObject(couponInfo); JSONObject jsonObject = JSONObject.parseObject(couponInfo);
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("data")); com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("data"));
JSONObject jsonObjectData = (JSONObject) jsonArray.get(0); JSONObject jsonObjectData = (JSONObject) jsonArray.get(0);
if (jsonObjectData.getString("udf2") != null){
if (jsonObjectData.getString("udf2") != "H5"){ if (!jsonObjectData.getString("udf2").equals("H5")){
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL); return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
}
} }
ordersEntity.setCouponAmount(jsonObjectData.getString("couponAmount") == null ? jsonObjectData.getString("discount") : jsonObjectData.getString("couponAmount")); ordersEntity.setCouponAmount(jsonObjectData.getString("couponAmount") == null ? jsonObjectData.getString("discount") : jsonObjectData.getString("couponAmount"));
ordersEntity.setCouponCode(jsonObjectData.getString("couponCode")); ordersEntity.setCouponCode(jsonObjectData.getString("couponCode"));