Commit 2d985a79 by 赵剑炜

Merge branch 'develop' of http://gitlab.sothing.top/843502640/jyzb_platformV2 into develop-zhaojw

parents 5894695d 9c9ffee4
......@@ -1436,3 +1436,11 @@ Caused by: java.sql.SQLSyntaxErrorException: Unknown column 't2.photo' in 'field
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)
... 93 common frames omitted
2024-01-23 16:39:09.333 ERROR 8168 --- [main] easy-es : Easy-Es supported elasticsearch and restHighLevelClient jar version is:7.14.0 ,Please resolve the dependency conflict!
2024-01-23 16:39:41.587 ERROR 8168 --- [http-nio-10030-exec-1] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-01-23 17:07:30.592 ERROR 8168 --- [http-nio-10030-exec-10] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-01-23 17:12:44.053 ERROR 3756 --- [main] easy-es : Easy-Es supported elasticsearch and restHighLevelClient jar version is:7.14.0 ,Please resolve the dependency conflict!
2024-01-23 17:14:17.017 ERROR 3756 --- [http-nio-10030-exec-1] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-01-23 17:31:54.876 ERROR 24652 --- [main] easy-es : Easy-Es supported elasticsearch and restHighLevelClient jar version is:7.14.0 ,Please resolve the dependency conflict!
2024-01-23 17:33:03.451 ERROR 24652 --- [http-nio-10030-exec-1] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-01-23 20:01:42.541 ERROR 8124 --- [main] easy-es : Easy-Es supported elasticsearch and restHighLevelClient jar version is:7.14.0 ,Please resolve the dependency conflict!
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -32,7 +32,7 @@ public class TemperatureRedisCache extends AbstractRedisCache<Object> {
data.setWarehouseName(warehouseName);
// String key = warehouseId;
// Long size = getRedisTemplate().opsForZSet().size(key);
getRedisTemplate().opsForZSet().add(warehouseId, data, timestamp);
getRedisTemplate().opsForZSet().add("WarehouseDev:"+warehouseId, data, timestamp);
put(warehouseId, data);
}
public List<Object> getDataByTimestampRange(String warehouseId, long startTimestamp, long endTimestamp) {
......
......@@ -220,6 +220,8 @@ public class InventorySummary implements Serializable {
@TableField(exist = false)
private String sizePhoto;
@TableField(exist = false)
private String typePhoto;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -71,6 +71,9 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
@Resource
private EquipmentCountSummaryMapper equipmentCountSummaryMapper;
@Resource
private EquipmentTypeService equipmentTypeService;
@Override
......@@ -101,23 +104,24 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
LambdaQueryWrapper<InventorySummary> wp = createWrapper(req);//取出仓库中总数并计算
Page<InventorySummary> page = page(PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()), wp);
List<InventorySummary> records = page.getRecords();
LambdaQueryWrapper<EquipmentSize> wrapper = new LambdaQueryWrapper<>();
Map<String,String> map=new HashMap<>();
LambdaQueryWrapper<EquipmentSize> sizeWrapper = new LambdaQueryWrapper<>();
//将size表中的photo取出来,给前端显示
Map<String,String> sizeMap=new HashMap<>();
for (InventorySummary is:records) {
String key=is.getTypeId()+"_"+is.getSizeId();
if (!map.containsKey(key)){
map.put(key,"1");
if (!sizeMap.containsKey(key)){
sizeMap.put(key,"1");
}
}
// 使用 keySet 遍历
//取出map中的所有进行遍历
for (String key : map.keySet()) {
for (String key : sizeMap.keySet()) {
String[] s = key.split("_");
String typeId=s[0];
String sizeId=s[1];
wrapper.or().eq(EquipmentSize::getTypeId,typeId).eq(EquipmentSize::getId,sizeId);
sizeWrapper.or().eq(EquipmentSize::getTypeId,typeId).eq(EquipmentSize::getId,sizeId);
}
List<EquipmentSize> equipmentSizeList = equipmentSizeService.list(wrapper);
List<EquipmentSize> equipmentSizeList = equipmentSizeService.list(sizeWrapper);
for (InventorySummary is:records) {
for (EquipmentSize size:equipmentSizeList) {
if (is.getSizeId().equals(size.getId())&& is.getTypeId().equals(size.getTypeId())){
......@@ -126,6 +130,27 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
}
}
}
//将type表中照片取出,给前端显示
Map<String,String> typeMap=new HashMap<>();
for (InventorySummary is:records) {
String key=is.getTypeId();
if (!sizeMap.containsKey(key)){
sizeMap.put(key,"1");
}
}
LambdaQueryWrapper<EquipmentType> typeWrapper = new LambdaQueryWrapper<>();
for (String key : sizeMap.keySet()) {
typeWrapper.or().eq(EquipmentType::getId,key);
}
List<EquipmentType> equipmentTypeList = equipmentTypeService.list(typeWrapper);
for (InventorySummary is:records ) {
for (EquipmentType type:equipmentTypeList) {
if (is.getTypeId().equals(type.getId())){
is.setTypePhoto(type.getPhoto());
break;
}
}
}
page.setRecords(records);
return PageResultFactory.createPageResult(page);
}
......
......@@ -206,6 +206,7 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
List<Object> dataByTimestampRange = temperatureRedisCache.getDataByTimestampRange(req.getId(), startTimeStamp, endTimeStamp);
List<HumidityAndtemperature> collect = dataByTimestampRange.stream()
.map(obj -> (HumidityAndtemperature) obj)
.sorted(Comparator.comparingLong(HumidityAndtemperature::getCreateTime).reversed())
.collect(Collectors.toList());
return collect;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论