Commit 9e592a48 authored by suhuiguang's avatar suhuiguang

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

# Conflicts: # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
parents 76128b63 28409f79
package com.yeejoin.amos.fas.dao.entity;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
/**
*
* <pre>
* 消息实体
* </pre>
*
* @author HK
* @version $Id: Message.java, v 0.1 2018年1月18日 下午7:48:58 HK Exp $
*/
@Entity
@Table(name = "toip_sys_message")
public class Message extends BusinessEntity
{
/**
* <pre>
*
* </pre>
*/
private static final long serialVersionUID = 292329658525267887L;
/**
* id
*/
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid2")
@Column(name = "id", nullable = false, length = 36)
protected String id;
/**
* 时间
*/
private Date time;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 类型
*/
private String type;
/**
* 发送者
*/
private String sender;
/**
* 接收者
*/
private String receiver;
/**
* 已读者
*/
private String reader;
/**
* 业务id
*/
private String bizId;
/**
* 业务员实体名,例如com.yeejoin.amos.toip.bizrulebridge.entity.Fire
*/
private String bizclassName;
public String getId()
{
return id;
}
public void setId(String id)
{
this.id = id;
}
public Date getTime()
{
return time;
}
public void setTime(Date time)
{
this.time = time;
}
public String getTitle()
{
return title;
}
public void setTitle(String title)
{
this.title = title;
}
public String getContent()
{
return content;
}
public void setContent(String content)
{
this.content = content;
}
public String getType()
{
return type;
}
public void setType(String type)
{
this.type = type;
}
public String getSender()
{
return sender;
}
public void setSender(String sender)
{
this.sender = sender;
}
public String getReceiver()
{
return receiver;
}
public void setReceiver(String receiver)
{
this.receiver = receiver;
}
public String getReader()
{
return reader;
}
public void setReader(String reader)
{
this.reader = reader;
}
public String getBizId()
{
return bizId;
}
public void setBizId(String bizId)
{
this.bizId = bizId;
}
public String getBizclassName()
{
return bizclassName;
}
public void setBizclassName(String bizclassName)
{
this.bizclassName = bizclassName;
}
}
package com.yeejoin.amos.fas.business.action;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Component;
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.message.ActionResultMessage;
import com.yeejoin.amos.fas.business.service.model.ToipResponse;
/**
*
* <pre>
* 气泡提示动作
* </pre>
*
* @author amos
* @version $Id: BubbleTipAction.java, v 0.1 2019年5月16日 上午10:42:32 amos Exp $
*/
@Component
public class BubbleTipAction implements CustomerAction
{
private static String PACKAGEURL = "com.yeejoin.amos.rule.map.action.result.message.";
//@ExposeAction("气泡提示")
public void sendBubbleTip(Object bizobj, Boolean showInfo, Object title, String type)
{
BubbleTipResult result = new BubbleTipResult();
Map<String, Object> tempmap1 = new HashMap<>();
tempmap1.put("bizobj", bizobj);
result.add(tempmap1);
//是否显示气泡
Map<String, Object> tempmap2 = new HashMap<>();
tempmap2.put("showInfo", showInfo);
result.add(tempmap2);
//显示title提示
Map<String, Object> tempmap3 = new HashMap<>();
tempmap3.put("title", title);
result.add(tempmap3);
//节点类型
Map<String, Object> tempmap4 = new HashMap<>();
tempmap4.put("type", type);
result.add(tempmap4);
Constructor<?> constructor;
try
{
constructor = Class.forName(
PACKAGEURL + result.getClass().getSimpleName() + "Message")
.getConstructor(ActionResult.class);
ActionResultMessage<?> action = (ActionResultMessage<?>) constructor.newInstance(result);
String firstStr = "fromws";
String secondStr = "map";
String thirdStr = "bubble";
Object obj = action.execute(firstStr, secondStr, thirdStr);
result.setToipResponse((ToipResponse) obj);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
package com.yeejoin.amos.fas.business.action;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Component;
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.message.ActionResultMessage;
import com.yeejoin.amos.fas.business.service.model.ToipResponse;
/**
*
* <pre>
* 风险态势图动作
* </pre>
*
* @author amos
* @version $Id: RiskSituationAction.java, v 0.1 2019年5月16日 下午5:26:27 amos Exp $
*/
@Component
public class RiskSituationAction implements CustomerAction
{
private static String PACKAGEURL = "com.yeejoin.amos.rule.map.action.result.message.";
//@ExposeAction("气泡提示")
public void sendBubbleTip(Object bizobj, Boolean showInfo, String title)
{
BubbleTipResult result = new BubbleTipResult();
Map<String, Object> tempmap1 = new HashMap<>();
tempmap1.put("bizobj", bizobj);
result.add(tempmap1);
//是否显示气泡
Map<String, Object> tempmap2 = new HashMap<>();
tempmap2.put("showInfo", showInfo);
result.add(tempmap2);
//显示title提示
Map<String, Object> tempmap3 = new HashMap<>();
tempmap3.put("title", title);
result.add(tempmap3);
Constructor<?> constructor;
try
{
constructor = Class.forName(
PACKAGEURL + result.getClass().getSimpleName() + "Message")
.getConstructor(ActionResult.class);
ActionResultMessage<?> action = (ActionResultMessage<?>) constructor.newInstance(result);
String firstStr = "fromws";
String secondStr = "riskSituation";
String thirdStr = "bubble";
Object obj = action.execute(firstStr, secondStr, thirdStr);
result.setToipResponse((ToipResponse) obj);
}
catch (Exception e)
{
e.printStackTrace();
}
}
//@ExposeAction("区域颜色改变")
public void regionChange(Object bizobj, String colour)
{
BubbleTipResult result = new BubbleTipResult();
Map<String, Object> tempmap1 = new HashMap<>();
tempmap1.put("bizobj", bizobj);
result.add(tempmap1);
//更改颜色
Map<String, Object> tempmap2 = new HashMap<>();
tempmap2.put("colour", colour);
result.add(tempmap2);
Constructor<?> constructor;
try
{
constructor = Class.forName(
PACKAGEURL + result.getClass().getSimpleName() + "Message")
.getConstructor(ActionResult.class);
ActionResultMessage<?> action = (ActionResultMessage<?>) constructor.newInstance(result);
String firstStr = "fromws";
String secondStr = "riskSituation";
String thirdStr = "colour";
Object obj = action.execute(firstStr, secondStr, thirdStr);
result.setToipResponse((ToipResponse) obj);
}
catch (Exception e)
{
e.printStackTrace();
}
}
//@ExposeAction(value = "区域闪烁",snapshot = false)
public void regionFlicker(Object bizobj, Integer frequency)
{
BubbleTipResult result = new BubbleTipResult();
Map<String, Object> tempmap1 = new HashMap<>();
tempmap1.put("bizobj", bizobj);
result.add(tempmap1);
//更改颜色
Map<String, Object> tempmap2 = new HashMap<>();
tempmap2.put("frequency", frequency);
result.add(tempmap2);
Constructor<?> constructor;
try
{
constructor = Class.forName(
PACKAGEURL + result.getClass().getSimpleName() + "Message")
.getConstructor(ActionResult.class);
ActionResultMessage<?> action = (ActionResultMessage<?>) constructor.newInstance(result);
String firstStr = "fromws";
String secondStr = "riskSituation";
String thirdStr = "flicker";
Object obj = action.execute(firstStr, secondStr, thirdStr);
result.setToipResponse((ToipResponse) obj);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
package com.yeejoin.amos.fas.business.action;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.yeejoin.amos.fas.business.action.el.ELEvaluationContext;
import com.yeejoin.amos.fas.business.action.result.AbstractActionResult;
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.message.ActionResultMessage;
import com.yeejoin.amos.fas.business.action.util.DataItemUtil;
import com.yeejoin.amos.fas.business.service.model.BasicsRo;
import com.yeejoin.amos.fas.business.service.model.ToipResponse;
import com.yeejoin.amos.fas.dao.entity.BusinessEntity;
import com.yeejoin.amos.fas.dao.entity.Message;
/**
*
* <pre>
* 消息提示动作
* </pre>
*
* @author amos
* @version $Id: SimpleTipAction.java, v 0.1 2019年4月24日 下午2:47:37 amos Exp $
*/
@Component
public class SimpleTipAction implements CustomerAction
{
private static String PACKAGEURL = "com.yeejoin.amos.rule.map.action.result.message.";
// @Autowired
// private IMessageService messageService;
//@ExposeAction("消息提示")
// public void sendMessageTip(Object bizobj, String title, String content,String type)
// {
//
// try
// {
//
// ELEvaluationContext.setVariable("bizobj",bizobj);
// TipResult result = new TipResult();
// result.add(bizobj);
// Map<String, Object> tempmap1 = new HashMap<>();
// tempmap1.put("title", title);
// result.add(tempmap1);
// Map<String, Object> tempmap2 = new HashMap<>();
// content =DataItemUtil.getNative(content);
// tempmap2.put("content", content);
// result.add(tempmap2);
//
//
// Constructor<?> constructor;
//
// constructor = Class.forName(
// PACKAGEURL + result.getClass().getSimpleName() + "Message")
// .getConstructor(ActionResult.class);
// ActionResultMessage<?> action = (ActionResultMessage<?>) constructor.newInstance(result);
// String firstStr = "fromws";
// String secondStr = "global";
// String thirdStr = "msg";
// result.setBizObj((BusinessEntity)bizobj);
// Object obj = action.execute(firstStr, secondStr, thirdStr);
// result.setToipResponse((ToipResponse) obj);
// saveMessageAction(result,type);
// }
// catch (Exception e)
// {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
// @SuppressWarnings("unchecked")
// private void saveMessageAction(AbstractActionResult abstractActionResult,String type)
// {
// Message message = new Message();
// List<Map<String, Object>> list = (List<Map<String, Object>>) abstractActionResult.getData();
// for(Map<String, Object> map : list) {
// for(String str: map.keySet()) {
// if(str.equals("content")) {
// message.setContent(map.get("content").toString());
// }else
// if (str.equals("title"))
// {
// message.setTitle(map.get("title").toString());
// }
// }
// BasicsRo basicsRo = (BasicsRo)abstractActionResult.getToipResponse().getBizObj();
// message.setTime(basicsRo.getDateTime());
// message.setBizId(basicsRo.getId());
// message.setBizclassName(abstractActionResult.getToipResponse().getBizObj().getClass().toString());
// message.setType(type);
// messageService.save(message);
// }
// }
}
package com.yeejoin.amos.fas.business.action.el;
import java.util.Map;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
public class ELEvaluationContext
{
private static EvaluationContext instance = new StandardEvaluationContext();
private static ExpressionParser parser = new SpelExpressionParser();
public static EvaluationContext getInstance()
{
return instance;
}
public static void setVariable(String name, Object value)
{
instance.setVariable(name, value);
}
public static void setVariable(Map<String, Object> vars)
{
for (Map.Entry<String, Object> entry : vars.entrySet())
{
instance.setVariable(entry.getKey(), entry.getValue());
}
}
public static Object getValue(String Expression){
return parser.parseExpression(Expression).getValue(instance);
}
}
package com.yeejoin.amos.fas.business.action.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.fas.business.action.el.ELEvaluationContext;
public class DataItemUtil
{
public static boolean getEnable(JSONObject jsonObject)
{
try
{
return jsonObject.getBooleanValue("enable");
}
catch (Exception e)
{
return false;
}
}
public static String getDisplayName(JSONObject jsonObject)
{
try
{
return jsonObject.get("displayname").toString();
}
catch (Exception e)
{
return null;
}
}
public static String getValue(JSONObject jsonObject)
{
try
{
return jsonObject.get("value").toString();
}
catch (Exception e)
{
return null;
}
}
public static String getName(JSONObject jsonObject)
{
try
{
return jsonObject.get("name").toString();
}
catch (Exception e)
{
return null;
}
}
public static String getNative(String str)
{
Pattern p = Pattern.compile("\\{(.*?)\\}");
Matcher m = p.matcher(str);
while (m.find())
{
String parameter = m.group();
Object parametervalue = ELEvaluationContext
.getValue(parameter.substring(1, parameter.length() - 1));
if(parametervalue != null)
str = str.replace(parameter,
parametervalue != null ? parametervalue.toString() : null);
}
return str;
}
}
...@@ -249,6 +249,8 @@ public class BaseController { ...@@ -249,6 +249,8 @@ public class BaseController {
if (reginParams.getCompany() != null) { if (reginParams.getCompany() != null) {
return reginParams.getCompany().getOrgCode(); return reginParams.getCompany().getOrgCode();
} }
return null; return null;
} }
......
...@@ -11,12 +11,14 @@ public interface ContingencyOriginalMapper extends BaseMapper { ...@@ -11,12 +11,14 @@ public interface ContingencyOriginalMapper extends BaseMapper {
Long queryCountForPage( Long queryCountForPage(
@Param("equipmentId")String equipmentId, @Param("equipmentId")String equipmentId,
@Param("createTime")String createTime); @Param("createTime")String createTime,
@Param("contingencyName")String contingencyName);
List<Map> queryForPage( @Param("equipmentId")String equipmentId, List<Map> queryForPage( @Param("equipmentId")String equipmentId,
@Param("createTime")String createTime, @Param("createTime")String createTime,
@Param("start") long start, @Param("start") long start,
@Param("length") Integer length); @Param("length") Integer length,
@Param("contingencyName")String contingencyName);
} }
...@@ -144,7 +144,7 @@ public interface View3dMapper extends BaseMapper{ ...@@ -144,7 +144,7 @@ public interface View3dMapper extends BaseMapper{
*/ */
List<View3dNodeVo> initViewErrorNode(String type,Long riskSourceId, String orgCode); List<View3dNodeVo> initViewErrorNode(String type,Long riskSourceId, String orgCode);
List<Node3DVoResponse> findViewDataByType(String type,Long riskSourceId,String orgCode); List<Node3DVoResponse> findViewDataByType(@Param("type")String type,@Param("riskSourceId")Long riskSourceId,@Param("orgCode")String orgCode);
Long retrieveAllCount(String type, String inputText,String orgCode,String dataLevel,String protectObjName); Long retrieveAllCount(String type, String inputText,String orgCode,String dataLevel,String protectObjName);
......
...@@ -50,8 +50,8 @@ public class ContingencyOriginalServiceImpl /*extends GenericManagerImpl<Conting ...@@ -50,8 +50,8 @@ public class ContingencyOriginalServiceImpl /*extends GenericManagerImpl<Conting
public Page queryForPage(String contingencyName, String equipmentId, String createTime, CommonPageable pageable) public Page queryForPage(String contingencyName, String equipmentId, String createTime, CommonPageable pageable)
{ {
Long total = contingencyOriginalMapper.queryCountForPage(equipmentId,createTime); Long total = contingencyOriginalMapper.queryCountForPage(equipmentId,createTime,contingencyName);
List<Map> content = contingencyOriginalMapper.queryForPage(equipmentId,createTime,pageable.getOffset(),pageable.getPageSize()); List<Map> content = contingencyOriginalMapper.queryForPage(equipmentId,createTime,pageable.getOffset(),pageable.getPageSize(),contingencyName);
Page result = new PageImpl(content,pageable,total); Page result = new PageImpl(content,pageable,total);
return result; return result;
} }
......
...@@ -243,6 +243,10 @@ public class EquipmentServiceImpl implements IEquipmentService { ...@@ -243,6 +243,10 @@ public class EquipmentServiceImpl implements IEquipmentService {
} }
long total = this.impAndFireEquipMapper.queryBindFirEqumtPageCount(String.valueOf(equipmentId)); long total = this.impAndFireEquipMapper.queryBindFirEqumtPageCount(String.valueOf(equipmentId));
List<FireEquipment> list = this.impAndFireEquipMapper.queryBindFirEqumtPage(start, length, String.valueOf(equipmentId)); List<FireEquipment> list = this.impAndFireEquipMapper.queryBindFirEqumtPage(start, length, String.valueOf(equipmentId));
if(commonPageable==null)
{
commonPageable = new CommonPageable();
}
Page result = new PageImpl(list, commonPageable, total); Page result = new PageImpl(list, commonPageable, total);
return result; return result;
} }
......
...@@ -21,7 +21,6 @@ import com.yeejoin.amos.fas.business.jpush.PushMsgParam; ...@@ -21,7 +21,6 @@ import com.yeejoin.amos.fas.business.jpush.PushMsgParam;
import com.yeejoin.amos.fas.business.param.AlarmParam; import com.yeejoin.amos.fas.business.param.AlarmParam;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.param.FmeaBindParam; import com.yeejoin.amos.fas.business.param.FmeaBindParam;
import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance;
import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService; import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService; import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService;
import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService; import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
......
...@@ -581,10 +581,14 @@ public class View3dServiceImpl implements IView3dService { ...@@ -581,10 +581,14 @@ public class View3dServiceImpl implements IView3dService {
List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, inputText,pageable.getOffset(),pageable.getPageSize(),orgCode,dataLevel,protectObjName); List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, inputText,pageable.getOffset(),pageable.getPageSize(),orgCode,dataLevel,protectObjName);
retrieveAll.stream().forEach(e->{ retrieveAll.stream().forEach(e->{
String person = (String)e.get("person"); String person = (String)e.get("person");
JSONArray ue4Location = this.getInitJSONArray(String.valueOf(e.get("ue4Location")));
JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(e.get("ue4Rotation")));
if(person != null && !person.equals("")) { if(person != null && !person.equals("")) {
AgencyUserModel user = remoteSecurityService.getUserById(token, product, appKey, person); AgencyUserModel user = remoteSecurityService.getUserById(token, product, appKey, person);
e.put("person", user != null ? user.getRealName() : ""); e.put("person", user != null ? user.getRealName() : "");
} }
e.put("ue4Location",ue4Location);
e.put("ue4Rotation",ue4Rotation);
}); });
Page result = new PageImpl(retrieveAll,pageable,count); Page result = new PageImpl(retrieveAll,pageable,count);
return CommonResponseUtil.success(result); return CommonResponseUtil.success(result);
......
package com.yeejoin.amos.fas.business.service.model; package com.yeejoin.amos.fas.business.service.model;
public class ContingencyRo extends BasicsRo { import java.io.Serializable;
public class ContingencyRo implements Serializable {
private String batchNo;
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
/** /**
* *
......
...@@ -8,9 +8,9 @@ import org.slf4j.Logger; ...@@ -8,9 +8,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
...@@ -18,6 +18,7 @@ import org.springframework.cloud.netflix.hystrix.EnableHystrix; ...@@ -18,6 +18,7 @@ import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
...@@ -27,6 +28,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; ...@@ -27,6 +28,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.yeejoin.amos.fas.client.invoke.RsDataQueue; import com.yeejoin.amos.fas.client.invoke.RsDataQueue;
import com.yeejoin.amos.fas.context.IotContext; import com.yeejoin.amos.fas.context.IotContext;
import com.yeejoin.amos.filter.CrossDomainFilter;
import springfox.documentation.swagger2.annotations.EnableSwagger2; import springfox.documentation.swagger2.annotations.EnableSwagger2;
...@@ -91,4 +93,25 @@ public class YeeAmosFireAutoSysStart implements ApplicationContextAware ...@@ -91,4 +93,25 @@ public class YeeAmosFireAutoSysStart implements ApplicationContextAware
IotContext.getInstance().setApplicationContext(applicationContext); IotContext.getInstance().setApplicationContext(applicationContext);
RsDataQueue.getInstance().start(); RsDataQueue.getInstance().start();
} }
/**
*
* <pre>
* 跨域处理的FilterBean
* </pre>
*
* @return
*/
@Bean
public FilterRegistrationBean crossFilterRegistrationBean()
{
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
CrossDomainFilter crossDomainFilter = new CrossDomainFilter();
registrationBean.setFilter(crossDomainFilter);
// List<String> urlPatterns = new ArrayList<String>();
// urlPatterns.add("/*");
// registrationBean.setUrlPatterns(urlPatterns);
registrationBean.setOrder(0);//值小的Filter先执行
return registrationBean;
}
} }
\ No newline at end of file
...@@ -5,12 +5,12 @@ security.appKeyWeb=CONVERTER_STATION ...@@ -5,12 +5,12 @@ security.appKeyWeb=CONVERTER_STATION
#environment #environment
#spring.profiles.active = dev #spring.profiles.active = dev
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://172.16.3.75:10001/eureka/
eureka.client.register-with-eureka = true eureka.client.register-with-eureka = true
eureka.client.fetch-registry = true eureka.client.fetch-registry = true
eureka.client.healthcheck.enabled = true eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry = true eureka.client.fetchRegistry = true
eureka.instance.prefer-ip-address=true
#DB properties: #DB properties:
spring.datasource.url=jdbc:mysql://172.16.11.33:3306/safety-business-2.0?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.datasource.url=jdbc:mysql://172.16.11.33:3306/safety-business-2.0?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root spring.datasource.username=root
...@@ -53,5 +53,10 @@ emqx.broker=tcp://172.16.10.85:1883 ...@@ -53,5 +53,10 @@ emqx.broker=tcp://172.16.10.85:1883
emqx.user-name=super emqx.user-name=super
emqx.password=a123456 emqx.password=a123456
Push.fegin.name=PPMESSAGEPUSHSERVICE15 Push.fegin.name=PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name=AMOS-DUTY dutyMode.fegin.name=AMOS-DUTY
##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF
rule.definition.load=true
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
\ No newline at end of file
...@@ -10,6 +10,7 @@ eureka.client.register-with-eureka = true ...@@ -10,6 +10,7 @@ eureka.client.register-with-eureka = true
eureka.client.fetch-registry = true eureka.client.fetch-registry = true
eureka.client.healthcheck.enabled = true eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry = true eureka.client.fetchRegistry = true
eureka.instance.prefer-ip-address=true
#DB properties: #DB properties:
spring.datasource.url=jdbc:mysql://amos-mysql:3306/yeejoin_safety_business?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.datasource.url=jdbc:mysql://amos-mysql:3306/yeejoin_safety_business?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
...@@ -55,3 +56,7 @@ emqx.password=a123456 ...@@ -55,3 +56,7 @@ emqx.password=a123456
Push.fegin.name=AMOS-PUSH Push.fegin.name=AMOS-PUSH
dutyMode.fegin.name=AMOS-DUTY dutyMode.fegin.name=AMOS-DUTY
##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF
rule.definition.load=true
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
\ No newline at end of file
...@@ -10,6 +10,7 @@ eureka.client.register-with-eureka = true ...@@ -10,6 +10,7 @@ eureka.client.register-with-eureka = true
eureka.client.fetch-registry = true eureka.client.fetch-registry = true
eureka.client.healthcheck.enabled = true eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry = true eureka.client.fetchRegistry = true
eureka.instance.prefer-ip-address=true
#DB properties: #DB properties:
spring.datasource.url=jdbc:mysql://47.103.14.66:3306/91-safety-business?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.datasource.url=jdbc:mysql://47.103.14.66:3306/91-safety-business?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
...@@ -55,3 +56,7 @@ emqx.password=a123456 ...@@ -55,3 +56,7 @@ emqx.password=a123456
Push.fegin.name=PPMESSAGEPUSHSERVICE15 Push.fegin.name=PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name=AMOS-DUTY dutyMode.fegin.name=AMOS-DUTY
##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF
rule.definition.load=true
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
\ No newline at end of file
spring.application.name = AMOS-AUTOSYS spring.application.name = AMOS-AUTOSYS-WJ
server.port = 8083 server.port = 8083
......
...@@ -15,14 +15,18 @@ ...@@ -15,14 +15,18 @@
1 = 1 1 = 1
<if test="equipmentId!=null"> <if test="equipmentId!=null">
AND t.equipment_Id = ${equipmentId} AND t.equipment_Id = #{equipmentId}
</if> </if>
<if test="createTime!=null"> <if test="createTime!=null">
AND TO_DAYS(t.create_date) = TO_DAYS(${createTime}) AND TO_DAYS(t.create_date) = TO_DAYS(#{createTime})
</if>
<if test="contingencyName!=null and contingencyName!=''">
AND t.fire_Equipment_Name like concat('%',#{contingencyName},'%')
OR t.equipment_Name like concat('%',#{contingencyName},'%')
</if> </if>
order by t.create_date desc order by t.create_date desc
LIMIT ${start},${length} ; LIMIT #{start},#{length} ;
</select> </select>
...@@ -35,11 +39,15 @@ ...@@ -35,11 +39,15 @@
1 = 1 1 = 1
<if test="equipmentId!=null"> <if test="equipmentId!=null">
AND t.equipment_Id = ${equipmentId} AND t.equipment_Id = #{equipmentId}
</if> </if>
<if test="createTime!=null"> <if test="createTime!=null">
AND TO_DAYS(t.create_date) = TO_DAYS(${createTime}) AND TO_DAYS(t.create_date) = TO_DAYS(#{createTime})
</if>
<if test="contingencyName!=null and contingencyName!=''">
AND t.fire_Equipment_Name like concat('%',#{contingencyName},'%')
OR t.equipment_Name like concat('%',#{contingencyName},'%')
</if> </if>
</select> </select>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent, R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,
<choose> <choose>
<when test="channelType == '3dpage'"> <when test="channelType == '3dpage'">
IF(ISNULL(route_path) || LENGTH(trim(route_path)) <![CDATA[ <]]> 1,0,1) as is_bind, IF(ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when> </when>
<otherwise> <otherwise>
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation)) IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation))
...@@ -115,84 +115,37 @@ ...@@ -115,84 +115,37 @@
AND B.id is not null AND B.id is not null
</when> </when>
<when test="type == 'fireEquipment'"> <when test="type == 'fireEquipment'">
select select tmp.id,tmp.name,tmp.type,tmp.position3d,tmp.ue4_rotation,tmp.ue4_location,tmp.code,R.parent_id,
<!-- R.id, -->
CASE
WHEN ISNULL(C.id) = 0 then C.id
WHEN ISNULL(E.id) = 0 then E.id
WHEN ISNULL(S.id) = 0 then S.id
WHEN ISNULL(W.id) = 0 then W.id
END as id
,R.parent_id,
<choose> <choose>
<when test="channelType == '3dpage'"> <when test="channelType == '3dpage'">
CASE IF(ISNULL(tmp.position3d) || LENGTH(trim(tmp.position3d)) <![CDATA[ <]]> 1,0,1) as isBind
WHEN ISNULL(C.id) = 0 AND ISNULL(C.position3d) OR LENGTH(trim(C.position3d)) <![CDATA[ <]]> 1 then 0
WHEN ISNULL(E.id) = 0 AND ISNULL(E.position3d) OR LENGTH(trim(E.position3d)) <![CDATA[ <]]> 1 then 0
WHEN ISNULL(S.id) = 0 AND ISNULL(S.position3d) OR LENGTH(trim(S.position3d)) <![CDATA[ <]]> 1 then 0
WHEN ISNULL(W.id) = 0 AND ISNULL(W.position3d) OR LENGTH(trim(W.position3d)) <![CDATA[ <]]> 1 then 0
ELSE 1
END as is_bind,
</when> </when>
<otherwise> <otherwise>
CASE IF(ISNULL(IF(replace(trim(tmp.ue4_rotation),'[]','')='',NULL,tmp.ue4_rotation))
WHEN ISNULL(C.id) = 0 then IF(ISNULL(IF(replace(trim(C.ue4_rotation),'[]','')='',NULL,C.ue4_rotation)) AND ISNULL(IF(replace(trim(tmp.ue4_location),'[]','')='',NULL,tmp.ue4_location)),0,1) as isBind
AND ISNULL(IF(replace(trim(C.ue4_rotation),'[]','')='',NULL,C.ue4_location)),0,1)
WHEN ISNULL(E.id) = 0 then IF(ISNULL(IF(replace(trim(E.ue4_rotation),'[]','')='',NULL,E.ue4_rotation))
AND ISNULL(IF(replace(trim(E.ue4_rotation),'[]','')='',NULL,E.ue4_location)),0,1)
WHEN ISNULL(S.id) = 0 then IF(ISNULL(IF(replace(trim(S.ue4_rotation),'[]','')='',NULL,S.ue4_rotation))
AND ISNULL(IF(replace(trim(S.ue4_rotation),'[]','')='',NULL,S.ue4_location)),0,1)
WHEN ISNULL(W.id) = 0 then IF(ISNULL(IF(replace(trim(W.ue4_rotation),'[]','')='',NULL,W.ue4_rotation))
AND ISNULL(IF(replace(trim(W.ue4_rotation),'[]','')='',NULL,W.ue4_location)),0,1)
END as is_bind,
</otherwise> </otherwise>
</choose> </choose>
from (
select id,name,'fireCar' as type,position3d,car_num as code,ue4_location,ue4_rotation,risk_source_id
from f_fire_car
union all
select id,name,'fireEquipment' as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
from f_fire_equipment
union all
select id,name,CASE
WHEN S.type = 1 then 'fireChamber'
WHEN S.type = 2 then 'fireFoamRoom'
END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
from f_fire_station s
union all
select id,name,
CASE CASE
WHEN ISNULL(C.id) = 0 then 'fireCar' WHEN W.type = 1 then 'hydrant'
WHEN ISNULL(E.id) = 0 then 'fireEquipment' WHEN W.type = 2 then 'pool'
WHEN ISNULL(S.id) = 0 AND S.type = 1 then 'fireChamber' END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
WHEN ISNULL(S.id) = 0 AND S.type = 2 then 'fireFoamRoom' from f_water_resource w
WHEN ISNULL(W.id) = 0 AND W.type = 1 then 'hydrant' ) tmp
WHEN ISNULL(W.id) = 0 AND W.type = 2 then 'pool' left join f_risk_source R on R.id = tmp.risk_source_id
END as type,
CASE
WHEN ISNULL(C.id) = 0 then C.name
WHEN ISNULL(E.id) = 0 then E.name
WHEN ISNULL(S.id) = 0 then S.name
WHEN ISNULL(W.id) = 0 then W.name
END as name,
CASE
WHEN ISNULL(C.id) = 0 then C.car_num
WHEN ISNULL(E.id) = 0 then E.code
WHEN ISNULL(S.id) = 0 then S.code
WHEN ISNULL(W.id) = 0 then W.code
END as code,
CASE
WHEN ISNULL(C.id) = 0 then C.ue4_location
WHEN ISNULL(E.id) = 0 then E.ue4_location
WHEN ISNULL(S.id) = 0 then S.ue4_location
WHEN ISNULL(W.id) = 0 then W.ue4_location
END as ue4_location,
CASE
WHEN ISNULL(C.id) = 0 then C.ue4_rotation
WHEN ISNULL(E.id) = 0 then E.ue4_rotation
WHEN ISNULL(S.id) = 0 then S.ue4_rotation
WHEN ISNULL(W.id) = 0 then W.ue4_rotation
END as ue4_rotation,
0 as is_region,
CASE
WHEN ISNULL(C.id) = 0 then C.position3d
WHEN ISNULL(E.id) = 0 then E.position3d
WHEN ISNULL(S.id) = 0 then S.position3d
WHEN ISNULL(W.id) = 0 then W.position3d
END as position3d
from f_risk_source R
left join f_fire_car C on C.risk_source_id = R.id
left join f_fire_equipment E on E.risk_source_id = R.id AND equip_classify = 3
left join f_fire_station S on S.risk_source_id = R.id
left join f_water_resource W on W.risk_source_id = R.id
where 1=1
AND (C.id is not null OR E.id is not null OR S.id is not null OR w.id is not null)
</when> </when>
</choose> </choose>
......
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