|
|
|
@@ -84,7 +84,7 @@ public class WxOrderController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\"}") |
|
|
|
@ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\"}") |
|
|
|
@PostMapping("save") |
|
|
|
public ResultData saveOrder(@RequestBody Map<String, String> paramMap) { |
|
|
|
logger.info("OrderSave: " + paramMap.toString()); |
|
|
|
@@ -92,11 +92,13 @@ public class WxOrderController extends BaseController { |
|
|
|
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
String couponChannelIdStr = paramMap.get("couponChannelId"); |
|
|
|
String couponIdStr = paramMap.get("couponId"); |
|
|
|
String pressStr = paramMap.get("press"); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(couponChannelIdStr)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); |
|
|
|
} |
|
|
|
Long couponChannelId = 0L, couponId = 0L; |
|
|
|
boolean isPress = false; |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(couponChannelIdStr)) { |
|
|
|
try { |
|
|
|
@@ -132,10 +134,18 @@ public class WxOrderController extends BaseController { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId或者couponId不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
if(pressStr != null) { |
|
|
|
try{ |
|
|
|
isPress = Boolean.valueOf(pressStr); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("press转换失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
WxCUser user = getUser(); |
|
|
|
|
|
|
|
try { |
|
|
|
WxOrder order = wxOrderService.saveCouponOrder(user, couponChannelId, couponId); |
|
|
|
WxOrder order = wxOrderService.saveCouponOrder(user, couponChannelId, couponId, isPress); |
|
|
|
return new ResultData(order); |
|
|
|
} catch (MallinkException e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
|