filter data except H5 data

This commit is contained in:
Carl 2022-02-18 15:50:21 +08:00
parent d2d0461ecf
commit bd24abd220

View File

@ -90,6 +90,9 @@ public class OrderController {
com.alibaba.fastjson.JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("data"));
JSONObject jsonObjectData = (JSONObject) jsonArray.get(0);
if (jsonObjectData.getString("udf2") != "H5"){
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
}
ordersEntity.setCouponAmount(jsonObjectData.getString("couponAmount") == null ? jsonObjectData.getString("discount") : jsonObjectData.getString("couponAmount"));
ordersEntity.setCouponCode(jsonObjectData.getString("couponCode"));
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
@ -222,7 +225,7 @@ public class OrderController {
@ApiOperation(value = "微信支付JSAPI订单", notes = "生成JSAPI订单")
@PostMapping("royalcanin/generateOrderWXJSAPI")
public ResponseDTO<Map<String, String>> generateOrderWXJSAPI(@RequestBody List<OrdersEntity> ordersEntityList) throws Exception {
public ResponseDTO<Map<String, String>> generateOrderWXJSAPI(@RequestBody List<OrdersEntity> ordersEntityList,String resp) throws Exception {
StringBuffer productId = new StringBuffer();
StringBuffer productName = new StringBuffer();
String memberId = "";
@ -293,7 +296,7 @@ public class OrderController {
Map<String, String> returnMap = new HashMap<>();
returnMap.put("orderNumber",ordersEntity.getOrderNo());
returnMap.put("orderAmount",ordersEntity.getOrderAmount());
return ResponseDTO.succData(returnMap,wxpayService.dounifiedOrderJSAPI(wxPayEntity));
return ResponseDTO.succData(returnMap,wxpayService.dounifiedOrderJSAPI(wxPayEntity,resp));
}
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_FAIL);
}
@ -358,7 +361,7 @@ public class OrderController {
@ApiOperation(value = "重新支付JSAPI", notes = "重新支付JSAPI")
@PostMapping("royalcanin/repayOrderJSAPI")
public ResponseDTO<String> repayOrderWXJSAPI(String orderNo) throws Exception {
public ResponseDTO<String> repayOrderWXJSAPI(String orderNo,String rsp) throws Exception {
OrderEntity ordersEntity = orderService.findByOrderId(orderNo);
if(ordersEntity != null){
QueryEntity queryEntity = new QueryEntity();
@ -371,7 +374,7 @@ public class OrderController {
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
wxPayEntity.setTotal_fee(jsonObject.getString("salesAmount"));
wxPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
return ResponseDTO.succData(wxpayService.dounifiedOrderJSAPI(wxPayEntity));
return ResponseDTO.succData(wxpayService.dounifiedOrderJSAPI(wxPayEntity,rsp));
}else {
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_ERROR,orderInfo);
}