|
@@ -2,6 +2,7 @@ package com.caimei.www.service.page.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.aliyun.oss.common.utils.StringUtils;
|
|
import com.caimei.www.mapper.BaikeDao;
|
|
import com.caimei.www.mapper.BaikeDao;
|
|
import com.caimei.www.mapper.ProductDao;
|
|
import com.caimei.www.mapper.ProductDao;
|
|
import com.caimei.www.pojo.JsonModel;
|
|
import com.caimei.www.pojo.JsonModel;
|
|
@@ -228,10 +229,32 @@ public class ProductServiceImpl implements ProductService {
|
|
// 问题列表
|
|
// 问题列表
|
|
List<BaikeProductQuestion> questionList = baikeDao.findQuestionList(productId);
|
|
List<BaikeProductQuestion> questionList = baikeDao.findQuestionList(productId);
|
|
baikeProduct.setQuestionList(questionList);
|
|
baikeProduct.setQuestionList(questionList);
|
|
|
|
+ // 格式化时间
|
|
|
|
+ String marketTime = baikeProduct.getMarketTime();
|
|
|
|
+ String nmpaTime = baikeProduct.getNmpaTime();
|
|
|
|
+ baikeProduct.setMarketTime(formatTime(marketTime));
|
|
|
|
+ baikeProduct.setNmpaTime(formatTime(nmpaTime));
|
|
}
|
|
}
|
|
return baikeProduct;
|
|
return baikeProduct;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private String formatTime(String time) {
|
|
|
|
+ String timeFormat = null;
|
|
|
|
+ if (!StringUtils.isNullOrEmpty(time)) {
|
|
|
|
+ String[] split = time.split("-");
|
|
|
|
+ if (split.length > 0) {
|
|
|
|
+ timeFormat = split[0] + "年";
|
|
|
|
+ if (split.length > 1) {
|
|
|
|
+ timeFormat += split[1] + "月";
|
|
|
|
+ if (split.length > 2) {
|
|
|
|
+ timeFormat += split[2] + "日";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return timeFormat;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public JsonModel encyclopediaPv(Integer id) {
|
|
public JsonModel encyclopediaPv(Integer id) {
|
|
baikeDao.encyclopediaPv(id);
|
|
baikeDao.encyclopediaPv(id);
|