Commit d88070b0 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_dl' into develop_dl

parents dd41da46 0bb6dc40
...@@ -84,6 +84,7 @@ public class EquipmentIndexVO { ...@@ -84,6 +84,7 @@ public class EquipmentIndexVO {
@ApiModelProperty(value = "装备名称") @ApiModelProperty(value = "装备名称")
private String equipmentSpecificName; private String equipmentSpecificName;
@ApiModelProperty(value = "指标名称") @ApiModelProperty(value = "装备指标名称")
private String equipmentIndexName; private String equipmentIndexName;
} }
...@@ -7,36 +7,54 @@ import java.util.List; ...@@ -7,36 +7,54 @@ import java.util.List;
public enum PressurePumpEnum { public enum PressurePumpEnum {
ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5", ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5",
PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"), PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5", ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5",
PressurePumpValueEnum.LAST_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"), PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
ALONE_STOP_QT("FHS_PressurePump_Stop_ALONE_STOP_QT", PressurePumpCheckEnum.GE.getCode(), "5", "",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30", ALONE_START_QT_WJ("FHS_PressurePump_Start_ALONE_START_QT_WJ", PressurePumpCheckEnum.BE.getCode(), "5", "30",
PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"), PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
ALL_START_QT_YZ("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60", ALONE_START_QT_YZ("FHS_PressurePump_Start_ALONE_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"), PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
ALL_START_QT_YB("FHS_PressurePump_Start_ALL_START_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240", ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "5",
PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时"), PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
ALL_STOP_QT_WJ("FHS_PressurePump_Stop_ALL_STOP_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30", START_QT_WJ_ALL("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "5", "30",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"), PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
ALL_STOP_QT_YZ("FHS_PressurePump_Stop_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60", ALL_STOP_QT_YZ("FHS_PressurePump_Start_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"), PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时");
ALL_STOP_QT_YB("FHS_PressurePump_Stop_ALL_STOP_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240", // 备份2023-07-13
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时"); // ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5",
// PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
//
// ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5",
// PressurePumpValueEnum.LAST_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
//
// ALONE_STOP_QT("FHS_PressurePump_Stop_ALONE_STOP_QT", PressurePumpCheckEnum.GE.getCode(), "5", "",
// PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
//
// ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30",
// PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
//
// ALL_START_QT_YZ("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
// PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
//
// ALL_START_QT_YB("FHS_PressurePump_Start_ALL_START_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240",
// PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时"),
//
// ALL_STOP_QT_WJ("FHS_PressurePump_Stop_ALL_STOP_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30",
// PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
//
// ALL_STOP_QT_YZ("FHS_PressurePump_Stop_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
// PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
//
// ALL_STOP_QT_YB("FHS_PressurePump_Stop_ALL_STOP_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240",
// PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时");
private String code; private String code;
private String operator; private String operator;
......
...@@ -5,7 +5,7 @@ public enum PressurePumpValueEnum { ...@@ -5,7 +5,7 @@ public enum PressurePumpValueEnum {
LAST_STOP("lastStop", "上次停泵时间"), LAST_STOP("lastStop", "上次停泵时间"),
LAST_START("lastStart", "上次启泵时间"), LAST_START("lastStart", "上次启泵时间"),
LATELY_STOP("latelyStop", "所有泵最近一次停泵时间"), LATELY_STOP("latelyStop", "所有泵最近一次停泵时间"),
PUMP_START_TIME("pumpStartTime", "计算启动时"), PUMP_START_TIME("pumpStartTime", "计算启动时"),
LATELY_START("latelyStart", "所有泵最近一次启泵时间"); LATELY_START("latelyStart", "所有泵最近一次启泵时间");
private String code; private String code;
......
package com.yeejoin.equipmanage.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author keyong
* @title: RiskSourceTypeEnum
* <pre>
* @description: TODO
* </pre>
* @date 2023/8/2 18:40
*/
@Getter
@AllArgsConstructor
public enum RiskSourceTypeEnum {
EQUIP("equip", "装备告警"), PATROL("patrol", "巡检异常"),
HIDDENDANGER("danger", "隐患"), DEFECT("defect", "缺陷");
private String name;
private String describe;
}
...@@ -18,6 +18,8 @@ public class SendToMsgRiskEquipInfoVo { ...@@ -18,6 +18,8 @@ public class SendToMsgRiskEquipInfoVo {
// 装备名称 // 装备名称
private String name; private String name;
private String value;
// 装备编码 // 装备编码
private String code; private String code;
......
...@@ -46,4 +46,7 @@ public class OrganizationUser extends BaseEntity { ...@@ -46,4 +46,7 @@ public class OrganizationUser extends BaseEntity {
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "排序")
private int sort; private int sort;
@ApiModelProperty(value = "是否是值长")
private boolean dutyLeader;
} }
...@@ -16,4 +16,6 @@ public interface ICcsToStationUserInfo { ...@@ -16,4 +16,6 @@ public interface ICcsToStationUserInfo {
* 保存用户信息至redis * 保存用户信息至redis
*/ */
void saveUserInfoToRedis() throws Exception; void saveUserInfoToRedis() throws Exception;
void test() throws Exception;
} }
...@@ -8,9 +8,13 @@ public interface IOrganizationUserService { ...@@ -8,9 +8,13 @@ public interface IOrganizationUserService {
OrganizationUser updateModelById(OrganizationUser organizationUser); OrganizationUser updateModelById(OrganizationUser organizationUser);
void updateModelByTel(OrganizationUser organizationUser);
OrganizationUser getDetailsById(Long id); OrganizationUser getDetailsById(Long id);
IPage<OrganizationUser> getListPage(int pageNumber, int pageSize, Long id); IPage<OrganizationUser> getListPage(int pageNumber, int pageSize, Long id);
IPage<OrganizationUser> getPage(int pageNumber, int pageSize, String tel);
int deleteById(Long id); int deleteById(Long id);
} }
...@@ -17,58 +17,7 @@ ...@@ -17,58 +17,7 @@
LIMIT 5 LIMIT 5
</select> </select>
<select id="getTeamLeader" resultType="Map"> <select id="getTeamLeader" resultType="Map">
SELECT SELECT cou.member_name AS `value`, cou.telephone AS tel, '当值值长' AS `name` FROM cb_organization_user cou WHERE cou.duty_leader = true LIMIT 1
(
SELECT
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS value
FROM
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId WHERE cou.is_delete = 0
) AS value,
(
SELECT
Ifnull(GROUP_CONCAT( dfi.field_value ),'') AS tel
FROM
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = temp.userId WHERE dfi.field_code = 'telephone'
) AS tel,
'当值值长' AS name
</select> </select>
<select id="getOrganizationList" resultType="java.util.Map"> <select id="getOrganizationList" resultType="java.util.Map">
SELECT SELECT
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -489,6 +490,25 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -489,6 +490,25 @@ public class EquipmentSpecificController extends AbstractBaseController {
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
@GetMapping("/change/status")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "查询泡沫系统指标", notes = "查询泡沫系统指标")
public ResponseModel changeEquipStatusById(@RequestParam(value = "status") String status,
@RequestParam(value = "equipId") String equipId) {
equipmentSpecificSerivce.updateEquipSpecificStatus(status, equipId);
return CommonResponseUtil.success();
}
@GetMapping("/find/one")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "查询泡沫系统指标", notes = "查询泡沫系统指标")
public ResponseModel getOneEntityById(@RequestParam(value = "id") String id) {
QueryWrapper<EquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id", id);
EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getOne(queryWrapper);
return CommonResponseUtil.success(equipmentSpecific);
}
@GetMapping(value = "/info/paomo") @GetMapping(value = "/info/paomo")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询泡沫系统指标", notes = "查询泡沫系统指标") @ApiOperation(httpMethod = "GET", value = "查询泡沫系统指标", notes = "查询泡沫系统指标")
......
...@@ -99,10 +99,10 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -99,10 +99,10 @@ public class FireFightingSystemController extends AbstractBaseController {
@Autowired @Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper; EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired @Autowired
ICarService carService; ICarService carService;
@RequestMapping(value = "/getEquiplistBySystemId", method = RequestMethod.GET) @RequestMapping(value = "/getEquiplistBySystemId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据系统id查询设备列表") @ApiOperation("根据系统id查询设备列表")
...@@ -533,7 +533,7 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -533,7 +533,7 @@ public class FireFightingSystemController extends AbstractBaseController {
equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId()); equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId());
} }
} }
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", ""), equipTypeAmountPage); return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode(), equipTypeAmountPage);
//String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", ""); //String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", "");
//return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage); //return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage);
...@@ -877,7 +877,7 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -877,7 +877,7 @@ public class FireFightingSystemController extends AbstractBaseController {
} }
/** /**
* 获取人员部门树7 * 获取人员部门树7
* *
* @return list * @return list
*/ */
...@@ -948,7 +948,7 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -948,7 +948,7 @@ public class FireFightingSystemController extends AbstractBaseController {
/** /**
* 获取装备类型和统计值 * 获取装备类型和统计值
* @throws Exception * @throws Exception
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取装备类型和统计值", notes = "获取装备类型和统计值") @ApiOperation(value = "获取装备类型和统计值", notes = "获取装备类型和统计值")
...@@ -956,10 +956,10 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -956,10 +956,10 @@ public class FireFightingSystemController extends AbstractBaseController {
public Object getEquipmentTypeAndCount( @RequestParam(required = false) String bizOrgCode) throws Exception { public Object getEquipmentTypeAndCount( @RequestParam(required = false) String bizOrgCode) throws Exception {
return fireFightingSystemService.getEquipmentTypeAndCount(bizOrgCode); return fireFightingSystemService.getEquipmentTypeAndCount(bizOrgCode);
} }
/** /**
* 获取车辆类型和统计值 * 获取车辆类型和统计值
* @throws Exception * @throws Exception
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取车辆类型和统计值", notes = "获取车辆类型和统计值") @ApiOperation(value = "获取车辆类型和统计值", notes = "获取车辆类型和统计值")
...@@ -1018,7 +1018,7 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -1018,7 +1018,7 @@ public class FireFightingSystemController extends AbstractBaseController {
public Object getSystemAlarmInfoList(@RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate) throws Exception { public Object getSystemAlarmInfoList(@RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate) throws Exception {
return fireFightingSystemService.getSystemAlarmInfoList(startDate, endDate); return fireFightingSystemService.getSystemAlarmInfoList(startDate, endDate);
} }
/** /**
* 重置画布数据 * 重置画布数据
* *
......
...@@ -4,17 +4,16 @@ import com.yeejoin.equipmanage.common.dto.FireRiskSourceDto; ...@@ -4,17 +4,16 @@ import com.yeejoin.equipmanage.common.dto.FireRiskSourceDto;
import com.yeejoin.equipmanage.common.request.Common3dRequest; import com.yeejoin.equipmanage.common.request.Common3dRequest;
import com.yeejoin.equipmanage.common.response.Common3dResponse; import com.yeejoin.equipmanage.common.response.Common3dResponse;
import com.yeejoin.equipmanage.common.response.Common3dResponseUtil; import com.yeejoin.equipmanage.common.response.Common3dResponseUtil;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.vo.Request3dVo; import com.yeejoin.equipmanage.common.vo.Request3dVo;
import com.yeejoin.equipmanage.service.IRiskSourceService; import com.yeejoin.equipmanage.service.IRiskSourceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
...@@ -56,4 +55,13 @@ public class RiskSourceController extends AbstractBaseController { ...@@ -56,4 +55,13 @@ public class RiskSourceController extends AbstractBaseController {
return Common3dResponseUtil.success(list); return Common3dResponseUtil.success(list);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取巡检记录设备详情发送至风险", notes = "获取巡检记录设备详情发送至风险")
@RequestMapping(value = "/risk/equip/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel getEquipDetailByCheckId( @RequestParam(value = "source") String source,
@RequestParam(value = "id") String id,
@RequestParam(value = "indexKey", required = false) String indexKey) {
return CommonResponseUtil.success(riskSourceService.getEquipmentToRiskInfo(source, id, indexKey));
}
} }
...@@ -272,4 +272,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -272,4 +272,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<String> selectIdsByPatrolCheck(String id); List<String> selectIdsByPatrolCheck(String id);
List<Map<String, Object>> queryCheckInputItemsByCheckId(@Param(value="checkId") String checkId);
Map<String, Object> getPointById(@Param(value = "pointId") Long id);
} }
...@@ -19,6 +19,4 @@ public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportant ...@@ -19,6 +19,4 @@ public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportant
List<VideoImportantEquipmentVo> getVideoList(Map<String, Object> map); List<VideoImportantEquipmentVo> getVideoList(Map<String, Object> map);
List<String> getVideoAddressGroupList(Map<String, Object> map);
} }
...@@ -2,6 +2,8 @@ package com.yeejoin.equipmanage.service; ...@@ -2,6 +2,8 @@ package com.yeejoin.equipmanage.service;
import com.yeejoin.equipmanage.common.dto.FireRiskSourceDto; import com.yeejoin.equipmanage.common.dto.FireRiskSourceDto;
import com.yeejoin.equipmanage.common.vo.RiskBizInfoVo;
import com.yeejoin.equipmanage.common.vo.RiskDataVo;
import java.util.List; import java.util.List;
...@@ -14,4 +16,6 @@ public interface IRiskSourceService { ...@@ -14,4 +16,6 @@ public interface IRiskSourceService {
* @return * @return
*/ */
List<FireRiskSourceDto> getFiskSourceTierTree(Integer tier, Boolean isRegion); List<FireRiskSourceDto> getFiskSourceTierTree(Integer tier, Boolean isRegion);
RiskBizInfoVo getEquipmentToRiskInfo(String source, String id, String indexKey);
} }
...@@ -2,12 +2,15 @@ package com.yeejoin.equipmanage.service.impl; ...@@ -2,12 +2,15 @@ package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.dto.EquiplistSpecificBySystemESVO; import com.yeejoin.equipmanage.common.dto.EquiplistSpecificBySystemESVO;
import com.yeejoin.equipmanage.common.entity.EquipmentIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentAlarmLogDto; import com.yeejoin.equipmanage.common.entity.dto.EquipmentAlarmLogDto;
import com.yeejoin.equipmanage.common.exception.BaseException; import com.yeejoin.equipmanage.common.exception.BaseException;
import com.yeejoin.equipmanage.dao.ESequiplistSpecificBySystemRepository; import com.yeejoin.equipmanage.dao.ESequiplistSpecificBySystemRepository;
import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper;
import com.yeejoin.equipmanage.service.IESeqService; import com.yeejoin.equipmanage.service.IESeqService;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
...@@ -46,7 +49,8 @@ public class ESeqServiceImpl implements IESeqService { ...@@ -46,7 +49,8 @@ public class ESeqServiceImpl implements IESeqService {
@Autowired @Autowired
private ESequiplistSpecificBySystemRepository esequiplistSpecificBySystemRepository; private ESequiplistSpecificBySystemRepository esequiplistSpecificBySystemRepository;
@Autowired
private EquipmentIndexMapper equipmentIndexMapper;
@Value("${es.ESEquiplistSpecific.flag}") @Value("${es.ESEquiplistSpecific.flag}")
private Boolean flag; private Boolean flag;
...@@ -101,9 +105,14 @@ public class ESeqServiceImpl implements IESeqService { ...@@ -101,9 +105,14 @@ public class ESeqServiceImpl implements IESeqService {
Date daf =new Date(equiplistSpecificBySystemESVO.getTime()); Date daf =new Date(equiplistSpecificBySystemESVO.getTime());
String time=ft.format(daf); String time=ft.format(daf);
da.setTime(time); da.setTime(time);
String value=equiplistSpecificBySystemESVO.getValue(); // String value=equiplistSpecificBySystemESVO.getValue();
value= getReadableStatus(value ); // value= getReadableStatus(value );
da.setContent(equiplistSpecificBySystemESVO.getEquipmentIndexName()+":"+value); // da.setContent(equiplistSpecificBySystemESVO.getEquipmentIndexName()+":"+value);
QueryWrapper<EquipmentIndex> wrapper = new QueryWrapper<>();
wrapper.eq("name_key", equiplistSpecificBySystemESVO.getEquipmentIndexKey());
wrapper.last("limit 1");
EquipmentIndex index = equipmentIndexMapper.selectOne(wrapper);
da.setContent(index.getTypeName());
list.add(da); list.add(da);
} }
pageBean.setRecords(list); pageBean.setRecords(list);
......
...@@ -201,6 +201,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -201,6 +201,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Value("classpath:/json/equipmentCode.json") @Value("classpath:/json/equipmentCode.json")
private Resource equipmentCode; private Resource equipmentCode;
@Value("${equipment.pressurepump.start}")
private String pressurePumpStart;
private final String injection = "{\n" + private final String injection = "{\n" +
"\n" + "\n" +
...@@ -1924,17 +1927,18 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1924,17 +1927,18 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
if (!ObjectUtils.isEmpty(equipmentSpecificIndex)) { if (!ObjectUtils.isEmpty(equipmentSpecificIndex)) {
IotIndexInfoVo iotIndexInfoVo = new IotIndexInfoVo(); IotIndexInfoVo iotIndexInfoVo = new IotIndexInfoVo();
iotIndexInfoVo.setType(equipmentSpecificIndex.getTypeName()!=null?equipmentSpecificIndex.getTypeName(): equipmentSpecificIndex.getIndexName()); iotIndexInfoVo.setType(equipmentSpecificIndex.getTypeName()!=null?equipmentSpecificIndex.getTypeName(): equipmentSpecificIndex.getIndexName());
iotIndexInfoVo.setNumber(deviceName); iotIndexInfoVo.setNumber(deviceName);
if (equipmentSpecificIndex.getIsTrend() == 1) { if (equipmentSpecificIndex.getIsTrend() == 1) {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + entry.getValue() + equipmentSpecificIndex.getIndexUnitName()); iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + entry.getValue() + equipmentSpecificIndex.getIndexUnitName());
} else { } else {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getEquipmentIndexName()); if (pressurePumpStart.equals(equipmentSpecificIndex.getNameKey())) {
iotIndexInfoVo.setContent(TrueOrFalseEnum.real.value.equals(entry.getValue()) ? equipmentSpecificIndex.getEquipmentIndexName() : PressurePumpRelateEnum.STOP.getDesc());
} else {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getEquipmentIndexName());
}
} }
iotIndexInfoVo.setSendTime(dateStr); iotIndexInfoVo.setSendTime(dateStr);
infoVoList.add(iotIndexInfoVo); infoVoList.add(iotIndexInfoVo);
} }
......
...@@ -391,14 +391,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -391,14 +391,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
indexAddress = jsonObject.getString("scadaid"); indexAddress = jsonObject.getString("scadaid");
value = jsonObject.getInteger("value") == 1 ? "true" : "false"; value = jsonObject.getInteger("value") == 1 ? "true" : "false";
timeStamp = jsonObject.getString("timestamp"); timeStamp = jsonObject.getString("timestamp");
}else if (dataType.equals("analog")){ }else if (dataType.equals("discreate")){
indexAddress = jsonObject.getString("key"); indexAddress = jsonObject.getString("key");
value = jsonObject.getString("value"); value = jsonObject.getFloat("value") == 0.0 ? "false" : "true";
timeStamp = jsonObject.getString("time_stamp"); timeStamp = jsonObject.getString("time_stamp");
quality = jsonObject.getString("quality"); quality = jsonObject.getString("quality");
}else { }else {
indexAddress = jsonObject.getString("key"); indexAddress = jsonObject.getString("key");
value = jsonObject.getFloat("value") == 0.0 ? "false" : "true"; value = jsonObject.getString("value");
timeStamp = jsonObject.getString("time_stamp"); timeStamp = jsonObject.getString("time_stamp");
quality = jsonObject.getString("quality"); quality = jsonObject.getString("quality");
} }
...@@ -429,11 +429,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -429,11 +429,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
String iotCode = equipmentSpecific.getIotCode(); String iotCode = equipmentSpecific.getIotCode();
StringBuilder endIndex = new StringBuilder(iotCode).insert(8, '/'); StringBuilder endIndex = new StringBuilder(iotCode).insert(8, '/');
String iotTopic = "influxdb/" + endIndex; String iotTopic = "influxdb/" + endIndex;
if (isSendIot) { JSONObject msg = new JSONObject();
JSONObject msg = new JSONObject(); msg.put(equipmentSpeIndex.getEquipmentIndexKey(), value);
msg.put(equipmentSpeIndex.getEquipmentIndexKey(), value); mqttSendGateway.sendToMqtt(iotTopic, JSON.toJSONString(msg));
mqttSendGateway.sendToMqtt(iotTopic, JSON.toJSONString(msg));
}
List<EquipmentSpecificVo> eqIotCodeList = iEquipmentSpecificSerivce.getEquipAndCarIotcodeByIotcode(iotCode); List<EquipmentSpecificVo> eqIotCodeList = iEquipmentSpecificSerivce.getEquipAndCarIotcodeByIotcode(iotCode);
...@@ -2096,6 +2094,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2096,6 +2094,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
} }
// private void pressurePump(String indexKey, String indexValue, List<IotDataVO> iotDatalist, TopicEntityVo topicEntity) {
// List<String> listIndex = new ArrayList<>();
// listIndex.add(pressurePumpStart);
// // 获取全部启停泵信号
// List<EquipmentSpecificIndex> equipmentSpeIndexList = equipmentSpecificIndexService.getEquipmentSpeIndexByIndex(listIndex);
// List<PressurePumpEnum> enumListByCode = PressurePumpEnum.getEnumListByCode(indexValue);
//
// if (!CollectionUtils.isEmpty(enumListByCode)) {
// enumListByCode.forEach(pressurePumpEnum -> {
// // 1. 获取需要校验的值
// PressurePumpValueEnum valueEnum = PressurePumpValueEnum.getByCode(pressurePumpEnum.getCompareValue());
// assert valueEnum != null;
// EquipmentSpecificIndex data = getPressurePumpDateByType(indexKey, valueEnum, topicEntity, equipmentSpeIndexList, pressurePumpEnum);
// Date newDate = new Date();
// // 2. 校验
// if (!ObjectUtils.isEmpty(data.getUpdateDate())) {
// checkValueByDate(data, newDate, pressurePumpEnum);
// } else {
// // 稳压泵漏水告警恢复
// List<EquipmentSpecificIndex> collect = equipmentSpeIndexList.stream().filter(item -> !ObjectUtils.isEmpty(item.getIotCode()) && item.getIotCode().equals(topicEntity.getIotCode())).collect(Collectors.toList());
// if (!ObjectUtils.isEmpty(collect) && !ObjectUtils.isEmpty(collect.get(0)) && !ObjectUtils.isEmpty(collect.get(0).getEquipmentId())) {
// equipmentSpecificAlarmLogService.pressurePumpRestore(collect.get(0).getEquipmentId());
// }
// }
// });
// }
// }
private void pressurePump(String indexKey, String indexValue, List<IotDataVO> iotDatalist, TopicEntityVo topicEntity) { private void pressurePump(String indexKey, String indexValue, List<IotDataVO> iotDatalist, TopicEntityVo topicEntity) {
List<String> listIndex = new ArrayList<>(); List<String> listIndex = new ArrayList<>();
listIndex.add(pressurePumpStart); listIndex.add(pressurePumpStart);
...@@ -2103,6 +2129,21 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2103,6 +2129,21 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
List<EquipmentSpecificIndex> equipmentSpeIndexList = equipmentSpecificIndexService.getEquipmentSpeIndexByIndex(listIndex); List<EquipmentSpecificIndex> equipmentSpeIndexList = equipmentSpecificIndexService.getEquipmentSpeIndexByIndex(listIndex);
List<PressurePumpEnum> enumListByCode = PressurePumpEnum.getEnumListByCode(indexValue); List<PressurePumpEnum> enumListByCode = PressurePumpEnum.getEnumListByCode(indexValue);
if (TrueOrFalseEnum.fake.value.equals(indexValue)) {
String jobName = topicEntity.getIotCode() + "_" + indexKey;
String triggerName = PUMP_TRIGGER_NAME + "-" + topicEntity.getIotCode();
boolean b = QuartzManager.checkExists(jobName, PUMP_JOB_GROUP_NAME);
// 删除这个稳压泵的监听任务
if (b) {
QuartzManager.removeJob(jobName, PUMP_JOB_GROUP_NAME, triggerName, PUMP_TRIGGER_GROUP_NAME);
}
// 稳压泵漏水告警恢复
List<EquipmentSpecificIndex> collect = equipmentSpeIndexList.stream().filter(item -> !ObjectUtils.isEmpty(item.getIotCode()) && item.getIotCode().equals(topicEntity.getIotCode())).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(collect) && !ObjectUtils.isEmpty(collect.get(0)) && !ObjectUtils.isEmpty(collect.get(0).getEquipmentId())) {
equipmentSpecificAlarmLogService.pressurePumpRestore(collect.get(0).getEquipmentId());
}
}
if (!CollectionUtils.isEmpty(enumListByCode)) { if (!CollectionUtils.isEmpty(enumListByCode)) {
enumListByCode.forEach(pressurePumpEnum -> { enumListByCode.forEach(pressurePumpEnum -> {
// 1. 获取需要校验的值 // 1. 获取需要校验的值
...@@ -2122,7 +2163,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2122,7 +2163,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
}); });
} }
} }
private EquipmentSpecificIndex getPressurePumpDateByType(String indexKey, PressurePumpValueEnum valueEnum, TopicEntityVo topicEntity, List<EquipmentSpecificIndex> equipmentSpeIndexList, PressurePumpEnum pressurePumpEnum) { private EquipmentSpecificIndex getPressurePumpDateByType(String indexKey, PressurePumpValueEnum valueEnum, TopicEntityVo topicEntity, List<EquipmentSpecificIndex> equipmentSpeIndexList, PressurePumpEnum pressurePumpEnum) {
...@@ -2136,8 +2176,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2136,8 +2176,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} else { } else {
throw new BadRequest("装备物联编码错误,请确认!"); throw new BadRequest("装备物联编码错误,请确认!");
} }
String jobName = topicEntity.getIotCode() + "_" + indexKey;
String triggerName = PUMP_TRIGGER_NAME + "-" + topicEntity.getIotCode();
switch (valueEnum) { switch (valueEnum) {
case LAST_STOP: case LAST_STOP:
List<EquipmentSpecificIndex> lastStop = equipmentSpeIndexList.stream().filter(e -> List<EquipmentSpecificIndex> lastStop = equipmentSpeIndexList.stream().filter(e ->
...@@ -2149,19 +2188,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2149,19 +2188,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
break; break;
case LAST_START: case LAST_START:
boolean b = QuartzManager.checkExists(jobName, PUMP_JOB_GROUP_NAME);
// 删除这个稳压泵的监听任务
if (b) {
QuartzManager.removeJob(jobName, PUMP_JOB_GROUP_NAME, triggerName, PUMP_TRIGGER_GROUP_NAME);
}
List<EquipmentSpecificIndex> lastStart = equipmentSpeIndexList.stream().filter(e -> List<EquipmentSpecificIndex> lastStart = equipmentSpeIndexList.stream().filter(e ->
StringUtil.isNotEmpty(e.getValue()) && e.getIotCode().equals(iotCode) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed()) StringUtil.isNotEmpty(e.getValue()) && e.getIotCode().equals(iotCode) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
.collect(Collectors.toList()); .collect(Collectors.toList());
if (!CollectionUtils.isEmpty(lastStart)) { if (!CollectionUtils.isEmpty(lastStart)) {
EquipmentSpecificIndex aTrue = getIotDate(equipmentSpecificIndex, lastStart, prefix, suffix, "true"); EquipmentSpecificIndex aTrue = getIotDate(equipmentSpecificIndex, lastStart, prefix, suffix, "true");
BeanUtils.copyProperties(aTrue, equipmentSpecificIndex); BeanUtils.copyProperties(aTrue, equipmentSpecificIndex);
} }
break; break;
case LATELY_STOP: case LATELY_STOP:
...@@ -2176,12 +2208,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2176,12 +2208,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
break; break;
case LATELY_START: case LATELY_START:
List<EquipmentSpecificIndex> latelyStart = equipmentSpeIndexList.stream().filter(e -> List<EquipmentSpecificIndex> latelyStart = equipmentSpeIndexList.stream().filter(e ->
StringUtil.isNotEmpty(e.getValue()) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed()) StringUtil.isNotEmpty(e.getValue()) && e.getIotCode().equals(iotCode) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
.collect(Collectors.toList()); .collect(Collectors.toList());
if (!CollectionUtils.isEmpty(latelyStart)) { if (!CollectionUtils.isEmpty(latelyStart)) {
EquipmentSpecificIndex aTrue = getIotDate(equipmentSpecificIndex, latelyStart, prefix, null, "true"); EquipmentSpecificIndex aTrue = getIotDateExceptSelf(equipmentSpecificIndex, latelyStart, prefix, suffix, "true");
BeanUtils.copyProperties(aTrue, equipmentSpecificIndex); BeanUtils.copyProperties(aTrue, equipmentSpecificIndex);
} }
break; break;
case PUMP_START_TIME: case PUMP_START_TIME:
...@@ -2195,14 +2226,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2195,14 +2226,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private EquipmentSpecificIndex getIotDate(EquipmentSpecificIndex equipmentSpecificIndex, List<EquipmentSpecificIndex> listData, String prefix, String suffix, String flag) { private EquipmentSpecificIndex getIotDate(EquipmentSpecificIndex equipmentSpecificIndex, List<EquipmentSpecificIndex> listData, String prefix, String suffix, String flag) {
ResponseModel start = iotFeign.selectOne(remoteSecurityService.getServerToken().getAppKey(), remoteSecurityService.getServerToken().getProduct(), remoteSecurityService.getServerToken().getToke(), "1", prefix, suffix, flag, pressurePumpStart); ResponseModel start = iotFeign.selectOne(remoteSecurityService.getServerToken().getAppKey(), remoteSecurityService.getServerToken().getProduct(), remoteSecurityService.getServerToken().getToke(), "2", prefix, suffix, flag, pressurePumpStart);
if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) { if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) {
String json1 = JSON.toJSONString(start.getResult()); String json1 = JSON.toJSONString(start.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1); List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList()); List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList());
Date startDate = null;
if (1 < collect.size()) {
String startTime = collect.get(1).get("time").substring(0, 19).replace("T", " ");
startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTime), +8);
}
listData.get(0).setUpdateDate(startDate);
BeanUtils.copyProperties(listData.get(0), equipmentSpecificIndex);
}
return equipmentSpecificIndex;
}
String startTime = collect.get(0).get("time").substring(0, 19).replace("T", " "); private EquipmentSpecificIndex getIotDateExceptSelf(EquipmentSpecificIndex equipmentSpecificIndex, List<EquipmentSpecificIndex> listData, String prefix, String suffix, String flag) {
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTime), +8); ResponseModel start = iotFeign.selectOne(remoteSecurityService.getServerToken().getAppKey(), remoteSecurityService.getServerToken().getProduct(), remoteSecurityService.getServerToken().getToke(), "100", prefix, null, flag, pressurePumpStart + "," + "deviceName");
if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) {
String json1 = JSON.toJSONString(start.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
listObject1 = listObject1.stream().filter(x -> !suffix.equalsIgnoreCase(x.get("deviceName"))).collect(Collectors.toList());
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList());
Date startDate = null;
if (0 < collect.size()) {
String startTime = collect.get(0).get("time").substring(0, 19).replace("T", " ");
startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTime), +8);
}
listData.get(0).setUpdateDate(startDate); listData.get(0).setUpdateDate(startDate);
BeanUtils.copyProperties(listData.get(0), equipmentSpecificIndex); BeanUtils.copyProperties(listData.get(0), equipmentSpecificIndex);
} }
......
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.equipmanage.common.dto.FireRiskSourceDto; import com.yeejoin.equipmanage.common.dto.FireRiskSourceDto;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.enums.DynamicLabelEnum;
import com.yeejoin.equipmanage.common.enums.EquipQrcodeColorEnum;
import com.yeejoin.equipmanage.common.enums.RiskSourceTypeEnum;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.utils.TreeNodeUtil; import com.yeejoin.equipmanage.common.utils.TreeNodeUtil;
import com.yeejoin.equipmanage.mapper.RiskSourceMapper; import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexService;
import com.yeejoin.equipmanage.service.IRiskSourceService; import com.yeejoin.equipmanage.service.IRiskSourceService;
import liquibase.pro.packaged.E;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import java.util.List; import java.text.SimpleDateFormat;
import java.util.*;
@Slf4j
@Service("riskSourceService") @Service("riskSourceService")
public class RiskSourceServiceImpl implements IRiskSourceService { public class RiskSourceServiceImpl implements IRiskSourceService {
static IEquipmentSpecificIndexService equipmentSpecificIndexService;
@Autowired @Autowired
private RiskSourceMapper riskSourceMapper; private RiskSourceMapper riskSourceMapper;
@Autowired
private EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired
EquipmentDetailMapper equipmentDetailMapper;
@Autowired
private ManufacturerInfoMapper manufacturerInfoMapper;
@Autowired
private FireFightingSystemMapper fireFightingSystemMapper;
@Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Override @Override
@Transactional @Transactional
public List<FireRiskSourceDto> getFiskSourceTierTree(Integer tier, Boolean isRegion) { public List<FireRiskSourceDto> getFiskSourceTierTree(Integer tier, Boolean isRegion) {
...@@ -38,5 +67,175 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -38,5 +67,175 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} }
return Lists.newArrayList(); return Lists.newArrayList();
} }
public RiskBizInfoVo getEquipmentToRiskInfo(String source, String id, String indexKey){
String equipmentSpecId = null;
SendToMsgRiskDetailVo detailVo = new SendToMsgRiskDetailVo();
SendToMsgRiskEquipInfoVo equipInfoVo = new SendToMsgRiskEquipInfoVo();
SendToMsgRiskAlarmInfoVo equipAlarm = new SendToMsgRiskAlarmInfoVo();
if (source.equalsIgnoreCase(RiskSourceTypeEnum.PATROL.getName())) {
List<Map<String, Object>> checkInputItems = equipmentSpecificMapper.queryCheckInputItemsByCheckId(id);
Map<String, Object> map = checkInputItems.get(0);
if (map.containsKey("equipId")) {
equipmentSpecId = String.valueOf(map.get("equipId"));
Map<String, Object> pointMap = equipmentSpecificMapper.getPointById(Long.valueOf(String.valueOf(map.get("pointId"))));
equipAlarm.setIndexNo(String.valueOf(pointMap.get("id")));
equipAlarm.setName(String.valueOf(pointMap.get("pointName")));
equipAlarm.setIndexNo(String.valueOf(pointMap.get("pointNo")));
equipAlarm.setKey(String.valueOf(map.get("inputItem")));
equipAlarm.setValue(String.valueOf(map.get("input_value")));
equipInfoVo.setName(String.valueOf(map.get("inputItem")));
equipInfoVo.setValue(String.valueOf(map.get("input_value")));
equipInfoVo.setCode(String.valueOf(map.get("item_no")));
equipInfoVo.setBizOrgCode(String.valueOf(map.get("biz_org_code")));
equipInfoVo.setBizOrgName(String.valueOf(map.get("biz_org_name")));
}
} else if (source.equalsIgnoreCase(RiskSourceTypeEnum.EQUIP.getName())) {
equipmentSpecId = id;
QueryWrapper<EquipmentSpecificIndex> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("equipment_specific_id", equipmentSpecId);
queryWrapper.eq("equipment_index_key", indexKey);
EquipmentSpecificIndex equipmentSpeIndex = equipmentSpecificIndexMapper.selectOne(queryWrapper);
equipAlarm.setKey(indexKey);
equipAlarm.setValue(equipmentSpeIndex.getValue());
equipAlarm.setAlarmContent(equipmentSpeIndex.getEquipmentName() + equipmentSpeIndex.getEquipmentIndexName());
equipAlarm.setAlarmDate(equipmentSpeIndex.getUpdateDate());
equipInfoVo.setName(equipmentSpeIndex.getEquipmentSpecificName());
equipInfoVo.setCode(equipmentSpeIndex.getEquipmentSpecificCode());
equipInfoVo.setReportIsAlarm(Boolean.TRUE);
equipInfoVo.setEquipSpeId(equipmentSpecId);
} else {
equipmentSpecId = id;
}
equipInfoVo.setId(equipmentSpecId);
if (StringUtil.isNotEmpty(equipmentSpecId)) {
EquipmentSpecific specific = equipmentSpecificMapper.selectById(equipmentSpecId);
equipInfoVo.setPosition(specific.getPosition());
equipInfoVo.setManufacturerName(getEquipmentDetailInfo(specific.getEquipmentDetailId()).getManufacturerName());
equipInfoVo.setSystemIds(specific.getSystemId());
equipInfoVo.setSystemName(getSystemNameBySpeId(specific));
equipInfoVo.setQrCode(specific.getQrCode());
equipInfoVo.setCodeColor(EquipQrcodeColorEnum.getEnumByKey(specific.getEquipStatus()).getColor());
equipInfoVo.setBatchNo(getEquipmentDetailInfo(specific.getEquipmentDetailId()).getStandard());
equipInfoVo.setBizOrgCode(specific.getBizOrgCode());
equipInfoVo.setBizOrgName(specific.getBizOrgName());
if (source.equalsIgnoreCase(RiskSourceTypeEnum.HIDDENDANGER.getName()) || source.equalsIgnoreCase(RiskSourceTypeEnum.DEFECT.getName())) {
equipInfoVo.setName(specific.getName());
equipInfoVo.setCode(specific.getCode());
equipInfoVo.setReportIsAlarm(Boolean.TRUE);
equipInfoVo.setEquipSpeId(equipmentSpecId);
}
}
detailVo.setEquipInfo(equipInfoVo);
detailVo.setAlarmInfo(equipAlarm);
RiskBizInfoVo infoVo = new RiskBizInfoVo();
infoVo.setWarningObjectName(detailVo.getEquipInfo().getName());
infoVo.setWarningObjectCode(detailVo.getEquipInfo().getCode());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
infoVo.setWarningTime(sdf.format(new Date()));
infoVo.setSourceAttribution(detailVo.getEquipInfo().getBizOrgCode());
infoVo.setSourceAttributionDesc(detailVo.getEquipInfo().getBizOrgName());
infoVo.setWarningObjectCode(detailVo.getEquipInfo().getId());
List<RiskDynamicDetailsVo> detailsVos = new ArrayList<>();
RiskDynamicDetailsVo dynamicDetailsVo = new RiskDynamicDetailsVo();
dynamicDetailsVo.setTabName("装备指标联动数据");
List<TableContentVo> contentVos = new ArrayList<>();
for (DynamicLabelEnum u : DynamicLabelEnum.values()) {
TableContentVo contentVo = new TableContentVo();
contentVo.setKey(u.getCode());
switch (u.getCode()) {
case "name":
contentVo.setLabel(u.getDescribe());
contentVo.setValue(equipInfoVo.getName());
contentVo.setType("text");
break;
case "code":
contentVo.setLabel(u.getDescribe());
contentVo.setValue(equipInfoVo.getCode());
contentVo.setType("text");
break;
case "position":
contentVo.setLabel(u.getDescribe());
contentVo.setValue(equipInfoVo.getPosition());
contentVo.setType("text");
break;
case "manufacturer":
contentVo.setLabel(u.getDescribe());
contentVo.setValue(equipInfoVo.getManufacturerName());
contentVo.setType("text");
break;
case "systemName":
contentVo.setLabel(u.getDescribe());
contentVo.setValue(equipInfoVo.getSystemName());
contentVo.setType("text");
break;
case "qrCode":
contentVo.setLabel(u.getDescribe());
Map<String, Object> map = new HashMap<>();
map.put("qrCode", equipInfoVo.getQrCode());
map.put("color", equipInfoVo.getCodeColor());
contentVo.setValue(map);
contentVo.setType("qrcode");
break;
case "alarmContent":
contentVo.setLabel(u.getDescribe());
contentVo.setValue(equipAlarm.getAlarmContent());
contentVo.setType("text");
break;
case "alarmDate":
contentVo.setLabel(u.getDescribe());
contentVo.setValue(equipAlarm.getAlarmDate());
contentVo.setType("text");
break;
default:
log.info("方法参数错误 !!!");
break;
}
contentVos.add(contentVo);
}
dynamicDetailsVo.setTabContent(contentVos);
detailsVos.add(dynamicDetailsVo);
infoVo.setDynamicDetails(detailsVos);
return infoVo;
}
public EquipmentDetail getEquipmentDetailInfo(long id) {
EquipmentDetail detail = equipmentDetailMapper.selectById(id);
if (ObjectUtils.isEmpty(detail.getManufacturerId())) {
detail.setManufacturerName("");
return detail;
}
ManufacturerInfo info = manufacturerInfoMapper.selectById(detail.getManufacturerId());
detail.setManufacturerName(info.getName());
return Optional.ofNullable(detail).orElse(detail);
}
public String getSystemNameBySpeId(EquipmentSpecific equipmentSpecific) {
List<FireFightingSystemEntity> sys = new ArrayList<>();
String[] ids;
String sysIds = equipmentSpecific.getSystemId();
if (StringUtil.isNotEmpty(sysIds)) {
if (-1 != sysIds.indexOf(",")) {
ids = sysIds.split(",");
sys = fireFightingSystemMapper.getFightingSysByIds(ids);
} else {
FireFightingSystemEntity entity = fireFightingSystemMapper.selectById(Long.valueOf(sysIds));
sys.add(entity);
}
}
StringBuilder sb = new StringBuilder();
sys.forEach(x -> {
if (0 < sb.length()) {
sb.append(",");
}
sb.append(x.getName());
});
return sb.toString();
}
} }
...@@ -7,12 +7,7 @@ import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper; ...@@ -7,12 +7,7 @@ import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService; import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -33,19 +28,12 @@ public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImporta ...@@ -33,19 +28,12 @@ public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImporta
@Override @Override
public List<Map<String, List<VideoImportantEquipmentVo>>> getVideoList(Map<String, Object> map) { public List<Map<String, List<VideoImportantEquipmentVo>>> getVideoList(Map<String, Object> map) {
ArrayList<Map<String, List<VideoImportantEquipmentVo>>> maps = new ArrayList<>();
List<VideoImportantEquipmentVo> videoList = videoImportantEquipmentMapper.getVideoList(map); List<VideoImportantEquipmentVo> videoList = videoImportantEquipmentMapper.getVideoList(map);
List<String> videoAddressGroupList = videoImportantEquipmentMapper.getVideoAddressGroupList(map); return videoList.stream()
for (String address : videoAddressGroupList) { .collect(Collectors.groupingBy(VideoImportantEquipmentVo::getAddress,LinkedHashMap::new,Collectors.toList()))
if (!ObjectUtils.isEmpty(address)) { .entrySet().stream()
List<VideoImportantEquipmentVo> collect = videoList.stream().filter(item -> item.getAddress().equals(address)).collect(Collectors.toList()); .map(entry -> Collections.singletonMap(entry.getKey(), entry.getValue()))
if (collect.size() > 0) { .collect(Collectors.toList());
HashMap<String, List<VideoImportantEquipmentVo>> listMap = new HashMap<>();
listMap.put(address, collect);
maps.add(listMap);
}
}
}
return maps;
} }
} }
...@@ -48,6 +48,8 @@ public class StartLoader implements ApplicationRunner { ...@@ -48,6 +48,8 @@ public class StartLoader implements ApplicationRunner {
loadSysParams(); loadSysParams();
// 监听中心级登录信息 // 监听中心级登录信息
ccsToStationUserInfo.saveUserInfoToRedis(); ccsToStationUserInfo.saveUserInfoToRedis();
ccsToStationUserInfo.test();
} }
public void loadSysParams(){ public void loadSysParams(){
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jcs.api.entity.Organization; import com.yeejoin.amos.boot.module.jcs.api.entity.Organization;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser; import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationMapper;
...@@ -51,6 +52,18 @@ public class OrganizationUserController extends BaseController { ...@@ -51,6 +52,18 @@ public class OrganizationUserController extends BaseController {
return ResponseHelper.buildResponse(organizationUserService.updateModelById(organizationUser)); return ResponseHelper.buildResponse(organizationUserService.updateModelById(organizationUser));
} }
/**
* 编辑应急小组成员
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateByTel", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "编辑应急小组成员", notes = "编辑应急小组成员")
public ResponseModel updateModelByTel(@RequestBody OrganizationUser organizationUser){
organizationUserService.updateModelByTel(organizationUser);
return CommonResponseUtil.success();
}
@GetMapping(value = "/getDetailsById") @GetMapping(value = "/getDetailsById")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取详情", notes = "获取详情") @ApiOperation(httpMethod = "GET", value = "获取详情", notes = "获取详情")
...@@ -66,6 +79,15 @@ public class OrganizationUserController extends BaseController { ...@@ -66,6 +79,15 @@ public class OrganizationUserController extends BaseController {
return ResponseHelper.buildResponse(organizationUserService.getListPage(pageNumber, pageSize, id)); return ResponseHelper.buildResponse(organizationUserService.getListPage(pageNumber, pageSize, id));
} }
@GetMapping(value = "/page")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "卡片值长列表", notes = "卡片值长列表")
public ResponseModel<IPage<OrganizationUser>> getPage(@RequestParam(value = "pageNumber", required = false) int pageNumber,
@RequestParam(value = "pageSize", required = false) int pageSize,
@RequestParam(value = "tel", required = false) String tel) {
return ResponseHelper.buildResponse(organizationUserService.getPage(pageNumber, pageSize, tel));
}
@GetMapping(value = "/deleteById") @GetMapping(value = "/deleteById")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "删除", notes = "根据id删除") @ApiOperation(httpMethod = "GET", value = "删除", notes = "根据id删除")
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.yeejoin.amos.boot.module.jcs.api.dto.AuthDataDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AuthDataDto;
import com.yeejoin.amos.boot.module.jcs.api.service.ICcsToStationUserInfo; import com.yeejoin.amos.boot.module.jcs.api.service.ICcsToStationUserInfo;
import com.yeejoin.amos.boot.module.jcs.biz.config.StartLoader; import com.yeejoin.amos.boot.module.jcs.biz.config.StartLoader;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage; import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
...@@ -17,9 +21,15 @@ import org.typroject.tyboot.component.cache.Redis; ...@@ -17,9 +21,15 @@ import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.cache.enumeration.CacheType; import org.typroject.tyboot.component.cache.enumeration.CacheType;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.component.emq.EmqxListener; import org.typroject.tyboot.component.emq.EmqxListener;
import org.typroject.tyboot.core.auth.face.model.SsoSessionsModel;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.xml.crypto.Data;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
...@@ -78,9 +88,13 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo { ...@@ -78,9 +88,13 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo {
if (!ValidationUtil.isEmpty(obj)) { if (!ValidationUtil.isEmpty(obj)) {
JSONObject json = JSON.parseObject(obj); JSONObject json = JSON.parseObject(obj);
JSONObject body = JSON.parseObject(JSON.toJSONString(json.get("body"))); JSONObject body = JSON.parseObject(JSON.toJSONString(json.get("body")));
SsoSessionsModel ssoSessionsModel = new SsoSessionsModel();
AuthDataDto authData = JSON.parseObject(JSON.toJSONString(body.get("authData")), AuthDataDto.class); AuthDataDto authData = JSON.parseObject(JSON.toJSONString(body.get("authData")), AuthDataDto.class);
if (!ObjectUtils.isEmpty(authData)) { try {
createSession(authData); BeanUtils.copyProperties(authData, ssoSessionsModel);
createSession(ssoSessionsModel);
} catch (Exception e) {
logger.error("同步用户登录信息失败:{}", e.getMessage());
} }
} }
} }
...@@ -90,7 +104,48 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo { ...@@ -90,7 +104,48 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo {
} }
} }
private void createSession(AuthDataDto authData) { @Override
public void test() {
try {
emqKeeper.subscript("zxjlc/cs", 0, new EmqxListener() {
@Override
public void processMessage(String s, MqttMessage mqttMessage) throws MqttException {
byte[] payload = mqttMessage.getPayload();
String obj = new String(payload);
if (!ValidationUtil.isEmpty(obj)) {
JSONObject json = JSON.parseObject(obj);
String isOk = JSON.toJSONString(json.get("is_ok"));
if (!"1".equals(isOk)) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("indexKey", "TEST20230508WB");
jsonObject.put("indexValue", json.get("is_ok"));
jsonObject.put("traceId", json.get("id"));
JSONObject jsonObject1 = new JSONObject();
JSONObject jsonObject2 = new JSONObject();
JSONArray jsonArray = new JSONArray();
jsonObject1.put("warningObjectName", "巡检点");
jsonObject1.put("warningObjectCode", json.get("input_id"));
jsonObject1.put("sourceAttribution", "LSHLZ1yOrS3WfXqzjn");
jsonObject1.put("sourceAttributionDesc", "鄱阳湖");
jsonObject2.put("tabName", "页签");
jsonObject2.put("tabContent", new ArrayList<>());
jsonArray.add(jsonObject2);
jsonObject1.put("dynamicDetails", jsonArray);
jsonObject.put("bizInfo", jsonObject1);
emqKeeper.getMqttClient().publish("patrol/data/analysis", jsonObject.toJSONString().getBytes(StandardCharsets.UTF_8), 1, false);
// mqttSendGateway.sendToMqtt("patrol/data/analysis", JSON.toJSONString(jsonObject));
}
}
}
});
} catch (Exception e) {
logger.info("订阅中心级用户登录信息异常>>{}", e.getMessage());
}
}
private void createSession(SsoSessionsModel authData) {
this.removeSession(authData.getActionByProduct(),authData.getLoginId()); this.removeSession(authData.getActionByProduct(),authData.getLoginId());
...@@ -114,14 +169,14 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo { ...@@ -114,14 +169,14 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo {
private void removeSession(String actionByProduct ,String loginId) { private void removeSession(String actionByProduct ,String loginId) {
AuthDataDto sessionsModel = (AuthDataDto)this.redisTemplate.opsForValue().get(sessionCacheKeyWithLoginId(loginId,actionByProduct)); SsoSessionsModel sessionsModel = (SsoSessionsModel)this.redisTemplate.opsForValue().get(sessionCacheKeyWithLoginId(loginId,actionByProduct));
if(!ObjectUtils.isEmpty(sessionsModel)) { if(!ObjectUtils.isEmpty(sessionsModel)) {
this.redisTemplate.delete(sessionCacheKeyWithLoginId(loginId,actionByProduct)); this.redisTemplate.delete(sessionCacheKeyWithLoginId(loginId,actionByProduct));
this.redisTemplate.delete(sessionCacheKeyWithToken(sessionsModel.getToken(),actionByProduct)); this.redisTemplate.delete(sessionCacheKeyWithToken(sessionsModel.getToken(),actionByProduct));
AuthDataDto model = queryByUserId(sessionsModel.getUserId()); SsoSessionsModel model = queryByUserId(sessionsModel.getUserId());
if(!ObjectUtils.isEmpty(model) && model.getToken().equals(sessionsModel.getToken())) { if(!ObjectUtils.isEmpty(model) && model.getToken().equals(sessionsModel.getToken())) {
this.redisTemplate.delete(sessionCacheKeyWithUserId(sessionsModel.getUserId())); this.redisTemplate.delete(sessionCacheKeyWithUserId(sessionsModel.getUserId()));
...@@ -146,8 +201,8 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo { ...@@ -146,8 +201,8 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo {
return Redis.genKey(CacheType.ERASABLE.name(),SESSION_USERID,userId); return Redis.genKey(CacheType.ERASABLE.name(),SESSION_USERID,userId);
} }
private AuthDataDto queryByUserId(String userId) { private SsoSessionsModel queryByUserId(String userId) {
return (AuthDataDto) this.redisTemplate.opsForValue().get(sessionCacheKeyWithUserId(userId)); return (SsoSessionsModel) this.redisTemplate.opsForValue().get(sessionCacheKeyWithUserId(userId));
} }
......
...@@ -53,7 +53,7 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or ...@@ -53,7 +53,7 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
} else { } else {
// 跟现场确认此处值长只有一人,所以只做一人处理 // 跟现场确认此处值长只有一人,所以只做一人处理
leaderMap.put("name", resMap.get("name") + " " + "1人"); leaderMap.put("name", resMap.get("name") + " " + "1人");
leaderMap.put("value", resMap.get("value") + "-" + resMap.get("tel")); leaderMap.put("value", resMap.get("value") + ( ObjectUtils.isNotEmpty(resMap.get("tel")) ? "-" + resMap.get("tel") : "" ));
} }
res.add(leaderMap); res.add(leaderMap);
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.util.StringUtil;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser; import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationUserMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationUserMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IOrganizationUserService; import com.yeejoin.amos.boot.module.jcs.api.service.IOrganizationUserService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.stream.Collectors;
@Service @Service
public class OrganizationUserImpl extends BaseService<OrganizationUser,OrganizationUser, OrganizationUserMapper> implements IOrganizationUserService { public class OrganizationUserImpl extends BaseService<OrganizationUser,OrganizationUser, OrganizationUserMapper> implements IOrganizationUserService {
@Override @Override
...@@ -24,6 +30,31 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat ...@@ -24,6 +30,31 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
} }
@Override @Override
public void updateModelByTel(OrganizationUser organizationUser) {
QueryWrapper<OrganizationUser> oldQuery = new QueryWrapper<>();
oldQuery.eq("duty_leader", 1);
List<OrganizationUser> oldList = this.baseMapper.selectList(oldQuery);
if (0 < oldList.size()) {
oldList.forEach(x -> {
x.setDutyLeader(false);
this.baseMapper.updateById(x);
});
}
LambdaQueryWrapper<OrganizationUser> wrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(organizationUser.getTelephone())) {
wrapper.eq(OrganizationUser::getTelephone, organizationUser.getTelephone());
} else if (!ObjectUtils.isEmpty(organizationUser.getSequenceNbr())) {
wrapper.eq(OrganizationUser::getSequenceNbr, organizationUser.getSequenceNbr());
}
List<OrganizationUser> newList = this.baseMapper.selectList(wrapper);
newList.forEach(x -> {
x.setDutyLeader(true);
this.baseMapper.updateById(x);
});
}
@Override
public OrganizationUser getDetailsById(Long id) { public OrganizationUser getDetailsById(Long id) {
return this.baseMapper.selectById(id); return this.baseMapper.selectById(id);
} }
...@@ -44,6 +75,22 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat ...@@ -44,6 +75,22 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
} }
@Override @Override
public IPage<OrganizationUser> getPage(int pageNumber, int pageSize, String tel) {
Page<OrganizationUser> page = new Page<>();
page.setSize(pageSize);
page.setCurrent(pageNumber);
LambdaQueryWrapper<OrganizationUser> wrapper = new LambdaQueryWrapper<>();
if (StringUtil.isNotEmpty(tel)) {
wrapper.eq(OrganizationUser::getTelephone, tel);
}
wrapper.eq(OrganizationUser::getIsDelete, false);
wrapper.orderByDesc(OrganizationUser::getSort);
wrapper.groupBy(OrganizationUser::getTelephone);
return this.baseMapper.selectPage(page, wrapper);
}
@Override
public int deleteById(Long id) { public int deleteById(Long id) {
return this.baseMapper.deleteById(id); return this.baseMapper.deleteById(id);
} }
......
package com.yeejoin.amos.patrol.business.controller; package com.yeejoin.amos.patrol.business.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.patrol.business.constants.XJConstant; import com.yeejoin.amos.patrol.business.constants.XJConstant;
...@@ -50,10 +51,8 @@ import javax.xml.transform.*; ...@@ -50,10 +51,8 @@ import javax.xml.transform.*;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import java.io.*; import java.io.*;
import java.util.Date; import java.text.SimpleDateFormat;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors; import java.util.stream.Collectors;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</parent> </parent>
<artifactId>amos-boot-system-equip</artifactId> <artifactId>amos-boot-system-equip</artifactId>
<version>3.7.0.9</version> <version>3.7.1.0</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
......
...@@ -241,7 +241,9 @@ ...@@ -241,7 +241,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '920322', '%' ) wes.equipment_code LIKE concat( '920322', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp ) temp
</select> </select>
...@@ -319,8 +321,10 @@ ...@@ -319,8 +321,10 @@
wl_equipment_specific wes wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '921003', '%' ) wes.equipment_code LIKE concat( '921003', '%')
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) UNION AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) UNION
( (
SELECT SELECT
...@@ -344,7 +348,9 @@ ...@@ -344,7 +348,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '921002', '%' ) wes.equipment_code LIKE concat( '921002', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) UNION ) UNION
( (
...@@ -369,7 +375,9 @@ ...@@ -369,7 +375,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '921004', '%' ) wes.equipment_code LIKE concat( '921004', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) UNION ) UNION
( (
...@@ -394,7 +402,9 @@ ...@@ -394,7 +402,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '921005', '%' ) wes.equipment_code LIKE concat( '921005', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) )
</select> </select>
......
...@@ -2374,6 +2374,56 @@ ...@@ -2374,6 +2374,56 @@
ppc.equipment_id = #{id} ppc.equipment_id = #{id}
</select> </select>
<select id="queryCheckInputItemsByCheckId" resultType="Map">
SELECT
c.id,
c.point_id pointId,
ii.item_no,
ii.NAME inputItem,
ci.input_value,
CASE
ci.is_ok
WHEN 1 THEN
'合格'
WHEN 2 THEN
'不合格' ELSE '漏检'
END AS is_ok,
ii.biz_org_code,
ii.biz_org_name,
ci.score ,
ci.id as traceId,
ppc.equipment_id as equipId
FROM
p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item ii ON ii.id = ci.input_id
LEFT JOIN p_point_classify ppc on ci.point_classify_id = ppc.id
WHERE
c.id = #{checkId}
ORDER BY
ci.order_no
</select>
<select id="getPointById" resultType="Map">
SELECT
p.id,
p.route_name routeName,
p.point_no pointNo,
p.NAME pointName,
(CASE p.is_fixed
WHEN 1 THEN
'固定点'
ELSE
'移动点'
END) fixed,
p.charge_person_name userName,
p.biz_org_name departmentName,
IFNULL(p.risk_source_id, '') as buildingId,
p.remark,
p.offline
FROM
p_point p
where p.id = #{pointId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -727,7 +727,15 @@ ...@@ -727,7 +727,15 @@
(SELECT name from wl_equipment_specific where id = wlesal.equipment_specific_id) AS fireEquipmentName, (SELECT name from wl_equipment_specific where id = wlesal.equipment_specific_id) AS fireEquipmentName,
wlesal.equipment_index_id AS fireEquipmentIndexId, wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey, wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName, (
SELECT
type_name
FROM
wl_signal_classify sc
WHERE
sc.type_code = wlesal.type
LIMIT 1
) AS fireEquipmentSpecificIndexName,
if(wlesal.confirm_type IS NULL, 0, 1) AS confirmType, if(wlesal.confirm_type IS NULL, 0, 1) AS confirmType,
if(wlesal.clean_time IS NULL, 0, 1) AS cleanStatus, if(wlesal.clean_time IS NULL, 0, 1) AS cleanStatus,
CASE CASE
......
...@@ -44,18 +44,4 @@ ...@@ -44,18 +44,4 @@
</where> </where>
ORDER BY v.create_date DESC ORDER BY v.create_date DESC
</select> </select>
<select id="getVideoAddressGroupList" resultType="java.lang.String">
SELECT
v.address
FROM
wl_video v
<where>
<if test="importantEquipmentId != null">
v.id in (select video_id from wl_video_important_equipment
where important_equipment_id = #{importantEquipmentId})
</if>
</where>
GROUP BY v.address
ORDER BY v.create_date DESC
</select>
</mapper> </mapper>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<artifactId>amos-boot-system-jcs</artifactId> <artifactId>amos-boot-system-jcs</artifactId>
<version>3.7.0.9</version> <version>3.7.1.0</version>
<dependencies> <dependencies>
<dependency> <dependency>
......
...@@ -3894,4 +3894,16 @@ ...@@ -3894,4 +3894,16 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="ky" id="2023-07-24">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_organization_user" columnName="duty_leader"/>
</not>
</preConditions>
<comment>cb_organization_user add column</comment>
<sql>
alter table `cb_organization_user` add column `duty_leader` bit(1) NULL DEFAULT b'0' COMMENT '是否是值长'
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -83,17 +83,17 @@ emqx.max-inflight=1000 ...@@ -83,17 +83,17 @@ emqx.max-inflight=1000
# 下面个配置默认站端 中心级系统的时候注释掉上边 放开下边 # 下面个配置默认站端 中心级系统的时候注释掉上边 放开下边
#站端配置 #站端配置
#需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 #需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
kafka.topics=null #kafka.topics=JKXT2BP-XFZX-Topic
#需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created, #需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created,
emq.topic=emq.xf.created,emq.iot.created,emq.patrol.created,emq.sign.created,emq.bussSign.created,emq.user.created #emq.topic=emq.xf.created,emq.iot.created,emq.patrol.created,emq.sign.created,emq.bussSign.created,emq.user.created,emq.risk.created,emq.mcb.zxj
##中心级配置配置 ##中心级配置配置
##需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 ##需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
#kafka.topics=JKXT2BP-XFYY-Topic kafka.topics=JKXT2BP-XFYY-Topic
# #
##需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created, ##需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created,
#emq.topic= emq.topic=ccs-user-login-info,sync.execute,data/mcb/warning
queue.kafka.topics=null queue.kafka.topics=null
kafka.auto-startup=false kafka.auto-startup=false
\ No newline at end of file
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