1.使用hutool进行Object to Int格式转换
2.添加部分resultCode
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.lili.timetask.handler.impl.goods;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.lili.modules.goods.mapper.GoodsMapper;
|
||||
@@ -40,7 +41,7 @@ public class GoodsExecute implements EveryDayExecute {
|
||||
.between("create_time", DateUtil.yesterday(), new DateTime()));
|
||||
|
||||
for (Map<String, Object> map : list) {
|
||||
goodsMapper.addGoodsCommentNum(Integer.parseInt(map.get("num").toString()), map.get("goods_id").toString());
|
||||
goodsMapper.addGoodsCommentNum(Convert.toInt(map.get("num").toString()), map.get("goods_id").toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.lili.timetask.handler.impl.view;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.lili.common.cache.Cache;
|
||||
import cn.lili.common.cache.CachePrefix;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
@@ -167,15 +168,15 @@ class PageViewStatistics {
|
||||
//将字符串解析成需要的对象
|
||||
str = str.substring(str.indexOf("}") + 2);
|
||||
String[] dateStr = str.split("-");
|
||||
Integer year = Integer.parseInt(dateStr[0]);
|
||||
Integer month = Integer.parseInt(dateStr[1]);
|
||||
Integer year = Convert.toInt(dateStr[0]);
|
||||
Integer month = Convert.toInt(dateStr[1]);
|
||||
Integer day;
|
||||
//是否有店铺id
|
||||
if (dateStr.length > 3) {
|
||||
day = Integer.parseInt(dateStr[2]);
|
||||
day = Convert.toInt(dateStr[2]);
|
||||
this.storeId = dateStr[3];
|
||||
} else {
|
||||
day = Integer.parseInt(dateStr[2]);
|
||||
day = Convert.toInt(dateStr[2]);
|
||||
}
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.YEAR, year);
|
||||
|
||||
Reference in New Issue
Block a user