记得上下班打卡 | git大法好,push需谨慎

Commit a33dd465 authored by 胡佳晨's avatar 胡佳晨

提交 收货接口

parent 721564f7
......@@ -19,6 +19,8 @@ public interface IGoblinOrderAppService {
ResponseDto<GoblinAppOrderDetailsVo> orderDetails(String orderId,String uid);
ResponseDto<Boolean> getProduce(String orderId,String uid);
ResponseDto<Boolean> applyRefund(GoblinAppOrderRefundParam param);
ResponseDto<List<GoblinBackOrderVo>> refundDetails(String orderId);
......
......@@ -59,6 +59,16 @@ public class GoblinOrderAppController {
return goblinOrderAppService.orderDetails(orderId, uid);
}
@PostMapping("getProduce")
@ApiOperation("已收货")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "订单id", example = "1"),
})
public ResponseDto<Boolean> getProduce(@RequestParam("orderId") @Valid String orderId) {
String uid = CurrentUtil.getCurrentUid();
return goblinOrderAppService.getProduce(orderId, uid);
}
@PostMapping("applyRefund")
@ApiOperation("退款申请")
public ResponseDto<Boolean> applyRefund(@RequestBody GoblinAppOrderRefundParam param) {
......
......@@ -133,6 +133,50 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
return ResponseDto.success(vo);
}
@Override
public ResponseDto<Boolean> getProduce(String orderId, String uid) {
LocalDateTime now = LocalDateTime.now();
LinkedList<String> sqls = CollectionUtil.linkedListString();
sqls.add(SqlMapping.get("goblin_order.store.orderStatus"));
sqls.add(SqlMapping.get("goblin_order.store.orderSkuStatus"));
LinkedList<Object[]> orderStatus = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> orderSkuStatus = CollectionUtil.linkedListObjectArr();
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId);
if (!orderVo.getUserId().equals(uid)) {
return ResponseDto.failure("无权操作");
}
if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_3.getValue()) {
return ResponseDto.failure("不可操作");
}
//订单状态修改
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue());
orderStatus.add(new Object[]{
orderVo.getStatus(), now,
orderVo.getOrderId(), now, now
});
for (String orderSkuId : orderVo.getOrderSkuVoIds()) {
//订单款式状态修改
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId);
orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue());
//redis
redisUtils.setGoblinOrderSku(orderSkuVo.getOrderSkuId(), orderSkuVo);
//mongo
mongoUtils.updateGoblinOrderSkuVo(orderSkuVo.getOrderSkuId(), orderSkuVo);
orderSkuStatus.add(new Object[]{
orderSkuVo.getStatus(), now,
orderSkuVo.getOrderSkuId(), now, now
});
}
//redis
redisUtils.setGoblinOrder(orderId, orderVo);
//mongo
mongoUtils.updateGoblinStoreOrderVo(orderId, orderVo);
//redis
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_USER_ORDER_OPERA.getKey(), SqlMapping.gets(sqls, orderStatus, orderSkuStatus));
return ResponseDto.success(true);
}
@Override
public ResponseDto<Boolean> applyRefund(GoblinAppOrderRefundParam param) {
......@@ -466,7 +510,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
private long getRestTime(GoblinStoreOrderVo orderVo) {
long restTime = 0L;
int time = orderVo.getPayCountdownMinute();
if (orderVo.getMarketType()!=null&&orderVo.getMarketType().equals(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue())) {
if (orderVo.getMarketType() != null && orderVo.getMarketType().equals(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue())) {
time = 0;
}
if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_0.getValue()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment