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

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

提交 发货接口

parent 91ec63e5
......@@ -32,5 +32,7 @@ public interface IGoblinStoreOrderService {
ResponseDto<Boolean> refundOrderSku(String orderId, String orderSkuId, BigDecimal price);
ResponseDto<Boolean> express(String orderId, String mailNo);
String refundSyncOrder(RefundCallbackParam refundCallbackParam);
}
......@@ -127,13 +127,15 @@ public class GoblinStoreOrderController {
public String refundSyncOrder(RefundCallbackParam refundCallbackParam) {
return goblinStoreOrderService.refundSyncOrder(refundCallbackParam);
}
// @ApiOperation(value = "发货")
// @ApiImplicitParams({
// @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderId", value = "订单id"),
// @ApiImplicitParam(type = "form", required = false, dataType = "BigDecimal", name = "price", value = "退款金额"),
// })
// @GetMapping(value = "refund")
// public ResponseDto<Boolean> express(@RequestParam(value = "orderId", required = true) @Valid String orderId,
// return ResponseDto.success();
// }
@ApiOperation(value = "发货")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderId", value = "订单id"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "mailNo", value = "快递单号"),
})
@GetMapping(value = "express")
public ResponseDto<Boolean> express(@RequestParam(value = "orderId", required = true) @Valid String orderId,
@RequestParam(value = "mailNo", required = true) @Valid String mailNo) {
return ResponseDto.success();
}
}
......@@ -20,6 +20,7 @@ import com.liquidnet.service.goblin.util.ObjectUtil;
import com.liquidnet.service.goblin.util.QueueUtils;
import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -205,7 +206,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
queueUtils.sendMsgByRedis(
MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(),
SqlMapping.get("goblin_order.store.orderExpressPrice",
orderVo.getPriceTotal(),orderVo.getPriceModify(), orderVo.getPriceVoucher(), orderVo.getPriceActual(), orderVo.getPriceExpress(), now,
orderVo.getPriceTotal(), orderVo.getPriceModify(), orderVo.getPriceVoucher(), orderVo.getPriceActual(), orderVo.getPriceExpress(), now,
orderId, now, now
)
);
......@@ -416,6 +417,51 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
return ResponseDto.failure("退款失败:" + message);
}
@Override
public ResponseDto<Boolean> express(String orderId, String mailNo) {
String uid = CurrentUtil.getCurrentUid();
LocalDateTime now = LocalDateTime.now();
String nowStr = DateUtil.getNowTime();
GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVoByUid(uid);
if (storeInfoVo == null) {
return ResponseDto.failure("无法查看");
}
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId);
if (orderVo == null || !orderVo.getStoreId().equals(storeInfoVo.getStoreId())) {
return ResponseDto.failure("无法查看");
}
if (orderVo.getStatus() != GoblinStatusConst.Status.ORDER_STATUS_2.getValue()) {
return ResponseDto.failure("无法发货");
}
orderVo.setMailNo(mailNo);
orderVo.setDeliveryTime(nowStr);
orderVo.setLogisticsCompany("松鼠德邦");
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_3.getValue());
GoblinOrderOperationLog log = initLog(orderId, uid, now);
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_13.getValue());
log.setRemark("发货:orderId=[" + orderId + "],mailNo=[" + mailNo + "]");
//redis
redisUtils.setGoblinOrder(orderId, orderVo);
//mongo
mongoUtils.updateGoblinStoreOrderVo(orderId, orderVo);
//mysql
queueUtils.sendMsgByRedis(
MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(),
SqlMapping.get("goblin_order.store.express",
orderVo.getMailNo(), orderVo.getDeliveryTime(), orderVo.getLogisticsCompany(), orderVo.getStatus(), now, orderId, now, now
)
);
//添加日志
queueUtils.sendMsgByRedis(
MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(),
SqlMapping.get("goblin_order.store.log",
log.getOrderLogId(), log.getOrderId(), log.getType(), log.getRemark(), log.getOperationName(), now
)
);
return ResponseDto.success();
}
@Override
public String refundSyncOrder(RefundCallbackParam refundCallbackParam) {
LocalDateTime now = LocalDateTime.now();
......
......@@ -64,7 +64,8 @@ goblin_order.pay.again=UPDATE goblin_store_order SET pay_type = ? ,device_from =
#---- 订单绑定[正在下单]
goblin_order.zhengzai.bind=UPDATE goblin_store_order SET uid = ? ,updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
#---- 商铺订单操作
goblin_order.store.cancel=UPDATE goblin_store_order SET status = ? ,cancel_time = ? , cancel_reason = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.cancel=UPDATE goblin_store_order SET mailNo = ? ,delivery_time = ? , logistics_company = ? , status = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.express=UPDATE goblin_store_order SET status = ? ,cancel_time = ? , cancel_reason = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.address=UPDATE goblin_order_attr SET express_contacts = ? ,express_address_detail = ? , express_phone = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.orderPrice=UPDATE goblin_store_order SET price_modify = ? ,price_voucher = ? , price_actual = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.orderSkuPrice=UPDATE goblin_order_sku SET price_modify = ? ,price_voucher = ? , sku_price_actual = ? , updated_at = ? WHERE order_sku_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
......
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