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

Commit ccfaaf20 authored by wangyifan's avatar wangyifan

修改商品可退款逻辑

parent 5fc81c72
......@@ -104,7 +104,7 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable {
private Integer payCountdownMinute;
@ApiModelProperty(value = " 快递单号[废弃]")
private String mailNo;
@ApiModelProperty(value = " 发货时间")
@ApiModelProperty(value = "订单完成时间")
private String deliveryTime;
@ApiModelProperty(value = " 物流公司姓名[废弃]")
private String logisticsCompany;
......
......@@ -33,8 +33,7 @@ import java.util.List;
import java.util.Objects;
import java.util.stream.IntStream;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
import static com.liquidnet.commons.lang.util.DateUtil.DTFYMDHMS;
import static com.liquidnet.commons.lang.util.DateUtil.*;
@Service
......@@ -215,6 +214,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
}
//订单状态修改
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue());
orderVo.setDeliveryTime(getNowTime()); // 设置收货时间
orderStatus.add(new Object[]{
orderVo.getStatus(), orderVo.getZhengzaiStatus(), now,
orderVo.getOrderId(), now, now
......@@ -774,19 +774,30 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
//获取 可申请退款时间
private LocalDateTime getCanRefundTime(GoblinStoreOrderVo orderVo) {
LocalDateTime canRefundTimeDateTime = null;
if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_2.getValue() || orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue()) {
if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_2.getValue()) {
try {
// 允许退款修改成发货时间+14天
// canRefundTimeDateTime = LocalDateTime.parse(orderVo.getPayTime(), DTF_YMD_HMS).plusDays(7);
// if (StringUtil.isBlank(orderVo.getDeliveryTime())) {
// canRefundTimeDateTime = LocalDateTime.parse(orderVo.getPayTime(), DTF_YMD_HMS).plusDays(7);
// }else {
// canRefundTimeDateTime = LocalDateTime.parse(orderVo.getDeliveryTime(), DTF_YMD_HMS).plusDays(14);
// }
// 未发货商品 可直接退款
canRefundTimeDateTime = LocalDateTime.now().plusDays(7);
// log.info("[getCanRefundTime] 未发货商品可退款时间: {}", canRefundTimeDateTime);
} catch (Exception e) {
e.printStackTrace();
}
} else if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue()) {
if (StringUtil.isBlank(orderVo.getDeliveryTime())) {
canRefundTimeDateTime = LocalDateTime.parse(orderVo.getPayTime(), DTF_YMD_HMS).plusDays(7);
}else {
canRefundTimeDateTime = LocalDateTime.parse(orderVo.getDeliveryTime(), DTF_YMD_HMS).plusDays(14);
}
} catch (Exception e) {
e.printStackTrace();
canRefundTimeDateTime = LocalDateTime.parse(orderVo.getDeliveryTime(), DTF_YMD_HMS).plusDays(7);
}
}
log.info("[getCanRefundTime] 订单可退款时间: orderId: {}, orderStatus: {}, canRefundTimeDateTime: {}",
orderVo.getOrderId(), orderVo.getStatus(), canRefundTimeDateTime);
return canRefundTimeDateTime;
}
......
......@@ -618,7 +618,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
LinkedList<Object[]> sqlsOrder = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> sqlsOrderSku = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> sqlsMail = CollectionUtil.linkedListObjectArr();
sqls.add(SqlMapping.get("goblin_order.store.expressTime"));
sqls.add(SqlMapping.get("goblin_order.store.express"));
sqls.add(SqlMapping.get("goblin_order.store.orderSkuStatus"));
sqls.add(SqlMapping.get("goblin_order.mail"));
// GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVoByUid(uid);
......@@ -701,15 +701,14 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_13.getValue());
log.setRemark("发货:orderId=[" + orderId + "],orderSkuId=[" + StringUtils.join(skuIds, ",") + "],mailNo=[" + mailNo + "]");
// 发货时间
orderVo.setDeliveryTime(nowStr);
//redis
redisUtils.setGoblinOrder(orderId, orderVo);
//mongo
mongoUtils.updateGoblinStoreOrderVo(orderId, orderVo);
//mysql
sqlsOrder.add(new Object[]{
orderVo.getStatus(), now, now, orderId, now, now
orderVo.getStatus(), now, orderId, now, now
});
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(),
SqlMapping.gets(sqls, sqlsOrder, sqlsOrderSku, sqlsMail));
......
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