Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
base-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
base-platform
Commits
a73e2fb2
Commit
a73e2fb2
authored
May 11, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改站点权限分配
parent
ed6ce31b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
118 additions
and
5 deletions
+118
-5
base-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
.../java/com/mortals/xhx/base/login/web/LoginController.java
+2
-1
base-manager/src/main/java/com/mortals/xhx/module/business/service/BusinessService.java
.../mortals/xhx/module/business/service/BusinessService.java
+2
-1
base-manager/src/main/java/com/mortals/xhx/module/business/service/impl/BusinessServiceImpl.java
...xhx/module/business/service/impl/BusinessServiceImpl.java
+2
-1
base-manager/src/main/java/com/mortals/xhx/module/site/service/SiteBusinessService.java
.../mortals/xhx/module/site/service/SiteBusinessService.java
+9
-1
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteBusinessServiceImpl.java
...xhx/module/site/service/impl/SiteBusinessServiceImpl.java
+9
-1
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteBusinessController.java
...m/mortals/xhx/module/site/web/SiteBusinessController.java
+30
-0
doc/api.md
doc/api.md
+64
-0
No files found.
base-manager/src/main/java/com/mortals/xhx/base/login/web/LoginController.java
View file @
a73e2fb2
...
...
@@ -102,12 +102,13 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
data
.
put
(
"userType"
,
userEntity
.
getUserType
());
userEntity
.
setLoginTime
(
System
.
currentTimeMillis
());
userEntity
.
setToken
(
IdUtil
.
fastSimpleUUID
());
userEntity
.
setExpireTime
(
DateUtils
.
addCurrDate
(
7
).
getTime
());
userEntity
.
setMenuUrl
(
generateMenuUrlCode
(
urls
));
String
token
=
authTokenService
.
createToken
(
userEntity
);
data
.
put
(
"token"
,
token
);
//设置token 和过期时间
data
.
put
(
"expiresTime"
,
DateUtils
.
addCurrDate
(
7
).
getTime
());
//
data.put("expiresTime", DateUtils.addCurrDate(7).getTime());
generateMenuUrlCode
(
urls
);
//this.generateBlackCookie(request, response, loginName, urls);
ret
.
put
(
KEY_RESULT_DATA
,
data
);
...
...
base-manager/src/main/java/com/mortals/xhx/module/business/service/BusinessService.java
View file @
a73e2fb2
package
com.mortals.xhx.module.business.service
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.service.ICRUDCacheService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.business.model.BusinessEntity
;
import
com.mortals.xhx.module.business.model.BusinessTreeSelect
;
...
...
@@ -17,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @author zxfei
* @date 2022-01-13
*/
public
interface
BusinessService
extends
ICRUD
Service
<
BusinessEntity
,
Long
>
{
public
interface
BusinessService
extends
ICRUD
CacheService
<
BusinessEntity
,
Long
>
{
/**
* 添加业务到站点
* @param businessIds
...
...
base-manager/src/main/java/com/mortals/xhx/module/business/service/impl/BusinessServiceImpl.java
View file @
a73e2fb2
...
...
@@ -3,6 +3,7 @@ package com.mortals.xhx.module.business.service.impl;
import
cn.hutool.core.util.StrUtil
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl
;
import
com.mortals.xhx.common.code.IsBusinessEnum
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.module.site.model.SiteBusinessEntity
;
...
...
@@ -37,7 +38,7 @@ import static com.mortals.framework.ap.SysConstains.RESULT_KEY;
* @date 2022-01-13
*/
@Service
(
"businessService"
)
public
class
BusinessServiceImpl
extends
AbstractCRUDServiceImpl
<
BusinessDao
,
BusinessEntity
,
Long
>
implements
BusinessService
{
public
class
BusinessServiceImpl
extends
AbstractCRUD
Cache
ServiceImpl
<
BusinessDao
,
BusinessEntity
,
Long
>
implements
BusinessService
{
@Autowired
private
SiteBusinessService
siteBusinessService
;
@Autowired
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/service/SiteBusinessService.java
View file @
a73e2fb2
package
com.mortals.xhx.module.site.service
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.service.ICRUDCacheService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.business.model.BusinessEntity
;
import
com.mortals.xhx.module.site.model.SiteBusinessEntity
;
import
com.mortals.xhx.module.site.model.SiteBusinessTreeSelect
;
import
java.util.List
;
...
...
@@ -13,7 +17,7 @@ import com.mortals.framework.model.Context;
* @author zxfei
* @date 2022-01-13
*/
public
interface
SiteBusinessService
extends
ICRUD
Service
<
SiteBusinessEntity
,
Long
>
{
public
interface
SiteBusinessService
extends
ICRUD
CacheService
<
SiteBusinessEntity
,
Long
>
{
/**
* 是否存在站点事项节点
...
...
@@ -41,4 +45,8 @@ public interface SiteBusinessService extends ICRUDService<SiteBusinessEntity,Lon
*/
List
<
SiteBusinessTreeSelect
>
buildSiteBusinessTreeSelect
(
List
<
SiteBusinessEntity
>
siteBusinessList
);
Result
<
SiteBusinessEntity
>
flatList
(
SiteBusinessEntity
query
,
PageInfo
pageInfo
,
Context
context
);
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteBusinessServiceImpl.java
View file @
a73e2fb2
package
com.mortals.xhx.module.site.service.impl
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl
;
import
com.mortals.xhx.module.business.model.BusinessEntity
;
import
com.mortals.xhx.module.business.model.BusinessQuery
;
import
org.springframework.stereotype.Service
;
...
...
@@ -26,7 +28,7 @@ import java.util.stream.Collectors;
* @date 2022-01-13
*/
@Service
(
"siteBusinessService"
)
public
class
SiteBusinessServiceImpl
extends
AbstractCRUDServiceImpl
<
SiteBusinessDao
,
SiteBusinessEntity
,
Long
>
implements
SiteBusinessService
{
public
class
SiteBusinessServiceImpl
extends
AbstractCRUD
Cache
ServiceImpl
<
SiteBusinessDao
,
SiteBusinessEntity
,
Long
>
implements
SiteBusinessService
{
@Override
...
...
@@ -99,6 +101,12 @@ public class SiteBusinessServiceImpl extends AbstractCRUDServiceImpl<SiteBusines
return
returnList
.
stream
().
map
(
SiteBusinessTreeSelect:
:
new
).
collect
(
Collectors
.
toList
());
}
@Override
public
Result
<
SiteBusinessEntity
>
flatList
(
SiteBusinessEntity
query
,
PageInfo
pageInfo
,
Context
context
)
{
Result
<
SiteBusinessEntity
>
result
=
this
.
dao
.
getList
(
query
,
pageInfo
);
return
result
;
}
/**
* 递归列表
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteBusinessController.java
View file @
a73e2fb2
...
...
@@ -3,6 +3,8 @@ package com.mortals.xhx.module.site.web;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BasePhpCRUDJsonMappingController
;
...
...
@@ -17,6 +19,7 @@ import org.apache.commons.lang3.ArrayUtils;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -108,4 +111,31 @@ public class SiteBusinessController extends BaseCRUDJsonBodyMappingController<Si
return
ret
.
toJSONString
();
}
/**
* 查询站点业务扁平结构
*/
@PostMapping
(
value
=
"flatList"
)
public
String
flatList
(
@RequestBody
SiteBusinessEntity
query
)
{
JSONObject
jsonObject
=
new
JSONObject
();
Map
<
String
,
Object
>
model
=
new
HashMap
<>();
String
busiDesc
=
"查询"
+
this
.
getModuleDesc
();
try
{
PageInfo
pageInfo
=
buildPageInfo
(
query
);
Result
<
SiteBusinessEntity
>
result
=
this
.
service
.
flatList
(
query
,
pageInfo
,
getContext
());
model
.
put
(
KEY_RESULT_DATA
,
result
.
getList
());
parsePageInfo
(
model
,
result
.
getPageInfo
());
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
jsonObject
.
put
(
KEY_RESULT_DATA
,
model
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
jsonObject
.
put
(
KEY_RESULT_MSG
,
"查询站点业务列表成功!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取异常"
,
e
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
jsonObject
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
}
return
jsonObject
.
toJSONString
();
}
}
\ No newline at end of file
doc/api.md
View file @
a73e2fb2
...
...
@@ -6616,6 +6616,70 @@ dict|object|字典对象|-
}
```
### 查询业务列表(非树形)
**请求URL:**
site/business/flatList
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
查询站点业务
**请求参数:**
参数名称|类型|备注|必填|其它
---|---|---|---|---
page|Integer|当前页|否|-
size|Integer|每页条数|否|-1查询全部
siteId|Long|站点Id|否|-
**请求样例:**
```
{
"siteId":12321,
"page":1,
"size":10
}
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
data|object|数据对象|-
 
per_page|Integer|每页条数|-
 
total|Integer|总条数|-
 
last_page|Integer|总页数|-
 
current_page|Integer|当前页|-
 
data|array|结果集列表|数组
  
id|Long|序号,主键,自增长|-
  
siteId|Long|站点ID|-
  
siteName|String|站点名称|-
  
ancestors|String|祖级列表,逗号分隔|-
  
businessId|Long|业务ID|-
  
isBusiness|Integer|业务类型(0.一级业务,1.二级业务)|-
  
parentId|Long|业务父级ID|-
  
businessName|String|业务名称|-
  
status|Integer|业务状态 (0.停用,1.正常)|-
  
createTime|Date|创建时间|-
  
createUserId|Long|创建用户|-
  
updateTime|Date|修改时间|-
dict|object|字典对象|-
 
isBusiness|object|字典属性对象,详见附录|-
 
status|object|字典属性对象,详见附录|-
**响应消息样例:**
```
{
}
```
### 编辑站点业务
**请求URL:**
site/business/edit
...
...
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