mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-01 17:56:39 +08:00
!208 adding generateOrder error msg logic
Merge pull request !208 from Admin/sit-Carl-V3
This commit is contained in:
commit
70ea7a7d68
@ -141,8 +141,12 @@ public class OrderController {
|
||||
returnMap.put("orderNumber", ordersEntity.getOrderNo());
|
||||
returnMap.put("orderAmount", ordersEntity.getOrderAmount());
|
||||
return ResponseDTO.succData(returnMap, wxpayService.generateQRCode(wxPayEntity));
|
||||
}else if (resultMsg.get("code").equals("3")){
|
||||
}else if (resultMsg.get("code").equals("0")){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_ERROR,resultMsg.get("msg"));
|
||||
}else if (resultMsg.get("code").equals("3")){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_FAIL_COUPONDED,resultMsg.get("msg"));
|
||||
}else if (resultMsg.get("code").equals("4")){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL,resultMsg.get("msg"));
|
||||
}
|
||||
}catch (Exception e){
|
||||
System.out.println(e.getMessage());
|
||||
@ -234,8 +238,12 @@ public class OrderController {
|
||||
returnMap.put("orderNumber", ordersEntity.getOrderNo());
|
||||
returnMap.put("orderAmount", ordersEntity.getOrderAmount());
|
||||
return ResponseDTO.succData(returnMap,wxpayService.dounifiedOrder(wxPayEntity));
|
||||
}else if (resultMsg.get("code").equals("3")){
|
||||
}else if (resultMsg.get("code").equals("0")){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_ERROR,resultMsg.get("msg"));
|
||||
}else if (resultMsg.get("code").equals("3")){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_FAIL_COUPONDED,resultMsg.get("msg"));
|
||||
}else if (resultMsg.get("code").equals("4")){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL,resultMsg.get("msg"));
|
||||
}
|
||||
}catch (Exception e){
|
||||
System.out.println(e.getMessage());
|
||||
@ -317,6 +325,7 @@ public class OrderController {
|
||||
ordersEntity.setOrderStatus("0");
|
||||
ordersEntity.setBasePoint(basePoint);
|
||||
ordersEntity.setPayType("3");
|
||||
resultMsg = orderService.generateOrder(ordersEntity, orderDatilListJson);
|
||||
//判断订单生成状况
|
||||
if (resultMsg.get("code").equals("1")) {
|
||||
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
|
||||
@ -326,8 +335,12 @@ public class OrderController {
|
||||
returnMap.put("orderNumber", ordersEntity.getOrderNo());
|
||||
returnMap.put("orderAmount", ordersEntity.getOrderAmount());
|
||||
return ResponseDTO.succData(returnMap, wxpayService.generateQRCode(wxPayEntity));
|
||||
}else if (resultMsg.get("code").equals("3")){
|
||||
}else if (resultMsg.get("code").equals("0")){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_ORDER_ERROR,resultMsg.get("msg"));
|
||||
}else if (resultMsg.get("code").equals("3")){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.GENERATE_FAIL_COUPONDED,resultMsg.get("msg"));
|
||||
}else if (resultMsg.get("code").equals("4")){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL,resultMsg.get("msg"));
|
||||
}
|
||||
}catch (Exception e){
|
||||
System.out.println(e.getMessage());
|
||||
|
@ -65,7 +65,7 @@ public class OrderService {
|
||||
couponCosumeEntity.setRealCouponAmount(realCouponAmount);
|
||||
JSONObject jsonObject = JSONObject.parseObject(couponService.couponCosume(couponCosumeEntity));
|
||||
if (!jsonObject.getString("code").equals("0")) {
|
||||
resultMap.put("code",jsonObject.getString("code"));
|
||||
resultMap.put("code","4");
|
||||
resultMap.put("msg",jsonObject.getString("msg"));
|
||||
return resultMap;
|
||||
}
|
||||
@ -125,20 +125,22 @@ public class OrderService {
|
||||
}
|
||||
|
||||
public int checkNotify(String orderNumber){
|
||||
if(notifyService.findNotifyByOrderNumber(orderNumber) != null)
|
||||
if(notifyService.findNotifyByOrderNumber(orderNumber) != null) {
|
||||
return 1;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Boolean afterPaySucceedUpdateOrderStatus(String outTradeNo,String totalFee){
|
||||
int result = ordersDao.updateOrderStatus(outTradeNo,totalFee);
|
||||
if(result == 1)
|
||||
if(result == 1) {
|
||||
return true;
|
||||
else
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public ResponseDTO<String> cancelOrder(String addOrSaveJson) throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user