Commit e847d424 authored by maoying's avatar maoying

Merge branch 'develop_dl' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl

parents d4cd7199 4bea5f0a
...@@ -9,6 +9,7 @@ import com.yeejoin.equipmanage.service.IEmergencyService; ...@@ -9,6 +9,7 @@ import com.yeejoin.equipmanage.service.IEmergencyService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import liquibase.pro.packaged.B;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -55,10 +56,14 @@ public class EmergencyController extends AbstractBaseController { ...@@ -55,10 +56,14 @@ public class EmergencyController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("系统告警统计") @ApiOperation("系统告警统计")
@GetMapping(value = "/system/alarm") @GetMapping(value = "/system/alarm")
public ResponseModel getSystemAlarmCount(@RequestParam(required = false) String status) { public ResponseModel getSystemAlarmCount(@RequestParam(value = "status",required = false) String status,
ReginParams reginParams = getSelectedOrgInfo(); @RequestParam(value = "current",required = false) int current,
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode(); @RequestParam(value = "size",required = false) int size,
return CommonResponseUtil.success(iEmergencyService.getSystemAlarmCount(bizOrgCode,status)); @RequestParam(value = "bizOrgCode",required = false)String bizOrgCode) {
if (current > 0){
current = (current-1)*size;
}
return CommonResponseUtil.success(iEmergencyService.getSystemAlarmCount(status,current,size, bizOrgCode));
} }
/** /**
......
...@@ -58,7 +58,7 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -58,7 +58,7 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object>> getSystemState(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getSystemState(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getSystemAlarmCount(@Param("bizOrgCode") String bizOrgCode,@Param("status") String status); List<Map<String, Object>> getSystemAlarmCount(@Param("status") String status,@Param("current") int current,@Param("size") int size,@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getCAFSWaterTankInfo(); List<Map<String, Object>> getCAFSWaterTankInfo();
......
...@@ -17,8 +17,7 @@ public interface IEmergencyService { ...@@ -17,8 +17,7 @@ public interface IEmergencyService {
* @return * @return
*/ */
List<Map<String, Object>> getSystemState(String bizOrgCode); List<Map<String, Object>> getSystemState(String bizOrgCode);
List<Map<String, Object>> getSystemAlarmCount(String status, int current, int size,String bizOrgCode);
List<Map<String, Object>> getSystemAlarmCount(String bizOrgCode, String status);
/** /**
* @return * @return
......
...@@ -86,20 +86,16 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -86,20 +86,16 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override @Override
public List<Map<String, Object>> getSystemAlarmCount(String bizOrgCode, String status) { public List<Map<String, Object>> getSystemAlarmCount(String status, int current, int size, String bizOrgCode) {
List<Map<String, Object>> list = emergencyMapper.getSystemAlarmCount(bizOrgCode,status); List<Map<String, Object>> list = emergencyMapper.getSystemAlarmCount(status,current,size,bizOrgCode);
if (0 < list.size()) { if (0 < list.size()) {
list.forEach(x -> { list.forEach(x -> {
List<Map<String, Object>> list1 = new ArrayList(); x.put("statis", x.get("status"));
Map<String, Object> map = new HashMap<>();
map.put("name", x.get("status"));
if ("正常".equals(String.valueOf(x.get("status")))) { if ("正常".equals(String.valueOf(x.get("status")))) {
map.put("level", "success"); x.put("level", "success");
} else { } else {
map.put("level", "warning"); x.put("level", "warning");
} }
list1.add(map);
x.put("status", list1);
}); });
} }
return list; return list;
......
...@@ -85,10 +85,8 @@ public class SafetyPreCtrlController extends AbstractBaseController { ...@@ -85,10 +85,8 @@ public class SafetyPreCtrlController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "巡检点统计", notes = "巡检点统计") @ApiOperation(value = "巡检点统计", notes = "巡检点统计")
@RequestMapping(value = "/countPointData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/countPointData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public HashMap<String, Object> countPointData() { public HashMap<String, Object> countPointData(@RequestParam(required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo(); Map<String,Object> List= pointService.countPointData(bizOrgCode);
String loginOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
Map<String,Object> List= pointService.countPointData(loginOrgCode);
HashMap<String, Object> temph = new HashMap<>(); HashMap<String, Object> temph = new HashMap<>();
temph.put("result",List); temph.put("result",List);
......
...@@ -1438,13 +1438,19 @@ public class PointServiceImpl implements IPointService { ...@@ -1438,13 +1438,19 @@ public class PointServiceImpl implements IPointService {
int today_num = Integer.parseInt(maps.get("today_num").toString()); int today_num = Integer.parseInt(maps.get("today_num").toString());
int miss_num = Integer.parseInt(maps.get("miss_num").toString()); int miss_num = Integer.parseInt(maps.get("miss_num").toString());
String passRate = ""; String passRate = "";
String passMiss = "";
if (over_num == 0) { if (over_num == 0) {
passRate = 0+""; passRate = 0+"";
}else { }else {
passRate = getPercent(over_num, today_num); passRate = getPercent(over_num, today_num);
} }
today_num = miss_num+today_num; today_num = miss_num+today_num;
String passMiss = getPercent(miss_num, today_num); if (miss_num == 0) {
passMiss = 0+"";
}else {
passMiss = getPercent(miss_num, today_num);
}
maps.put("passRate",passRate); maps.put("passRate",passRate);
maps.put("passMiss",passMiss); maps.put("passMiss",passMiss);
return maps; return maps;
......
...@@ -38,39 +38,54 @@ ...@@ -38,39 +38,54 @@
<select id="getSystemAlarmCount" resultType="Map"> <select id="getSystemAlarmCount" resultType="Map">
SELECT * FROM SELECT
(SELECT *
FROM
(
SELECT
`fs`.`id` AS `key`, `fs`.`id` AS `key`,
`fs`.`name` AS `name`, `fs`.`name` AS `name`,
`fs`.system_type_code AS systemTypeCode, `fs`.system_type_code AS systemTypeCode,
`fs`.`code` AS code, `fs`.`code` AS CODE,
( select count(*) FROM (select id FROM wl_equipment_specific_alarm_log WHERE system_codes = fs.code and clean_time is null GROUP BY equipment_specific_id) b) as alarmNum , `fs`.`biz_org_code` AS bizOrgCode,
`fs`.`biz_org_name` AS bizOrgName,
(
SELECT
count( * )
FROM
( SELECT id FROM wl_equipment_specific_alarm_log WHERE system_codes = fs.CODE AND clean_time IS NULL GROUP BY equipment_specific_id ) b
) AS alarmNum,
IF IF
((( (
(
(
SELECT SELECT
count( `wesa`.`equipment_specific_id` ) count( `wesa`.`equipment_specific_id` )
FROM FROM
`wl_equipment_specific_alarm` `wesa` `wl_equipment_specific_alarm` `wesa`
WHERE WHERE
( 0 <![CDATA[<>]]> find_in_set( `fs`.`id`, `wesa`.`system_ids` ) AND `wesa`.`status` = 1)) > 0), ( 0 <![CDATA[<>]]> find_in_set( `fs`.`id`, `wesa`.`system_ids` ) AND `wesa`.`status` = 1 )
) > 0
),
'异常', '异常',
'正常' '正常'
) AS `status` ) AS `status`
FROM FROM
`f_fire_fighting_system` `fs` `f_fire_fighting_system` `fs`
where
fs.system_type_code IS NOT NULL AND LENGTH(TRIM(fs.system_type_code)) > 0 AND fs.system_type_code != 'otherSys'
AND fs.biz_org_code like concat('LSHLZ1yOrS3WfXqzjn', '%')
GROUP BY GROUP BY
`fs`.`id` `fs`.`id`
ORDER BY ORDER BY
`fs`.`sort`) sys fs.biz_org_name
) sys
<where> <where>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
sys.status = #{status} sys.status = #{status}
</if> </if>
<if test="bizOrgCode != null and bizOrgCode != ''">
sys.bizOrgCode like concat('%',#{bizOrgCode},'%')
</if>
</where> </where>
LIMIT #{current},#{size}
</select> </select>
<select id="getCAFSWaterTankInfo" resultType="Map"> <select id="getCAFSWaterTankInfo" resultType="Map">
......
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