统计接口代码提交

main
zhangyu 2023-02-17 14:50:49 +08:00
parent afc05a575f
commit 94ab95b70f
2 changed files with 6 additions and 6 deletions

View File

@ -61,8 +61,8 @@ public class MajorHazardSources extends BaseEntity
@Excel(name = "危险源统一编码") @Excel(name = "危险源统一编码")
private String unifiedCoding; private String unifiedCoding;
/** 单元类型 */ /** 单元类型 0-生产单元 1-存储单元*/
private String unitType; private int unitType;
/** 当前存储量 */ /** 当前存储量 */
private String memorySpace; private String memorySpace;
@ -186,11 +186,11 @@ public class MajorHazardSources extends BaseEntity
this.unifiedCoding = unifiedCoding; this.unifiedCoding = unifiedCoding;
} }
public String getUnitType() { public int getUnitType() {
return unitType; return unitType;
} }
public void setUnitType(String unitType) { public void setUnitType(int unitType) {
this.unitType = unitType; this.unitType = unitType;
} }

View File

@ -117,12 +117,12 @@ public class MajorHazardSourcesServiceImpl implements IMajorHazardSourcesService
// 获取生产单元数量 // 获取生产单元数量
int productionUnit = (int) list.stream() int productionUnit = (int) list.stream()
.filter(s -> s.getUnitType().equals("生产单元")).count(); .filter(s -> s.getUnitType() == 0).count();
map.put("productionUnit", productionUnit); map.put("productionUnit", productionUnit);
// 获取存储单元数量 // 获取存储单元数量
int storageCell = (int) list.stream() int storageCell = (int) list.stream()
.filter(s -> s.getUnitType().equals("存储单元")).count(); .filter(s -> s.getUnitType() == 0).count();
map.put("storageCell", storageCell); map.put("storageCell", storageCell);
return JSONObject.toJSONString(map); return JSONObject.toJSONString(map);