Commit f72c369e authored by 单奇雲's avatar 单奇雲

冲突

parents 003010c6 87a2f8e3
package com.yeejoin.amos.fas.common.enums;
/**
* @author suhg
*/
public enum RpnChangeTypeEum {
/**
* rpn 上升
*/
upper("上升",0),
/**
* rpn 下降
*/
down("下降",1);
private String label;
private int value;
RpnChangeTypeEum(String label,int value ){
this.label = label;
this.value = value;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}
package com.yeejoin.amos.fas.common.enums;
/**
* @author suhg
*/
public enum StatisticsErrorTypeEum {
/**
* 风险异常
*/
risk("risk", "风险异常"),
/**
* 巡检异常
*/
patrol("patrol", "巡检异常"),
/**
* 设备故障
*/
equip("equip", "设备故障"),
/**
* 火灾告警
*/
fire("fire", "火灾告警");
/**
* 编号
*/
private String code;
/**
* 名称
*/
private String name;
StatisticsErrorTypeEum(String code, String name) {
this.code = code;
this.name = 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;
}
}
\ No newline at end of file
package com.yeejoin.amos.fas.business.bo;
/**
* @author suhg
*/
public class RiskPointRpnChangeBo {
private Long id;
private String name;
private Long riskLevelId;
private String changeDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getRiskLevelId() {
return riskLevelId;
}
public void setRiskLevelId(Long riskLevelId) {
this.riskLevelId = riskLevelId;
}
public String getChangeDate() {
return changeDate;
}
public void setChangeDate(String changeDate) {
this.changeDate = changeDate;
}
}
...@@ -8,12 +8,7 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil; ...@@ -8,12 +8,7 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService; import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import com.yeejoin.amos.fas.business.vo.ReginParams; import com.yeejoin.amos.fas.business.vo.ReginParams;
...@@ -89,5 +84,19 @@ public class View3dController extends BaseController { ...@@ -89,5 +84,19 @@ public class View3dController extends BaseController {
return CommonResponseUtil.success(view3dService.getPointDetailByTypeAndId(type,pointId,orgCode)); return CommonResponseUtil.success(view3dService.getPointDetailByTypeAndId(type,pointId,orgCode));
} }
@ApiOperation(value = "今日安全指数查询",notes = "按照日期查询安全指数及分类数据")
@GetMapping(value = "/statistics/safetyIndex")
public CommonResponse getSafetyIndexInfoByDate(@RequestParam(name = "date",required = false) String date){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.getSafetyIndexInfoByDate(orgCode,date));
}
@ApiOperation(value = "今日安全指数详情",notes = "risk-风险异常,check-巡检异常,equipProblem-设备故障")
@GetMapping(value = "/safetyIndex/detail/{type}")
public CommonResponse getSafetyIndexDetail(@PathVariable String type){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.getSafetyIndexDetail(type,orgCode));
}
} }
...@@ -2,15 +2,51 @@ package com.yeejoin.amos.fas.business.dao.mapper; ...@@ -2,15 +2,51 @@ package com.yeejoin.amos.fas.business.dao.mapper;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse; import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
public interface View3dMapper extends BaseMapper{ public interface View3dMapper extends BaseMapper{
/**
* 按类型查询树
* @param type
* @param orgCode
* @return
*/
List<RegionTreeResponse> getPointTreeByType(@Param("type")String type,@Param("orgCode")String orgCode); List<RegionTreeResponse> getPointTreeByType(@Param("type")String type,@Param("orgCode")String orgCode);
/**
* 获取点详情
* @param type
* @param pointId
* @param orgCode
* @return
*/
HashMap<String, Object> getPointDetailByTypeAndId(@Param("type")String type, @Param("pointId")Long pointId,@Param("orgCode")String orgCode); HashMap<String, Object> getPointDetailByTypeAndId(@Param("type")String type, @Param("pointId")Long pointId,@Param("orgCode")String orgCode);
/**
* 统计风险上升异常数量(风险点)-日期+机构
* @param param:{type,orgCode}
* @return Long
*/
Long countUpperRiskPoint(Map<String,Object> param);
/**
* 统计巡检异常数量(不合格、漏检)-日期+机构
* @param param{}
* @return Long
*/
Long countCheckException(Map<String,Object> param);
/**
* 今日安全指数详情
* @param params orgCode,date
* @return list
*/
List<RiskPointRpnChangeBo> getAllErrorRiskPoint(Map<String, Object> params);
} }
...@@ -36,5 +36,5 @@ public interface IRiskSourceDao extends BaseDao<RiskSource, Long> { ...@@ -36,5 +36,5 @@ public interface IRiskSourceDao extends BaseDao<RiskSource, Long> {
List<RiskSource> queryRiskAreaRpn(); List<RiskSource> queryRiskAreaRpn();
Optional<RiskSource> findByOrgCodeAndParentId(String orgCode, Long parentId);
} }
...@@ -9,23 +9,33 @@ import java.util.List; ...@@ -9,23 +9,33 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType; import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import com.google.common.collect.Lists;
import com.yeejoin.amos.fas.business.bo.BindPointBo; import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo;
import com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper; import com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper;
import com.yeejoin.amos.fas.business.dao.repository.*; import com.yeejoin.amos.fas.business.dao.repository.*;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService; import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.business.vo.ErrorContentVo;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo;
import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo;
import com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum;
import com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum;
import com.yeejoin.amos.fas.core.common.request.DateUtil;
import com.yeejoin.amos.fas.core.util.*;
import com.yeejoin.amos.fas.dao.entity.*; import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.exception.YeeException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.dao.mapper.View3dMapper; import com.yeejoin.amos.fas.business.dao.mapper.View3dMapper;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum; import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse; import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
...@@ -53,9 +63,12 @@ public class View3dServiceImpl implements IView3dService { ...@@ -53,9 +63,12 @@ public class View3dServiceImpl implements IView3dService {
private IEquipmentDao iEquipmentDao; private IEquipmentDao iEquipmentDao;
@Autowired @Autowired
private IWaterResourceDao iWaterResourceDao; private IWaterResourceDao iWaterResourceDao;
@Autowired @Autowired
private PatrolMapper patrolMapper; private PatrolMapper patrolMapper;
@Autowired
private IRiskLevelDao iRiskLevelDao;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -102,8 +115,9 @@ public class View3dServiceImpl implements IView3dService { ...@@ -102,8 +115,9 @@ public class View3dServiceImpl implements IView3dService {
} }
public void updateFireCarPosition(BindPointBo pointBo) { public void updateFireCarPosition(BindPointBo pointBo) {
FireCar fireCar = iFireCarDao.getOne(pointBo.getPointId()); Optional<FireCar> data = iFireCarDao.findById(pointBo.getPointId());
if(fireCar != null){ if(data.isPresent()){
FireCar fireCar = data.get();
fireCar.setUe4Location(pointBo.getUe4Location()); fireCar.setUe4Location(pointBo.getUe4Location());
fireCar.setUe4Rotation(pointBo.getUe4Rotation()); fireCar.setUe4Rotation(pointBo.getUe4Rotation());
iFireCarDao.save(fireCar); iFireCarDao.save(fireCar);
...@@ -111,8 +125,9 @@ public class View3dServiceImpl implements IView3dService { ...@@ -111,8 +125,9 @@ public class View3dServiceImpl implements IView3dService {
} }
public void updateWaterSourcePosition(BindPointBo pointBo) { public void updateWaterSourcePosition(BindPointBo pointBo) {
WaterResource waterResource = iWaterResourceDao.getOne(pointBo.getPointId()); Optional<WaterResource> data = iWaterResourceDao.findById(pointBo.getPointId());
if(waterResource != null){ if(data.isPresent()){
WaterResource waterResource = data.get();
waterResource.setUe4Location(pointBo.getUe4Location()); waterResource.setUe4Location(pointBo.getUe4Location());
waterResource.setUe4Rotation(pointBo.getUe4Rotation()); waterResource.setUe4Rotation(pointBo.getUe4Rotation());
iWaterResourceDao.save(waterResource); iWaterResourceDao.save(waterResource);
...@@ -120,8 +135,9 @@ public class View3dServiceImpl implements IView3dService { ...@@ -120,8 +135,9 @@ public class View3dServiceImpl implements IView3dService {
} }
public void updateFireStationPosition(BindPointBo pointBo) { public void updateFireStationPosition(BindPointBo pointBo) {
FireStation fireStation = iFireStationDao.getOne(pointBo.getPointId()); Optional<FireStation> data = iFireStationDao.findById(pointBo.getPointId());
if(fireStation != null){ if(data.isPresent()){
FireStation fireStation = data.get();
fireStation.setUe4Location(pointBo.getUe4Location()); fireStation.setUe4Location(pointBo.getUe4Location());
fireStation.setUe4Rotation(pointBo.getUe4Rotation()); fireStation.setUe4Rotation(pointBo.getUe4Rotation());
iFireStationDao.save(fireStation); iFireStationDao.save(fireStation);
...@@ -129,8 +145,9 @@ public class View3dServiceImpl implements IView3dService { ...@@ -129,8 +145,9 @@ public class View3dServiceImpl implements IView3dService {
} }
public void updateFireEquipmentPosition(BindPointBo pointBo) { public void updateFireEquipmentPosition(BindPointBo pointBo) {
FireEquipment fireEquipment = iFireEquipmentDao.getOne(pointBo.getPointId()); Optional<FireEquipment> data = iFireEquipmentDao.findById(pointBo.getPointId());
if(fireEquipment != null){ if(data.isPresent()){
FireEquipment fireEquipment = data.get();
fireEquipment.setUe4Location(pointBo.getUe4Location()); fireEquipment.setUe4Location(pointBo.getUe4Location());
fireEquipment.setUe4Rotation(pointBo.getUe4Rotation()); fireEquipment.setUe4Rotation(pointBo.getUe4Rotation());
iFireEquipmentDao.save(fireEquipment); iFireEquipmentDao.save(fireEquipment);
...@@ -138,8 +155,10 @@ public class View3dServiceImpl implements IView3dService { ...@@ -138,8 +155,10 @@ public class View3dServiceImpl implements IView3dService {
} }
public void updateEquipmentPosition(BindPointBo pointBo) { public void updateEquipmentPosition(BindPointBo pointBo) {
Equipment equipment = iEquipmentDao.getOne(pointBo.getPointId()); Optional<Equipment> data=iEquipmentDao.findById(pointBo.getPointId());
if(equipment != null){ Equipment equipment = null;
if(data.isPresent()){
equipment = data.get();
equipment.setUe4Location(pointBo.getUe4Location()); equipment.setUe4Location(pointBo.getUe4Location());
equipment.setUe4Rotation(pointBo.getUe4Rotation()); equipment.setUe4Rotation(pointBo.getUe4Rotation());
iEquipmentDao.save(equipment); iEquipmentDao.save(equipment);
...@@ -151,8 +170,9 @@ public class View3dServiceImpl implements IView3dService { ...@@ -151,8 +170,9 @@ public class View3dServiceImpl implements IView3dService {
} }
public void updateRiskSourcePosition(BindPointBo pointBo) { public void updateRiskSourcePosition(BindPointBo pointBo) {
RiskSource riskSource = iRiskSourceDao.getOne(pointBo.getPointId()); Optional<RiskSource> data = iRiskSourceDao.findById(pointBo.getPointId());
if(riskSource != null){ if(data.isPresent()){
RiskSource riskSource = data.get();
riskSource.setUe4Location(pointBo.getUe4Location()); riskSource.setUe4Location(pointBo.getUe4Location());
riskSource.setUe4Rotation(pointBo.getUe4Rotation()); riskSource.setUe4Rotation(pointBo.getUe4Rotation());
iRiskSourceDao.save(riskSource); iRiskSourceDao.save(riskSource);
...@@ -193,4 +213,83 @@ public class View3dServiceImpl implements IView3dService { ...@@ -193,4 +213,83 @@ public class View3dServiceImpl implements IView3dService {
public HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId,String orgCode) { public HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId,String orgCode) {
return view3dMapper.getPointDetailByTypeAndId(type,pointId,orgCode); return view3dMapper.getPointDetailByTypeAndId(type,pointId,orgCode);
} }
@Override
public TodaySafetyIndexVo getSafetyIndexInfoByDate(String orgCode,String date) {
if(!StringUtil.isNotEmpty(date)){
date = DateUtil.getDateFormat(new Date(),DateUtil.DATE_DEFAULT_FORMAT);
}
Optional<RiskSource> optional = iRiskSourceDao.findByOrgCodeAndParentId(orgCode,0L);
TodaySafetyIndexVo vo = new TodaySafetyIndexVo();
if(optional.isPresent()){
//1.按照等级进行转换rpn为分数-机构
RiskSource riskSource = optional.get();
double safetyIndex = this.calSafetyIndex(riskSource);
vo.setSafetyIndex(safetyIndex);
//2.统计风险上升异常数量(风险点)-日期+机构
Long upperNum = this.getRiskUpperNum(orgCode, date);
vo.setRiskExceptionNum(upperNum);
//3.统计巡检异常数量(不合格、漏检)-日期+机构
Long checkExceptionNum = this.getCheckExceptionNum(orgCode,date);
vo.setCheckExceptionNum(checkExceptionNum);
//4.统计火灾报警数量-日期+机构
//TODO:待毛颖确认调整完成后继续
vo.setFireExceptionNum(0L);
} else {
throw new YeeException("机构:"+orgCode+" 不存在");
}
return vo;
}
@Override
public List<SafetyIndexDetailVo> getSafetyIndexDetail(String type,String orgCode) {
List<SafetyIndexDetailVo> resultList = Lists.newArrayList();
String dateStr = DateUtil.getDateFormat(new Date(),DateUtil.DATE_DEFAULT_FORMAT);
if(StatisticsErrorTypeEum.risk.getCode().equals(type)){
//1.按照日期+机构,查询出所有风险点
Map<String,Object> params = new HashMap<>();
params.put("orgCode",orgCode);
params.put("date",dateStr);
List<RiskPointRpnChangeBo> risks = view3dMapper.getAllErrorRiskPoint(params);
//2.按照 风险等级id进行分组,加工数据
Map<Long,List<RiskPointRpnChangeBo>> map = risks.stream().collect(Collectors.groupingBy(RiskPointRpnChangeBo::getRiskLevelId));
List<RiskLevel> riskLevelList = iRiskLevelDao.findAll();
Map<Long,String> riskLevelMap = riskLevelList.stream().collect(Collectors.toMap(RiskLevel::getId,RiskLevel::getName));
map.forEach((k,v)->{
SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo();
safetyIndexDetailVo.setTypeCode(Long.toString(k));
safetyIndexDetailVo.setTypeName(riskLevelMap.get(k));
List<ErrorContentVo> errorContentVoList = new ArrayList<>();
BeanUtils.copyProperties(v,errorContentVoList);
safetyIndexDetailVo.setContent(errorContentVoList);
resultList.add(safetyIndexDetailVo);
});
} else if(StatisticsErrorTypeEum.patrol.getCode().equals(type)){
} else if(StatisticsErrorTypeEum.equip.getCode().equals(type)){
}
return resultList;
}
private Long getCheckExceptionNum(String orgCode, String date) {
Map<String,Object> params = new HashMap<>();
params.put("orgCode", orgCode);
params.put("date", date);
return view3dMapper.countCheckException(params);
}
private Long getRiskUpperNum(String orgCode, String date) {
Map<String,Object> param = new HashMap<>();
param.put("type", RpnChangeTypeEum.upper.getValue());
param.put("orgCode", orgCode);
param.put("date", date);
return view3dMapper.countUpperRiskPoint(param);
}
private double calSafetyIndex(RiskSource riskSource) {
BigDecimal rpn = new BigDecimal(String.valueOf(riskSource.getRpn() == null ? "0" : riskSource.getRpn()));
//计算规则:除10 减100 求绝对值,结果保留1位小数
return rpn.divide(new BigDecimal("10")).subtract(new BigDecimal("100")).abs().setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue();
}
} }
package com.yeejoin.amos.fas.business.service.intfc; package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.business.bo.BindPointBo; import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo;
import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse; import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
...@@ -13,11 +15,49 @@ import java.util.Map; ...@@ -13,11 +15,49 @@ import java.util.Map;
*/ */
public interface IView3dService { public interface IView3dService {
/**
* 区域绑定保存
* @param pointBoList 数组
* @return 空
*/
CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList); CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList);
/**
* 点类型查询
* @return list
*/
List<Map<String, String>> getPointType(); List<Map<String, String>> getPointType();
/**
* 按照分类查询点树
* @param type 树类型字典值
* @param orgCode 登陆机构
* @return list
*/
List<RegionTreeResponse> getPointTreeByType(String type,String orgCode); List<RegionTreeResponse> getPointTreeByType(String type,String orgCode);
/**
* 获取点详情
* @param type 树类型
* @param pointId 点id
* @param orgCode 登录机构
* @return
*/
HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId,String orgCode); HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId,String orgCode);
/**
* 今日安全指数
* @param orgCode 登陆机构
* @param date 日期
* @return TodaySafetyIndexVo
*/
TodaySafetyIndexVo getSafetyIndexInfoByDate(String orgCode, String date);
/**
* 今日安全指数详情
* @param type 详情类型
* @return list
*/
List<SafetyIndexDetailVo> getSafetyIndexDetail(String type,String orgCode);
} }
package com.yeejoin.amos.fas.business.vo;
/**
* @author suhg
*/
public class ErrorContentVo {
/**
* 名称
*/
private String name;
/**
* 日期
*/
private String changeDate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getChangeDate() {
return changeDate;
}
public void setChangeDate(String changeDate) {
this.changeDate = changeDate;
}
}
package com.yeejoin.amos.fas.business.vo;
import java.util.List;
/**
* @author suhg
*/
public class SafetyIndexDetailVo {
/**
* 类型字典
*/
private String typeCode;
/**
* 类型名称
*/
private String typeName;
/**
* 异常内容数组
*/
private List<ErrorContentVo> content;
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public List<ErrorContentVo> getContent() {
return content;
}
public void setContent(List<ErrorContentVo> content) {
this.content = content;
}
}
package com.yeejoin.amos.fas.business.vo;
/**
* @author suhg
*/
public class TodaySafetyIndexVo {
private Double safetyIndex;
private Long riskExceptionNum;
private Long checkExceptionNum;
private Long fireExceptionNum;
public Long getRiskExceptionNum() {
return riskExceptionNum;
}
public void setRiskExceptionNum(Long riskExceptionNum) {
this.riskExceptionNum = riskExceptionNum;
}
public Long getCheckExceptionNum() {
return checkExceptionNum;
}
public void setCheckExceptionNum(Long checkExceptionNum) {
this.checkExceptionNum = checkExceptionNum;
}
public Long getFireExceptionNum() {
return fireExceptionNum;
}
public void setFireExceptionNum(Long fireExceptionNum) {
this.fireExceptionNum = fireExceptionNum;
}
public Double getSafetyIndex() {
return safetyIndex;
}
public void setSafetyIndex(Double safetyIndex) {
this.safetyIndex = safetyIndex;
}
}
...@@ -14,7 +14,7 @@ eureka.client.fetchRegistry = true ...@@ -14,7 +14,7 @@ eureka.client.fetchRegistry = true
#DB properties: #DB properties:
spring.datasource.url=jdbc:mysql://amos-mysql:3306/91-safety-business?serverTimezone=UTC&&useSSL=false&&allowMultiQueries=true&serverTimezone=GMT&characterEncoding=utf8 spring.datasource.url=jdbc:mysql://amos-mysql:3306/91-safety-business?serverTimezone=UTC&&useSSL=false&&allowMultiQueries=true&serverTimezone=GMT&characterEncoding=utf8
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=root_123 spring.datasource.password=yeejoin_1234
spring.datasource.driver-class-name = com.mysql.jdbc.Driver spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.datasource.hikari.maxLifetime = 1765000 spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size = 10 spring.datasource.hikari.maximum-pool-size = 10
...@@ -22,18 +22,18 @@ spring.datasource.testWhileIdle = true ...@@ -22,18 +22,18 @@ spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1 spring.datasource.validationQuery = SELECT 1
#mongodb #mongodb
spring.data.mongodb.uri = mongodb://amos-mongodb:27017/iecmonitor spring.data.mongodb.uri = mongodb://amos-mongo:27017/iecmonitor
#rule #rule
#params.remoteRuleUrl=http://172.16.3.3:8080/ #params.remoteRuleUrl=http://172.16.3.3:8080/
params.remoteRuleUrl=http://magintursh.xicp.net:18080/ params.remoteRuleUrl=http://station-rule:8080/
params.remoteWebsocketUrl=http://amos-websocket:10600/ params.remoteWebsocketUrl=http://station-websocket:10600/
spring.redis.database=5 spring.redis.database=5
spring.redis.host=amos-redis spring.redis.host=amos-redis
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=1234560 spring.redis.password=redis2020
spring.redis.jedis.pool.max-active=200 spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10 spring.redis.jedis.pool.max-idle=10
...@@ -43,5 +43,5 @@ spring.redis.timeout=1000 ...@@ -43,5 +43,5 @@ spring.redis.timeout=1000
#picture upload #picture upload
file.uploadUrl=D:\\upload\\files\\ file.uploadUrl=D:\\upload\\files\\
#picture read #picture read
file.readUrl=http://amos-file:8083/file/getFile?in= file.readUrl=http://station-fireautosys:8083/file/getFile?in=
params.isPush=true params.isPush=true
...@@ -173,5 +173,54 @@ ...@@ -173,5 +173,54 @@
AND org_code like CONCAT(#{orgCode},'%') AND org_code like CONCAT(#{orgCode},'%')
</if> </if>
</select> </select>
<select id="countUpperRiskPoint" resultType="long">
SELECT
count(DISTINCT frcl.id)
FROM
(
SELECT
a.id,
a.risk_source_id,
date_format(a.create_date, '%Y-%m-%d') AS create_date
FROM
`f_rpn_change_log` a,
`f_risk_source` b
WHERE
a.type = #{type}
and a.risk_source_id = b.id
and b.org_code = #{orgCode}
) as frcl
WHERE
frcl.create_date = #{date}
</select>
<select id="countCheckException" resultType="long">
select count(1) from
(
SELECT
a.id,
DATE_FORMAT(b.begin_time,'%Y-%m-%d') as begin_date,
DATE_FORMAT(b.end_time,'%Y-%m-%d') as end_date
FROM `p_plan_task_detail` a , p_plan_task b
where
a.task_no = b.id
and a.`status` in ('2','3')
and (b.org_code = #{orgCode} or b.org_code like CONCAT(#{orgCode},'-','%'))
) pt
where #{date} BETWEEN pt.begin_date and pt.end_date
</select>
<select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo" >
SELECT
b.id,
a.`name`,
a.risk_level_id as riskLevelId,
b.create_date as changeDate
FROM
f_risk_source a,
f_rpn_change_log b
WHERE
b.risk_source_id = a.id
AND b.type = '0'
and a.org_code = #{orgCode}
and DATE_FORMAT(b.create_date,'%Y-%m-%d') = #{date}
</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