| @@ -12,6 +12,7 @@ import com.iformall.service.WxCouponService; | |||||
| import com.iformall.service.WxOrderPressService; | import com.iformall.service.WxOrderPressService; | ||||
| import com.iformall.service.WxOrderService; | import com.iformall.service.WxOrderService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -108,23 +109,23 @@ public class WxPressOrderController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation(value = "砍价状态(1:我发起的砍价,2:未参与的砍价, 3:已参与的砍价)", notes = "{\"orderId\":\"String\"}") | |||||
| @ApiOperation(value = "砍价状态(1:我发起的砍价,2:未参与的砍价, 3:已参与的砍价)", notes = "") | |||||
| @GetMapping("getPressOrderStatus") | @GetMapping("getPressOrderStatus") | ||||
| public ResultData getPressOrderStatus(@RequestBody Map<String, String> paramMap) { | |||||
| @ApiImplicitParam(name = "orderId", value = "orderId", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData getPressOrderStatus(String orderId) { | |||||
| Map ret = new HashMap(); | Map ret = new HashMap(); | ||||
| String orderIdStr = paramMap.get("orderId"); | |||||
| if (StringUtils.isBlank(orderIdStr)) { | |||||
| if (StringUtils.isBlank(orderId)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | ||||
| } | } | ||||
| Long orderId = 0L; | |||||
| Long orderIdL = 0L; | |||||
| try { | try { | ||||
| orderId = Long.valueOf(orderIdStr); | |||||
| orderIdL = Long.valueOf(orderId); | |||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("orderId convert error, " + orderIdStr + ", e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "orderId: " + orderIdStr + ", e:" + e.getMessage()); | |||||
| logger.error("orderId convert error, " + orderId + ", e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "orderId: " + orderId + ", e:" + e.getMessage()); | |||||
| } | } | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| WxOrder order = wxOrderService.getById(orderId); | |||||
| WxOrder order = wxOrderService.getById(orderIdL); | |||||
| if(order == null) { | if(order == null) { | ||||
| logger.error("订单不存在:" + orderId); | logger.error("订单不存在:" + orderId); | ||||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | ||||