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