Commit b9cd3627 authored by KeYong's avatar KeYong

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

parents 34164ec6 6bf518c1
...@@ -38,7 +38,6 @@ import com.yeejoin.amos.fas.business.action.model.ContingencyEvent; ...@@ -38,7 +38,6 @@ import com.yeejoin.amos.fas.business.action.model.ContingencyEvent;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo; import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.model.DeviceRo; import com.yeejoin.amos.fas.business.action.model.DeviceRo;
import com.yeejoin.amos.fas.business.action.model.SetpEnum; import com.yeejoin.amos.fas.business.action.model.SetpEnum;
import com.yeejoin.amos.fas.business.action.mq.StationEnum;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.result.ActionResult; import com.yeejoin.amos.fas.business.action.result.ActionResult;
import com.yeejoin.amos.fas.business.action.result.SafteyPlanResult; import com.yeejoin.amos.fas.business.action.result.SafteyPlanResult;
...@@ -76,6 +75,9 @@ public class ContingencyAction implements CustomerAction { ...@@ -76,6 +75,9 @@ public class ContingencyAction implements CustomerAction {
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String serviceName; private String serviceName;
@Value("${station.name}")
private String stationName;
@Autowired @Autowired
private IContingencyInstance iContingencyInstance; private IContingencyInstance iContingencyInstance;
...@@ -182,7 +184,7 @@ public class ContingencyAction implements CustomerAction { ...@@ -182,7 +184,7 @@ public class ContingencyAction implements CustomerAction {
AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result); AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result);
if ("mqtt".equals(pushType.toLowerCase())) { if ("mqtt".equals(pushType.toLowerCase())) {
ToipResponse toipResponse = action.buildResponse(msgType, contingency, result.toJson()); ToipResponse toipResponse = action.buildResponse(msgType, contingency, result.toJson());
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"plan");
log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr())); log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr()));
webMqttComponent.publish(topic, toipResponse.toJsonStr()); webMqttComponent.publish(topic, toipResponse.toJsonStr());
...@@ -745,7 +747,7 @@ public class ContingencyAction implements CustomerAction { ...@@ -745,7 +747,7 @@ public class ContingencyAction implements CustomerAction {
AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result); AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result);
if ("mqtt".equals(pushType.toLowerCase())) { if ("mqtt".equals(pushType.toLowerCase())) {
ToipResponse toipResponse = action.buildResponse(msgType, deviceRo, result.toJson()); ToipResponse toipResponse = action.buildResponse(msgType, deviceRo, result.toJson());
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"plan");
log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr())); log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr()));
webMqttComponent.publish(topic, toipResponse.toJsonStr()); webMqttComponent.publish(topic, toipResponse.toJsonStr());
......
package com.yeejoin.amos.fas.business.action; package com.yeejoin.amos.fas.business.action;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentHandlerService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.yeejoin.amos.fas.business.action.model.ContingencyEvent; import com.yeejoin.amos.fas.business.action.model.ContingencyEvent;
...@@ -12,10 +14,15 @@ public class ContingencyLogListener implements ApplicationListener<ContingencyEv ...@@ -12,10 +14,15 @@ public class ContingencyLogListener implements ApplicationListener<ContingencyEv
@Autowired @Autowired
IRuleRunningSnapshotService ruleRunningSnapshotService; IRuleRunningSnapshotService ruleRunningSnapshotService;
// @Autowired
// @Lazy
// IEquipmentHandlerService equipmentHandlerService;
@Override @Override
public void onApplicationEvent(ContingencyEvent event) { public void onApplicationEvent(ContingencyEvent event) {
ruleRunningSnapshotService.reacordPlan(event.getTopic(), event.getMsgType(), event.getMsgBody(), event.getContingency()); ruleRunningSnapshotService.reacordPlan(event.getTopic(), event.getMsgType(), event.getMsgBody(), event.getContingency());
// equipmentHandlerService.subscribeTopic();
} }
} }
...@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component; ...@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component;
import com.yeejoin.amos.component.rule.MethodParam; import com.yeejoin.amos.component.rule.MethodParam;
import com.yeejoin.amos.component.rule.RuleActionBean; import com.yeejoin.amos.component.rule.RuleActionBean;
import com.yeejoin.amos.component.rule.RuleMethod; import com.yeejoin.amos.component.rule.RuleMethod;
import com.yeejoin.amos.fas.business.action.mq.StationEnum;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.result.ActionResult; import com.yeejoin.amos.fas.business.action.result.ActionResult;
import com.yeejoin.amos.fas.business.action.result.BubbleTipResult; import com.yeejoin.amos.fas.business.action.result.BubbleTipResult;
...@@ -42,6 +41,9 @@ public class RiskSituationAction implements CustomerAction ...@@ -42,6 +41,9 @@ public class RiskSituationAction implements CustomerAction
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String serviceName; private String serviceName;
@Value("${station.name}")
private String stationName;
@RuleMethod(methodLabel = "气泡提示", project = "换流站消防专项预案") @RuleMethod(methodLabel = "气泡提示", project = "换流站消防专项预案")
public void sendBubbleTip(@MethodParam(paramLabel = "bizobj对象") Object bizobj, public void sendBubbleTip(@MethodParam(paramLabel = "bizobj对象") Object bizobj,
@MethodParam(paramLabel = "是否显示名称") Boolean showInfo, @MethodParam(paramLabel = "是否显示名称") Boolean showInfo,
...@@ -70,7 +72,7 @@ public class RiskSituationAction implements CustomerAction ...@@ -70,7 +72,7 @@ public class RiskSituationAction implements CustomerAction
String msgType = "bubbleTip"; String msgType = "bubbleTip";
if ("mqtt".equals(pushType.toLowerCase())) { if ("mqtt".equals(pushType.toLowerCase())) {
ToipResponse toipResponse = action.buildResponse(msgType, bizobj, result); ToipResponse toipResponse = action.buildResponse(msgType, bizobj, result);
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"rule"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"rule");
webMqttComponent.publish(topic, toipResponse.toJsonStr()); webMqttComponent.publish(topic, toipResponse.toJsonStr());
} else { } else {
Object obj = action.execute(msgType, bizobj); Object obj = action.execute(msgType, bizobj);
......
...@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.yeejoin.amos.fas.business.action.el.ELEvaluationContext; import com.yeejoin.amos.fas.business.action.el.ELEvaluationContext;
import com.yeejoin.amos.fas.business.action.mq.StationEnum;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.result.ActionResult; import com.yeejoin.amos.fas.business.action.result.ActionResult;
import com.yeejoin.amos.fas.business.action.result.TipResult; import com.yeejoin.amos.fas.business.action.result.TipResult;
...@@ -43,6 +42,10 @@ public class SimpleTipAction implements CustomerAction ...@@ -43,6 +42,10 @@ public class SimpleTipAction implements CustomerAction
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String serviceName; private String serviceName;
@Value("${station.name}")
private String stationName;
//@ExposeAction("消息提示") //@ExposeAction("消息提示")
public void sendMessageTip(Object bizobj, String title, String content, String type) public void sendMessageTip(Object bizobj, String title, String content, String type)
{ {
...@@ -68,7 +71,7 @@ public class SimpleTipAction implements CustomerAction ...@@ -68,7 +71,7 @@ public class SimpleTipAction implements CustomerAction
String msgType = "message"; String msgType = "message";
if ("mqtt".equals(pushType.toLowerCase())) { if ("mqtt".equals(pushType.toLowerCase())) {
ToipResponse toipResponse = action.buildResponse(msgType, bizobj, result); ToipResponse toipResponse = action.buildResponse(msgType, bizobj, result);
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"rule"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"rule");
webMqttComponent.publish(topic, toipResponse.toJsonStr()); webMqttComponent.publish(topic, toipResponse.toJsonStr());
} else { } else {
action.execute(msgType, bizobj); action.execute(msgType, bizobj);
......
package com.yeejoin.amos.fas.business.action.mq;
public enum StationEnum {
YINAN("yinan", "沂南站");
String code;
String desc;
private StationEnum(String code, String desc) {
this.desc = desc;
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
...@@ -4,6 +4,7 @@ import java.util.ArrayList; ...@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -45,6 +46,9 @@ import io.swagger.annotations.ApiParam; ...@@ -45,6 +46,9 @@ import io.swagger.annotations.ApiParam;
@Api(tags = "风险点API") @Api(tags = "风险点API")
public class RiskSourceController extends BaseController { public class RiskSourceController extends BaseController {
private final Logger log = LoggerFactory.getLogger(RiskSourceController.class); private final Logger log = LoggerFactory.getLogger(RiskSourceController.class);
private final static String IS_RISK_AREA = "TRUE";
@Autowired @Autowired
IRiskFactorService iRiskFactorService; IRiskFactorService iRiskFactorService;
...@@ -87,7 +91,7 @@ public class RiskSourceController extends BaseController { ...@@ -87,7 +91,7 @@ public class RiskSourceController extends BaseController {
* @return * @return
*/ */
@Permission @Permission
@ApiOperation(httpMethod = "GET", value = "风险上升率", notes = "风险上升率") @ApiOperation(httpMethod = "GET", value = "风险上升率", notes = "风险上升率")
@RequestMapping(value = "/riseuprate", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/riseuprate", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryForRiseUp() throws Exception { public CommonResponse queryForRiseUp() throws Exception {
return CommonResponseUtil.success(riskSourceService.queryForRiseUp()); return CommonResponseUtil.success(riskSourceService.queryForRiseUp());
...@@ -116,29 +120,29 @@ public class RiskSourceController extends BaseController { ...@@ -116,29 +120,29 @@ 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() {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String compCode=getOrgCode(reginParams); String compCode = getOrgCode(reginParams);
List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(compCode); List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(compCode);
return CommonResponseUtil.success(getRiskSourcesTree(riskSources)); return CommonResponseUtil.success(getRiskSourcesTree(riskSources));
} }
@Permission @Permission
@ApiOperation(value = "远程同步", notes = "将本地 风险模型推送到远程同步") @ApiOperation(value = "远程同步", notes = "将本地 风险模型推送到远程同步")
@PutMapping(value = "/synToEquipManage") @PutMapping(value = "/synToEquipManage")
public CommonResponse synToEquipManage() { public CommonResponse synToEquipManage() {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String compCode=getOrgCode(reginParams); String compCode = getOrgCode(reginParams);
if(!riskSourceService.isSynEquipManage()) { if (!riskSourceService.isSynEquipManage()) {
return CommonResponseUtil.failure("同步功能未开启"); return CommonResponseUtil.failure("同步功能未开启");
} }
List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(compCode); List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(compCode).stream().filter(source -> IS_RISK_AREA.equalsIgnoreCase(source.getIsRegion())).collect(Collectors.toList());
String synMsg = riskSourceService.synToEquipManage(getAppKey(), getProduct(), getToken(), SUCCESS, getRiskSourcesTree(riskSources)); String synMsg = riskSourceService.synToEquipManage(getAppKey(), getProduct(), getToken(), SUCCESS, getRiskSourcesTree(riskSources));
if (synMsg != null) { if (synMsg != null) {
return CommonResponseUtil.failure(synMsg); return CommonResponseUtil.failure(synMsg);
} }
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
/** /**
* 获取区域树型结构 * 获取区域树型结构
* *
...@@ -149,12 +153,12 @@ public class RiskSourceController extends BaseController { ...@@ -149,12 +153,12 @@ public class RiskSourceController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取区域树型结构", notes = "获取区域树型结构") @ApiOperation(httpMethod = "GET", value = "获取区域树型结构", notes = "获取区域树型结构")
@RequestMapping(value = "/regionTress", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/regionTress", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse getRegionTress() { public CommonResponse getRegionTress() {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String compCode=getOrgCode(reginParams); String compCode = getOrgCode(reginParams);
List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(compCode); List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(compCode);
return CommonResponseUtil.success(getRegionTree(riskSources)); return CommonResponseUtil.success(getRegionTree(riskSources));
} }
@Permission @Permission
//@Authorization(ingore = true) //@Authorization(ingore = true)
@ApiOperation(httpMethod = "GET", value = "统计级别为1的风险点下面", notes = "获取风险点树型结构") @ApiOperation(httpMethod = "GET", value = "统计级别为1的风险点下面", notes = "获取风险点树型结构")
...@@ -184,8 +188,8 @@ public class RiskSourceController extends BaseController { ...@@ -184,8 +188,8 @@ 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 {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String compCode=getOrgCode(reginParams); String compCode = getOrgCode(reginParams);
List<RiskSourceTreeResponse> riskSources = riskSourceService.findRiskSourceTrees(compCode); 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));
...@@ -322,7 +326,7 @@ public class RiskSourceController extends BaseController { ...@@ -322,7 +326,7 @@ public class RiskSourceController extends BaseController {
} }
@Permission @Permission
// @Authorization(ingore = true) // @Authorization(ingore = true)
@ApiOperation(httpMethod = "GET", value = "统计级别为1的风险点下面设备统计", notes = "统计级别为1的风险点下面设备统计") @ApiOperation(httpMethod = "GET", value = "统计级别为1的风险点下面设备统计", notes = "统计级别为1的风险点下面设备统计")
@RequestMapping(value = "/equipStatistics/{type}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/equipStatistics/{type}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse equipStatistics(@PathVariable(value = "type", required = true) String[] type) throws Exception { public CommonResponse equipStatistics(@PathVariable(value = "type", required = true) String[] type) throws Exception {
...@@ -525,7 +529,7 @@ public class RiskSourceController extends BaseController { ...@@ -525,7 +529,7 @@ public class RiskSourceController extends BaseController {
} }
return treeList; return treeList;
} }
private static List<RiskSourceTreeResponse> getRegionTree(List<RiskSourceTreeResponse> list) { private static List<RiskSourceTreeResponse> getRegionTree(List<RiskSourceTreeResponse> list) {
List<RiskSourceTreeResponse> treeList = new ArrayList<RiskSourceTreeResponse>(); List<RiskSourceTreeResponse> treeList = new ArrayList<RiskSourceTreeResponse>();
for (RiskSourceTreeResponse tree : list) { for (RiskSourceTreeResponse tree : list) {
...@@ -554,7 +558,7 @@ public class RiskSourceController extends BaseController { ...@@ -554,7 +558,7 @@ public class RiskSourceController extends BaseController {
@ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber, @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
@ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) { @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
try { try {
Page<Map<String, Object>> list = riskSourceService.listFmeaPointInputitem(getToken(),getProduct(),getAppKey(),fmeaId, pageNumber, pageSize); Page<Map<String, Object>> list = riskSourceService.listFmeaPointInputitem(getToken(), getProduct(), getAppKey(), fmeaId, pageNumber, pageSize);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
...@@ -632,15 +636,15 @@ public class RiskSourceController extends BaseController { ...@@ -632,15 +636,15 @@ public class RiskSourceController extends BaseController {
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
// @Permission // @Permission
// @Authorization(ingore = true) // @Authorization(ingore = true)
@ApiOperation(httpMethod = "PUT", value = "上传巡检数据", notes = "上传巡检数据") @ApiOperation(httpMethod = "PUT", value = "上传巡检数据", notes = "上传巡检数据")
@RequestMapping(value = "/data/patroldata", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT) @RequestMapping(value = "/data/patroldata", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
public CommonResponse postPatrolData(@RequestBody ProtalDataRo protalData) throws Exception { public CommonResponse postPatrolData(@RequestBody ProtalDataRo protalData) throws Exception {
log.info("上传巡检数据" + JSONObject.toJSONString(protalData)); log.info("上传巡检数据" + JSONObject.toJSONString(protalData));
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String compCode=getOrgCode(reginParams); String compCode = getOrgCode(reginParams);
riskSourceService.processProtalData(getToken(),getProduct(),getAppKey(),protalData, compCode); riskSourceService.processProtalData(getToken(), getProduct(), getAppKey(), protalData, compCode);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
...@@ -714,8 +718,8 @@ public class RiskSourceController extends BaseController { ...@@ -714,8 +718,8 @@ 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() {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String compCode=getOrgCode(reginParams); String compCode = getOrgCode(reginParams);
return CommonResponseUtil.success(riskSourceService.queryRiskSourceSecondLevel(compCode)); return CommonResponseUtil.success(riskSourceService.queryRiskSourceSecondLevel(compCode));
} }
......
...@@ -44,7 +44,7 @@ public class SafetyController extends BaseController{ ...@@ -44,7 +44,7 @@ public class SafetyController extends BaseController{
@PostMapping(value = "/save/curCompany") @PostMapping(value = "/save/curCompany")
public CommonResponse saveCurCompany(@RequestBody ReginParams reginParams) { public CommonResponse saveCurCompany(@RequestBody ReginParams reginParams) {
this.saveSelectedOrgInfo(reginParams); this.saveSelectedOrgInfo(reginParams);
equipmentHandlerService.subscribeTopic(reginParams); equipmentHandlerService.subscribeTopic();
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
......
...@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
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;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -224,6 +225,20 @@ public class View3dController extends BaseController { ...@@ -224,6 +225,20 @@ public class View3dController extends BaseController {
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
/**
* 二级区域风险等级,风险值
*
* @return
*/
@Permission
@ApiOperation(httpMethod = "GET", value = "二级区域风险等级,风险值", notes = "二级区域风险等级,风险值")
@RequestMapping(value = "/secondLevelRiskSource", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryRiskSourceSecondLevel() {
ReginParams reginParams = getSelectedOrgInfo();
String compCode = getOrgCode(reginParams);
return CommonResponseUtil.success(riskSourceService.queryRiskSourceSecondLevel(compCode));
}
/** /**
* <pre> * <pre>
* 初始化三维视图节点 * 初始化三维视图节点
......
...@@ -25,7 +25,6 @@ import com.yeejoin.amos.fas.business.action.ContingencyAction; ...@@ -25,7 +25,6 @@ import com.yeejoin.amos.fas.business.action.ContingencyAction;
import com.yeejoin.amos.fas.business.action.model.ContingencyEvent; import com.yeejoin.amos.fas.business.action.model.ContingencyEvent;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo; import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.model.SetpEnum; import com.yeejoin.amos.fas.business.action.model.SetpEnum;
import com.yeejoin.amos.fas.business.action.mq.StationEnum;
import com.yeejoin.amos.fas.business.action.util.ContingencyLogPublisher; import com.yeejoin.amos.fas.business.action.util.ContingencyLogPublisher;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper; import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper; import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper;
...@@ -66,6 +65,10 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla ...@@ -66,6 +65,10 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
@Autowired @Autowired
private IContingencyInstance iContingencyInstance; private IContingencyInstance iContingencyInstance;
@Value("${station.name}")
private String stationName;
private static Map<String, String> stepMap = new HashMap<>(); private static Map<String, String> stepMap = new HashMap<>();
...@@ -213,7 +216,7 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla ...@@ -213,7 +216,7 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
json.put("msgType", "message"); json.put("msgType", "message");
json.put("msgContext", msgContext); json.put("msgContext", msgContext);
event.setMsgBody(json.toJSONString()); event.setMsgBody(json.toJSONString());
String topic = String.format("/%s/%s/%s", serviceName, StationEnum.YINAN.getCode(),"plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName,"plan");
event.setTopic(topic); event.setTopic(topic);
event.setMsgType("clickEvent"); event.setMsgType("clickEvent");
event.setContingency(batchNo); event.setContingency(batchNo);
......
...@@ -117,14 +117,14 @@ public class EquipmentServiceImpl implements IEquipmentService { ...@@ -117,14 +117,14 @@ public class EquipmentServiceImpl implements IEquipmentService {
public Equipment queryOne(Long id) { public Equipment queryOne(Long id) {
Optional<Equipment> dict1=iEquipmentDao.findById(id); Optional<Equipment> dict1=iEquipmentDao.findById(id);
Equipment dict=null; Equipment dict=null;
if(dict1.isPresent()){ if(dict1.isPresent()){
dict=dict1.get(); dict=dict1.get();
} }
return dict; return dict;
} }
@Override @Override
......
package com.yeejoin.amos.fas.business.service.impl; package com.yeejoin.amos.fas.business.service.impl;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -10,12 +33,15 @@ import com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo; ...@@ -10,12 +33,15 @@ import com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo;
import com.yeejoin.amos.fas.business.action.model.SetpEnum; import com.yeejoin.amos.fas.business.action.model.SetpEnum;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe; import com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe;
import com.yeejoin.amos.fas.business.bo.JpushMsgBo; import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper;
import com.yeejoin.amos.fas.business.bo.MsgParamBo; import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.*; import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaEquipmentPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaPointInputitemMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao; import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao;
import com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao; import com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao; import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService; import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.AlarmParam; import com.yeejoin.amos.fas.business.param.AlarmParam;
...@@ -25,28 +51,21 @@ import com.yeejoin.amos.fas.business.service.intfc.IView3dService; ...@@ -25,28 +51,21 @@ import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.business.util.JexlUtil; import com.yeejoin.amos.fas.business.util.JexlUtil;
import com.yeejoin.amos.fas.business.util.RpnUtils; import com.yeejoin.amos.fas.business.util.RpnUtils;
import com.yeejoin.amos.fas.business.util.StringUtil; import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.business.vo.*; import com.yeejoin.amos.fas.business.vo.EquipmentSpecificForRiskVo;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.business.vo.Toke;
import com.yeejoin.amos.fas.business.vo.TopicEntityVo;
import com.yeejoin.amos.fas.client.invoke.RsDataQueue; import com.yeejoin.amos.fas.client.invoke.RsDataQueue;
import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum; import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum; import com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum;
import com.yeejoin.amos.fas.dao.entity.*; import com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData;
import org.apache.commons.lang3.ArrayUtils; import com.yeejoin.amos.fas.dao.entity.Equipment;
import org.slf4j.Logger; import com.yeejoin.amos.fas.dao.entity.EvaluationModel;
import org.slf4j.LoggerFactory; import com.yeejoin.amos.fas.dao.entity.Fmea;
import org.springframework.beans.BeanUtils; import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint;
import org.springframework.beans.factory.annotation.Autowired; import com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem;
import org.springframework.beans.factory.annotation.Value; import com.yeejoin.amos.fas.dao.entity.PreplanPicture;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* @author keyong * @author keyong
...@@ -118,7 +137,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -118,7 +137,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Autowired @Autowired
private FmeaMapper fmeaMapper; private FmeaMapper fmeaMapper;
@Value("${station.name}")
private String stationName;
@Value("${spring.application.name}") @Value("${spring.application.name}")
private String serviceName; private String serviceName;
...@@ -166,29 +187,43 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -166,29 +187,43 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
} else { // 向三维推送实时值修改 } else { // 向三维推送实时值修改
log.info("(监测)Message type is: " + equipmentSpecificIndex.getType()); log.info("(监测)Message type is: " + equipmentSpecificIndex.getType());
Map<String, Object> content = new HashMap<>(); Map<String, Object> content = new HashMap<>();
// content.put("id", fireEquipmentData.getId());
// content.put("label", fireEquipmentData.getEqPointName());
// content.put("changeDate", fireEquipmentData.getCreateDate());
// content.put("orgCode", fireEquipment.getOrgCode());
// content.put("status", deviceData.getSoe());
content.put("id", "id"); content.put("id", "id");
content.put("label", "eqPointName"); content.put("label", "eqPointName");
content.put("changeDate", new Date()); content.put("changeDate", new Date());
content.put("orgCode", "orgCode"); content.put("orgCode", "orgCode");
content.put("status", deviceData.getSoe()); content.put("status", deviceData.getSoe());
iDataRefreshService.sendRefreshDataWithArea(View3dRefreshAreaEum.monitor_data.getCode(), content); iDataRefreshService.sendRefreshDataWithArea(View3dRefreshAreaEum.monitor_data.getCode(), content);
String title = String.format("/%s/%s/%s", serviceName, "yinan","data/refresh/monitorData"); String title = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/monitorData");
webMqttComponent.publish(title, JSON.toJSONString(view3dService.getEquipStatusList(equipmentSpecific.getOrgCode()))); webMqttComponent.publish(title, JSON.toJSONString(view3dService.getEquipStatusList(equipmentSpecific.getOrgCode())));
} }
} }
// @Override
// public void subscribeTopic(ReginParams reginParams) {
// // 若登录系统则订阅装备数据
// webMqttSubscribe.adapter.removeTopic(defaultTopic);
// String orgCode = reginParams.getCompany().getOrgCode();
// String topic = String.format("%s.%s%s", serverName, "equipment", "/#");
// String[] strs = webMqttSubscribe.adapter.getTopic();
// List<String> list = Stream.of(strs).collect(Collectors.toList());
// if(list.size() > 0) {
// list.forEach(x -> {
// if(!(x.equals(topic))) {
// webMqttSubscribe.adapter.addTopic(topic);
// }
// });
// } else {
// webMqttSubscribe.adapter.addTopic(topic);
// }
//
// }
@Override @Override
public void subscribeTopic(ReginParams reginParams) { public void subscribeTopic() {
// 若登录系统则订阅装备数据 // 若登录系统则订阅装备数据
webMqttSubscribe.adapter.removeTopic(defaultTopic); webMqttSubscribe.adapter.removeTopic(defaultTopic);
String orgCode = reginParams.getCompany().getOrgCode(); String topic = String.format("%s.%s%s", serverName, "equipment", "/#");
String topic = String.format("%s.%s.%s%s", serverName, orgCode, "equipment", "/#");
String[] strs = webMqttSubscribe.adapter.getTopic(); String[] strs = webMqttSubscribe.adapter.getTopic();
List<String> list = Stream.of(strs).collect(Collectors.toList()); List<String> list = Stream.of(strs).collect(Collectors.toList());
if(list.size() > 0) { if(list.size() > 0) {
......
...@@ -28,6 +28,8 @@ import org.springframework.stereotype.Service; ...@@ -28,6 +28,8 @@ 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 org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
...@@ -56,6 +58,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService; ...@@ -56,6 +58,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService; import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.business.vo.ErrorContentVo; import com.yeejoin.amos.fas.business.vo.ErrorContentVo;
import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo; import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo; import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo;
import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo; import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo;
import com.yeejoin.amos.fas.business.vo.View3dNodeVo; import com.yeejoin.amos.fas.business.vo.View3dNodeVo;
...@@ -67,6 +70,7 @@ import com.yeejoin.amos.fas.common.enums.RiskSourceLevelEum; ...@@ -67,6 +70,7 @@ import com.yeejoin.amos.fas.common.enums.RiskSourceLevelEum;
import com.yeejoin.amos.fas.common.enums.RiskSourceRegionEum; import com.yeejoin.amos.fas.common.enums.RiskSourceRegionEum;
import com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum; import com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum;
import com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum; import com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum;
import com.yeejoin.amos.fas.config.Permission;
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.request.DateUtil; import com.yeejoin.amos.fas.core.common.request.DateUtil;
import com.yeejoin.amos.fas.core.common.response.CoordDTO; import com.yeejoin.amos.fas.core.common.response.CoordDTO;
...@@ -85,6 +89,8 @@ import com.yeejoin.amos.fas.dao.entity.SafetyIndexChangeLog; ...@@ -85,6 +89,8 @@ import com.yeejoin.amos.fas.dao.entity.SafetyIndexChangeLog;
import com.yeejoin.amos.fas.dao.entity.WaterResource; import com.yeejoin.amos.fas.dao.entity.WaterResource;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import io.swagger.annotations.ApiOperation;
/** /**
* @author DELL * @author DELL
*/ */
...@@ -343,6 +349,8 @@ public class View3dServiceImpl implements IView3dService { ...@@ -343,6 +349,8 @@ public class View3dServiceImpl implements IView3dService {
} }
return vo; return vo;
} }
@Override @Override
public List<SafetyIndexDetailVo> getSafetyIndexDetail(String type,String orgCode) { public List<SafetyIndexDetailVo> getSafetyIndexDetail(String type,String orgCode) {
......
...@@ -12,5 +12,8 @@ import com.yeejoin.amos.fas.business.vo.ReginParams; ...@@ -12,5 +12,8 @@ import com.yeejoin.amos.fas.business.vo.ReginParams;
*/ */
public interface IEquipmentHandlerService { public interface IEquipmentHandlerService {
void handlerMqttMessage(String topic, String message); void handlerMqttMessage(String topic, String message);
void subscribeTopic(ReginParams reginParams);
// void subscribeTopic(ReginParams reginParams);
void subscribeTopic();
} }
...@@ -78,44 +78,43 @@ public class PermissionAspect { ...@@ -78,44 +78,43 @@ public class PermissionAspect {
if (joinPoint.getSignature().getName().equals("saveCurCompany")) { if (joinPoint.getSignature().getName().equals("saveCurCompany")) {
return; return;
} }
// FeignClientResult feignClientResult; FeignClientResult feignClientResult;
// AgencyUserModel userModel=null; AgencyUserModel userModel=null;
// try { try {
// feignClientResult = Privilege.agencyUserClient.getme(); feignClientResult = Privilege.agencyUserClient.getme();
// userModel = (AgencyUserModel) feignClientResult.getResult(); userModel = (AgencyUserModel) feignClientResult.getResult();
//
// } catch (InnerInvokException e) { } catch (InnerInvokException e) {
// e.printStackTrace(); e.printStackTrace();
// } }
// String userId = null; String userId = null;
// ReginParams regionParam = new ReginParams(); ReginParams regionParam = new ReginParams();
// if(userModel != null){ if(userModel != null){
// userId = userModel.getUserId(); userId = userModel.getUserId();
// Map<Long, List<RoleModel>> orgRoles = userModel.getOrgRoles(); ReginParams reginParams = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(userModel.getUserId(), token)), ReginParams.class);
// List<RoleModel> roleModels = null; if(reginParams == null && userModel.getCompanys().size() > 0){
// if(!ObjectUtils.isEmpty(orgRoles)) { CompanyModel companyModel = userModel.getCompanys().get(0);
// for (Map.Entry<Long, List<RoleModel>> entry : orgRoles.entrySet()) { List<DepartmentModel> deptList = remoteSecurityService.getDepartmentTreeByCompanyId(token, product, appKey, companyModel.getSequenceNbr().toString());
// roleModels = entry.getValue(); if(deptList.size() > 0){
// break; CompanyBo companyBo = convertCompanyModelToBo(companyModel);
// } DepartmentBo departmentBo = convertDepartmentModelToBo(deptList.get(0));
// } regionParam.setCompany(companyBo);
// ReginParams reginParams = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(userModel.getUserId(), token)), ReginParams.class); regionParam.setDepartment(departmentBo);
// if(reginParams == null && userModel.getCompanys().size() > 0){ }
// CompanyModel companyModel = userModel.getCompanys().get(0); Map<Long, List<RoleModel>> orgRoles = userModel.getOrgRoles();
// List<RoleModel> roleModels = null;
// List<DepartmentModel> deptList = remoteSecurityService.getDepartmentTreeByCompanyId(token, product, appKey, companyModel.getSequenceNbr().toString()); if(!ObjectUtils.isEmpty(orgRoles)) {
// if(deptList.size() > 0){ for (Map.Entry<Long, List<RoleModel>> entry : orgRoles.entrySet()) {
// CompanyBo companyBo = convertCompanyModelToBo(companyModel); roleModels = entry.getValue();
// DepartmentBo departmentBo = convertDepartmentModelToBo(deptList.get(0)); break;
// regionParam.setCompany(companyBo); }
// regionParam.setDepartment(departmentBo); }
// } if(!ObjectUtils.isEmpty(roleModels)){
// if(!ObjectUtils.isEmpty(roleModels)){ regionParam.setRole(convertRoleModelToBo(roleModels.get(0)));
// regionParam.setRole(convertRoleModelToBo(roleModels.get(0))); }
// } redisTemplate.opsForValue().set(buildKey(userId, token), JSONObject.toJSONString(regionParam));
// redisTemplate.opsForValue().set(buildKey(userId, token), JSONObject.toJSONString(regionParam)); }
// } }
// }
} }
private DepartmentBo convertDepartmentModelToBo(DepartmentModel departmentModel){ private DepartmentBo convertDepartmentModelToBo(DepartmentModel departmentModel){
......
...@@ -71,4 +71,8 @@ amos.feign.gennerator.use-gateway=true ...@@ -71,4 +71,8 @@ amos.feign.gennerator.use-gateway=true
autoSys.push.type=mqtt autoSys.push.type=mqtt
#����� #�����
file.downLoad.url=http://172.16.10.175:8888/ file.downLoad.url=http://39.98.246.31:8888/
#站端名称使用全拼
station.name = yinan
spring.application.name = AMOS-AUTOSYS spring.application.name = AMOS-AUTOSYS
server.port = 8083 server.port = 8083
spring.profiles.active=dev spring.profiles.active=dev
#spring.freemarker.cache=false #spring.freemarker.cache=false
...@@ -61,4 +59,6 @@ param.safetyIndexChange.cron = 0 0 2 * * ? ...@@ -61,4 +59,6 @@ param.safetyIndexChange.cron = 0 0 2 * * ?
param.weather.url = http://wthrcdn.etouch.cn/weather_mini?citykey= param.weather.url = http://wthrcdn.etouch.cn/weather_mini?citykey=
#站端名称使用全拼
station.name = yinan
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper"> <mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper">
<!--查询--> <!--查询 0-设备类;1-耗材类;2-视频监控;3-灭火器材'-->
<select id="getResourceListByType" resultType="java.util.HashMap"> <select id="getResourceListByType" resultType="java.util.HashMap">
SELECT SELECT
rs.id as `key` , rs.id as `key` ,
rs.id AS `value`, rs.id AS `value`,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.AlarmMapper"> <mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.AlarmMapper">
<!----> <!---->
<select id="countPageData" resultType="long"> <select id="countPageData" resultType="long">
SELECT <!-- SELECT
count(a.id) AS total_num count(a.id) AS total_num
FROM `f_alarm` a FROM `f_alarm` a
inner join inner join
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null"> and a.alarm_time >= #{beginDate} </if> <if test="beginDate!=null"> and a.alarm_time >= #{beginDate} </if>
<if test="endDate!=null"> and a.alarm_time <![CDATA[<=]]> #{endDate} </if> <if test="endDate!=null"> and a.alarm_time <![CDATA[<=]]> #{endDate} </if>
</trim> </trim> -->
</select> </select>
<select id="countAlarmData" resultType="long"> <select id="countAlarmData" resultType="long">
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</select> </select>
<!--分页查询 --> <!--分页查询 -->
<select id="getAlarmMapperPage" resultType="java.util.HashMap"> <select id="getAlarmMapperPage" resultType="java.util.HashMap">
SELECT <!-- SELECT
a.id, a.id,
sa.code, sa.code,
sa.equip_code as equipCode, sa.equip_code as equipCode,
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose> -->
</select> </select>
......
...@@ -58,20 +58,26 @@ ...@@ -58,20 +58,26 @@
</select> </select>
<select id="getEquipmentBySpeCount" resultType="int"> <select id="getEquipmentBySpeCount" resultType="int">
select select
count(1) count(1)
from from
wl_stock_detail as sto wl_stock_detail as sto
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code
left join wl_equipment as equ on det.equipment_id = equ.id left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware .id
left join wl_equipment_category as cate on equ.category_id = cate.id left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
where sto.amount <![CDATA[>]]> 0 left join wl_equipment as equ on det.equipment_id = equ.id
<if test="name != null and name!='null' "> left join wl_equipment_category as cate on equ.category_id = cate.id
and det.name like CONCAT('%',#{name},'%' ) left join f_equipment_fire_equipment as fire on sto.id = fire.fire_equipment_id
</if> where sto.amount <![CDATA[>]]> 0
<if test="code != null and code!='null' "> <if test="name != null and name!='null' ">
and cate.code like CONCAT('%',#{code},'%' ) and det.name like CONCAT('%',#{name},'%' )
</if> </if>
<if test="code != null and code!='null' ">
and cate.code like CONCAT('%',#{code},'%' )
</if>
<if test="equipmentId != null and equipmentId!='null' ">
and fire.equipment_id = #{equipmentId}
</if>
</select> </select>
<select id="getFireEquiments" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpeVo"> <select id="getFireEquiments" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpeVo">
select select
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<select id="queryForFireEquipmentHistoryCount" resultType="long"> <select id="queryForFireEquipmentHistoryCount" resultType="long">
SELECT SELECT
count(1) count(1)
FROM FROM
( (
...@@ -221,7 +221,6 @@ ...@@ -221,7 +221,6 @@
ORDER BY d.create_date desc ORDER BY d.create_date desc
LIMIT ${start},${length} LIMIT ${start},${length}
</select> </select>
...@@ -359,7 +358,7 @@ ...@@ -359,7 +358,7 @@
f_fire_equipment_point p f_fire_equipment_point p
LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id
LEFT JOIN f_dict d on d.id = p.alarm_type LEFT JOIN f_dict d on d.id = p.alarm_type
where p.`code` = #{code} where p.`code` = #{code}
</select> </select>
<select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity"> <select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity">
...@@ -432,7 +431,7 @@ ...@@ -432,7 +431,7 @@
#{item.weight}, #{item.weight},
#{item.riskSourceId} #{item.riskSourceId}
) )
</foreach> </foreach>
</insert> </insert>
<update id="updateBatch"> <update id="updateBatch">
...@@ -517,7 +516,7 @@ ...@@ -517,7 +516,7 @@
count(1) count(1)
FROM FROM
f_equipment_fire_equipment efe f_equipment_fire_equipment efe
JOIN f_fire_equipment fe ON efe.fire_equipment_id = fe.id JOIN wl_equipment_specific fe ON efe.fire_equipment_id = fe.id
WHERE WHERE
efe.equipment_id = ${equipmentId} efe.equipment_id = ${equipmentId}
<if test="fname != null"> <if test="fname != null">
...@@ -531,7 +530,7 @@ ...@@ -531,7 +530,7 @@
<select id="removeIfmeaPointByFireEquipIdAndEquipId" resultType="long"> <select id="removeIfmeaPointByFireEquipIdAndEquipId" resultType="long">
DELETE fmep FROM `f_fmea_equipment_point` fmep DELETE fmep FROM `f_fmea_equipment_point` fmep
LEFT JOIN f_fire_equipment_point fep ON fep.id = fmep.equipment_point_id LEFT JOIN wl_equipment_specific_index esi ON esi.id = fmep.equipment_point_id
WHERE fep.fire_equipment_id = #{fireEquipmentId} AND fmep.important_equipment_id = #{importantEquipmentId} WHERE esi.equipment_specific_id = #{fireEquipmentId} AND fmep.important_equipment_id = #{importantEquipmentId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,30 +6,30 @@ ...@@ -6,30 +6,30 @@
<select id="queryOne" resultType="java.util.Map"> <select id="queryOne" resultType="java.util.Map">
select * from f_fire_equipment_point where id = ${id} <!-- select * from f_fire_equipment_point where id = ${id} -->
</select> </select>
<select id="queryCountForPage" resultType="long"> <select id="queryCountForPage" resultType="long">
select count(1) from f_fire_equipment_point <!-- select count(1) from f_fire_equipment_point
where fire_equipment_id = ${fireEqumntId} where fire_equipment_id = ${fireEqumntId}
<if test="name!=null"> <if test="name!=null">
and fp.name like '%${name}%' and fp.name like '%${name}%'
</if> </if> -->
</select> </select>
<select id="queryForPage" resultType="java.util.Map"> <select id="queryForPage" resultType="java.util.Map">
select * from f_fire_equipment_point fp <!-- select * from f_fire_equipment_point fp
where fp.fire_equipment_id = ${fireEqumntId} where fp.fire_equipment_id = ${fireEqumntId}
<if test="name!=null"> <if test="name!=null">
and fp.name like '%${name}%' and fp.name like '%${name}%'
</if> </if>
LIMIT ${start},${length} ; LIMIT ${start},${length} ; -->
</select> </select>
<select id="queryForEqueAndPointName" resultType="map"> <select id="queryForEqueAndPointName" resultType="map">
SELECT <!-- SELECT
ep.`name`, ep.`name`,
( (
SELECT SELECT
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
AND se.risk_source_id = ${riskSourceId} AND se.risk_source_id = ${riskSourceId}
) )
AND ep.type = 'SWITCH' AND ep.type = 'SWITCH'
AND ep.`value` = 1 AND ep.`value` = 1 -->
</select> </select>
<select id="queryStopCountByEuipmentIdAndAlarmType" resultType="int"> <select id="queryStopCountByEuipmentIdAndAlarmType" resultType="int">
SELECT <!-- SELECT
count(1) count(1)
FROM FROM
f_equipment e, f_equipment e,
...@@ -70,11 +70,11 @@ ...@@ -70,11 +70,11 @@
and d.id = ep.alarm_type and d.id = ep.alarm_type
AND d.dict_value = #{alarmType} AND d.dict_value = #{alarmType}
AND e.id = #{equimentId} AND e.id = #{equimentId}
AND ep.`value` = #{value} AND ep.`value` = #{value} -->
</select> </select>
<select id="queryCountByEuipmentIdAndAlarmType" resultType="int"> <select id="queryCountByEuipmentIdAndAlarmType" resultType="int">
SELECT <!-- SELECT
count(1) count(1)
FROM FROM
f_equipment e, f_equipment e,
...@@ -86,17 +86,17 @@ ...@@ -86,17 +86,17 @@
AND fe.fire_equipment_id = ep.fire_equipment_id AND fe.fire_equipment_id = ep.fire_equipment_id
and d.id = ep.alarm_type and d.id = ep.alarm_type
AND d.dict_value = #{alarmType} AND d.dict_value = #{alarmType}
AND e.id = #{equimentId} AND e.id = #{equimentId}-->
</select> </select>
<update id="updateValue"> <update id="updateValue">
update f_fire_equipment_point set value = #{state},create_date = NOW() where id = #{id} <!-- update f_fire_equipment_point set value = #{state},create_date = NOW() where id = #{id} -->
</update> </update>
<insert id="saveBatch" keyColumn="id" keyProperty="id" <insert id="saveBatch" keyColumn="id" keyProperty="id"
parameterType="com.yeejoin.amos.fas.business.param.FireEquipmentPointParam" parameterType="com.yeejoin.amos.fas.business.param.FireEquipmentPointParam"
useGeneratedKeys="true"> useGeneratedKeys="true">
insert into f_fire_equipment_point <!-- insert into f_fire_equipment_point
( (
name, name,
code, code,
...@@ -119,11 +119,11 @@ ...@@ -119,11 +119,11 @@
#{item.orgCode}, #{item.orgCode},
#{item.createBy} #{item.createBy}
) )
</foreach> </foreach>-->
</insert> </insert>
<select id="listByMap" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <select id="listByMap" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
select <!-- select
a.id, a.id,
a.name, a.name,
a.code, a.code,
...@@ -159,11 +159,11 @@ ...@@ -159,11 +159,11 @@
order by a.create_date desc order by a.create_date desc
<if test="pageSize!=null and pageSize!=-1 and offset!=null"> <if test="pageSize!=null and pageSize!=-1 and offset!=null">
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</if> </if> -->
</select> </select>
<select id="countByMap" resultType="long"> <select id="countByMap" resultType="long">
select <!-- select
count(1) count(1)
from from
f_fire_equipment_point as a f_fire_equipment_point as a
...@@ -178,11 +178,11 @@ ...@@ -178,11 +178,11 @@
<if test="type!=null and type.trim() != ''"> <if test="type!=null and type.trim() != ''">
and a.type = #{type} and a.type = #{type}
</if> </if>
</where> </where> -->
</select> </select>
<select id="getByCode" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <select id="getByCode" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
select <!-- select
id, id,
name, name,
code, code,
...@@ -199,11 +199,11 @@ ...@@ -199,11 +199,11 @@
f_fire_equipment_point f_fire_equipment_point
where where
code = #{code} code = #{code}
limit 1 limit 1 -->
</select> </select>
<update id="updateBatch"> <update id="updateBatch">
<foreach collection="list" item="item" index="index" separator=";"> <!-- <foreach collection="list" item="item" index="index" separator=";">
update f_fire_equipment_point update f_fire_equipment_point
<set> <set>
<if test="item.name != null"> <if test="item.name != null">
...@@ -241,11 +241,11 @@ ...@@ -241,11 +241,11 @@
</if> </if>
</set> </set>
where id = #{item.id} where id = #{item.id}
</foreach> </foreach> -->
</update> </update>
<select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
select <!-- select
id, id,
name, name,
code, code,
...@@ -264,11 +264,11 @@ ...@@ -264,11 +264,11 @@
code in code in
<foreach collection="codes" item="item" index="index" open="(" separator="," close=")"> <foreach collection="codes" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach> -->
</select> </select>
<select id="getById" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <select id="getById" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
select <!-- select
id, id,
name, name,
code, code,
...@@ -285,11 +285,11 @@ ...@@ -285,11 +285,11 @@
f_fire_equipment_point f_fire_equipment_point
where where
id = #{id} id = #{id}
limit 1 limit 1 -->
</select> </select>
<select id="countBindByIds" resultType="java.lang.Long"> <select id="countBindByIds" resultType="java.lang.Long">
select <!-- select
count(1) count(1)
from from
f_fire_equipment_point f_fire_equipment_point
...@@ -299,23 +299,23 @@ ...@@ -299,23 +299,23 @@
#{item} #{item}
</foreach> </foreach>
and and
fire_equipment_id > 0 fire_equipment_id > 0 -->
</select> </select>
<update id="updatefireEquipmentIdByIds"> <update id="updatefireEquipmentIdByIds">
update <!-- update
f_fire_equipment_point f_fire_equipment_point
set set
fire_equipment_id = #{fireEquipmentId} fire_equipment_id = #{fireEquipmentId}
where id in where id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")"> <foreach collection="ids" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach> -->
</update> </update>
<insert id="save" keyColumn="id" keyProperty="id" parameterType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity" <insert id="save" keyColumn="id" keyProperty="id" parameterType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"
useGeneratedKeys="true"> useGeneratedKeys="true">
insert into f_fire_equipment_point <!-- insert into f_fire_equipment_point
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null"> <if test="name != null">
name, name,
...@@ -385,11 +385,11 @@ ...@@ -385,11 +385,11 @@
<if test="alarmType != null"> <if test="alarmType != null">
#{alarmType}, #{alarmType},
</if> </if>
</trim> </trim> -->
</insert> </insert>
<update id="update" parameterType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <update id="update" parameterType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
update f_fire_equipment_point <!-- update f_fire_equipment_point
<set> <set>
<if test="name != null"> <if test="name != null">
name = #{name}, name = #{name},
...@@ -425,25 +425,25 @@ ...@@ -425,25 +425,25 @@
alarm_type = #{alarmType}, alarm_type = #{alarmType},
</if> </if>
</set> </set>
where id = #{id} where id = #{id} -->
</update> </update>
<delete id="deleteBatchByIds"> <delete id="deleteBatchByIds">
delete from f_fire_equipment_point <!-- delete from f_fire_equipment_point
where where
id in id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")"> <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach> -->
</delete> </delete>
<select id="getPointsByEquipmentIdAndType" resultType="Map"> <select id="getPointsByEquipmentIdAndType" resultType="Map">
SELECT p.* from <!-- SELECT p.* from
f_fire_equipment_point p f_fire_equipment_point p
LEFT JOIN f_fire_equipment fe on p.fire_equipment_id = fe.id LEFT JOIN f_fire_equipment fe on p.fire_equipment_id = fe.id
LEFT JOIN f_equipment_fire_equipment e on fe.id = e.fire_equipment_id LEFT JOIN f_equipment_fire_equipment e on fe.id = e.fire_equipment_id
where e.equipment_id = #{id} where e.equipment_id = #{id}
and p.type = #{type} and p.type = #{type} -->
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -50,14 +50,14 @@ ...@@ -50,14 +50,14 @@
select select
c.fmea_id as fmeaId c.fmea_id as fmeaId
from from
f_fire_equipment as a wl_equipment_specific as a
left join left join
f_fire_equipment_point as b on b.fire_equipment_id = a.id wl_equipment_specific_index as b on b.equipment_specific_id = a.id
left join left join
f_fmea_equipment_point as c on c.equipment_point_id = b.id f_fmea_equipment_point as c on c.equipment_point_id = b.id
where where
c.fmea_id = #{fmeaId} c.fmea_id = #{fmeaId}
group by b.fire_equipment_id group by b.equipment_specific_id
) as d ) as d
</select> </select>
...@@ -65,21 +65,25 @@ ...@@ -65,21 +65,25 @@
select select
c.fmea_id as fmeaId, c.fmea_id as fmeaId,
a.id as equipmentId, a.id as equipmentId,
group_concat(concat( b.NAME, '##', c.state ) SEPARATOR <![CDATA[ '\n' ]]> ) as equipmentPointNames, group_concat(concat( ei.name, '##', c.state ) SEPARATOR <![CDATA[ '\n' ]]> ) as equipmentPointNames,
a.name as equipmentName, ed.name as equipmentName,
a.code as equipmentCode, a.code as equipmentCode,
d.name AS importantEquipName, d.name AS importantEquipName,
d.id AS importantEquipId d.id AS importantEquipId
from from
f_fire_equipment as a wl_equipment_specific as a
left join left join
f_fire_equipment_point as b on b.fire_equipment_id = a.id wl_equipment_detail as ed on ed.id = a.equipment_detail_id
left join
wl_equipment_specific_index as b on b.equipment_specific_id = a.id
left join
wl_equipment_index as ei on b.equipment_index_id = ei.id
left join left join
f_fmea_equipment_point as c on c.equipment_point_id = b.id f_fmea_equipment_point as c on c.equipment_point_id = b.id
LEFT JOIN f_equipment AS d ON d.id = c.important_equipment_id LEFT JOIN f_equipment AS d ON d.id = c.important_equipment_id
where where
c.fmea_id = #{fmeaId} c.fmea_id = #{fmeaId}
group by b.fire_equipment_id,c.important_equipment_id group by b.equipment_specific_id,c.important_equipment_id
limit #{offset},#{limit} limit #{offset},#{limit}
</select> </select>
...@@ -87,13 +91,13 @@ ...@@ -87,13 +91,13 @@
select select
count(1) count(1)
from from
f_fire_equipment_point as a wl_equipment_specific_index as a
where where
a.fire_equipment_id = #{equipmentId} a.equipment_specific_id = #{equipmentId}
</select> </select>
<select id="listEquipmentPointIdsByEquipmentId" resultType="java.lang.Long"> <select id="listEquipmentPointIdsByEquipmentId" resultType="java.lang.Long">
select id from f_fire_equipment_point where fire_equipment_id = #{equipmentId} select id from wl_equipment_specific_index where equipment_specific_id = #{equipmentId}
</select> </select>
<select id="listByEquipmentPointId" resultType="com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint"> <select id="listByEquipmentPointId" resultType="com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint">
...@@ -108,8 +112,8 @@ ...@@ -108,8 +112,8 @@
<select id="listEquipmentPoint" resultType="java.util.Map"> <select id="listEquipmentPoint" resultType="java.util.Map">
select select
a.id, a.id,
a.name, ei.name,
a.code, ei.name_key as code,
( (
select select
case when count(1) > 0 then 'bound' else 'noBound' end case when count(1) > 0 then 'bound' else 'noBound' end
...@@ -123,15 +127,15 @@ ...@@ -123,15 +127,15 @@
d.important_equipment_id = #{importantEquipId} d.important_equipment_id = #{importantEquipId}
) isBound ) isBound
from from
f_fire_equipment_point as a wl_equipment_specific_index as a
left join f_dict fd on fd.id = a.alarm_type left join wl_equipment_index ei on ei.id = a.equipment_index_id
<where> <where>
fd.dict_value = 'alarm_type_trouble' ei.type_code = 'BREAKDOWN'
<if test="equipmentId!=null"> <if test="equipmentId!=null">
and a.fire_equipment_id = #{equipmentId} and a.equipment_specific_id = #{equipmentId}
</if> </if>
<if test="equipmentPointName!=null and equipmentPointName!=''"> <if test="equipmentPointName!=null and equipmentPointName!=''">
and a.name like concat("%",#{equipmentPointName},"%") and ei.name like concat("%",#{equipmentPointName},"%")
</if> </if>
</where> </where>
</select> </select>
......
...@@ -149,12 +149,11 @@ ...@@ -149,12 +149,11 @@
SELECT SELECT
1 1
FROM FROM
f_fire_equipment_point ep wl_equipment_specific_index ep
LEFT JOIN f_fire_equipment e ON e.id = ep.fire_equipment_id LEFT JOIN wl_equipment_specific e ON e.id = ep.equipment_specific_id
LEFT JOIN f_equipment_fire_equipment fe ON fe.fire_equipment_id = e.id LEFT JOIN f_equipment_fire_equipment fe ON fe.fire_equipment_id = e.id
LEFT JOIN f_dict d on ep.alarm_type = d.id LEFT JOIN wl_equipment_index ei on ei.id = ep.equipment_index_id
where d.dict_code = 'fire_equipment_switch' where ei.type_code = 'FIREALARM'
and d.dict_value = 'alarm_type_fire'
and fe.equipment_id = #{equipmentId} and fe.equipment_id = #{equipmentId}
and ep.id = #{pointId} and ep.id = #{pointId}
</select> </select>
......
...@@ -570,12 +570,14 @@ ...@@ -570,12 +570,14 @@
<select id="queryForFmeaEquipAlarm" resultType="map"> <select id="queryForFmeaEquipAlarm" resultType="map">
SELECT SELECT
fe.`name` as 'fireEquipmentName', ed.`name` as 'fireEquipmentName',
fep.`name` as 'name' ei.`name` as 'name'
FROM FROM
`f_fmea_equipment_point` AS fmep `f_fmea_equipment_point` AS fmep
LEFT JOIN f_fire_equipment_point fep ON fep.id = fmep.equipment_point_id LEFT JOIN wl_equipment_specific_index fep ON fep.id = fmep.equipment_point_id
LEFT JOIN f_fire_equipment fe ON fe.id = fep.fire_equipment_id LEFT JOIN wl_equipment_index ei ON ei.id = fep.equipment_index_id
LEFT JOIN wl_equipment_specific fe ON fe.id = fep.equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = fe.equipment_detail_id
LEFT JOIN f_fmea fm ON fm.id = fmep.fmea_id LEFT JOIN f_fmea fm ON fm.id = fmep.fmea_id
WHERE WHERE
fmep.state = 1 fmep.state = 1
...@@ -597,7 +599,7 @@ ...@@ -597,7 +599,7 @@
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.parent_id &gt; 0 WHERE rs.parent_id &gt; 0
order by rs.id order by rs.sort_num,rs.id
</select> </select>
<select id="queryByFactor" resultType="com.yeejoin.amos.fas.dao.entity.RiskSource"> <select id="queryByFactor" resultType="com.yeejoin.amos.fas.dao.entity.RiskSource">
SELECT SELECT
...@@ -620,9 +622,12 @@ ...@@ -620,9 +622,12 @@
SELECT SELECT
rs.id, rs.id,
rs.`code`, rs.`code`,
rs.`name` rs.`name`,
rl.`level`,
rs.rpn
FROM FROM
`f_risk_source` rs `f_risk_source` rs
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
WHERE WHERE
rs.parent_id = ( rs.parent_id = (
SELECT SELECT
...@@ -632,12 +637,12 @@ ...@@ -632,12 +637,12 @@
WHERE WHERE
parent_id = 0 and org_code = #{compCode} parent_id = 0 and org_code = #{compCode}
) )
ORDER BY sort_num ASC,id DESC ORDER BY sort_num,id
</select> </select>
<select id="queryContingencyWater" resultType="java.util.HashMap"> <select id="queryContingencyWater" resultType="java.util.HashMap">
SELECT <!-- SELECT
wr.alarm_level, wr.alarm_level,
wr.max_level, wr.max_level,
wr.area, wr.area,
...@@ -654,7 +659,7 @@ ...@@ -654,7 +659,7 @@
wr.alarm_level, wr.alarm_level,
wr.max_level, wr.max_level,
wr.area, wr.area,
wr.`name` wr.`name` -->
</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