Commit b9678e18 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_dl' into develop_dl

parents 02f0b67f b7e2f19a
...@@ -166,4 +166,7 @@ public class PeopleBasicInfoDto { ...@@ -166,4 +166,7 @@ public class PeopleBasicInfoDto {
@ApiModelProperty(value = "单位人员id") @ApiModelProperty(value = "单位人员id")
private String orgUsrId; private String orgUsrId;
@ApiModelProperty(value = "人员码状态")
private String personStatus;
} }
...@@ -93,4 +93,7 @@ public class OrgUsr extends BaseEntity { ...@@ -93,4 +93,7 @@ public class OrgUsr extends BaseEntity {
@ApiModelProperty(value = "人员照片") @ApiModelProperty(value = "人员照片")
private String personImg; private String personImg;
@ApiModelProperty(value = "人员码状态")
private String personStatus;
} }
...@@ -52,4 +52,7 @@ public interface AmosTrainingFeignClient { ...@@ -52,4 +52,7 @@ public interface AmosTrainingFeignClient {
@GetMapping("/v1/examination/onlineExamPage?pageSize=10&pageNum=1&flag=online&examinationName=") @GetMapping("/v1/examination/onlineExamPage?pageSize=10&pageNum=1&flag=online&examinationName=")
ResponseModel<PageInfo> getExamStatisticsList(); ResponseModel<PageInfo> getExamStatisticsList();
@RequestMapping(value = "/studyPlan/userId/list", method = RequestMethod.GET)
ResponseModel<List<String>> getUserIdList();
} }
...@@ -36,6 +36,10 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -36,6 +36,10 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> selectCompanyDepartmentMsg(); List<OrgUsr> selectCompanyDepartmentMsg();
List<Map<String, Object>> selectStaticFire(String bizOrgCode);
List<Map<String, Object>> selectStaticYw(String bizOrgCode);
List<Map<String, Object>> selectPersonAllList(Map<String, Object> map); List<Map<String, Object>> selectPersonAllList(Map<String, Object> map);
List<OrgUsr> queryOrgUsrListByBizOrgCode(String bizOrgCode); List<OrgUsr> queryOrgUsrListByBizOrgCode(String bizOrgCode);
......
...@@ -115,6 +115,10 @@ public interface IOrgUsrService { ...@@ -115,6 +115,10 @@ public interface IOrgUsrService {
void updateDynamicFormInstance(Long instanceId, List<DynamicFormInstance> fromValueList) throws Exception; void updateDynamicFormInstance(Long instanceId, List<DynamicFormInstance> fromValueList) throws Exception;
/** /**
* @throws Exception
*/
List<Map<String, Object>> selectStatic(String bizOrgCode, String type);
/**
* @param id * @param id
* @throws Exception * @throws Exception
*/ */
...@@ -394,6 +398,8 @@ public interface IOrgUsrService { ...@@ -394,6 +398,8 @@ public interface IOrgUsrService {
RiskBizInfoVo getPersonInfo(String id,String type); RiskBizInfoVo getPersonInfo(String id,String type);
OrgUsr getPersonOne(String id);
void updatePersonStatus(String status, String id); void updatePersonStatus(String status, String id);
} }
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
max(case v.field_code when 'administrativePositionCode' then IFNULL(v.field_value_label,v.field_value) end) administrativePositionCode, max(case v.field_code when 'administrativePositionCode' then IFNULL(v.field_value_label,v.field_value) end) administrativePositionCode,
max(case v.field_code when 'internalPositionCode' then IFNULL(v.field_value_label,v.field_value) end) internalPositionCode, max(case v.field_code when 'internalPositionCode' then IFNULL(v.field_value_label,v.field_value) end) internalPositionCode,
max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,v.field_value) end) fireManagementPostCode, max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,v.field_value) end) fireManagementPostCode,
max(case v.field_code when 'fireManagementPostCode' then v.field_value end) fireManagementPost,
max(case v.field_code when 'positionType' then IFNULL(v.field_value,v.field_value_label) end) positionType, max(case v.field_code when 'positionType' then IFNULL(v.field_value,v.field_value_label) end) positionType,
max(case v.field_code when 'certificateType' then IFNULL(v.field_value_label,v.field_value) end) certificateType, max(case v.field_code when 'certificateType' then IFNULL(v.field_value_label,v.field_value) end) certificateType,
max(case v.field_code when 'holdingTime' then IFNULL(v.field_value_label,v.field_value) end) holdingTime, max(case v.field_code when 'holdingTime' then IFNULL(v.field_value_label,v.field_value) end) holdingTime,
...@@ -84,6 +85,12 @@ ...@@ -84,6 +85,12 @@
<if test="map.peopleType != null and map.peopleType != ''"> <if test="map.peopleType != null and map.peopleType != ''">
AND g.peopleType = #{map.peopleType} AND g.peopleType = #{map.peopleType}
</if> </if>
<if test="map.fireManagementPost != null">
AND g.fireManagementPost IN
<foreach item="item" index="index" collection="map.fireManagementPost" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
...@@ -112,6 +119,7 @@ ...@@ -112,6 +119,7 @@
u.amos_org_id amosOrgId, u.amos_org_id amosOrgId,
u.biz_org_code bizOrgCode, u.biz_org_code bizOrgCode,
u.parent_id parentId, u.parent_id parentId,
(select bizOrgName from cb_org_usr where sequence_nbr = u.parent_id) as companyName,
g.* g.*
FROM FROM
cb_org_usr u cb_org_usr u
...@@ -129,7 +137,10 @@ ...@@ -129,7 +137,10 @@
max(case v.field_code when 'administrativePositionCode' then IFNULL(v.field_value_label,v.field_value) end) administrativePositionCode, max(case v.field_code when 'administrativePositionCode' then IFNULL(v.field_value_label,v.field_value) end) administrativePositionCode,
max(case v.field_code when 'internalPositionCode' then IFNULL(v.field_value_label,v.field_value) end) internalPositionCode, max(case v.field_code when 'internalPositionCode' then IFNULL(v.field_value_label,v.field_value) end) internalPositionCode,
max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,v.field_value) end) fireManagementPostCode, max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,v.field_value) end) fireManagementPostCode,
max(case v.field_code when 'fireManagementPostCode' then v.field_value end) fireManagementPost,
max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,'其他') end) fireManagementPostName,
max(case v.field_code when 'positionType' then IFNULL(v.field_value,v.field_value_label) end) positionType, max(case v.field_code when 'positionType' then IFNULL(v.field_value,v.field_value_label) end) positionType,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,'其他') end) positionTypeName,
max(case v.field_code when 'certificateType' then IFNULL(v.field_value_label,v.field_value) end) certificateType, max(case v.field_code when 'certificateType' then IFNULL(v.field_value_label,v.field_value) end) certificateType,
max(case v.field_code when 'holdingTime' then IFNULL(v.field_value_label,v.field_value) end) holdingTime, max(case v.field_code when 'holdingTime' then IFNULL(v.field_value_label,v.field_value) end) holdingTime,
max(case v.field_code when 'auditCycle' then IFNULL(v.field_value_label,v.field_value) end) auditCycle, max(case v.field_code when 'auditCycle' then IFNULL(v.field_value_label,v.field_value) end) auditCycle,
...@@ -171,6 +182,12 @@ ...@@ -171,6 +182,12 @@
<if test="map.peopleType != null and map.peopleType != ''"> <if test="map.peopleType != null and map.peopleType != ''">
AND g.peopleType = #{map.peopleType} AND g.peopleType = #{map.peopleType}
</if> </if>
<if test="map.fireManagementPost != null">
AND g.fireManagementPost IN
<foreach item="item" index="index" collection="map.fireManagementPost" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
...@@ -859,7 +876,7 @@ GROUP BY ...@@ -859,7 +876,7 @@ GROUP BY
</update> </update>
<update id="updatePersonStatus"> <update id="updatePersonStatus">
update cb_org_usr set person_status = #{status} where id = #{id} update cb_org_usr set person_status = #{status} where sequence_nbr = #{id}
</update> </update>
<select id ='getPersonSimpleDetail' resultType='Map'> <select id ='getPersonSimpleDetail' resultType='Map'>
...@@ -1297,5 +1314,104 @@ LEFT JOIN ( ...@@ -1297,5 +1314,104 @@ LEFT JOIN (
)a where a.sequenceNbr is not null )a where a.sequenceNbr is not null
LIMIT #{map.pageNum}, #{map.pageSize} LIMIT #{map.pageNum}, #{map.pageSize}
</select> </select>
<select id="selectStaticFire" resultType="java.util.Map">
SELECT count( postName ) as num,( count( postName )/( SELECT count(*) AS count FROM cb_org_usr a WHERE is_delete = 0 AND biz_org_type = 'PERSON'
AND biz_org_code like concat(#{bizOrgCode}, '%')
))* 100 AS percent, postName
FROM
(
SELECT
a.*,
IFNULL( b.NAME, '其他' ) AS postName
FROM
(
SELECT DISTINCT
u.sequence_nbr sequenceNbr,
g.*
FROM
cb_org_usr u
LEFT JOIN (
SELECT
v.`instance_id`,
max( CASE v.field_code WHEN 'fireManagementPostCode' THEN IFNULL( v.field_value_label, v.field_value ) END ) fireManagementPostCode,
max( CASE v.field_code WHEN 'fireManagementPostCode' THEN v.field_value END ) fireManagementPost,
max( CASE v.field_code WHEN 'fireManagementPostCode' THEN v.field_value_label END ) fireManagementPostName,
max( CASE v.field_code WHEN 'positionType' THEN IFNULL( v.field_value, v.field_value_label ) END ) positionType,
max( CASE v.field_code WHEN 'positionType' THEN v.field_value_label END ) positionTypeName,
max( CASE v.field_code WHEN 'peopleType' THEN 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 g.peopleType = '1601'
AND u.is_delete = 0
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
GROUP BY
u.sequence_nbr,
u.biz_org_name,
u.biz_org_code
ORDER BY
u.rec_date DESC
) a
LEFT JOIN ( SELECT * FROM cb_data_dictionary WHERE type = 'XFGLGW' ) b ON LOCATE( b.CODE, a.fireManagementPost ) != 0
WHERE
a.sequenceNbr IS NOT NULL
) a
GROUP BY
postName
</select>
<select id="selectStaticYw" resultType="java.util.Map">
SELECT count( postName ) as num, (count( postName )/( SELECT count(*) AS count FROM cb_org_usr a WHERE is_delete = 0 AND biz_org_type = 'PERSON'
AND biz_org_code like concat(#{bizOrgCode}, '%')
))* 100 AS percent, postName
FROM
(
SELECT
a.*,
IFNULL( b.NAME, '其他' ) AS postName
FROM
(
SELECT DISTINCT
u.sequence_nbr sequenceNbr,
g.*
FROM
cb_org_usr u
LEFT JOIN (
SELECT
v.`instance_id`,
max( CASE v.field_code WHEN 'positionType' THEN v.field_value END ) positionType,
max( CASE v.field_code WHEN 'positionType' THEN v.field_value_label END ) positionTypeName,
max( CASE v.field_code WHEN 'peopleType' THEN 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 g.peopleType = '1602'
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
AND u.is_delete = 0
GROUP BY
u.sequence_nbr,
u.biz_org_name,
u.biz_org_code
ORDER BY
u.rec_date DESC
) a
LEFT JOIN ( SELECT * FROM cb_data_dictionary WHERE type = 'GWMC' ) b ON LOCATE( b.CODE, a.positionType ) != 0
WHERE
a.sequenceNbr IS NOT NULL
) a
GROUP BY
postName
</select>
</mapper> </mapper>
...@@ -141,4 +141,7 @@ public class FireFightingSystemEntity { ...@@ -141,4 +141,7 @@ public class FireFightingSystemEntity {
@ApiModelProperty(value = "主要设计人员") @ApiModelProperty(value = "主要设计人员")
private String leadDesigner; private String leadDesigner;
@ApiModelProperty(value = "系统状态")
private String systemStatus;
} }
...@@ -78,4 +78,8 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> { ...@@ -78,4 +78,8 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> {
@ApiModelProperty(value = "车牌号") @ApiModelProperty(value = "车牌号")
private String carNum; private String carNum;
@ApiModelProperty(value = "设备红黄绿码状态")
private String equipStatus;
} }
package com.yeejoin.equipmanage.common.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "消防资源监管子项DTO", description = "消防资源监管子项DTO")
public class FireResourceStatsDTO {
@ApiModelProperty(value = "资源总数")
private long totalCounts;
@ApiModelProperty(value = "黄码资源数")
private long yellowCounts;
@ApiModelProperty(value = "红码资源数")
private long redCounts;
@ApiModelProperty(value = "异常百分比", notes = "非正常资源数/资源总数, 非正常资源数=黄码资源数+红码资源数")
private Number abnormalRatio;
}
...@@ -69,4 +69,8 @@ public class EquipTypeImgAmountVO { ...@@ -69,4 +69,8 @@ public class EquipTypeImgAmountVO {
@ApiModelProperty(value = "车牌号") @ApiModelProperty(value = "车牌号")
private String carNum; private String carNum;
@ApiModelProperty(value = "分类名称/车或者装备")
private String systemType;
} }
package com.yeejoin.equipmanage.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Getter
@AllArgsConstructor
public enum WaterResourceTypeEnum {
消火栓("hydrant", "消火栓"),
消防水鹤("crane", "消防水鹤"),
消防水池("pool", "消防水池"),
天然水源("natural", "天然水源"),
消防水箱("waterTank", "消防水箱"),
工业水池("industryPool", "工业水池");
private String code;
private String name;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static List<Map<String, String>> getEnumList() {
return Arrays.stream(WaterResourceTypeEnum.values()).map(e -> {
Map<String, String> map = new HashMap<>();
map.put("code", e.getCode());
map.put("name", e.getName());
return map;
}).collect(Collectors.toList());
}
}
...@@ -129,4 +129,6 @@ public class EquipmentManageVo implements Serializable { ...@@ -129,4 +129,6 @@ public class EquipmentManageVo implements Serializable {
private String fullName; private String fullName;
private String categoryCode; private String categoryCode;
private String systemStatus;
} }
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
public interface FireResourceSupervisionMapper extends BaseMapper<OrgUsr> {
List<Map<String, Object>> selectPersonnelStats(@Param("bizOrgCode") String bizOrgCode);
Long selectTodayAttendance(@Param("bizOrgCode") String bizOrgCode);
List<String> getZzPersonNum();
List<String> getYwPersonNum();
}
package com.yeejoin.amos.boot.module.jcs.api.service;
import java.util.Map;
/**
* 消防资源监管
*/
public interface IFireResourceSupervisionService {
/**
* 获取人员统计信息
*
* @param bizOrgCode 机构编码
*/
Map<String, Map<String, Number>> getPersonnelStats(String bizOrgCode);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.FireResourceSupervisionMapper">
<select id="selectPersonnelStats" resultType="java.util.HashMap">
SELECT
IF(dfi.field_value = 1601, 1, IF(dfi.field_value = 1602, 0, -1)) AS peopleType,
COUNT(DISTINCT u.sequence_nbr) AS totalCount,
SUM(IF(ISNULL(cfp.post_qualification), 0, 1)) AS certifiedCount
FROM
cb_org_usr u
INNER JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = u.sequence_nbr AND dfi.field_code = 'peopleType'
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = u.sequence_nbr AND cfp.is_delete = false
WHERE
u.is_delete = false
AND u.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%')
GROUP BY
peopleType
HAVING peopleType in (0, 1);
</select>
<select id="selectTodayAttendance" resultType="java.lang.Long">
SELECT COUNT(DISTINCT cs.user_id)
FROM cb_sign cs
WHERE cs.date = date_format(now(), '%Y-%m-%d')
AND cs.is_delete = FALSE
AND cs.org_code like concat(#{bizOrgCode}, '%')
</select>
<select id="getZzPersonNum" resultType="Map">
SELECT
u.amos_org_id AS zzFireNum
FROM
cb_org_usr u
LEFT JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = u.sequence_nbr
WHERE
u.is_delete = FALSE
AND u.amos_org_id IS NOT NULL
AND dfi.field_value = 1601
AND dfi.field_code = 'peopleType'
</select>
<select id="getYwPersonNum" resultType="Map">
SELECT
u.amos_org_id AS ywNum
FROM
cb_org_usr u
LEFT JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = u.sequence_nbr
WHERE
u.is_delete = FALSE
AND u.amos_org_id IS NOT NULL
AND dfi.field_value = 1602
AND dfi.field_code = 'peopleType'
</select>
</mapper>
...@@ -179,6 +179,20 @@ public class OrgPersonController extends BaseController { ...@@ -179,6 +179,20 @@ public class OrgPersonController extends BaseController {
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
/**
* 消防资源监管,驻站消防员,运维人员环状态图统计接口
*
* @param bizOrgCode type
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getStaticByFire", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "消防资源监管,驻站消防员,运维人员环状态图统计接口", notes = "消防资源监管,驻站消防员,运维人员环状态图统计接口")
public ResponseModel<List<Map<String, Object>>> selectStatic(String bizOrgCode, String type) throws Exception {
List<Map<String, Object>> result = iOrgUsrService.selectStatic(bizOrgCode, type);
return ResponseHelper.buildResponse(result);
}
/** /**
* 获取人员树 * 获取人员树
......
...@@ -600,6 +600,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -600,6 +600,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
map.put("positionType", positionType); map.put("positionType", positionType);
} }
List<String> fireManagementPost;
if(req.containsKey("fireManagementPost")) {
if(StringUtils.isNotEmpty(req.get("fireManagementPost").toString())) {
fireManagementPost = Arrays.asList(req.get("fireManagementPost").toString().split(","));
map.put("fireManagementPost", fireManagementPost);
}
}
String peopleType = ""; String peopleType = "";
if(req.containsKey("peopleType")) { if(req.containsKey("peopleType")) {
peopleType = req.get("peopleType").toString(); peopleType = req.get("peopleType").toString();
...@@ -614,6 +622,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -614,6 +622,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
req.remove("positionType"); req.remove("positionType");
req.remove("peopleType"); req.remove("peopleType");
req.remove("bizOrgName"); req.remove("bizOrgName");
req.remove("fireManagementPost");
map.put("fieldsValue", req); map.put("fieldsValue", req);
map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode())); map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode()));
pageBean.setTotal(this.baseMapper.selectPersonListCount(map)); pageBean.setTotal(this.baseMapper.selectPersonListCount(map));
...@@ -908,6 +917,17 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -908,6 +917,17 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
public List<Map<String, Object>> selectStatic(String bizOrgCode, String type) {
List<Map<String,Object>> listMap;
if("1601".equals(type)) {
listMap = this.baseMapper.selectStaticFire(bizOrgCode);
} else {
listMap = this.baseMapper.selectStaticYw(bizOrgCode);
}
return listMap;
}
@Override
public Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception { public Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception {
QueryWrapper<DynamicFormColumn> queryWrapper = new QueryWrapper<DynamicFormColumn>(); QueryWrapper<DynamicFormColumn> queryWrapper = new QueryWrapper<DynamicFormColumn>();
queryWrapper.eq("group_code", OrgPersonEnum.人员.getCode()); queryWrapper.eq("group_code", OrgPersonEnum.人员.getCode());
...@@ -3263,8 +3283,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3263,8 +3283,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
} }
if (!ObjectUtils.isEmpty(orgUsr.getSequenceNbr())) { if (!ObjectUtils.isEmpty(orgUsr.getSequenceNbr())) {
peopleBasicInfoDto.setName(orgUsr.getBizOrgName()); peopleBasicInfoDto.setName(orgUsr.getBizOrgName());
peopleBasicInfoDto.setAmosUserId(orgUsr.getAmosOrgId()); peopleBasicInfoDto.setAmosUserId(orgUsr.getAmosOrgId());
...@@ -3275,6 +3293,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3275,6 +3293,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
peopleBasicInfoDto.setBizOrgCode(orgUsr.getBizOrgCode()); peopleBasicInfoDto.setBizOrgCode(orgUsr.getBizOrgCode());
peopleBasicInfoDto.setCompanyCode(orgUsr.getParentId()); peopleBasicInfoDto.setCompanyCode(orgUsr.getParentId());
peopleBasicInfoDto.setCompanyName(orgUsr.getParentName()); peopleBasicInfoDto.setCompanyName(orgUsr.getParentName());
peopleBasicInfoDto.setPersonStatus(orgUsr.getPersonStatus());
} }
if ("1601".equals(peopleBasicInfoDto.getPeopleType())) { if ("1601".equals(peopleBasicInfoDto.getPeopleType())) {
...@@ -3543,6 +3562,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3543,6 +3562,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
public OrgUsr getPersonOne(String id) {
OrgUsr orgUsr = orgUsrMapper.selectById(Long.valueOf(id));
return orgUsr;
}
@Override
public void updatePersonStatus(String status, String id) { public void updatePersonStatus(String status, String id) {
orgUsrMapper.updatePersonStatus(status,id); orgUsrMapper.updatePersonStatus(status,id);
} }
...@@ -3634,7 +3660,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3634,7 +3660,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
case "birthdayTime": case "birthdayTime":
contentVo.setLabel(u.getDescribe()); contentVo.setLabel(u.getDescribe());
try { try {
contentVo.setValue(DateUtils.dateFormat(peopleInfoDto.getFirefighters().getBirthdayTime(), DateUtils.DATE_TIME_PATTERN)); if(null != peopleInfoDto.getFirefighters().getBirthdayTime()) {
contentVo.setValue(DateUtils.dateFormat(peopleInfoDto.getFirefighters().getBirthdayTime(), DateUtils.DATE_TIME_PATTERN));
}
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.controller; ...@@ -3,6 +3,7 @@ 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.entity.dto.OrgUsrDto; import com.yeejoin.equipmanage.common.entity.dto.OrgUsrDto;
import com.yeejoin.equipmanage.common.entity.publics.CommonResponse;
import com.yeejoin.equipmanage.common.utils.*; import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.config.PersonIdentify; import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper; import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
...@@ -204,4 +205,35 @@ public class DCenterController extends AbstractBaseController { ...@@ -204,4 +205,35 @@ public class DCenterController extends AbstractBaseController {
return CommonResponseUtil.success(menus); return CommonResponseUtil.success(menus);
} }
@GetMapping("/water/statics")
@ApiOperation(value = "消防水源信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getFireWaterStatics() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
return CommonResponseUtil.success(fireFightingSystemService.getFireWaterStatics(bizOrgCode));
}
@GetMapping("/water/info")
@ApiOperation(value = "消防水源信息饼图统计")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getFireWaterInfo() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
return CommonResponseUtil.success(fireFightingSystemService.getFireWaterInfo(bizOrgCode));
}
@GetMapping("/water/info/page")
@ApiOperation(value = "消防水源信息分页列表")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getWaterInfoPage(CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(fireFightingSystemService.getWaterInfoPage(page, bizOrgCode));
}
} }
...@@ -67,7 +67,7 @@ public class EquipmentManageController extends AbstractBaseController{ ...@@ -67,7 +67,7 @@ public class EquipmentManageController extends AbstractBaseController{
companyId = result.get("sequenceNbr").toString(); companyId = result.get("sequenceNbr").toString();
} }
} }
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,controBoxBuildId,companyId, nameOrCode); return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,controBoxBuildId,companyId, nameOrCode, null);
} }
@GetMapping(value = "/getUtils") @GetMapping(value = "/getUtils")
......
...@@ -110,6 +110,13 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -110,6 +110,13 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getEquiplistBySystemId(systemId); return fireFightingSystemService.getEquiplistBySystemId(systemId);
} }
@RequestMapping(value = "/getEquiplistBySystemIdPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据系统id查询设备列表")
public IPage<EquiplistSpecificBySystemVO> getEquiplistBySystemIdPage(Long systemId, int size, int current) {
return fireFightingSystemService.getEquiplistBySystemIdPage(systemId, size, current);
}
@RequestMapping(value = "/getEquipcountBySystemId", method = RequestMethod.GET) @RequestMapping(value = "/getEquipcountBySystemId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据系统id查询分组设备数量") @ApiOperation("根据系统id查询分组设备数量")
...@@ -589,6 +596,7 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -589,6 +596,7 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestParam(value = "construction", required = false) String construction, @RequestParam(value = "construction", required = false) String construction,
@RequestParam(value = "maintenance", required = false) String maintenance, @RequestParam(value = "maintenance", required = false) String maintenance,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode, @RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "systemStatus", required = false) String systemStatus,
@RequestParam(value = "formGroupId", required = false) String formGroupId, @RequestParam(value = "formGroupId", required = false) String formGroupId,
@RequestParam(value = "controBoxBuildId", required = false) String controBoxBuildId, @RequestParam(value = "controBoxBuildId", required = false) String controBoxBuildId,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
...@@ -619,7 +627,7 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -619,7 +627,7 @@ public class FireFightingSystemController extends AbstractBaseController {
} }
} }
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId, nameOrCode); return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId, nameOrCode, systemStatus);
} }
/** /**
......
package com.yeejoin.equipmanage.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO;
import com.yeejoin.equipmanage.service.IFireResourceSupervisionService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.HashMap;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping(value = "/fire-resource-superv")
public class FireResourceSupervisionController extends BaseController {
@Autowired
private IFireResourceSupervisionService iFireResourceSupervisionService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防系统、检测部件、消防车辆统计信息查询", notes = "聚合接口: 消防系统、检测部件、消防车辆统计信息查询")
@RequestMapping(value = "/stats", method = RequestMethod.GET)
public ResponseModel<Object> stats() {
String orgCode = this.getOrgCode();
FireResourceStatsDTO fireSystemStats = iFireResourceSupervisionService.getFireSystemStats(orgCode);
FireResourceStatsDTO monitorComponentStats = iFireResourceSupervisionService.getMonitorComponentStats(orgCode);
FireResourceStatsDTO fireCarStats = iFireResourceSupervisionService.getFireCarStats(orgCode);
Map<String, FireResourceStatsDTO> result = new HashMap<String, FireResourceStatsDTO>() {{
put("fireSystemStats", fireSystemStats);
put("monitorComponentStats", monitorComponentStats);
put("fireCarStats", fireCarStats);
}};
return ResponseHelper.buildResponse(result);
}
}
...@@ -264,7 +264,15 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -264,7 +264,15 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
EquipmentSpecific getEquipSpecificEntityByCode(@Param("code") String code); EquipmentSpecific getEquipSpecificEntityByCode(@Param("code") String code);
void updateEquipSpecificStatus(String status,String id); Integer updateEquipSpecificStatus(String status,String id);
String getEquipStatusList(@Param("id") String id);
List<Long> countEquipStatusListByEquipId(@Param("id") Long id);
String getSpecificStatusByEquipmentCode(@Param("equipCode") String equipCode);
void updateWaterResourceStatus(@Param("id") Long id, @Param("status") String status);
String updateEquipSpecificStatusByCheckInput(String id); String updateEquipSpecificStatusByCheckInput(String id);
......
...@@ -25,6 +25,15 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -25,6 +25,15 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/ */
List<EquiplistSpecificBySystemVO> getEquiplistBySystemId(Long systemId); List<EquiplistSpecificBySystemVO> getEquiplistBySystemId(Long systemId);
/**
* 根据系统id查询设备列表
*
* @param systemId page
* @return
*/
IPage<EquiplistSpecificBySystemVO> getEquiplistBySystemIdPage(@Param("page") IPage<EquiplistSpecificBySystemVO> page,
@Param("systemId") Long systemId);
/** /**
* 根据系统id查询设备列表 * 根据系统id查询设备列表
...@@ -678,4 +687,18 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -678,4 +687,18 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> selectPressureDetails(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> selectPressureDetails(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectEquipmentSpecificById(@Param("id") String id); Map<String, Object> selectEquipmentSpecificById(@Param("id") String id);
void updateStatusById(@Param("id") String id, @Param("status") String status);
Map<String, Object> getFireWaterStatics(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectFireFightingSystemStats(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectEquipmentSpecificStats(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectCarStats(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> getFireWaterInfo(@Param("bizOrgCode") String bizOrgCode);
Page<Map<String, Object>> getWaterInfoPage(Page page, String bizOrgCode);
} }
...@@ -26,7 +26,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity> ...@@ -26,7 +26,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity>
* @param pageSize * @param pageSize
* @return * @return
*/ */
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId,String companyId, String nameOrCode); Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId,String companyId, String nameOrCode,String systemStatus);
/** /**
* 获取下拉菜单数据 * 获取下拉菜单数据
......
...@@ -27,6 +27,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -27,6 +27,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<EquiplistSpecificBySystemVO> getEquiplistBySystemId(Long systemId); List<EquiplistSpecificBySystemVO> getEquiplistBySystemId(Long systemId);
/** /**
* 根据系统id查询设备列表
*
* @param systemId
* @return
*/
IPage<EquiplistSpecificBySystemVO> getEquiplistBySystemIdPage(Long systemId, int size, int current);
/**
* 获取系列列表 * 获取系列列表
* *
* @param equimentName * @param equimentName
...@@ -37,7 +45,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -37,7 +45,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param pageSize * @param pageSize
* @return * @return
*/ */
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId, String nameOrCode); Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId, String nameOrCode, String systemStatus);
FireFightingSystemEntity getOneById(Long id); FireFightingSystemEntity getOneById(Long id);
...@@ -302,6 +310,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -302,6 +310,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<Map<String, Object>> getSystemRunningInfoList(); List<Map<String, Object>> getSystemRunningInfoList();
Page<FireFightingSystemDto> fireSysRunStatusPage(Page<Map<String, Object>> page, String bizOrgCode); Page<FireFightingSystemDto> fireSysRunStatusPage(Page<Map<String, Object>> page, String bizOrgCode);
List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode(); List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode();
Map<String, Object> getSystemDetailByCode(String systemCode); Map<String, Object> getSystemDetailByCode(String systemCode);
...@@ -317,4 +326,10 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -317,4 +326,10 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
*/ */
void resetMorphic(); void resetMorphic();
Map<String, Object> getFireWaterStatics(String bizOrgCode);
Map<String, Object> getFireWaterInfo(String bizOrgCode);
Page<Map<String, Object>> getWaterInfoPage(Page<Map<String, Object>> page, String bizOrgCode);
} }
package com.yeejoin.equipmanage.service;
import com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO;
/**
* 消防资源监管
*/
public interface IFireResourceSupervisionService {
/**
* 消防系统信息
* @param bizOrgCode 机构编码
*/
FireResourceStatsDTO getFireSystemStats(String bizOrgCode);
/**
* 监测部件
* @param bizOrgCode 机构编码
*/
FireResourceStatsDTO getMonitorComponentStats(String bizOrgCode);
/**
* 消防车辆
* @param bizOrgCode 机构编码
*/
FireResourceStatsDTO getFireCarStats(String bizOrgCode);
}
...@@ -53,7 +53,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe ...@@ -53,7 +53,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
@Override @Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance,
String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyCode, String nameOrCode) { String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyCode, String nameOrCode, String systemStatus) {
HttpServletRequest request = null; HttpServletRequest request = null;
Map map = new HashMap<String, Object>(); Map map = new HashMap<String, Object>();
map.put("equimentName", equimentName); map.put("equimentName", equimentName);
...@@ -67,6 +67,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe ...@@ -67,6 +67,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
map.put("formGroupId", formGroupId); map.put("formGroupId", formGroupId);
map.put("controBoxBuildId",controBoxBuildId); map.put("controBoxBuildId",controBoxBuildId);
map.put("nameOrCode", nameOrCode); map.put("nameOrCode", nameOrCode);
map.put("systemStatus", systemStatus);
List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map); List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map);
Long count = equipmentManageMapper.queryEquipmenCount(map); Long count = equipmentManageMapper.queryEquipmenCount(map);
map.clear(); map.clear();
......
...@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
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;
...@@ -2113,7 +2114,30 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2113,7 +2114,30 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Override @Override
public void updateEquipSpecificStatus(String status, String id){ public void updateEquipSpecificStatus(String status, String id){
equipmentSpecificMapper.updateEquipSpecificStatus(status,id); Integer num = equipmentSpecificMapper.updateEquipSpecificStatus(status, id);
if (0 < num) {
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectById(id);
if (StringUtil.isNotEmpty(equipmentSpecific.getSystemId())) {
List<String> ids = new ArrayList<>();
ids = Arrays.asList(equipmentSpecific.getSystemId().split(","));
ids.forEach(x -> {
// 系统赋码
String equipStatus = equipmentSpecificMapper.getEquipStatusList(x);
fireFightingSystemMapper.updateStatusById(x, equipStatus);
});
}
// 水源赋码
QueryWrapper<Equipment> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("code", equipmentSpecific.getEquipmentCode());
Equipment equipment = equipmentService.getOne(queryWrapper);
List<Long> ids = equipmentSpecificMapper.countEquipStatusListByEquipId(equipment.getId());
if (0 < ids.size()) {
String equipStatus = equipmentSpecificMapper.getSpecificStatusByEquipmentCode(equipment.getCode());
equipmentSpecificMapper.updateWaterResourceStatus(equipment.getId(), equipStatus);
}
}
} }
@Override @Override
......
...@@ -181,12 +181,19 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -181,12 +181,19 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
getEquiplistBySystemId(Long systemId) { getEquiplistBySystemId(Long systemId) {
return this.baseMapper.getEquiplistBySystemId(systemId); return this.baseMapper.getEquiplistBySystemId(systemId);
} }
@Override
public IPage<EquiplistSpecificBySystemVO> getEquiplistBySystemIdPage(Long systemId, int size, int current) {
IPage<EquiplistSpecificBySystemVO> page = new Page();
page.setSize(size);
page.setCurrent(current);
return this.baseMapper.getEquiplistBySystemIdPage(page, systemId);
}
@Override @Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction,
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String controBoxBuildId, String companyId, String nameOrCode) { String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String controBoxBuildId, String companyId, String nameOrCode,String systemStatus) {
Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode, Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode,
construction, maintenance, bizOrgCode, formGroupId, current, pageSize, controBoxBuildId, companyId, nameOrCode); construction, maintenance, bizOrgCode, formGroupId, current, pageSize, controBoxBuildId, companyId, nameOrCode, systemStatus);
List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList"); List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList");
StringBuilder stb = new StringBuilder(); StringBuilder stb = new StringBuilder();
dataList.forEach(y -> { dataList.forEach(y -> {
...@@ -2456,4 +2463,30 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2456,4 +2463,30 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
} }
@Override
public Map<String, Object> getFireWaterStatics(String bizOrgCode) {
Map<String, Object> map = new HashMap<>();
Map<String, Object> resultMap = fireFightingSystemMapper.getFireWaterStatics(bizOrgCode);
map.put("total", resultMap.get("total"));
map.put("redCode", resultMap.get("redCode"));
map.put("yellowCode", resultMap.get("yellowCode"));
BigDecimal total = new BigDecimal(String.valueOf(resultMap.get("total")));
BigDecimal redNum = new BigDecimal(String.valueOf(resultMap.get("redCode")));
BigDecimal yellowNum = new BigDecimal(String.valueOf(resultMap.get("yellowCode")));
BigDecimal errorNum = redNum.add(yellowNum);
BigDecimal ratePercent = errorNum.divide(total, 2, BigDecimal.ROUND_HALF_UP);
map.put("ratePercent", ratePercent + "%");
return map;
}
@Override
public Map<String, Object> getFireWaterInfo(String bizOrgCode) {
Map<String, Object> resultMap = fireFightingSystemMapper.getFireWaterInfo(bizOrgCode);
return resultMap;
}
@Override
public Page<Map<String, Object>> getWaterInfoPage(Page<Map<String, Object>> page, String bizOrgCode) {
return fireFightingSystemMapper.getWaterInfoPage(page, bizOrgCode);
}
} }
package com.yeejoin.equipmanage.service.impl;
import com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IFireResourceSupervisionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Map;
@Slf4j
@Service
public class IFireResourceSupervisionServiceImpl implements IFireResourceSupervisionService {
@Autowired
private FireFightingSystemMapper fireFightingSystemMapper;
/**
* 消防系统信息
*
* @param bizOrgCode 机构编码
*/
@Override
public FireResourceStatsDTO getFireSystemStats(String bizOrgCode) {
Map<String, Object> resultMap = fireFightingSystemMapper.selectFireFightingSystemStats(bizOrgCode);
return buildFireResourceStatsDTO(resultMap);
}
/**
* 监测部件
*
* @param bizOrgCode 机构编码
*/
@Override
public FireResourceStatsDTO getMonitorComponentStats(String bizOrgCode) {
Map<String, Object> resultMap = fireFightingSystemMapper.selectEquipmentSpecificStats(bizOrgCode);
return buildFireResourceStatsDTO(resultMap);
}
/**
* 消防车辆
*
* @param bizOrgCode 机构编码
*/
@Override
public FireResourceStatsDTO getFireCarStats(String bizOrgCode) {
Map<String, Object> resultMap = fireFightingSystemMapper.selectCarStats(bizOrgCode);
return buildFireResourceStatsDTO(resultMap);
}
private FireResourceStatsDTO buildFireResourceStatsDTO(Map<String, Object> resultMap) {
FireResourceStatsDTO fireResourceStats = new FireResourceStatsDTO();
fireResourceStats.setTotalCounts((long) resultMap.get("totalCount"));
fireResourceStats.setYellowCounts((long) resultMap.get("yellowCodeCount"));
fireResourceStats.setRedCounts((long) resultMap.get("redCodeCount"));
long expCount = fireResourceStats.getYellowCounts() + fireResourceStats.getRedCounts();
double abnormalRatio = 0;
if (fireResourceStats.getTotalCounts() != 0 && expCount != 0) {
abnormalRatio = (double) expCount / fireResourceStats.getTotalCounts() * 100;
}
if (abnormalRatio == 0) {
fireResourceStats.setAbnormalRatio(0);
} else {
DecimalFormat decimalFormat = new DecimalFormat("#.00");
decimalFormat.setRoundingMode(RoundingMode.HALF_UP);
String formattedRatio = decimalFormat.format(abnormalRatio);
fireResourceStats.setAbnormalRatio(Double.parseDouble(formattedRatio));
}
return fireResourceStats;
}
}
...@@ -47,6 +47,7 @@ import org.typroject.tyboot.component.emq.EmqKeeper; ...@@ -47,6 +47,7 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
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 org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.math.RoundingMode; import java.math.RoundingMode;
...@@ -177,9 +178,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -177,9 +178,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
CarMapper carMapper; CarMapper carMapper;
@Autowired @Autowired
IMainIotMonitorSerivce iMainIotMonitorSerivce;
@Autowired
private ISyncDataService syncDataService; private ISyncDataService syncDataService;
@Autowired @Autowired
......
...@@ -211,7 +211,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -211,7 +211,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return detail; return detail;
} }
ManufacturerInfo info = manufacturerInfoMapper.selectById(detail.getManufacturerId()); ManufacturerInfo info = manufacturerInfoMapper.selectById(detail.getManufacturerId());
detail.setManufacturerName(info.getName()); detail.setManufacturerName(ObjectUtils.isEmpty(info) ? "" : info.getName());
return Optional.ofNullable(detail).orElse(detail); return Optional.ofNullable(detail).orElse(detail);
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.service.IFireResourceSupervisionService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/fire-resource-superv")
public class FireResourceSupervisionController extends BaseController {
@Autowired
private IFireResourceSupervisionService iFireResourceSupervisionService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "驻站消防员、运维人员统计信息查询", notes = "驻站消防员、运维人员统计信息查询")
@RequestMapping(value = "/stats", method = RequestMethod.GET)
public ResponseModel<Object> stats() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
Map<String, Map<String, Number>> personnelStats = iFireResourceSupervisionService.getPersonnelStats(bizOrgCode);
return ResponseHelper.buildResponse(personnelStats);
}
}
...@@ -42,4 +42,12 @@ public class RiskController { ...@@ -42,4 +42,12 @@ public class RiskController {
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "人员信息", notes = "人员信息")
@RequestMapping(value = "/person/info", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel getPersonInfo(@RequestParam(value = "id") String id
) {
return CommonResponseUtil.success(orgUsrService.getPersonOne(id));
}
} }
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.common.api.feign.AmosTrainingFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.mapper.FireResourceSupervisionMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IFireResourceSupervisionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@Service
public class FireResourceSupervisionServiceImpl implements IFireResourceSupervisionService {
@Autowired
private FireResourceSupervisionMapper fireResourceSupervisionMapper;
@Autowired
private AmosTrainingFeignClient examFeign;
/**
* 获取人员统计信息
*
* @param bizOrgCode 机构编码
*/
@Override
public Map<String, Map<String, Number>> getPersonnelStats(String bizOrgCode) {
List<Map<String, Object>> maps = fireResourceSupervisionMapper.selectPersonnelStats(bizOrgCode);
Long attendanceCount = fireResourceSupervisionMapper.selectTodayAttendance(bizOrgCode);
Map<String, Map<String, Number>> result = new HashMap<>();
for (Map<String, Object> map : maps) {
Object peopleType = map.get("peopleType");
if (Objects.isNull(peopleType)) {
continue;
}
long totalCount = Long.parseLong(map.get("totalCount").toString());
long certifiedCount = Long.parseLong(map.get("certifiedCount").toString());
String key;
switch (peopleType.toString()) {
case "0":
key = "operationStats";
break;
case "1":
key = "fireStats";
break;
default:
continue;
}
Map<String, Number> stats = getStringNumberMap(certifiedCount, totalCount, attendanceCount, key);
result.put(key, stats);
}
return result;
}
private Map<String, Number> getStringNumberMap(long certifiedCount, long totalCount, Long attendanceCount, String key) {
Map<String, Number> stats = new HashMap<>();
stats.put("totalCount", totalCount);
stats.put("certifiedRate", calculateRate(certifiedCount, totalCount));
stats.put("attendanceRate", calculateRate(attendanceCount, totalCount));
ResponseModel<List<String>> response = null;
try {
response = examFeign.getUserIdList();
} catch (Exception e) {
e.printStackTrace();
}
if (0 < response.getResult().size()) {
BigDecimal ratePercent;
if ("operationStats".equals(key)) {
List<String> ywNum = fireResourceSupervisionMapper.getYwPersonNum();
List<String> result = ywNum.stream().filter(response.getResult()::contains).collect(Collectors.toList());
BigDecimal total = new BigDecimal(String.valueOf(ywNum.size()));
BigDecimal zzExamCount = new BigDecimal(String.valueOf(result.size()));
ratePercent = zzExamCount.divide(total, 2, BigDecimal.ROUND_HALF_UP);
} else {
List<String> zzNum = fireResourceSupervisionMapper.getZzPersonNum();
List<String> result = zzNum.stream().filter(response.getResult()::contains).collect(Collectors.toList());
BigDecimal total = new BigDecimal(String.valueOf(zzNum.size()));
BigDecimal zzExamCount = new BigDecimal(String.valueOf(result.size()));
ratePercent = zzExamCount.divide(total, 2, BigDecimal.ROUND_HALF_UP);
}
stats.put("monthStudyRate", ratePercent);
} else {
stats.put("monthStudyRate", BigDecimal.ZERO);
}
return stats;
}
private BigDecimal calculateRate(Number numerator, Number denominator) {
BigDecimal rate = new BigDecimal(numerator.toString())
.divide(new BigDecimal(denominator.toString()), 4, RoundingMode.HALF_UP)
.multiply(new BigDecimal(100))
.setScale(2, RoundingMode.HALF_UP);
return rate.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : rate;
}
}
...@@ -34,4 +34,12 @@ public class ControlScreenController extends AbstractBaseController { ...@@ -34,4 +34,12 @@ public class ControlScreenController extends AbstractBaseController {
} }
return CommonResponseUtil.success(iPlanTaskService.firePatrolStatics(bizOrgCode)); return CommonResponseUtil.success(iPlanTaskService.firePatrolStatics(bizOrgCode));
} }
@GetMapping("/statics")
@ApiOperation(value = "消防运维信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getStatics(@RequestParam(required = false) String companyCode) {
return CommonResponseUtil.success(iPlanTaskService.getStatics(companyCode));
}
} }
...@@ -216,4 +216,9 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -216,4 +216,9 @@ public interface PlanTaskMapper extends BaseMapper {
List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId); List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId);
String getCheckIdByDetailId(@Param(value="taskDetailId") String taskDetailId); String getCheckIdByDetailId(@Param(value="taskDetailId") String taskDetailId);
String queryByCompanyCode(@Param("companyCode") String companyCode);
List<Map<String, Object>> getStatics(@Param("bizOrgCode") String bizOrgCode);
} }
...@@ -2028,6 +2028,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -2028,6 +2028,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return map; return map;
} }
@Override
public List<Map<String, Object>> getStatics(String companyCode) {
String bizOrgCode = null;
if (StringUtil.isNotEmpty(companyCode)) {
bizOrgCode = planTaskMapper.queryByCompanyCode(companyCode);
}
return planTaskMapper.getStatics(bizOrgCode);
}
public static byte[] file2byte(File file) { public static byte[] file2byte(File file) {
try { try {
FileInputStream in = new FileInputStream(file); FileInputStream in = new FileInputStream(file);
......
...@@ -187,6 +187,8 @@ public interface IPlanTaskService { ...@@ -187,6 +187,8 @@ public interface IPlanTaskService {
*/ */
List<Map<String,Object>> firePatrolStatics(String bizOrgCode); List<Map<String,Object>> firePatrolStatics(String bizOrgCode);
List<Map<String,Object>> getStatics(String companyCode);
/** /**
* 计划执行查询 * 计划执行查询
*/ */
......
...@@ -975,6 +975,17 @@ ...@@ -975,6 +975,17 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="ky" id="20230808">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_fire_fighting_system" columnName="system_status"/>
</not>
</preConditions>
<comment>f_fire_fighting_system新增属性字段 system_status</comment>
<sql>
ALTER TABLE `f_fire_fighting_system` ADD COLUMN `system_status` varchar(20) NULL DEFAULT 0 COMMENT '消防系统状态,默认0表示正常(绿色),1为故障类(黄色),2为火警类(红色)';
ALTER TABLE `cb_water_resource` ADD COLUMN `water_status` varchar(20) NULL DEFAULT 0 COMMENT '水源状态,默认0表示正常(绿色),1为故障类(黄色),2为火警类(红色)';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
sys.code as code, sys.code as code,
sys.form_group_id, sys.form_group_id,
sys.instance_id, sys.instance_id,
sys.system_status as systemStatus,
date_format(sys.install_date,'%Y-%m-%d') AS installDate, date_format(sys.install_date,'%Y-%m-%d') AS installDate,
date_format(sys.first_maintenance_date,'%Y-%m-%d') AS firstMaintenanceDate, date_format(sys.first_maintenance_date,'%Y-%m-%d') AS firstMaintenanceDate,
sys.charge_person_name as chargePerson, sys.charge_person_name as chargePerson,
...@@ -50,13 +51,16 @@ ...@@ -50,13 +51,16 @@
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND sys.biz_org_code like CONCAT(#{bizOrgCode},'%') AND sys.biz_org_code like CONCAT(#{bizOrgCode},'%')
</if> </if>
<if test="systemStatus != null and systemStatus != ''">
AND sys.system_status = #{systemStatus}
</if>
<if test="companyCode != null and companyCode != ''"> <if test="companyCode != null and companyCode != ''">
AND sys.biz_org_code = #{companyCode} AND sys.biz_org_code = #{companyCode}
</if> </if>
<if test="formGroupId != null and formGroupId != '' and formGroupId != '-1'"> <if test="formGroupId != null and formGroupId != '' and formGroupId != '-1'">
AND sys.form_group_id = #{formGroupId} AND sys.form_group_id = #{formGroupId}
</if> </if>
order by sys.id DESC order by CONVERT(sys.biz_org_name USING gbk) ASC, sys.system_status DESC
LIMIT #{spage},#{pageSize} LIMIT #{spage},#{pageSize}
</select> </select>
<select id="queryEquipmenCount" resultType="long"> <select id="queryEquipmenCount" resultType="long">
......
...@@ -2337,10 +2337,46 @@ ...@@ -2337,10 +2337,46 @@
FROM FROM
`f_equipment` a `f_equipment` a
</select> </select>
<update id="updateEquipSpecificStatus"> <update id="updateEquipSpecificStatus">
update wl_equipment_specific set equip_status = #{status} where id = #{id} update wl_equipment_specific set equip_status = #{status} where id = #{id}
</update> </update>
<update id="updateWaterResourceStatus">
update cb_water_resource set water_status = #{status} where equip_id = #{id}
</update>
<select id="getEquipStatusList" resultType="java.lang.String">
SELECT
wles.equip_status AS equipStatus
FROM
`wl_equipment_specific` `wles`
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET(fs.id, wles.system_id)
WHERE
fs.id = #{id}
ORDER BY wles.equip_status DESC
limit 1
</select>
<select id="getSpecificStatusByEquipmentCode" resultType="java.lang.String">
SELECT
wles.equip_status AS equipStatus
FROM
`wl_equipment_specific` `wles`
WHERE
wles.equipment_code = #{equipCode}
ORDER BY wles.equip_status DESC
limit 1
</select>
<select id="countEquipStatusListByEquipId" resultType="java.lang.Long">
SELECT
cwr.sequence_nbr AS id
FROM
cb_water_resource cwr
where
cwr.equip_id = #{id}
</select>
<select id="updateEquipSpecificStatusByCheckInput" resultType="java.lang.String"> <select id="updateEquipSpecificStatusByCheckInput" resultType="java.lang.String">
SELECT SELECT
......
...@@ -1354,4 +1354,82 @@ ...@@ -1354,4 +1354,82 @@
<select id="getCheckIdByDetailId" resultType="java.lang.String"> <select id="getCheckIdByDetailId" resultType="java.lang.String">
select id from p_check where plan_task_detail_id = #{taskDetailId} limit 1 select id from p_check where plan_task_detail_id = #{taskDetailId} limit 1
</select> </select>
<select id="getStatics" resultType="java.util.Map">
SELECT
'1' AS `key`,
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`,
'' AS unit,
'今日累计巡查点位' AS `name`,
'xfxcjrljxcdw' AS code
FROM
`p_plan_task`
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
ifnull( sum( ppk.`point_num` ), 0 ) AS `value`,
'' AS unit,
'合格' AS `name`,
'xfxchg' AS code,
'2' AS `key`
FROM
`p_plan_task` ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 1
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
'' AS `value`,
'%' AS unit,
'合格占比' AS `name`,
'xfxchgzb' AS code,
'3' AS `key`
UNION ALL
SELECT
'' AS `value`,
'' AS unit,
'不合格' AS `name`,
'xfxcbhg' AS code,
'4' AS `key`
UNION ALL
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'' AS unit,
'今日漏查点位' AS `name`,
'currentDayMiss' AS `indexKey`,
'xfxcjrlcdw' AS code,
'5' AS `key`
FROM
`p_plan_task`
WHERE
`finish_status` = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
'' AS `value`,
'' AS unit,
'漏查率' AS `name`,
'xfxclcl' AS code,
'6' AS `key`
</select>
<select id="queryByCompanyCode" resultType="java.lang.String">
SELECT biz_org_code
FROM cb_org_usr
WHERE is_delete = 0
<if test="companyCode != null and companyCode != ''">
AND code = #{companyCode}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
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