Commit 6ad08e10 by 李小惠

新增类型图片以及新增库存接口返回图片

parent dd85f1bb
...@@ -1436,3 +1436,11 @@ Caused by: java.sql.SQLSyntaxErrorException: Unknown column 't2.photo' in 'field ...@@ -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) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)
... 93 common frames omitted ... 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> { ...@@ -32,7 +32,7 @@ public class TemperatureRedisCache extends AbstractRedisCache<Object> {
data.setWarehouseName(warehouseName); data.setWarehouseName(warehouseName);
// String key = warehouseId; // String key = warehouseId;
// Long size = getRedisTemplate().opsForZSet().size(key); // Long size = getRedisTemplate().opsForZSet().size(key);
getRedisTemplate().opsForZSet().add(warehouseId, data, timestamp); getRedisTemplate().opsForZSet().add("WarehouseDev:"+warehouseId, data, timestamp);
put(warehouseId, data); put(warehouseId, data);
} }
public List<Object> getDataByTimestampRange(String warehouseId, long startTimestamp, long endTimestamp) { public List<Object> getDataByTimestampRange(String warehouseId, long startTimestamp, long endTimestamp) {
......
...@@ -220,6 +220,8 @@ public class InventorySummary implements Serializable { ...@@ -220,6 +220,8 @@ public class InventorySummary implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String sizePhoto; private String sizePhoto;
@TableField(exist = false)
private String typePhoto;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -71,6 +71,9 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -71,6 +71,9 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
@Resource @Resource
private EquipmentCountSummaryMapper equipmentCountSummaryMapper; private EquipmentCountSummaryMapper equipmentCountSummaryMapper;
@Resource
private EquipmentTypeService equipmentTypeService;
@Override @Override
...@@ -101,23 +104,24 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -101,23 +104,24 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
LambdaQueryWrapper<InventorySummary> wp = createWrapper(req);//取出仓库中总数并计算 LambdaQueryWrapper<InventorySummary> wp = createWrapper(req);//取出仓库中总数并计算
Page<InventorySummary> page = page(PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()), wp); Page<InventorySummary> page = page(PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()), wp);
List<InventorySummary> records = page.getRecords(); List<InventorySummary> records = page.getRecords();
LambdaQueryWrapper<EquipmentSize> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EquipmentSize> sizeWrapper = new LambdaQueryWrapper<>();
Map<String,String> map=new HashMap<>(); //将size表中的photo取出来,给前端显示
Map<String,String> sizeMap=new HashMap<>();
for (InventorySummary is:records) { for (InventorySummary is:records) {
String key=is.getTypeId()+"_"+is.getSizeId(); String key=is.getTypeId()+"_"+is.getSizeId();
if (!map.containsKey(key)){ if (!sizeMap.containsKey(key)){
map.put(key,"1"); sizeMap.put(key,"1");
} }
} }
// 使用 keySet 遍历 // 使用 keySet 遍历
//取出map中的所有进行遍历 //取出map中的所有进行遍历
for (String key : map.keySet()) { for (String key : sizeMap.keySet()) {
String[] s = key.split("_"); String[] s = key.split("_");
String typeId=s[0]; String typeId=s[0];
String sizeId=s[1]; 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 (InventorySummary is:records) {
for (EquipmentSize size:equipmentSizeList) { for (EquipmentSize size:equipmentSizeList) {
if (is.getSizeId().equals(size.getId())&& is.getTypeId().equals(size.getTypeId())){ if (is.getSizeId().equals(size.getId())&& is.getTypeId().equals(size.getTypeId())){
...@@ -126,6 +130,27 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -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); page.setRecords(records);
return PageResultFactory.createPageResult(page); return PageResultFactory.createPageResult(page);
} }
......
...@@ -206,6 +206,7 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse> ...@@ -206,6 +206,7 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
List<Object> dataByTimestampRange = temperatureRedisCache.getDataByTimestampRange(req.getId(), startTimeStamp, endTimeStamp); List<Object> dataByTimestampRange = temperatureRedisCache.getDataByTimestampRange(req.getId(), startTimeStamp, endTimeStamp);
List<HumidityAndtemperature> collect = dataByTimestampRange.stream() List<HumidityAndtemperature> collect = dataByTimestampRange.stream()
.map(obj -> (HumidityAndtemperature) obj) .map(obj -> (HumidityAndtemperature) obj)
.sorted(Comparator.comparingLong(HumidityAndtemperature::getCreateTime).reversed())
.collect(Collectors.toList()); .collect(Collectors.toList());
return collect; return collect;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论