Commit 4b5d07ac by zhangjw

新增物业module

parent b1615250
......@@ -18,11 +18,11 @@ import net.sf.jsqlparser.expression.LongValue;
/**
* 单数据源配置(jeecg.datasource.open = false时生效)
* @Author zhoujf
*
* @Author zhoujf
*/
@Configuration
@MapperScan(value={"org.jeecg.modules.**.mapper*"})
@MapperScan(value = {"org.jeecg.modules.**.mapper*", "org.jeecg.pm.mapper"})
public class MybatisPlusSaasConfig {
/**
* tenant_id 字段名
......@@ -50,20 +50,20 @@ public class MybatisPlusSaasConfig {
interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(new TenantLineHandler() {
@Override
public Expression getTenantId() {
String tenant_id = oConvertUtils.getString(TenantContext.getTenant(),"0");
String tenant_id = oConvertUtils.getString(TenantContext.getTenant(), "0");
return new LongValue(tenant_id);
}
@Override
public String getTenantIdColumn(){
public String getTenantIdColumn() {
return TENANT_FIELD_NAME;
}
// 返回 true 表示不走租户逻辑
@Override
public boolean ignoreTable(String tableName) {
for(String temp: tenantTable){
if(temp.equalsIgnoreCase(tableName)){
for (String temp : tenantTable) {
if (temp.equalsIgnoreCase(tableName)) {
return false;
}
}
......
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>jeecg-boot-parent</artifactId>
<groupId>org.jeecgframework.boot</groupId>
<version>3.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jeecg-boot-module-property</artifactId>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-base-core</artifactId>
</dependency>
<dependency>
<groupId>com.chanjx</groupId>
<artifactId>chanjx-utils</artifactId>
</dependency>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-module-hikvision</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
</dependencies>
<!-- <build>-->
<!-- <extensions>-->
<!-- <extension>-->
<!-- <groupId>kr.motd.maven</groupId>-->
<!-- <artifactId>os-maven-plugin</artifactId>-->
<!-- <version>1.6.2</version>-->
<!-- </extension>-->
<!-- </extensions>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.xolstice.maven.plugins</groupId>-->
<!-- <artifactId>protobuf-maven-plugin</artifactId>-->
<!-- <version>0.6.1</version>-->
<!-- <configuration>-->
<!-- <protocArtifact>com.google.protobuf:protoc:3.12.0:exe:${os.detected.classifier}</protocArtifact>-->
<!-- <pluginId>grpc-java</pluginId>-->
<!-- <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.32.1:exe:${os.detected.classifier}</pluginArtifact>-->
<!-- <protoSourceRoot>src/main/proto</protoSourceRoot>-->
<!-- <outputDirectory>src/main/java</outputDirectory>-->
<!-- <clearOutputDirectory>false</clearOutputDirectory>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>compile</goal>-->
<!-- <goal>compile-custom</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
</project>
package org.jeecg.modules.pm.controller.event;
package org.jeecg.pm.controller.event;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -10,8 +10,8 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.pm.entity.event.PmEventInfo;
import org.jeecg.modules.pm.service.event.IPmEventInfoService;
import org.jeecg.pm.entity.event.PmEventInfo;
import org.jeecg.pm.service.event.IPmEventInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
......
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: comm.proto
package org.jeecg.modules.pm.entity.eps;
package org.jeecg.pm.entity.eps;
public final class Comm {
private Comm() {}
......
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: event_dis.proto
package org.jeecg.modules.pm.entity.eps;
package org.jeecg.pm.entity.eps;
public final class EventDis {
private EventDis() {}
......
package org.jeecg.modules.pm.entity.event;
package org.jeecg.pm.entity.event;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -44,13 +44,13 @@ public class PmEventInfo implements Serializable {
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.Long id;
private Long id;
/**
* 唯一标识一次发生的事件
*/
@Excel(name = "唯一标识一次发生的事件", width = 15)
@ApiModelProperty(value = "唯一标识一次发生的事件")
private java.lang.String logId;
private String logId;
/**
* 0:瞬时事件,保存;1:事件开始,
* 保存;2:事件结束,更新结束时间; 3:事件脉冲,客户端和服务器使用,
......@@ -59,45 +59,45 @@ public class PmEventInfo implements Serializable {
*/
@Excel(name = "0:瞬时事件,保存;1:事件开始, 保存;2:事件结束,更新结束时间; 3:事件脉冲,客户端和服务器使用, CMS 不用;4:事件更新,联动结果更 新", width = 15)
@ApiModelProperty(value = "0:瞬时事件,保存;1:事件开始, 保存;2:事件结束,更新结束时间; 3:事件脉冲,客户端和服务器使用, CMS 不用;4:事件更新,联动结果更 新")
private java.lang.Integer eventState;
private Integer eventState;
/**
* 0:普通事件;1:低级报警;2:中级
* 报警;3:高级报警
*/
@Excel(name = "0:普通事件;1:低级报警;2:中级 报警;3:高级报警", width = 15)
@ApiModelProperty(value = "0:普通事件;1:低级报警;2:中级 报警;3:高级报警")
private java.lang.Integer eventLevel;
private Integer eventLevel;
/**
* 控制中心编号
*/
@Excel(name = "控制中心编号", width = 15)
@ApiModelProperty(value = "控制中心编号")
private java.lang.String unitIdx;
private String unitIdx;
/**
* 事件类型
*/
@Excel(name = "事件类型", width = 15)
@ApiModelProperty(value = "事件类型")
private java.lang.Integer eventType;
private Integer eventType;
/**
* 事件类型名称
*/
@Excel(name = "事件类型名称", width = 15)
@ApiModelProperty(value = "事件类型名称")
private java.lang.String eventTypeName;
private String eventTypeName;
/**
* 事件所属子系统类型.
* "废弃,事件整改,没有子系统属性"
*/
@Excel(name = "事件所属子系统类型: 废弃,事件整改,没有子系统属性", width = 15)
@ApiModelProperty(value = "事件所属子系统类型: 废弃,事件整改,没有子系统属性 ")
private java.lang.Integer subSysType;
private Integer subSysType;
/**
* 事件名称
*/
@Excel(name = "事件名称", width = 15)
@ApiModelProperty(value = "事件名称")
private java.lang.String eventName;
private String eventName;
/**
* 事件开始时间
*/
......@@ -105,7 +105,7 @@ public class PmEventInfo implements Serializable {
// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
// @DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "事件开始时间")
private java.lang.String startTime;
private String startTime;
/**
* 事件结束时间
*/
......@@ -113,37 +113,37 @@ public class PmEventInfo implements Serializable {
// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
// @DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "事件结束时间")
private java.lang.String stopTime;
private String stopTime;
/**
* 事件源编号
*/
@Excel(name = "事件源编号", width = 15)
@ApiModelProperty(value = "事件源编号")
private java.lang.String sourceIdx;
private String sourceIdx;
/**
* 事件源类型
*/
@Excel(name = "事件源类型", width = 15)
@ApiModelProperty(value = "事件源类型")
private java.lang.Integer sourceType;
private Integer sourceType;
/**
* 事件源名称
*/
@Excel(name = "事件源名称", width = 15)
@ApiModelProperty(value = "事件源名称")
private java.lang.String sourceName;
private String sourceName;
/**
* 事件描述信息
*/
@Excel(name = "事件描述信息", width = 15)
@ApiModelProperty(value = "事件描述信息")
private java.lang.String logTxt;
private String logTxt;
/**
* 事件源区域编号
*/
@Excel(name = "事件源区域编号", width = 15)
@ApiModelProperty(value = "事件源区域编号")
private java.lang.String regionIdx;
private String regionIdx;
/**
* 事件拓展信息:
* 各个子系统根据子系统的消息结构体
......@@ -152,20 +152,20 @@ public class PmEventInfo implements Serializable {
*/
@Excel(name = "事件拓展信息:各个子系统根据子系统的消息结构体 定义解析, 下文主要介绍事件中此字 段含义", width = 15)
@ApiModelProperty(value = "事件拓展信息: 各个子系统根据子系统的消息结构体 定义解析, 下文主要介绍事件中此字 段含义")
private java.lang.String extInfo;
private String extInfo;
/**
* 事件处理结果:当 event_state 为更新时使用
*/
@Excel(name = "事件处理结果:当 event_state 为更新时使用", width = 15)
@ApiModelProperty(value = "事件处理结果:当 event_state 为更新时使用")
private java.lang.String rsltMsg;
private String rsltMsg;
/**
* 联动信息:目前包含客户端联动、预
* 案
*/
@Excel(name = "联动信息:目前包含客户端联动、预 案", width = 15)
@ApiModelProperty(value = "联动信息:目前包含客户端联动、预 案")
private java.lang.String trigInfo;
private String trigInfo;
/**
* 上层事件类型
......
package org.jeecg.modules.pm.mapper.event;
package org.jeecg.pm.mapper.event;
import org.jeecg.modules.pm.entity.event.PmEventInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.pm.entity.event.PmEventInfo;
/**
* @Description: pm_event_info
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.pm.mapper.event.PmEventInfoMapper">
<mapper namespace="org.jeecg.pm.mapper.event.PmEventInfoMapper">
</mapper>
\ No newline at end of file
package org.jeecg.modules.pm.mq;
package org.jeecg.pm.mq;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.pm.entity.eps.EventDis;
import org.jeecg.modules.pm.entity.event.PmEventInfo;
import org.jeecg.modules.pm.service.event.IPmEventInfoService;
import org.jeecg.pm.entity.eps.EventDis;
import org.jeecg.pm.entity.event.PmEventInfo;
import org.jeecg.pm.service.event.IPmEventInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
......@@ -40,26 +40,27 @@ public class EventMessageListener {
bytesMessage.readBytes(bytes);
// 壳文件字段,EventDis类为event_dis.proto文件解析而来,CommEventLog类为事件壳文件类
final EventDis.CommEventLog commEventLog = EventDis.CommEventLog.parseFrom(bytes);
pmEventInfoService.save(
new PmEventInfo()
.setEventCategory(PmEventInfo.VSS)
.setId(IdWorker.getId())
.setLogId(commEventLog.getLogId())
.setEventState(commEventLog.getEventState())
.setEventLevel(commEventLog.getEventLevel())
.setUnitIdx(commEventLog.getUnitIdx())
.setEventType(commEventLog.getEventType())
.setEventTypeName(commEventLog.getEventTypeName())
.setSubSysType(commEventLog.getSubSysType())
.setEventName(commEventLog.getEventName())
.setStartTime(commEventLog.getStartTime())
.setStopTime(commEventLog.getStopTime())
.setSourceIdx(commEventLog.getSourceIdx())
.setSourceType(commEventLog.getSourceType())
.setSourceName(commEventLog.getSourceName())
.setLogTxt(commEventLog.getLogTxt())
.setRegionIdx(commEventLog.getRegionIdx())
.setExtInfo(commEventLog.getExtInfo().toString()));
PmEventInfo pmEventInfo = new PmEventInfo()
.setEventCategory(PmEventInfo.VSS)
.setId(IdWorker.getId())
.setLogId(commEventLog.getLogId())
.setEventState(commEventLog.getEventState())
.setEventLevel(commEventLog.getEventLevel())
.setUnitIdx(commEventLog.getUnitIdx())
.setEventType(commEventLog.getEventType())
.setEventTypeName(commEventLog.getEventTypeName())
.setSubSysType(commEventLog.getSubSysType())
.setEventName(commEventLog.getEventName())
.setStartTime(commEventLog.getStartTime())
.setStopTime(commEventLog.getStopTime())
.setSourceIdx(commEventLog.getSourceIdx())
.setSourceType(commEventLog.getSourceType())
.setSourceName(commEventLog.getSourceName())
.setLogTxt(commEventLog.getLogTxt())
.setRegionIdx(commEventLog.getRegionIdx())
.setExtInfo(commEventLog.getExtInfo().toString());
log.info(pmEventInfo.toString());
pmEventInfoService.save(pmEventInfo);
}
......
package org.jeecg.modules.pm.service.event;
package org.jeecg.pm.service.event;
import org.jeecg.modules.pm.entity.event.PmEventInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.pm.entity.event.PmEventInfo;
/**
* @Description: pm_event_info
......
package org.jeecg.modules.pm.service.impl.event;
package org.jeecg.pm.service.impl.event;
import org.jeecg.modules.pm.entity.event.PmEventInfo;
import org.jeecg.modules.pm.mapper.event.PmEventInfoMapper;
import org.jeecg.modules.pm.service.event.IPmEventInfoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.pm.entity.event.PmEventInfo;
import org.jeecg.pm.mapper.event.PmEventInfoMapper;
import org.jeecg.pm.service.event.IPmEventInfoService;
import org.springframework.stereotype.Service;
/**
* @Description: pm_event_info
......
package org.jeecg.pm.jeecgbootmoduleproperty;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class JeecgBootModulePropertyApplicationTests {
@Test
void contextLoads() {
}
}
......@@ -69,6 +69,13 @@
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-module-property</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
<build>
......
......@@ -57,6 +57,7 @@
<module>jeecg-boot-module-demo</module>
<module>jeecg-boot-module-system</module>
<module>jeecg-boot-module-hikvision</module>
<module>jeecg-boot-module-property</module>
<!--需要微服务,请打开
<module>jeecg-boot-starter</module>
<module>jeecg-cloud-module</module>-->
......
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