Commit 35d85995 authored by 吴江's avatar 吴江

Merge branch 'dev_upgrade' of http://172.16.10.76/station/YeeAmosFireAutoSysRoot into dev_upgrade

# Conflicts: # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
parents 071c4c65 b99e2551
...@@ -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 java.util.Date; import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -69,8 +70,9 @@ public class FireCarController extends BaseController { ...@@ -69,8 +70,9 @@ public class FireCarController extends BaseController {
//@Authorization(ingore = true) //@Authorization(ingore = true)
@ApiOperation(httpMethod = "POST", value = "上传消防车图片", notes = "上传消防车图片") @ApiOperation(httpMethod = "POST", value = "上传消防车图片", notes = "上传消防车图片")
@RequestMapping(value = "/uploadCarImg", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/uploadCarImg", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse uploadCarImg(@ApiParam(value = "消防车图片", required = false) @RequestParam(value = "file" ,required = false) MultipartFile[] file,FireCar fireCar) { public CommonResponse uploadCarImg(@ApiParam(value = "消防车图片", required = false) @RequestParam(value = "file" ,required = false) MultipartFile[] file,FireCar fireCar, BindingResult bindingResult) {
System.out.print(fireCar);
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams); String compCode=getOrgCode(reginParams);
fireCar.setOrgCode(compCode); fireCar.setOrgCode(compCode);
...@@ -78,5 +80,4 @@ public class FireCarController extends BaseController { ...@@ -78,5 +80,4 @@ public class FireCarController extends BaseController {
fireCarService.saveFireCarAndPhoto(fireCar,file); fireCarService.saveFireCarAndPhoto(fireCar,file);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
} }
...@@ -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);
} }
......
...@@ -55,7 +55,12 @@ public class FireStationController extends BaseController { ...@@ -55,7 +55,12 @@ public class FireStationController extends BaseController {
fireStationFireEquipment.setCreateBy("0"); fireStationFireEquipment.setCreateBy("0");
fireStationFireEquipment.setCreateDate(new Date()); fireStationFireEquipment.setCreateDate(new Date());
} }
return CommonResponseUtil.success(iFireStationService.saveStationFireEquipment(fireStationFireEquipments)); try {
List<FireStationFireEquipment> fireStationFireEquipments1 = iFireStationService.saveStationFireEquipment(fireStationFireEquipments);
return CommonResponseUtil.success(fireStationFireEquipments1);
} catch (Exception e){
return CommonResponseUtil.failure(e.getMessage());
}
} }
@ApiOperation(httpMethod = "DELETE", value = "解除绑定消防设备", notes = "解除绑定消防设备") @ApiOperation(httpMethod = "DELETE", value = "解除绑定消防设备", notes = "解除绑定消防设备")
......
...@@ -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);
......
...@@ -16,4 +16,6 @@ public interface IFireEquipmentDao extends BaseDao<FireEquipment, Long> { ...@@ -16,4 +16,6 @@ public interface IFireEquipmentDao extends BaseDao<FireEquipment, Long> {
Optional<FireEquipment> findById(Long id); Optional<FireEquipment> findById(Long id);
@Query(value = "SELECT count(1) FROM `f_fire_station_equipment` WHERE fire_equipment_id in ?1", nativeQuery = true)
int countAssociatedEquipStationByIds(String[] ids);
} }
...@@ -10,5 +10,4 @@ import com.yeejoin.amos.fas.dao.entity.FireStation; ...@@ -10,5 +10,4 @@ import com.yeejoin.amos.fas.dao.entity.FireStation;
public interface IFireStationDao extends BaseDao<FireStation, Long> { public interface IFireStationDao extends BaseDao<FireStation, Long> {
Optional<FireStation> findById(Long id); Optional<FireStation> findById(Long id);
} }
...@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.dao.entity.WaterResource; ...@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.dao.entity.WaterResource;
import java.util.Optional; import java.util.Optional;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Repository("iWaterResourceDao") @Repository("iWaterResourceDao")
...@@ -11,4 +12,6 @@ public interface IWaterResourceDao extends BaseDao<WaterResource, Long> { ...@@ -11,4 +12,6 @@ public interface IWaterResourceDao extends BaseDao<WaterResource, Long> {
Optional<WaterResource> findById(Long id); Optional<WaterResource> findById(Long id);
@Query(value = "SELECT count(1) FROM `f_water_resource_equipment` WHERE fire_equipment_id in ?1", nativeQuery = true)
int countAssociatedEquipWaterByIds(String[] ids);
} }
...@@ -105,7 +105,7 @@ public class FireCarServiceImpl implements IFireCarService { ...@@ -105,7 +105,7 @@ public class FireCarServiceImpl implements IFireCarService {
List<DepartmentModel> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIds)); List<DepartmentModel> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIds));
Map<Long, String> deptMap = depts.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr,DepartmentModel::getDepartmentName)); Map<Long, String> deptMap = depts.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr,DepartmentModel::getDepartmentName));
content.forEach(e -> { content.forEach(e -> {
e.put("departmentName",deptMap.get(e.get("dept_id"))); e.put("departmentName",deptMap.get(Long.valueOf(e.get("dept_id").toString())));
}); });
} }
} }
......
...@@ -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));
} }
......
...@@ -189,7 +189,8 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -189,7 +189,8 @@ public class FireEquipServiceImpl implements IFireEquipService {
return returnEntity; return returnEntity;
} }
@Override
public int countAssociatedEquipStationByIds(String[] ids) {
return iFireEquipmentDao.countAssociatedEquipStationByIds(ids);
}
} }
...@@ -299,8 +299,7 @@ public class View3dServiceImpl implements IView3dService { ...@@ -299,8 +299,7 @@ public class View3dServiceImpl implements IView3dService {
} }
Optional<RiskSource> optional = iRiskSourceDao.findByOrgCodeAndParentId(orgCode,0L); Optional<RiskSource> optional = iRiskSourceDao.findByOrgCodeAndParentId(orgCode,0L);
TodaySafetyIndexVo vo = new TodaySafetyIndexVo(); TodaySafetyIndexVo vo = new TodaySafetyIndexVo();
if(optional.isPresent()){ if(optional.isPresent()){ //1.按照等级进行转换rpn为分数-机构
//1.按照等级进行转换rpn为分数-机构
RiskSource riskSource = optional.get(); RiskSource riskSource = optional.get();
double safetyIndex = this.changeRpnToSafetyIndex(riskSource.getRpn()); double safetyIndex = this.changeRpnToSafetyIndex(riskSource.getRpn());
vo.setSafetyIndex(safetyIndex); vo.setSafetyIndex(safetyIndex);
...@@ -424,7 +423,8 @@ public class View3dServiceImpl implements IView3dService { ...@@ -424,7 +423,8 @@ public class View3dServiceImpl implements IView3dService {
List<RiskSource> regionList = iRiskSourceDao.findByParentIdAndIsRegion(optional.get().getId(),RiskSourceRegionEum.TRUE.getCode()); List<RiskSource> regionList = iRiskSourceDao.findByParentIdAndIsRegion(optional.get().getId(),RiskSourceRegionEum.TRUE.getCode());
exceptionList = regionList.stream().filter(riskSource -> { exceptionList = regionList.stream().filter(riskSource -> {
BigDecimal rpn = riskSource.getRpn() == null ? new BigDecimal("0") : riskSource.getRpn(); BigDecimal rpn = riskSource.getRpn() == null ? new BigDecimal("0") : riskSource.getRpn();
return rpn.subtract(riskSource.getRpni()).doubleValue() > 0; BigDecimal rpni = riskSource.getRpni() == null ? new BigDecimal("0") : riskSource.getRpni();
return rpn.subtract(rpni).doubleValue() > 0;
}).map(riskSource -> { }).map(riskSource -> {
ExceptionRegionVo regionVo = new ExceptionRegionVo(); ExceptionRegionVo regionVo = new ExceptionRegionVo();
regionVo.setId(riskSource.getId()); regionVo.setId(riskSource.getId());
......
...@@ -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;
} }
...@@ -98,7 +98,7 @@ public class WaterResourceServiceImpl implements IWaterResourceService { ...@@ -98,7 +98,7 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
for(WaterResourceEquipment waterResourceEquipment:waterResourceEquipments){ for(WaterResourceEquipment waterResourceEquipment:waterResourceEquipments){
WaterResourceEquipment saveWaterResourceEquipment = iWaterResourceEquipmentDao.findByWaterResourceIdAndFireEquipmentId(waterResourceEquipment.getWaterResourceId(),waterResourceEquipment.getFireEquipmentId()); WaterResourceEquipment saveWaterResourceEquipment = iWaterResourceEquipmentDao.findByWaterResourceIdAndFireEquipmentId(waterResourceEquipment.getWaterResourceId(),waterResourceEquipment.getFireEquipmentId());
if(StringUtil.isNotEmpty(saveWaterResourceEquipment)){ if(StringUtil.isNotEmpty(saveWaterResourceEquipment)){
deleteList.add(waterResourceEquipment); deleteList.add(saveWaterResourceEquipment);
} }
} }
iWaterResourceEquipmentDao.deleteAll(deleteList); iWaterResourceEquipmentDao.deleteAll(deleteList);
...@@ -120,8 +120,8 @@ public class WaterResourceServiceImpl implements IWaterResourceService { ...@@ -120,8 +120,8 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
} }
@Override
public int countAssociatedEquipWaterByIds(String[] ids) {
return iWaterResourceDao.countAssociatedEquipWaterByIds(ids);
}
} }
...@@ -18,15 +18,10 @@ public interface IFireEquipService { ...@@ -18,15 +18,10 @@ public interface IFireEquipService {
List<String> findFireEquipArea(); List<String> findFireEquipArea();
FireEquipment save(FireEquipment fireEquipment); FireEquipment save(FireEquipment fireEquipment);
FireEquipment queryOne(Long id); FireEquipment queryOne(Long id);
/** /**
* 删除单个风险点 * 删除单个风险点
* @return * @return
...@@ -34,8 +29,6 @@ public interface IFireEquipService { ...@@ -34,8 +29,6 @@ public interface IFireEquipService {
*/ */
String [] delete(String []idArray) throws Exception; String [] delete(String []idArray) throws Exception;
Page queryForFireEquipmentHistory(String fireEquipmentName, Page queryForFireEquipmentHistory(String fireEquipmentName,
String equipmentName, String equipmentName,
String startTime, String startTime,
...@@ -44,9 +37,13 @@ public interface IFireEquipService { ...@@ -44,9 +37,13 @@ public interface IFireEquipService {
Page queryForEquipmentList(String name, String code,String equipClassify,CommonPageable commonPageable); Page queryForEquipmentList(String name, String code,String equipClassify,CommonPageable commonPageable);
//查询设备明细 //查询设备明细
Object queryForDetail(String type, Long id) throws Exception; Object queryForDetail(String type, Long id) throws Exception;
/**
* 查询关联数量
* @param ids
* @return
*/
int countAssociatedEquipStationByIds(String[] ids);
} }
...@@ -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);
...@@ -54,4 +54,6 @@ public interface IWaterResourceService { ...@@ -54,4 +54,6 @@ public interface IWaterResourceService {
Object queryForList(); Object queryForList();
int countAssociatedEquipWaterByIds(String[] ids);
} }
...@@ -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
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
left join f_risk_source frs on frs.id = f.risk_source_id left join f_risk_source frs on frs.id = f.risk_source_id
WHERE WHERE
fs.fire_station_id = ${fireStationId} fs.fire_station_id = ${fireStationId}
and f.id is not null
LIMIT ${start}, ${length}; LIMIT ${start}, ${length};
</select> </select>
......
...@@ -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>
......
...@@ -68,7 +68,9 @@ ...@@ -68,7 +68,9 @@
fe.room, fe.room,
fe.risk_source_id, fe.risk_source_id,
fe.is_indoor, fe.is_indoor,
fe.model,fe.manufacturer fe.model,
fe.manufacturer,
fe.floor3d
FROM FROM
f_fire_equipment fe f_fire_equipment fe
LEFT JOIN f_risk_source rs ON rs.id = fe.risk_source_id LEFT JOIN f_risk_source rs ON rs.id = fe.risk_source_id
......
...@@ -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>
...@@ -100,6 +99,7 @@ ...@@ -100,6 +99,7 @@
left join f_risk_source frs on frs.id = f.risk_source_id left join f_risk_source frs on frs.id = f.risk_source_id
WHERE WHERE
fs.water_resource_id = ${waterResourceId} fs.water_resource_id = ${waterResourceId}
and f.id is not null
LIMIT ${start}, ${length}; LIMIT ${start}, ${length};
</select> </select>
......
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