提交 | 用户 | 时间
|
b368e6
|
1 |
package com.iailab.module.model.mcs.pre.service.impl; |
潘 |
2 |
|
|
3 |
import com.alibaba.fastjson.JSONArray; |
|
4 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
5 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
|
6 |
import com.iailab.module.model.mcs.pre.dao.MmItemResultJsonDao; |
|
7 |
import com.iailab.module.model.mcs.pre.entity.MmItemResultJsonEntity; |
|
8 |
import com.iailab.module.model.mcs.pre.service.MmItemResultJsonService; |
|
9 |
import org.apache.commons.lang3.StringUtils; |
|
10 |
import org.springframework.stereotype.Service; |
|
11 |
|
|
12 |
import java.util.ArrayList; |
|
13 |
import java.util.Date; |
|
14 |
import java.util.List; |
|
15 |
|
|
16 |
/** |
|
17 |
* @author PanZhibao |
|
18 |
* @Description |
|
19 |
* @createTime 2024年11月14日 |
|
20 |
*/ |
|
21 |
@Service |
|
22 |
public class MmItemResultJsonServiceImpl extends BaseServiceImpl<MmItemResultJsonDao, MmItemResultJsonEntity> |
|
23 |
implements MmItemResultJsonService { |
|
24 |
|
|
25 |
@Override |
|
26 |
public List<Object[]> getData(String outputId, Date predictTime) { |
|
27 |
List<Object[]> result = new ArrayList<>(); |
|
28 |
QueryWrapper<MmItemResultJsonEntity> wrapper = new QueryWrapper<>(); |
|
29 |
wrapper.eq("outputid", outputId) |
|
30 |
.eq("predicttime", predictTime); |
|
31 |
MmItemResultJsonEntity data = baseDao.selectOne(wrapper); |
|
32 |
if (data == null || StringUtils.isBlank(data.getJsonvalue())) { |
|
33 |
return result; |
|
34 |
} |
|
35 |
result = JSONArray.parseArray(data.getJsonvalue(), Object[].class); |
|
36 |
result.forEach(item -> { |
|
37 |
item[0] = new Date(Long.parseLong(item[0].toString())); |
|
38 |
}); |
|
39 |
return result; |
|
40 |
} |
|
41 |
} |