Commit ad881afb authored by wangjinjing's avatar wangjinjing

添加任务派发功能

parent 5749f15e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>im.zhaojun</groupId> <groupId>im.dx</groupId>
<artifactId>zjgszdVideoAlarmService</artifactId> <artifactId>zjgszdVideoAlarmService</artifactId>
<version>0.6</version> <version>0.6</version>
<packaging>jar</packaging> <packaging>jar</packaging>
...@@ -172,7 +172,12 @@ ...@@ -172,7 +172,12 @@
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
<version>3.8-beta5</version> <version>3.8-beta5</version>
</dependency> </dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<repositories> <repositories>
......
package im.zhaojun.common.annotation; package im.dx.common.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
......
package im.zhaojun.common.annotation; package im.dx.common.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
......
package im.zhaojun.common.aop; package im.dx.common.aop;
import im.zhaojun.common.util.IPUtils; import im.dx.common.util.IPUtils;
import im.zhaojun.system.model.User; import im.dx.system.model.User;
import im.zhaojun.system.service.LoginLogService; import im.dx.system.service.LoginLogService;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
...@@ -22,7 +22,7 @@ public class LoginLogAspect { ...@@ -22,7 +22,7 @@ public class LoginLogAspect {
@Resource @Resource
private LoginLogService loginLogService; private LoginLogService loginLogService;
@Pointcut("execution(im.zhaojun.common.util.ResultBean im.zhaojun.system.controller..LoginController.login(im.zhaojun.system.model.User, String) )") @Pointcut("execution(im.dx.common.util.ResultBean im.dx.system.controller..LoginController.login(im.dx.system.model.User, String) )")
public void loginLogPointCut() {} public void loginLogPointCut() {}
@After("loginLogPointCut()") @After("loginLogPointCut()")
......
package im.zhaojun.common.aop; package im.dx.common.aop;
import im.zhaojun.common.annotation.OperationLog; import im.dx.common.annotation.OperationLog;
import im.zhaojun.common.util.IPUtils; import im.dx.common.util.IPUtils;
import im.zhaojun.common.util.ShiroUtil; import im.dx.common.util.ShiroUtil;
import im.zhaojun.system.mapper.SysLogMapper; import im.dx.system.mapper.SysLogMapper;
import im.zhaojun.system.model.SysLog; import im.dx.system.model.SysLog;
import im.zhaojun.system.model.User; import im.dx.system.model.User;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Around;
...@@ -30,7 +30,7 @@ public class OperationLogAspect { ...@@ -30,7 +30,7 @@ public class OperationLogAspect {
@Resource @Resource
private SysLogMapper sysLogMapper; private SysLogMapper sysLogMapper;
@Pointcut("@annotation(im.zhaojun.common.annotation.OperationLog)") @Pointcut("@annotation(im.dx.common.annotation.OperationLog)")
public void pointcut() { public void pointcut() {
} }
......
package im.zhaojun.common.aop; package im.dx.common.aop;
import im.zhaojun.system.service.ShiroService; import im.dx.system.service.ShiroService;
import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
...@@ -18,7 +18,7 @@ public class RefreshFilterChainAspect { ...@@ -18,7 +18,7 @@ public class RefreshFilterChainAspect {
@Resource @Resource
private ShiroService shiroService; private ShiroService shiroService;
@Pointcut("@annotation(im.zhaojun.common.annotation.RefreshFilterChain)") @Pointcut("@annotation(im.dx.common.annotation.RefreshFilterChain)")
public void updateFilterChain() {} public void updateFilterChain() {}
@AfterReturning("updateFilterChain()") @AfterReturning("updateFilterChain()")
......
package im.zhaojun.common.config; package im.dx.common.config;
import at.pollux.thymeleaf.shiro.dialect.ShiroDialect; import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
import im.zhaojun.common.shiro.EnhanceModularRealmAuthenticator; import im.dx.common.shiro.EnhanceModularRealmAuthenticator;
import im.zhaojun.common.shiro.OAuth2Helper; import im.dx.common.shiro.OAuth2Helper;
import im.zhaojun.common.shiro.RestShiroFilterFactoryBean; import im.dx.common.shiro.RestShiroFilterFactoryBean;
import im.zhaojun.common.shiro.ShiroActionProperties; import im.dx.common.shiro.ShiroActionProperties;
import im.zhaojun.common.shiro.credential.RetryLimitHashedCredentialsMatcher; import im.dx.common.shiro.credential.RetryLimitHashedCredentialsMatcher;
import im.zhaojun.common.shiro.filter.OAuth2AuthenticationFilter; import im.dx.common.shiro.filter.OAuth2AuthenticationFilter;
import im.zhaojun.common.shiro.filter.RestAuthorizationFilter; import im.dx.common.shiro.filter.RestAuthorizationFilter;
import im.zhaojun.common.shiro.filter.RestFormAuthenticationFilter; import im.dx.common.shiro.filter.RestFormAuthenticationFilter;
import im.zhaojun.common.shiro.realm.OAuth2GiteeRealm; import im.dx.common.shiro.realm.OAuth2GiteeRealm;
import im.zhaojun.common.shiro.realm.OAuth2GithubRealm; import im.dx.common.shiro.realm.OAuth2GithubRealm;
import im.zhaojun.common.shiro.realm.UserNameRealm; import im.dx.common.shiro.realm.UserNameRealm;
import im.zhaojun.system.service.MyWebSocketClient; import im.dx.system.service.ShiroService;
import im.zhaojun.system.service.ShiroService;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.apache.shiro.authc.pam.ModularRealmAuthenticator; import org.apache.shiro.authc.pam.ModularRealmAuthenticator;
...@@ -30,8 +29,6 @@ import org.springframework.context.annotation.Lazy; ...@@ -30,8 +29,6 @@ import org.springframework.context.annotation.Lazy;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.Filter; import javax.servlet.Filter;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map; import java.util.Map;
......
package im.zhaojun.common.config; package im.dx.common.config;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
......
package im.zhaojun.common.config; package im.dx.common.config;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
......
package im.zhaojun.common.config; package im.dx.common.config;
import im.zhaojun.common.interceptor.LogMDCInterceptor; import im.dx.common.interceptor.LogMDCInterceptor;
import im.zhaojun.common.interceptor.RequestLogHandlerInterceptor; import im.dx.common.interceptor.RequestLogHandlerInterceptor;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
......
package im.zhaojun.common.config; package im.dx.common.config;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import im.zhaojun.system.mapper.AlarmMapper; import im.dx.system.mapper.AlarmMapper;
import im.zhaojun.system.model.Alarm; import im.dx.system.model.Alarm;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient; import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455; import org.java_websocket.drafts.Draft_6455;
......
package im.zhaojun.common.constants; package im.dx.common.constants;
/** /**
* 登录认证类型 枚举类 * 登录认证类型 枚举类
......
package im.zhaojun.common.exception; package im.dx.common.exception;
public class AuthcTypeNotSupportException extends RuntimeException { public class AuthcTypeNotSupportException extends RuntimeException {
......
package im.zhaojun.common.exception; package im.dx.common.exception;
import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationException;
......
package im.zhaojun.common.exception; package im.dx.common.exception;
public class DuplicateNameException extends RuntimeException { public class DuplicateNameException extends RuntimeException {
......
package im.zhaojun.common.exception; package im.dx.common.exception;
import org.springframework.boot.web.servlet.error.DefaultErrorAttributes; import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
......
package im.zhaojun.common.exception; package im.dx.common.exception;
public class TreeCastException extends RuntimeException { public class TreeCastException extends RuntimeException {
private static final long serialVersionUID = -7358633666514111106L; private static final long serialVersionUID = -7358633666514111106L;
......
package im.zhaojun.common.exception; package im.dx.common.exception;
public class UnknownRedirectUrlException extends RuntimeException{ public class UnknownRedirectUrlException extends RuntimeException{
......
package im.zhaojun.common.exception; package im.dx.common.exception;
import im.zhaojun.common.util.ResultBean; import im.dx.common.util.ResultBean;
import org.apache.catalina.connector.ClientAbortException; import org.apache.catalina.connector.ClientAbortException;
import org.apache.shiro.authc.ExcessiveAttemptsException; import org.apache.shiro.authc.ExcessiveAttemptsException;
import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.IncorrectCredentialsException;
......
package im.zhaojun.common.information; package im.dx.common.information;
/** /**
......
package im.zhaojun.common.information; package im.dx.common.information;
/** /**
* 系统相关信息 * 系统相关信息
......
package im.zhaojun.common.information; package im.dx.common.information;
/** /**
* 系统文件相关信息 * 系统文件相关信息
......
package im.zhaojun.common.interceptor; package im.dx.common.interceptor;
import im.zhaojun.common.util.IPUtils; import im.dx.common.util.IPUtils;
import im.zhaojun.system.model.User; import im.dx.system.model.User;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
......
package im.zhaojun.common.interceptor; package im.dx.common.interceptor;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
......
package im.zhaojun.common.shiro; package im.dx.common.shiro;
import im.zhaojun.common.constants.AuthcTypeEnum; import im.dx.common.constants.AuthcTypeEnum;
import im.zhaojun.common.exception.AuthcTypeNotSupportException; import im.dx.common.exception.AuthcTypeNotSupportException;
import me.zhyd.oauth.config.AuthConfig; import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthGiteeRequest; import me.zhyd.oauth.request.AuthGiteeRequest;
import me.zhyd.oauth.request.AuthGithubRequest; import me.zhyd.oauth.request.AuthGithubRequest;
......
package im.zhaojun.common.shiro; package im.dx.common.shiro;
import im.zhaojun.common.util.WebHelper; import im.dx.common.util.WebHelper;
import org.apache.shiro.web.filter.mgt.FilterChainManager; import org.apache.shiro.web.filter.mgt.FilterChainManager;
import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver; import org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver;
import org.slf4j.Logger; import org.slf4j.Logger;
......
package im.zhaojun.common.shiro; package im.dx.common.shiro;
import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean; import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
......
package im.zhaojun.common.shiro; package im.dx.common.shiro;
import im.zhaojun.common.constants.AuthcTypeEnum; import im.dx.common.constants.AuthcTypeEnum;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
......
package im.zhaojun.common.shiro.credential; package im.dx.common.shiro.credential;
import im.zhaojun.common.shiro.ShiroActionProperties; import im.dx.common.shiro.ShiroActionProperties;
import im.zhaojun.common.util.IPUtils; import im.dx.common.util.IPUtils;
import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.ExcessiveAttemptsException; import org.apache.shiro.authc.ExcessiveAttemptsException;
......
package im.zhaojun.common.shiro.filter; package im.dx.common.shiro.filter;
import im.zhaojun.common.constants.AuthcTypeEnum; import im.dx.common.constants.AuthcTypeEnum;
import im.zhaojun.common.exception.UnknownRedirectUrlException; import im.dx.common.exception.UnknownRedirectUrlException;
import im.zhaojun.common.shiro.OAuth2Helper; import im.dx.common.shiro.OAuth2Helper;
import im.zhaojun.common.shiro.token.OAuth2Token; import im.dx.common.shiro.token.OAuth2Token;
import im.zhaojun.common.util.WebHelper; import im.dx.common.util.WebHelper;
import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.AuthenticatingFilter; import org.apache.shiro.web.filter.authc.AuthenticatingFilter;
......
package im.zhaojun.common.shiro.filter; package im.dx.common.shiro.filter;
import im.zhaojun.common.util.IPUtils; import im.dx.common.util.IPUtils;
import im.zhaojun.common.util.ResultBean; import im.dx.common.util.ResultBean;
import im.zhaojun.common.util.WebHelper; import im.dx.common.util.WebHelper;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.StringUtils; import org.apache.shiro.util.StringUtils;
import org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter; import org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter;
......
package im.zhaojun.common.shiro.filter; package im.dx.common.shiro.filter;
import im.zhaojun.common.util.IPUtils; import im.dx.common.util.IPUtils;
import im.zhaojun.common.util.ResultBean; import im.dx.common.util.ResultBean;
import im.zhaojun.common.util.WebHelper; import im.dx.common.util.WebHelper;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter; import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.apache.shiro.web.util.WebUtils; import org.apache.shiro.web.util.WebUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
......
package im.zhaojun.common.shiro.realm; package im.dx.common.shiro.realm;
import im.zhaojun.common.constants.AuthcTypeEnum; import im.dx.common.constants.AuthcTypeEnum;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
......
package im.zhaojun.common.shiro.realm; package im.dx.common.shiro.realm;
import im.zhaojun.common.constants.AuthcTypeEnum; import im.dx.common.constants.AuthcTypeEnum;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
......
package im.zhaojun.common.shiro.realm; package im.dx.common.shiro.realm;
import cn.hutool.core.lang.UUID; import cn.hutool.core.lang.UUID;
import im.zhaojun.common.constants.AuthcTypeEnum; import im.dx.common.constants.AuthcTypeEnum;
import im.zhaojun.common.shiro.OAuth2Helper; import im.dx.common.shiro.OAuth2Helper;
import im.zhaojun.common.shiro.token.OAuth2Token; import im.dx.common.shiro.token.OAuth2Token;
import im.zhaojun.common.util.ShiroUtil; import im.dx.common.util.ShiroUtil;
import im.zhaojun.common.util.WebHelper; import im.dx.common.util.WebHelper;
import im.zhaojun.system.model.User; import im.dx.system.model.User;
import im.zhaojun.system.model.UserAuths; import im.dx.system.model.UserAuths;
import im.zhaojun.system.service.UserAuthsService; import im.dx.system.service.UserAuthsService;
import im.zhaojun.system.service.UserService; import im.dx.system.service.UserService;
import me.zhyd.oauth.model.AuthResponse; import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.model.AuthUser; import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.request.AuthRequest; import me.zhyd.oauth.request.AuthRequest;
......
package im.zhaojun.common.shiro.realm; package im.dx.common.shiro.realm;
import im.zhaojun.common.shiro.ShiroActionProperties; import im.dx.common.shiro.ShiroActionProperties;
import im.zhaojun.common.util.ShiroUtil; import im.dx.common.util.ShiroUtil;
import im.zhaojun.system.model.User; import im.dx.system.model.User;
import im.zhaojun.system.service.UserService; import im.dx.system.service.UserService;
import org.apache.shiro.authc.*; import org.apache.shiro.authc.*;
import org.apache.shiro.authz.AuthorizationInfo; import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo; import org.apache.shiro.authz.SimpleAuthorizationInfo;
......
package im.zhaojun.common.shiro.token; package im.dx.common.shiro.token;
import im.zhaojun.common.constants.AuthcTypeEnum; import im.dx.common.constants.AuthcTypeEnum;
import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.AuthenticationToken;
public class OAuth2Token implements AuthenticationToken { public class OAuth2Token implements AuthenticationToken {
......
package im.zhaojun.common.util; package im.dx.common.util;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import java.lang.management.ManagementFactory;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
......
package im.zhaojun.common.util; package im.dx.common.util;
public class ExcelCol { public class ExcelCol {
......
package im.zhaojun.common.util; package im.dx.common.util;
import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFRow;
...@@ -11,7 +11,7 @@ import java.text.DecimalFormat; ...@@ -11,7 +11,7 @@ import java.text.DecimalFormat;
/** /**
* 取Excel * ��ȡExcel
* @author redhightree * @author redhightree
* *
*/ */
...@@ -24,7 +24,7 @@ public class ExcelReader { ...@@ -24,7 +24,7 @@ public class ExcelReader {
private HSSFRow row = null; private HSSFRow row = null;
/* cell,the content which contains */ /* cell,the content which contains */
private HSSFCell cell = null; private HSSFCell cell = null;
/* 第sheetnum个工作表 */ /* ��sheetnum�������� */
private int sheetNum = 0; private int sheetNum = 0;
private int rowNum = 0; private int rowNum = 0;
private FileInputStream fis = null; private FileInputStream fis = null;
...@@ -46,8 +46,8 @@ public class ExcelReader { ...@@ -46,8 +46,8 @@ public class ExcelReader {
} }
/** /**
* 读取excel文件获得HSSFWorkbook对象 * ��ȡexcel�ļ����HSSFWorkbook����
* @param fileName 文件名 * @param fileName �ļ���
*/ */
public void openFile(String fileName) { public void openFile(String fileName) {
this.fileName = fileName; this.fileName = fileName;
...@@ -67,7 +67,7 @@ public class ExcelReader { ...@@ -67,7 +67,7 @@ public class ExcelReader {
} }
/** /**
* 返回sheet表数 * ����sheet����Ŀ
* @return int * @return int
*/ */
public int getSheetCount() { public int getSheetCount() {
...@@ -77,7 +77,7 @@ public class ExcelReader { ...@@ -77,7 +77,7 @@ public class ExcelReader {
} }
/** /**
* sheetNum下的记录行数 * sheetNum�µļ�¼����
* @return int * @return int
*/ */
public int getRowCount() { public int getRowCount() {
...@@ -91,7 +91,7 @@ public class ExcelReader { ...@@ -91,7 +91,7 @@ public class ExcelReader {
} }
/** /**
* 读取指定sheetNum的rowCount * ��ȡָ��sheetNum��rowCount
* @param sheetNum * @param sheetNum
* @return int * @return int
*/ */
...@@ -103,7 +103,7 @@ public class ExcelReader { ...@@ -103,7 +103,7 @@ public class ExcelReader {
} }
/** /**
* 得到指定行的内容 * �õ�ָ���е�����
* @param lineNum * @param lineNum
* @return String[] * @return String[]
*/ */
...@@ -112,10 +112,10 @@ public class ExcelReader { ...@@ -112,10 +112,10 @@ public class ExcelReader {
} }
/** /**
* 指定工作表和行数的内容 * ָ�������������������
* @param sheetNum * @param sheetNum
* @param lineNum * @param lineNum
* @param colNum 制定的列号 added by wangxiaohui * @param colNum �ƶ����к� added by wangxiaohui
* @return String[] * @return String[]
*/ */
public String [] readExcelLine(int sheetNum, int lineNum,int colNum) { public String [] readExcelLine(int sheetNum, int lineNum,int colNum) {
...@@ -129,7 +129,7 @@ public class ExcelReader { ...@@ -129,7 +129,7 @@ public class ExcelReader {
int cellCount = sheet.getRow(sheet.getFirstRowNum()).getLastCellNum(); int cellCount = sheet.getRow(sheet.getFirstRowNum()).getLastCellNum();
strExcelLine = new String[cellCount]; strExcelLine = new String[cellCount];
//for (int i = 0; i < cellCount; i++) { //for (int i = 0; i < cellCount; i++) {
//不做循环,直接读取指定列,提高效率 modified by wangxiaohui //����ѭ����ֱ�Ӷ�ȡָ���У����Ч�� modified by wangxiaohui
int i=colNum; int i=colNum;
strExcelLine[i] = ""; strExcelLine[i] = "";
if (null != row.getCell((short) i)) { if (null != row.getCell((short) i)) {
...@@ -150,7 +150,7 @@ public class ExcelReader { ...@@ -150,7 +150,7 @@ public class ExcelReader {
strExcelLine[i] = ""; strExcelLine[i] = "";
break; break;
} }
//如果读取的是科学计数法的格式,则转换为普通格式 //�����ȡ���ǿ�ѧ�������ĸ�ʽ����ת��Ϊ��ͨ��ʽ
//added by wangtongjun at 20060626 //added by wangtongjun at 20060626
if (null != strExcelLine[i] && if (null != strExcelLine[i] &&
strExcelLine[i].indexOf(".") != -1 && strExcelLine[i].indexOf(".") != -1 &&
...@@ -158,7 +158,7 @@ public class ExcelReader { ...@@ -158,7 +158,7 @@ public class ExcelReader {
DecimalFormat df = new DecimalFormat(); DecimalFormat df = new DecimalFormat();
strExcelLine[i] = df.parse(strExcelLine[i]).toString(); strExcelLine[i] = df.parse(strExcelLine[i]).toString();
} }
//如果读取的是数字格式,并且以".0"结尾格式,则转换为普通格 //�����ȡ�������ָ�ʽ��������".0"��β��ʽ����ת��Ϊ��ͨ��ʽ
//added by wangtongjun at 20060713 //added by wangtongjun at 20060713
if (null != strExcelLine && if (null != strExcelLine &&
strExcelLine[i].endsWith(".0")) { strExcelLine[i].endsWith(".0")) {
...@@ -174,7 +174,7 @@ public class ExcelReader { ...@@ -174,7 +174,7 @@ public class ExcelReader {
} }
/** /**
* 读取指定列的内容 * ��ȡָ���е�����
* @param cellNum * @param cellNum
* @return String * @return String
*/ */
...@@ -183,7 +183,7 @@ public class ExcelReader { ...@@ -183,7 +183,7 @@ public class ExcelReader {
} }
/** /**
* 指定行和列编号的内容 * ָ���к��б�ŵ�����
* @param rowNum * @param rowNum
* @param cellNum * @param cellNum
* @return String * @return String
...@@ -193,7 +193,7 @@ public class ExcelReader { ...@@ -193,7 +193,7 @@ public class ExcelReader {
} }
/** /**
* 指定工作表、行、列下的内容 * ָ���������С����µ�����
* @param sheetNum * @param sheetNum
* @param rowNum * @param rowNum
* @param cellNum * @param cellNum
...@@ -225,14 +225,14 @@ public class ExcelReader { ...@@ -225,14 +225,14 @@ public class ExcelReader {
break; break;
default : default :
} }
//如果读取的是科学计数法的格式,则转换为普通格式 //�����ȡ���ǿ�ѧ�������ĸ�ʽ����ת��Ϊ��ͨ��ʽ
if (null != strExcelCell && if (null != strExcelCell &&
strExcelCell.indexOf(".") != -1 && strExcelCell.indexOf(".") != -1 &&
strExcelCell.indexOf("E") != -1) { strExcelCell.indexOf("E") != -1) {
DecimalFormat df = new DecimalFormat(); DecimalFormat df = new DecimalFormat();
strExcelCell = df.parse(strExcelCell).toString(); strExcelCell = df.parse(strExcelCell).toString();
} }
//如果读取的是数字格式,并且以".0"结尾格式,则转换为普通格 //�����ȡ�������ָ�ʽ��������".0"��β��ʽ����ת��Ϊ��ͨ��ʽ
//added by wangtongjun at 20060713 //added by wangtongjun at 20060713
if (null != strExcelCell && if (null != strExcelCell &&
strExcelCell.endsWith(".0")) { strExcelCell.endsWith(".0")) {
...@@ -321,9 +321,9 @@ public class ExcelReader { ...@@ -321,9 +321,9 @@ public class ExcelReader {
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
ExcelReader readExcel = new ExcelReader(); ExcelReader readExcel = new ExcelReader();
readExcel.openFile("C:\\all.xls"); readExcel.openFile("C:\\all.xls");
/* 设置读取索引为0的工作表 */ /* ���ö�ȡ����Ϊ0�Ĺ����� */
readExcel.setSheetNum(0); readExcel.setSheetNum(0);
//总行数 //������
int count = readExcel.getRowCount(); int count = readExcel.getRowCount();
System.out.println(readExcel.readStringExcelCell(1, 5)); System.out.println(readExcel.readStringExcelCell(1, 5));
for (int i = 0; i <= count; i++) { for (int i = 0; i <= count; i++) {
......
package im.zhaojun.common.util; package im.dx.common.util;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
......
package im.zhaojun.common.util; package im.dx.common.util;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
......
package im.zhaojun.common.util; package im.dx.common.util;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
......
package im.zhaojun.common.util; package im.dx.common.util;
import java.io.Serializable; import java.io.Serializable;
......
package im.zhaojun.common.util; package im.dx.common.util;
import im.zhaojun.system.model.User; import im.dx.system.model.User;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.UnauthenticatedException; import org.apache.shiro.authz.UnauthenticatedException;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
......
package im.zhaojun.common.util; package im.dx.common.util;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
......
package im.zhaojun.common.util; package im.dx.common.util;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy; import java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy;
......
package im.zhaojun.common.util; package im.dx.common.util;
import im.zhaojun.common.exception.TreeCastException; import im.dx.common.exception.TreeCastException;
import im.dx.system.model.UserRoleTree;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayDeque; import java.util.*;
import java.util.ArrayList; import java.util.stream.Collectors;
import java.util.List;
import java.util.Queue;
public class TreeUtil { public class TreeUtil {
...@@ -101,6 +100,24 @@ public class TreeUtil { ...@@ -101,6 +100,24 @@ public class TreeUtil {
throw new TreeCastException(e); throw new TreeCastException(e);
} }
} }
private static List<UserRoleTree> getChildCategoryList(UserRoleTree menu, List<UserRoleTree> button) {
//当前对象的pid==传进来的集合里面的id 根据这个关系去确定是否是子集
return button.stream().filter(o -> o.getParentid().equals(menu.getId()))
//递归查询
.peek(o -> o.setChildren(getChildCategoryList(o, button)))
.collect(Collectors.toList());
}
public static List<UserRoleTree> getTree( List<UserRoleTree> roleInfoVoList) {
//用java8新特性 stream的filter对付目录进行过滤获取
return roleInfoVoList.stream()
.filter(o -> o.getParentid() ==0)
.peek(o -> o.setChildren(getChildCategoryList(o, roleInfoVoList)))
//返回list集合
.collect(Collectors.toList());
}
/** /**
* 集合转树结构 * 集合转树结构
......
package im.zhaojun.common.util; package im.dx.common.util;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
......
package im.zhaojun.common.validate.groups; package im.dx.common.validate.groups;
import javax.validation.groups.Default; import javax.validation.groups.Default;
......
package im.zhaojun.common.validate.groups; package im.dx.common.validate.groups;
import javax.validation.groups.Default; import javax.validation.groups.Default;
......
package im.zhaojun.common.validate.groups; package im.dx.common.validate.groups;
import javax.validation.groups.Default; import javax.validation.groups.Default;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.Alarm; import im.dx.system.model.Alarm;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.Code; import im.dx.system.model.Code;
import im.zhaojun.system.model.VideoeRecordType; import im.dx.system.model.VideoeRecordType;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.Dept; import im.dx.system.model.Dept;
import im.zhaojun.system.model.DeptTree; import im.dx.system.model.DeptTree;
import im.zhaojun.system.model.DeptVideo; import im.dx.system.model.DeptVideo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.DeptTree; import im.dx.system.model.DeptTree;
import im.zhaojun.system.model.VideoeRecordType; import im.dx.system.model.VideoeRecordType;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.LoginLog; import im.dx.system.model.LoginLog;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.Menu; import im.dx.system.model.Menu;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.Operator; import im.dx.system.model.Operator;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.Role; import im.dx.system.model.Role;
import im.dx.system.model.TaskParams;
import im.dx.system.model.UserRoleTree;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -20,4 +23,7 @@ public interface RoleMapper { ...@@ -20,4 +23,7 @@ public interface RoleMapper {
List<Role> selectAllByQuery(Role roleQuery); List<Role> selectAllByQuery(Role roleQuery);
int count(); int count();
List<UserRoleTree> queryRoleUserTree();
int addtaskinfo(@Param("taskParams") TaskParams taskParams);
} }
\ No newline at end of file
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.RoleOperator; import im.dx.system.model.RoleOperator;
import im.dx.system.model.UserRoleTree;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface RoleOperatorMapper { public interface RoleOperatorMapper {
int insert(RoleOperator roleOperator); int insert(RoleOperator roleOperator);
...@@ -21,5 +24,4 @@ public interface RoleOperatorMapper { ...@@ -21,5 +24,4 @@ public interface RoleOperatorMapper {
int deleterecordtypeByRoleId(@Param("roleId") Integer roleId); int deleterecordtypeByRoleId(@Param("roleId") Integer roleId);
} }
\ No newline at end of file
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.SysLog; import im.dx.system.model.SysLog;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.DeviceChannelid; import im.dx.system.model.DeviceChannelid;
import im.zhaojun.system.model.Traffalarmrecord; import im.dx.system.model.Traffalarmrecord;
import im.zhaojun.system.model.TraffalarmrecordResult; import im.dx.system.model.TraffalarmrecordResult;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.additional.dialect.oracle.InsertListMapper; import tk.mybatis.mapper.additional.dialect.oracle.InsertListMapper;
import tk.mybatis.mapper.common.BaseMapper; import tk.mybatis.mapper.common.BaseMapper;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.SbtdspsrParams; import im.dx.system.model.SbtdspsrParams;
import im.zhaojun.system.model.SbtdspsrResult; import im.dx.system.model.SbtdspsrResult;
import im.zhaojun.system.model.Traffdevicewriteresult; import im.dx.system.model.Traffdevicewriteresult;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.additional.dialect.oracle.InsertListMapper; import tk.mybatis.mapper.additional.dialect.oracle.InsertListMapper;
import tk.mybatis.mapper.common.BaseMapper; import tk.mybatis.mapper.common.BaseMapper;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.*; import im.dx.system.model.*;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -9,27 +9,6 @@ import java.util.Map; ...@@ -9,27 +9,6 @@ import java.util.Map;
@Mapper @Mapper
public interface TrafficStatisticsMapper { public interface TrafficStatisticsMapper {
List<Map> selectVehicles(@Param("starttime") String starttime, @Param("endtime") String endtime, @Param("deptId") String deptid);
List<Map> selectFlowStatus(@Param("starttime") String starttime, @Param("endtime") String endtime, @Param("deptId") String videoid);
List<Map> selectVehiclesTypes(@Param("starttime") String starttime, @Param("endtime") String endtime, @Param("deptId") String deptid);
List<Map> selectAlarms(@Param("starttime") String starttime, @Param("endtime") String endtime, @Param("deptId") String deptid);
List<Map> selectAlarmsTypes(@Param("starttime") String starttime, @Param("endtime") String endtime, @Param("deptId") String deptid);
List<Map> selectAlarmsByVideoName(@Param("videoname") String videoname, @Param("starttime") String starttime, @Param("endtime") String endtime, @Param("topnum") Integer topnum);
List<VehiclesStatistic> selectVehiclesByVideoIdAndType(Map map);
List<VehiclesStatisticResult> selectStatisVehiclesByVideoIdAndType(Map map);
List<VehiclesStatisticResult> selectVehiclesStatisByVideoIdAndType(Map map);
List<VehiclesStatisticResult> selectVehiclesByMutiParam(Map map);
List<Alarm> selectAlarmsByTime(Map map);
Role selectByPrimaryKey(@Param("roleId") Integer roleId); Role selectByPrimaryKey(@Param("roleId") Integer roleId);
...@@ -37,24 +16,17 @@ public interface TrafficStatisticsMapper { ...@@ -37,24 +16,17 @@ public interface TrafficStatisticsMapper {
List<Role> selectAll(); List<Role> selectAll();
List<Role> selectAllByQuery(Role roleQuery);
int count(); int count();
List<CodeData> selectCodeByCodeid(@Param("codeid") String codeid, @Param("level") String level); List<CodeData> selectCodeByCodeid(@Param("codeid") String codeid, @Param("level") String level);
List<Map> selectvideoVehiclesOrAlarms(Map map);
List<TraffpictureParam> queryTraffalarmrecordByPage(Map map); List<TraffpictureParam> queryTraffalarmrecordByPage(Map map);
int updateTraffalarmrecordById(@Param(value = "list") List<TraffpictureParam> recordlist); int updateTraffalarmrecordById(@Param(value = "list") List<TraffpictureParam> recordlist);
List<VehiclesStatisticResult> todayvehiclesByVideoId(Map map);
List<VehiclesStatisticResult> todayvehiclesByeveryhour(Map map);
List<RecordResult> todaytraffRecordByeveryhour(Map map);
List<RecordResult> todaytraffRecords(Map map); List<RecordResult> todaytraffRecords(Map map);
...@@ -68,10 +40,6 @@ public interface TrafficStatisticsMapper { ...@@ -68,10 +40,6 @@ public interface TrafficStatisticsMapper {
List<Traffalarmrecordstate> selecteventresultBypage(TraffalarmrecordstatParams params); List<Traffalarmrecordstate> selecteventresultBypage(TraffalarmrecordstatParams params);
List<TraffalarmrecordResult> selectTraffalarmrecordAllByPage(@Param("recordtype") String recordtype, @Param("areaid") Long areaid, @Param("checkstatus") Integer checkstatus,
@Param("starttime") String starttime, @Param("endtime") String endtime, @Param("pushstatus") Integer pushstatus);
int updateVideochecktime(@Param(value = "list") List<TraffpictureParam> recordlist);
int deleteTraffalarmrecordById(String recordid); int deleteTraffalarmrecordById(String recordid);
...@@ -84,4 +52,7 @@ public interface TrafficStatisticsMapper { ...@@ -84,4 +52,7 @@ public interface TrafficStatisticsMapper {
List<Face> queryTraffFaceDetail(String id); List<Face> queryTraffFaceDetail(String id);
List<PeopleRideBicyc> queryTraffPeopleRideBicycDetail(String id); List<PeopleRideBicyc> queryTraffPeopleRideBicycDetail(String id);
int delTraffalarmrecordByIds(@Param(value = "list") List<TraffpictureParam> recordlist);
int deltaskinfoByIds(@Param(value = "list") List<TraffpictureParam> recordlist);
} }
\ No newline at end of file
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.UserAuths; import im.dx.system.model.UserAuths;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.User; import im.dx.system.model.User;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.UserRole; import im.dx.system.model.UserRole;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package im.zhaojun.system.mapper; package im.dx.system.mapper;
import im.zhaojun.system.model.Sbtdspsr; import im.dx.system.model.Sbtdspsr;
import im.zhaojun.system.model.Video; import im.dx.system.model.Video;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -14,4 +14,5 @@ public interface VideoMapper { ...@@ -14,4 +14,5 @@ public interface VideoMapper {
int insert(Sbtdspsr video); int insert(Sbtdspsr video);
void delete(String id); void delete(String id);
void updateByPrimaryKey(Sbtdspsr video); void updateByPrimaryKey(Sbtdspsr video);
int taskExists(String tsakno);
} }
\ No newline at end of file
package im.zhaojun.system.model; package im.dx.system.model;
public class Alarm { public class Alarm {
private String id; private String id;
......
package im.zhaojun.system.model; package im.dx.system.model;
public class Car { public class Car {
String obj_id; String obj_id;
......
package im.zhaojun.system.model; package im.dx.system.model;
import java.io.Serializable; import java.io.Serializable;
......
package im.zhaojun.system.model; package im.dx.system.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
public class CodeData implements Serializable { public class CodeData implements Serializable {
......
package im.zhaojun.system.model; package im.dx.system.model;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
public class Dept implements Serializable { public class Dept implements Serializable {
......
package im.zhaojun.system.model; package im.dx.system.model;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
......
package im.zhaojun.system.model; package im.dx.system.model;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
......
package im.zhaojun.system.model; package im.dx.system.model;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
......
package im.zhaojun.system.model; package im.dx.system.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class Face { public class Face {
private Long id; private Long id;
......
/** /**
* Copyright 2021 json.cn * Copyright 2021 json.cn
*/ */
package im.zhaojun.system.model; package im.dx.system.model;
public class FaceBoundingBox { public class FaceBoundingBox {
......
/** /**
* Copyright 2021 json.cn * Copyright 2021 json.cn
*/ */
package im.zhaojun.system.model; package im.dx.system.model;
public class HeadBoundingBox { public class HeadBoundingBox {
......
package im.zhaojun.system.model; package im.dx.system.model;
import java.util.Date;
public class LoginLog{ public class LoginLog{
private Integer id; private Integer id;
......
/** /**
* Copyright 2021 json.cn * Copyright 2021 json.cn
*/ */
package im.zhaojun.system.model; package im.dx.system.model;
public class LowerBoundingBox { public class LowerBoundingBox {
......
package im.zhaojun.system.model; package im.dx.system.model;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
public class Menu implements Serializable { public class Menu implements Serializable {
......
/** /**
* Copyright 2021 json.cn * Copyright 2021 json.cn
*/ */
package im.zhaojun.system.model; package im.dx.system.model;
public class ObjectBoundingBox { public class ObjectBoundingBox {
......
package im.zhaojun.system.model; package im.dx.system.model;
import java.util.Date;
public class Operator { public class Operator {
/** /**
......
package im.zhaojun.system.model; package im.dx.system.model;
public class PeopleRideBicyc { public class PeopleRideBicyc {
......
package im.dx.system.model;
public class Point {
int x;
int y;
int w;
int h;
public Point() {
}
public Point(int x, int y, int w, int h) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
}
public Point(int x, int y) {
this.x = x;
this.y = y;
}
public int getW() {
return w;
}
public void setW(int w) {
this.w = w;
}
public int getH() {
return h;
}
public void setH(int h) {
this.h = h;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
}
package im.dx.system.model;
public class PointFour {
int x;
int y;
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
}
package im.dx.system.model;
import java.io.Serializable;
public class QuartzTaskInformations implements Serializable {
private Long id;
private Integer version;
private String taskno;
private String taskname;
private String schedulerrule;
private String frozenstatus;
private String executorno;
private Long frozentime;
private Long unfrozentime;
private Long createtime;
private Long lastmodifytime;
private String sendtype;
private String url;
private String executeparamter;
private String timekey;
private Long objectx;
private Long objecty;
private Long objectw;
private Long objecth;
private String recordtype;
private String metatype;
private String imgsrc;
private String rtsp;
private String videoid;
public String getVideoid() {
return videoid;
}
public void setVideoid(String videoid) {
this.videoid = videoid;
}
public String getImgsrc() {
return imgsrc;
}
public void setImgsrc(String imgsrc) {
this.imgsrc = imgsrc;
}
public String getRtsp() {
return rtsp;
}
public void setRtsp(String rtsp) {
this.rtsp = rtsp;
}
public String getMetatype() {
return metatype;
}
public void setMetatype(String metatype) {
this.metatype = metatype;
}
public Long getObjectx() {
return objectx;
}
public void setObjectx(Long objectx) {
this.objectx = objectx;
}
public Long getObjecty() {
return objecty;
}
public void setObjecty(Long objecty) {
this.objecty = objecty;
}
public Long getObjectw() {
return objectw;
}
public void setObjectw(Long objectw) {
this.objectw = objectw;
}
public Long getObjecth() {
return objecth;
}
public void setObjecth(Long objecth) {
this.objecth = objecth;
}
public String getRecordtype() {
return recordtype;
}
public void setRecordtype(String recordtype) {
this.recordtype = recordtype;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public String getTaskno() {
return taskno;
}
public void setTaskno(String taskno) {
this.taskno = taskno == null ? null : taskno.trim();
}
public String getTaskname() {
return taskname;
}
public void setTaskname(String taskname) {
this.taskname = taskname == null ? null : taskname.trim();
}
public String getSchedulerrule() {
return schedulerrule;
}
public void setSchedulerrule(String schedulerrule) {
this.schedulerrule = schedulerrule == null ? null : schedulerrule.trim();
}
public String getFrozenstatus() {
return frozenstatus;
}
public void setFrozenstatus(String frozenstatus) {
this.frozenstatus = frozenstatus == null ? null : frozenstatus.trim();
}
public String getExecutorno() {
return executorno;
}
public void setExecutorno(String executorno) {
this.executorno = executorno == null ? null : executorno.trim();
}
public Long getFrozentime() {
return frozentime;
}
public void setFrozentime(Long frozentime) {
this.frozentime = frozentime;
}
public Long getUnfrozentime() {
return unfrozentime;
}
public void setUnfrozentime(Long unfrozentime) {
this.unfrozentime = unfrozentime;
}
public Long getCreatetime() {
return createtime;
}
public void setCreatetime(Long createtime) {
this.createtime = createtime;
}
public Long getLastmodifytime() {
return lastmodifytime;
}
public void setLastmodifytime(Long lastmodifytime) {
this.lastmodifytime = lastmodifytime;
}
public String getSendtype() {
return sendtype;
}
public void setSendtype(String sendtype) {
this.sendtype = sendtype == null ? null : sendtype.trim();
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url == null ? null : url.trim();
}
public String getExecuteparamter() {
return executeparamter;
}
public void setExecuteparamter(String executeparamter) {
this.executeparamter = executeparamter == null ? null : executeparamter.trim();
}
public String getTimekey() {
return timekey;
}
public void setTimekey(String timekey) {
this.timekey = timekey == null ? null : timekey.trim();
}
}
package im.zhaojun.system.model; package im.dx.system.model;
import lombok.Data;
public class RecordResult { public class RecordResult {
private String total; private String total;
......
package im.zhaojun.system.model; package im.dx.system.model;
import lombok.Getter; import lombok.Getter;
......
package im.zhaojun.system.model; package im.dx.system.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
public class Role implements Serializable { public class Role implements Serializable {
......
package im.zhaojun.system.model; package im.dx.system.model;
public class RoleMenu { public class RoleMenu {
private Integer roleId; private Integer roleId;
......
package im.zhaojun.system.model; package im.dx.system.model;
public class RoleOperator { public class RoleOperator {
private Integer roleId; private Integer roleId;
......
/** /**
* Copyright 2021 json.cn * Copyright 2021 json.cn
*/ */
package im.zhaojun.system.model; package im.dx.system.model;
public class SafetyBelt { public class SafetyBelt {
......
package im.zhaojun.system.model; package im.dx.system.model;
import javax.persistence.Column; import javax.persistence.Column;
import java.io.Serializable; import java.io.Serializable;
......
package im.zhaojun.system.model; package im.dx.system.model;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
...@@ -9,38 +9,38 @@ import java.util.Date; ...@@ -9,38 +9,38 @@ import java.util.Date;
@Setter @Setter
public class SbtdspsrParams extends Sbtdspsr { public class SbtdspsrParams extends Sbtdspsr {
/** /**
* 创建时间 * ����ʱ��
*/ */
private Date createtime; private Date createtime;
/** /**
* 推送状态(0成功1失败) * ����״̬(0�ɹ�1ʧ��)
*/ */
private Long pushstatus; private Long pushstatus;
/** /**
* 推送描述 * ��������
*/ */
private String pushdesc; private String pushdesc;
/** /**
* 推送次数 * ���ʹ���
*/ */
private Long pushcount; private Long pushcount;
/** /**
* 行政编号 * �������
*/ */
private String xzbh; private String xzbh;
/** /**
* * ��ע
*/ */
private String remark; private String remark;
/** /**
* 行政名称 * ��������
*/ */
private String xztreename; private String xztreename;
......
package im.zhaojun.system.model; package im.dx.system.model;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
...@@ -9,38 +9,38 @@ import java.util.Date; ...@@ -9,38 +9,38 @@ import java.util.Date;
@Setter @Setter
public class SbtdspsrResult extends Sbtdspsr { public class SbtdspsrResult extends Sbtdspsr {
/** /**
* 创建时间 * ����ʱ��
*/ */
private Date createtime; private Date createtime;
/** /**
* 推送状态(0成功1失败) * ����״̬(0�ɹ�1ʧ��)
*/ */
private Long pushstatus; private Long pushstatus;
/** /**
* 推送描述 * ��������
*/ */
private String pushdesc; private String pushdesc;
/** /**
* 推送次数 * ���ʹ���
*/ */
private Long pushcount; private Long pushcount;
/** /**
* 行政编号 * �������
*/ */
private String xzbh; private String xzbh;
/** /**
* * ��ע
*/ */
private String remark; private String remark;
/** /**
* 行政名称 * ��������
*/ */
private String xztreename; private String xztreename;
......
package im.dx.system.model;
import java.util.List;
public class TaskParams {
private List<String> traffid;
private String userid;
public List<String> getTraffid() {
return traffid;
}
public void setTraffid(List<String> traffid) {
this.traffid = traffid;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
}
package im.zhaojun.system.model;
package im.dx.system.model;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Getter;
import lombok.Setter;
import java.util.List; import java.util.List;
/** public class TaskResultObj {
* 自定义响应结构
* @author cp
*/
@Getter
@Setter
public class ResultObj {
// 定义jackson对象
private static final ObjectMapper MAPPER = new ObjectMapper(); private static final ObjectMapper MAPPER = new ObjectMapper();
/** /**
* 响应业务状态 * 响应业务状态
* 200 成功 * 200 成功
* 201 错误 * 201 错误
* 400 参数错误 * 400 参数错误
*/ */
private Integer status; private String errorCode;
/** /**
* 响应消息 * 响应消息
*/ */
private String msg; private String errorMsg;
/** /**
* 响应中的数据 * 响应中的数据
*/ */
private Object data; private Object data;
public static ResultObj error(Integer status, String msg, Object data) { public static TaskResultObj error(String status, String msg, Object data) {
return new ResultObj(status, msg, data); return new TaskResultObj(status, msg, data);
} }
public static ResultObj ok(Object data) { public static TaskResultObj ok(Object data) {
return new ResultObj(data); return new TaskResultObj(data);
} }
public static ResultObj ok() { public static TaskResultObj ok() {
return ok(null); return ok(null);
} }
private ResultObj() { private TaskResultObj() {
} }
public static ResultObj error(Integer status, String msg) { public static TaskResultObj error(String status, String msg) {
return new ResultObj(status, msg, null); return new TaskResultObj(status, msg, null);
} }
private ResultObj(Integer status, String msg, Object data) { private TaskResultObj(String status, String msg, Object data) {
this.status = status; this.errorCode = status;
this.msg = msg; this.errorMsg = msg;
this.data = data; this.data = data;
} }
private ResultObj(Object data) { private TaskResultObj(Object data) {
this.status = 200; this.errorCode = "0";
this.msg = "OK"; this.errorMsg = "success";
this.data = data; this.data = data;
} }
/** /**
* 将json结果集转化为SysResult对象 * 将json结果集转化为SysResult对象
* *
* @param jsonData json数据 * @param jsonData json数据
* @param clazz SysResult中的object类型 * @param clazz SysResult中的object类型
* @return SysResult对象 * @return SysResult对象
*/ */
public static ResultObj formatToPojo(String jsonData, Class<?> clazz) { public static TaskResultObj formatToPojo(String jsonData, Class<?> clazz) {
try { try {
if (clazz == null) { if (clazz == null) {
return MAPPER.readValue(jsonData, ResultObj.class); return MAPPER.readValue(jsonData, TaskResultObj.class);
} }
JsonNode jsonNode = MAPPER.readTree(jsonData); JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data"); JsonNode data = jsonNode.get("data");
...@@ -89,7 +78,7 @@ public class ResultObj { ...@@ -89,7 +78,7 @@ public class ResultObj {
} else if (data.isTextual()) { } else if (data.isTextual()) {
obj = MAPPER.readValue(data.asText(), clazz); obj = MAPPER.readValue(data.asText(), clazz);
} }
return error(jsonNode.get("status").intValue(), jsonNode.get("msg").asText(), obj); return error(jsonNode.get("errorCode").toString(), jsonNode.get("errorMsg").asText(), obj);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return null; return null;
...@@ -97,14 +86,14 @@ public class ResultObj { ...@@ -97,14 +86,14 @@ public class ResultObj {
} }
/** /**
* 没有object对象的转化 * 没有object对象的转化
* *
* @param json 字符串 * @param json 字符串
* @return SysResult对象 * @return SysResult对象
*/ */
public static ResultObj format(String json) { public static TaskResultObj format(String json) {
try { try {
return MAPPER.readValue(json, ResultObj.class); return MAPPER.readValue(json, TaskResultObj.class);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -112,13 +101,13 @@ public class ResultObj { ...@@ -112,13 +101,13 @@ public class ResultObj {
} }
/** /**
* Object是集合转化 * Object是集合转化
* *
* @param jsonData json数据 * @param jsonData json数据
* @param clazz 集合中的类型 * @param clazz 集合中的类型
* @return SysResult对象 * @return SysResult对象
*/ */
public static ResultObj formatToList(String jsonData, Class<?> clazz) { public static TaskResultObj formatToList(String jsonData, Class<?> clazz) {
try { try {
JsonNode jsonNode = MAPPER.readTree(jsonData); JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data"); JsonNode data = jsonNode.get("data");
...@@ -127,20 +116,34 @@ public class ResultObj { ...@@ -127,20 +116,34 @@ public class ResultObj {
obj = MAPPER.readValue(data.traverse(), obj = MAPPER.readValue(data.traverse(),
MAPPER.getTypeFactory().constructCollectionType(List.class, clazz)); MAPPER.getTypeFactory().constructCollectionType(List.class, clazz));
} }
return error(jsonNode.get("status").intValue(), jsonNode.get("msg").asText(), obj); return error(jsonNode.get("errorCode").toString(), jsonNode.get("errorMsg").asText(), obj);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return null; return null;
} }
} }
@Override public String getErrorCode() {
public String toString() { return errorCode;
return "ResultObj{" + }
"status=" + status +
", msg='" + msg + '\'' + public void setErrorCode(String errorCode) {
", data=" + data + this.errorCode = errorCode;
'}'; }
public String getErrorMsg() {
return errorMsg;
} }
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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