Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
H
hzsomms
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZTGK
hzsomms
Commits
db66b0f6
Commit
db66b0f6
authored
Jun 20, 2023
by
hkl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:1.线路管理
parent
66c23824
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1046 additions
and
1051 deletions
+1046
-1051
PageSearch.java
...re/src/main/java/org/jeecg/common/api/dto/PageSearch.java
+18
-0
JeecgTenantParser.java
...main/java/org/jeecg/config/mybatis/JeecgTenantParser.java
+0
-130
TenantContext.java
...src/main/java/org/jeecg/config/mybatis/TenantContext.java
+0
-25
ShiroConfig.java
...ore/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
+72
-72
LightRailController.java
...modules/subwayNetwork/controller/LightRailController.java
+7
-13
SectionStationMapController.java
...subwayNetwork/controller/SectionStationMapController.java
+118
-117
LightRailQueryDTO.java
...rg/jeecg/modules/subwayNetwork/dto/LightRailQueryDTO.java
+15
-0
LightRail.java
...ava/org/jeecg/modules/subwayNetwork/entity/LightRail.java
+37
-22
LightRailMapper.java
...g/jeecg/modules/subwayNetwork/mapper/LightRailMapper.java
+5
-1
LightRailMapper.xml
...eecg/modules/subwayNetwork/mapper/xml/LightRailMapper.xml
+21
-0
ILightRailService.java
...eecg/modules/subwayNetwork/service/ILightRailService.java
+12
-1
LightRailServiceImpl.java
...ules/subwayNetwork/service/impl/LightRailServiceImpl.java
+15
-3
LightRailQueryVO.java
.../org/jeecg/modules/subwayNetwork/vo/LightRailQueryVO.java
+46
-0
LoginController.java
.../org/jeecg/modules/system/controller/LoginController.java
+680
-667
No files found.
jeecg-boot-base-core/src/main/java/org/jeecg/common/api/dto/PageSearch.java
0 → 100644
View file @
db66b0f6
package
org
.
jeecg
.
common
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"统一分页查询"
)
public
class
PageSearch
<
T
>
{
@ApiModelProperty
(
value
=
"当前页码"
)
private
Integer
pageNo
=
1
;
@ApiModelProperty
(
value
=
"每页记录数"
)
private
Integer
pageSize
=
10
;
@ApiModelProperty
(
value
=
"查询载体"
)
private
T
query
;
}
jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/JeecgTenantParser.java
deleted
100644 → 0
View file @
66c23824
//package org.jeecg.config.mybatis;
//
//import com.baomidou.mybatisplus.extension.plugins.tenant.TenantSqlParser;
//import net.sf.jsqlparser.expression.BinaryExpression;
//import net.sf.jsqlparser.expression.Expression;
//import net.sf.jsqlparser.expression.Parenthesis;
//import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
//import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
//import net.sf.jsqlparser.expression.operators.relational.*;
//import net.sf.jsqlparser.schema.Column;
//import net.sf.jsqlparser.schema.Table;
//import net.sf.jsqlparser.statement.select.*;
//
//import java.util.List;
//
///**
// * 复写租户条件
// */
//public class JeecgTenantParser extends TenantSqlParser {
//
// /**
// * @param expression
// * @param table
// * @return
// */
// protected Expression processTableAlias(Expression expression, Table table) {
// String tableAliasName;
// if (table.getAlias() == null) {
// tableAliasName = table.getName();
// } else {
// tableAliasName = table.getAlias().getName();
// }
//
// // in
// if (expression instanceof InExpression) {
// InExpression in = (InExpression) expression;
// if (in.getLeftExpression() instanceof Column) {
// setTableAliasNameForColumn((Column) in.getLeftExpression(), tableAliasName);
// }
//
// // 比较操作
// } else if (expression instanceof BinaryExpression) {
// BinaryExpression compare = (BinaryExpression) expression;
// if (compare.getLeftExpression() instanceof Column) {
// setTableAliasNameForColumn((Column) compare.getLeftExpression(), tableAliasName);
// } else if (compare.getRightExpression() instanceof Column) {
// setTableAliasNameForColumn((Column) compare.getRightExpression(), tableAliasName);
// }
//
// // between
// } else if (expression instanceof Between) {
// Between between = (Between) expression;
// if (between.getLeftExpression() instanceof Column) {
// setTableAliasNameForColumn((Column) between.getLeftExpression(), tableAliasName);
// }
// }
// return expression;
// }
//
// private void setTableAliasNameForColumn(Column column, String tableAliasName) {
// column.setColumnName(tableAliasName + "." + column.getColumnName());
// }
//
// /**
// * 默认是按 tenant_id=1 按等于条件追加
// *
// * @param currentExpression 现有的条件:比如你原来的sql查询条件
// * @param table
// * @return
// */
// @Override
// protected Expression builderExpression(Expression currentExpression, Table table) {
// final Expression tenantExpression = this.getTenantHandler().getTenantId(true);
// Expression appendExpression;
// if (!(tenantExpression instanceof SupportsOldOracleJoinSyntax)) {
// appendExpression = new EqualsTo();
// ((EqualsTo) appendExpression).setLeftExpression(this.getAliasColumn(table));
// ((EqualsTo) appendExpression).setRightExpression(tenantExpression);
// } else {
// appendExpression = processTableAlias(tenantExpression, table);
// }
// if (currentExpression == null) {
// return appendExpression;
// }
// if (currentExpression instanceof BinaryExpression) {
// BinaryExpression binaryExpression = (BinaryExpression) currentExpression;
// if (binaryExpression.getLeftExpression() instanceof FromItem) {
// processFromItem((FromItem) binaryExpression.getLeftExpression());
// }
// if (binaryExpression.getRightExpression() instanceof FromItem) {
// processFromItem((FromItem) binaryExpression.getRightExpression());
// }
// } else if (currentExpression instanceof InExpression) {
// InExpression inExp = (InExpression) currentExpression;
// ItemsList rightItems = inExp.getRightItemsList();
// if (rightItems instanceof SubSelect) {
// processSelectBody(((SubSelect) rightItems).getSelectBody());
// }
// }
// if (currentExpression instanceof OrExpression) {
// return new AndExpression(new Parenthesis(currentExpression), appendExpression);
// } else {
// return new AndExpression(currentExpression, appendExpression);
// }
// }
//
// @Override
// protected void processPlainSelect(PlainSelect plainSelect, boolean addColumn) {
// FromItem fromItem = plainSelect.getFromItem();
// if (fromItem instanceof Table) {
// Table fromTable = (Table) fromItem;
// if (!this.getTenantHandler().doTableFilter(fromTable.getName())) {
// plainSelect.setWhere(builderExpression(plainSelect.getWhere(), fromTable));
// if (addColumn) {
// plainSelect.getSelectItems().add(new SelectExpressionItem(new Column(this.getTenantHandler().getTenantIdColumn())));
// }
// }
// } else {
// processFromItem(fromItem);
// }
// List<Join> joins = plainSelect.getJoins();
// if (joins != null && joins.size() > 0) {
// joins.forEach(j -> {
// processJoin(j);
// processFromItem(j.getRightItem());
// });
// }
// }
//
//}
jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/TenantContext.java
deleted
100644 → 0
View file @
66c23824
//package org.jeecg.config.mybatis;
//
//import lombok.extern.slf4j.Slf4j;
//
///**
// * 多租户 tenant_id存储器
// * @author: jeecg-boot
// */
//@Slf4j
//public class TenantContext {
// private static ThreadLocal<String> currentTenant = new ThreadLocal<>();
//
// public static void setTenant(String tenant) {
// log.debug(" setting tenant to " + tenant);
// currentTenant.set(tenant);
// }
//
// public static String getTenant() {
// return currentTenant.get();
// }
//
// public static void clear(){
// currentTenant.remove();
// }
//}
jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
View file @
db66b0f6
...
@@ -65,89 +65,89 @@ public class ShiroConfig {
...
@@ -65,89 +65,89 @@ public class ShiroConfig {
Map
<
String
,
String
>
filterChainDefinitionMap
=
new
LinkedHashMap
<
String
,
String
>();
Map
<
String
,
String
>
filterChainDefinitionMap
=
new
LinkedHashMap
<
String
,
String
>();
//支持yml方式,配置拦截排除
//支持yml方式,配置拦截排除
if
(
jeecgBaseConfig
!=
null
&&
jeecgBaseConfig
.
getShiro
()!=
null
){
//
if(jeecgBaseConfig!=null && jeecgBaseConfig.getShiro()!=null){
String
shiroExcludeUrls
=
jeecgBaseConfig
.
getShiro
().
getExcludeUrls
();
//
String shiroExcludeUrls = jeecgBaseConfig.getShiro().getExcludeUrls();
if
(
oConvertUtils
.
isNotEmpty
(
shiroExcludeUrls
)){
//
if(oConvertUtils.isNotEmpty(shiroExcludeUrls)){
String
[]
permissionUrl
=
shiroExcludeUrls
.
split
(
","
);
//
String[] permissionUrl = shiroExcludeUrls.split(",");
for
(
String
url
:
permissionUrl
){
//
for(String url : permissionUrl){
filterChainDefinitionMap
.
put
(
url
,
"anon"
);
//
filterChainDefinitionMap.put(url,"anon");
}
//
}
}
//
}
}
//
}
// 配置不会被拦截的链接 顺序判断
//
// 配置不会被拦截的链接 顺序判断
filterChainDefinitionMap
.
put
(
"/sys/cas/client/validateLogin"
,
"anon"
);
//cas验证登录
//
filterChainDefinitionMap.put("/sys/cas/client/validateLogin", "anon"); //cas验证登录
filterChainDefinitionMap
.
put
(
"/sys/randomImage/**"
,
"anon"
);
//登录验证码接口排除
//
filterChainDefinitionMap.put("/sys/randomImage/**", "anon"); //登录验证码接口排除
filterChainDefinitionMap
.
put
(
"/sys/checkCaptcha"
,
"anon"
);
//登录验证码接口排除
//
filterChainDefinitionMap.put("/sys/checkCaptcha", "anon"); //登录验证码接口排除
filterChainDefinitionMap
.
put
(
"/sys/login"
,
"anon"
);
//登录接口排除
//
filterChainDefinitionMap.put("/sys/login", "anon"); //登录接口排除
filterChainDefinitionMap
.
put
(
"/sys/mLogin"
,
"anon"
);
//登录接口排除
//
filterChainDefinitionMap.put("/sys/mLogin", "anon"); //登录接口排除
filterChainDefinitionMap
.
put
(
"/sys/logout"
,
"anon"
);
//登出接口排除
//
filterChainDefinitionMap.put("/sys/logout", "anon"); //登出接口排除
filterChainDefinitionMap
.
put
(
"/sys/thirdLogin/**"
,
"anon"
);
//第三方登录
//
filterChainDefinitionMap.put("/sys/thirdLogin/**", "anon"); //第三方登录
filterChainDefinitionMap
.
put
(
"/sys/getEncryptedString"
,
"anon"
);
//获取加密串
//
filterChainDefinitionMap.put("/sys/getEncryptedString", "anon"); //获取加密串
filterChainDefinitionMap
.
put
(
"/sys/sms"
,
"anon"
);
//短信验证码
//
filterChainDefinitionMap.put("/sys/sms", "anon");//短信验证码
filterChainDefinitionMap
.
put
(
"/sys/phoneLogin"
,
"anon"
);
//手机登录
//
filterChainDefinitionMap.put("/sys/phoneLogin", "anon");//手机登录
filterChainDefinitionMap
.
put
(
"/sys/user/checkOnlyUser"
,
"anon"
);
//校验用户是否存在
//
filterChainDefinitionMap.put("/sys/user/checkOnlyUser", "anon");//校验用户是否存在
filterChainDefinitionMap
.
put
(
"/sys/user/register"
,
"anon"
);
//用户注册
//
filterChainDefinitionMap.put("/sys/user/register", "anon");//用户注册
filterChainDefinitionMap
.
put
(
"/sys/user/phoneVerification"
,
"anon"
);
//用户忘记密码验证手机号
//
filterChainDefinitionMap.put("/sys/user/phoneVerification", "anon");//用户忘记密码验证手机号
filterChainDefinitionMap
.
put
(
"/sys/user/passwordChange"
,
"anon"
);
//用户更改密码
//
filterChainDefinitionMap.put("/sys/user/passwordChange", "anon");//用户更改密码
filterChainDefinitionMap
.
put
(
"/auth/2step-code"
,
"anon"
);
//登录验证码
//
filterChainDefinitionMap.put("/auth/2step-code", "anon");//登录验证码
filterChainDefinitionMap
.
put
(
"/sys/common/static/**"
,
"anon"
);
//图片预览 &下载文件不限制token
//
filterChainDefinitionMap.put("/sys/common/static/**", "anon");//图片预览 &下载文件不限制token
filterChainDefinitionMap
.
put
(
"/sys/common/pdf/**"
,
"anon"
);
//pdf预览
//
filterChainDefinitionMap.put("/sys/common/pdf/**", "anon");//pdf预览
filterChainDefinitionMap
.
put
(
"/generic/**"
,
"anon"
);
//pdf预览需要文件
//
filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件
//
filterChainDefinitionMap
.
put
(
"/sys/getLoginQrcode/**"
,
"anon"
);
//登录二维码
//
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码
filterChainDefinitionMap
.
put
(
"/sys/getQrcodeToken/**"
,
"anon"
);
//监听扫码
//
filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //监听扫码
filterChainDefinitionMap
.
put
(
"/sys/checkAuth"
,
"anon"
);
//授权接口排除
//
filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //授权接口排除
//
//
filterChainDefinitionMap
.
put
(
"/"
,
"anon"
);
//
filterChainDefinitionMap.put("/", "anon");
filterChainDefinitionMap
.
put
(
"/doc.html"
,
"anon"
);
//
filterChainDefinitionMap.put("/doc.html", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.js"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.js", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.css"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.css", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.html"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.html", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.svg"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.svg", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.pdf"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.pdf", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.jpg"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.jpg", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.png"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.png", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.gif"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.gif", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.ico"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.ico", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.ttf"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.ttf", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.woff"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.woff", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.woff2"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.woff2", "anon");
//
filterChainDefinitionMap
.
put
(
"/druid/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/druid/**", "anon");
filterChainDefinitionMap
.
put
(
"/swagger-ui.html"
,
"anon"
);
//
filterChainDefinitionMap.put("/swagger-ui.html", "anon");
filterChainDefinitionMap
.
put
(
"/swagger**/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/swagger**/**", "anon");
filterChainDefinitionMap
.
put
(
"/webjars/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/webjars/**", "anon");
filterChainDefinitionMap
.
put
(
"/v2/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/v2/**", "anon");
//
filterChainDefinitionMap
.
put
(
"/sys/annountCement/show/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/sys/annountCement/show/**", "anon");
//
//积木报表排除
//
//积木报表排除
filterChainDefinitionMap
.
put
(
"/jmreport/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/jmreport/**", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.js.map"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.js.map", "anon");
filterChainDefinitionMap
.
put
(
"/**/*.css.map"
,
"anon"
);
//
filterChainDefinitionMap.put("/**/*.css.map", "anon");
//
//大屏模板例子
//
//大屏模板例子
filterChainDefinitionMap
.
put
(
"/test/bigScreen/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/test/bigScreen/**", "anon");
filterChainDefinitionMap
.
put
(
"/bigscreen/template1/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/bigscreen/template1/**", "anon");
filterChainDefinitionMap
.
put
(
"/bigscreen/template1/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/bigscreen/template1/**", "anon");
//filterChainDefinitionMap.put("/test/jeecgDemo/rabbitMqClientTest/**", "anon"); //MQ测试
//filterChainDefinitionMap.put("/test/jeecgDemo/rabbitMqClientTest/**", "anon"); //MQ测试
//filterChainDefinitionMap.put("/test/jeecgDemo/html", "anon"); //模板页面
//filterChainDefinitionMap.put("/test/jeecgDemo/html", "anon"); //模板页面
//filterChainDefinitionMap.put("/test/jeecgDemo/redis/**", "anon"); //redis测试
//filterChainDefinitionMap.put("/test/jeecgDemo/redis/**", "anon"); //redis测试
//websocket排除
//websocket排除
filterChainDefinitionMap
.
put
(
"/websocket/**"
,
"anon"
);
//系统通知和公告
//
filterChainDefinitionMap.put("/websocket/**", "anon");//系统通知和公告
filterChainDefinitionMap
.
put
(
"/newsWebsocket/**"
,
"anon"
);
//CMS模块
//
filterChainDefinitionMap.put("/newsWebsocket/**", "anon");//CMS模块
filterChainDefinitionMap
.
put
(
"/vxeSocket/**"
,
"anon"
);
//JVxeTable无痕刷新示例
//
filterChainDefinitionMap.put("/vxeSocket/**", "anon");//JVxeTable无痕刷新示例
//性能监控——安全隐患泄露TOEKN(durid连接池也有)
//性能监控——安全隐患泄露TOEKN(durid连接池也有)
//filterChainDefinitionMap.put("/actuator/**", "anon");
//filterChainDefinitionMap.put("/actuator/**", "anon");
//测试模块排除
//测试模块排除
filterChainDefinitionMap
.
put
(
"/test/seata/**"
,
"anon"
);
//
filterChainDefinitionMap.put("/test/seata/**", "anon");
// update-begin--author:liusq Date:20230522 for:[issues/4829]访问不存在的url时会提示Token失效,请重新登录呢
// update-begin--author:liusq Date:20230522 for:[issues/4829]访问不存在的url时会提示Token失效,请重新登录呢
//错误路径排除
//错误路径排除
filterChainDefinitionMap
.
put
(
"/
error
"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/
**
"
,
"anon"
);
// update-end--author:liusq Date:20230522 for:[issues/4829]访问不存在的url时会提示Token失效,请重新登录呢
// update-end--author:liusq Date:20230522 for:[issues/4829]访问不存在的url时会提示Token失效,请重新登录呢
// 添加自己的过滤器并且取名为jwt
// 添加自己的过滤器并且取名为jwt
...
@@ -157,7 +157,7 @@ public class ShiroConfig {
...
@@ -157,7 +157,7 @@ public class ShiroConfig {
filterMap
.
put
(
"jwt"
,
new
JwtFilter
(
cloudServer
==
null
));
filterMap
.
put
(
"jwt"
,
new
JwtFilter
(
cloudServer
==
null
));
shiroFilterFactoryBean
.
setFilters
(
filterMap
);
shiroFilterFactoryBean
.
setFilters
(
filterMap
);
// <!-- 过滤链定义,从上向下顺序执行,一般将/**放在最为下边
// <!-- 过滤链定义,从上向下顺序执行,一般将/**放在最为下边
filterChainDefinitionMap
.
put
(
"/**"
,
"jwt"
);
//
filterChainDefinitionMap.put("/**", "jwt");
// 未授权界面返回JSON
// 未授权界面返回JSON
shiroFilterFactoryBean
.
setUnauthorizedUrl
(
"/sys/common/403"
);
shiroFilterFactoryBean
.
setUnauthorizedUrl
(
"/sys/common/403"
);
...
...
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/controller/LightRailController.java
View file @
db66b0f6
...
@@ -4,8 +4,10 @@ import java.util.Arrays;
...
@@ -4,8 +4,10 @@ import java.util.Arrays;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
org.jeecg.common.api.dto.PageSearch
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.system.query.QueryGenerator
;
import
org.jeecg.common.system.query.QueryGenerator
;
import
org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO
;
import
org.jeecg.modules.subwayNetwork.entity.LightRail
;
import
org.jeecg.modules.subwayNetwork.entity.LightRail
;
import
org.jeecg.modules.subwayNetwork.service.ILightRailService
;
import
org.jeecg.modules.subwayNetwork.service.ILightRailService
;
...
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.jeecg.common.system.base.controller.JeecgController
;
import
org.jeecg.common.system.base.controller.JeecgController
;
import
org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
...
@@ -40,22 +43,13 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
...
@@ -40,22 +43,13 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
/**
/**
* 分页列表查询
* 分页列表查询
*
*
* @param lightRail
* @param pageNo
* @param pageSize
* @param req
* @return
* @return
*/
*/
//@AutoLog(value = "线路车站-轻轨线路-分页列表查询")
//@AutoLog(value = "线路车站-轻轨线路-分页列表查询")
@ApiOperation
(
value
=
"线路车站-轻轨线路-分页列表查询"
,
notes
=
"线路车站-轻轨线路-分页列表查询"
)
@ApiOperation
(
value
=
"线路车站-轻轨线路-分页列表查询"
,
notes
=
"线路车站-轻轨线路-分页列表查询"
)
@GetMapping
(
value
=
"/list"
)
@GetMapping
(
value
=
"/list"
)
public
Result
<
IPage
<
LightRail
>>
queryPageList
(
LightRail
lightRail
,
public
Result
<
IPage
<
LightRailQueryVO
>>
queryPageList
(
PageSearch
<
LightRailQueryDTO
>
dto
)
{
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
IPage
<
LightRailQueryVO
>
pageList
=
lightRailService
.
queryPageList
(
dto
);
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
HttpServletRequest
req
)
{
QueryWrapper
<
LightRail
>
queryWrapper
=
QueryGenerator
.
initQueryWrapper
(
lightRail
,
req
.
getParameterMap
());
Page
<
LightRail
>
page
=
new
Page
<
LightRail
>(
pageNo
,
pageSize
);
IPage
<
LightRail
>
pageList
=
lightRailService
.
page
(
page
,
queryWrapper
);
return
Result
.
OK
(
pageList
);
return
Result
.
OK
(
pageList
);
}
}
...
@@ -98,7 +92,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
...
@@ -98,7 +92,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
@AutoLog
(
value
=
"线路车站-轻轨线路-通过id删除"
)
@AutoLog
(
value
=
"线路车站-轻轨线路-通过id删除"
)
@ApiOperation
(
value
=
"线路车站-轻轨线路-通过id删除"
,
notes
=
"线路车站-轻轨线路-通过id删除"
)
@ApiOperation
(
value
=
"线路车站-轻轨线路-通过id删除"
,
notes
=
"线路车站-轻轨线路-通过id删除"
)
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:delete")
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:delete")
@
Delete
Mapping
(
value
=
"/delete"
)
@
Get
Mapping
(
value
=
"/delete"
)
public
Result
<
String
>
delete
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
public
Result
<
String
>
delete
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
lightRailService
.
removeById
(
id
);
lightRailService
.
removeById
(
id
);
return
Result
.
OK
(
"删除成功!"
);
return
Result
.
OK
(
"删除成功!"
);
...
@@ -113,7 +107,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
...
@@ -113,7 +107,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
@AutoLog
(
value
=
"线路车站-轻轨线路-批量删除"
)
@AutoLog
(
value
=
"线路车站-轻轨线路-批量删除"
)
@ApiOperation
(
value
=
"线路车站-轻轨线路-批量删除"
,
notes
=
"线路车站-轻轨线路-批量删除"
)
@ApiOperation
(
value
=
"线路车站-轻轨线路-批量删除"
,
notes
=
"线路车站-轻轨线路-批量删除"
)
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:deleteBatch")
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:deleteBatch")
@
Delete
Mapping
(
value
=
"/deleteBatch"
)
@
Get
Mapping
(
value
=
"/deleteBatch"
)
public
Result
<
String
>
deleteBatch
(
@RequestParam
(
name
=
"ids"
,
required
=
true
)
String
ids
)
{
public
Result
<
String
>
deleteBatch
(
@RequestParam
(
name
=
"ids"
,
required
=
true
)
String
ids
)
{
this
.
lightRailService
.
removeByIds
(
Arrays
.
asList
(
ids
.
split
(
","
)));
this
.
lightRailService
.
removeByIds
(
Arrays
.
asList
(
ids
.
split
(
","
)));
return
Result
.
OK
(
"批量删除成功!"
);
return
Result
.
OK
(
"批量删除成功!"
);
...
...
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/controller/SectionStationMapController.java
View file @
db66b0f6
...
@@ -3,6 +3,7 @@ package org.jeecg.modules.subwayNetwork.controller;
...
@@ -3,6 +3,7 @@ package org.jeecg.modules.subwayNetwork.controller;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.system.query.QueryGenerator
;
import
org.jeecg.common.system.query.QueryGenerator
;
import
org.jeecg.modules.subwayNetwork.entity.SectionStationMap
;
import
org.jeecg.modules.subwayNetwork.entity.SectionStationMap
;
...
@@ -22,13 +23,13 @@ import io.swagger.annotations.ApiOperation;
...
@@ -22,13 +23,13 @@ import io.swagger.annotations.ApiOperation;
import
org.jeecg.common.aspect.annotation.AutoLog
;
import
org.jeecg.common.aspect.annotation.AutoLog
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
/**
/**
* @Description: 线路车站-区间站点映射
* @Description: 线路车站-区间站点映射
* @Author: jeecg-boot
* @Author: jeecg-boot
* @Date: 2023-06-15
* @Date: 2023-06-15
* @Version: V1.0
* @Version: V1.0
*/
*/
@Api
(
tags
=
"线路车站-区间站点映射"
)
@Api
(
tags
=
"线路车站-区间站点映射"
)
@RestController
@RestController
@RequestMapping
(
"/subwayNetwork/sectionStationMap"
)
@RequestMapping
(
"/subwayNetwork/sectionStationMap"
)
@Slf4j
@Slf4j
...
@@ -46,11 +47,11 @@ public class SectionStationMapController extends JeecgController<SectionStationM
...
@@ -46,11 +47,11 @@ public class SectionStationMapController extends JeecgController<SectionStationM
* @return
* @return
*/
*/
//@AutoLog(value = "线路车站-区间站点映射-分页列表查询")
//@AutoLog(value = "线路车站-区间站点映射-分页列表查询")
@ApiOperation
(
value
=
"线路车站-区间站点映射-分页列表查询"
,
notes
=
"线路车站-区间站点映射-分页列表查询"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-分页列表查询"
,
notes
=
"线路车站-区间站点映射-分页列表查询"
)
@GetMapping
(
value
=
"/list"
)
@GetMapping
(
value
=
"/list"
)
public
Result
<
IPage
<
SectionStationMap
>>
queryPageList
(
SectionStationMap
sectionStationMap
,
public
Result
<
IPage
<
SectionStationMap
>>
queryPageList
(
SectionStationMap
sectionStationMap
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
HttpServletRequest
req
)
{
HttpServletRequest
req
)
{
QueryWrapper
<
SectionStationMap
>
queryWrapper
=
QueryGenerator
.
initQueryWrapper
(
sectionStationMap
,
req
.
getParameterMap
());
QueryWrapper
<
SectionStationMap
>
queryWrapper
=
QueryGenerator
.
initQueryWrapper
(
sectionStationMap
,
req
.
getParameterMap
());
Page
<
SectionStationMap
>
page
=
new
Page
<
SectionStationMap
>(
pageNo
,
pageSize
);
Page
<
SectionStationMap
>
page
=
new
Page
<
SectionStationMap
>(
pageNo
,
pageSize
);
...
@@ -65,8 +66,8 @@ public class SectionStationMapController extends JeecgController<SectionStationM
...
@@ -65,8 +66,8 @@ public class SectionStationMapController extends JeecgController<SectionStationM
* @return
* @return
*/
*/
@AutoLog
(
value
=
"线路车站-区间站点映射-添加"
)
@AutoLog
(
value
=
"线路车站-区间站点映射-添加"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-添加"
,
notes
=
"线路车站-区间站点映射-添加"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-添加"
,
notes
=
"线路车站-区间站点映射-添加"
)
@RequiresPermissions
(
"subwayNetwork:t_sn_section_station_map:add"
)
//
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:add")
@PostMapping
(
value
=
"/add"
)
@PostMapping
(
value
=
"/add"
)
public
Result
<
String
>
add
(
@RequestBody
SectionStationMap
sectionStationMap
)
{
public
Result
<
String
>
add
(
@RequestBody
SectionStationMap
sectionStationMap
)
{
sectionStationMapService
.
save
(
sectionStationMap
);
sectionStationMapService
.
save
(
sectionStationMap
);
...
@@ -80,9 +81,9 @@ public class SectionStationMapController extends JeecgController<SectionStationM
...
@@ -80,9 +81,9 @@ public class SectionStationMapController extends JeecgController<SectionStationM
* @return
* @return
*/
*/
@AutoLog
(
value
=
"线路车站-区间站点映射-编辑"
)
@AutoLog
(
value
=
"线路车站-区间站点映射-编辑"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-编辑"
,
notes
=
"线路车站-区间站点映射-编辑"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-编辑"
,
notes
=
"线路车站-区间站点映射-编辑"
)
@RequiresPermissions
(
"subwayNetwork:t_sn_section_station_map:edit"
)
//
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:edit")
@RequestMapping
(
value
=
"/edit"
,
method
=
{
RequestMethod
.
PUT
,
RequestMethod
.
POST
}
)
@RequestMapping
(
value
=
"/edit"
,
method
=
RequestMethod
.
POST
)
public
Result
<
String
>
edit
(
@RequestBody
SectionStationMap
sectionStationMap
)
{
public
Result
<
String
>
edit
(
@RequestBody
SectionStationMap
sectionStationMap
)
{
sectionStationMapService
.
updateById
(
sectionStationMap
);
sectionStationMapService
.
updateById
(
sectionStationMap
);
return
Result
.
OK
(
"编辑成功!"
);
return
Result
.
OK
(
"编辑成功!"
);
...
@@ -95,10 +96,10 @@ public class SectionStationMapController extends JeecgController<SectionStationM
...
@@ -95,10 +96,10 @@ public class SectionStationMapController extends JeecgController<SectionStationM
* @return
* @return
*/
*/
@AutoLog
(
value
=
"线路车站-区间站点映射-通过id删除"
)
@AutoLog
(
value
=
"线路车站-区间站点映射-通过id删除"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-通过id删除"
,
notes
=
"线路车站-区间站点映射-通过id删除"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-通过id删除"
,
notes
=
"线路车站-区间站点映射-通过id删除"
)
@RequiresPermissions
(
"subwayNetwork:t_sn_section_station_map:delete"
)
//
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:delete")
@Delete
Mapping
(
value
=
"/delete"
)
@Get
Mapping
(
value
=
"/delete"
)
public
Result
<
String
>
delete
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
public
Result
<
String
>
delete
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
sectionStationMapService
.
removeById
(
id
);
sectionStationMapService
.
removeById
(
id
);
return
Result
.
OK
(
"删除成功!"
);
return
Result
.
OK
(
"删除成功!"
);
}
}
...
@@ -110,10 +111,10 @@ public class SectionStationMapController extends JeecgController<SectionStationM
...
@@ -110,10 +111,10 @@ public class SectionStationMapController extends JeecgController<SectionStationM
* @return
* @return
*/
*/
@AutoLog
(
value
=
"线路车站-区间站点映射-批量删除"
)
@AutoLog
(
value
=
"线路车站-区间站点映射-批量删除"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-批量删除"
,
notes
=
"线路车站-区间站点映射-批量删除"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-批量删除"
,
notes
=
"线路车站-区间站点映射-批量删除"
)
@RequiresPermissions
(
"subwayNetwork:t_sn_section_station_map:deleteBatch"
)
@RequiresPermissions
(
"subwayNetwork:t_sn_section_station_map:deleteBatch"
)
@Delete
Mapping
(
value
=
"/deleteBatch"
)
@Get
Mapping
(
value
=
"/deleteBatch"
)
public
Result
<
String
>
deleteBatch
(
@RequestParam
(
name
=
"ids"
,
required
=
true
)
String
ids
)
{
public
Result
<
String
>
deleteBatch
(
@RequestParam
(
name
=
"ids"
,
required
=
true
)
String
ids
)
{
this
.
sectionStationMapService
.
removeByIds
(
Arrays
.
asList
(
ids
.
split
(
","
)));
this
.
sectionStationMapService
.
removeByIds
(
Arrays
.
asList
(
ids
.
split
(
","
)));
return
Result
.
OK
(
"批量删除成功!"
);
return
Result
.
OK
(
"批量删除成功!"
);
}
}
...
@@ -125,11 +126,11 @@ public class SectionStationMapController extends JeecgController<SectionStationM
...
@@ -125,11 +126,11 @@ public class SectionStationMapController extends JeecgController<SectionStationM
* @return
* @return
*/
*/
//@AutoLog(value = "线路车站-区间站点映射-通过id查询")
//@AutoLog(value = "线路车站-区间站点映射-通过id查询")
@ApiOperation
(
value
=
"线路车站-区间站点映射-通过id查询"
,
notes
=
"线路车站-区间站点映射-通过id查询"
)
@ApiOperation
(
value
=
"线路车站-区间站点映射-通过id查询"
,
notes
=
"线路车站-区间站点映射-通过id查询"
)
@GetMapping
(
value
=
"/queryById"
)
@GetMapping
(
value
=
"/queryById"
)
public
Result
<
SectionStationMap
>
queryById
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
public
Result
<
SectionStationMap
>
queryById
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
SectionStationMap
sectionStationMap
=
sectionStationMapService
.
getById
(
id
);
SectionStationMap
sectionStationMap
=
sectionStationMapService
.
getById
(
id
);
if
(
sectionStationMap
==
null
)
{
if
(
sectionStationMap
==
null
)
{
return
Result
.
error
(
"未找到对应数据"
);
return
Result
.
error
(
"未找到对应数据"
);
}
}
return
Result
.
OK
(
sectionStationMap
);
return
Result
.
OK
(
sectionStationMap
);
...
@@ -141,7 +142,7 @@ public class SectionStationMapController extends JeecgController<SectionStationM
...
@@ -141,7 +142,7 @@ public class SectionStationMapController extends JeecgController<SectionStationM
* @param request
* @param request
* @param sectionStationMap
* @param sectionStationMap
*/
*/
@RequiresPermissions
(
"subwayNetwork:t_sn_section_station_map:exportXls"
)
//
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:exportXls")
@RequestMapping
(
value
=
"/exportXls"
)
@RequestMapping
(
value
=
"/exportXls"
)
public
ModelAndView
exportXls
(
HttpServletRequest
request
,
SectionStationMap
sectionStationMap
)
{
public
ModelAndView
exportXls
(
HttpServletRequest
request
,
SectionStationMap
sectionStationMap
)
{
return
super
.
exportXls
(
request
,
sectionStationMap
,
SectionStationMap
.
class
,
"线路车站-区间站点映射"
);
return
super
.
exportXls
(
request
,
sectionStationMap
,
SectionStationMap
.
class
,
"线路车站-区间站点映射"
);
...
@@ -154,7 +155,7 @@ public class SectionStationMapController extends JeecgController<SectionStationM
...
@@ -154,7 +155,7 @@ public class SectionStationMapController extends JeecgController<SectionStationM
* @param response
* @param response
* @return
* @return
*/
*/
@RequiresPermissions
(
"subwayNetwork:t_sn_section_station_map:importExcel"
)
//
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:importExcel")
@RequestMapping
(
value
=
"/importExcel"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/importExcel"
,
method
=
RequestMethod
.
POST
)
public
Result
<?>
importExcel
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
Result
<?>
importExcel
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
return
super
.
importExcel
(
request
,
response
,
SectionStationMap
.
class
);
return
super
.
importExcel
(
request
,
response
,
SectionStationMap
.
class
);
...
...
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/dto/LightRailQueryDTO.java
0 → 100644
View file @
db66b0f6
package
org
.
jeecg
.
modules
.
subwayNetwork
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"线路DTO"
)
public
class
LightRailQueryDTO
{
@ApiModelProperty
(
value
=
"线路code"
)
private
String
railLineCode
;
@ApiModelProperty
(
value
=
"状态"
)
private
String
status
;
}
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/entity/LightRail.java
View file @
db66b0f6
...
@@ -4,10 +4,8 @@ import java.io.Serializable;
...
@@ -4,10 +4,8 @@ import java.io.Serializable;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.Date
;
import
java.util.Date
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
lombok.Data
;
import
lombok.Data
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
...
@@ -28,40 +26,57 @@ import lombok.experimental.Accessors;
...
@@ -28,40 +26,57 @@ import lombok.experimental.Accessors;
@TableName
(
"t_sn_light_rail"
)
@TableName
(
"t_sn_light_rail"
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"t_sn_light_rail对象"
,
description
=
"线路车站-轻轨线路"
)
@ApiModel
(
value
=
"t_sn_light_rail对象"
,
description
=
"线路车站-轻轨线路"
)
public
class
LightRail
implements
Serializable
{
public
class
LightRail
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**主键*/
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
value
=
"主键"
)
@ApiModelProperty
(
value
=
"主键"
)
private
java
.
lang
.
String
id
;
private
java
.
lang
.
String
id
;
/**创建人*/
/**
* 创建人
*/
@ApiModelProperty
(
value
=
"创建人"
)
@ApiModelProperty
(
value
=
"创建人"
)
private
java
.
lang
.
String
createBy
;
private
java
.
lang
.
String
createBy
;
/**创建日期*/
/**
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
* 创建日期
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建日期"
)
@ApiModelProperty
(
value
=
"创建日期"
)
private
java
.
util
.
Date
createTime
;
private
java
.
util
.
Date
createTime
;
/**更新人*/
/**
* 更新人
*/
@ApiModelProperty
(
value
=
"更新人"
)
@ApiModelProperty
(
value
=
"更新人"
)
private
java
.
lang
.
String
updateBy
;
private
java
.
lang
.
String
updateBy
;
/**更新日期*/
/**
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
* 更新日期
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新日期"
)
@ApiModelProperty
(
value
=
"更新日期"
)
private
java
.
util
.
Date
updateTime
;
private
java
.
util
.
Date
updateTime
;
/**线路名称*/
/**
* 线路名称
*/
@Excel
(
name
=
"线路名称"
,
width
=
15
)
@Excel
(
name
=
"线路名称"
,
width
=
15
)
@ApiModelProperty
(
value
=
"线路名称"
)
@ApiModelProperty
(
value
=
"线路名称"
)
private
java
.
lang
.
String
railLineName
;
private
java
.
lang
.
String
railLineName
;
/**线路code*/
/**
* 线路code
*/
@Excel
(
name
=
"线路code"
,
width
=
15
)
@Excel
(
name
=
"线路code"
,
width
=
15
)
@ApiModelProperty
(
value
=
"线路code"
)
@ApiModelProperty
(
value
=
"线路code"
)
private
java
.
lang
.
String
railLineCode
;
private
java
.
lang
.
String
railLineCode
;
/**状态*/
/**
* 状态
*/
@Excel
(
name
=
"状态"
,
width
=
15
)
@Excel
(
name
=
"状态"
,
width
=
15
)
@ApiModelProperty
(
value
=
"状态"
)
@ApiModelProperty
(
value
=
"状态"
)
private
java
.
lang
.
String
status
;
private
java
.
lang
.
String
status
;
}
}
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/mapper/LightRailMapper.java
View file @
db66b0f6
package
org
.
jeecg
.
modules
.
subwayNetwork
.
mapper
;
package
org
.
jeecg
.
modules
.
subwayNetwork
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO
;
import
org.jeecg.modules.subwayNetwork.entity.LightRail
;
import
org.jeecg.modules.subwayNetwork.entity.LightRail
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO
;
/**
/**
* @Description: 线路车站-轻轨线路
* @Description: 线路车站-轻轨线路
...
@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
LightRailMapper
extends
BaseMapper
<
LightRail
>
{
public
interface
LightRailMapper
extends
BaseMapper
<
LightRail
>
{
IPage
<
LightRailQueryVO
>
queryPageList
(
IPage
<
LightRailQueryVO
>
page
,
LightRailQueryDTO
query
);
}
}
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/mapper/xml/LightRailMapper.xml
View file @
db66b0f6
...
@@ -2,4 +2,25 @@
...
@@ -2,4 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.jeecg.modules.subwayNetwork.mapper.LightRailMapper"
>
<mapper
namespace=
"org.jeecg.modules.subwayNetwork.mapper.LightRailMapper"
>
<select
id=
"queryPageList"
resultType=
"org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO"
>
SELECT
t1.create_by,
t1.create_time,
t1.id,
t1.rail_line_code,
t1.rail_line_name,
t1.status,
t1.update_by,
t1.update_time,
count(t2.id) subwaySectionNum,
count(t3.id) trainStationNum,
sum(t3.end_mileage) lineMileage
FROM
t_sn_light_rail t1
LEFT JOIN t_sn_subway_section t2 ON t1.id = t2.rail_id
LEFT JOIN t_sn_train_station t3 ON t1.id = t3.light_rail_id
WHERE 1=1
GROUP BY t1.id
</select>
</mapper>
</mapper>
\ No newline at end of file
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/service/ILightRailService.java
View file @
db66b0f6
package
org
.
jeecg
.
modules
.
subwayNetwork
.
service
;
package
org
.
jeecg
.
modules
.
subwayNetwork
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.jeecg.common.api.dto.PageSearch
;
import
org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO
;
import
org.jeecg.modules.subwayNetwork.entity.LightRail
;
import
org.jeecg.modules.subwayNetwork.entity.LightRail
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO
;
/**
/**
* @Description: 线路车站-轻轨线路
* @Description: 线路车站-轻轨线路
...
@@ -11,4 +15,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -11,4 +15,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
*/
public
interface
ILightRailService
extends
IService
<
LightRail
>
{
public
interface
ILightRailService
extends
IService
<
LightRail
>
{
/**
* 分页查询
*
* @param dto
* @return
*/
IPage
<
LightRailQueryVO
>
queryPageList
(
PageSearch
<
LightRailQueryDTO
>
dto
);
}
}
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/service/impl/LightRailServiceImpl.java
View file @
db66b0f6
package
org
.
jeecg
.
modules
.
subwayNetwork
.
service
.
impl
;
package
org
.
jeecg
.
modules
.
subwayNetwork
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.jeecg.common.api.dto.PageSearch
;
import
org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO
;
import
org.jeecg.modules.subwayNetwork.entity.LightRail
;
import
org.jeecg.modules.subwayNetwork.entity.LightRail
;
import
org.jeecg.modules.subwayNetwork.entity.SectionStationMap
;
import
org.jeecg.modules.subwayNetwork.mapper.LightRailMapper
;
import
org.jeecg.modules.subwayNetwork.mapper.LightRailMapper
;
import
org.jeecg.modules.subwayNetwork.service.ILightRailService
;
import
org.jeecg.modules.subwayNetwork.service.ILightRailService
;
import
org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
/**
/**
* @Description: 线路车站-轻轨线路
* @Description: 线路车站-轻轨线路
* @Author: jeecg-boot
* @Author: jeecg-boot
...
@@ -16,4 +21,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...
@@ -16,4 +21,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
@Service
public
class
LightRailServiceImpl
extends
ServiceImpl
<
LightRailMapper
,
LightRail
>
implements
ILightRailService
{
public
class
LightRailServiceImpl
extends
ServiceImpl
<
LightRailMapper
,
LightRail
>
implements
ILightRailService
{
@Override
public
IPage
<
LightRailQueryVO
>
queryPageList
(
PageSearch
<
LightRailQueryDTO
>
dto
)
{
IPage
<
LightRailQueryVO
>
page
=
new
Page
<>(
dto
.
getPageNo
(),
dto
.
getPageSize
());
page
=
this
.
baseMapper
.
queryPageList
(
page
,
dto
.
getQuery
());
return
page
;
}
}
}
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/vo/LightRailQueryVO.java
0 → 100644
View file @
db66b0f6
package
org
.
jeecg
.
modules
.
subwayNetwork
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Data
@ApiModel
(
value
=
"线路VO"
)
public
class
LightRailQueryVO
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
String
id
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createBy
;
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建日期"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新日期"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"线路名称"
)
private
java
.
lang
.
String
railLineName
;
@ApiModelProperty
(
value
=
"线路code"
)
private
java
.
lang
.
String
railLineCode
;
@ApiModelProperty
(
value
=
"状态"
)
private
java
.
lang
.
String
status
;
@ApiModelProperty
(
value
=
"区间数量"
)
private
Integer
subwaySectionNum
;
@ApiModelProperty
(
value
=
"车站数量"
)
private
Integer
trainStationNum
;
@ApiModelProperty
(
value
=
"线路里程"
)
private
BigDecimal
lineMileage
;
}
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java
View file @
db66b0f6
...
@@ -44,7 +44,7 @@ import java.util.*;
...
@@ -44,7 +44,7 @@ import java.util.*;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/sys"
)
@RequestMapping
(
"/sys"
)
@Api
(
tags
=
"用户登录"
)
@Api
(
tags
=
"用户登录"
)
@Slf4j
@Slf4j
public
class
LoginController
{
public
class
LoginController
{
@Autowired
@Autowired
...
@@ -73,12 +73,12 @@ public class LoginController {
...
@@ -73,12 +73,12 @@ public class LoginController {
@ApiOperation
(
"登录接口"
)
@ApiOperation
(
"登录接口"
)
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
POST
)
public
Result
<
JSONObject
>
login
(
@RequestBody
SysLoginModel
sysLoginModel
)
{
public
Result
<
JSONObject
>
login
(
@RequestBody
SysLoginModel
sysLoginModel
)
{
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
String
username
=
sysLoginModel
.
getUsername
();
String
username
=
sysLoginModel
.
getUsername
();
String
password
=
sysLoginModel
.
getPassword
();
String
password
=
sysLoginModel
.
getPassword
();
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
if
(
isLoginFailOvertimes
(
username
))
{
if
(
isLoginFailOvertimes
(
username
))
{
return
result
.
error500
(
"该用户登录失败次数过多,请于10分钟后再次登录!"
);
return
result
.
error500
(
"该用户登录失败次数过多,请于10分钟后再次登录!"
);
}
}
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
...
@@ -89,19 +89,19 @@ public class LoginController {
...
@@ -89,19 +89,19 @@ public class LoginController {
//update-begin-author:taoyan date:20190828 for:校验验证码
//update-begin-author:taoyan date:20190828 for:校验验证码
String
captcha
=
sysLoginModel
.
getCaptcha
();
String
captcha
=
sysLoginModel
.
getCaptcha
();
if
(
captcha
==
null
)
{
if
(
captcha
==
null
)
{
result
.
error500
(
"验证码无效"
);
result
.
error500
(
"验证码无效"
);
return
result
;
return
result
;
}
}
String
lowerCaseCaptcha
=
captcha
.
toLowerCase
();
String
lowerCaseCaptcha
=
captcha
.
toLowerCase
();
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
// 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可
// 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可
String
origin
=
lowerCaseCaptcha
+
sysLoginModel
.
getCheckKey
()+
jeecgBaseConfig
.
getSignatureSecret
();
String
origin
=
lowerCaseCaptcha
+
sysLoginModel
.
getCheckKey
()
+
jeecgBaseConfig
.
getSignatureSecret
();
String
realKey
=
Md5Util
.
md5Encode
(
origin
,
"utf-8"
);
String
realKey
=
Md5Util
.
md5Encode
(
origin
,
"utf-8"
);
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
Object
checkCode
=
redisUtil
.
get
(
realKey
);
Object
checkCode
=
redisUtil
.
get
(
realKey
);
//当进入登录页时,有一定几率出现验证码错误 #1714
//当进入登录页时,有一定几率出现验证码错误 #1714
if
(
checkCode
==
null
||
!
checkCode
.
toString
().
equals
(
lowerCaseCaptcha
))
{
if
(
checkCode
==
null
||
!
checkCode
.
toString
().
equals
(
lowerCaseCaptcha
))
{
log
.
warn
(
"验证码错误,key= {} , Ui checkCode= {}, Redis checkCode = {}"
,
sysLoginModel
.
getCheckKey
(),
lowerCaseCaptcha
,
checkCode
);
log
.
warn
(
"验证码错误,key= {} , Ui checkCode= {}, Redis checkCode = {}"
,
sysLoginModel
.
getCheckKey
(),
lowerCaseCaptcha
,
checkCode
);
result
.
error500
(
"验证码错误"
);
result
.
error500
(
"验证码错误"
);
// 改成特殊的code 便于前端判断
// 改成特殊的code 便于前端判断
...
@@ -113,11 +113,11 @@ public class LoginController {
...
@@ -113,11 +113,11 @@ public class LoginController {
//1. 校验用户是否有效
//1. 校验用户是否有效
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
LambdaQueryWrapper
<
SysUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SysUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SysUser:
:
getUsername
,
username
);
queryWrapper
.
eq
(
SysUser:
:
getUsername
,
username
);
SysUser
sysUser
=
sysUserService
.
getOne
(
queryWrapper
);
SysUser
sysUser
=
sysUserService
.
getOne
(
queryWrapper
);
//update-end-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
//update-end-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
result
=
sysUserService
.
checkUserIsEffective
(
sysUser
);
result
=
sysUserService
.
checkUserIsEffective
(
sysUser
);
if
(!
result
.
isSuccess
())
{
if
(!
result
.
isSuccess
())
{
return
result
;
return
result
;
}
}
...
@@ -140,7 +140,7 @@ public class LoginController {
...
@@ -140,7 +140,7 @@ public class LoginController {
redisUtil
.
del
(
CommonConstant
.
LOGIN_FAIL
+
username
);
redisUtil
.
del
(
CommonConstant
.
LOGIN_FAIL
+
username
);
LoginUser
loginUser
=
new
LoginUser
();
LoginUser
loginUser
=
new
LoginUser
();
BeanUtils
.
copyProperties
(
sysUser
,
loginUser
);
BeanUtils
.
copyProperties
(
sysUser
,
loginUser
);
baseCommonService
.
addLog
(
"用户名: "
+
username
+
",登录成功!"
,
CommonConstant
.
LOG_TYPE_1
,
null
,
loginUser
);
baseCommonService
.
addLog
(
"用户名: "
+
username
+
",登录成功!"
,
CommonConstant
.
LOG_TYPE_1
,
null
,
loginUser
);
//update-end--Author:wangshuai Date:20200714 for:登录日志没有记录人员
//update-end--Author:wangshuai Date:20200714 for:登录日志没有记录人员
return
result
;
return
result
;
}
}
...
@@ -150,13 +150,13 @@ public class LoginController {
...
@@ -150,13 +150,13 @@ public class LoginController {
* 【vue3专用】获取用户信息
* 【vue3专用】获取用户信息
*/
*/
@GetMapping
(
"/user/getUserInfo"
)
@GetMapping
(
"/user/getUserInfo"
)
public
Result
<
JSONObject
>
getUserInfo
(
HttpServletRequest
request
)
{
public
Result
<
JSONObject
>
getUserInfo
(
HttpServletRequest
request
)
{
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
String
username
=
JwtUtil
.
getUserNameByToken
(
request
);
String
username
=
JwtUtil
.
getUserNameByToken
(
request
);
if
(
oConvertUtils
.
isNotEmpty
(
username
))
{
if
(
oConvertUtils
.
isNotEmpty
(
username
))
{
// 根据用户名查询用户信息
// 根据用户名查询用户信息
SysUser
sysUser
=
sysUserService
.
getUserByName
(
username
);
SysUser
sysUser
=
sysUserService
.
getUserByName
(
username
);
JSONObject
obj
=
new
JSONObject
();
JSONObject
obj
=
new
JSONObject
();
//update-begin---author:scott ---date:2022-06-20 for:vue3前端,支持自定义首页-----------
//update-begin---author:scott ---date:2022-06-20 for:vue3前端,支持自定义首页-----------
String
version
=
request
.
getHeader
(
CommonConstant
.
VERSION
);
String
version
=
request
.
getHeader
(
CommonConstant
.
VERSION
);
...
@@ -172,7 +172,7 @@ public class LoginController {
...
@@ -172,7 +172,7 @@ public class LoginController {
//update-begin---author:liusq ---date:2022-06-29 for:接口返回值修改,同步修改这里的判断逻辑-----------
//update-begin---author:liusq ---date:2022-06-29 for:接口返回值修改,同步修改这里的判断逻辑-----------
//update-end---author:scott ---date::2022-06-20 for:vue3前端,支持自定义首页--------------
//update-end---author:scott ---date::2022-06-20 for:vue3前端,支持自定义首页--------------
obj
.
put
(
"userInfo"
,
sysUser
);
obj
.
put
(
"userInfo"
,
sysUser
);
obj
.
put
(
"sysAllDictItems"
,
sysDictService
.
queryAllDictItems
());
obj
.
put
(
"sysAllDictItems"
,
sysDictService
.
queryAllDictItems
());
result
.
setResult
(
obj
);
result
.
setResult
(
obj
);
result
.
success
(
""
);
result
.
success
(
""
);
...
@@ -183,24 +183,25 @@ public class LoginController {
...
@@ -183,24 +183,25 @@ public class LoginController {
/**
/**
* 退出登录
* 退出登录
*
* @param request
* @param request
* @param response
* @param response
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/logout"
)
@RequestMapping
(
value
=
"/logout"
)
public
Result
<
Object
>
logout
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
Result
<
Object
>
logout
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
//用户退出逻辑
//用户退出逻辑
String
token
=
request
.
getHeader
(
CommonConstant
.
X_ACCESS_TOKEN
);
String
token
=
request
.
getHeader
(
CommonConstant
.
X_ACCESS_TOKEN
);
if
(
oConvertUtils
.
isEmpty
(
token
))
{
if
(
oConvertUtils
.
isEmpty
(
token
))
{
return
Result
.
error
(
"退出登录失败!"
);
return
Result
.
error
(
"退出登录失败!"
);
}
}
String
username
=
JwtUtil
.
getUsername
(
token
);
String
username
=
JwtUtil
.
getUsername
(
token
);
LoginUser
sysUser
=
sysBaseApi
.
getUserByName
(
username
);
LoginUser
sysUser
=
sysBaseApi
.
getUserByName
(
username
);
if
(
sysUser
!=
null
)
{
if
(
sysUser
!=
null
)
{
//update-begin--Author:wangshuai Date:20200714 for:登出日志没有记录人员
//update-begin--Author:wangshuai Date:20200714 for:登出日志没有记录人员
baseCommonService
.
addLog
(
"用户名: "
+
sysUser
.
getRealname
()+
",退出成功!"
,
CommonConstant
.
LOG_TYPE_1
,
null
,
sysUser
);
baseCommonService
.
addLog
(
"用户名: "
+
sysUser
.
getRealname
()
+
",退出成功!"
,
CommonConstant
.
LOG_TYPE_1
,
null
,
sysUser
);
//update-end--Author:wangshuai Date:20200714 for:登出日志没有记录人员
//update-end--Author:wangshuai Date:20200714 for:登出日志没有记录人员
log
.
info
(
" 用户名: "
+
sysUser
.
getRealname
()+
",退出成功! "
);
log
.
info
(
" 用户名: "
+
sysUser
.
getRealname
()
+
",退出成功! "
);
//清空用户登录Token缓存
//清空用户登录Token缓存
redisUtil
.
del
(
CommonConstant
.
PREFIX_USER_TOKEN
+
token
);
redisUtil
.
del
(
CommonConstant
.
PREFIX_USER_TOKEN
+
token
);
//清空用户登录Shiro权限缓存
//清空用户登录Shiro权限缓存
...
@@ -210,13 +211,14 @@ public class LoginController {
...
@@ -210,13 +211,14 @@ public class LoginController {
//调用shiro的logout
//调用shiro的logout
SecurityUtils
.
getSubject
().
logout
();
SecurityUtils
.
getSubject
().
logout
();
return
Result
.
ok
(
"退出登录成功!"
);
return
Result
.
ok
(
"退出登录成功!"
);
}
else
{
}
else
{
return
Result
.
error
(
"Token无效!"
);
return
Result
.
error
(
"Token无效!"
);
}
}
}
}
/**
/**
* 获取访问量
* 获取访问量
*
* @return
* @return
*/
*/
@GetMapping
(
"loginfo"
)
@GetMapping
(
"loginfo"
)
...
@@ -236,9 +238,9 @@ public class LoginController {
...
@@ -236,9 +238,9 @@ public class LoginController {
// 获取系统访问记录
// 获取系统访问记录
Long
totalVisitCount
=
logService
.
findTotalVisitCount
();
Long
totalVisitCount
=
logService
.
findTotalVisitCount
();
obj
.
put
(
"totalVisitCount"
,
totalVisitCount
);
obj
.
put
(
"totalVisitCount"
,
totalVisitCount
);
Long
todayVisitCount
=
logService
.
findTodayVisitCount
(
dayStart
,
dayEnd
);
Long
todayVisitCount
=
logService
.
findTodayVisitCount
(
dayStart
,
dayEnd
);
obj
.
put
(
"todayVisitCount"
,
todayVisitCount
);
obj
.
put
(
"todayVisitCount"
,
todayVisitCount
);
Long
todayIp
=
logService
.
findTodayIp
(
dayStart
,
dayEnd
);
Long
todayIp
=
logService
.
findTodayIp
(
dayStart
,
dayEnd
);
//update-end--Author:zhangweijian Date:20190428 for:传入开始时间,结束时间参数
//update-end--Author:zhangweijian Date:20190428 for:传入开始时间,结束时间参数
obj
.
put
(
"todayIp"
,
todayIp
);
obj
.
put
(
"todayIp"
,
todayIp
);
result
.
setResult
(
obj
);
result
.
setResult
(
obj
);
...
@@ -248,21 +250,22 @@ public class LoginController {
...
@@ -248,21 +250,22 @@ public class LoginController {
/**
/**
* 获取访问量
* 获取访问量
*
* @return
* @return
*/
*/
@GetMapping
(
"visitInfo"
)
@GetMapping
(
"visitInfo"
)
public
Result
<
List
<
Map
<
String
,
Object
>>>
visitInfo
()
{
public
Result
<
List
<
Map
<
String
,
Object
>>>
visitInfo
()
{
Result
<
List
<
Map
<
String
,
Object
>>>
result
=
new
Result
<
List
<
Map
<
String
,
Object
>>>();
Result
<
List
<
Map
<
String
,
Object
>>>
result
=
new
Result
<
List
<
Map
<
String
,
Object
>>>();
Calendar
calendar
=
new
GregorianCalendar
();
Calendar
calendar
=
new
GregorianCalendar
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
0
);
calendar
.
set
(
Calendar
.
MILLISECOND
,
0
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
1
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
1
);
Date
dayEnd
=
calendar
.
getTime
();
Date
dayEnd
=
calendar
.
getTime
();
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
7
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
7
);
Date
dayStart
=
calendar
.
getTime
();
Date
dayStart
=
calendar
.
getTime
();
List
<
Map
<
String
,
Object
>>
list
=
logService
.
findVisitCount
(
dayStart
,
dayEnd
);
List
<
Map
<
String
,
Object
>>
list
=
logService
.
findVisitCount
(
dayStart
,
dayEnd
);
result
.
setResult
(
oConvertUtils
.
toLowerCasePageList
(
list
));
result
.
setResult
(
oConvertUtils
.
toLowerCasePageList
(
list
));
return
result
;
return
result
;
}
}
...
@@ -270,6 +273,7 @@ public class LoginController {
...
@@ -270,6 +273,7 @@ public class LoginController {
/**
/**
* 登陆成功选择用户当前部门
* 登陆成功选择用户当前部门
*
* @param user
* @param user
* @return
* @return
*/
*/
...
@@ -277,16 +281,16 @@ public class LoginController {
...
@@ -277,16 +281,16 @@ public class LoginController {
public
Result
<
JSONObject
>
selectDepart
(
@RequestBody
SysUser
user
)
{
public
Result
<
JSONObject
>
selectDepart
(
@RequestBody
SysUser
user
)
{
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
String
username
=
user
.
getUsername
();
String
username
=
user
.
getUsername
();
if
(
oConvertUtils
.
isEmpty
(
username
))
{
if
(
oConvertUtils
.
isEmpty
(
username
))
{
LoginUser
sysUser
=
(
LoginUser
)
SecurityUtils
.
getSubject
().
getPrincipal
();
LoginUser
sysUser
=
(
LoginUser
)
SecurityUtils
.
getSubject
().
getPrincipal
();
username
=
sysUser
.
getUsername
();
username
=
sysUser
.
getUsername
();
}
}
//获取登录部门
//获取登录部门
String
orgCode
=
user
.
getOrgCode
();
String
orgCode
=
user
.
getOrgCode
();
//获取登录租户
//获取登录租户
Integer
tenantId
=
user
.
getLoginTenantId
();
Integer
tenantId
=
user
.
getLoginTenantId
();
this
.
sysUserService
.
updateUserDepart
(
username
,
orgCode
,
tenantId
);
this
.
sysUserService
.
updateUserDepart
(
username
,
orgCode
,
tenantId
);
SysUser
sysUser
=
sysUserService
.
getUserByName
(
username
);
SysUser
sysUser
=
sysUserService
.
getUserByName
(
username
);
JSONObject
obj
=
new
JSONObject
();
JSONObject
obj
=
new
JSONObject
();
obj
.
put
(
"userInfo"
,
sysUser
);
obj
.
put
(
"userInfo"
,
sysUser
);
...
@@ -305,16 +309,16 @@ public class LoginController {
...
@@ -305,16 +309,16 @@ public class LoginController {
Result
<
String
>
result
=
new
Result
<
String
>();
Result
<
String
>
result
=
new
Result
<
String
>();
String
mobile
=
jsonObject
.
get
(
"mobile"
).
toString
();
String
mobile
=
jsonObject
.
get
(
"mobile"
).
toString
();
//手机号模式 登录模式: "2" 注册模式: "1"
//手机号模式 登录模式: "2" 注册模式: "1"
String
smsmode
=
jsonObject
.
get
(
"smsmode"
).
toString
();
String
smsmode
=
jsonObject
.
get
(
"smsmode"
).
toString
();
log
.
info
(
mobile
);
log
.
info
(
mobile
);
if
(
oConvertUtils
.
isEmpty
(
mobile
))
{
if
(
oConvertUtils
.
isEmpty
(
mobile
))
{
result
.
setMessage
(
"手机号不允许为空!"
);
result
.
setMessage
(
"手机号不允许为空!"
);
result
.
setSuccess
(
false
);
result
.
setSuccess
(
false
);
return
result
;
return
result
;
}
}
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
String
redisKey
=
CommonConstant
.
PHONE_REDIS_KEY_PRE
+
mobile
;
String
redisKey
=
CommonConstant
.
PHONE_REDIS_KEY_PRE
+
mobile
;
Object
object
=
redisUtil
.
get
(
redisKey
);
Object
object
=
redisUtil
.
get
(
redisKey
);
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
...
@@ -333,20 +337,20 @@ public class LoginController {
...
@@ -333,20 +337,20 @@ public class LoginController {
//注册模板
//注册模板
if
(
CommonConstant
.
SMS_TPL_TYPE_1
.
equals
(
smsmode
))
{
if
(
CommonConstant
.
SMS_TPL_TYPE_1
.
equals
(
smsmode
))
{
SysUser
sysUser
=
sysUserService
.
getUserByPhone
(
mobile
);
SysUser
sysUser
=
sysUserService
.
getUserByPhone
(
mobile
);
if
(
sysUser
!=
null
)
{
if
(
sysUser
!=
null
)
{
result
.
error500
(
" 手机号已经注册,请直接登录!"
);
result
.
error500
(
" 手机号已经注册,请直接登录!"
);
baseCommonService
.
addLog
(
"手机号已经注册,请直接登录!"
,
CommonConstant
.
LOG_TYPE_1
,
null
);
baseCommonService
.
addLog
(
"手机号已经注册,请直接登录!"
,
CommonConstant
.
LOG_TYPE_1
,
null
);
return
result
;
return
result
;
}
}
b
=
DySmsHelper
.
sendSms
(
mobile
,
obj
,
DySmsEnum
.
REGISTER_TEMPLATE_CODE
);
b
=
DySmsHelper
.
sendSms
(
mobile
,
obj
,
DySmsEnum
.
REGISTER_TEMPLATE_CODE
);
}
else
{
}
else
{
//登录模式,校验用户有效性
//登录模式,校验用户有效性
SysUser
sysUser
=
sysUserService
.
getUserByPhone
(
mobile
);
SysUser
sysUser
=
sysUserService
.
getUserByPhone
(
mobile
);
result
=
sysUserService
.
checkUserIsEffective
(
sysUser
);
result
=
sysUserService
.
checkUserIsEffective
(
sysUser
);
if
(!
result
.
isSuccess
())
{
if
(!
result
.
isSuccess
())
{
String
message
=
result
.
getMessage
();
String
message
=
result
.
getMessage
();
String
userNotExist
=
"该用户不存在,请注册"
;
String
userNotExist
=
"该用户不存在,请注册"
;
if
(
userNotExist
.
equals
(
message
))
{
if
(
userNotExist
.
equals
(
message
))
{
result
.
error500
(
"该用户不存在或未绑定手机号"
);
result
.
error500
(
"该用户不存在或未绑定手机号"
);
}
}
return
result
;
return
result
;
...
@@ -358,7 +362,7 @@ public class LoginController {
...
@@ -358,7 +362,7 @@ public class LoginController {
if
(
CommonConstant
.
SMS_TPL_TYPE_0
.
equals
(
smsmode
))
{
if
(
CommonConstant
.
SMS_TPL_TYPE_0
.
equals
(
smsmode
))
{
//登录模板
//登录模板
b
=
DySmsHelper
.
sendSms
(
mobile
,
obj
,
DySmsEnum
.
LOGIN_TEMPLATE_CODE
);
b
=
DySmsHelper
.
sendSms
(
mobile
,
obj
,
DySmsEnum
.
LOGIN_TEMPLATE_CODE
);
}
else
if
(
CommonConstant
.
SMS_TPL_TYPE_2
.
equals
(
smsmode
))
{
}
else
if
(
CommonConstant
.
SMS_TPL_TYPE_2
.
equals
(
smsmode
))
{
//忘记密码模板
//忘记密码模板
b
=
DySmsHelper
.
sendSms
(
mobile
,
obj
,
DySmsEnum
.
FORGET_PASSWORD_TEMPLATE_CODE
);
b
=
DySmsHelper
.
sendSms
(
mobile
,
obj
,
DySmsEnum
.
FORGET_PASSWORD_TEMPLATE_CODE
);
}
}
...
@@ -401,21 +405,21 @@ public class LoginController {
...
@@ -401,21 +405,21 @@ public class LoginController {
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
String
phone
=
jsonObject
.
getString
(
"mobile"
);
String
phone
=
jsonObject
.
getString
(
"mobile"
);
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
if
(
isLoginFailOvertimes
(
phone
))
{
if
(
isLoginFailOvertimes
(
phone
))
{
return
result
.
error500
(
"该用户登录失败次数过多,请于10分钟后再次登录!"
);
return
result
.
error500
(
"该用户登录失败次数过多,请于10分钟后再次登录!"
);
}
}
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
//校验用户有效性
//校验用户有效性
SysUser
sysUser
=
sysUserService
.
getUserByPhone
(
phone
);
SysUser
sysUser
=
sysUserService
.
getUserByPhone
(
phone
);
result
=
sysUserService
.
checkUserIsEffective
(
sysUser
);
result
=
sysUserService
.
checkUserIsEffective
(
sysUser
);
if
(!
result
.
isSuccess
())
{
if
(!
result
.
isSuccess
())
{
return
result
;
return
result
;
}
}
String
smscode
=
jsonObject
.
getString
(
"captcha"
);
String
smscode
=
jsonObject
.
getString
(
"captcha"
);
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
String
redisKey
=
CommonConstant
.
PHONE_REDIS_KEY_PRE
+
phone
;
String
redisKey
=
CommonConstant
.
PHONE_REDIS_KEY_PRE
+
phone
;
Object
code
=
redisUtil
.
get
(
redisKey
);
Object
code
=
redisUtil
.
get
(
redisKey
);
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
...
@@ -456,7 +460,7 @@ public class LoginController {
...
@@ -456,7 +460,7 @@ public class LoginController {
obj
.
put
(
"token"
,
token
);
obj
.
put
(
"token"
,
token
);
//2.设置登录租户
//2.设置登录租户
Result
<
JSONObject
>
loginTenantError
=
sysUserService
.
setLoginTenant
(
sysUser
,
obj
,
username
,
result
);
Result
<
JSONObject
>
loginTenantError
=
sysUserService
.
setLoginTenant
(
sysUser
,
obj
,
username
,
result
);
if
(
loginTenantError
!=
null
)
{
if
(
loginTenantError
!=
null
)
{
return
loginTenantError
;
return
loginTenantError
;
}
}
...
@@ -470,14 +474,14 @@ public class LoginController {
...
@@ -470,14 +474,14 @@ public class LoginController {
if
(
departs
==
null
||
departs
.
size
()
==
0
)
{
if
(
departs
==
null
||
departs
.
size
()
==
0
)
{
obj
.
put
(
"multi_depart"
,
0
);
obj
.
put
(
"multi_depart"
,
0
);
}
else
if
(
departs
.
size
()
==
1
)
{
}
else
if
(
departs
.
size
()
==
1
)
{
sysUserService
.
updateUserDepart
(
username
,
departs
.
get
(
0
).
getOrgCode
(),
null
);
sysUserService
.
updateUserDepart
(
username
,
departs
.
get
(
0
).
getOrgCode
(),
null
);
obj
.
put
(
"multi_depart"
,
1
);
obj
.
put
(
"multi_depart"
,
1
);
}
else
{
}
else
{
//查询当前是否有登录部门
//查询当前是否有登录部门
// update-begin--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去
// update-begin--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去
SysUser
sysUserById
=
sysUserService
.
getById
(
sysUser
.
getId
());
SysUser
sysUserById
=
sysUserService
.
getById
(
sysUser
.
getId
());
if
(
oConvertUtils
.
isEmpty
(
sysUserById
.
getOrgCode
()))
{
if
(
oConvertUtils
.
isEmpty
(
sysUserById
.
getOrgCode
()))
{
sysUserService
.
updateUserDepart
(
username
,
departs
.
get
(
0
).
getOrgCode
(),
null
);
sysUserService
.
updateUserDepart
(
username
,
departs
.
get
(
0
).
getOrgCode
(),
null
);
}
}
// update-end--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去
// update-end--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去
obj
.
put
(
"multi_depart"
,
2
);
obj
.
put
(
"multi_depart"
,
2
);
...
@@ -490,36 +494,38 @@ public class LoginController {
...
@@ -490,36 +494,38 @@ public class LoginController {
/**
/**
* 获取加密字符串
* 获取加密字符串
*
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/getEncryptedString"
)
@GetMapping
(
value
=
"/getEncryptedString"
)
public
Result
<
Map
<
String
,
String
>>
getEncryptedString
()
{
public
Result
<
Map
<
String
,
String
>>
getEncryptedString
()
{
Result
<
Map
<
String
,
String
>>
result
=
new
Result
<
Map
<
String
,
String
>>();
Result
<
Map
<
String
,
String
>>
result
=
new
Result
<
Map
<
String
,
String
>>();
Map
<
String
,
String
>
map
=
new
HashMap
(
5
);
Map
<
String
,
String
>
map
=
new
HashMap
(
5
);
map
.
put
(
"key"
,
EncryptedString
.
key
);
map
.
put
(
"key"
,
EncryptedString
.
key
);
map
.
put
(
"iv"
,
EncryptedString
.
iv
);
map
.
put
(
"iv"
,
EncryptedString
.
iv
);
result
.
setResult
(
map
);
result
.
setResult
(
map
);
return
result
;
return
result
;
}
}
/**
/**
* 后台生成图形验证码 :有效
* 后台生成图形验证码 :有效
*
* @param response
* @param response
* @param key
* @param key
*/
*/
@ApiOperation
(
"获取验证码"
)
@ApiOperation
(
"获取验证码"
)
@GetMapping
(
value
=
"/randomImage/{key}"
)
@GetMapping
(
value
=
"/randomImage/{key}"
)
public
Result
<
String
>
randomImage
(
HttpServletResponse
response
,
@PathVariable
(
"key"
)
String
key
)
{
public
Result
<
String
>
randomImage
(
HttpServletResponse
response
,
@PathVariable
(
"key"
)
String
key
)
{
Result
<
String
>
res
=
new
Result
<
String
>();
Result
<
String
>
res
=
new
Result
<
String
>();
try
{
try
{
//生成验证码
//生成验证码
String
code
=
RandomUtil
.
randomString
(
BASE_CHECK_CODES
,
4
);
String
code
=
RandomUtil
.
randomString
(
BASE_CHECK_CODES
,
4
);
//存到redis中
//存到redis中
String
lowerCaseCode
=
code
.
toLowerCase
();
String
lowerCaseCode
=
code
.
toLowerCase
();
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
// 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可
// 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可
String
origin
=
lowerCaseCode
+
key
+
jeecgBaseConfig
.
getSignatureSecret
();
String
origin
=
lowerCaseCode
+
key
+
jeecgBaseConfig
.
getSignatureSecret
();
String
realKey
=
Md5Util
.
md5Encode
(
origin
,
"utf-8"
);
String
realKey
=
Md5Util
.
md5Encode
(
origin
,
"utf-8"
);
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
...
@@ -528,6 +534,7 @@ public class LoginController {
...
@@ -528,6 +534,7 @@ public class LoginController {
//返回前端
//返回前端
String
base64
=
RandImageUtil
.
generate
(
code
);
String
base64
=
RandImageUtil
.
generate
(
code
);
res
.
setSuccess
(
true
);
res
.
setSuccess
(
true
);
res
.
setCode
(
CommonConstant
.
SC_OK_200
);
res
.
setResult
(
base64
);
res
.
setResult
(
base64
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
...
@@ -550,6 +557,7 @@ public class LoginController {
...
@@ -550,6 +557,7 @@ public class LoginController {
/**
/**
* app登录
* app登录
*
* @param sysLoginModel
* @param sysLoginModel
* @return
* @return
* @throws Exception
* @throws Exception
...
@@ -562,14 +570,14 @@ public class LoginController {
...
@@ -562,14 +570,14 @@ public class LoginController {
JSONObject
obj
=
new
JSONObject
();
JSONObject
obj
=
new
JSONObject
();
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
if
(
isLoginFailOvertimes
(
username
))
{
if
(
isLoginFailOvertimes
(
username
))
{
return
result
.
error500
(
"该用户登录失败次数过多,请于10分钟后再次登录!"
);
return
result
.
error500
(
"该用户登录失败次数过多,请于10分钟后再次登录!"
);
}
}
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
//1. 校验用户是否有效
//1. 校验用户是否有效
SysUser
sysUser
=
sysUserService
.
getUserByName
(
username
);
SysUser
sysUser
=
sysUserService
.
getUserByName
(
username
);
result
=
sysUserService
.
checkUserIsEffective
(
sysUser
);
result
=
sysUserService
.
checkUserIsEffective
(
sysUser
);
if
(!
result
.
isSuccess
())
{
if
(!
result
.
isSuccess
())
{
return
result
;
return
result
;
}
}
...
@@ -586,17 +594,17 @@ public class LoginController {
...
@@ -586,17 +594,17 @@ public class LoginController {
//3.设置登录部门
//3.设置登录部门
String
orgCode
=
sysUser
.
getOrgCode
();
String
orgCode
=
sysUser
.
getOrgCode
();
if
(
oConvertUtils
.
isEmpty
(
orgCode
))
{
if
(
oConvertUtils
.
isEmpty
(
orgCode
))
{
//如果当前用户无选择部门 查看部门关联信息
//如果当前用户无选择部门 查看部门关联信息
List
<
SysDepart
>
departs
=
sysDepartService
.
queryUserDeparts
(
sysUser
.
getId
());
List
<
SysDepart
>
departs
=
sysDepartService
.
queryUserDeparts
(
sysUser
.
getId
());
//update-begin-author:taoyan date:20220117 for: JTC-1068【app】新建用户,没有设置部门及角色,点击登录提示暂未归属部,一直在登录页面 使用手机号登录 可正常
//update-begin-author:taoyan date:20220117 for: JTC-1068【app】新建用户,没有设置部门及角色,点击登录提示暂未归属部,一直在登录页面 使用手机号登录 可正常
if
(
departs
==
null
||
departs
.
size
()
==
0
)
{
if
(
departs
==
null
||
departs
.
size
()
==
0
)
{
/*result.error500("用户暂未归属部门,不可登录!");
/*result.error500("用户暂未归属部门,不可登录!");
return result;*/
return result;*/
}
else
{
}
else
{
orgCode
=
departs
.
get
(
0
).
getOrgCode
();
orgCode
=
departs
.
get
(
0
).
getOrgCode
();
sysUser
.
setOrgCode
(
orgCode
);
sysUser
.
setOrgCode
(
orgCode
);
this
.
sysUserService
.
updateUserDepart
(
username
,
orgCode
,
null
);
this
.
sysUserService
.
updateUserDepart
(
username
,
orgCode
,
null
);
}
}
//update-end-author:taoyan date:20220117 for: JTC-1068【app】新建用户,没有设置部门及角色,点击登录提示暂未归属部,一直在登录页面 使用手机号登录 可正常
//update-end-author:taoyan date:20220117 for: JTC-1068【app】新建用户,没有设置部门及角色,点击登录提示暂未归属部,一直在登录页面 使用手机号登录 可正常
}
}
...
@@ -614,7 +622,7 @@ public class LoginController {
...
@@ -614,7 +622,7 @@ public class LoginController {
String
token
=
JwtUtil
.
sign
(
username
,
syspassword
);
String
token
=
JwtUtil
.
sign
(
username
,
syspassword
);
// 设置超时时间
// 设置超时时间
redisUtil
.
set
(
CommonConstant
.
PREFIX_USER_TOKEN
+
token
,
token
);
redisUtil
.
set
(
CommonConstant
.
PREFIX_USER_TOKEN
+
token
,
token
);
redisUtil
.
expire
(
CommonConstant
.
PREFIX_USER_TOKEN
+
token
,
JwtUtil
.
EXPIRE_TIME
*
2
/
1000
);
redisUtil
.
expire
(
CommonConstant
.
PREFIX_USER_TOKEN
+
token
,
JwtUtil
.
EXPIRE_TIME
*
2
/
1000
);
//token 信息
//token 信息
obj
.
put
(
"token"
,
token
);
obj
.
put
(
"token"
,
token
);
...
@@ -627,31 +635,33 @@ public class LoginController {
...
@@ -627,31 +635,33 @@ public class LoginController {
/**
/**
* 图形验证码
* 图形验证码
*
* @param sysLoginModel
* @param sysLoginModel
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/checkCaptcha"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/checkCaptcha"
,
method
=
RequestMethod
.
POST
)
public
Result
<?>
checkCaptcha
(
@RequestBody
SysLoginModel
sysLoginModel
)
{
public
Result
<?>
checkCaptcha
(
@RequestBody
SysLoginModel
sysLoginModel
)
{
String
captcha
=
sysLoginModel
.
getCaptcha
();
String
captcha
=
sysLoginModel
.
getCaptcha
();
String
checkKey
=
sysLoginModel
.
getCheckKey
();
String
checkKey
=
sysLoginModel
.
getCheckKey
();
if
(
captcha
==
null
)
{
if
(
captcha
==
null
)
{
return
Result
.
error
(
"验证码无效"
);
return
Result
.
error
(
"验证码无效"
);
}
}
String
lowerCaseCaptcha
=
captcha
.
toLowerCase
();
String
lowerCaseCaptcha
=
captcha
.
toLowerCase
();
String
realKey
=
Md5Util
.
md5Encode
(
lowerCaseCaptcha
+
checkKey
,
"utf-8"
);
String
realKey
=
Md5Util
.
md5Encode
(
lowerCaseCaptcha
+
checkKey
,
"utf-8"
);
Object
checkCode
=
redisUtil
.
get
(
realKey
);
Object
checkCode
=
redisUtil
.
get
(
realKey
);
if
(
checkCode
==
null
||
!
checkCode
.
equals
(
lowerCaseCaptcha
))
{
if
(
checkCode
==
null
||
!
checkCode
.
equals
(
lowerCaseCaptcha
))
{
return
Result
.
error
(
"验证码错误"
);
return
Result
.
error
(
"验证码错误"
);
}
}
return
Result
.
ok
();
return
Result
.
ok
();
}
}
/**
/**
* 登录二维码
* 登录二维码
*/
*/
@ApiOperation
(
value
=
"登录二维码"
,
notes
=
"登录二维码"
)
@ApiOperation
(
value
=
"登录二维码"
,
notes
=
"登录二维码"
)
@GetMapping
(
"/getLoginQrcode"
)
@GetMapping
(
"/getLoginQrcode"
)
public
Result
<?>
getLoginQrcode
()
{
public
Result
<?>
getLoginQrcode
()
{
String
qrcodeId
=
CommonConstant
.
LOGIN_QRCODE_PRE
+
IdWorker
.
getIdStr
();
String
qrcodeId
=
CommonConstant
.
LOGIN_QRCODE_PRE
+
IdWorker
.
getIdStr
();
//定义二维码参数
//定义二维码参数
Map
params
=
new
HashMap
(
5
);
Map
params
=
new
HashMap
(
5
);
params
.
put
(
"qrcodeId"
,
qrcodeId
);
params
.
put
(
"qrcodeId"
,
qrcodeId
);
...
@@ -659,6 +669,7 @@ public class LoginController {
...
@@ -659,6 +669,7 @@ public class LoginController {
redisUtil
.
set
(
CommonConstant
.
LOGIN_QRCODE
+
qrcodeId
,
qrcodeId
,
30
);
redisUtil
.
set
(
CommonConstant
.
LOGIN_QRCODE
+
qrcodeId
,
qrcodeId
,
30
);
return
Result
.
OK
(
params
);
return
Result
.
OK
(
params
);
}
}
/**
/**
* 扫码二维码
* 扫码二维码
*/
*/
...
@@ -668,7 +679,7 @@ public class LoginController {
...
@@ -668,7 +679,7 @@ public class LoginController {
Object
check
=
redisUtil
.
get
(
CommonConstant
.
LOGIN_QRCODE
+
qrcodeId
);
Object
check
=
redisUtil
.
get
(
CommonConstant
.
LOGIN_QRCODE
+
qrcodeId
);
if
(
oConvertUtils
.
isNotEmpty
(
check
))
{
if
(
oConvertUtils
.
isNotEmpty
(
check
))
{
//存放token给前台读取
//存放token给前台读取
redisUtil
.
set
(
CommonConstant
.
LOGIN_QRCODE_TOKEN
+
qrcodeId
,
token
,
60
);
redisUtil
.
set
(
CommonConstant
.
LOGIN_QRCODE_TOKEN
+
qrcodeId
,
token
,
60
);
}
else
{
}
else
{
return
Result
.
error
(
"二维码已过期,请刷新后重试"
);
return
Result
.
error
(
"二维码已过期,请刷新后重试"
);
}
}
...
@@ -701,15 +712,16 @@ public class LoginController {
...
@@ -701,15 +712,16 @@ public class LoginController {
/**
/**
* 登录失败超出次数5 返回true
* 登录失败超出次数5 返回true
*
* @param username
* @param username
* @return
* @return
*/
*/
private
boolean
isLoginFailOvertimes
(
String
username
)
{
private
boolean
isLoginFailOvertimes
(
String
username
)
{
String
key
=
CommonConstant
.
LOGIN_FAIL
+
username
;
String
key
=
CommonConstant
.
LOGIN_FAIL
+
username
;
Object
failTime
=
redisUtil
.
get
(
key
);
Object
failTime
=
redisUtil
.
get
(
key
);
if
(
failTime
!=
null
)
{
if
(
failTime
!=
null
)
{
Integer
val
=
Integer
.
parseInt
(
failTime
.
toString
());
Integer
val
=
Integer
.
parseInt
(
failTime
.
toString
());
if
(
val
>
5
)
{
if
(
val
>
5
)
{
return
true
;
return
true
;
}
}
}
}
...
@@ -718,13 +730,14 @@ public class LoginController {
...
@@ -718,13 +730,14 @@ public class LoginController {
/**
/**
* 记录登录失败次数
* 记录登录失败次数
*
* @param username
* @param username
*/
*/
private
void
addLoginFailOvertimes
(
String
username
)
{
private
void
addLoginFailOvertimes
(
String
username
)
{
String
key
=
CommonConstant
.
LOGIN_FAIL
+
username
;
String
key
=
CommonConstant
.
LOGIN_FAIL
+
username
;
Object
failTime
=
redisUtil
.
get
(
key
);
Object
failTime
=
redisUtil
.
get
(
key
);
Integer
val
=
0
;
Integer
val
=
0
;
if
(
failTime
!=
null
)
{
if
(
failTime
!=
null
)
{
val
=
Integer
.
parseInt
(
failTime
.
toString
());
val
=
Integer
.
parseInt
(
failTime
.
toString
());
}
}
// 1小时
// 1小时
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment