|
|
@@ -9,6 +9,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
+import com.cyksj.common.i18n.I18nMessageUtil;
|
|
|
import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.dto.UserSharedDto;
|
|
|
@@ -139,7 +140,7 @@ public class GoodsDonController {
|
|
|
GoodsFrontListView views = beanSearcher.searchFirst(GoodsFrontListView.class, MapUtils.builder().field(GoodsFrontListView::getId, id)
|
|
|
.build());
|
|
|
if (views == null) {
|
|
|
- throw BusinessRuntimeException.getInstance("商品已下架..");
|
|
|
+ throw BusinessRuntimeException.getInstance(I18nMessageUtil.getI18nMsg("sys_error"));
|
|
|
}
|
|
|
|
|
|
views.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, views.getId()).build()));
|
|
|
@@ -310,7 +311,7 @@ public class GoodsDonController {
|
|
|
.orderByDesc(OrderDon::getId)
|
|
|
.last("limit 1"));
|
|
|
if (orderDon == null) {
|
|
|
- notifyMsg.append("点击购买立即上车");
|
|
|
+ notifyMsg.append(I18nMessageUtil.getI18nMsg("order_buy_now_notify"));
|
|
|
return notifyMsg.toString();
|
|
|
}
|
|
|
startTime = orderDon.getPayTime() != null ? orderDon.getPayTime() : orderDon.getCreatedTime();
|
|
|
@@ -319,10 +320,15 @@ public class GoodsDonController {
|
|
|
if (hour == 0) {
|
|
|
long minute = DateUtil.between(startTime, now, DateUnit.MINUTE);
|
|
|
if (minute == 0) {
|
|
|
- notifyMsg.append("1分钟");
|
|
|
+ notifyMsg.append("1");
|
|
|
+ notifyMsg.append(I18nMessageUtil.getI18nMsg("minute"));
|
|
|
} else {
|
|
|
notifyMsg.append(minute);
|
|
|
- notifyMsg.append("分钟");
|
|
|
+ if (minute > 1) {
|
|
|
+ notifyMsg.append(I18nMessageUtil.getI18nMsg("minutes"));
|
|
|
+ } else {
|
|
|
+ notifyMsg.append(I18nMessageUtil.getI18nMsg("minute"));
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
if (hour > 3) {
|
|
|
@@ -331,9 +337,13 @@ public class GoodsDonController {
|
|
|
} else {
|
|
|
notifyMsg.append(hour);
|
|
|
}
|
|
|
- notifyMsg.append("小时");
|
|
|
+ if (hour > 1) {
|
|
|
+ notifyMsg.append(I18nMessageUtil.getI18nMsg("hours"));
|
|
|
+ } else {
|
|
|
+ notifyMsg.append(I18nMessageUtil.getI18nMsg("hour"));
|
|
|
+ }
|
|
|
}
|
|
|
- notifyMsg.append("前有人购买");
|
|
|
+ notifyMsg.append(I18nMessageUtil.getI18nMsg("order_pre_buy_it"));
|
|
|
return notifyMsg.toString();
|
|
|
}
|
|
|
|