|
|
@@ -3,9 +3,11 @@ package com.unissoft.interaction.service.impl;
|
|
3
|
3
|
import com.alibaba.fastjson.JSONArray;
|
|
4
|
4
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
5
|
5
|
import com.unissoft.interaction.algorithm.CylinderAlg;
|
|
|
6
|
+import com.unissoft.interaction.entity.DensityData;
|
|
6
|
7
|
import com.unissoft.interaction.entity.ReMsg;
|
|
7
|
8
|
import com.unissoft.interaction.entity.STask;
|
|
8
|
9
|
import com.unissoft.interaction.entity.TeData;
|
|
|
10
|
+import com.unissoft.interaction.mapper.DensityDataMapper;
|
|
9
|
11
|
import com.unissoft.interaction.mapper.ReMsgMapper;
|
|
10
|
12
|
import com.unissoft.interaction.mapper.STaskMapper;
|
|
11
|
13
|
import com.unissoft.interaction.mapper.TeDataMapper;
|
|
|
@@ -47,16 +49,6 @@ public class TeDataServiceImpl implements TeDataService {
|
|
47
|
49
|
private TeDataMapper teDataMapper;
|
|
48
|
50
|
private ReMsgMapper reMsgMapper;
|
|
49
|
51
|
|
|
50
|
|
- @Resource
|
|
51
|
|
- private NBasicEdgeMapper nBasicEdgeMapper;
|
|
52
|
|
- @Resource
|
|
53
|
|
- private PointDataMapper pointDataMapper;
|
|
54
|
|
- @Resource
|
|
55
|
|
- private HardwareParameterMapper hardwareParameterMapper;
|
|
56
|
|
- @Resource
|
|
57
|
|
- private OrgInfoMapper orgInfoMapper;
|
|
58
|
|
-
|
|
59
|
|
-
|
|
60
|
52
|
@Autowired
|
|
61
|
53
|
public void setsTaskMapper(STaskMapper sTaskMapper) {
|
|
62
|
54
|
this.sTaskMapper = sTaskMapper;
|
|
|
@@ -71,6 +63,19 @@ public class TeDataServiceImpl implements TeDataService {
|
|
71
|
63
|
public void setReMsgMapper(ReMsgMapper reMsgMapper) {
|
|
72
|
64
|
this.reMsgMapper = reMsgMapper;
|
|
73
|
65
|
}
|
|
|
66
|
+
|
|
|
67
|
+
|
|
|
68
|
+ @Resource
|
|
|
69
|
+ private NBasicEdgeMapper nBasicEdgeMapper;
|
|
|
70
|
+ @Resource
|
|
|
71
|
+ private PointDataMapper pointDataMapper;
|
|
|
72
|
+ @Resource
|
|
|
73
|
+ private HardwareParameterMapper hardwareParameterMapper;
|
|
|
74
|
+ @Resource
|
|
|
75
|
+ private OrgInfoMapper orgInfoMapper;
|
|
|
76
|
+ @Resource
|
|
|
77
|
+ private DensityDataMapper densityDataMapper;
|
|
|
78
|
+
|
|
74
|
79
|
|
|
75
|
80
|
/**
|
|
76
|
81
|
* todo-----------暂时不用
|
|
|
@@ -288,16 +293,24 @@ public class TeDataServiceImpl implements TeDataService {
|
|
288
|
293
|
*/
|
|
289
|
294
|
public void addNBasicEdge(double lkVolume,String taskId){
|
|
290
|
295
|
NBasicEdge nBasicEdge = new NBasicEdge();
|
|
291
|
|
- String density = "500"; //密度 千克/立方米
|
|
|
296
|
+
|
|
|
297
|
+ String houseId = taskId.split(",")[0];//仓房id
|
|
|
298
|
+
|
|
|
299
|
+ //获取密度
|
|
|
300
|
+ QueryWrapper<DensityData> densityQueryWrapper = new QueryWrapper<>();
|
|
|
301
|
+ List<DensityData> densityDataList = null;
|
|
|
302
|
+ densityQueryWrapper.eq("house_id", houseId);
|
|
|
303
|
+ densityDataList = densityDataMapper.selectList(densityQueryWrapper);
|
|
|
304
|
+ String density = "0"; //密度 千克/立方米
|
|
|
305
|
+ if(densityDataList.size()>0){
|
|
|
306
|
+ density = densityDataList.get(0).getDensity();
|
|
|
307
|
+ }
|
|
292
|
308
|
//质量
|
|
293
|
309
|
BigDecimal big_density = new BigDecimal(density);
|
|
294
|
310
|
BigDecimal big_lkVolume = new BigDecimal(lkVolume); //保留两位小数的体积
|
|
295
|
311
|
BigDecimal quality = big_density.multiply(big_lkVolume).divide(new BigDecimal(1000));
|
|
296
|
312
|
nBasicEdge.setLkWeight(Double.parseDouble(quality+""));//单位 吨
|
|
297
|
313
|
|
|
298
|
|
- /*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
299
|
|
- Date beginTime = sdf.parse(startTime);*/
|
|
300
|
|
-
|
|
301
|
314
|
QueryWrapper<TeData> queryWrapper = new QueryWrapper<>();
|
|
302
|
315
|
List<TeData> teDataList = null;
|
|
303
|
316
|
queryWrapper.eq("taskID", taskId);
|
|
|
@@ -308,7 +321,6 @@ public class TeDataServiceImpl implements TeDataService {
|
|
308
|
321
|
}
|
|
309
|
322
|
|
|
310
|
323
|
|
|
311
|
|
- String houseId = taskId.split(",")[0];//仓房id
|
|
312
|
324
|
//获取仓房信息
|
|
313
|
325
|
OrgInfo orgInfoHouse = orgInfoMapper.selectById(Integer.parseInt(houseId));
|
|
314
|
326
|
|
|
|
@@ -323,11 +335,11 @@ public class TeDataServiceImpl implements TeDataService {
|
|
323
|
335
|
|
|
324
|
336
|
|
|
325
|
337
|
//取上次的数据 如果大于上次的数据 则入库 否则出库
|
|
326
|
|
- QueryWrapper<NBasicEdge> queryWrapper1 = new QueryWrapper<>();
|
|
327
|
|
- queryWrapper1.eq("fk", orgInfo.getId());
|
|
328
|
|
- queryWrapper1.orderByDesc("id");
|
|
|
338
|
+ QueryWrapper<NBasicEdge> nQueryWrapper = new QueryWrapper<>();
|
|
|
339
|
+ nQueryWrapper.eq("fk", orgInfo.getId());
|
|
|
340
|
+ nQueryWrapper.orderByDesc("id");
|
|
329
|
341
|
// 分页对象
|
|
330
|
|
- List<NBasicEdge> nList = nBasicEdgeMapper.selectList(queryWrapper1);
|
|
|
342
|
+ List<NBasicEdge> nList = nBasicEdgeMapper.selectList(nQueryWrapper);
|
|
331
|
343
|
double v = 0 ;
|
|
332
|
344
|
if(nList.size()>0){
|
|
333
|
345
|
v =Double.parseDouble(nList.get(0).getLkVolume());
|