Authored by mali

寄存订单支付回调

  1 +package com.yohoufo.common.utils;
  2 +
  3 +import org.slf4j.helpers.MessageFormatter;
  4 +
  5 +/**
  6 + * Created by li.ma on 2019/7/9.
  7 + */
  8 +public class StringUtil {
  9 + public static String getReplacedContent(String content ,Object... params) {
  10 + return MessageFormatter.arrayFormat(content, params).getMessage();
  11 + }
  12 +}
1 package com.yohoufo.dal.order.model; 1 package com.yohoufo.dal.order.model;
2 2
3 -import lombok.Builder;  
4 -import lombok.Data;  
5 -import lombok.NoArgsConstructor;  
6 -import lombok.ToString; 3 +import lombok.*;
7 4
8 import java.math.BigDecimal; 5 import java.math.BigDecimal;
9 6
10 @ToString 7 @ToString
11 @Builder 8 @Builder
12 @NoArgsConstructor 9 @NoArgsConstructor
  10 +@AllArgsConstructor
13 @Data 11 @Data
14 public class DepositOrder { 12 public class DepositOrder {
15 private Integer id; 13 private Integer id;
@@ -14,6 +14,7 @@ import com.yohobuy.ufo.model.order.resp.DepositOrderComputeResp; @@ -14,6 +14,7 @@ import com.yohobuy.ufo.model.order.resp.DepositOrderComputeResp;
14 import com.yohobuy.ufo.model.order.vo.AddressInfo; 14 import com.yohobuy.ufo.model.order.vo.AddressInfo;
15 import com.yohoufo.common.exception.UfoServiceException; 15 import com.yohoufo.common.exception.UfoServiceException;
16 import com.yohoufo.common.utils.DateUtil; 16 import com.yohoufo.common.utils.DateUtil;
  17 +import com.yohoufo.common.utils.StringUtil;
17 import com.yohoufo.dal.order.BuyerOrderGoodsMapper; 18 import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
18 import com.yohoufo.dal.order.DepositOrderMapper; 19 import com.yohoufo.dal.order.DepositOrderMapper;
19 import com.yohoufo.dal.order.SellerOrderGoodsMapper; 20 import com.yohoufo.dal.order.SellerOrderGoodsMapper;
@@ -76,11 +77,7 @@ public class DepositOrderService { @@ -76,11 +77,7 @@ public class DepositOrderService {
76 StorageDeposit storageDeposit = storageDepositMapper.selectByDepositCode(req.getUid(), req.getDepositCode()); 77 StorageDeposit storageDeposit = storageDepositMapper.selectByDepositCode(req.getUid(), req.getDepositCode());
77 // TODO 不存在的时候有异常 78 // TODO 不存在的时候有异常
78 79
79 - Integer depositEndTime = storageDeposit.getDepositEndTime();  
80 - int depositRemainDay = 45;  
81 - if (null != depositEndTime) {  
82 - depositRemainDay = depositService.getRemainDay(req.getUid(), req.getDepositCode());  
83 - } 80 + int depositRemainDay = depositService.getRemainDay(req.getUid(), req.getDepositCode()); // 还可存放多久 单位天
84 81
85 Integer skup = storageDeposit.getSkup(); 82 Integer skup = storageDeposit.getSkup();
86 Long orderCode = storageDeposit.getOrderCode(); 83 Long orderCode = storageDeposit.getOrderCode();
@@ -127,7 +124,7 @@ public class DepositOrderService { @@ -127,7 +124,7 @@ public class DepositOrderService {
127 } 124 }
128 125
129 private String getReplacedContent(String content ,Object... params) { 126 private String getReplacedContent(String content ,Object... params) {
130 - return MessageFormatter.arrayFormat(content, params).getMessage(); 127 + return StringUtil.getReplacedContent(content, params);
131 } 128 }
132 129
133 public void updateByOrderCode(DepositOrder order) { 130 public void updateByOrderCode(DepositOrder order) {