| | |
| | | List<DeptVo> deptVos = deptFeignApi.selDeptList(); |
| | | |
| | | List<AlarmVO> page = alarmService.getAlarming(alarmVO); |
| | | |
| | | for (int j = 0; j < page.size(); j++) { |
| | | if (null!=page.get(j).getDeptId()){ |
| | | String[] split = page.get(j).getDeptId().split(","); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询当前保安需要处理和未处理的警情信息 |
| | | * @param alarmVO 需包含保安人员id,状态 status 1 查当前保安收到的警情和已接收的警情,已处理完成的 2:未接收的 3:处理完成的 |
| | | * @param response |
| | | * @param query 分页对象 |
| | | * @return |
| | | */ |
| | | @GetMapping("/APP-getAlarmListPage") |
| | | public R getAlarmListPage(AlarmVO alarmVO, HttpServletResponse response,Query query) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | //获取部门数据 |
| | | List<DeptVo> deptVos = deptFeignApi.selDeptList(); |
| | | |
| | | List<AlarmVO> page = new ArrayList<>(); |
| | | //不分页的情况 |
| | | if (null == query.getCurrent()) { |
| | | //获取警情数量的集合 |
| | | map.put("number",alarmService.getAlarmNumber(alarmVO)); |
| | | //获取警情数据 |
| | | page = alarmService.getAlarmList(alarmVO); |
| | | } |
| | | for (int j = 0; j < page.size(); j++) { |
| | | if (null!=page.get(j).getDeptId()){ |
| | | String[] split = page.get(j).getDeptId().split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | StringBuffer deptNameBuiffer = new StringBuffer(); |
| | | //数据匹配封装 |
| | | for (String deptId:list) { |
| | | for (DeptVo deptVo:deptVos) { |
| | | if (deptId.equals(deptVo.getId().toString())){ |
| | | deptNameBuiffer.append(deptVo.getDeptName()).append(","); |
| | | } |
| | | } |
| | | } |
| | | //封装部门名称数据 |
| | | page.get(j).setDeptName(deptNameBuiffer.substring(0,deptNameBuiffer.length()-1)); |
| | | } |
| | | } |
| | | //封装数据 |
| | | map.put("page",page); |
| | | //返回数据 |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * APP警情接受 |
| | | * @param alarmVO |
| | | * @param response |
| | |
| | | * @return |
| | | */ |
| | | int updateReceivingAlarmPoliceInfo(@Param("alarm") Alarm alarm); |
| | | |
| | | |
| | | /** |
| | | * 查询当前保安需要处理和未处理以及处理完成的警情信息 |
| | | * @param alarmVO 需包含保安人员id,状态 status 1 查当前保安收到的警情和已接收的警情,已处理完成的 2:未接收的 3:处理完成的 |
| | | * @return |
| | | */ |
| | | List<AlarmVO> getAlarmList(@Param("alarm")AlarmVO alarmVO); |
| | | |
| | | /** |
| | | * 查询当前保安所有的警情信息 |
| | | * @param alarmVO 需包含保安人员id,状态 status 1 查当前保安收到的警情和已接收的警情,已处理完成的 |
| | | * @return |
| | | */ |
| | | List<AlarmVO> getAllAlarmList(@Param("alarm")AlarmVO alarmVO); |
| | | |
| | | /** |
| | | * 获取警情数量的集合,全部,未处理,已处理的数量 |
| | | * @param alarmVO 需包含保安人员id |
| | | * @return |
| | | */ |
| | | List<Integer> getAlarmNumber(@Param("alarm")AlarmVO alarmVO); |
| | | } |
| | |
| | | sys_alarm a |
| | | LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber |
| | | WHERE |
| | | |
| | | <if test="alarm.securityArr!=null and alarm.securityArr!=''"> |
| | | securityId = "" or securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityArr},'%') |
| | |
| | | <if test="alarm.id!=null and alarm.id!=''"> |
| | | a.id = #{alarm.id} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="getAlarming" resultMap="alarmResultMap"> |
| | |
| | | |
| | | </select> |
| | | |
| | | |
| | | <sql id="getAlarmListSqlParam"> |
| | | select a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.content,a.waringType,a.bz, |
| | | a.deviceNumber,a.region,e.district,a.vaddress,a.aaddress, |
| | | a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,a.cid, |
| | | a.securityArr,a.securityId, |
| | | e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone, |
| | | e.stype, |
| | | e.oneId, |
| | | e.twoId, |
| | | e.threeId, |
| | | e.deptId, |
| | | e.deviceName, |
| | | a.place as place, |
| | | e.channelNumber |
| | | FROM |
| | | sys_alarm a |
| | | LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber |
| | | WHERE |
| | | 1=1 |
| | | </sql> |
| | | |
| | | <!--查询当前保安所有警情信息--> |
| | | <select id="getAllAlarmList" resultMap="alarmResultMap"> |
| | | (select * from ( |
| | | <include refid="getAlarmListSqlParam"/> |
| | | and securityId =#{alarm.securityId} and jtype = 1 order by alarmTime limit 9999 |
| | | )a) |
| | | union |
| | | (select * from ( |
| | | <include refid="getAlarmListSqlParam"/> |
| | | and securityId = "" or securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityId},'%') |
| | | order by alarmTime desc limit 9999 |
| | | )a) |
| | | union |
| | | (select * from ( |
| | | <include refid="getAlarmListSqlParam"/> |
| | | and securityId =#{alarm.securityId} and jtype = 2 order by alarmTime desc limit 9999 |
| | | )a) |
| | | </select> |
| | | |
| | | <!--查询当前保安需要处理和未处理的警情信息--> |
| | | <select id="getAlarmList" resultMap="alarmResultMap"> |
| | | <include refid="getAlarmListSqlParam"/> |
| | | <if test="alarm.status==2"> |
| | | and securityId = "" or securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityId},'%') |
| | | order by alarmTime desc |
| | | </if> |
| | | <if test="alarm.status==3"> |
| | | and securityId =#{alarm.securityId} and jtype = 2 |
| | | order by alarmTime desc |
| | | </if> |
| | | </select> |
| | | |
| | | <!--获取警情数量的集合,全部,未处理,已处理的数量--> |
| | | <select id="getAlarmNumber" resultType="java.lang.Integer"> |
| | | (select ifnull(count(*),0) number from sys_alarm |
| | | where securityId =#{alarm.securityId} |
| | | or securityId = "" or securityId IS NULL |
| | | and securityArr LIKE concat('%',#{alarm.securityId},'%')) |
| | | |
| | | union |
| | | (select ifnull(count(*),0) number from sys_alarm |
| | | where securityId = "" or securityId IS NULL |
| | | and securityArr LIKE concat('%',#{alarm.securityId},'%')) |
| | | |
| | | union |
| | | (select ifnull(count(*),0) number from sys_alarm |
| | | where securityId =#{alarm.securityId} and jtype = 2) |
| | | </select> |
| | | |
| | | <update id="setAlarm"> |
| | | update sys_alarm SET securityId=#{alarm.securityId} where id=#{alarm.id} |
| | | </update> |
| | |
| | | * @return |
| | | */ |
| | | boolean updateReceivingAlarmPoliceInfo(Alarm alarm); |
| | | |
| | | /** |
| | | * 查询当前保安需要处理和未处理的警情信息 |
| | | * @param alarmVO 需包含保安人员id,状态 status 1 查当前保安收到的警情和已接收的警情,已处理完成的 2:未接收的 3:处理完成的 |
| | | * @return |
| | | */ |
| | | List<AlarmVO> getAlarmList(AlarmVO alarmVO); |
| | | |
| | | /** |
| | | * 获取警情数量的集合,全部,未处理,已处理的数量 |
| | | * @param alarmVO 需包含保安人员id |
| | | * @return |
| | | */ |
| | | List<Integer> getAlarmNumber(AlarmVO alarmVO); |
| | | } |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 查询当前保安需要处理和未处理的警情信息 |
| | | * @param alarmVO 需包含保安人员id,状态 status 1 查当前保安收到的警情和已接收的警情,已处理完成的 2:未接收的 3:处理完成的 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<AlarmVO> getAlarmList(AlarmVO alarmVO) { |
| | | |
| | | return alarmVO.getStatus()==1?baseMapper.getAllAlarmList(alarmVO):baseMapper.getAlarmList(alarmVO); |
| | | } |
| | | |
| | | /** |
| | | * 获取警情数量的集合,全部,未处理,已处理的数量 |
| | | * @param alarmVO 需包含保安人员id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Integer> getAlarmNumber(AlarmVO alarmVO) { |
| | | return baseMapper.getAlarmNumber(alarmVO); |
| | | } |
| | | } |
| | |
| | | private String manufacturers; |
| | | private String deviceName; |
| | | |
| | | /** |
| | | * 状态 status 1 查当前保安收到的警情和已接收的警情,已处理完成的 2:未接收的 3:处理完成的 |
| | | */ |
| | | private Integer status; |
| | | |
| | | |
| | | } |