Commit cdb3ef58 authored by maoying's avatar maoying

修改消防水池,点位添加,风险模型相关模块bug

parent bc956768
...@@ -42,6 +42,8 @@ public class FireEquipmentPoint extends BasicEntity { ...@@ -42,6 +42,8 @@ public class FireEquipmentPoint extends BasicEntity {
@Column(name="alarm_type") @Column(name="alarm_type")
private Long alarmType; private Long alarmType;
@Column(name="org_code")
private String orgCode;
public String getCode() { public String getCode() {
return code; return code;
} }
...@@ -113,4 +115,12 @@ public class FireEquipmentPoint extends BasicEntity { ...@@ -113,4 +115,12 @@ public class FireEquipmentPoint extends BasicEntity {
public void setAlarmType(Long alarmType) { public void setAlarmType(Long alarmType) {
this.alarmType = alarmType; this.alarmType = alarmType;
} }
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
} }
\ No newline at end of file
...@@ -82,6 +82,15 @@ public class WaterResource extends BasicEntity{ ...@@ -82,6 +82,15 @@ public class WaterResource extends BasicEntity{
*/ */
@Column(name="create_by") @Column(name="create_by")
private String createBy; private String createBy;
@Column(name="area")
private String area;
@Column(name="max_level")
private String maxLevel;
@Column(name="alarm_level")
private String alarmLevel;
/** /**
* ue4位置 * ue4位置
...@@ -209,4 +218,28 @@ public class WaterResource extends BasicEntity{ ...@@ -209,4 +218,28 @@ public class WaterResource extends BasicEntity{
public void setUe4Rotation(String ue4Rotation) { public void setUe4Rotation(String ue4Rotation) {
this.ue4Rotation = ue4Rotation; this.ue4Rotation = ue4Rotation;
} }
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getMaxLevel() {
return maxLevel;
}
public void setMaxLevel(String maxLevel) {
this.maxLevel = maxLevel;
}
public String getAlarmLevel() {
return alarmLevel;
}
public void setAlarmLevel(String alarmLevel) {
this.alarmLevel = alarmLevel;
}
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.controller;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity; import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity;
import com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService; import com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
...@@ -45,11 +46,13 @@ public class FireEquimtPointController extends BaseController { ...@@ -45,11 +46,13 @@ public class FireEquimtPointController extends BaseController {
if (fireEquipmentPoint == null if (fireEquipmentPoint == null
|| StringUtils.isEmpty(fireEquipmentPoint.getName()) || StringUtils.isEmpty(fireEquipmentPoint.getName())
|| StringUtils.isEmpty(fireEquipmentPoint.getFireEquipmentId())
|| StringUtils.isEmpty(fireEquipmentPoint.getType()) || StringUtils.isEmpty(fireEquipmentPoint.getType())
|| StringUtils.isEmpty(fireEquipmentPoint.getCode())) || StringUtils.isEmpty(fireEquipmentPoint.getCode())){
throw new Exception("数据校验失败."); return CommonResponseUtil.failure("请检查必填字段");
};
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
fireEquipmentPoint.setOrgCode(compCode);
fireEquipmentPoint.setCreateBy(getUserId()); fireEquipmentPoint.setCreateBy(getUserId());
fireEquipmentPoint.setCreateDate(new Date()); fireEquipmentPoint.setCreateDate(new Date());
return CommonResponseUtil.success(fireEquipPontService.savePoint(fireEquipmentPoint)); return CommonResponseUtil.success(fireEquipPontService.savePoint(fireEquipmentPoint));
...@@ -100,13 +103,16 @@ public class FireEquimtPointController extends BaseController { ...@@ -100,13 +103,16 @@ public class FireEquimtPointController extends BaseController {
@ApiParam(value = "监测点编号或者监测点名称模糊匹配") @RequestParam(required = false) String searchValue, @ApiParam(value = "监测点编号或者监测点名称模糊匹配") @RequestParam(required = false) String searchValue,
@ApiParam(value = "类型(模拟量:ANALOGUE;开关量:SWITCH)") @RequestParam(required = false) String type) { @ApiParam(value = "类型(模拟量:ANALOGUE;开关量:SWITCH)") @RequestParam(required = false) String type) {
Map<String, Object> queryMap = Maps.newHashMap(); Map<String, Object> queryMap = Maps.newHashMap();
queryMap.put("offset", pageNumber*pageSize); ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
queryMap.put("pageNumber", pageNumber);
queryMap.put("pageSize", pageSize); queryMap.put("pageSize", pageSize);
if (isBindDevice != null && isBindDevice == 0) { if (isBindDevice != null && isBindDevice == 0) {
queryMap.put("fireEquipmentId", 0); queryMap.put("fireEquipmentId", 0);
} }
queryMap.put("searchValue", searchValue); queryMap.put("searchValue", searchValue);
queryMap.put("type", type); queryMap.put("type", type);
queryMap.put("compCode", compCode);
return fireEquipPontService.queryByMap(queryMap); return fireEquipPontService.queryByMap(queryMap);
} }
......
...@@ -27,6 +27,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService; ...@@ -27,6 +27,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus; import com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus;
import com.yeejoin.amos.fas.business.service.model.FireEquimentDataRo; import com.yeejoin.amos.fas.business.service.model.FireEquimentDataRo;
import com.yeejoin.amos.fas.business.service.model.ProtalDataRo; import com.yeejoin.amos.fas.business.service.model.ProtalDataRo;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse; import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
...@@ -107,7 +108,9 @@ public class RiskSourceController extends BaseController { ...@@ -107,7 +108,9 @@ public class RiskSourceController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取风险点树型结构", notes = "获取风险点树型结构") @ApiOperation(httpMethod = "GET", value = "获取风险点树型结构", notes = "获取风险点树型结构")
@RequestMapping(value = "/riskSourceTress", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/riskSourceTress", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse getRiskSourceTress() { public CommonResponse getRiskSourceTress() {
List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(); ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(compCode);
return CommonResponseUtil.success(getRiskSourcesTree(riskSources)); return CommonResponseUtil.success(getRiskSourcesTree(riskSources));
} }
...@@ -138,7 +141,9 @@ public class RiskSourceController extends BaseController { ...@@ -138,7 +141,9 @@ public class RiskSourceController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "统计级别为1的风险点下面", notes = "获取风险点树型结构") @ApiOperation(httpMethod = "GET", value = "统计级别为1的风险点下面", notes = "获取风险点树型结构")
@RequestMapping(value = "/riskSourceStatistics", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/riskSourceStatistics", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse riskSourceStatistics() throws Exception { public CommonResponse riskSourceStatistics() throws Exception {
List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(); ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(compCode);
List<RiskSourceTreeResponse> treeRiskSources = getRiskSourcesTree(riskSources); List<RiskSourceTreeResponse> treeRiskSources = getRiskSourcesTree(riskSources);
return CommonResponseUtil.success(riskSourceStatistics(treeRiskSources)); return CommonResponseUtil.success(riskSourceStatistics(treeRiskSources));
} }
...@@ -632,7 +637,9 @@ public class RiskSourceController extends BaseController { ...@@ -632,7 +637,9 @@ public class RiskSourceController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取危险因素树二级节点", notes = "获取危险因素树二级节点") @ApiOperation(httpMethod = "GET", value = "获取危险因素树二级节点", notes = "获取危险因素树二级节点")
@RequestMapping(value = "/riskSourceSecondLevel", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/riskSourceSecondLevel", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryRiskSourceSecondLevel() { public CommonResponse queryRiskSourceSecondLevel() {
return CommonResponseUtil.success(riskSourceService.queryRiskSourceSecondLevel()); ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
return CommonResponseUtil.success(riskSourceService.queryRiskSourceSecondLevel(compCode));
} }
/** /**
......
...@@ -91,8 +91,9 @@ public class WaterResourceController extends BaseController{ ...@@ -91,8 +91,9 @@ public class WaterResourceController extends BaseController{
@RequestParam int pageSize @RequestParam int pageSize
) { ) {
CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize); CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize);
ReginParams reginParams =getSelectedOrgInfo();
return CommonResponseUtil.success(iWaterResourceService.queryForPage(StringUtils.trimToNull(name),StringUtils.trimToNull(code),StringUtils.trimToNull(type),commonPageable)); String compCode = getOrgCode(reginParams);
return CommonResponseUtil.success(iWaterResourceService.queryForPage(compCode,StringUtils.trimToNull(name),StringUtils.trimToNull(code),StringUtils.trimToNull(type),commonPageable));
} }
//@Authorization(ingore = true) //@Authorization(ingore = true)
......
...@@ -42,7 +42,7 @@ public interface RiskSourceMapper extends BaseMapper { ...@@ -42,7 +42,7 @@ public interface RiskSourceMapper extends BaseMapper {
List<Map> queryForMatrix(); List<Map> queryForMatrix();
List<RiskSourceTreeResponse> getRiskSources(); List<RiskSourceTreeResponse> getRiskSources(String compCode);
List<RiskSourceTreeResponse> getRiskSourcesEquipment(); List<RiskSourceTreeResponse> getRiskSourcesEquipment();
...@@ -87,7 +87,7 @@ public interface RiskSourceMapper extends BaseMapper { ...@@ -87,7 +87,7 @@ public interface RiskSourceMapper extends BaseMapper {
List<RiskSource> queryByFactor(@Param("factorId") Long factorId); List<RiskSource> queryByFactor(@Param("factorId") Long factorId);
List<HashMap<String, Object>> queryRiskSourceSecondLevel(); List<HashMap<String, Object>> queryRiskSourceSecondLevel(String compCode);
List<RiskSourceTreeResponse> getRiskSourcesFireEquipmentByType(@Param("type") String[] type); List<RiskSourceTreeResponse> getRiskSourcesFireEquipmentByType(@Param("type") String[] type);
......
...@@ -14,12 +14,14 @@ public interface WaterResourceMapper extends BaseMapper { ...@@ -14,12 +14,14 @@ public interface WaterResourceMapper extends BaseMapper {
List<Map> queryForPage( List<Map> queryForPage(
@Param("orgCode") String compCode,
@Param("name") String name, @Param("name") String name,
@Param("code") String code, @Param("code") String code,
@Param("type") String type, @Param("type") String type,
@Param("start") long start, @Param("start") long start,
@Param("length") Integer length); @Param("length") Integer length);
Long queryCountForPage( Long queryCountForPage(
@Param("orgCode") String compCode,
@Param("name") String name, @Param("name") String name,
@Param("code") String code, @Param("code") String code,
@Param("type")String type); @Param("type")String type);
......
...@@ -92,13 +92,14 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService { ...@@ -92,13 +92,14 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
@Override @Override
public CommonResponse queryByMap(Map<String, Object> map) { public CommonResponse queryByMap(Map<String, Object> map) {
int pageNumber = map.get("pageNumber") != null ? Integer.parseInt(map.get("pageNumber").toString()) : 0;
int pageSize = map.get("pageSize") != null ? Integer.parseInt(map.get("pageSize").toString()) : 0;
CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
Long total = fireEquipPointMapper.countByMap(map); Long total = fireEquipPointMapper.countByMap(map);
if (total.equals(0L)) { if (total.equals(0L)) {
return CommonResponseUtil.success(new PageImpl<>(Lists.newArrayList(), null, total)); return CommonResponseUtil.success(new PageImpl<>(Lists.newArrayList(), commonPageable, total));
} }
int pageNumber = map.get("pageNumber") != null ? Integer.parseInt(map.get("pageNumber").toString()) : 0; map.put("offset", pageNumber*pageSize);
int pageSize = map.get("pageSize") != null ? Integer.parseInt(map.get("pageSize").toString()) : 0;
CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
List<FireEquipmentPointEntity> list = fireEquipPointMapper.listByMap(map); List<FireEquipmentPointEntity> list = fireEquipPointMapper.listByMap(map);
return CommonResponseUtil.success(new PageImpl<>(list, commonPageable, total)); return CommonResponseUtil.success(new PageImpl<>(list, commonPageable, total));
} }
......
...@@ -262,6 +262,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -262,6 +262,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
int count = iRiskSourceDao.countByParentId(rId); int count = iRiskSourceDao.countByParentId(rId);
Optional<RiskSource> rs = iRiskSourceDao.findById(rId); Optional<RiskSource> rs = iRiskSourceDao.findById(rId);
rs.ifPresent(riskSource -> parentIds.add(riskSource.getParentId())); rs.ifPresent(riskSource -> parentIds.add(riskSource.getParentId()));
if(parentIds.contains(0l)){
throw new YeeException("公司节点不能删除");
}
if (count > 0) { if (count > 0) {
throw new YeeException("该数据有关联子项,请先删除子项数据"); throw new YeeException("该数据有关联子项,请先删除子项数据");
} }
...@@ -387,8 +390,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -387,8 +390,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} }
@Override @Override
public List<RiskSourceTreeResponse> findRiskSourceTrees() { public List<RiskSourceTreeResponse> findRiskSourceTrees(String compCode) {
return riskSourceMapper.getRiskSources(); return riskSourceMapper.getRiskSources(compCode);
} }
@Override @Override
...@@ -1002,9 +1005,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1002,9 +1005,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} }
@Override @Override
public List<HashMap<String, Object>> queryRiskSourceSecondLevel() { public List<HashMap<String, Object>> queryRiskSourceSecondLevel(String compCode) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return riskSourceMapper.queryRiskSourceSecondLevel(); return riskSourceMapper.queryRiskSourceSecondLevel(compCode);
} }
@Override @Override
......
...@@ -68,10 +68,10 @@ public class WaterResourceServiceImpl implements IWaterResourceService { ...@@ -68,10 +68,10 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
} }
public Page queryForPage(String username,String code,String type, CommonPageable pageable) public Page queryForPage(String compCode, String username,String code,String type, CommonPageable pageable)
{ {
Long total = waterResourceMapper.queryCountForPage(username,code,type); Long total = waterResourceMapper.queryCountForPage(compCode,username,code,type);
List<Map> content = waterResourceMapper.queryForPage(username,code,type,pageable.getOffset(),pageable.getPageSize()); List<Map> content = waterResourceMapper.queryForPage(compCode,username,code,type,pageable.getOffset(),pageable.getPageSize());
Page result = new PageImpl(content,pageable,total); Page result = new PageImpl(content,pageable,total);
return result; return result;
} }
......
...@@ -52,7 +52,7 @@ public interface IRiskSourceService { ...@@ -52,7 +52,7 @@ public interface IRiskSourceService {
/** /**
* 获取所有风险点 * 获取所有风险点
*/ */
List<RiskSourceTreeResponse> findRiskSourceTrees(); List<RiskSourceTreeResponse> findRiskSourceTrees(String compCode);
List<FmeaEquipmentPoint> bindFireEquiment(FmeaBindParam fmeaBindParam); List<FmeaEquipmentPoint> bindFireEquiment(FmeaBindParam fmeaBindParam);
...@@ -93,7 +93,7 @@ public interface IRiskSourceService { ...@@ -93,7 +93,7 @@ public interface IRiskSourceService {
void saveData(List<AlarmParam> deviceDatas, String type); void saveData(List<AlarmParam> deviceDatas, String type);
List<HashMap<String, Object>> queryRiskSourceSecondLevel(); List<HashMap<String, Object>> queryRiskSourceSecondLevel(String compCode);
List<RiskSourceTreeResponse> findRiskSourceEquipStatistics(); List<RiskSourceTreeResponse> findRiskSourceEquipStatistics();
......
...@@ -39,7 +39,7 @@ public interface IWaterResourceService { ...@@ -39,7 +39,7 @@ public interface IWaterResourceService {
* 查询指定设备的风险点列表 * 查询指定设备的风险点列表
* @return * @return
*/ */
Page queryForPage(String username, String code, String type,CommonPageable pageable); Page queryForPage(String compCode,String username, String code, String type,CommonPageable pageable);
void saveBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments); void saveBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments);
......
...@@ -279,4 +279,16 @@ ...@@ -279,4 +279,16 @@
update f_risk_level set manage_level = 4 where level = '4'; update f_risk_level set manage_level = 4 where level = '4';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="maoying" id="11590390304001-1">
<preConditions onFail="MARK_RAN">
<columnExists tableName="f_fire_equipment_point " columnName="fire_equipment_id"/>
</preConditions>
<comment>修改fire_equipment_id可为空</comment>
<sql>
ALTER TABLE `f_fire_equipment_point`
MODIFY COLUMN `fire_equipment_id` bigint(20) NULL COMMENT '消防装备id' AFTER `code`;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -141,6 +141,7 @@ ...@@ -141,6 +141,7 @@
f_fire_equipment as b on a.fire_equipment_id = b.id f_fire_equipment as b on a.fire_equipment_id = b.id
left join f_dict fd on fd.id = a.alarm_type left join f_dict fd on fd.id = a.alarm_type
<where> <where>
a.org_code = #{compCode}
<if test="searchValue!=null and searchValue.trim() != ''"> <if test="searchValue!=null and searchValue.trim() != ''">
and (a.name like concat('%',#{searchValue},'%') or a.code like concat('%',#{searchValue},'%')) and (a.name like concat('%',#{searchValue},'%') or a.code like concat('%',#{searchValue},'%'))
</if> </if>
...@@ -163,6 +164,7 @@ ...@@ -163,6 +164,7 @@
from from
f_fire_equipment_point as a f_fire_equipment_point as a
<where> <where>
a.org_code = #{compCode}
<if test="searchValue!=null and searchValue.trim() != ''"> <if test="searchValue!=null and searchValue.trim() != ''">
and (a.name like concat('%',#{searchValue},'%') or a.code like concat('%',#{searchValue},'%')) and (a.name like concat('%',#{searchValue},'%') or a.code like concat('%',#{searchValue},'%'))
</if> </if>
......
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
FROM FROM
`f_risk_source` rs `f_risk_source` rs
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
where rs.org_code = #{compCode}
ORDER BY rs.sort_num,rs.id ASC ORDER BY rs.sort_num,rs.id ASC
</select> </select>
...@@ -597,7 +598,7 @@ ...@@ -597,7 +598,7 @@
FROM FROM
f_risk_source f_risk_source
WHERE WHERE
parent_id = 0 parent_id = 0 and org_code = #{compCode}
) )
ORDER BY sort_num ASC,id DESC ORDER BY sort_num ASC,id DESC
</select> </select>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
FROM FROM
f_water_resource fs f_water_resource fs
WHERE WHERE
1=1 fs.org_code = #{orgCode}
<if test="name!=null"> <if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%') AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if> </if>
...@@ -63,8 +63,7 @@ ...@@ -63,8 +63,7 @@
f_water_resource fs f_water_resource fs
left join f_risk_source frs on frs.id = fs.risk_source_id left join f_risk_source frs on frs.id = fs.risk_source_id
WHERE WHERE
1=1 fs.org_code = #{orgCode}
<if test="name!=null"> <if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%') AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if> </if>
......
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