| @@ -271,7 +271,7 @@ public class WxOrderController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @ApiOperation("砍价订单-分页列表接口") | |||||
| @ApiOperation("我的砍价-分页列表接口") | |||||
| @GetMapping("pressOrderList") | @GetMapping("pressOrderList") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @@ -39,23 +39,12 @@ public class WxPressOrderController extends BaseController { | |||||
| WxOrderPressService wxOrderPressService; | WxOrderPressService wxOrderPressService; | ||||
| // 砍价列表 - /api/wxCouponChannel/list | // 砍价列表 - /api/wxCouponChannel/list | ||||
| // 砍价订单 - /api/order/pressOrderList | |||||
| @ApiOperation("我的砍价-分页列表接口") | |||||
| @GetMapping("pressCouponList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData pressCouponList(Integer pageNum, Integer pageSize) { | |||||
| WxCUser user = getUser(); | |||||
| return new ResultData(); | |||||
| } | |||||
| // 我的砍价 - /api/order/pressOrderList | |||||
| // 砍价订单详情 - /api/order/pressOrderDetail | |||||
| // 发起砍价 - /api/order/save | // 发起砍价 - /api/order/save | ||||
| // 砍价券详情 | |||||
| // 券包详情 | |||||
| // 砍价券详情 - /api/order/pressOrderDetail | |||||
| @ApiOperation("参与砍价") | @ApiOperation("参与砍价") | ||||
| @PostMapping("pressOrderJoin") | @PostMapping("pressOrderJoin") | ||||
| @@ -88,5 +77,7 @@ public class WxPressOrderController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| /// 砍价 - 统计 相关 ?????? | |||||
| } | } | ||||
| @@ -52,7 +52,7 @@ public class OrderExpiringSchedule { | |||||
| dateMap.put("endDate", curDate); | dateMap.put("endDate", curDate); | ||||
| List<WxOrder> orderPresss = wxOrderMapper.findListOfUnpaidPressOrderByDate(dateMap); | List<WxOrder> orderPresss = wxOrderMapper.findListOfUnpaidPressOrderByDate(dateMap); | ||||
| orderPresss.parallelStream().forEach( o -> { | orderPresss.parallelStream().forEach( o -> { | ||||
| orderExpired(o); | |||||
| orderPressExpired(o); | |||||
| }); | }); | ||||
| } | } | ||||
| @@ -69,4 +69,14 @@ public class OrderExpiringSchedule { | |||||
| + " create at " + order.getCreateDate() +"\n" | + " create at " + order.getCreateDate() +"\n" | ||||
| + " expired at " + new Date()); | + " expired at " + new Date()); | ||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| public void orderPressExpired(WxOrder order) { | |||||
| Date curDate = new Date(); | |||||
| order.setUpdateDate(curDate); | |||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PRESS_OVERTIME.getCode()); | |||||
| wxOrderMapper.updateByPrimaryKeySelective(order); | |||||
| logger.info("\n砍价订单: " + order.getId() + " create at " + order.getCreateDate() + " expired at " + curDate); | |||||
| } | |||||
| } | } | ||||
| @@ -73,8 +73,8 @@ public class WxOrder implements Serializable { | |||||
| /**支付时间**/ | /**支付时间**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | ||||
| private Date paymentTime; | private Date paymentTime; | ||||
| /**订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款;4-退款失败; 砍价:5-砍价中,6-砍价完成**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款; 4-退款失败; 砍价:5-砍价中; 6-砍价完成",name="orderStatus") | |||||
| /**订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-待退款;4-已退款,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款; 4-退款失败,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败",name="orderStatus") | |||||
| private Integer orderStatus; | private Integer orderStatus; | ||||
| /**创建时间/砍价开始时间**/ | /**创建时间/砍价开始时间**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间/砍价开始时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间/砍价开始时间",name="createDate") | ||||
| @@ -12,7 +12,10 @@ public enum EnumOrderStatus { | |||||
| ORDER_STATUS_OVERTIME_CANCEL(2, "已取消"), | ORDER_STATUS_OVERTIME_CANCEL(2, "已取消"), | ||||
| ORDER_STATUS_PENDING_REFUND(3, "待退款"), | ORDER_STATUS_PENDING_REFUND(3, "待退款"), | ||||
| ORDER_STATUS_REFUND_SUCCESS(4,"已退款"), | ORDER_STATUS_REFUND_SUCCESS(4,"已退款"), | ||||
| ORDER_STATUS_REFUND_FAILD(5, "退款失败") | |||||
| ORDER_STATUS_REFUND_FAILD(5, "退款失败"), | |||||
| ORDER_STATUS_PRESSING(6, "砍价中"), | |||||
| ORDER_STATUS_PRESS_COMPLETE(7, "砍价完成"), | |||||
| ORDER_STATUS_PRESS_OVERTIME(8, "砍价已过期"), | |||||
| ; | ; | ||||
| public static EnumOrderStatus getEnum(Integer code) { | public static EnumOrderStatus getEnum(Integer code) { | ||||
| @@ -8,6 +8,7 @@ import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxOrderPress; | import com.iformall.domain.po.WxOrderPress; | ||||
| import com.iformall.enums.EnumOrderStatus; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxOrderMapper; | import com.iformall.mapper.WxOrderMapper; | ||||
| import com.iformall.mapper.WxOrderPressMapper; | import com.iformall.mapper.WxOrderPressMapper; | ||||
| @@ -81,10 +82,16 @@ public class WxOrderPressServiceImpl implements WxOrderPressService { | |||||
| } | } | ||||
| // 更新砍价信息 | // 更新砍价信息 | ||||
| Integer index = order.getPressCurrentNum() + 1; | |||||
| WxOrder orderUpdatePress = new WxOrder(); | WxOrder orderUpdatePress = new WxOrder(); | ||||
| orderUpdatePress.setId(order.getId()); | orderUpdatePress.setId(order.getId()); | ||||
| orderUpdatePress.setPressCurrentNum(order.getPressCurrentNum() + 1); | |||||
| orderUpdatePress.setPressCurrentNum(index); | |||||
| orderUpdatePress.setPressCurrentValue(left_total - orderPress.getPressValue()); | orderUpdatePress.setPressCurrentValue(left_total - orderPress.getPressValue()); | ||||
| if(index.equals(coupon.getPressLimitNum())) { | |||||
| orderUpdatePress.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PRESS_COMPLETE.getCode()); | |||||
| } else { | |||||
| orderUpdatePress.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PRESSING.getCode()); | |||||
| } | |||||
| orderUpdatePress.setUpdateDate(new Date()); | orderUpdatePress.setUpdateDate(new Date()); | ||||
| try { | try { | ||||
| // 保存订单 | // 保存订单 | ||||
| @@ -422,6 +422,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| orderUpdatePress.setId(record.getId()); | orderUpdatePress.setId(record.getId()); | ||||
| orderUpdatePress.setPressCurrentNum(1); | orderUpdatePress.setPressCurrentNum(1); | ||||
| orderUpdatePress.setPressCurrentValue(left_total - orderPress.getPressValue()); | orderUpdatePress.setPressCurrentValue(left_total - orderPress.getPressValue()); | ||||
| orderUpdatePress.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PRESSING.getCode()); | |||||
| orderUpdatePress.setUpdateDate(new Date()); | orderUpdatePress.setUpdateDate(new Date()); | ||||
| try { | try { | ||||
| // 保存订单 | // 保存订单 | ||||