Commit 79218d84 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_ccs' of http://172.16.10.76/moa/amos-boot-biz into develop_ccs

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/CarController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
parents 97fb9777 7381bc04
...@@ -105,4 +105,10 @@ public class EquipmentIndex extends BaseEntity { ...@@ -105,4 +105,10 @@ public class EquipmentIndex extends BaseEntity {
@Transient @Transient
@TableField(exist = false) @TableField(exist = false)
private String perfQuotaStr; private String perfQuotaStr;
/**
* 是否支持趋势查看
*/
@TableField(value = "is_trend")
private Boolean isTrend;
} }
...@@ -57,4 +57,7 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> { ...@@ -57,4 +57,7 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> {
@ApiModelProperty(value = "队伍id") @ApiModelProperty(value = "队伍id")
private String teamId; private String teamId;
@ApiModelProperty(value = "是否物联")
private String isIot;
} }
...@@ -63,4 +63,6 @@ public class EquipmentIndexVO { ...@@ -63,4 +63,6 @@ public class EquipmentIndexVO {
@ApiModelProperty(value = "更新日期") @ApiModelProperty(value = "更新日期")
private Date updateDate; private Date updateDate;
@ApiModelProperty(value = "是否支持趋势查看")
private Integer isTrend;
} }
...@@ -14,8 +14,8 @@ public enum SourceTypeEnum { ...@@ -14,8 +14,8 @@ public enum SourceTypeEnum {
* 资源类型枚举 * 资源类型枚举
*/ */
EQUIPMENT("装备","equipment", "equipmentSpecificSerivceImpl","refreshStaData"), EQUIPMENT("装备","equipment", "equipmentSpecificSerivceImpl","refreshStaData"),
CAR("车辆","car", "carServiceImpl","refreshStaData"); CAR("车辆","car", "carServiceImpl","refreshStaData"),
IOT("iot","car", "carServiceImpl","iotrefreshStaData");
private String name; private String name;
private String code; private String code;
......
...@@ -129,6 +129,10 @@ public class CarController extends AbstractBaseController { ...@@ -129,6 +129,10 @@ public class CarController extends AbstractBaseController {
@Value("${auth-key-fire-car}") @Value("${auth-key-fire-car}")
private String carAuthKey; private String carAuthKey;
@Value("${auth-key-fire-iot-equip:fire_iot-equip_info}")
private String iotAuthKey;
@Autowired @Autowired
JcsFeign jcsFeign; JcsFeign jcsFeign;
@Autowired @Autowired
...@@ -185,6 +189,7 @@ public class CarController extends AbstractBaseController { ...@@ -185,6 +189,7 @@ public class CarController extends AbstractBaseController {
iCarService.refreshStaData(); iCarService.refreshStaData();
// 刷新分类树缓存 // 刷新分类树缓存
fireFightingSystemServiceImpl.refreshCarTypeAndCount(bizOrgCode); fireFightingSystemServiceImpl.refreshCarTypeAndCount(bizOrgCode);
} }
@Async @Async
...@@ -259,7 +264,6 @@ public class CarController extends AbstractBaseController { ...@@ -259,7 +264,6 @@ public class CarController extends AbstractBaseController {
Car car1 = iCarService.updateOneById(car); Car car1 = iCarService.updateOneById(car);
CarController controllerProxy = SpringUtils.getBean(CarController.class); CarController controllerProxy = SpringUtils.getBean(CarController.class);
controllerProxy.refreshCount(car.getBizOrgCode()); controllerProxy.refreshCount(car.getBizOrgCode());
refreshCount(car.getBizOrgCode());
return car1; return car1;
} }
...@@ -1254,4 +1258,13 @@ public class CarController extends AbstractBaseController { ...@@ -1254,4 +1258,13 @@ public class CarController extends AbstractBaseController {
FeignClientResult<List<OrgMenuDto>> menusList = jcsFeign.getCompanyDeptTreeWithAuth(carAuthKey, null); FeignClientResult<List<OrgMenuDto>> menusList = jcsFeign.getCompanyDeptTreeWithAuth(carAuthKey, null);
return ResponseHelper.buildResponse(menusList.getResult()); return ResponseHelper.buildResponse(menusList.getResult());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/iot/companyTreeByUserAndType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司部门树", notes = "根据登录人及类型获取公司部门树")
public ResponseModel<Object> iotcompanyTreeByUserAndType() throws Exception {
FeignClientResult<List<OrgMenuDto>> menusList = jcsFeign.getCompanyDeptTreeWithAuth(iotAuthKey, null);
return ResponseHelper.buildResponse(menusList.getResult());
}
} }
...@@ -314,7 +314,47 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -314,7 +314,47 @@ public class FireFightingSystemController extends AbstractBaseController {
@PostMapping(value = "/iot/getEquipTypeAmount")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "九大类下装备,通过code截取", notes = "九大类下装备信息列表")
public IPage<EquipTypeImgAmountVO> iotgetEquipTypeAmount(@RequestBody EquipTypeAmountPageDTO equipTypeAmountPage) {
equipTypeAmountPage.setIsIot("1");
String[] result = hierarchy.split(",");
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < result.length; i++) {
map.put(i, Integer.valueOf(result[i]));
}
if (StringUtil.isNotEmpty(equipTypeAmountPage.getEquipmentClassificationCode())) {
QueryWrapper<EquipmentCategory> equipmentCategoryQueryWrapper = new QueryWrapper<>();
equipmentCategoryQueryWrapper.eq("code", equipTypeAmountPage.getEquipmentClassificationCode());
equipmentCategoryQueryWrapper.eq("industry_code", equipTypeAmountPage.getIndustryCode());
EquipmentCategory equipmentCategory = equipmentCategoryService.getOne(equipmentCategoryQueryWrapper);
if (equipmentCategory == null) {
throw new RuntimeException("装备定义code有误");
}
int inhierarchy = 1;
for (int i = 0; i < result.length + 1; i++) {
//进来先判断是否默认就是空,如果为空第一层
if (equipmentCategory.getParentId() == null) {
//判断是否是最下面的子节点
if (i >= 4) {
inhierarchy = 8;
} else {
inhierarchy = map.get(i);
}
break;
} else {
//查找到循环几次为空
equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId());
}
}
return fireFightingSystemService.getColaCategoryAmountList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage);
} else {
return fireFightingSystemService.getColaCategoryAmountList(0, null, equipTypeAmountPage);
}
}
...@@ -731,4 +771,19 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -731,4 +771,19 @@ public class FireFightingSystemController extends AbstractBaseController {
public Object getCarTypeAndCount( @RequestParam(required = false) String bizOrgCode) throws Exception { public Object getCarTypeAndCount( @RequestParam(required = false) String bizOrgCode) throws Exception {
return fireFightingSystemService.getCarTypeAndCount(bizOrgCode); return fireFightingSystemService.getCarTypeAndCount(bizOrgCode);
} }
/**
* 获取物联设备类型和统计值
* @throws Exception
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取物联设备类型和统计值", notes = "获取物联设备类型和统计值")
@GetMapping(value = "iot/getEquipmentTypeAndCount/tree")
public Object iotgetEquipmentTypeAndCount( @RequestParam(required = false) String bizOrgCode) throws Exception {
return fireFightingSystemService.iotgetEquipmentTypeAndCount(bizOrgCode);
}
} }
...@@ -498,12 +498,17 @@ public class TopographyController extends AbstractBaseController { ...@@ -498,12 +498,17 @@ public class TopographyController extends AbstractBaseController {
@RequestMapping(value = "/equipment/detail", method = RequestMethod.GET) @RequestMapping(value = "/equipment/detail", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据节点id查询详情", notes = "根据节点id查询详情") @ApiOperation(httpMethod = "GET", value = "根据节点id查询详情", notes = "根据节点id查询详情")
public EquipmentDate selectEquipmentDateById(@RequestParam(required = false) String id) { public EquipmentDate selectEquipmentDateById(@RequestParam(required = false) String id, @RequestParam(required = false) String equipSpeId) {
TopographyNodeDetailDTO detailDTO = topographyNodeDetailService.queryByNodeid(id); String eqpId;
if (null == id || null == detailDTO || !StringUtil.isNotEmpty(detailDTO.getEqpId())) { if (StringUtil.isNotEmpty(equipSpeId)) {
throw new RuntimeException("节点信息错误或此节点下未绑定装备!"); eqpId = equipSpeId;
} else {
TopographyNodeDetailDTO detailDTO = topographyNodeDetailService.queryByNodeid(id);
if (null == detailDTO || !StringUtil.isNotEmpty(detailDTO.getEqpId())) {
throw new RuntimeException("节点信息错误或此节点下未绑定装备!");
}
eqpId = detailDTO.getEqpId();
} }
String eqpId = detailDTO.getEqpId();
EquipmentDate equipmentDate = new EquipmentDate(); EquipmentDate equipmentDate = new EquipmentDate();
EquipmentSpecific equipmentSpecific = equipmentSpecificService.getById(eqpId); EquipmentSpecific equipmentSpecific = equipmentSpecificService.getById(eqpId);
QueryWrapper<EquipmentSpecificAlarm> wrapper = new QueryWrapper<>(); QueryWrapper<EquipmentSpecificAlarm> wrapper = new QueryWrapper<>();
...@@ -567,14 +572,25 @@ public class TopographyController extends AbstractBaseController { ...@@ -567,14 +572,25 @@ public class TopographyController extends AbstractBaseController {
@RequestMapping(value = "/equipment/alarm", method = RequestMethod.GET) @RequestMapping(value = "/equipment/alarm", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据节点id查询告警信息", notes = "根据节点id查询告警信息") @ApiOperation(httpMethod = "GET", value = "根据节点id查询告警信息", notes = "根据节点id查询告警信息")
public ResponseModel getAlarmInfo(@RequestParam(required = false) String id, @RequestParam(required = false) int status, public ResponseModel getAlarmInfo(@RequestParam(required = false) String id,
@RequestParam(required = false) String beginDate, @RequestParam(required = false) String endDate, @RequestParam(required = false) String equipSpeId,
@RequestParam(required = false) int status,
@RequestParam(required = false) String confirmType,
@RequestParam(required = false) String cleanStatus,
@RequestParam(required = false) String beginDate,
@RequestParam(required = false) String endDate,
CommonPageable commonPageable) { CommonPageable commonPageable) {
TopographyNodeDetailDTO detailDTO = topographyNodeDetailService.queryByNodeid(id); String eqpId;
if (null == id || null == detailDTO || !StringUtil.isNotEmpty(detailDTO.getEqpId())) { if (StringUtil.isNotEmpty(equipSpeId)) {
throw new RuntimeException("节点信息错误或此节点下未绑定装备!"); eqpId = equipSpeId;
} else {
TopographyNodeDetailDTO detailDTO = topographyNodeDetailService.queryByNodeid(id);
if (null == id || null == detailDTO || !StringUtil.isNotEmpty(detailDTO.getEqpId())) {
throw new RuntimeException("节点信息错误或此节点下未绑定装备!");
}
EquipmentSpecific equipmentSpecific = equipmentSpecificService.getById(detailDTO.getEqpId());
eqpId = String.valueOf(equipmentSpecific.getId());
} }
EquipmentSpecific equipmentSpecific = equipmentSpecificService.getById(detailDTO.getEqpId());
List<CommonRequest> queryRequests = new ArrayList<>(); List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request = new CommonRequest(); CommonRequest request = new CommonRequest();
request.setName("beginDate"); request.setName("beginDate");
...@@ -586,12 +602,22 @@ public class TopographyController extends AbstractBaseController { ...@@ -586,12 +602,22 @@ public class TopographyController extends AbstractBaseController {
queryRequests.add(request1); queryRequests.add(request1);
CommonRequest request2 = new CommonRequest(); CommonRequest request2 = new CommonRequest();
request2.setName("id"); request2.setName("id");
request2.setValue(StringUtil.isNotEmpty(String.valueOf(equipmentSpecific.getId())) ? StringUtils.trimToNull(String.valueOf(equipmentSpecific.getId())) : null); request2.setValue(StringUtil.isNotEmpty(eqpId) ? StringUtils.trimToNull(eqpId) : null);
queryRequests.add(request2); queryRequests.add(request2);
CommonRequest request3 = new CommonRequest(); CommonRequest request3 = new CommonRequest();
request3.setName("status"); request3.setName("status");
request3.setValue(StringUtil.isNotEmpty(status) ? StringUtils.trimToNull(String.valueOf(status)) : null); request3.setValue(StringUtil.isNotEmpty(status) ? StringUtils.trimToNull(String.valueOf(status)) : null);
queryRequests.add(request3); queryRequests.add(request3);
// confirmType: '' 为全部数据 0 为未确认 1为已确认
CommonRequest request4 = new CommonRequest();
request4.setName("confirmType");
request4.setValue(StringUtil.isNotEmpty(confirmType) ? StringUtils.trimToNull(confirmType) : null);
queryRequests.add(request4);
// cleanStatus: '' 为全部数据 1 为已消除 2为未消除
CommonRequest request5 = new CommonRequest();
request5.setName("cleanStatus");
request5.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null);
queryRequests.add(request5);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<TopographyAlarmVo> list = iEquipmentSpecificAlarmService.listAlarmsPageForTopography(param); Page<TopographyAlarmVo> list = iEquipmentSpecificAlarmService.listAlarmsPageForTopography(param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
...@@ -603,12 +629,17 @@ public class TopographyController extends AbstractBaseController { ...@@ -603,12 +629,17 @@ public class TopographyController extends AbstractBaseController {
@RequestMapping(value = "/equipment/iot/info", method = RequestMethod.GET) @RequestMapping(value = "/equipment/iot/info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据节点id查询当前物联信息", notes = "根据节点id查询当前物联信息") @ApiOperation(httpMethod = "GET", value = "根据节点id查询当前物联信息", notes = "根据节点id查询当前物联信息")
public Map<String, Object> getEquipmentIotInfo(@RequestParam(required = false) String id) { public Map<String, Object> getEquipmentIotInfo(@RequestParam(required = false) String id, @RequestParam(required = false) String equipSpeId) {
TopographyNodeDetailDTO detailDTO = topographyNodeDetailService.queryByNodeid(id); String eqpId;
if (null == id || null == detailDTO || !StringUtil.isNotEmpty(detailDTO.getEqpId())) { if (StringUtil.isNotEmpty(equipSpeId)) {
throw new RuntimeException("节点信息错误或此节点下未绑定装备!"); eqpId = equipSpeId;
} else {
TopographyNodeDetailDTO detailDTO = topographyNodeDetailService.queryByNodeid(id);
if (null == detailDTO || !StringUtil.isNotEmpty(detailDTO.getEqpId())) {
throw new RuntimeException("节点信息错误或此节点下未绑定装备!");
}
eqpId = detailDTO.getEqpId();
} }
String eqpId = detailDTO.getEqpId();
EquipmentSpecific equipmentSpecific = equipmentSpecificService.getById(eqpId); EquipmentSpecific equipmentSpecific = equipmentSpecificService.getById(eqpId);
EquipmentDetail equipmentDetail = iEquipmentDetailService.getById(equipmentSpecific.getEquipmentDetailId()); EquipmentDetail equipmentDetail = iEquipmentDetailService.getById(equipmentSpecific.getEquipmentDetailId());
Long equipmentId = equipmentDetail.getEquipmentId(); Long equipmentId = equipmentDetail.getEquipmentId();
...@@ -688,13 +719,20 @@ public class TopographyController extends AbstractBaseController { ...@@ -688,13 +719,20 @@ public class TopographyController extends AbstractBaseController {
@RequestMapping(value = "/equipment/info", method = RequestMethod.GET) @RequestMapping(value = "/equipment/info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据节点id查询当前节点物联数据记录", notes = "根据节点id查询当前节点物联数据记录") @ApiOperation(httpMethod = "GET", value = "根据节点id查询当前节点物联数据记录", notes = "根据节点id查询当前节点物联数据记录")
public ResponseModel getEquipmentIotInfo(@RequestParam(required = false) String id, @RequestParam(required = false) String beginDate, public ResponseModel getEquipmentIotInfo(@RequestParam(required = false) String id,
@RequestParam(required = false) String equipSpeId,
@RequestParam(required = false) String beginDate,
@RequestParam(required = false) String endDate) { @RequestParam(required = false) String endDate) {
TopographyNodeDetailDTO detailDTO = topographyNodeDetailService.queryByNodeid(id); String eqpId;
if (null == id || null == detailDTO || !StringUtil.isNotEmpty(detailDTO.getEqpId())) { if (StringUtil.isNotEmpty(equipSpeId)) {
throw new RuntimeException("节点信息错误或此节点下未绑定装备!"); eqpId = equipSpeId;
} else {
TopographyNodeDetailDTO detailDTO = topographyNodeDetailService.queryByNodeid(id);
if (null == detailDTO || !StringUtil.isNotEmpty(detailDTO.getEqpId())) {
throw new RuntimeException("节点信息错误或此节点下未绑定装备!");
}
eqpId = detailDTO.getEqpId();
} }
String eqpId = detailDTO.getEqpId();
EquipmentSpecific equipmentSpecific = equipmentSpecificService.getById(eqpId); EquipmentSpecific equipmentSpecific = equipmentSpecificService.getById(eqpId);
String iotCode = equipmentSpecific.getIotCode(); String iotCode = equipmentSpecific.getIotCode();
String prefix = null; String prefix = null;
...@@ -765,16 +803,32 @@ public class TopographyController extends AbstractBaseController { ...@@ -765,16 +803,32 @@ public class TopographyController extends AbstractBaseController {
} }
} }
public static Map<String, String> mapStringToMap(String str) { /***
str = str.substring(1, str.length() - 1); *
String[] strs = str.split(","); * 根拓补节点id查询当前节点物联数据记录
Map<String, String> map = new HashMap<String, String>(); *
for (String string : strs) { * **/
String key = string.split("=")[0]; @RequestMapping(value = "/equipment/tren", method = RequestMethod.GET)
String value = string.split("=")[1]; @TycloudOperation(ApiLevel = UserType.AGENCY)
map.put(key, value); @ApiOperation(httpMethod = "GET", value = "根据节点id查询当前节点物联数据记录", notes = "根据节点id查询当前节点物联数据记录")
public ResponseModel getEquipmentIndexTrendInfo(@RequestParam(required = false) String id,
@RequestParam(required = false) String equipSpeId,
@RequestParam(required = false) String beginDate,
@RequestParam(required = false) String endDate) {
String eqpId;
if (StringUtil.isNotEmpty(equipSpeId)) {
eqpId = equipSpeId;
} else {
TopographyNodeDetailDTO detailDTO = topographyNodeDetailService.queryByNodeid(id);
if (null == detailDTO || !StringUtil.isNotEmpty(detailDTO.getEqpId())) {
throw new RuntimeException("节点信息错误或此节点下未绑定装备!");
}
eqpId = detailDTO.getEqpId();
} }
return map; EquipmentSpecific equipmentSpecific = equipmentSpecificService.getById(eqpId);
return CommonResponseUtil.success();
} }
} }
...@@ -73,4 +73,6 @@ public interface CarMapper extends BaseMapper<Car> { ...@@ -73,4 +73,6 @@ public interface CarMapper extends BaseMapper<Car> {
List<CarFusionDto> selectCarAndCarProperty(); List<CarFusionDto> selectCarAndCarProperty();
List<Map<String, Object>> queryCompanyCarStaData(); List<Map<String, Object>> queryCompanyCarStaData();
List<Map<String, Object>> queryCompanyIotStaData();
} }
...@@ -178,4 +178,11 @@ public interface ICarService extends IService<Car> { ...@@ -178,4 +178,11 @@ public interface ICarService extends IService<Car> {
* 更新redis 统计数据 * 更新redis 统计数据
*/ */
void refreshStaData(); void refreshStaData();
/**
* iot装备更新redis 统计数据
*/
void iotrefreshStaData();
} }
...@@ -203,28 +203,35 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -203,28 +203,35 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/** /**
* 获取列表不分页 * 获取列表不分页
*
* @param bizOrgCode orgCode * @param bizOrgCode orgCode
* @return * @return
*/ */
List<FireFightingSystemEntity> systemListByBziOrgCode(String bizOrgCode); List<FireFightingSystemEntity> systemListByBziOrgCode(String bizOrgCode);
/**
*装备分类的类型和总数 /**
* @param bizOrgCode * 装备分类的类型和总数
* @return *
* @throws Exception * @param bizOrgCode
*/ * @return
Object getEquipmentTypeAndCount(String bizOrgCode) throws Exception; * @throws Exception
/*** */
* 车辆类型和统计值 Object getEquipmentTypeAndCount(String bizOrgCode) throws Exception;
* @param bizOrgCode
* @return /***
* @throws Exception * 车辆类型和统计值
*/ * @param bizOrgCode
Object getCarTypeAndCount(String bizOrgCode) throws Exception; * @return
* @throws Exception
Object refreshEquipmentTypeAndCount(String bizOrgCode) throws Exception; */
Object getCarTypeAndCount(String bizOrgCode) throws Exception;
Object refreshCarTypeAndCount(String bizOrgCode) throws Exception;
Object refreshEquipmentTypeAndCount(String bizOrgCode) throws Exception;
Object iotgetEquipmentTypeAndCount(String bizOrgCode) throws Exception;
Object refreshCarTypeAndCount(String bizOrgCode) throws Exception;
} }
...@@ -1621,9 +1621,21 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS ...@@ -1621,9 +1621,21 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
public void refreshStaData() { public void refreshStaData() {
List<Map<String, Object>> result = this.baseMapper.queryCompanyCarStaData(); List<Map<String, Object>> result = this.baseMapper.queryCompanyCarStaData();
result.forEach(m -> redisUtils.set((buildKey(m)), m.get("total"), 86400)); result.forEach(m -> redisUtils.set((buildKey(m)), m.get("total"), 86400));
iotrefreshStaData();
}
@Override
public void iotrefreshStaData() {
List<Map<String, Object>> result = this.baseMapper.queryCompanyIotStaData();
result.forEach(m -> redisUtils.set((iotbuildKey(m)), m.get("total"), 86400));
} }
private String buildKey(Map<String, Object> row) { private String buildKey(Map<String, Object> row) {
return SourcesStatisticsImpl.PREFIX_CATEGORY_COUNT + row.get("bizOrgCode").toString() + "_" + SourceTypeEnum.CAR.getCode() + "_" + row.get("categoryCode").toString(); return SourcesStatisticsImpl.PREFIX_CATEGORY_COUNT + row.get("bizOrgCode").toString() + "_" + SourceTypeEnum.CAR.getCode() + "_" + row.get("categoryCode").toString();
} }
private String iotbuildKey(Map<String, Object> row) {
return SourcesStatisticsImpl.PREFIX_CATEGORY_COUNT + row.get("bizOrgCode").toString() + "_" + SourceTypeEnum.IOT.getCode() + "_" + row.get("categoryCode").toString();
}
} }
...@@ -112,6 +112,10 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -112,6 +112,10 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
private IVideoService videoService; private IVideoService videoService;
@Autowired
private ICarService carService;
@Value("${systemctl.dict.iot-core-param}") @Value("${systemctl.dict.iot-core-param}")
private String iotCoreParam; private String iotCoreParam;
...@@ -1592,6 +1596,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1592,6 +1596,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
public void refreshStaData() { public void refreshStaData() {
List<Map<String, Object>> result = this.baseMapper.queryCompanyStaData(); List<Map<String, Object>> result = this.baseMapper.queryCompanyStaData();
result.forEach(m -> redisUtils.set((buildKey(m)), m.get("total"), 86400)); result.forEach(m -> redisUtils.set((buildKey(m)), m.get("total"), 86400));
carService.iotrefreshStaData();
} }
private String buildKey(Map<String, Object> row) { private String buildKey(Map<String, Object> row) {
......
...@@ -975,7 +975,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -975,7 +975,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
} }
@Override @Override
public Object refreshEquipmentTypeAndCount(String bizOrgCode) { public Object refreshEquipmentTypeAndCount(String bizOrgCode) {
List<EquipmentCategory> responseList = this.typeList(); List<EquipmentCategory> responseList = this.typeList();
...@@ -993,15 +992,34 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -993,15 +992,34 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override @Override
public Object getCarTypeAndCount(String bizOrgCode) { public Object getCarTypeAndCount(String bizOrgCode) {
if (redisUtils.hasKey(carTypeAndCount + bizOrgCode)) { if (redisUtils.hasKey(carTypeAndCount + bizOrgCode)) {
List<EquipmentCategory> typeList = JSONArray.parseArray( return JSONArray.parseArray(
JSONArray.toJSONString(redisUtils.get(carTypeAndCount + bizOrgCode)), EquipmentCategory.class); JSONArray.toJSONString(redisUtils.get(carTypeAndCount + bizOrgCode)), EquipmentCategory.class);
return typeList;
} else { } else {
return refreshCarTypeAndCount(bizOrgCode); return refreshCarTypeAndCount(bizOrgCode);
} }
} }
@Override @Override
public Object iotgetEquipmentTypeAndCount(String bizOrgCode) throws Exception {
if (redisUtils.hasKey("iotTypeAndCount" + bizOrgCode)) {
return JSONArray.parseArray(
JSONArray.toJSONString(redisUtils.get("iotTypeAndCount" + bizOrgCode)), EquipmentCategory.class);
} else {
return iotrefreshEquipmentTypeAndCount(bizOrgCode);
}
}
public Object iotrefreshEquipmentTypeAndCount(String bizOrgCode) {
List<EquipmentCategory> responseList = this.typeList();
if (responseList == null || responseList.size() < 1) {
return null;
}
List<EquipmentCategory> list = typeListTree(responseList, bizOrgCode, SourceTypeEnum.IOT);
redisUtils.set("iotTypeAndCount" + bizOrgCode, list, 86400);
return list;
}
@Override
public Object refreshCarTypeAndCount(String bizOrgCode) { public Object refreshCarTypeAndCount(String bizOrgCode) {
List<EquipmentCategory> responseList = this.typeList(); List<EquipmentCategory> responseList = this.typeList();
if (responseList == null || responseList.size() < 1) { if (responseList == null || responseList.size() < 1) {
...@@ -1015,10 +1033,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1015,10 +1033,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return list; return list;
} }
public List<EquipmentCategory> typeList() { public List<EquipmentCategory> typeList() {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService return this.iEquipmentCategoryService
.getEquipmentCategoryList(Integer.valueOf(equipmentCategoryLeftTypeCode)); .getEquipmentCategoryList(Integer.valueOf(equipmentCategoryLeftTypeCode));
return equipmentCategorys;
} }
public List<EquipmentCategory> typeListTree(List<EquipmentCategory> equipmentCategorys, String bizOrgCode, public List<EquipmentCategory> typeListTree(List<EquipmentCategory> equipmentCategorys, String bizOrgCode,
......
...@@ -103,4 +103,8 @@ auth-key-fire-building=fire_building_info ...@@ -103,4 +103,8 @@ auth-key-fire-building=fire_building_info
redis_car_type_count = carTypeAndCount redis_car_type_count = carTypeAndCount
redis_equip_type_count = equipTypeAndCount redis_equip_type_count = equipTypeAndCount
\ No newline at end of file
# 权限标识-物联装备
auth-key-fire-iot-equip=fire_iot-equip_info
\ No newline at end of file
...@@ -2261,7 +2261,17 @@ ...@@ -2261,7 +2261,17 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="keyong" id="1641977770-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_index" columnName="is_trend"/>
</not>
</preConditions>
<comment>wl_equipment_index add column is_trend</comment>
<sql>
alter table `wl_equipment_index` add column `is_trend` bit(1) DEFAULT b'0' COMMENT '是否支持趋势查看, 默认false';
</sql>
</changeSet>
......
...@@ -619,4 +619,43 @@ ...@@ -619,4 +619,43 @@
and s.biz_org_code <![CDATA[<>]]> '' and s.biz_org_code <![CDATA[<>]]> ''
GROUP BY s.biz_org_code ,c.code GROUP BY s.biz_org_code ,c.code
</select> </select>
<select id="queryCompanyIotStaData" resultType="java.util.Map">
SELECT
s.biz_org_code as bizOrgCode,
c.code as categoryCode,
count(1) as total
FROM
`wl_car` s,
wl_equipment e,
wl_equipment_category c
where
e.is_iot=1
and s.equipment_id = e.`id`
and e.category_id = c.id
and s.biz_org_code is not null
GROUP BY s.biz_org_code ,c.code
UNION
SELECT
s.biz_org_code as bizOrgCode,
c.code as categoryCode,
count(1) as total
FROM
`wl_equipment_specific` s,
wl_equipment e,
wl_equipment_category c
where
e.is_iot=1
and s.equipment_code = e.`code`
and e.category_id = c.id
and s.biz_org_code is not null
GROUP BY s.biz_org_code ,c.code
</select>
</mapper> </mapper>
...@@ -153,7 +153,8 @@ ...@@ -153,7 +153,8 @@
index_definition_id as index_id, index_definition_id as index_id,
1 as is_importent_parameter, 1 as is_importent_parameter,
sort_num, sort_num,
type type,
is_trend
from from
wl_equipment_index wl_equipment_index
where id = #{id} where id = #{id}
......
...@@ -611,6 +611,11 @@ ...@@ -611,6 +611,11 @@
<if test="codeHead!=null and codeHead!='' and codeHead!=' '"> <if test="codeHead!=null and codeHead!='' and codeHead!=' '">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead} and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
</if> </if>
<if test="equipTypeAmountPage.isIot!=null">
and wle.is_iot=1
</if>
<if test="equipTypeAmountPage.industryCode!=null"> <if test="equipTypeAmountPage.industryCode!=null">
and wec.industry_code = #{equipTypeAmountPage.industryCode} and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if> </if>
...@@ -713,6 +718,9 @@ ...@@ -713,6 +718,9 @@
<if test="equipTypeAmountPage.industryCode!=null"> <if test="equipTypeAmountPage.industryCode!=null">
and wec.industry_code = #{equipTypeAmountPage.industryCode} and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if> </if>
<if test="equipTypeAmountPage.isIot!=null">
and wle.is_iot=1
</if>
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''"> <if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
And wlc.`NAME` LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%') And wlc.`NAME` LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
</if> </if>
......
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