Commit cbfe0769 authored by tangwei's avatar tangwei

修改装备统计

parent c16e627b
...@@ -842,10 +842,12 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -842,10 +842,12 @@ public class FireFightingSystemController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取装备类型和统计值", notes = "获取装备类型和统计值") @ApiOperation(value = "获取装备类型和统计值", notes = "获取装备类型和统计值")
@GetMapping(value = "/getEquipmentTypeAndCount/tree") @GetMapping(value = "/getEquipmentTypeAndCount/tree")
public Object getEquipmentTypeAndCount( @RequestParam(required = false) String bizOrgCode) throws Exception { public Object getEquipmentTypeAndCount( @RequestParam(required = false) String bizOrgCode,@RequestParam(required = false) String isiot) throws Exception {
return fireFightingSystemService.getEquipmentTypeAndCount(bizOrgCode); return fireFightingSystemService.getEquipmentTypeAndCount(bizOrgCode,isiot);
} }
/** /**
* 获取车辆类型和统计值 * 获取车辆类型和统计值
* @throws Exception * @throws Exception
......
...@@ -54,7 +54,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -54,7 +54,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<EquipmentCategory> getEquipmentCategoryList(Integer head); List<EquipmentCategory> getEquipmentCategoryList(Integer head);
List<EquipmentCategory> getEquipmentCategoryListNew( @Param("head") Integer code, @Param("carCode") String carCode, @Param("waterCode") String waterCode); List<EquipmentCategory> getEquipmentCategoryListNew( @Param("head") Integer code, @Param("carCode") String carCode, @Param("waterCode") String waterCode);
List<Map<String,Object>> getequipmentListEQNew(); List<Map<String,Object>> getequipmentListEQNew(@Param("isiot") String isiot);
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head); List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head);
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head); List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head);
......
...@@ -48,7 +48,7 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> { ...@@ -48,7 +48,7 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> {
List<EquipmentCategory> getEquipmentCategoryList(Integer head); List<EquipmentCategory> getEquipmentCategoryList(Integer head);
List<EquipmentCategory> getEquipmentCategoryListNew(Integer head,String carCode,String waterCode); List<EquipmentCategory> getEquipmentCategoryListNew(Integer head,String carCode,String waterCode);
List<Map<String,Object>> getequipmentListEQNew(); List<Map<String,Object>> getequipmentListEQNew(String isiot);
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) ; List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head) ; List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head) ;
......
...@@ -221,7 +221,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -221,7 +221,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @return * @return
* @throws Exception * @throws Exception
*/ */
Object getEquipmentTypeAndCount(String bizOrgCode) throws Exception; Object getEquipmentTypeAndCount(String bizOrgCode,String isiot) throws Exception;
/*** /***
* 车辆类型和统计值 * 车辆类型和统计值
......
...@@ -399,8 +399,8 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM ...@@ -399,8 +399,8 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM
} }
@Override @Override
public List<Map<String, Object>> getequipmentListEQNew() { public List<Map<String, Object>> getequipmentListEQNew(String isiot) {
return this.baseMapper.getequipmentListEQNew(); return this.baseMapper.getequipmentListEQNew(isiot);
} }
public List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) { public List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) {
......
...@@ -1151,19 +1151,19 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1151,19 +1151,19 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public Object getEquipmentTypeAndCount(String bizOrgCode) { public Object getEquipmentTypeAndCount(String bizOrgCode,String isiot) {
// if (redisUtils.hasKey(equipTypeAndCount + bizOrgCode)) { // if (redisUtils.hasKey(equipTypeAndCount + bizOrgCode)) {
// return JSONArray.parseArray( // return JSONArray.parseArray(
// JSONArray.toJSONString(redisUtils.get(equipTypeAndCount + bizOrgCode)), EquipmentCategory.class); // JSONArray.toJSONString(redisUtils.get(equipTypeAndCount + bizOrgCode)), EquipmentCategory.class);
// } else { // } else {
return refreshEquipmentTypeAndCountNew(bizOrgCode); return refreshEquipmentTypeAndCountNew(bizOrgCode,isiot);
// } // }
} }
public Object refreshEquipmentTypeAndCountNew(String bizOrgCode) { public Object refreshEquipmentTypeAndCountNew(String bizOrgCode,String isiot) {
//获取装备分类 //获取装备分类
List<EquipmentCategory> responseList= this.iEquipmentCategoryService List<EquipmentCategory> responseList= this.iEquipmentCategoryService
.getEquipmentCategoryListNew(Integer.valueOf(equipmentCategoryLeftTypeCode),carCode,waterCode); .getEquipmentCategoryListNew(Integer.valueOf(equipmentCategoryLeftTypeCode),carCode,waterCode);
...@@ -1171,15 +1171,15 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1171,15 +1171,15 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return null; return null;
} }
//分类数据处理 //分类数据处理
List<EquipmentCategory> list = typeListTreeNew(responseList, bizOrgCode); List<EquipmentCategory> list = typeListTreeNew(responseList, bizOrgCode, isiot);
return list; return list;
} }
public List<EquipmentCategory> typeListTreeNew(List<EquipmentCategory> equipmentCategorys, String bizOrgCode) { public List<EquipmentCategory> typeListTreeNew(List<EquipmentCategory> equipmentCategorys, String bizOrgCode,String isiot) {
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>(); Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
// 查询所有装备 // 查询所有装备
List<Map<String,Object>> listMP = this.iEquipmentCategoryService.getequipmentListEQNew(); List<Map<String,Object>> listMP = this.iEquipmentCategoryService.getequipmentListEQNew(isiot);
equipmentCategorys.forEach(action -> { equipmentCategorys.forEach(action -> {
//根据条件获取装备数量 //根据条件获取装备数量
List<Map<String,Object>> listM= listMP.stream().filter(x->x.get("code").toString().contains(action.getCode())&&x.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList()); List<Map<String,Object>> listM= listMP.stream().filter(x->x.get("code").toString().contains(action.getCode())&&x.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
......
...@@ -348,6 +348,11 @@ ...@@ -348,6 +348,11 @@
( `s`.`equipment_code` = `e`.`code` ) ( `s`.`equipment_code` = `e`.`code` )
AND ( `e`.`category_id` = `c`.`id` ) AND ( `e`.`category_id` = `c`.`id` )
AND ( `s`.`biz_org_code` != '' ) AND ( `s`.`biz_org_code` != '' )
<if test="isiot != null and isiot!='' ">
AND ( `e`.`is_iot` =#{isiot} )
</if>
) )
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment