Commit 047862f8 authored by chenzhao's avatar chenzhao

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp
parents 9294fce7 bebdeb71
...@@ -14,6 +14,7 @@ import org.aspectj.lang.JoinPoint; ...@@ -14,6 +14,7 @@ import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -32,6 +33,8 @@ public class PersonIdentifyAspect { ...@@ -32,6 +33,8 @@ public class PersonIdentifyAspect {
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
private IOrgUsrService orgUsrService; private IOrgUsrService orgUsrService;
@Value("${logic}")
Boolean logic;
@Before(value = "@annotation(com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify) && @annotation(permission)") @Before(value = "@annotation(com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify) && @annotation(permission)")
public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException { public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException {
...@@ -41,12 +44,19 @@ public class PersonIdentifyAspect { ...@@ -41,12 +44,19 @@ public class PersonIdentifyAspect {
UserDto userDto = orgUsrService.getUserParentInfo(userId); UserDto userDto = orgUsrService.getUserParentInfo(userId);
ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity(); ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
// TODO 没有绑定机场单位的人员,则赋值不存在的bizOrgCode,规避查询出所有数据 // TODO 没有绑定机场单位的人员,则赋值不存在的bizOrgCode,规避查询出所有数据
personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode()); // personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode());
personIdentity.setCompanyId(userDto.getCompanyId()); personIdentity.setCompanyId(userDto.getCompanyId());
personIdentity.setCompanyName(userDto.getCompanyName()); personIdentity.setCompanyName(userDto.getCompanyName());
personIdentity.setPersonSeq(userDto.getPersonSeq()); personIdentity.setPersonSeq(userDto.getPersonSeq());
personIdentity.setPersonName(userDto.getPersonName()); personIdentity.setPersonName(userDto.getPersonName());
personIdentity.setIdentityType(userDto.getIdentityType()); personIdentity.setIdentityType(userDto.getIdentityType());
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getCompanyBizOrgCode()) ? "-1" : userDto.getCompanyBizOrgCode());
}else{
personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode());
}
personIdentity.setCompanyBizOrgCode(userDto.getCompanyBizOrgCode()); personIdentity.setCompanyBizOrgCode(userDto.getCompanyBizOrgCode());
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
......
...@@ -157,6 +157,9 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc ...@@ -157,6 +157,9 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
* @return * @return
*/ */
Page<Map<String, Object>> getPersonInfoByPage(Page page, @Param("bizOrgCode") String bizOrgCode); Page<Map<String, Object>> getPersonInfoByPage(Page page, @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> dutyCardCount();
List<Map<String, Object>> dutyCardList ();
} }
...@@ -26,6 +26,14 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -26,6 +26,14 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
//BUG 2880 by litw start 2021年9月16日 //BUG 2880 by litw start 2021年9月16日
List<OrgUsr> selectAllChildrenList(@Param("map")Map<String, Object> map); List<OrgUsr> selectAllChildrenList(@Param("map")Map<String, Object> map);
int getUserByPeopleTypeCount(@Param("map")Map<String, Object> map);
List<Map<String, Object>> getUserByPeopleType(@Param("map")Map<String, Object> map);
List<OrgUsr> selectCompanyDepartmentMsg(); List<OrgUsr> selectCompanyDepartmentMsg();
List<Map<String, Object>> selectPersonAllList(Map<String, Object> map); List<Map<String, Object>> selectPersonAllList(Map<String, Object> map);
...@@ -144,4 +152,5 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -144,4 +152,5 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> companyUserTreeByUserAndTypeALL(@Param("bizorgcode") String bizorgcode); List<OrgUsr> companyUserTreeByUserAndTypeALL(@Param("bizorgcode") String bizorgcode);
List<Map<String, Object>> getFireProtectionAndMaintenance();
} }
...@@ -51,4 +51,6 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> { ...@@ -51,4 +51,6 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> {
Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page, @Param("nameOrCode") String nameOrCode, @Param("bizOrgCode") String bizOrgCode, @Param("systemName") String systemName); Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page, @Param("nameOrCode") String nameOrCode, @Param("bizOrgCode") String bizOrgCode, @Param("systemName") String systemName);
Map<String, Object> getWaterResourceInfoList(@Param("map") Map<String, Object> map); Map<String, Object> getWaterResourceInfoList(@Param("map") Map<String, Object> map);
Map<String, Object> getResourcesCount();
} }
...@@ -34,6 +34,11 @@ public interface IDutyCommonService { ...@@ -34,6 +34,11 @@ public interface IDutyCommonService {
*/ */
IPage<Map<String, Object>> pageListDetail(int current, int size, String beginDate, String endDate, String bizOrgCode) throws ParseException; IPage<Map<String, Object>> pageListDetail(int current, int size, String beginDate, String endDate, String bizOrgCode) throws ParseException;
List<Map<String, Object>> dutyCardCount()throws ParseException;
List<Map<String, Object>> dutyCardList()throws ParseException;
/** /**
* 值班明细 * 值班明细
* *
...@@ -47,7 +52,6 @@ public interface IDutyCommonService { ...@@ -47,7 +52,6 @@ public interface IDutyCommonService {
* *
* @param beginDate * @param beginDate
* @param endDate * @param endDate
* @param dutyType
* @return * @return
* @throws ParseException * @throws ParseException
*/ */
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -376,4 +377,7 @@ public interface IOrgUsrService { ...@@ -376,4 +377,7 @@ public interface IOrgUsrService {
List<OrgMenuDto> companyUserTreeByUserAndTypeAll(String bizorgcode); List<OrgMenuDto> companyUserTreeByUserAndTypeAll(String bizorgcode);
List<DynamicFormInstance> selectTelById(List<String> ids, String type); List<DynamicFormInstance> selectTelById(List<String> ids, String type);
List<FirefightersPost> selectPostById(List<String> ids);
} }
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceZhDto; import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceZhDto;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 接口类 * 接口类
...@@ -36,4 +37,5 @@ public interface IWaterResourceService { ...@@ -36,4 +37,5 @@ public interface IWaterResourceService {
* */ * */
WaterResourceDto selectBySequenceNbr(Long id); WaterResourceDto selectBySequenceNbr(Long id);
Map<String, Object> getResourcesCount();
} }
...@@ -675,4 +675,132 @@ WHERE ...@@ -675,4 +675,132 @@ WHERE
HAVING HAVING
peopleType = 1602 peopleType = 1602
</select> </select>
<select id="dutyCardCount" resultType="java.util.Map">
SELECT
'fire' as peopleType,
count(*) as total
from
(SELECT
c.sequence_nbr as id,
c.biz_org_name as userName,
IFNULL( cf.mobile_phone, '' ) telephone,
'驻站消防员' as peopleType
FROM
cb_org_usr c
RIGHT JOIN cb_sign cs ON c.sequence_nbr = cs.USER_ID
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL
AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' )
GROUP BY
cs.USER_ID
ORDER BY
cs.sign_time DESC) d
union all
SELECT
(CASE b.peopleType
WHEN 1602 THEN
'run'
ELSE
'overhaul'
END) peopleType,
count( * ) as total
FROM
(
SELECT
ou.sequence_nbr AS id,
ou.biz_org_name AS userName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'telephone' THEN field_value END ), '' ) AS telephone,
IF
(
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END ) = '',
NULL,
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END )
) AS postTypeName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'personImg' THEN field_value END ), '' ) AS personImg,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
(
SELECT
IFNULL( max( CASE WHEN fi.field_code = 'userId' THEN fi.field_value END ), ps.instance_id ) AS id
FROM
cb_duty_person_shift ps
LEFT JOIN cb_dynamic_form_instance fi ON fi.instance_id = ps.instance_id
WHERE
ps.duty_date = CURRENT_DATE
GROUP BY
fi.instance_id
) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
GROUP BY
a.id
) b WHERE b.peopleType in ('1602','1604')
GROUP BY
peopleType
</select>
<select id="dutyCardList" resultType="java.util.Map">
(SELECT
c.sequence_nbr as id,
c.biz_org_name as userName,
IFNULL( cf.mobile_phone, '' ) telephone,
'1601' as peopleType
FROM
cb_org_usr c
RIGHT JOIN cb_sign cs ON c.sequence_nbr = cs.USER_ID
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL
AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' )
GROUP BY
cs.USER_ID
ORDER BY
cs.sign_time DESC)
UNION all
(SELECT
id,
userName,
telephone,
peopleType
FROM
(
SELECT
ou.sequence_nbr AS id,
ou.biz_org_name AS userName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'telephone' THEN field_value END ), '' ) AS telephone,
IF
(
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END ) = '',
NULL,
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END )
) AS postTypeName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'personImg' THEN field_value END ), '' ) AS personImg,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
(
SELECT
IFNULL( max( CASE WHEN fi.field_code = 'userId' THEN fi.field_value END ), ps.instance_id ) AS id
FROM
cb_duty_person_shift ps
LEFT JOIN cb_dynamic_form_instance fi ON fi.instance_id = ps.instance_id
WHERE
ps.duty_date = CURRENT_DATE
GROUP BY
fi.instance_id
) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
GROUP BY
a.id
) b WHERE b.peopleType in ('1602','1604'))
</select>
</mapper> </mapper>
...@@ -1206,4 +1206,85 @@ LEFT JOIN ( ...@@ -1206,4 +1206,85 @@ LEFT JOIN (
GROUP BY biz_org_name GROUP BY biz_org_name
</select> </select>
<select id="getUserByPeopleTypeCount" resultType="Integer">
select
count(*)
from (
SELECT
DISTINCT
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
g.telephone,
g.positionType
FROM
cb_org_usr u
LEFT JOIN
( SELECT
v.`instance_id`,
max(case v.field_code when 'telephone' then IFNULL(v.field_value,'') end) telephone,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,'') end) positionType,
max(case v.field_code when 'peopleType' then IFNULL(v.field_value,'') end) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) g
on u.sequence_nbr = g.instance_id
where
u.biz_org_type = 'person'
AND
u.is_delete = 0
and g.peopleType=1601
GROUP BY
u.sequence_nbr
order by u.rec_date desc
)a where a.sequenceNbr is not null
</select>
<select id="getUserByPeopleType" resultType="Map">
SET @rownum = #{map.pageNum};
select
@rownum := @rownum + 1 AS rownum,
a.* from (
SELECT
DISTINCT
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
g.telephone,
g.positionType
FROM
cb_org_usr u
LEFT JOIN
( SELECT
v.`instance_id`,
max(case v.field_code when 'telephone' then IFNULL(v.field_value,'') end) telephone,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,'') end) positionType,
max(case v.field_code when 'peopleType' then IFNULL(v.field_value,'') end) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) g
on u.sequence_nbr = g.instance_id
where
u.biz_org_type = 'person'
AND
u.is_delete = 0
and g.peopleType=1601
GROUP BY
u.sequence_nbr
order by u.rec_date desc
)a where a.sequenceNbr is not null
LIMIT #{map.pageNum}, #{map.pageSize}
</select>
</mapper> </mapper>
...@@ -239,4 +239,49 @@ ...@@ -239,4 +239,49 @@
</if> </if>
) AS fireWaterTank ) AS fireWaterTank
</select> </select>
<select id="getResourcesCount" resultType="java.util.Map">
SELECT
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'hydrant' ) AS hydrant,
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'pool' ) AS pool,
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'waterTank' ) AS waterTank,
(
SELECT
count( * ) AS total
FROM
(
SELECT
ou.biz_org_name,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) a
WHERE
a.peopleType = '1601'
) fire,
(
SELECT
count( * ) AS total
FROM
(
SELECT
ou.biz_org_name,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) a
WHERE
a.peopleType = '1602'
) run
</select>
</mapper> </mapper>
...@@ -895,6 +895,75 @@ public class DateUtils { ...@@ -895,6 +895,75 @@ public class DateUtils {
return dates; return dates;
} }
public static List<Map<String, String>> getWeeksMapInterval(String date){
List<Map<String, String>> dates = new ArrayList<>();
String year = date.substring(0,4);
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
Date date1 = null;
try {
date1 = dateFormat.parse(date);
} catch (ParseException e) {
System.out.println("获取当前月自然周,日期格式转换错误!11");
e.printStackTrace();
}
Calendar calendar = new GregorianCalendar();
calendar.setTime(date1);
int days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
int count = 0;
for (int i = 1; i <= days; i++) {
DateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
Date date2 = null;
try {
date2 = dateFormat1.parse(date + "-" + i);
} catch (ParseException e) {
System.out.println("获取当前月自然周,日期格式转换错误!22");
e.printStackTrace();
}
calendar.clear();
calendar.setTime(date2);
int k = new Integer(calendar.get(Calendar.DAY_OF_WEEK));
int startDay = 0;
int endDay = 0;
// 若当天是周日
if (k == 1) {
count++;
if (i - 6 <= 1) {
startDay = 1;
} else {
startDay = i - 6;
}
endDay = i;
}
// 若是本月最好一天,且不是周日
if (k != 1 && i == days) {
count++;
startDay = i - k + 2;
endDay = i;
}
if(startDay != 0 && endDay != 0){
String s = "";
String weekStart = year + "-"+ date.substring(5) +"-" +startDay +" 00:00:00";
String weekEnd = year + "-"+ date.substring(5) +"-" +endDay +" 23:59:59";
if("12".equals(date.substring(5)) && weekOfYear(date2) == 1 ){
long week = Long.valueOf(dates.get(dates.size()-1).get("name").substring(5,7)) + 1;
s = year + "第" + week + "周" + "(" + date.substring(5) + "月" + startDay +
"日至" + date.substring(5) + "月" + endDay + "日" +")";
} else {
s = year + "第" + getWeekOfYear(date2) + "周" + "(" + date.substring(5) + "月" + startDay +
"日至" + date.substring(5) + "月" + endDay + "日" +")";
}
HashMap<String, String> map = new HashMap<>();
map.put("name",s);
map.put("weekStart",weekStart);
map.put("weekEnd",weekEnd);
dates.add(map);
}
}
return dates;
}
/** /**
* 获取一年的第几周 * 获取一年的第几周
* *
...@@ -908,6 +977,14 @@ public class DateUtils { ...@@ -908,6 +977,14 @@ public class DateUtils {
return week_of_year; return week_of_year;
} }
public static int weekOfYear(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
c.setFirstDayOfWeek(Calendar.MONDAY);
int week_of_year = c.get(Calendar.WEEK_OF_YEAR);
return week_of_year;
}
/** /**
* 获得本月的开始时间,即2012-01-01 00:00:00 * 获得本月的开始时间,即2012-01-01 00:00:00
* *
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
AND cdfi.field_code = 'userId' AND cdfi.field_code = 'userId'
) temp ) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId
WHERE cou.is_delete = 0
) AS ) AS
value value
, ,
...@@ -64,7 +65,7 @@ ...@@ -64,7 +65,7 @@
cb_organization co cb_organization co
WHERE co.is_delete = 0 WHERE co.is_delete = 0
ORDER BY ORDER BY
co.sort co.sort desc
LIMIT 4 LIMIT 4
) )
</select> </select>
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
cb_organization co cb_organization co
LEFT JOIN cb_organization_user cou ON co.sequence_nbr = cou.emergency_team_id LEFT JOIN cb_organization_user cou ON co.sequence_nbr = cou.emergency_team_id
where co.biz_org_code like concat(#{bizOrgCode}, '%') and cou.is_delete = 0 where co.biz_org_code like concat(#{bizOrgCode}, '%') and cou.is_delete = 0
ORDER BY co.sort , cou.rec_date ORDER BY co.sort desc , cou.rec_date
</select> </select>
<select id="getOrganizationGroup" resultType="java.util.Map"> <select id="getOrganizationGroup" resultType="java.util.Map">
SELECT SELECT
......
...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
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.api.dto.DutyPersonDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService; import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -24,6 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -24,6 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -79,6 +81,29 @@ public class DutyPersonController extends BaseController { ...@@ -79,6 +81,29 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.pageListDetail(current, size, beginDate, endDate, bizOrgCode)); return ResponseHelper.buildResponse(iDutyPersonService.pageListDetail(current, size, beginDate, endDate, bizOrgCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/cardDetailCount")
@ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计")
public ResponseModel<Map<String, Object>> cardDetail() throws ParseException {
Map<String, Object> map = new HashMap<>();
List<Map<String, Object>> maps = iDutyPersonService.dutyCardCount();
maps.forEach(e->map.put(e.get("peopleType").toString(),e.get("total")));
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/cardList")
@ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计")
public ResponseModel<List<Map<String, Object>>> cardList() throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.dutyCardList());
}
/** /**
* 值班列表视图--不分页 * 值班列表视图--不分页
* *
......
...@@ -276,6 +276,19 @@ public class OrgPersonController extends BaseController { ...@@ -276,6 +276,19 @@ public class OrgPersonController extends BaseController {
return ResponseHelper.buildResponse(orgUsr); return ResponseHelper.buildResponse(orgUsr);
} }
//驻站消防人员
@TycloudOperation( ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getUserByPeopleType/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "消防人员列表分页查询", notes = "消防人员列表分页查询")
public ResponseModel<IPage<Map<String, Object>>> getUserByPeopleType(@RequestParam Map<String, Object> requestBody) {
Map<String, Object> map = new HashMap<>();
IPage<Map<String, Object>> mapIPage = iOrgUsrService.getUserByPeopleType(
requestBody.containsKey("pageNum") ? requestBody.get("pageNum").toString() : null ,
requestBody.containsKey("pageSize") ? requestBody.get("pageSize").toString() : null,map );
return ResponseHelper.buildResponse(mapIPage);
}
/** /**
......
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
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.conditions.query.QueryWrapper;
...@@ -18,11 +19,14 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; ...@@ -18,11 +19,14 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify; import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo; import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
...@@ -47,7 +51,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -47,7 +51,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -1188,4 +1192,20 @@ public class OrgUsrController extends BaseController { ...@@ -1188,4 +1192,20 @@ public class OrgUsrController extends BaseController {
List<DynamicFormInstance> menus = iOrgUsrService.selectTelById(ids, type); List<DynamicFormInstance> menus = iOrgUsrService.selectTelById(ids, type);
return ResponseHelper.buildResponse(menus); return ResponseHelper.buildResponse(menus);
} }
/**
* 获取人员电话
* @param
* @returnP
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/selectPostById", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id获取用户岗位", notes = "根据id获取用户岗位")
public ResponseModel<List<FirefightersPost>> selectPostById(@RequestParam List<String> ids) {
List<FirefightersPost> menus = iOrgUsrService.selectPostById(ids);
return ResponseHelper.buildResponse(menus);
}
} }
\ No newline at end of file
...@@ -209,6 +209,17 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -209,6 +209,17 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return dynamicFormInstanceMapper.getPersonInfoByPage(new Page(current, size), bizOrgCode); return dynamicFormInstanceMapper.getPersonInfoByPage(new Page(current, size), bizOrgCode);
} }
public List<Map<String, Object>> dutyCardCount()
throws ParseException {
return dynamicFormInstanceMapper.dutyCardCount();
}
public List<Map<String, Object>> dutyCardList()
throws ParseException {
return dynamicFormInstanceMapper.dutyCardList();
}
private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException { private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException {
// 获取值班的实例id // 获取值班的实例id
String instanceId = m.get("instanceId").toString(); String instanceId = m.get("instanceId").toString();
......
...@@ -3564,4 +3564,30 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3564,4 +3564,30 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return dynamicFormInstanceService.list(wrapper); return dynamicFormInstanceService.list(wrapper);
} }
@Override
public List<FirefightersPost> selectPostById(List<String> ids) {
LambdaQueryWrapper<FirefightersPost> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(FirefightersPost::getOrgUsrId, ids);
return iFirefightersPostService.list(queryWrapper);
}
public IPage<Map<String, Object>> getUserByPeopleType(String pageNum, String pageSize, Map<String, Object> map) {
IPage<Map<String, Object>> pageBean = null;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
} else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
pageBean.setTotal(orgUsrMapper.getUserByPeopleTypeCount(map));
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize());
List<Map<String, Object>> list = orgUsrMapper.getUserByPeopleType(map);
pageBean.setRecords(list);
return pageBean;
}
} }
\ No newline at end of file
...@@ -319,6 +319,11 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -319,6 +319,11 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
return waterResourceDto; return waterResourceDto;
} }
@Override
public Map<String, Object> getResourcesCount() {
return waterResourceMapper.getResourcesCount();
}
public List<WaterResourceTypeDto> getWaterResourceTypeList(Boolean isDelete) { public List<WaterResourceTypeDto> getWaterResourceTypeList(Boolean isDelete) {
return waterResourceMapper.getWaterResourceTypeList(isDelete); return waterResourceMapper.getWaterResourceTypeList(isDelete);
} }
...@@ -555,4 +560,8 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -555,4 +560,8 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
}); });
return list; return list;
} }
} }
...@@ -14,6 +14,7 @@ import org.aspectj.lang.annotation.Aspect; ...@@ -14,6 +14,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -38,6 +39,9 @@ public class PersonIdentifyAspect { ...@@ -38,6 +39,9 @@ public class PersonIdentifyAspect {
@Autowired @Autowired
private JcsFeign jcsFeignClient; private JcsFeign jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Pointcut("execution(public * com.*.equipmanage.controller..*(..))") @Pointcut("execution(public * com.*.equipmanage.controller..*(..))")
public void userDate() { public void userDate() {
...@@ -60,6 +64,11 @@ public class PersonIdentifyAspect { ...@@ -60,6 +64,11 @@ public class PersonIdentifyAspect {
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class); // ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
String s = JSONObject.toJSONString(responseModel.getResult()); String s = JSONObject.toJSONString(responseModel.getResult());
ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class); ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class);
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
} }
......
...@@ -103,7 +103,10 @@ public class AnalysisReportLogController extends AbstractBaseController { ...@@ -103,7 +103,10 @@ public class AnalysisReportLogController extends AbstractBaseController {
dto.setStartDate(startDate); dto.setStartDate(startDate);
dto.setEndDate(endDate); dto.setEndDate(endDate);
dto.setReportType(reportType); dto.setReportType(reportType);
dto.setStationCode(stationCode); ReginParams reginParams = getSelectedOrgInfo();
dto.setStationCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
return iAnalysisReportLogService.iotReportPage(page, dto); return iAnalysisReportLogService.iotReportPage(page, dto);
} }
} }
...@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
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.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -74,6 +75,43 @@ public class DCenterController extends AbstractBaseController { ...@@ -74,6 +75,43 @@ public class DCenterController extends AbstractBaseController {
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
@PersonIdentify
@RequestMapping(value = "/station-info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "站点信息查询", produces = "application/json;charset=UTF-8", notes = "站点信息查询")
public ResponseModel stationInfo() {
return CommonResponseUtil.success(equipmentSpecificAlarmService.stationInfo());
}
@PersonIdentify
@RequestMapping(value = "/fireAlarmLogPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防报警列表分页查询", produces = "application/json;charset=UTF-8", notes = "消防报警列表分页查询")
public ResponseModel pageQuery(@RequestParam(required = false) String code,
@RequestParam(required = false) String typeCode,
@RequestParam(required = false) String bizOrgCode,
CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
ReginParams reginParams = getSelectedOrgInfo();
List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request7 = new CommonRequest();
request7.setName("system");
request7.setValue(StringUtil.isNotEmpty(code) ? StringUtils.trimToNull(code) : null);
queryRequests.add(request7);
CommonRequest request8 = new CommonRequest();
request8.setName("specificIndexKey");
request8.setValue(StringUtil.isNotEmpty(typeCode) ? StringUtils.trimToNull(typeCode) : null);
queryRequests.add(request8);
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue(ObjectUtils.isEmpty(bizOrgCode) ? reginParams.getPersonIdentity().getBizOrgCode() : bizOrgCode);
queryRequests.add(request13);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
return CommonResponseUtil.success(equipmentSpecificAlarmService.dcFireAlarmLogPage(param));
}
/** /**
* 消防系统运行状态分页查询 * 消防系统运行状态分页查询
* @param bizOrgCode * @param bizOrgCode
......
...@@ -3,21 +3,32 @@ package com.yeejoin.equipmanage.controller; ...@@ -3,21 +3,32 @@ package com.yeejoin.equipmanage.controller;
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;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.vo.IotDataVO;
import com.yeejoin.equipmanage.service.IEmergencyService; 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 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;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; 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.foundation.utils.DateTimeUtil;
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 org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map; import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.*;
import static org.typroject.tyboot.core.foundation.utils.DateTimeUtil.ISO8601_DATE_HOUR_MIN_SEC;
/** /**
* *
...@@ -60,12 +71,15 @@ public class EmergencyController extends AbstractBaseController { ...@@ -60,12 +71,15 @@ public class EmergencyController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("应急物资") @ApiOperation("应急物资")
@GetMapping(value = "/emergencyMaterials") @GetMapping(value = "/emergencyMaterials")
public Map<String, Object> emergencyMaterials(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ) { public Map<String, Object> emergencyMaterials() {
if (ObjectUtils.isEmpty(bizOrgCode)){ return iEmergencyService.emergencyMaterials();
ReginParams reginParams = getSelectedOrgInfo(); }
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
} @TycloudOperation(ApiLevel = UserType.AGENCY)
return iEmergencyService.emergencyMaterials(bizOrgCode); @ApiOperation("消防系统/消防车")
@GetMapping(value = "/systemAndCar")
public Map<String, Object> systemAndCar() {
return iEmergencyService.systemAndCar();
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -141,4 +155,411 @@ public class EmergencyController extends AbstractBaseController { ...@@ -141,4 +155,411 @@ public class EmergencyController extends AbstractBaseController {
return iEmergencyService.selectPressureFlow(page, bizOrgCode); return iEmergencyService.selectPressureFlow(page, bizOrgCode);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("火灾自动报警系统告警分析-折线图")
@GetMapping(value = "/selectAlarmAnalysis")
public List<Map<String, Object>> selectPressureFlow(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "type") String type,
@RequestParam(value = "systemType") String systemType)throws Exception {
ArrayList<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> maps = iEmergencyService.selectAlarmAnalysis(startDate, endDate, "0", "", systemType);
if ("week".equals(type)) {
String beginMonth = startDate.substring(5,7);
String endMonth = endDate.substring(5,7);
List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate));
for (Map<String, String> week : weeksMapInterval) {
Date weekStart = null;
Date weekEnd = null;
try {
weekStart = DateUtils.dateParse(week.get("weekStart"), DateUtils.DATE_PATTERN);
weekEnd = DateUtils.dateParse(week.get("weekEnd"), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
long startTime = weekStart.getTime();
long endTime = weekEnd.getTime();
HashMap<String, Object> mapData = new HashMap<>();
for (Map<String, Object> map : maps) {
Date check = null;
try {
check = DateUtils.dateParse(String.valueOf(map.get("date")), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(check) && check.getTime() >= startTime && check.getTime() <= endTime) {
if (!ObjectUtils.isEmpty(mapData)) {
BigDecimal old = new BigDecimal(String.valueOf(mapData.get("faultNum")));
BigDecimal add = new BigDecimal(String.valueOf(map.get("faultNum")));
BigDecimal now = old.add(add);
mapData.put("faultNum", String.valueOf(now));
BigDecimal firePumpsOld = new BigDecimal(String.valueOf(mapData.get("alarmNum")));
BigDecimal firePumpsAdd = new BigDecimal(String.valueOf(map.get("alarmNum")));
BigDecimal firePumpsNow = firePumpsOld.add(firePumpsAdd);
mapData.put("alarmNum", String.valueOf(firePumpsNow));
BigDecimal stabilizedOld = new BigDecimal(String.valueOf(mapData.get("shieldNum")));
BigDecimal stabilizedAdd = new BigDecimal(String.valueOf(map.get("shieldNum")));
BigDecimal stabilizedNow = stabilizedOld.add(stabilizedAdd);
mapData.put("shieldNum", String.valueOf(stabilizedNow));
} else {
mapData.put("name", week.get("name"));
mapData.put("faultNum", map.get("faultNum"));
mapData.put("alarmNum", map.get("alarmNum"));
mapData.put("shieldNum", map.get("shieldNum"));
}
}
}
result.add(mapData);
}
if(!StringUtils.isEmpty(beginMonth) && !beginMonth.equals(endMonth)){
weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(endDate));
for (Map<String, String> weeks : weeksMapInterval) {
Date weekStart1 = null;
Date weekEnd1 = null;
try {
weekStart1 = DateUtils.dateParse(weeks.get("weekStart"), DateUtils.DATE_PATTERN);
weekEnd1 = DateUtils.dateParse(weeks.get("weekEnd"), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
long startTime1 = weekStart1.getTime();
long endTime1 = weekEnd1.getTime();
HashMap<String, Object> mapData1 = new HashMap<>();
for (Map<String, Object> map : maps) {
Date check = null;
try {
check = DateUtils.dateParse(String.valueOf(map.get("date")), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(check) && check.getTime() >= startTime1 && check.getTime() <= endTime1) {
if (!ObjectUtils.isEmpty(mapData1)) {
BigDecimal old = new BigDecimal(String.valueOf(mapData1.get("faultNum")));
BigDecimal add = new BigDecimal(String.valueOf(map.get("faultNum")));
BigDecimal now = old.add(add);
mapData1.put("faultNum", String.valueOf(now));
BigDecimal firePumpsOld = new BigDecimal(String.valueOf(mapData1.get("alarmNum")));
BigDecimal firePumpsAdd = new BigDecimal(String.valueOf(map.get("alarmNum")));
BigDecimal firePumpsNow = firePumpsOld.add(firePumpsAdd);
mapData1.put("alarmNum", String.valueOf(firePumpsNow));
BigDecimal stabilizedOld = new BigDecimal(String.valueOf(mapData1.get("shieldNum")));
BigDecimal stabilizedAdd = new BigDecimal(String.valueOf(map.get("shieldNum")));
BigDecimal stabilizedNow = stabilizedOld.add(stabilizedAdd);
mapData1.put("shieldNum", String.valueOf(stabilizedNow));
} else {
mapData1.put("name", weeks.get("name"));
mapData1.put("faultNum", map.get("faultNum"));
mapData1.put("alarmNum", map.get("alarmNum"));
mapData1.put("shieldNum", map.get("shieldNum"));
}
}
}
result.add(mapData1);
}
}
} else if ("day".equals(type)) {
return maps;
} else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.selectAlarmAnalysis(startDate, endDate, "1", date, systemType);
}
return result;
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("火灾自动报警系统告警分析-饼图")
@GetMapping(value = "/selectAlarmAnalysisCount")
public List<Map<String, Object>> selectAlarmAnalysisCount(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "systemType") String systemType) {
return iEmergencyService.selectAlarmAnalysisCount(systemType, startDate, endDate);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防炮灭火系统告警分析-饼图")
@GetMapping(value = "/fireCannonAlarmAnalysisPie")
public List<Map<String, Object>> fireCannonAlarmAnalysisPie(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "systemType") String systemType) {
return iEmergencyService.selectFireCannonAlarmAnalysisPie(startDate, endDate, systemType);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防给水系统告警分析-饼图")
@GetMapping(value = "/waterSystemAlarmAnalysisPie")
public List<Map<String, Object>> waterSystemAlarmAnalysisPie(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "systemType") String systemType) {
return iEmergencyService.waterSystemAlarmAnalysisPie(startDate, endDate, systemType);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防给水系统告警分析-小图")
@GetMapping(value = "/waterSystemAlarmAnalysis")
public List<Map<String, Object>> waterSystemAlarmAnalysis(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "type") String type,
@RequestParam(value = "systemType") String systemType) {
ArrayList<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> maps = iEmergencyService.waterSystemAlarmAnalysis(startDate, endDate, "0", "", systemType);
if ("week".equals(type)) {
String beginMonth = startDate.substring(5,7);
String endMonth = endDate.substring(5,7);
List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate));
for (Map<String, String> week : weeksMapInterval) {
Date weekStart = null;
Date weekEnd = null;
try {
weekStart = DateUtils.dateParse(week.get("weekStart"), DateUtils.DATE_PATTERN);
weekEnd = DateUtils.dateParse(week.get("weekEnd"), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
long startTime = weekStart.getTime();
long endTime = weekEnd.getTime();
HashMap<String, Object> mapData = new HashMap<>();
for (Map<String, Object> map : maps) {
Date check = null;
try {
check = DateUtils.dateParse(String.valueOf(map.get("date")), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(check) && check.getTime() >= startTime && check.getTime() <= endTime) {
if (!ObjectUtils.isEmpty(mapData)) {
BigDecimal old = new BigDecimal(String.valueOf(mapData.get("controlCabinetAlarmNum")));
BigDecimal add = new BigDecimal(String.valueOf(map.get("controlCabinetAlarmNum")));
BigDecimal now = old.add(add);
mapData.put("controlCabinetAlarmNum", String.valueOf(now));
BigDecimal firePumpsOld = new BigDecimal(String.valueOf(mapData.get("firePumpsAlarmNum")));
BigDecimal firePumpsAdd = new BigDecimal(String.valueOf(map.get("firePumpsAlarmNum")));
BigDecimal firePumpsNow = firePumpsOld.add(firePumpsAdd);
mapData.put("firePumpsAlarmNum", String.valueOf(firePumpsNow));
BigDecimal stabilizedOld = new BigDecimal(String.valueOf(mapData.get("stabilizedPumpAlarmNum")));
BigDecimal stabilizedAdd = new BigDecimal(String.valueOf(map.get("stabilizedPumpAlarmNum")));
BigDecimal stabilizedNow = stabilizedOld.add(stabilizedAdd);
mapData.put("stabilizedPumpAlarmNum", String.valueOf(stabilizedNow));
} else {
mapData.put("name", week.get("name"));
mapData.put("controlCabinetAlarmNum", map.get("controlCabinetAlarmNum"));
mapData.put("firePumpsAlarmNum", map.get("firePumpsAlarmNum"));
mapData.put("stabilizedPumpAlarmNum", map.get("stabilizedPumpAlarmNum"));
}
}
}
result.add(mapData);
}
if(!StringUtils.isEmpty(beginMonth) && !beginMonth.equals(endMonth)){
weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(endDate));
for (Map<String, String> weeks : weeksMapInterval) {
Date weekStart1 = null;
Date weekEnd1 = null;
try {
weekStart1 = DateUtils.dateParse(weeks.get("weekStart"), DateUtils.DATE_PATTERN);
weekEnd1 = DateUtils.dateParse(weeks.get("weekEnd"), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
long startTime1 = weekStart1.getTime();
long endTime1 = weekEnd1.getTime();
HashMap<String, Object> mapData1 = new HashMap<>();
for (Map<String, Object> map : maps) {
Date check = null;
try {
check = DateUtils.dateParse(String.valueOf(map.get("date")), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(check) && check.getTime() >= startTime1 && check.getTime() <= endTime1) {
if (!ObjectUtils.isEmpty(mapData1)) {
BigDecimal old = new BigDecimal(String.valueOf(mapData1.get("controlCabinetAlarmNum")));
BigDecimal add = new BigDecimal(String.valueOf(map.get("controlCabinetAlarmNum")));
BigDecimal now = old.add(add);
mapData1.put("controlCabinetAlarmNum", String.valueOf(now));
BigDecimal firePumpsOld = new BigDecimal(String.valueOf(mapData1.get("firePumpsAlarmNum")));
BigDecimal firePumpsAdd = new BigDecimal(String.valueOf(map.get("firePumpsAlarmNum")));
BigDecimal firePumpsNow = firePumpsOld.add(firePumpsAdd);
mapData1.put("firePumpsAlarmNum", String.valueOf(firePumpsNow));
BigDecimal stabilizedOld = new BigDecimal(String.valueOf(mapData1.get("stabilizedPumpAlarmNum")));
BigDecimal stabilizedAdd = new BigDecimal(String.valueOf(map.get("stabilizedPumpAlarmNum")));
BigDecimal stabilizedNow = stabilizedOld.add(stabilizedAdd);
mapData1.put("stabilizedPumpAlarmNum", String.valueOf(stabilizedNow));
} else {
mapData1.put("name", weeks.get("name"));
mapData1.put("controlCabinetAlarmNum", map.get("controlCabinetAlarmNum"));
mapData1.put("firePumpsAlarmNum", map.get("firePumpsAlarmNum"));
mapData1.put("stabilizedPumpAlarmNum", map.get("stabilizedPumpAlarmNum"));
}
}
}
result.add(mapData1);
}
}
} else if ("day".equals(type)) {
return maps;
} else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.waterSystemAlarmAnalysis(startDate, endDate, "1", date, systemType);
}
return result;
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防炮系统告警分析-折线图")
@GetMapping(value = "/fireCannonSystemAlarmAnalysis")
public List<Map<String, Object>> fireCannonSystemAlarmAnalysis(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "type") String type,
@RequestParam(value = "systemType") String systemType) {
ArrayList<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> maps = iEmergencyService.fireCannonSystemAlarmAnalysis(startDate, endDate, "0", "", systemType);
if ("week".equals(type)) {
String beginMonth = startDate.substring(5,7);
String endMonth = endDate.substring(5,7);
List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate));
for (Map<String, String> week : weeksMapInterval) {
Date weekStart = null;
Date weekEnd = null;
try {
weekStart = DateUtils.dateParse(week.get("weekStart"), DateUtils.DATE_PATTERN);
weekEnd = DateUtils.dateParse(week.get("weekEnd"), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
long startTime = weekStart.getTime();
long endTime = weekEnd.getTime();
HashMap<String, Object> mapData = new HashMap<>();
for (Map<String, Object> map : maps) {
Date check = null;
try {
check = DateUtils.dateParse(String.valueOf(map.get("date")), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(check) && check.getTime() >= startTime && check.getTime() <= endTime) {
if (!ObjectUtils.isEmpty(mapData)) {
BigDecimal old = new BigDecimal(String.valueOf(mapData.get("powerLossNum")));
BigDecimal add = new BigDecimal(String.valueOf(map.get("powerLossNum")));
BigDecimal now = old.add(add);
mapData.put("powerLossNum", String.valueOf(now));
BigDecimal firePumpsOld = new BigDecimal(String.valueOf(mapData.get("faultNum")));
BigDecimal firePumpsAdd = new BigDecimal(String.valueOf(map.get("faultNum")));
BigDecimal firePumpsNow = firePumpsOld.add(firePumpsAdd);
mapData.put("faultNum", String.valueOf(firePumpsNow));
BigDecimal stabilizedOld = new BigDecimal(String.valueOf(mapData.get("fireAlarmNum")));
BigDecimal stabilizedAdd = new BigDecimal(String.valueOf(map.get("fireAlarmNum")));
BigDecimal stabilizedNow = stabilizedOld.add(stabilizedAdd);
mapData.put("fireAlarmNum", String.valueOf(stabilizedNow));
BigDecimal shieldOld = new BigDecimal(String.valueOf(mapData.get("shieldNum")));
BigDecimal shieldAdd = new BigDecimal(String.valueOf(map.get("shieldNum")));
BigDecimal shieldNow = shieldOld.add(shieldAdd);
mapData.put("shieldNum", String.valueOf(shieldNow));
} else {
mapData.put("name", week.get("name"));
mapData.put("shieldNum", map.get("shieldNum"));
mapData.put("fireAlarmNum", map.get("fireAlarmNum"));
mapData.put("faultNum", map.get("faultNum"));
mapData.put("powerLossNum", map.get("powerLossNum"));
}
}
}
result.add(mapData);
}
if(!StringUtils.isEmpty(beginMonth) && !beginMonth.equals(endMonth)){
weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(endDate));
for (Map<String, String> weeks : weeksMapInterval) {
Date weekStart1 = null;
Date weekEnd1 = null;
try {
weekStart1 = DateUtils.dateParse(weeks.get("weekStart"), DateUtils.DATE_PATTERN);
weekEnd1 = DateUtils.dateParse(weeks.get("weekEnd"), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
long startTime1 = weekStart1.getTime();
long endTime1 = weekEnd1.getTime();
HashMap<String, Object> mapData1 = new HashMap<>();
for (Map<String, Object> map : maps) {
Date check = null;
try {
check = DateUtils.dateParse(String.valueOf(map.get("date")), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(check) && check.getTime() >= startTime1 && check.getTime() <= endTime1) {
if (!ObjectUtils.isEmpty(mapData1)) {
BigDecimal old = new BigDecimal(String.valueOf(mapData1.get("powerLossNum")));
BigDecimal add = new BigDecimal(String.valueOf(map.get("powerLossNum")));
BigDecimal now = old.add(add);
mapData1.put("powerLossNum", String.valueOf(now));
BigDecimal firePumpsOld = new BigDecimal(String.valueOf(mapData1.get("faultNum")));
BigDecimal firePumpsAdd = new BigDecimal(String.valueOf(map.get("faultNum")));
BigDecimal firePumpsNow = firePumpsOld.add(firePumpsAdd);
mapData1.put("faultNum", String.valueOf(firePumpsNow));
BigDecimal stabilizedOld = new BigDecimal(String.valueOf(mapData1.get("fireAlarmNum")));
BigDecimal stabilizedAdd = new BigDecimal(String.valueOf(map.get("fireAlarmNum")));
BigDecimal stabilizedNow = stabilizedOld.add(stabilizedAdd);
mapData1.put("fireAlarmNum", String.valueOf(stabilizedNow));
BigDecimal shieldOld = new BigDecimal(String.valueOf(mapData1.get("shieldNum")));
BigDecimal shieldAdd = new BigDecimal(String.valueOf(map.get("shieldNum")));
BigDecimal shieldNow = shieldOld.add(shieldAdd);
mapData1.put("shieldNum", String.valueOf(shieldNow));
} else {
mapData1.put("name", weeks.get("name"));
mapData1.put("powerLossNum", map.get("powerLossNum"));
mapData1.put("faultNum", map.get("faultNum"));
mapData1.put("fireAlarmNum", map.get("fireAlarmNum"));
mapData1.put("shieldNum", map.get("shieldNum"));
}
}
}
result.add(mapData1);
}
}
} else if ("day".equals(type)) {
return maps;
} else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.fireCannonSystemAlarmAnalysis(startDate, endDate, "1", date, systemType);
}
return result;
}
} }
...@@ -193,6 +193,15 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -193,6 +193,15 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getDetailByCode(systemCode); return fireFightingSystemService.getDetailByCode(systemCode);
} }
//查询系统下设备状态
@RequestMapping(value = "/alarmSystem/info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("通过id查询消防系统信息")
public List<Map<String,Object>> getEquip() {
return fireFightingSystemService.getEquip();
}
/** /**
* 生产厂商列表(不分页) * 生产厂商列表(不分页)
* *
......
...@@ -18,14 +18,17 @@ import org.apache.commons.lang3.StringUtils; ...@@ -18,14 +18,17 @@ import org.apache.commons.lang3.StringUtils;
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.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -386,18 +389,18 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -386,18 +389,18 @@ public class SupervisionConfigureController extends AbstractBaseController {
} catch (ParseException e) { } catch (ParseException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
long res = start - end; long res = Math.abs(start - end);
diffMinute = res / 1000 / 60; diffMinute = res / 1000 / 60;
} }
long finalDiffMinute = diffMinute; long finalDiffMinute = diffMinute;
pressurePumpInfo.getRecords().stream( pressurePumpInfo.getRecords().stream(
).map(item -> { ).map(item -> {
item.put("startAndStopInterval", finalDiffMinute); item.put("startAndStopInterval", finalDiffMinute);
// if (finalDiffMinute > 5) { if (finalDiffMinute > 5) {
// item.put("stateDesc", "异常"); item.put("generalState", "异常");
// } else { } else {
// item.put("stateDesc", "正常"); item.put("generalState", "正常");
// } }
item.put("nameKey", pressurePumpStart); item.put("nameKey", pressurePumpStart);
return item; return item;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
...@@ -462,4 +465,196 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -462,4 +465,196 @@ public class SupervisionConfigureController extends AbstractBaseController {
return CommonResponseUtil.success(supervisionVideoService.queryVideoAllId(bizOrgCode)); return CommonResponseUtil.success(supervisionVideoService.queryVideoAllId(bizOrgCode));
} }
@PersonIdentify
@RequestMapping(value = "/selectPressureMonth", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "统计当月稳压泵启停", produces = "application/json;charset=UTF-8", notes = "统计当月稳压泵启停")
public ResponseModel selectPressureMonth(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String startDay = df.format(new Date());
Calendar calendar = Calendar.getInstance();
calendar.set(Integer.parseInt(startDay.substring(0, 4)), Integer.parseInt(startDay.substring(5, 7)) - 1, 1);
String firstDayOfMonth = new SimpleDateFormat("yyyy-MM-dd ").format(calendar.getTime());
System.out.println("第一天:" + firstDayOfMonth + "00:00:00");
//这里先设置要获取月份的下月的第一天
calendar.set(Integer.parseInt(startDay.substring(0, 4)), Integer.parseInt(startDay.substring(5, 7)), 1);
//这里将日期值减去一天,从而获取到要求的月份最后一天
calendar.add(Calendar.DATE, -1);
String lastDayOfMonth = new SimpleDateFormat("yyyy-MM-dd ").format(calendar.getTime());
System.out.println("最后一天:" + lastDayOfMonth + "23:59:59");
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
}
// 稳压泵信息
List<Map<String, Object>> pressurePumps = fireFightingSystemMapper.selectAllPressurePumpInfo(bizOrgCode);
ArrayList<Map<String, Object>> names = new ArrayList<>();
// x轴数据
List<Map<String, Object>> data = fireFightingSystemMapper.selectAllDays();
for (Map<String, Object> pressurePump : pressurePumps) {
HashMap<String, Object> bar = new HashMap<>();
bar.put("name", pressurePump.get("name"));
bar.put("id", pressurePump.get("id"));
names.add(bar);
String prefix = null;
String suffix = null;
String iotCode = pressurePump.get("iot_code").toString();
if (iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
throw new BadRequest("装备物联编码错误,请确认!");
}
ResponseModel mounthEntity = null;
try {
mounthEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), firstDayOfMonth + "00:00:00", lastDayOfMonth + "23:59:59", prefix, suffix, null);
} catch (Exception e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(mounthEntity) && "200".equals(String.valueOf(mounthEntity.getStatus()))) {
for (Map<String, Object> item : data) {
HashMap<String, Object> map = new HashMap<>();
map.put("name", pressurePump.get("name"));
String json1 = JSON.toJSONString(mounthEntity.getResult());
List<Map<String, String>> list = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = list.stream().filter(t -> (t.containsKey("time") && t.get("time").substring(0, 10).equals(item.get("date")))).collect(Collectors.toList());
map.put("value", collect.size());
map.put("id", pressurePump.get("id"));
if (item.containsKey("yData")) {
List<Map<String, Object>> yData1 = (List<Map<String, Object>>) item.get("yData");
yData1.add(map);
} else {
ArrayList<Map<String, Object>> maps = new ArrayList<>();
maps.add(map);
item.put("yData", maps);
}
}
}
}
HashMap<String, Object> result = new HashMap<>();
result.put("names", names);
result.put("data", data);
return CommonResponseUtil.success(result);
}
@PersonIdentify
@RequestMapping(value = "/selectPressureDetails", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "稳压泵详情", produces = "application/json;charset=UTF-8", notes = "稳压泵详情")
public ResponseModel selectPressureDetails(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
List<Map<String, Object>> pressurePumps = fireFightingSystemMapper.selectPressureDetails(bizOrgCode);
return CommonResponseUtil.success(pressurePumps);
}
@PersonIdentify
@RequestMapping(value = "/selectPipePressureDetail", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "管网压力详情", produces = "application/json;charset=UTF-8", notes = "管网压力详情")
public ResponseModel selectPipePressureDetail(@RequestParam(value = "equipmentSpecificId") String equipmentSpecificId) {
if (!StringUtil.isNotEmpty(equipmentSpecificId)) {
return CommonResponseUtil.success();
}
Map<String, Object> map = fireFightingSystemMapper.selectEquipmentSpecificById(equipmentSpecificId);
String name = "";
String code = "";
if (String.valueOf(map.get("equipment_code")).indexOf("92011000") != -1) {
name = "管网压力";
code = "gwyl";
} else if (String.valueOf(map.get("equipment_code")).indexOf("92011100") != -1) {
name = "水池液位";
code = "scyw";
}
if (ObjectUtils.isEmpty(map) || ObjectUtils.isEmpty(map.get("iot_code"))) {
return CommonResponseUtil.success(null);
}
String iotCode = map.get("iot_code").toString();
String prefix = null;
String suffix = null;
if (iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
throw new BadRequest("装备物联编码错误,请确认!");
}
String now = LocalDateTimeUtils.getNow();
ResponseModel mounthEntity = null;
try {
mounthEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), now.substring(0, 10) + " 00:00:00", now.substring(0, 10) + " 23:59:59", prefix, suffix, "FHS_PipePressureDetector_PipePressure");
} catch (Exception e) {
e.printStackTrace();
}
List<Map<String, String>> result = new ArrayList<>();
if (200 == mounthEntity.getStatus()) {
String json1 = JSON.toJSONString(mounthEntity.getResult());
List<Map<String, String>> list = (List<Map<String, String>>) JSONArray.parse(json1);
Collections.reverse(list);
if (!CollectionUtils.isEmpty(list) && list.size() > 30) {
for (int i = 0; i <= 29; i++) {
result.add(list.get(i));
}
} else {
result.addAll(list);
}
}
List<Map<String, String>> res = new ArrayList<>();
for (Map<String, String> m : result) {
Map<String, String> item = new HashMap<>();
item.put("time", change(String.valueOf(m.get("time"))));
for (String s : m.keySet()) {
if (!s.equals("time")) {
item.put("value", m.get(s));
item.remove(s);
continue;
}
}
res.add(item);
}
// result.stream().map(item -> {
// if (!ObjectUtils.isEmpty(item.get("time"))) {
// item.put("time", change(String.valueOf(item.get("time"))));
// }
// return item;
// }).collect(Collectors.toList());
List<Map<String, Object>> resList = new ArrayList<>();
Map<String, Object> map1 = new HashMap<>();
map1.put("name", name);
map1.put("xData", res.stream().map(x -> x.get("time")).collect(Collectors.toList()));
map1.put("yData", res.stream().map(x -> x.get("value")).collect(Collectors.toList()));
Map<String, Object> resMap = new HashMap<>();
resMap.put(code, map1);
return CommonResponseUtil.success(resMap);
}
private String change(String time) {
//进行转化时区
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US);
Date myDate = null;
try {
myDate = dateFormat.parse(time.replace("Z", "+0000"));
} catch (ParseException e) {
e.printStackTrace();
}
//转换为年月日时分秒
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = df.format(myDate);
return format;
}
} }
...@@ -18,7 +18,7 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -18,7 +18,7 @@ public interface EmergencyMapper extends BaseMapper{
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
Map<String, Object> selectEmergencyMaterials(@Param("bizOrgCode") String bizOrgCode); Map<String, Object> selectEmergencyMaterials();
/** /**
* 应急物资详情 * 应急物资详情
...@@ -61,4 +61,23 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -61,4 +61,23 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object>> getCAFSWaterTankInfo(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getCAFSWaterTankInfo(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> selectAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
List<Map<String, Object>> selectAlarmAnalysisCount( @Param("startDate")String startDate, @Param("endDate")String endDate,@Param("list") List<String> codes);
Map<String, Object> getSystemAndCarCount();
List<String> selectSystemCodes(@Param("systemType") String systemType);
List<Map<String, Object>> selectFireCannonAlarmAnalysisPie(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("list") List<String> codes);
List<Map<String, Object>> waterSystemAlarmAnalysisPie(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("list") List<String> codes);
List<Map<String, Object>> waterSystemAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
List<Map<String, Object>> fireCannonSystemAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
} }
...@@ -226,6 +226,8 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif ...@@ -226,6 +226,8 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
, @Param("endTime") String endTime); , @Param("endTime") String endTime);
Page<Map<String, Object>> fireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param); Page<Map<String, Object>> fireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
Page<Map<String, Object>> dcFireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
List<Map<String, Object>> alarmTrend(String bizOrgCode); List<Map<String, Object>> alarmTrend(String bizOrgCode);
List<Map<String, Object>> stationInfo();
} }
...@@ -640,4 +640,14 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -640,4 +640,14 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getStationStatusStatistics(); List<Map<String, Object>> getStationStatusStatistics();
List<Map<String, Object>> selectAllPressurePumpInfo(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> selectAllDays();
List<Map<String, Object>> getEquip();
List<Map<String, Object>> selectPressureDetails(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectEquipmentSpecificById(@Param("id") String id);
} }
...@@ -22,7 +22,7 @@ public interface IEmergencyService { ...@@ -22,7 +22,7 @@ public interface IEmergencyService {
*/ */
List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode); List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode);
Map<String, Object> emergencyMaterials(String bizOrgCode); Map<String, Object> emergencyMaterials();
Page<Map<String, Object>> emergencyMaterialsDetails(Page<Map<String, Object>> page, String bizOrgCode); Page<Map<String, Object>> emergencyMaterialsDetails(Page<Map<String, Object>> page, String bizOrgCode);
...@@ -33,4 +33,20 @@ public interface IEmergencyService { ...@@ -33,4 +33,20 @@ public interface IEmergencyService {
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode, String code); Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode, String code);
Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode); Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode);
List<Map<String, Object>> selectAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType);
List<Map<String, Object>> selectAlarmAnalysisCount(String systemType, String startDate, String endDate);
Map<String, Object> systemAndCar();
List<Map<String, Object>> selectFireCannonAlarmAnalysisPie(String startDate, String endDate, String systemType);
List<Map<String, Object>> waterSystemAlarmAnalysisPie(String startDate, String endDate, String systemType);
List<Map<String, Object>> waterSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType);
List<Map<String, Object>> fireCannonSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType);
} }
...@@ -97,6 +97,9 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif ...@@ -97,6 +97,9 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param); Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param);
Page<Map<String, Object>> dcFireAlarmLogPage(CommonPageInfoParam param);
List<Map<String, Object>> stationInfo();
List<Map<String, Object>> alarmTrend(String bizOrgCode); List<Map<String, Object>> alarmTrend(String bizOrgCode);
List<Map<String, Object>> allList(CommonPageInfoParam param); List<Map<String, Object>> allList(CommonPageInfoParam param);
......
...@@ -171,6 +171,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -171,6 +171,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
*/ */
FireFightingSystemEntity getDetailByCode(String systemCode); FireFightingSystemEntity getDetailByCode(String systemCode);
List<Map<String,Object>> getEquip();
/** /**
* 集成页面系统数据 * 集成页面系统数据
* *
......
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.mapper.EmergencyMapper; import com.yeejoin.equipmanage.mapper.EmergencyMapper;
import com.yeejoin.equipmanage.service.IEmergencyService; import com.yeejoin.equipmanage.service.IEmergencyService;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
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.CollectionUtils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import static com.yeejoin.equipmanage.common.utils.DateUtils.getFirstDayOfMonth;
/** /**
* *
* 四横八纵应急模块接口服务类 * 四横八纵应急模块接口服务类
...@@ -59,8 +66,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -59,8 +66,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
@Override @Override
public Map<String, Object> emergencyMaterials(String bizOrgCode) { public Map<String, Object> emergencyMaterials() {
return emergencyMapper.selectEmergencyMaterials(bizOrgCode); return emergencyMapper.selectEmergencyMaterials();
} }
@Override @Override
...@@ -87,4 +94,68 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -87,4 +94,68 @@ public class EmergencyServiceImpl implements IEmergencyService {
public Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode) { public Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectPressureFlow(page, bizOrgCode); return emergencyMapper.selectPressureFlow(page, bizOrgCode);
} }
@Override
public List<Map<String, Object>> selectAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.selectAlarmAnalysis(startDate, endDate, dataType, date, strings);
}
return null;
}
@Override
public List<Map<String, Object>> selectAlarmAnalysisCount(String systemType, String startDate, String endDate) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.selectAlarmAnalysisCount( startDate, endDate,strings);
}
return null;
}
@Override
public Map<String, Object> systemAndCar() {
return emergencyMapper.getSystemAndCarCount();
}
@Override
public List<Map<String, Object>> selectFireCannonAlarmAnalysisPie(String startDate, String endDate, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.selectFireCannonAlarmAnalysisPie(startDate, endDate, strings);
}
return null;
}
@Override
public List<Map<String, Object>> waterSystemAlarmAnalysisPie(String startDate, String endDate, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.waterSystemAlarmAnalysisPie(startDate, endDate, strings);
}
return null;
}
@Override
public List<Map<String, Object>> waterSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.waterSystemAlarmAnalysis(startDate, endDate, dataType, date, strings);
}
return null;
}
@Override
public List<Map<String, Object>> fireCannonSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.fireCannonSystemAlarmAnalysis(startDate, endDate, dataType, date, strings);
}
return null;
}
} }
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.*;
...@@ -17,6 +18,7 @@ import org.apache.commons.lang3.RandomStringUtils; ...@@ -17,6 +18,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
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.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -57,6 +59,9 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -57,6 +59,9 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
@Autowired @Autowired
private IEquipmentDetailService iEquipmentDetailService; private IEquipmentDetailService iEquipmentDetailService;
@Autowired
private RedisUtils redisUtils;
// 装备分类code长度 // 装备分类code长度
private static final int CATECODELEN = 8; private static final int CATECODELEN = 8;
private String proviceCode = "44"; private String proviceCode = "44";
...@@ -111,10 +116,10 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -111,10 +116,10 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
} }
equipmentMapper.deleteById(equipment.getId()); equipmentMapper.deleteById(equipment.getId());
}); });
refreshData();
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("删除失败!"); throw new RuntimeException("删除失败!");
} }
} }
@Override @Override
...@@ -140,10 +145,22 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -140,10 +145,22 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
log.error("新增装备定义操作中,检测到巡检服务未启动或启动出错!"); log.error("新增装备定义操作中,检测到巡检服务未启动或启动出错!");
} }
if (num > 0) { if (num > 0) {
refreshData();
return true; return true;
} }
return false; return false;
} }
@Async
public void refreshData() {
if (redisUtils.hasKey("equip_equipDefinitions")) {
redisUtils.del("equip_equipDefinitions");
}
QueryWrapper<Equipment> equipmentQueryWrapper = new QueryWrapper<>();
equipmentQueryWrapper.isNotNull("id");
List<Equipment> equipments = equipmentMapper.selectList(equipmentQueryWrapper);
redisUtils.set("equip_equipDefinitions", JSONObject.toJSONString(equipments));
}
// public void saveEquipmentQRCodes(Equipment equipment) { // public void saveEquipmentQRCodes(Equipment equipment) {
// try { // try {
...@@ -233,6 +250,7 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -233,6 +250,7 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
log.error("编辑装备定义操作中,检测到巡检服务未启动或启动出错!"); log.error("编辑装备定义操作中,检测到巡检服务未启动或启动出错!");
} }
if (savedEquipment > 0) { if (savedEquipment > 0) {
refreshData();
return true; return true;
} }
return false; return false;
......
...@@ -109,7 +109,17 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -109,7 +109,17 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
if (0 == list.size()) { if (0 == list.size()) {
throw new RuntimeException("导出数据列表无数据!"); throw new RuntimeException("导出数据列表无数据!");
} }
ExcelUtil.createTemplate(response, "设备告警信息", "设备告警信息", equipmentDownloads, EquipmentAlarmDownloadVO.class, null, false);
if(alarmType.equals("FIREALARM")){
ExcelUtil.createTemplate(response, "设备火灾报警信息", "设备火灾报警信息", equipmentDownloads, EquipmentAlarmDownloadVO.class, null, false);
}else if(alarmType.equals("BREAKDOWN")){
ExcelUtil.createTemplate(response, "设备故障告警信息", "设备故障告警信息", equipmentDownloads, EquipmentAlarmDownloadVO.class, null, false);
}else{
ExcelUtil.createTemplate(response, "设备告警信息", "设备告警信息", equipmentDownloads, EquipmentAlarmDownloadVO.class, null, false);
}
} }
...@@ -798,9 +808,19 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -798,9 +808,19 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
} }
@Override @Override
public Page<Map<String, Object>> dcFireAlarmLogPage(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
return this.baseMapper.dcFireAlarmLogPage(result, param);
}
@Override
public List<Map<String, Object>> alarmTrend(String bizOrgCode) { public List<Map<String, Object>> alarmTrend(String bizOrgCode) {
return this.baseMapper.alarmTrend(bizOrgCode); return this.baseMapper.alarmTrend(bizOrgCode);
} }
@Override
public List<Map<String, Object>> stationInfo() {
return this.baseMapper.stationInfo();
}
@Override @Override
public List<Map<String, Object>> allList(CommonPageInfoParam param) { public List<Map<String, Object>> allList(CommonPageInfoParam param) {
......
...@@ -36,8 +36,9 @@ import com.yeejoin.equipmanage.fegin.JcsFeign; ...@@ -36,8 +36,9 @@ import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.*; import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import org.apache.commons.beanutils.BeanUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.io.IOUtils;
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.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -52,7 +53,6 @@ import org.typroject.tyboot.core.foundation.context.RequestContext; ...@@ -52,7 +53,6 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
...@@ -64,8 +64,8 @@ import java.net.SocketException; ...@@ -64,8 +64,8 @@ import java.net.SocketException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.lang.String.valueOf; import static java.lang.String.valueOf;
import org.apache.commons.io.IOUtils;
@Slf4j @Slf4j
@Service @Service
...@@ -981,6 +981,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -981,6 +981,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public List<Map<String, Object>> getEquip() {
List<Map<String, Object>> list = fireFightingSystemMapper.getEquip();
List<Map<String, Object>> resList = new ArrayList<>();
int i = 1;
if (0 < list.size()) {
for (Map<String, Object> m : list) {
Map<String, Object> map = new HashMap<>();
map.put("key", i);
map.put("name", m.get("equipmentName"));
map.put("equipmentCode", m.get("equipmentCode"));
map.put("code", m.get("code"));
map.put("value", m.get("flag"));
map.put("unit", "");
resList.add(map);
i++;
}
}
return resList;
}
@Override
public List<AlarmDataVO> getSystemById(Long id) { public List<AlarmDataVO> getSystemById(Long id) {
return this.baseMapper.getSystemById(id); return this.baseMapper.getSystemById(id);
} }
......
...@@ -192,6 +192,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -192,6 +192,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${state.code:code}") @Value("${state.code:code}")
private String stationCode; private String stationCode;
@Value("${system.type}")
private String system;
@Value("${state.name:name}") @Value("${state.name:name}")
private String stationName; private String stationName;
...@@ -485,75 +488,72 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -485,75 +488,72 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 直流中心消息推送刷新 // 直流中心消息推送刷新
publishDataToDCCenterPage(equipmentSpecificIndexList); publishDataToDCCenterPage(equipmentSpecificIndexList);
if("zd".equals(system)){
// 向预控系统发送消息 System.out.println("站端系统----------------");
sendEquipSpecIndexToAutosysTopic(equipmentSpecificIndexList);
// 向预控系统发送消息
// 首页性能指标数据订阅 sendEquipSpecIndexToAutosysTopic(equipmentSpecificIndexList);
mqttSendGateway.sendToMqtt(indexTopic, JSON.toJSONString(indexStateList));
// 首页性能指标数据订阅
// 组态大屏消息推送,设备表实时指标修改 mqttSendGateway.sendToMqtt(indexTopic, JSON.toJSONString(indexStateList));
intePageSysDataRefresh(equipmentSpecificIndexList, topicEntity);
// 组态大屏消息推送,设备表实时指标修改
// 数字换流站同步指标修改 intePageSysDataRefresh(equipmentSpecificIndexList, topicEntity);
syncSpecificIndexsToGS(equipmentSpecificIndexList);
// 数字换流站同步指标修改
// 则更新拓扑节点数据及告警状态 syncSpecificIndexsToGS(equipmentSpecificIndexList);
updateNodeDateByEquipId(equipmentSpecificIndexList);
// 则更新拓扑节点数据及告警状态
// 向画布推送 updateNodeDateByEquipId(equipmentSpecificIndexList);
publishDataToCanvas(equipmentSpecificIndexList);
// 向画布推送
// 向其他系统推送报警 publishDataToCanvas(equipmentSpecificIndexList);
equipmentAlarmLogsToOtherSystems(alarmLogs);
// 向其他系统推送报警
// 直流中心消息推送刷新 equipmentAlarmLogsToOtherSystems(alarmLogs);
publishDataToDCCenterPage(equipmentSpecificIndexList);
if(vo.getEcode()!=null){
if(vo.getEcode()!=null){ String ecode= vo.getEcode();
String ecode= vo.getEcode(); boolean flag=false;
boolean flag=false;
//消防泵
//消防泵 String[] strings = pumpCodes.split(",");
String[] strings = pumpCodes.split(","); for (String string : strings) {
for (String string : strings) { if(ecode.startsWith(string)){
if(ecode.startsWith(string)){ //通知>消防应急预案
//通知>消防应急预案 topicEntity.setType("xfb");
topicEntity.setType("xfb"); mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity)); flag=true;
flag=true; break;
break; }
} }
}
// 消防炮
// 消防炮 String[] stringxfp = monitorCodes.split(",");
String[] stringxfp = monitorCodes.split(","); if(!flag){
if(!flag){ for (String string1 : stringxfp) {
for (String string1 : stringxfp) { if(ecode.startsWith(string1)){
if(ecode.startsWith(string1)){ //通知>消防应急预案
//通知>消防应急预案 topicEntity.setType("xfp");
topicEntity.setType("xfp"); mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity)); flag=true;
flag=true; break;
break; }
} }
} }
} //消防水源
//消防水源 if(!flag){
if(!flag){ List<Map> lit= iEquipmentSpecificSerivce.getWater(vo.getId());
List<Map> lit= iEquipmentSpecificSerivce.getWater(vo.getId()); if(lit!=null&& lit.size()>0){
if(lit!=null&& lit.size()>0){ topicEntity.setType("xfsy");
topicEntity.setType("xfsy"); mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity)); }
} }
} }
} }
} }
}); });
} }
......
...@@ -8,6 +8,7 @@ import java.util.stream.Collectors; ...@@ -8,6 +8,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.utils.*; import com.yeejoin.equipmanage.common.utils.*;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -32,21 +33,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -32,21 +33,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.equipmanage.common.entity.Equipment;
import com.yeejoin.equipmanage.common.entity.EquipmentDetail;
import com.yeejoin.equipmanage.common.entity.EquipmentIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentManageEntity;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentSystemSourceStatistics;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.Journal;
import com.yeejoin.equipmanage.common.entity.ManufacturerInfo;
import com.yeejoin.equipmanage.common.entity.Stock;
import com.yeejoin.equipmanage.common.entity.StockBill;
import com.yeejoin.equipmanage.common.entity.StockBillDetail;
import com.yeejoin.equipmanage.common.entity.StockDetail;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO; import com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo; import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.enums.BillContentEnum; import com.yeejoin.equipmanage.common.enums.BillContentEnum;
...@@ -507,10 +493,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -507,10 +493,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
relationRedisUtil.delSysRedisKey(fireFightSysIdsBuffer.toString()); relationRedisUtil.delSysRedisKey(fireFightSysIdsBuffer.toString());
} }
if (redisUtils.hasKey("equipAndCarIotCodes")) {
redisUtils.del("equipAndCarIotCodes");
}
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { // TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
// @Override // @Override
// public void afterCommit() { // public void afterCommit() {
...@@ -546,6 +528,10 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -546,6 +528,10 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
redisUtils.del("equipAndCarIotCodes"); redisUtils.del("equipAndCarIotCodes");
} }
redisUtils.set("equipAndCarIotCodes", JSONObject.toJSONString(data)); redisUtils.set("equipAndCarIotCodes", JSONObject.toJSONString(data));
if (redisUtils.hasKey("equip_warehouseStructures")) {
redisUtils.getAndDeletePatternKeys("equip_warehouseStructures" + "*");
}
return date; return date;
} }
...@@ -579,11 +565,22 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -579,11 +565,22 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
TransactionStatus transactionStatus = platformTransactionManager.getTransaction(transactionDefinition); TransactionStatus transactionStatus = platformTransactionManager.getTransaction(transactionDefinition);
try { try {
//查询装备定义信息 //查询装备定义信息
QueryWrapper<Equipment> equipmentQueryWrapper = new QueryWrapper<>(); // equipmentQueryWrapper.lambda().eq(Equipment::getCode, equipmentDetailDownloadVOS.getCode());
equipmentQueryWrapper.lambda().eq(Equipment::getCode, equipmentDetailDownloadVOS.getCode()); // Equipment equipment = equipmentMapper.selectOne(equipmentQueryWrapper);
Equipment equipment = equipmentMapper.selectOne(equipmentQueryWrapper);
// 此处由于每次导入都需查装备定义导致导入缓慢,所以优化为加入缓存
Equipment equipment;
if (redisUtils.hasKey("equip_equipDefinitions")) {
List<Equipment> equipmentList = JSONObject.parseArray(redisUtils.get("equip_equipDefinitions").toString(), Equipment.class);;
equipment = equipmentList.stream().filter(x -> x.getCode().equals(equipmentDetailDownloadVOS.getCode())).collect(Collectors.toList()).get(0);
} else {
QueryWrapper<Equipment> equipmentQueryWrapper = new QueryWrapper<>();
equipmentQueryWrapper.isNotNull("id");
List<Equipment> equipments = equipmentMapper.selectList(equipmentQueryWrapper);
equipment = equipments.stream().filter(x -> x.getCode().equals(equipmentDetailDownloadVOS.getCode())).collect(Collectors.toList()).get(0);
redisUtils.set("equip_equipDefinitions", JSONObject.toJSONString(equipments));
}
if (equipment == null) { if (equipment == null) {
erryy.append(String.format("装备(器材)编码[%S]填写错误,请输入正确的装备(器材)编码!",equipmentDetailDownloadVOS.getCode()) + ","); erryy.append(String.format("装备(器材)编码[%S]填写错误,请输入正确的装备(器材)编码!",equipmentDetailDownloadVOS.getCode()) + ",");
throw new RuntimeException(String.format("装备(器材)编码[%S]填写错误,请输入正确的装备(器材)编码!",equipmentDetailDownloadVOS.getCode())); throw new RuntimeException(String.format("装备(器材)编码[%S]填写错误,请输入正确的装备(器材)编码!",equipmentDetailDownloadVOS.getCode()));
...@@ -604,8 +601,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -604,8 +601,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
throw new RuntimeException(String.format("物联编码[%S]填写重复,请重新输入!",iotCode)); throw new RuntimeException(String.format("物联编码[%S]填写重复,请重新输入!",iotCode));
} }
if(StringUtils.isNotEmpty(haveUsedIotPrefix) && Arrays.stream(haveUsedIotPrefix.split(",")).anyMatch(iotCode::startsWith)){ if(StringUtils.isNotEmpty(haveUsedIotPrefix) && Arrays.stream(haveUsedIotPrefix.split(",")).anyMatch(iotCode::startsWith)){
erryy.append(String.format("物联编码[%S]航班已占用,请重新输入!",iotCode)+ ","); erryy.append(String.format("物联编码[%S]已占用,请重新输入!",iotCode)+ ",");
throw new BadRequest("物联编码航班已占用"); throw new BadRequest("物联编码已占用");
} }
} }
AtomicReference<String> fightSysIds = new AtomicReference<>(""); AtomicReference<String> fightSysIds = new AtomicReference<>("");
...@@ -680,7 +677,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -680,7 +677,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
equipmentSpecific.setTeamId(fireTeam[1]); equipmentSpecific.setTeamId(fireTeam[1]);
} }
// 导入新增所属单位 // 导入新增所属单位
if (StringUtils.isNotBlank(equipmentDetailDownloadVOS.getCompanyName())) { if (StringUtils.isNotBlank(equipmentDetailDownloadVOS.getCompanyName())) {
String[] company = equipmentDetailDownloadVOS.getCompanyName().split("@"); String[] company = equipmentDetailDownloadVOS.getCompanyName().split("@");
equipmentSpecific.setAgencyId(company[1]); equipmentSpecific.setAgencyId(company[1]);
...@@ -700,9 +696,19 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -700,9 +696,19 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
controllerProxy.refreshCount(equipmentSpecific.getBizOrgCode()); controllerProxy.refreshCount(equipmentSpecific.getBizOrgCode());
//位置编码不为空入库 //位置编码不为空入库
if (equipmentDetailDownloadVOS != null && equipmentDetailDownloadVOS.getWarehouseStructCode() != null) { if (equipmentDetailDownloadVOS != null && equipmentDetailDownloadVOS.getWarehouseStructCode() != null) {
QueryWrapper<WarehouseStructure> warehouseStructureQueryWrapper = new QueryWrapper<>(); // QueryWrapper<WarehouseStructure> warehouseStructureQueryWrapper = new QueryWrapper<>();
warehouseStructureQueryWrapper.lambda().eq(WarehouseStructure::getCode, equipmentDetailDownloadVOS.getWarehouseStructCode()); // warehouseStructureQueryWrapper.lambda().eq(WarehouseStructure::getCode, equipmentDetailDownloadVOS.getWarehouseStructCode());
WarehouseStructure warehouseStructure = warehouseStructureService.getOne(warehouseStructureQueryWrapper); // WarehouseStructure warehouseStructure = warehouseStructureService.getOne(warehouseStructureQueryWrapper);
// 入库位置进行优化
WarehouseStructure warehouseStructure;
if (redisUtils.hasKey("equip_warehouseStructures")) {
List<WarehouseStructure> warehouseStructures = JSONObject.parseArray(redisUtils.get("equip_warehouseStructures").toString(), WarehouseStructure.class);
warehouseStructure = warehouseStructures.stream().filter(x -> x.getCode().equals(equipmentDetailDownloadVOS.getWarehouseStructCode())).collect(Collectors.toList()).get(0);
} else {
List<WarehouseStructure> warehouseStructures = warehouseStructureService.list();
warehouseStructure = warehouseStructures.stream().filter(x -> x.getCode().equals(equipmentDetailDownloadVOS.getWarehouseStructCode())).collect(Collectors.toList()).get(0);
redisUtils.set("equip_warehouseStructures", JSONObject.toJSONString(warehouseStructures));
}
if (warehouseStructure == null) { if (warehouseStructure == null) {
erryy.append(String.format("货位编码[%S]填写错误,请输入正确的货位编码!",equipmentDetailDownloadVOS.getWarehouseStructCode())+ ","); erryy.append(String.format("货位编码[%S]填写错误,请输入正确的货位编码!",equipmentDetailDownloadVOS.getWarehouseStructCode())+ ",");
throw new RuntimeException(String.format("货位编码[%S]填写错误,请输入正确的货位编码!",equipmentDetailDownloadVOS.getWarehouseStructCode())); throw new RuntimeException(String.format("货位编码[%S]填写错误,请输入正确的货位编码!",equipmentDetailDownloadVOS.getWarehouseStructCode()));
...@@ -770,7 +776,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -770,7 +776,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
} }
list.add(equipmentSpecific); list.add(equipmentSpecific);
this.equipmentSpecificIndexSave(equipmentDetail, equipmentSpecific); this.equipmentSpecificIndexSave(equipmentDetail, equipmentSpecific);
platformTransactionManager.commit(transactionStatus); platformTransactionManager.commit(transactionStatus);
} catch (Exception e) { } catch (Exception e) {
platformTransactionManager.rollback(transactionStatus); platformTransactionManager.rollback(transactionStatus);
errBufferName.append(equipmentDetailDownloadVOS.getCode() + ","); errBufferName.append(equipmentDetailDownloadVOS.getCode() + ",");
...@@ -781,10 +787,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -781,10 +787,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
} }
// @Async // @Async
public void refreshCount(String bizOrgCode) { public void refreshCount(String bizOrgCode) {
equipmentSpecificSerivce.refreshStaData(); equipmentSpecificSerivce.refreshStaData();
......
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
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.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -68,4 +67,18 @@ public class EquipmentController extends BaseController { ...@@ -68,4 +67,18 @@ public class EquipmentController extends BaseController {
public ResponseModel getWaterResourceList(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) { public ResponseModel getWaterResourceList(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
return ResponseHelper.buildResponse(equipmentService.getWaterResourceInfoList(bizOrgCode)); return ResponseHelper.buildResponse(equipmentService.getWaterResourceInfoList(bizOrgCode));
} }
/**
* 获取驻站消防员和运维人员数量
* @param
* @returnP
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/resources/count", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "消防资源部分数据-四横八纵", notes = "消防资源部分数据-四横八纵")
public ResponseModel<Map<String, Object>> getResourcesCount() {
Map<String, Object> map = equipmentService.getResourcesCount();
return ResponseHelper.buildResponse(map);
}
} }
...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto; ...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.MaintenanceCompanyMapper; import com.yeejoin.amos.boot.module.common.api.mapper.MaintenanceCompanyMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -74,6 +75,7 @@ public class EquipmentServiceImpl { ...@@ -74,6 +75,7 @@ public class EquipmentServiceImpl {
List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult(); List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult();
List<MenuFrom> buildingTreeList = Lists.newArrayList(); List<MenuFrom> buildingTreeList = Lists.newArrayList();
buildingMapList.forEach(building -> { buildingMapList.forEach(building -> {
MenuFrom menuFrom = new MenuFrom((String) building.get("id"), "全部建筑", (String) building.get("parentId"), MenuFrom menuFrom = new MenuFrom((String) building.get("id"), "全部建筑", (String) building.get("parentId"),
"0"); "0");
List<Map<String, Object>> children = (List<Map<String, Object>>) building.get("children"); List<Map<String, Object>> children = (List<Map<String, Object>>) building.get("children");
...@@ -92,6 +94,10 @@ public class EquipmentServiceImpl { ...@@ -92,6 +94,10 @@ public class EquipmentServiceImpl {
(String) child.get("parentId"), "0"); (String) child.get("parentId"), "0");
if (!ValidationUtil.isEmpty(child.get("children"))) { if (!ValidationUtil.isEmpty(child.get("children"))) {
parseTree(menuFrom, (List<Map<String, Object>>) child.get("children")); parseTree(menuFrom, (List<Map<String, Object>>) child.get("children"));
if(parent!=null){
parent.setIsLeaf(false);
}
} else { } else {
parent.setIsLeaf(false); parent.setIsLeaf(false);
} }
...@@ -145,4 +151,8 @@ public class EquipmentServiceImpl { ...@@ -145,4 +151,8 @@ public class EquipmentServiceImpl {
public List<Map<String, Object>> getWaterResourceInfoList(String bizOrgCode){ public List<Map<String, Object>> getWaterResourceInfoList(String bizOrgCode){
return waterResourceServiceImpl.getWaterResourceInfoList(bizOrgCode); return waterResourceServiceImpl.getWaterResourceInfoList(bizOrgCode);
} }
public Map<String, Object> getResourcesCount() {
return waterResourceServiceImpl.getResourcesCount();
}
} }
package com.yeejoin.amos.knowledgebase.controller; package com.yeejoin.amos.knowledgebase.controller;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -80,6 +81,20 @@ public class DocLibraryResource { ...@@ -80,6 +81,20 @@ public class DocLibraryResource {
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "知识库卡片信息")
@RequestMapping(value = "/card", method = RequestMethod.GET)
public ResponseModel<Object> queryDocCard(HttpServletRequest request,
@RequestParam(value = "offset") Integer offset,
@RequestParam(value = "end") Integer end,
@RequestParam(value = "filterByCollection") String filterByCollection,
@RequestParam(value = "directoryId", required = false) Long directoryId,
@RequestParam(value = "docTitle", required = false) String docTitle,
@RequestParam(value = "createTimeLeft", required = false) String createTimeLeft,
@RequestParam(value = "createTimeRight", required = false) String createTimeRight) {
return ResponseHelper.buildResponse(docLibraryService.queryCardList());
}
/** /**
* 收藏文档 * 收藏文档
* *
......
...@@ -29,6 +29,10 @@ public interface DocContentMapper extends BaseMapper<KnowledgeDocContent> { ...@@ -29,6 +29,10 @@ public interface DocContentMapper extends BaseMapper<KnowledgeDocContent> {
List<Map<String,Object>> queryDocBaseInfoList(Map<String, Object> paramMap); List<Map<String,Object>> queryDocBaseInfoList(Map<String, Object> paramMap);
List<Map<String,Object>> queryDocCardList();
List<Map<String,Object>> queryCardCount();
int queryDocBaseInfoTotal(Map<String, Object> paramMap); int queryDocBaseInfoTotal(Map<String, Object> paramMap);
List<Long> getAllPublishedDocIds(); List<Long> getAllPublishedDocIds();
......
...@@ -181,6 +181,16 @@ public class DocLibraryService { ...@@ -181,6 +181,16 @@ public class DocLibraryService {
return page; return page;
} }
public Map<String,Object> queryCardList(){
List<Map<String, Object>> content = docContentService.getBaseMapper().queryDocCardList();
List<Map<String, Object>> countMap = docContentService.getBaseMapper().queryCardCount();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("content",content);
countMap.forEach(e->resultMap.put(e.get("directoryName").toString(),e.get("num")));
return resultMap;
}
private void addExtraFieldsAndFilters(Map<String, Object> paramsMap, Map<String, String[]> requestMap) { private void addExtraFieldsAndFilters(Map<String, Object> paramsMap, Map<String, String[]> requestMap) {
List<KnowledgeDynamicsOptionModel> optionModels = dynamicsOptionService.queryByFunctional(RequestContext.getAppKey(), DynamicsFunctional.DOC_BASEINFO.name()); List<KnowledgeDynamicsOptionModel> optionModels = dynamicsOptionService.queryByFunctional(RequestContext.getAppKey(), DynamicsFunctional.DOC_BASEINFO.name());
if (ValidationUtil.isEmpty(optionModels)) { if (ValidationUtil.isEmpty(optionModels)) {
......
...@@ -9,10 +9,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -9,10 +9,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.maintenance.business.feign.JCSFeignClient; import com.yeejoin.amos.maintenance.business.feign.JCSFeignClient;
import com.yeejoin.amos.maintenance.exception.PermissionException; import com.yeejoin.amos.maintenance.exception.PermissionException;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -36,6 +38,8 @@ public class PersonIdentifyAspect { ...@@ -36,6 +38,8 @@ public class PersonIdentifyAspect {
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
JCSFeignClient jcsFeignClient; JCSFeignClient jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Before(value = "@annotation(com.yeejoin.amos.maintenance.core.framework.PersonIdentify) && @annotation(permission)") @Before(value = "@annotation(com.yeejoin.amos.maintenance.core.framework.PersonIdentify) && @annotation(permission)")
...@@ -49,6 +53,12 @@ public class PersonIdentifyAspect { ...@@ -49,6 +53,12 @@ public class PersonIdentifyAspect {
throw new RuntimeException(responseModel.getDevMessage()); throw new RuntimeException(responseModel.getDevMessage());
} }
ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class); ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
} }
......
...@@ -1133,36 +1133,36 @@ public class PointServiceImpl implements IPointService { ...@@ -1133,36 +1133,36 @@ public class PointServiceImpl implements IPointService {
Map<String, Object> resp = new HashMap<String, Object>(); Map<String, Object> resp = new HashMap<String, Object>();
Map<String, Object> point = pointMapper.getPointById(id); Map<String, Object> point = pointMapper.getPointById(id);
if (StringUtil.isNotEmpty(point.get("depid"))) { // if (StringUtil.isNotEmpty(point.get("depid"))) {
List<LinkedHashMap> departmentBos = remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, point.get("depid") + ""); // List<LinkedHashMap> departmentBos = remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, point.get("depid") + "");
if (departmentBos != null && departmentBos.size() > 0) { // if (departmentBos != null && departmentBos.size() > 0) {
for (int i = 0; i < departmentBos.size(); i++) { // for (int i = 0; i < departmentBos.size(); i++) {
point.put("departmentName", departmentBos.get(i).get("departmentName")); // point.put("departmentName", departmentBos.get(i).get("departmentName"));
//
//
} // }
} // }
//
} // }
// deptName = checkPointBo.getExecuteDeptId(); // deptName = checkPointBo.getExecuteDeptId();
if (StringUtil.isNotEmpty(point.get("userName"))) { // if (StringUtil.isNotEmpty(point.get("userName"))) {
List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds(toke, product, appKey, point.get("userName") + ""); // List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds(toke, product, appKey, point.get("userName") + "");
String userName = ""; // String userName = "";
if (userModels != null && userModels.size() > 0) { // if (userModels != null && userModels.size() > 0) {
for (int i = 0; i < userModels.size(); i++) { // for (int i = 0; i < userModels.size(); i++) {
if (i == userModels.size() - 1) { // if (i == userModels.size() - 1) {
userName = userName + userModels.get(i).getRealName(); // userName = userName + userModels.get(i).getRealName();
} else { // } else {
userName = userName + userModels.get(i).getRealName() + ","; // userName = userName + userModels.get(i).getRealName() + ",";
} // }
//
} // }
point.put("userName", userName); // point.put("userName", userName);
} // }
//
//
} // }
......
...@@ -15,6 +15,7 @@ import org.aspectj.lang.annotation.Aspect; ...@@ -15,6 +15,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -39,6 +40,8 @@ public class PersonIdentifyAspect { ...@@ -39,6 +40,8 @@ public class PersonIdentifyAspect {
@Autowired @Autowired
private JcsFeignClient jcsFeignClient; private JcsFeignClient jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Pointcut("execution(public * com.yeejoin.amos.*.business.controller..*(..))") @Pointcut("execution(public * com.yeejoin.amos.*.business.controller..*(..))")
public void userDate() { public void userDate() {
...@@ -69,6 +72,11 @@ public class PersonIdentifyAspect { ...@@ -69,6 +72,11 @@ public class PersonIdentifyAspect {
String s = JSONObject.toJSONString(responseModel.getResult()); String s = JSONObject.toJSONString(responseModel.getResult());
ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class); ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class);
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class); // ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
......
package com.yeejoin.amos.patrol.quartz; package com.yeejoin.amos.patrol.quartz;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo; import com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo;
import com.yeejoin.amos.patrol.business.bo.PlanTaskSyncBo;
import com.yeejoin.amos.patrol.business.constants.XJConstant; import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.dao.mapper.CheckInputMapper; import com.yeejoin.amos.patrol.business.dao.mapper.CheckInputMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.MsgMapper; import com.yeejoin.amos.patrol.business.dao.mapper.MsgMapper;
...@@ -26,6 +28,7 @@ import com.yeejoin.amos.patrol.mqtt.WebMqttComponent; ...@@ -26,6 +28,7 @@ import com.yeejoin.amos.patrol.mqtt.WebMqttComponent;
import org.quartz.Job; import org.quartz.Job;
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.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -530,6 +533,11 @@ public class JobService implements IJobService { ...@@ -530,6 +533,11 @@ public class JobService implements IJobService {
if (PlanTaskFinishStatusEnum.NOTSTARTED.getValue() == planTask.getFinishStatus()) { if (PlanTaskFinishStatusEnum.NOTSTARTED.getValue() == planTask.getFinishStatus()) {
planTask.setFinishStatus(PlanTaskFinishStatusEnum.UNDERWAY.getValue()); planTask.setFinishStatus(PlanTaskFinishStatusEnum.UNDERWAY.getValue());
iPlanTaskDao.save(planTask); iPlanTaskDao.save(planTask);
if (planTask != null) {
PlanTaskSyncBo planTaskSyncBo = buildPlanTaskBo(planTask);
String message = buildSyncMessage(PatrolDataSyncTopicEnum.PLAN_TASK.getTopic(), planTaskSyncBo);
webMqttComponent.publish(PatrolDataSyncTopicEnum.EQM_PATROL_CREATED.getTopic(), message);
}
} }
} else if (XJConstant.STATUS_MONITOR_END.equals(jobType)) { } else if (XJConstant.STATUS_MONITOR_END.equals(jobType)) {
if (PlanTaskFinishStatusEnum.UNDERWAY.getValue() == planTask.getFinishStatus()) { if (PlanTaskFinishStatusEnum.UNDERWAY.getValue() == planTask.getFinishStatus()) {
...@@ -543,6 +551,19 @@ public class JobService implements IJobService { ...@@ -543,6 +551,19 @@ public class JobService implements IJobService {
removeJob(jobName); removeJob(jobName);
} }
public PlanTaskSyncBo buildPlanTaskBo(PlanTask planTask) {
PlanTaskSyncBo taskSyncBo = new PlanTaskSyncBo();
BeanUtils.copyProperties(planTask, taskSyncBo);
return taskSyncBo;
}
public String buildSyncMessage(String topic, Object object) {
Map<String, Object> map = new HashMap<>();
map.put("topic", topic);
map.put("data", object);
return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue);
}
@Override @Override
public void msgAddJob(Msg msg) { public void msgAddJob(Msg msg) {
addJob("msg", XJConstant.MESSAGE_PUSH, msg.getId(), msg.getFixedTime()); addJob("msg", XJConstant.MESSAGE_PUSH, msg.getId(), msg.getFixedTime());
......
...@@ -9,17 +9,18 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -9,17 +9,18 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient; import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
import com.yeejoin.amos.supervision.exception.PermissionException; import com.yeejoin.amos.supervision.exception.PermissionException;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -36,6 +37,8 @@ public class PersonIdentifyAspect { ...@@ -36,6 +37,8 @@ public class PersonIdentifyAspect {
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
JCSFeignClient jcsFeignClient; JCSFeignClient jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Before(value = "@annotation(com.yeejoin.amos.supervision.core.framework.PersonIdentify) && @annotation(permission)") @Before(value = "@annotation(com.yeejoin.amos.supervision.core.framework.PersonIdentify) && @annotation(permission)")
public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException { public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException {
...@@ -61,6 +64,10 @@ public class PersonIdentifyAspect { ...@@ -61,6 +64,10 @@ public class PersonIdentifyAspect {
personIdentity.setCompanyId((String) other.get("sequenceNbr")); personIdentity.setCompanyId((String) other.get("sequenceNbr"));
personIdentity.setCompanyName((String) other.get("bizOrgName")); personIdentity.setCompanyName((String) other.get("bizOrgName"));
} }
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) result.get(0), ReginParams.PersonIdentity.class); // ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) result.get(0), ReginParams.PersonIdentity.class);
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
......
...@@ -124,6 +124,9 @@ state.code=GW190301 ...@@ -124,6 +124,9 @@ state.code=GW190301
state.name=\u9526\u5c4f\u6362\u6d41\u7ad9 state.name=\u9526\u5c4f\u6362\u6d41\u7ad9
#用于总部系统与站端系统逻辑区分,站端写zd总部默认为空
system.type=zd
# 是否开启遥测数据上报 # 是否开启遥测数据上报
is.open.telemetering=false is.open.telemetering=false
......
...@@ -126,4 +126,7 @@ management.security.enabled=true ...@@ -126,4 +126,7 @@ management.security.enabled=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
spring.security.user.name=admin spring.security.user.name=admin
spring.security.user.password=a1234560 spring.security.user.password=a1234560
stationCode=LSHLZ1bZAJU645Pgl7 stationCode=LSHLZ1bZAJU645Pgl7
\ No newline at end of file
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
\ No newline at end of file
...@@ -98,18 +98,12 @@ ...@@ -98,18 +98,12 @@
<select id="selectEmergencyMaterials" resultType="java.util.Map"> <select id="selectEmergencyMaterials" resultType="java.util.Map">
SELECT SELECT
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3104', '%' ) ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3104', '%' ) ) AS fireExtinguisher,
and wel.biz_org_code like concat(#{bizOrgCode} , '%') ) AS fireExtinguisher, ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3105', '%' ) ) AS fireHydrant,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3105', '%' ) ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3910', '%' ) ) AS fireShovel,
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireHydrant, ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3904', '%' ) ) AS fireAxe,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3910', '%' ) ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3911', '%' ) ) AS fireBucket,
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireShovel, ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '1106', '%' ) ) AS respirator
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3904', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireAxe,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3911', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireBucket,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '1106', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS respirator
</select> </select>
<select id="selectEmergencyMaterialsDetails" resultType="java.util.Map"> <select id="selectEmergencyMaterialsDetails" resultType="java.util.Map">
SELECT SELECT
...@@ -147,6 +141,8 @@ ...@@ -147,6 +141,8 @@
concat( wesi.equipment_index_name, '(是)' ) concat( wesi.equipment_index_name, '(是)' )
WHEN 'false' THEN WHEN 'false' THEN
concat( wesi.equipment_index_name, '(否)' ) concat( wesi.equipment_index_name, '(否)' )
ELSE
wesi.equipment_index_name
END) ELSE wesi.value_label END FROM wl_equipment_specific_index wesi END) ELSE wesi.value_label END FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_index wei on wesi.equipment_index_id = wei.id LEFT JOIN wl_equipment_index wei on wesi.equipment_index_id = wei.id
WHERE wesi.equipment_specific_id = temp.id AND wei.is_trend = 0 WHERE wesi.equipment_specific_id = temp.id AND wei.is_trend = 0
...@@ -229,7 +225,7 @@ ...@@ -229,7 +225,7 @@
wes.equipment_code as code , wes.equipment_code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'--' '暂无信号'
) AS status, ) AS status,
CASE CASE
...@@ -253,7 +249,7 @@ ...@@ -253,7 +249,7 @@
wes.equipment_code as code , wes.equipment_code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'--' '暂无信号'
) AS status, ) AS status,
CASE CASE
...@@ -278,7 +274,7 @@ ...@@ -278,7 +274,7 @@
wes.equipment_code as code , wes.equipment_code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'--' '暂无信号'
) AS status, ) AS status,
CASE CASE
...@@ -303,7 +299,7 @@ ...@@ -303,7 +299,7 @@
wes.equipment_code as code , wes.equipment_code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'--' '暂无信号'
) AS status, ) AS status,
CASE CASE
...@@ -327,6 +323,8 @@ ...@@ -327,6 +323,8 @@
temp.name, temp.name,
temp.nowPressure, temp.nowPressure,
temp.area, temp.area,
temp.minPressure AS `minValue`,
temp.maxPressure AS `maxValue`,
CASE CASE
WHEN temp.nowPressure = '--' THEN WHEN temp.nowPressure = '--' THEN
'--' '--'
...@@ -334,13 +332,9 @@ ...@@ -334,13 +332,9 @@
'--' '--'
WHEN temp.minPressure = '' THEN WHEN temp.minPressure = '' THEN
'--' '--'
WHEN ( temp.maxPressure = 0 ) THEN WHEN (temp.nowPressure - temp.maxPressure) > 0 THEN
'--'
WHEN ( temp.minPressure = 0 ) THEN
'--'
WHEN temp.nowPressure - temp.maxPressure > 0 THEN
'压力高' '压力高'
WHEN temp.minPressure - temp.nowPressure > 0 THEN WHEN (temp.minPressure - temp.nowPressure) > 0 THEN
'压力低' ELSE '正常' '压力低' ELSE '正常'
END AS status, END AS status,
1 AS type 1 AS type
...@@ -351,8 +345,8 @@ ...@@ -351,8 +345,8 @@
wes.name, wes.name,
concat_ws( '-', ws.full_name, ed.area ) area, concat_ws( '-', ws.full_name, ed.area ) area,
IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_PipePressureDetector_PipePressure' ), '--' ) AS nowPressure, IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_PipePressureDetector_PipePressure' ), '--' ) AS nowPressure,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxPressure' ), 0 ) AS maxPressure, IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxPressure' AND field_value <![CDATA[<>]]> '' ), 1.5 ) AS maxPressure,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minPressure' ), 0 ) AS minPressure IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minPressure' AND field_value <![CDATA[<>]]> '' ), 0.5 ) AS minPressure
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id
...@@ -368,22 +362,20 @@ ...@@ -368,22 +362,20 @@
temp.name, temp.name,
temp.nowFlow, temp.nowFlow,
temp.area, temp.area,
temp.minFlow AS `minValue`,
temp.maxFlow AS `maxValue`,
CASE CASE
WHEN temp.nowFlow = '--' THEN WHEN temp.nowFlow = '--' THEN
'--' '--'
WHEN temp.maxFlow = '' THEN WHEN temp.maxFlow = '' THEN
'--' '--'
WHEN temp.minFlow = '' THEN WHEN temp.minFlow = '' THEN
'--' '--'
WHEN ( temp.maxFlow = 0 ) THEN WHEN (temp.nowFlow - IFNULL(temp.maxFlow, 0)) > 0 THEN
'--' '流量高'
WHEN ( temp.minFlow = 0 ) THEN WHEN (IFNULL(temp.minFlow, 0) - temp.nowFlow) > 0 THEN
'--' '流量低' ELSE '正常'
WHEN temp.nowFlow - temp.maxFlow > 0 THEN END AS status,
'流量高'
WHEN temp.minFlow - temp.nowFlow > 0 THEN
'流量低' ELSE '正常'
END AS status,
2 AS type 2 AS type
FROM FROM
( (
...@@ -392,8 +384,8 @@ ...@@ -392,8 +384,8 @@
wes.NAME, wes.NAME,
concat_ws( '-', ws.full_name, ed.area ) area, concat_ws( '-', ws.full_name, ed.area ) area,
IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_FirePoolDevice_InfluentFlow' ), '--' ) AS nowFlow, IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_FirePoolDevice_InfluentFlow' ), '--' ) AS nowFlow,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxFlow' ), 0 ) AS maxFlow, IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxFlow' AND field_value <![CDATA[<>]]> '' ), 2.4 ) AS maxFlow,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minFlow' ), 0 ) AS minFlow IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minFlow' AND field_value <![CDATA[<>]]> '' ), 0.5 ) AS minFlow
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id
...@@ -404,5 +396,630 @@ ...@@ -404,5 +396,630 @@
wes.equipment_code LIKE concat( '92010700', '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) wes.equipment_code LIKE concat( '92010700', '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp ) temp
</select> </select>
<select id="selectAlarmAnalysis" resultType="java.util.Map">
SELECT
temp.date,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Fault')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS faultNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS alarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS shieldNum
FROM
<if test="dataType == 1">
(
SELECT
date_format(
(#{date} - INTERVAL 0 MONTH),
'%Y-%m'
) AS `date`
UNION
(SELECT
date_format(
(#{date} - INTERVAL -1 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -2 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -3 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -4 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -5 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -6 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -7 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -8 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -9 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -10 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -11 MONTH),
'%Y-%m'
) AS `date`))temp
</if>
<if test="dataType != 1">
(
SELECT temp.selected_date as date FROM
(SELECT ADDDATE('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date FROM
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t0,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t1,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t2,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t3,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t4)
temp
WHERE selected_date BETWEEN #{startDate} AND #{endDate}
) temp
ORDER BY
temp.date
</if>
</select>
<select id="selectAlarmAnalysisCount" resultType="java.util.Map">
SELECT
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Fault')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS faultNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS fireAlarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS shieldNum
</select>
<select id="selectSystemCodes" resultType="java.lang.String">
SELECT
fs. code
FROM
f_fire_fighting_system fs
WHERE
fs.system_type_code = #{systemType}
</select>
<select id="selectFireCannonAlarmAnalysisPie" resultType="java.util.Map">
SELECT
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Fault')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS faultNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS fireAlarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS shieldNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'PowerLoss')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS lossNum
</select>
<select id="waterSystemAlarmAnalysis" resultType="java.util.Map">
SELECT
temp.date,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010600' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS firePumpsAlarmNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010800' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS stabilizedPumpAlarmNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010500' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS controlCabinetAlarmNum
FROM
<if test="dataType == 1">
(
SELECT
date_format(
(#{date} - INTERVAL 0 MONTH),
'%Y-%m'
) AS `date`
UNION
(SELECT
date_format(
(#{date} - INTERVAL -1 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -2 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -3 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -4 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -5 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -6 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -7 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -8 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -9 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -10 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -11 MONTH),
'%Y-%m'
) AS `date`))temp
</if>
<if test="dataType != 1">
(
SELECT temp.selected_date as date FROM
(SELECT ADDDATE('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date FROM
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t0,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t1,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t2,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t3,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t4)
temp
WHERE selected_date BETWEEN #{startDate} AND #{endDate}
) temp
ORDER BY
temp.date
</if>
</select>
<select id="fireCannonSystemAlarmAnalysis" resultType="java.util.Map">
SELECT
temp.date,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm ')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS fireAlarmNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS shieldNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Fault ')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS faultNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'PowerLoss ')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS powerLossNum
FROM
<if test="dataType == 1">
(
SELECT
date_format(
(#{date} - INTERVAL 0 MONTH),
'%Y-%m'
) AS `date`
UNION
(SELECT
date_format(
(#{date} - INTERVAL -1 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -2 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -3 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -4 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -5 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -6 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -7 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -8 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -9 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -10 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -11 MONTH),
'%Y-%m'
) AS `date`))temp
</if>
<if test="dataType != 1">
(
SELECT temp.selected_date as date FROM
(SELECT ADDDATE('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date FROM
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t0,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t1,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t2,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t3,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t4)
temp
WHERE selected_date BETWEEN #{startDate} AND #{endDate}
) temp
ORDER BY
temp.date
</if>
</select>
<select id="waterSystemAlarmAnalysisPie" resultType="java.util.Map">
SELECT
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010600' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS firePumpsAlarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010800' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS stabilizedPumpAlarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010500' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS controlCabinetAlarmNum
</select>
<select id="getSystemAndCarCount" resultType="java.util.Map">
SELECT
(SELECT count(*) FROM f_fire_fighting_system) fireSystem,
(SELECT count(*) FROM wl_car) fireCar
</select>
</mapper> </mapper>
...@@ -1395,6 +1395,32 @@ ...@@ -1395,6 +1395,32 @@
ORDER BY ORDER BY
`wlesal`.`create_date` DESC `wlesal`.`create_date` DESC
</select> </select>
<select id="dcFireAlarmLogPage" resultType="java.util.HashMap">
SELECT
`wlesal`.equipment_specific_index_name type,
`wlesal`.equipment_specific_name alamContent,
DATE_FORMAT(`wlesal`.`create_date`,'%m-%d %H:%i:%s') createDate,
wlesal.location
FROM
`wl_equipment_specific_alarm_log` `wlesal`
LEFT JOIN `wl_equipment_specific_alarm` wesa ON wesa.id = wlesal.equipment_specific_alarm_id
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
<where>
wesa.`status` = 1
<if test="param.system != null and param.system != ''">
AND find_in_set( #{param.system}, `wlesal`.`system_codes` )
</if>
<if test="param.fireEquipmentSpecificIndexKey != null and param.fireEquipmentSpecificIndexKey != ''">
AND wlesal.type = #{param.fireEquipmentSpecificIndexKey}
</if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''">
AND wlesal.biz_org_code like concat (#{param.bizOrgCode},'%')
</if>
</where>
ORDER BY
`wlesal`.`create_date` DESC
</select>
<select id="alarmTrend" resultType="java.util.Map"> <select id="alarmTrend" resultType="java.util.Map">
SELECT SELECT
`result`.`click_date` AS `click_date`, `result`.`click_date` AS `click_date`,
...@@ -1480,6 +1506,7 @@ ...@@ -1480,6 +1506,7 @@
ORDER BY ORDER BY
`result`.`click_date` `result`.`click_date`
</select> </select>
<select id="pressureMessage" resultType="java.util.Map"> <select id="pressureMessage" resultType="java.util.Map">
select select
( (
...@@ -1516,5 +1543,33 @@ ...@@ -1516,5 +1543,33 @@
and update_date >= and update_date >=
#{startTime} and #{endTime} >= update_date #{startTime} and #{endTime} >= update_date
) as startNum) as startNum ) as startNum) as startNum
</select>
<select id="stationInfo" resultType="java.util.Map">
SELECT
a.`name`,
a.`code`,
CASE
WHEN a.countAlarmTotal = 0 THEN
SUM( a.NAME ) ELSE count( a.`name` )
END AS alarmEquipTotal,
IFNULL( SUM( a.countAlarmTotal ), 0 ) countAlarmTotal
FROM
(
SELECT
fs.`name`,
fs.`code`,
IFNULL( sum( wesi.`status` ), 0 ) AS countAlarmTotal
FROM
idx_biz_station_info fs
LEFT JOIN wl_equipment_specific_alarm wesi ON wesi.station_code = fs.`code`
AND wesi.`status` = 1
GROUP BY
fs.id,
wesi.equipment_specific_id
) a
GROUP BY
a.`name`
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -4127,12 +4127,11 @@ ...@@ -4127,12 +4127,11 @@
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids ) LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids )
LEFT JOIN wl_equipment_specific spec on report.equipment_specific_id = spec.id LEFT JOIN wl_equipment_specific spec on report.equipment_specific_id = spec.id
where report.system_ids is not null and report.index_true_num > 0 where report.system_ids is not null and report.index_true_num > 0
and( report.index_type LIKE CONCAT('%','Fault','%')
or report.index_type LIKE CONCAT('%','FireAlarm','%') <foreach collection="indicator" item="index" open="AND(" separator="or" close=")">
or report.index_type LIKE CONCAT('%','Shield','%') report.index_type like concat ('%', #{index})
or report.index_type LIKE CONCAT('%','Open','%') </foreach>
or report.index_type LIKE CONCAT('%','OilLeak','%')
or report.index_type LIKE CONCAT('%','Alarm','%'))
and report.report_date BETWEEN #{startDate} and #{endDate} and report.report_date BETWEEN #{startDate} and #{endDate}
and system_id = #{systemId} and system_id = #{systemId}
and index_type = #{indexType} and index_type = #{indexType}
...@@ -5015,6 +5014,26 @@ ...@@ -5015,6 +5014,26 @@
OR ( `is_alarm` = 0 AND `value` = 'false' )) OR ( `is_alarm` = 0 AND `value` = 'false' ))
</select> </select>
<select id="queryStartAndStopBySpecificId" resultType="java.util.Map"> <select id="queryStartAndStopBySpecificId" resultType="java.util.Map">
( SELECT
i.equipment_specific_id,
DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date,
i.equipment_index_name
FROM
wl_equipment_specific_index i
WHERE
<if test="ids != null and ids.size > 0">
i.equipment_specific_id IN
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
AND
</if>
i.equipment_index_key in ('FHS_PressurePump_Start')
ORDER BY
i.update_date DESC
limit 1
) union
(
SELECT SELECT
i.equipment_specific_id, i.equipment_specific_id,
DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date, DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date,
...@@ -5029,10 +5048,11 @@ ...@@ -5029,10 +5048,11 @@
</foreach> </foreach>
AND AND
</if> </if>
i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop') i.equipment_index_key in ('FHS_PressurePump_Stop')
ORDER BY ORDER BY
i.update_date DESC i.update_date DESC
limit 2 limit 1
)
</select> </select>
<select id="queryStateBySpecificId" resultType="java.util.Map"> <select id="queryStateBySpecificId" resultType="java.util.Map">
SELECT SELECT
...@@ -5495,5 +5515,170 @@ ...@@ -5495,5 +5515,170 @@
GROUP BY GROUP BY
s.id s.id
</select> </select>
<select id="selectAllPressurePumpInfo" resultType="java.util.Map">
SELECT
ed.`name`,
concat_ws( '-', ws.full_name, ed.area ) area,
es.iot_code,
es.id,
IFNULL( sum( `status` ), 0 ) AS isAlarm
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = es.warehouse_structure_id
LEFT JOIN wl_equipment_specific_alarm esa ON esa.equipment_specific_id = es.id
WHERE
ed.`code` LIKE '92010800%'
AND es.iot_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''" >
AND es.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
es.id
</select>
<select id="selectAllDays" resultType="java.util.Map">
select temp.date from (
SELECT
date
FROM
(
SELECT
DATE_FORMAT(
DATE_SUB(
last_day(curdate()),
INTERVAL xc - 1 DAY
),
'%Y-%m-%d'
) AS date
FROM
(
SELECT
@xi :=@xi + 1 AS xc
FROM
(
SELECT
1
UNION
SELECT
2
UNION
SELECT
3
UNION
SELECT
4
UNION
SELECT
5
UNION
SELECT
6
) xc1,
(
SELECT
1
UNION
SELECT
2
UNION
SELECT
3
UNION
SELECT
4
UNION
SELECT
5
UNION
SELECT
6
) xc2,
(SELECT @xi := 0) xc0
) xcxc
) x0
WHERE
x0.date >= (
SELECT
date_add(
curdate(),
INTERVAL - DAY (curdate()) + 1 DAY
)
)
)temp
order by temp.date
</select>
<select id="getEquip" resultType="java.util.Map">
SELECT
spe.id,
det.`name` equipmentName,
spe.`code`,
det.`code` equipmentCode,
(
CASE
( SELECT count(*) FROM wl_equipment_specific_alarm wesa WHERE wesa.equipment_specific_id = spe.id AND STATUS = 1 )
WHEN 0 THEN
'正常' ELSE '异常'
END
) flag
FROM
wl_equipment_specific AS spe
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_stock_detail AS wlsd ON wlsd.equipment_detail_id = det.id
WHERE
fs.system_type_code IS NOT NULL
AND fs.system_type_code = 'fireAlarmSys'
AND wlsd.`status` = 1
GROUP BY det.`code`
</select>
<select id="selectPressureDetails" resultType="java.util.Map">
SELECT
ed.`name`,
concat_ws('-', ws.full_name, ed.area) area,
es.iot_code as iotCode,
es.id,
(
SELECT
DATE_FORMAT(wesi.update_date,'%Y-%m-%d %H:%i:%S')
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = es.id
AND wesi.equipment_index_key IN ('FHS_PressurePump_Stop')
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS stopTime,
(
SELECT
DATE_FORMAT(wesi.update_date,'%Y-%m-%d %H:%i:%S')
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = es.id
AND wesi.equipment_index_key IN ('FHS_PressurePump_Start')
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS startTime
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = es.warehouse_structure_id
LEFT JOIN wl_equipment_specific_alarm esa ON esa.equipment_specific_id = es.id
WHERE
ed.`code` LIKE '92010800%'
AND es.iot_code IS NOT NULL
AND es.biz_org_code like CONCAT(#{bizOrgCode}, '%')
GROUP BY
es.id
</select>
<select id="selectEquipmentSpecificById" resultType="java.util.Map">
select * from wl_equipment_specific where id = #{id}
</select>
</mapper> </mapper>
...@@ -103,5 +103,7 @@ redis.cache.failure.time=10800 ...@@ -103,5 +103,7 @@ redis.cache.failure.time=10800
#now.gateway.address=http://172.16.10.72:10005/ #now.gateway.address=http://172.16.10.72:10005/
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -3518,7 +3518,7 @@ ...@@ -3518,7 +3518,7 @@
ALTER TABLE `cb_data_dictionary` add column `extend` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '扩展列'; ALTER TABLE `cb_data_dictionary` add column `extend` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '扩展列';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="shg" id="1663051535136-1"> <changeSet author="shg" id="1663051595136-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
<tableExists tableName="cb_org_usr_agency_user"/> <tableExists tableName="cb_org_usr_agency_user"/>
...@@ -3541,7 +3541,6 @@ ...@@ -3541,7 +3541,6 @@
PRIMARY KEY (`sequence_nbr`) USING BTREE, PRIMARY KEY (`sequence_nbr`) USING BTREE,
UNIQUE KEY `uk_org_usr_id` (`org_usr_id`) USING BTREE UNIQUE KEY `uk_org_usr_id` (`org_usr_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='单位人员平台人员关系表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='单位人员平台人员关系表';
>>>>>>> develop_dl_plan6
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tianyiming" id="20220923-tianyiming"> <changeSet author="tianyiming" id="20220923-tianyiming">
...@@ -3858,5 +3857,18 @@ ...@@ -3858,5 +3857,18 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tym" id="202301050916">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>cb_data_dictionary 添加人员类型</comment>
<sql>
REPLACE INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `extend`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1604, '1604', '检修人员', 'DLRYLX', NULL, NULL, NULL, NULL, NULL, NULL, b'0', 4);
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -23,3 +23,5 @@ mybatis-plus.mapper-locations=classpath:mapper/* ...@@ -23,3 +23,5 @@ mybatis-plus.mapper-locations=classpath:mapper/*
redis.cache.failure.time=10800 redis.cache.failure.time=10800
management.endpoints.enabled-by-default=false management.endpoints.enabled-by-default=false
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
)d LIMIT #{offset},#{length} )d LIMIT #{offset},#{length}
</select> </select>
<select id="queryDocBaseInfoList" parameterType="map" resultType="map"> <select id="queryDocBaseInfoList" parameterType="map" resultType="map">
SELECT SELECT
SEQUENCE_NBR sequenceNbr, REC_DATE recDate, DOC_STATUS docStatus, CREATE_TIME createTime, USER_ID userId, SEQUENCE_NBR sequenceNbr, REC_DATE recDate, DOC_STATUS docStatus, CREATE_TIME createTime, USER_ID userId,
...@@ -253,5 +252,72 @@ ...@@ -253,5 +252,72 @@
<select id="getAllPublishedDocIds" resultType="long"> <select id="getAllPublishedDocIds" resultType="long">
SELECT SEQUENCE_NBR FROM knowledge_doc_content WHERE DOC_STATUS = "PUBLISHED" SELECT SEQUENCE_NBR FROM knowledge_doc_content WHERE DOC_STATUS = "PUBLISHED"
</select> </select>
<select id="queryDocCardList" resultType="map">
SELECT
SEQUENCE_NBR sequenceNbr,
REC_DATE recDate,
DOC_STATUS docStatus,
CREATE_TIME createTime,
USER_ID userId,
AUDIT_STATUS auditStatus,
REJECTION_COMMENT rejectionComment,
AUDITOR_USER_ID auditorUserId,
ORG_CODE orgCode,
DOC_TITLE docTitle,
DIRECTORY_ID directoryId,
( SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID ) directoryName,
releaseDate,
excuteDate,
IFNULL( collectNum, 0 ) collectNum,
IFNULL( quoteNum, 0 ) quoteNum,
IFNULL( collect, "UNCOLLECT" ) collect
FROM
knowledge_doc_content doct
LEFT JOIN (
SELECT
INSTANCE_ID,
MAX( CASE FIELD_NAME WHEN 'releaseDate' THEN FIELD_VALUE ELSE NULL END ) AS releaseDate,
MAX( CASE FIELD_NAME WHEN 'excuteDate' THEN FIELD_VALUE ELSE NULL END ) AS excuteDate
FROM
knowledge_dynamics_value
GROUP BY
INSTANCE_ID
) fieldt ON doct.SEQUENCE_NBR = fieldt.INSTANCE_ID
LEFT JOIN ( SELECT ENTITY_ID, COUNT( 1 ) collectNum FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" GROUP BY ENTITY_ID ) coll ON doct.SEQUENCE_NBR = coll.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_COUNT quoteNum FROM knowledge_interaction_count WHERE OPERATE_TYPE = "PUBLISH" AND ENTITY_TYPE = "DOC" ) quot ON doct.SEQUENCE_NBR = quot.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_TYPE collect FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" AND USER_ID = 3780967 ) favor ON doct.SEQUENCE_NBR = favor.ENTITY_ID
WHERE
DOC_STATUS = 'PUBLISHED'
ORDER BY
directoryName DESC,
create_time DESC
</select>
<select id="queryCardCount" resultType="map">
SELECT
( SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID ) directoryName,
COUNT(SEQUENCE_NBR) as num
FROM
knowledge_doc_content doct
LEFT JOIN (
SELECT
INSTANCE_ID,
MAX( CASE FIELD_NAME WHEN 'releaseDate' THEN FIELD_VALUE ELSE NULL END ) AS releaseDate,
MAX( CASE FIELD_NAME WHEN 'excuteDate' THEN FIELD_VALUE ELSE NULL END ) AS excuteDate
FROM
knowledge_dynamics_value
GROUP BY
INSTANCE_ID
) fieldt ON doct.SEQUENCE_NBR = fieldt.INSTANCE_ID
LEFT JOIN ( SELECT ENTITY_ID, COUNT( 1 ) collectNum FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" GROUP BY ENTITY_ID ) coll ON doct.SEQUENCE_NBR = coll.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_COUNT quoteNum FROM knowledge_interaction_count WHERE OPERATE_TYPE = "PUBLISH" AND ENTITY_TYPE = "DOC" ) quot ON doct.SEQUENCE_NBR = quot.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_TYPE collect FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" ) favor ON doct.SEQUENCE_NBR = favor.ENTITY_ID
WHERE
DOC_STATUS = 'PUBLISHED'
GROUP BY DIRECTORY_ID
</select>
</mapper> </mapper>
...@@ -65,3 +65,5 @@ Knowledgebase.fegin.name=AMOS-API-KNOWLEDGEBASE ...@@ -65,3 +65,5 @@ Knowledgebase.fegin.name=AMOS-API-KNOWLEDGEBASE
## 消防救援保障部ID ## 消防救援保障部ID
fire-rescue=1432549862557130753 fire-rescue=1432549862557130753
management.endpoints.enabled-by-default=false management.endpoints.enabled-by-default=false
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -67,4 +67,7 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa ...@@ -67,4 +67,7 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa
eureka.instance.status-page-url-path=/actuator/info eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
management.endpoints.enabled-by-default=false management.endpoints.enabled-by-default=false
\ No newline at end of file
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<if test="pointName!=null">and b.name like concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">and b.name like concat(concat("%",#{pointName}),"%")</if>
<if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if> <if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null and isOk!=''">and a.is_OK = #{isOK}</if> <if test="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if>
<if test="planId!=null">and a.plan_Id = #{planId}</if> <if test="planId!=null">and a.plan_Id = #{planId}</if>
<if test="planTaskId!=null">and a.plan_task_id = #{planTaskId}</if> <if test="planTaskId!=null">and a.plan_task_id = #{planTaskId}</if>
<if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if> <if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if>
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
<if test="pointName!=null">and b.name like concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">and b.name like concat(concat("%",#{pointName}),"%")</if>
<if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if> <if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if> <if test="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if>
<if test="planId!=null">and a.plan_Id = #{planId}</if> <if test="planId!=null">and a.plan_Id = #{planId}</if>
<if test="planTaskId!=null">and a.plan_task_id = #{planTaskId}</if> <if test="planTaskId!=null">and a.plan_task_id = #{planTaskId}</if>
<if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if> <if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if>
......
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
<!-- ,prpi.id as routePointItemId--> <!-- ,prpi.id as routePointItemId-->
FROM FROM
p_point_classify ppc p_point_classify ppc
LEFT JOIN p_point_inputitem ppi ON ppi.classify_ids = ppc.id LEFT JOIN p_point_inputitem ppi ON ppi.classify_ids = ppc.id and ppc.point_id=ppi.point_id
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
<!-- lEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id--> <!-- lEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id-->
WHERE pii.is_delete = '0' WHERE pii.is_delete = '0'
......
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
'移动点' '移动点'
END) fixed, END) fixed,
p.charge_person_name userName, p.charge_person_name userName,
p.charge_dept_id depid, p.biz_org_name departmentName,
IFNULL(p.risk_source_id, '') as buildingId, IFNULL(p.risk_source_id, '') as buildingId,
p.remark, p.remark,
p.offline p.offline
......
...@@ -27,3 +27,5 @@ rule.award="\u65BD\u5DE5\u5B89\u5168\u9884\u63A7/award" ...@@ -27,3 +27,5 @@ rule.award="\u65BD\u5DE5\u5B89\u5168\u9884\u63A7/award"
#server.ssl.key-store-type=JKS #server.ssl.key-store-type=JKS
login.environment=dev login.environment=dev
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -73,4 +73,7 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa ...@@ -73,4 +73,7 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa
eureka.instance.status-page-url-path=/actuator/info eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
management.endpoints.enabled-by-default=false management.endpoints.enabled-by-default=false
\ No newline at end of file
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -5,3 +5,5 @@ spring.profiles.active=dev ...@@ -5,3 +5,5 @@ spring.profiles.active=dev
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps=true spring.jackson.serialization.write-dates-as-timestamps=true
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -6,3 +6,5 @@ spring.jackson.time-zone=GMT+8 ...@@ -6,3 +6,5 @@ spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps=true spring.jackson.serialization.write-dates-as-timestamps=true
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -35,3 +35,7 @@ spring.redis.lettuce.pool.max-wait=-1 ...@@ -35,3 +35,7 @@ spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10 spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0 spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300 spring.redis.expire.time=300
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
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