Commit 101d3358 authored by tianyiming's avatar tianyiming

跑马灯修改

parent 79e527eb
...@@ -182,10 +182,10 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -182,10 +182,10 @@ public class EquipmentAlarmController extends AbstractBaseController {
* *
* @return * @return
*/ */
@RequestMapping(value = "/listPage", method = RequestMethod.GET) @RequestMapping(value = "/allList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", produces = "application/json;charset=UTF-8", notes = "列表分页查询") @ApiOperation(httpMethod = "GET", value = "列表分页查询", produces = "application/json;charset=UTF-8", notes = "列表分页查询")
public ResponseModel list(@RequestParam(value = "beginDate", required = false) String beginDate, public ResponseModel allList(@RequestParam(value = "beginDate", required = false) String beginDate,
@RequestParam(value = "endDate", required = false) String endDate, @RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "warehouseStructureName", required = false) String warehouseStructureName, @RequestParam(value = "warehouseStructureName", required = false) String warehouseStructureName,
@RequestParam(value = "equipCode", required = false) String equipCode, @RequestParam(value = "equipCode", required = false) String equipCode,
...@@ -268,7 +268,7 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -268,7 +268,7 @@ public class EquipmentAlarmController extends AbstractBaseController {
request13.setValue(""); request13.setValue("");
} }
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.pageList(param); List<Map<String, Object>> list = iEquipmentSpecificAlarmService.allList(param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
......
...@@ -2,7 +2,9 @@ package com.yeejoin.equipmanage.mapper; ...@@ -2,7 +2,9 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.MarqueeData; import com.yeejoin.equipmanage.common.entity.MarqueeData;
import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -12,6 +14,6 @@ import java.util.Map; ...@@ -12,6 +14,6 @@ import java.util.Map;
public interface MarqueeDataMapper extends BaseMapper<MarqueeData> { public interface MarqueeDataMapper extends BaseMapper<MarqueeData> {
List<Map<String, Object>> selectAll(); List<Map<String, Object>> selectAll(@Param("param") CommonPageInfoParam param);
} }
...@@ -96,7 +96,7 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif ...@@ -96,7 +96,7 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
List<Map<String, Object>> alarmTrend(String bizOrgCode); List<Map<String, Object>> alarmTrend(String bizOrgCode);
Page<Map<String, Object>> pageList(CommonPageInfoParam param); List<Map<String, Object>> allList(CommonPageInfoParam param);
int updateReadStatus(String messageId); int updateReadStatus(String messageId);
} }
...@@ -749,17 +749,14 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -749,17 +749,14 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
} }
@Override @Override
public Page<Map<String, Object>> pageList(CommonPageInfoParam param) { public List<Map<String, Object>> allList(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
if (AlarmTypeEnum.GZGJ.getCode().equals(param.getAlarmType())) { if (AlarmTypeEnum.GZGJ.getCode().equals(param.getAlarmType())) {
param.setAlarmType(""); param.setAlarmType("");
param.setIsFireAlarm("false"); param.setIsFireAlarm("false");
} }
Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param); List<Map<String, Object>> list = marqueeDataMapper.selectAll(param);
if (resultPage.getTotal() > 0) { if (list.size() > 0) {
for (Map<String, Object> x : resultPage.getRecords()) { for (Map<String, Object> x : list) {
// LocalDateTime createDate = (LocalDateTime) x.get("createDate");
// x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant()));
if (ObjectUtils.isEmpty(x.get("handleType"))) { if (ObjectUtils.isEmpty(x.get("handleType"))) {
x.put("handleType", null); x.put("handleType", null);
} else { } else {
...@@ -770,14 +767,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -770,14 +767,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
x.put("equipmentSpecificIndexName", x.get("fireEquipmentSpecificIndexName")); x.put("equipmentSpecificIndexName", x.get("fireEquipmentSpecificIndexName"));
} }
} }
List<Map<String, Object>> list = marqueeDataMapper.selectAll(); return list;
List<Map<String, Object>> resList = new ArrayList();
for (Map<String, Object> stringObjectMap : list) {
resList.add(stringObjectMap);
}
resList.sort((t1, t2) -> t2.get("createDate").toString().compareTo(t1.get("createDate").toString()));
resultPage.setRecords(resList);
return resultPage;
} }
@Override @Override
......
...@@ -3,21 +3,100 @@ ...@@ -3,21 +3,100 @@
<mapper namespace="com.yeejoin.equipmanage.mapper.MarqueeDataMapper"> <mapper namespace="com.yeejoin.equipmanage.mapper.MarqueeDataMapper">
<select id="selectAll" resultType="java.util.Map"> <select id="selectAll" resultType="java.util.Map">
select SELECT
id messageId, wlesal.id,
type equipmentSpecificIndexName, wlesal.org_code,
position, wlesal.equipment_specific_id AS fireEquipmentId,
name equipmentSpecificName, wles.equipment_detail_id AS equipDetailId,
date_format( wles.CODE AS fireEquipmentCode,
create_date, wles.system_id AS systemId,
'%Y-%m-%d %H:%i:%s' IF
) createDate, (
message_type messageType, wles.CODE IS NULL,
is_read isRead, wlesal.equipment_specific_name,
equipment_specific_id id concat( wlesal.equipment_specific_name, '(', wles.CODE, ')' )) AS fireEquipmentName,
from concat( wlesal.equipment_specific_name, wlesal.equipment_specific_index_name ) AS alamContent,
wl_marquee_data IF
where ( wlesal.confirm_type IS NULL, '未处理', '已处理' ) handleStatus,
is_read = '0' IF
( wlesal.clean_time IS NOT NULL, '已消除', '未消除' ) cleanStatus,
confirm_type AS handleType,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wles.warehouse_structure_id AS buildId,
we.img AS imgUrl,
CASE
wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否' ELSE wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesal.type AS typeCode,
( SELECT type_name FROM wl_signal_classify sc WHERE sc.type_code = wlesal.type LIMIT 1 ) AS type,
date_format( wlesal.create_date, '%Y-%m-%d %H:%i:%s' ) createDate,
CONCAT_WS( ' ', wles.position, wled.area ) AS warehouseStructureName,
/*告警列表拼接详细地址*/
(
SELECT
group_concat( fet.`name` )
FROM
f_equipment_fire_equipment AS fefe
LEFT JOIN f_equipment AS fet ON fet.id = fefe.equipment_id
WHERE
fefe.fire_equipment_id = wlesal.equipment_specific_id
) AS equipmentName,
wlesal.equipment_specific_name AS equipmentSpecificName,
wles.position,
null messageId,
null messageType,
null isRead
FROM wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
<where>
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2">
wlesal.clean_time IS NULL
</if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''">AND
wles.biz_org_code like concat (#{param.bizOrgCode},'%')
</if>
</where>
UNION ALL
SELECT
equipment_specific_id id,
NULL org_code,
null fireEquipmentId,
NULL equipDetailId,
NULL fireEquipmentCode,
null systemId,
NULL fireEquipmentName,
NULL alamContent,
NULL handleStatus,
NULL cleanStatus,
NULL handleType,
NULL fireEquipmentIndexId,
NULL fireEquipmentSpecificIndexKey,
type fireEquipmentSpecificIndexName,
NULL buildId,
NULL imgUrl,
NULL fireEquipmentPointValue,
NULL typeCode,
NULL type,
date_format( create_date, '%Y-%m-%d %H:%i:%s' ) createDate,
NULL warehouseStructureName,
NULL equipmentName,
NAME equipmentSpecificName,
position,
id messageId,
message_type messageType,
is_read isRead
FROM
wl_marquee_data
WHERE
is_read = '0'
ORDER BY createDate DESC
</select> </select>
</mapper> </mapper>
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