Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
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
liqin
chnmuseum-party
Commits
031176d4
Commit
031176d4
authored
Apr 02, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://111.203.232.171:8888/lee/chnmuseum-party
into master
parents
7d9b2e91
6cf497be
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
507 additions
and
262 deletions
+507
-262
LanguageEnum.java
.../wisenergy/chnmuseum/party/common/enums/LanguageEnum.java
+5
-5
SystemOperationLogService.java
...chnmuseum/party/common/log/SystemOperationLogService.java
+11
-2
AuditStatusParam.java
...wisenergy/chnmuseum/party/common/vo/AuditStatusParam.java
+32
-0
Asset.java
src/main/java/cn/wisenergy/chnmuseum/party/model/Asset.java
+5
-0
Audit.java
src/main/java/cn/wisenergy/chnmuseum/party/model/Audit.java
+4
-0
ExhibitionBoard.java
...a/cn/wisenergy/chnmuseum/party/model/ExhibitionBoard.java
+4
-0
AuditService.java
...va/cn/wisenergy/chnmuseum/party/service/AuditService.java
+26
-1
TOrganService.java
...a/cn/wisenergy/chnmuseum/party/service/TOrganService.java
+1
-1
AuditServiceImpl.java
...energy/chnmuseum/party/service/impl/AuditServiceImpl.java
+261
-3
TOrganServiceImpl.java
...nergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
+2
-2
AuditController.java
...nergy/chnmuseum/party/web/controller/AuditController.java
+129
-63
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+2
-2
TBoxOperationController.java
...nmuseum/party/web/controller/TBoxOperationController.java
+10
-5
TOperationLogController.java
...nmuseum/party/web/controller/TOperationLogController.java
+0
-175
TOrganController.java
...ergy/chnmuseum/party/web/controller/TOrganController.java
+1
-2
TUserController.java
...nergy/chnmuseum/party/web/controller/TUserController.java
+6
-1
BaseController.java
...y/chnmuseum/party/web/controller/base/BaseController.java
+5
-0
TUserMapper.xml
src/main/resources/mapper/TUserMapper.xml
+3
-0
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/enums/LanguageEnum.java
View file @
031176d4
...
@@ -2,11 +2,11 @@ package cn.wisenergy.chnmuseum.party.common.enums;
...
@@ -2,11 +2,11 @@ package cn.wisenergy.chnmuseum.party.common.enums;
public
enum
LanguageEnum
{
public
enum
LanguageEnum
{
CHINESE
(
"Chinese"
,
"汉语"
),
zh
(
"Chinese"
,
"汉语"
),
MONGOLIAN
(
"Mongolian"
,
"蒙语"
),
mn
(
"Mongolian"
,
"蒙语"
),
TIBETAN
(
"Tibetan"
,
"藏语"
),
bo
(
"Tibetan"
,
"藏语"
),
UYGHUR
(
"Uyghur"
,
"维吾尔语"
),
uyg
(
"Uyghur"
,
"维吾尔语"
),
ENGLISH
(
"English"
,
"英语"
);
en
(
"English"
,
"英语"
);
// 错误编码
// 错误编码
private
String
code
;
private
String
code
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/log/SystemOperationLogService.java
View file @
031176d4
...
@@ -15,6 +15,7 @@ import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl;
...
@@ -15,6 +15,7 @@ import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
javassist.util.HotSwapper
;
import
javassist.util.HotSwapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.Signature
;
...
@@ -60,7 +61,7 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
...
@@ -60,7 +61,7 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
public
TUser
getCurAdmin
(
HttpServletRequest
request
)
{
public
TUser
getCurAdmin
(
HttpServletRequest
request
)
{
String
header
=
request
.
getHeader
(
"Authorization"
);
String
header
=
request
.
getHeader
(
"Authorization"
);
if
(
StringUtils
.
isBlank
(
header
))
{
if
(
StringUtils
.
isBlank
(
header
))
{
return
null
;
throw
new
AuthenticationException
(
"token失效,请重新登录"
)
;
}
}
String
username
=
JwtTokenUtil
.
getUsername
(
header
);
String
username
=
JwtTokenUtil
.
getUsername
(
header
);
TUser
user
=
userService
.
selectByUsername
(
username
);
TUser
user
=
userService
.
selectByUsername
(
username
);
...
@@ -89,7 +90,15 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
...
@@ -89,7 +90,15 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
.
getRequestAttributes
()).
getRequest
();
.
getRequestAttributes
()).
getRequest
();
MethodLog
methodLog
=
getAnnotationLog
(
point
);
MethodLog
methodLog
=
getAnnotationLog
(
point
);
String
ip
=
getIp
(
request
);
String
ip
=
getIp
(
request
);
TUser
user
=
getCurAdmin
(
request
);
TUser
user
=
null
;
try
{
user
=
getCurAdmin
(
request
);
}
catch
(
Exception
e
)
{
HashMap
<
Object
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"message"
,
e
.
getMessage
());
return
resultMap
;
}
// if (user==null){
// if (user==null){
// HashMap<String, Object> resultMap = new HashMap<>();
// HashMap<String, Object> resultMap = new HashMap<>();
// resultMap.put("resultCode", "500");
// resultMap.put("resultCode", "500");
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/vo/AuditStatusParam.java
0 → 100644
View file @
031176d4
package
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* 审核修改参数封装对象
*
* @author jiawei
*/
@Data
@ApiModel
public
class
AuditStatusParam
implements
Serializable
{
@ApiModelProperty
(
"审核ID"
)
@NotNull
(
message
=
"审核ID不能为空"
)
private
String
id
;
@ApiModelProperty
(
value
=
"审核状态,驳回:REFUSED,通过:APPROVED_FINAL"
,
allowableValues
=
"REFUSED,APPROVED_FINAL"
)
@NotBlank
(
message
=
"审核状态不能为空"
)
private
String
status
;
@ApiModelProperty
(
"审核状态为驳回时,填写的审核意见"
)
private
String
remarks
;
}
src/main/java/cn/wisenergy/chnmuseum/party/model/Asset.java
View file @
031176d4
...
@@ -76,6 +76,11 @@ public class Asset implements Serializable {
...
@@ -76,6 +76,11 @@ public class Asset implements Serializable {
@TableField
(
"md5"
)
@TableField
(
"md5"
)
private
String
md5
;
private
String
md5
;
@ApiModelProperty
(
"是否已删除"
)
@TableField
(
"is_deleted"
)
private
Boolean
isDeleted
;
@ApiModelProperty
(
"创建日期"
)
@ApiModelProperty
(
"创建日期"
)
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/model/Audit.java
View file @
031176d4
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.baomidou.mybatisplus.annotation.*
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -62,10 +63,12 @@ public class Audit implements Serializable {
...
@@ -62,10 +63,12 @@ public class Audit implements Serializable {
@ApiModelProperty
(
"操作类型"
)
@ApiModelProperty
(
"操作类型"
)
@TableField
(
"operation"
)
@TableField
(
"operation"
)
@NotBlank
(
message
=
"操作类型不能为空"
,
groups
=
{
Update
.
class
})
private
String
operation
;
private
String
operation
;
@ApiModelProperty
(
value
=
"审核状态"
,
allowableValues
=
"TBC,REFUSED,TBCA,APPROVED_FINAL"
)
@ApiModelProperty
(
value
=
"审核状态"
,
allowableValues
=
"TBC,REFUSED,TBCA,APPROVED_FINAL"
)
@TableField
(
"status"
)
@TableField
(
"status"
)
@NotBlank
(
message
=
"审核状态不能为空"
,
groups
=
{
Update
.
class
})
private
String
status
;
private
String
status
;
@ApiModelProperty
(
"创建日期"
)
@ApiModelProperty
(
"创建日期"
)
...
@@ -94,6 +97,7 @@ public class Audit implements Serializable {
...
@@ -94,6 +97,7 @@ public class Audit implements Serializable {
private
String
secondRemarks
;
private
String
secondRemarks
;
@ApiModelProperty
(
value
=
"审核层级"
,
allowableValues
=
"TBC,TBCA"
)
@ApiModelProperty
(
value
=
"审核层级"
,
allowableValues
=
"TBC,TBCA"
)
@NotBlank
(
message
=
"审核层级不能为空"
,
groups
=
{
Update
.
class
})
@TableField
(
"level"
)
@TableField
(
"level"
)
private
String
level
;
private
String
level
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/model/ExhibitionBoard.java
View file @
031176d4
...
@@ -94,6 +94,10 @@ public class ExhibitionBoard implements Serializable {
...
@@ -94,6 +94,10 @@ public class ExhibitionBoard implements Serializable {
@TableField
(
"is_published"
)
@TableField
(
"is_published"
)
private
Boolean
published
;
private
Boolean
published
;
@ApiModelProperty
(
"是否已删除"
)
@TableField
(
"is_deleted"
)
private
Boolean
isDeleted
;
@ApiModelProperty
(
"创建日期"
)
@ApiModelProperty
(
"创建日期"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/service/AuditService.java
View file @
031176d4
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
...
@@ -24,9 +25,33 @@ public interface AuditService extends IService<Audit> {
...
@@ -24,9 +25,33 @@ public interface AuditService extends IService<Audit> {
*
*
* @param name
* @param name
* @param status
* @param status
* @param auditStatusLevel
* @param type
* @param type
* @param page
* @param page
* @return
* @return
*/
*/
Page
<
Audit
>
pageList
(
String
name
,
AuditStatusEnum
status
,
AuditTypeEnum
type
,
Page
<
Object
>
page
);
Page
<
Audit
>
pageList
(
String
name
,
AuditStatusEnum
status
,
AuditStatusEnum
auditStatusLevel
,
AuditTypeEnum
type
,
Page
<
Object
>
page
);
/**
* 根据id更新审核信息
*
* @param audit
* @return
*/
boolean
updateAuditAllById
(
Audit
audit
);
Audit
selectOne
(
String
id
,
String
type
);
/**
* 根据审核项数据插入审核记录
*
* @param refItemId 审核项ID
* @param content 审核内容
* @param typeEnum 审核类型
* @param operationEnum 操作类型
* @return
*/
boolean
saveByRefItemInfo
(
String
refItemId
,
String
content
,
AuditTypeEnum
typeEnum
,
AuditOperationEnum
operationEnum
);
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/TOrganService.java
View file @
031176d4
...
@@ -15,7 +15,7 @@ import java.util.List;
...
@@ -15,7 +15,7 @@ import java.util.List;
*/
*/
public
interface
TOrganService
extends
IService
<
TOrgan
>
{
public
interface
TOrganService
extends
IService
<
TOrgan
>
{
List
<
TOrgan
>
getTree
();
List
<
TOrgan
>
getTree
(
String
orgCode
);
boolean
batchUpload
(
List
excelList
);
boolean
batchUpload
(
List
excelList
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/AuditServiceImpl.java
View file @
031176d4
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum
;
import
cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException
;
import
cn.wisenergy.chnmuseum.party.mapper.AuditMapper
;
import
cn.wisenergy.chnmuseum.party.mapper.AuditMapper
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
import
cn.wisenergy.chnmuseum.party.model.*
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.service.AssetService
;
import
cn.wisenergy.chnmuseum.party.service.AssetService
;
import
cn.wisenergy.chnmuseum.party.service.AuditService
;
import
cn.wisenergy.chnmuseum.party.service.AuditService
;
import
cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService
;
import
cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService
;
import
cn.wisenergy.chnmuseum.party.service.LearningContentService
;
import
cn.wisenergy.chnmuseum.party.service.LearningContentService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
/**
/**
* <pre>
* <pre>
...
@@ -62,13 +66,15 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
...
@@ -62,13 +66,15 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
* @return
* @return
*/
*/
@Override
@Override
public
Page
<
Audit
>
pageList
(
String
name
,
AuditStatusEnum
status
,
AuditTypeEnum
type
,
Page
<
Object
>
page
)
{
public
Page
<
Audit
>
pageList
(
String
name
,
AuditStatusEnum
status
,
Audit
StatusEnum
auditStatusLevel
,
Audit
TypeEnum
type
,
Page
<
Object
>
page
)
{
//分页
//分页
Page
<
Audit
>
auditPage
=
new
Page
<>();
Page
<
Audit
>
auditPage
=
new
Page
<>();
auditPage
.
setCurrent
(
page
.
getCurrent
());
auditPage
.
setCurrent
(
page
.
getCurrent
());
auditPage
.
setSize
(
page
.
getSize
());
auditPage
.
setSize
(
page
.
getSize
());
//条件
//条件
QueryWrapper
<
Audit
>
ew
=
new
QueryWrapper
<
Audit
>()
QueryWrapper
<
Audit
>
ew
=
new
QueryWrapper
<
Audit
>()
//暂时注掉
// .eq("a.level", auditStatusLevel.name())
.
eq
(
"a.type"
,
type
.
name
())
.
eq
(
"a.type"
,
type
.
name
())
.
orderByDesc
(
"a.create_time"
,
"a.id"
);
.
orderByDesc
(
"a.create_time"
,
"a.id"
);
//
//
...
@@ -111,4 +117,256 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
...
@@ -111,4 +117,256 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
return
selectPage
;
return
selectPage
;
}
}
/**
* 根据id更新审核信息
*
* @param audit
* @return
*/
@Override
public
boolean
updateAuditAllById
(
Audit
audit
)
{
//审核层级,初审 和 复审
AuditStatusEnum
auditStatusLevel
=
AuditStatusEnum
.
valueOf
(
audit
.
getLevel
());
boolean
update
;
switch
(
auditStatusLevel
)
{
case
TBC:
update
=
updateOnTBC
(
audit
);
return
update
;
case
TBCA:
update
=
updateOnTBCA
(
audit
);
return
update
;
default
:
throw
new
InterfaceException
(
"level参数不正确"
);
}
}
@Override
public
Audit
selectOne
(
String
id
,
String
type
)
{
UpdateWrapper
<
Audit
>
wrapper
=
new
UpdateWrapper
<>();
if
(
StringUtils
.
isNotBlank
(
id
))
{
wrapper
.
eq
(
"ref_item_id"
,
id
);
}
if
(
StringUtils
.
isNotBlank
(
type
))
{
wrapper
.
eq
(
"type"
,
type
);
}
wrapper
.
orderByDesc
(
"create_time"
).
last
(
"limit 1"
);
Audit
one
=
getOne
(
wrapper
);
return
one
;
}
/**
* 初审级别的修改情况
*
* @return
*/
private
boolean
updateOnTBC
(
Audit
audit
)
{
audit
.
setFirstTime
(
LocalDateTime
.
now
());
String
status
=
audit
.
getStatus
();
AuditStatusEnum
auditStatusEnum
=
AuditStatusEnum
.
valueOf
(
status
);
//初审 通过时,修改状态为待复审
if
(
AuditStatusEnum
.
APPROVED_FINAL
.
equals
(
auditStatusEnum
))
{
audit
.
setStatus
(
AuditStatusEnum
.
TBCA
.
name
());
audit
.
setLevel
(
AuditStatusEnum
.
TBCA
.
name
());
}
if
(!
AuditStatusEnum
.
REFUSED
.
equals
(
auditStatusEnum
))
{
audit
.
setFirstRemarks
(
""
);
}
audit
.
setSecondRemarks
(
""
);
//初审驳回时,不做状态修改
int
update
=
auditMapper
.
updateById
(
audit
);
return
update
>=
1
;
}
/**
* 复审级别的修改情况
*
* @return
*/
private
boolean
updateOnTBCA
(
Audit
audit
)
{
audit
.
setSecondTime
(
LocalDateTime
.
now
());
String
status
=
audit
.
getStatus
();
AuditStatusEnum
auditStatusEnum
=
AuditStatusEnum
.
valueOf
(
status
);
if
(!
AuditStatusEnum
.
REFUSED
.
equals
(
auditStatusEnum
))
{
audit
.
setSecondRemarks
(
""
);
}
audit
.
setFirstRemarks
(
""
);
//复审通过时,
boolean
updateRefItemByRefItemId
=
true
;
if
(
AuditStatusEnum
.
APPROVED_FINAL
.
equals
(
auditStatusEnum
))
{
//修改对应审核项中的信息
updateRefItemByRefItemId
=
updateRefItemByRefItemId
(
audit
);
}
//复审不通过时,不做状态修改
int
update
=
auditMapper
.
updateById
(
audit
);
return
updateRefItemByRefItemId
&&
update
>=
1
;
}
/**
* 根据审核项ID 修改 审核项表中的信息
*/
private
boolean
updateRefItemByRefItemId
(
Audit
audit
)
{
//
String
type
=
audit
.
getType
();
AuditTypeEnum
auditTypeEnum
=
AuditTypeEnum
.
valueOf
(
type
);
//
boolean
update
;
switch
(
auditTypeEnum
)
{
case
ASSET:
Asset
asset
=
fillAssetByAudit
(
audit
);
update
=
assetService
.
updateById
(
asset
);
break
;
// case ACCOUNT:
// break;
case
EXHIBITION_BOARD:
ExhibitionBoard
exhibitionBoard
=
fillAssetByExhibitionBoard
(
audit
);
update
=
exhibitionBoardService
.
updateById
(
exhibitionBoard
);
break
;
case
LEARNING_CONTENT:
LearningContent
learningContent
=
fillAssetByLearningContent
(
audit
);
update
=
learningContentService
.
updateById
(
learningContent
);
break
;
default
:
throw
new
InterfaceException
(
"type参数不正确"
);
}
return
update
;
}
/**
* 根据审核操作 填充Asset属性用于更改
*
* @param audit
* @return
*/
public
Asset
fillAssetByAudit
(
Audit
audit
)
{
Asset
asset
=
new
Asset
();
asset
.
setId
(
audit
.
getRefItemId
());
asset
.
setAuditStatus
(
audit
.
getStatus
());
//
String
operation
=
audit
.
getOperation
();
AuditOperationEnum
auditOperationEnum
=
AuditOperationEnum
.
valueOf
(
operation
);
switch
(
auditOperationEnum
)
{
case
ADD:
asset
.
setIsDeleted
(
false
);
break
;
case
ENABLE:
case
EDIT:
break
;
case
DISABLE:
asset
.
setIsDeleted
(
true
);
break
;
case
REMOVE:
asset
.
setPublished
(
false
);
break
;
default
:
}
return
asset
;
}
/**
* 根据审核操作 填充ExhibitionBoard属性用于更改
*
* @param audit
* @return
*/
public
ExhibitionBoard
fillAssetByExhibitionBoard
(
Audit
audit
)
{
ExhibitionBoard
exhibitionBoard
=
new
ExhibitionBoard
();
exhibitionBoard
.
setId
(
audit
.
getRefItemId
());
exhibitionBoard
.
setAuditStatus
(
audit
.
getStatus
());
//
String
operation
=
audit
.
getOperation
();
AuditOperationEnum
auditOperationEnum
=
AuditOperationEnum
.
valueOf
(
operation
);
switch
(
auditOperationEnum
)
{
case
ADD:
exhibitionBoard
.
setIsDeleted
(
false
);
break
;
case
ENABLE:
case
EDIT:
break
;
case
DISABLE:
exhibitionBoard
.
setIsDeleted
(
true
);
break
;
case
REMOVE:
exhibitionBoard
.
setPublished
(
false
);
break
;
default
:
}
return
exhibitionBoard
;
}
/**
* 根据审核操作 填充LearningContent属性用于更改
*
* @param audit
* @return
*/
public
LearningContent
fillAssetByLearningContent
(
Audit
audit
)
{
LearningContent
learningContent
=
new
LearningContent
();
learningContent
.
setAuditStatus
(
audit
.
getStatus
());
learningContent
.
setId
(
audit
.
getRefItemId
());
//
String
operation
=
audit
.
getOperation
();
AuditOperationEnum
auditOperationEnum
=
AuditOperationEnum
.
valueOf
(
operation
);
switch
(
auditOperationEnum
)
{
case
ADD:
learningContent
.
setIsDeleted
(
false
);
break
;
case
ENABLE:
case
EDIT:
break
;
case
DISABLE:
learningContent
.
setIsDeleted
(
true
);
break
;
case
REMOVE:
learningContent
.
setIsPublished
(
false
);
break
;
default
:
}
return
learningContent
;
}
/**
* 根据审核项数据插入审核记录
*
* @param refItemId 审核项ID
* @param content 审核内容
* @param typeEnum 审核类型
* @param operationEnum 操作类型
* @return
*/
@Override
public
boolean
saveByRefItemInfo
(
String
refItemId
,
String
content
,
AuditTypeEnum
typeEnum
,
AuditOperationEnum
operationEnum
)
{
Audit
audit
=
new
Audit
();
//
audit
.
setRefItemId
(
refItemId
);
audit
.
setContent
(
content
);
audit
.
setType
(
typeEnum
.
name
());
audit
.
setOperation
(
operationEnum
.
name
());
//
audit
.
setLevel
(
AuditStatusEnum
.
TBC
.
name
());
audit
.
setStatus
(
AuditStatusEnum
.
TBC
.
name
());
audit
.
setIsDeleted
(
false
);
audit
.
setCreateTime
(
LocalDateTime
.
now
());
//
Object
principal
=
SecurityUtils
.
getSubject
().
getPrincipal
();
if
(
principal
instanceof
TUser
)
{
TUser
user
=
(
TUser
)
principal
;
audit
.
setUserId
(
user
.
getId
());
audit
.
setUserName
(
user
.
getUserName
());
audit
.
setOrganId
(
user
.
getOrgId
());
audit
.
setOrgName
(
user
.
getOrgName
());
}
//保存
int
insert
=
auditMapper
.
insert
(
audit
);
return
insert
>=
1
;
}
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
View file @
031176d4
...
@@ -38,8 +38,8 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
...
@@ -38,8 +38,8 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
private
TAreaMapper
areaMapper
;
private
TAreaMapper
areaMapper
;
@Override
@Override
public
List
<
TOrgan
>
getTree
()
{
public
List
<
TOrgan
>
getTree
(
String
orgCode
)
{
List
<
TOrgan
>
list
=
list
(
Wrappers
.<
TOrgan
>
lambdaQuery
().
eq
(
TOrgan:
:
getIsDeleted
,
0
).
orderByDesc
(
TOrgan:
:
getLevel
));
List
<
TOrgan
>
list
=
list
(
Wrappers
.<
TOrgan
>
lambdaQuery
().
eq
(
TOrgan:
:
getIsDeleted
,
0
).
likeRight
(
TOrgan:
:
getCode
,
orgCode
).
orderByDesc
(
TOrgan:
:
getLevel
));
HashMap
<
String
,
TOrgan
>
map
=
new
HashMap
<>();
HashMap
<
String
,
TOrgan
>
map
=
new
HashMap
<>();
list
.
forEach
(
o
->
map
.
put
(
o
.
getId
(),
o
));
list
.
forEach
(
o
->
map
.
put
(
o
.
getId
(),
o
));
for
(
TOrgan
o
:
list
)
{
for
(
TOrgan
o
:
list
)
{
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AuditController.java
View file @
031176d4
...
@@ -4,10 +4,12 @@ import cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum;
...
@@ -4,10 +4,12 @@ import cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.vo.AuditStatusParam
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.service.AuditService
;
import
cn.wisenergy.chnmuseum.party.service.AuditService
;
import
cn.wisenergy.chnmuseum.party.service.impl.AuditServiceImpl
;
import
cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl
;
import
cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -46,7 +48,7 @@ import java.util.Map;
...
@@ -46,7 +48,7 @@ import java.util.Map;
public
class
AuditController
extends
BaseController
{
public
class
AuditController
extends
BaseController
{
@Resource
@Resource
private
AuditService
auditService
;
private
AuditService
Impl
auditService
;
@Resource
@Resource
private
TUserServiceImpl
userService
;
private
TUserServiceImpl
userService
;
...
@@ -65,6 +67,7 @@ public class AuditController extends BaseController {
...
@@ -65,6 +67,7 @@ public class AuditController extends BaseController {
public
Map
<
String
,
Object
>
getUserList
(
String
name
,
String
status
,
String
level
)
{
public
Map
<
String
,
Object
>
getUserList
(
String
name
,
String
status
,
String
level
)
{
Page
<
Audit
>
auditList
;
Page
<
Audit
>
auditList
;
try
{
try
{
TUser
user1
=
getcurUser
();
TUser
user
=
new
TUser
();
TUser
user
=
new
TUser
();
if
(
StringUtils
.
isNotBlank
(
name
))
{
if
(
StringUtils
.
isNotBlank
(
name
))
{
user
.
setUserName
(
name
);
user
.
setUserName
(
name
);
...
@@ -75,6 +78,15 @@ public class AuditController extends BaseController {
...
@@ -75,6 +78,15 @@ public class AuditController extends BaseController {
if
(
StringUtils
.
isNotBlank
(
level
))
{
if
(
StringUtils
.
isNotBlank
(
level
))
{
user
.
setAuditStatus
(
level
);
user
.
setAuditStatus
(
level
);
}
}
//如果是账号禁用初审员,设置层级为初审
if
(
user1
.
getRoleList
().
contains
(
"15"
)){
user
.
setAuditStatus
(
AuditStatusEnum
.
TBC
.
name
());
}
else
if
(
user1
.
getRoleList
().
contains
(
"16"
)){
user
.
setAuditStatus
(
AuditStatusEnum
.
TBCA
.
name
());
}
else
{
//不存在的层级
user
.
setAuditStatus
(
"1"
);
}
auditList
=
auditService
.
getUserList
(
getPage
(),
user
);
auditList
=
auditService
.
getUserList
(
getPage
(),
user
);
return
getResult
(
auditList
);
return
getResult
(
auditList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -95,7 +107,7 @@ public class AuditController extends BaseController {
...
@@ -95,7 +107,7 @@ public class AuditController extends BaseController {
if
(!
AuditStatusEnum
.
REFUSED
.
name
().
equals
(
audit
.
getStatus
()))
{
if
(!
AuditStatusEnum
.
REFUSED
.
name
().
equals
(
audit
.
getStatus
()))
{
audit
.
setFirstRemarks
(
""
);
audit
.
setFirstRemarks
(
""
);
}
}
}
else
{
}
else
{
//如果层级是复审,设置复审时间
//如果层级是复审,设置复审时间
audit
.
setSecondTime
(
LocalDateTime
.
now
());
audit
.
setSecondTime
(
LocalDateTime
.
now
());
//如果审核状态不是驳回,清空驳回原因
//如果审核状态不是驳回,清空驳回原因
...
@@ -117,7 +129,7 @@ public class AuditController extends BaseController {
...
@@ -117,7 +129,7 @@ public class AuditController extends BaseController {
//无论初审复审,及时更新审核状态
//无论初审复审,及时更新审核状态
user
.
setAuditStatus
(
audit
.
getStatus
());
user
.
setAuditStatus
(
audit
.
getStatus
());
//如果复审通过,真正禁用用户
//如果复审通过,真正禁用用户
if
(
AuditStatusEnum
.
APPROVED_FINAL
.
name
().
equals
(
audit
.
getStatus
())
&&
AuditStatusEnum
.
TBC
.
name
().
equals
(
audit
.
getLevel
()))
{
if
(
AuditStatusEnum
.
APPROVED_FINAL
.
name
().
equals
(
audit
.
getStatus
())
&&
AuditStatusEnum
.
TBCA
.
name
().
equals
(
audit
.
getLevel
()))
{
user
.
setStatus
(
AuditOperationEnum
.
DISABLE
.
name
());
user
.
setStatus
(
AuditOperationEnum
.
DISABLE
.
name
());
}
}
userService
.
updateById
(
user
);
userService
.
updateById
(
user
);
...
@@ -148,48 +160,48 @@ public class AuditController extends BaseController {
...
@@ -148,48 +160,48 @@ public class AuditController extends BaseController {
return
getFailResult
();
return
getFailResult
();
}
}
@GetMapping
(
"/getList"
)
//
@GetMapping("/getList")
@RequiresPermissions
(
"/audit/getList"
)
//
@RequiresPermissions("/audit/getList")
@ApiOperation
(
value
=
"获取禁用审核全部列表(无分页)"
,
notes
=
"获取禁用审核全部列表(无分页)"
)
//
@ApiOperation(value = "获取禁用审核全部列表(无分页)", notes = "获取禁用审核全部列表(无分页)")
@ApiImplicitParams
(
value
=
{
//
@ApiImplicitParams(value = {
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
//
@ApiImplicitParam(name = "auditStatus", value = "审核状态", paramType = "query", dataType = "String")
})
//
})
public
Map
<
String
,
Object
>
getAuditList
(
@RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED_FINAL"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
//
public Map<String, Object> getAuditList(@RequestParam(value = "auditStatus", defaultValue = "APPROVED_FINAL", required = false) AuditStatusEnum auditStatus) {
List
<
Audit
>
auditList
=
auditService
.
list
();
//
List<Audit> auditList = auditService.list();
return
getResult
(
auditList
);
//
return getResult(auditList);
}
//
}
//
@ApiImplicitParams
(
value
=
{
//
@ApiImplicitParams(value = {
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
//
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
//
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
),
//
@ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
//
@ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
//
@ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
})
//
})
@PostMapping
(
"/getPageList"
)
//
@PostMapping("/getPageList")
@RequiresPermissions
(
"/audit/getPageList"
)
//
@RequiresPermissions("/audit/getPageList")
@ApiOperation
(
value
=
"获取禁用审核分页列表"
,
notes
=
"获取禁用审核分页列表"
)
//
@ApiOperation(value = "获取禁用审核分页列表", notes = "获取禁用审核分页列表")
public
Map
<
String
,
Object
>
getAuditPageList
(
GenericPageParam
genericPageParam
)
{
//
public Map<String, Object> getAuditPageList(GenericPageParam genericPageParam) {
LambdaQueryWrapper
<
Audit
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
//
LambdaQueryWrapper<Audit> queryWrapper = new LambdaQueryWrapper<>();
// 对名称或编码模糊查询
//
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
//
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
queryWrapper
.
like
(
Audit:
:
getContent
,
genericPageParam
.
getNameOrCode
());
//
queryWrapper.like(Audit::getContent, genericPageParam.getNameOrCode());
}
//
}
// 根据创建时间区间检索
//
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
//
if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
queryWrapper
.
ge
(
Audit:
:
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
//
queryWrapper.ge(Audit::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
.
le
(
Audit:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
//
.le(Audit::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
}
//
}
// 设置排序规则
//
// 设置排序规则
queryWrapper
.
orderByDesc
(
Audit:
:
getCreateTime
);
//
queryWrapper.orderByDesc(Audit::getCreateTime);
// 设置查询内容
//
// 设置查询内容
queryWrapper
.
select
(
//
queryWrapper.select(
Audit:
:
getId
,
//
Audit::getId,
Audit:
:
getContent
,
//
Audit::getContent,
Audit:
:
getCreateTime
);
//
Audit::getCreateTime);
Page
<
Audit
>
page
=
this
.
auditService
.
page
(
getPage
(),
queryWrapper
);
//
Page<Audit> page = this.auditService.page(getPage(), queryWrapper);
return
getResult
(
page
);
//
return getResult(page);
}
//
}
@ApiOperation
(
value
=
"获取禁用审核详情"
,
notes
=
"获取禁用审核详情"
)
@ApiOperation
(
value
=
"获取禁用审核详情"
,
notes
=
"获取禁用审核详情"
)
@GetMapping
(
"/getById"
)
@GetMapping
(
"/getById"
)
...
@@ -198,19 +210,8 @@ public class AuditController extends BaseController {
...
@@ -198,19 +210,8 @@ public class AuditController extends BaseController {
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
try
{
try
{
Audit
audit
=
null
;
Audit
audit
=
null
;
UpdateWrapper
<
Audit
>
wrapper
=
new
UpdateWrapper
<>();
if
(
StringUtils
.
isNotBlank
(
id
))
{
wrapper
.
eq
(
"ref_item_id"
,
id
);
}
if
(
StringUtils
.
isNotBlank
(
type
))
{
wrapper
.
eq
(
"type"
,
type
);
}
wrapper
.
orderByDesc
(
"create_time"
);
//只获取最新的一条审核数据
//只获取最新的一条审核数据
List
<
Audit
>
list
=
auditService
.
list
(
wrapper
);
audit
=
auditService
.
selectOne
(
id
,
type
);
if
(
list
.
size
()
>
0
)
{
audit
=
list
.
get
(
0
);
}
resultMap
.
put
(
"resultCode"
,
"200"
);
resultMap
.
put
(
"resultCode"
,
"200"
);
resultMap
.
put
(
"message"
,
"操作成功"
);
resultMap
.
put
(
"message"
,
"操作成功"
);
resultMap
.
put
(
"data"
,
audit
);
resultMap
.
put
(
"data"
,
audit
);
...
@@ -225,30 +226,63 @@ public class AuditController extends BaseController {
...
@@ -225,30 +226,63 @@ public class AuditController extends BaseController {
//=================审核管理接口=================
//=================审核管理接口=================
@GetMapping
(
"/getPageAllList"
)
@GetMapping
(
"/getPageAllList"
)
// @RequiresPermissions("/audit/getUserList")
@ApiOperation
(
value
=
"审核管理=========分页查询"
,
notes
=
"审核管理=========分页查询"
)
@ApiOperation
(
value
=
"审核管理=========分页查询"
,
notes
=
"审核管理=========分页查询"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"账号名称或提交人"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"账号名称或提交人"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"待初审
TBC, 驳回 REFUSED,待复审 TBCA, 通过
APPROVED_FINAL"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"待初审
:TBC, 驳回:REFUSED,待复审:TBCA, 通过:
APPROVED_FINAL"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"视频内容
ASSET,展板内容 EXHIBITION_BOARD,学习内容
LEARNING_CONTENT"
,
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
)
@ApiImplicitParam
(
name
=
"type"
,
value
=
"视频内容
:ASSET,展板内容:EXHIBITION_BOARD,学习内容:
LEARNING_CONTENT"
,
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
)
})
})
public
Map
<
String
,
Object
>
getPageAllList
(
String
name
,
String
status
,
public
Map
<
String
,
Object
>
getPageAllList
(
String
name
,
String
status
,
@NotBlank
(
message
=
"type参数不能为空"
)
String
type
)
{
@NotBlank
(
message
=
"type参数不能为空"
)
String
type
)
{
//分页
Page
<
Object
>
page
=
getPage
();
Page
<
Object
>
page
=
getPage
();
AuditStatusEnum
auditStatusEnum
=
null
;
AuditStatusEnum
auditStatus
=
null
;
AuditStatusEnum
auditStatusLevel
=
null
;
AuditTypeEnum
auditTypeEnum
=
AuditTypeEnum
.
valueOf
(
type
);
AuditTypeEnum
auditTypeEnum
=
AuditTypeEnum
.
valueOf
(
type
);
//数据权限,暂时注释
// TUser user = getcurUser();
// switch (auditTypeEnum){
// case ASSET:
// if (user.getRoleList().contains("9")){
// auditStatusLevel=AuditStatusEnum.TBC;
// }else if(user.getRoleList().contains("10")) {
// auditStatusLevel=AuditStatusEnum.TBCA;
// }else {
// auditStatusLevel=AuditStatusEnum.APPROVED_FINAL;
// }
// break;
// case EXHIBITION_BOARD:
// if (user.getRoleList().contains("11")){
// auditStatusLevel=AuditStatusEnum.TBC;
// }else if(user.getRoleList().contains("12")) {
// auditStatusLevel=AuditStatusEnum.TBCA;
// }else {
// auditStatusLevel=AuditStatusEnum.APPROVED_FINAL;
// }
// break;
// case LEARNING_CONTENT:
// if (user.getRoleList().contains("13")){
// auditStatusLevel=AuditStatusEnum.TBC;
// }else if(user.getRoleList().contains("14")) {
// auditStatusLevel=AuditStatusEnum.TBCA;
// }else {
// auditStatusLevel=AuditStatusEnum.APPROVED_FINAL;
// }
// break;
//
// }
if
(
auditTypeEnum
==
null
)
{
if
(
auditTypeEnum
==
null
)
{
return
getFailResult
(
"type参数不正确"
);
return
getFailResult
(
"type参数不正确"
);
}
}
if
(
StringUtils
.
isNotBlank
(
status
))
{
if
(
StringUtils
.
isNotBlank
(
status
))
{
auditStatus
Enum
=
AuditStatusEnum
.
valueOf
(
status
);
auditStatus
=
AuditStatusEnum
.
valueOf
(
status
);
}
}
//
//
try
{
try
{
Page
<
Audit
>
auditList
=
auditService
.
pageList
(
name
,
auditStatus
Enum
,
auditTypeEnum
,
page
);
Page
<
Audit
>
auditList
=
auditService
.
pageList
(
name
,
auditStatus
,
auditStatusLevel
,
auditTypeEnum
,
page
);
return
getResult
(
auditList
);
return
getResult
(
auditList
);
}
catch
(
}
catch
(
...
@@ -258,5 +292,37 @@ public class AuditController extends BaseController {
...
@@ -258,5 +292,37 @@ public class AuditController extends BaseController {
return
getFailResult
();
return
getFailResult
();
}
}
@PutMapping
(
"/updateAuditAllById"
)
@RequiresPermissions
(
"/audit/update"
)
@ApiOperation
(
value
=
"审核管理===根据id修改审核信息"
,
notes
=
"审核管理===根据id修改审核信息"
)
public
Map
<
String
,
Object
>
updateAuditAllById
(
@RequestBody
@Validated
AuditStatusParam
auditStatusParam
)
{
String
id
=
auditStatusParam
.
getId
();
Audit
audit
=
auditService
.
getById
(
id
);
if
(
audit
==
null
)
{
return
getFailResult
(
"id参数有误"
);
}
//设置修改的审核状态
audit
.
setStatus
(
auditStatusParam
.
getStatus
());
//为啥数据库有null值
if
(
StringUtils
.
isBlank
(
audit
.
getLevel
()))
{
audit
.
setLevel
(
AuditStatusEnum
.
TBC
.
name
());
}
//初审
if
(
AuditStatusEnum
.
TBC
.
name
().
equals
(
audit
.
getLevel
()))
{
audit
.
setFirstRemarks
(
auditStatusParam
.
getRemarks
());
}
//复审
if
(
AuditStatusEnum
.
TBCA
.
name
().
equals
(
audit
.
getLevel
()))
{
audit
.
setSecondRemarks
(
auditStatusParam
.
getRemarks
());
}
boolean
update
=
auditService
.
updateAuditAllById
(
audit
);
return
update
?
getSuccessResult
()
:
getFailResult
();
}
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
031176d4
...
@@ -131,10 +131,10 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -131,10 +131,10 @@ public class ChinaMobileRestApiController extends BaseController {
jsonObject
.
put
(
"key"
,
tBoxOperation
.
getPrivateKey
());
jsonObject
.
put
(
"key"
,
tBoxOperation
.
getPrivateKey
());
return
getResult
(
jsonObject
);
return
getResult
(
jsonObject
);
}
else
{
}
else
{
throw
new
InterfaceException
(
"4
00"
,
"您无权获取本单位机顶盒密钥"
);
return
getFailResult
(
"5
00"
,
"您无权获取本单位机顶盒密钥"
);
}
}
}
}
throw
new
InterfaceException
(
"4
00"
,
"未查询到相关机顶盒信息"
);
return
getFailResult
(
"5
00"
,
"未查询到相关机顶盒信息"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TBoxOperationController.java
View file @
031176d4
...
@@ -62,10 +62,10 @@ public class TBoxOperationController extends BaseController {
...
@@ -62,10 +62,10 @@ public class TBoxOperationController extends BaseController {
user
.
setAreaId
(
areaId
);
user
.
setAreaId
(
areaId
);
}
}
//设置数据权限
//设置数据权限
if
(
StringUtils
.
isNotBlank
(
user1
.
getAreaId
()))
{
//
if (StringUtils.isNotBlank(user1.getAreaId())) {
String
areaId1
=
getAreaId
(
user1
.
getAreaId
());
//
String areaId1 = getAreaId(user1.getAreaId());
user
.
setAreaName
(
getAreaId
(
areaId1
)
);
// user.setAreaName(areaId1
);
}
//
}
user
.
setOrgCode
(
user1
.
getOrgCode
());
user
.
setOrgCode
(
user1
.
getOrgCode
());
try
{
try
{
Page
<
TBoxOperation
>
page
=
tBoxOperationService
.
selectBoxPage
(
getPage
(),
user
);
Page
<
TBoxOperation
>
page
=
tBoxOperationService
.
selectBoxPage
(
getPage
(),
user
);
...
@@ -109,6 +109,11 @@ public class TBoxOperationController extends BaseController {
...
@@ -109,6 +109,11 @@ public class TBoxOperationController extends BaseController {
if
(
tBoxOperation
!=
null
&&
StringUtils
.
isNotBlank
(
tBoxOperation
.
getMac
()))
{
if
(
tBoxOperation
!=
null
&&
StringUtils
.
isNotBlank
(
tBoxOperation
.
getMac
()))
{
tBoxOperation
.
setMac
(
tBoxOperation
.
getMac
().
toUpperCase
());
tBoxOperation
.
setMac
(
tBoxOperation
.
getMac
().
toUpperCase
());
}
}
if
(
2
==
tBoxOperation
.
getStatus
())
{
final
ArrayList
<
String
>
rsaKeys
=
RSAUtils
.
createRSAKeys
();
tBoxOperation
.
setPublicKey
(
rsaKeys
.
get
(
0
));
tBoxOperation
.
setPrivateKey
(
rsaKeys
.
get
(
1
));
}
boolean
flag
=
tBoxOperationService
.
updateById
(
tBoxOperation
);
boolean
flag
=
tBoxOperationService
.
updateById
(
tBoxOperation
);
UpdateWrapper
<
TUser
>
wrapper
=
new
UpdateWrapper
<>();
UpdateWrapper
<
TUser
>
wrapper
=
new
UpdateWrapper
<>();
wrapper
.
eq
(
"org_id"
,
tBoxOperation
.
getOrganId
());
wrapper
.
eq
(
"org_id"
,
tBoxOperation
.
getOrganId
());
...
@@ -212,7 +217,7 @@ public class TBoxOperationController extends BaseController {
...
@@ -212,7 +217,7 @@ public class TBoxOperationController extends BaseController {
}
}
public
String
getAreaId
(
String
areaId
)
{
public
static
String
getAreaId
(
String
areaId
)
{
if
(
"0000"
.
equals
(
areaId
.
substring
(
2
)))
{
if
(
"0000"
.
equals
(
areaId
.
substring
(
2
)))
{
areaId
=
areaId
.
substring
(
0
,
2
);
areaId
=
areaId
.
substring
(
0
,
2
);
}
else
if
(
"00"
.
equals
(
areaId
.
substring
(
4
)))
{
}
else
if
(
"00"
.
equals
(
areaId
.
substring
(
4
)))
{
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TOperationLogController.java
deleted
100644 → 0
View file @
7d9b2e91
//package cn.wisenergy.chnmuseum.party.web.controller;
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
//import cn.wisenergy.chnmuseum.party.model.TOperationLog;
//import cn.wisenergy.chnmuseum.party.service.TOperationLogService;
//import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum;
//import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
//import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
//import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.stereotype.Controller;
//
//import javax.annotation.Resource;
//import javax.validation.constraints.NotNull;
//import java.util.List;
//import java.util.Map;
//
///**
// * <pre>
// * 运维日志表 前端控制器
// * </pre>
// *
// * @author Danny Lee
// * @since 2021-03-23
// */
//@Slf4j
//@RestController
//@RequestMapping("/tOperationLog")
//@Api(tags = {"运维日志表操作接口"})
//public class TOperationLogController extends BaseController {
//
// @Resource
// private TOperationLogService tOperationLogService;
//
// @PostMapping("/batchSave")
// @RequiresPermissions("t:operation:log:batch:save")
// @ApiOperation(value = "批量添加运维日志表", notes = "批量添加运维日志表")
// public Map<String, Object> batchSaveTOperationLog(@Validated(value = {Add.class}) List<TOperationLog> tOperationLogList) {
// // 保存业务节点信息
// boolean result = tOperationLogService.saveBatch(tOperationLogList);
// // 返回操作结果
// if (result) {
// return getSuccessResult();
// } else {
// // 保存失败
// return getFailResult();
// }
// }
//
// @PostMapping("/save")
// @RequiresPermissions("t:operation:log:save")
// @ApiOperation(value = "添加运维日志表", notes = "添加运维日志表")
// public Map<String, Object> saveTOperationLog(@Validated(value = {Add.class}) TOperationLog tOperationLog) {
// // 保存业务节点信息
// boolean result = tOperationLogService.save(tOperationLog);
// // 返回操作结果
// if (result) {
// return getSuccessResult();
// } else {
// // 保存失败
// return getFailResult();
// }
// }
//
// @PutMapping("/update")
// @RequiresPermissions("t:operation:log:update")
// @ApiOperation(value = "修改运维日志表信息", notes = "修改运维日志表信息")
// public Map<String, Object> updateTOperationLog(@Validated(value = {Update.class}) TOperationLog tOperationLog) {
// boolean flag = tOperationLogService.updateById(tOperationLog);
// if (flag) {
// return getSuccessResult();
// }
// return getFailResult();
// }
//
// @PutMapping("/updateAuditStatus/{id}")
// @RequiresPermissions("t:operation:log:update:audit:status")
// @ApiOperation(value = "更新运维日志表审核状态", notes = "更新运维日志表审核状态")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
// @ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String")
// })
// public Map<String, Object> updateStatus(@NotNull(message = "运维日志表ID不能为空") @PathVariable("id") String id, @RequestParam("status") AuditStatusEnum status) {
// UpdateWrapper<TOperationLog> updateWrapper = new UpdateWrapper<>();
// updateWrapper.eq("id", id);
// updateWrapper.eq("audit_status", status.name());
// boolean flag = tOperationLogService.update(updateWrapper);
// if (flag) {
// return getSuccessResult();
// }
// return getFailResult();
// }
//
// @DeleteMapping("/delete/{id}")
// @RequiresPermissions("t:operation:log:delete")
// @ApiOperation(value = "根据ID删除运维日志表", notes = "根据ID删除运维日志表")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
// })
// public Map<String, Object> deleteTOperationLog(@PathVariable("id") String id) {
// boolean result = tOperationLogService.removeById(id);
// if (result) {
// return getSuccessResult();
// }
// return getFailResult();
// }
//
// @GetMapping("/getList")
// @RequiresPermissions("t:operation:log:list")
// @ApiOperation(value = "获取运维日志表全部列表(无分页)", notes = "获取运维日志表全部列表(无分页)")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "auditStatus", value = "审核状态", paramType = "query", dataType = "String")
// })
// public Map<String, Object> getTOperationLogList(@RequestParam(value = "auditStatus", defaultValue = "APPROVED_FINAL", required = false) AuditStatusEnum auditStatus) {
// List<TOperationLog> tOperationLogList = tOperationLogService.list();
// return getResult(tOperationLogList);
// }
//
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
// @ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
// @ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"),
// @ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
// @ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
// })
// @PostMapping("/getPageList")
// @RequiresPermissions("t:operation:log:page")
// @ApiOperation(value = "获取运维日志表分页列表", notes = "获取运维日志表分页列表")
// public Map<String, Object> getTOperationLogPageList(GenericPageParam genericPageParam) {
// LambdaQueryWrapper<TOperationLog> queryWrapper = new LambdaQueryWrapper<>();
// // 对名称或编码模糊查询
// if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
// queryWrapper.like(TOperationLog::getUserId, genericPageParam.getNameOrCode());
// }
// // 根据创建时间区间检索
// if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
// queryWrapper.ge(TOperationLog::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
// .le(TOperationLog::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
// }
// // 设置排序规则
// queryWrapper.orderByDesc(TOperationLog::getCreateTime);
// Page<TOperationLog> page = this.tOperationLogService.page(getPage(), queryWrapper);
// for (TOperationLog tOperationLog : page.getRecords()) {
//
// }
// return getResult(page);
// }
//
// @ApiOperation(value = "获取运维日志表详情", notes = "获取运维日志表详情")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path")
// })
// @GetMapping("/get/{id}")
// @RequiresPermissions("t:operation:log:get:id")
// public Map<String, Object> getById(@PathVariable("id") String id) {
// TOperationLog tOperationLog = tOperationLogService.getById(id);
// return getResult(tOperationLog);
// }
//
//}
//
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TOrganController.java
View file @
031176d4
...
@@ -242,10 +242,9 @@ public class TOrganController extends BaseController {
...
@@ -242,10 +242,9 @@ public class TOrganController extends BaseController {
public
Map
<
String
,
Object
>
getTree
(
String
name
)
{
public
Map
<
String
,
Object
>
getTree
(
String
name
)
{
TUser
user
=
getcurUser
();
TUser
user
=
getcurUser
();
List
<
TOrgan
>
list
=
new
ArrayList
<>();
List
<
TOrgan
>
list
=
new
ArrayList
<>();
try
{
try
{
if
(
StringUtils
.
isBlank
(
name
))
{
if
(
StringUtils
.
isBlank
(
name
))
{
list
=
tOrganService
.
getTree
();
list
=
tOrganService
.
getTree
(
user
.
getOrgCode
()
);
}
else
{
}
else
{
list
=
tOrganService
.
list
(
new
UpdateWrapper
<
TOrgan
>().
like
(
"name"
,
name
).
likeRight
(
"code"
,
user
.
getOrgCode
()));
list
=
tOrganService
.
list
(
new
UpdateWrapper
<
TOrgan
>().
like
(
"name"
,
name
).
likeRight
(
"code"
,
user
.
getOrgCode
()));
}
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TUserController.java
View file @
031176d4
...
@@ -89,10 +89,14 @@ public class TUserController extends BaseController {
...
@@ -89,10 +89,14 @@ public class TUserController extends BaseController {
}
}
if
(
StringUtils
.
isNotBlank
(
type
))
{
if
(
StringUtils
.
isNotBlank
(
type
))
{
user
.
setType
(
type
);
user
.
setType
(
type
);
if
(!
"4"
.
equals
(
type
)
&&
!
"5"
.
equals
(
type
)
)
{
if
(!
"4"
.
equals
(
type
))
{
//设置用户数据权限
//设置用户数据权限
user
.
setOrgCode
(
user1
.
getOrgCode
());
user
.
setOrgCode
(
user1
.
getOrgCode
());
}
}
if
(
"4"
.
equals
(
type
))
{
//设置用户数据权限
user
.
setAreaName
(
TBoxOperationController
.
getAreaId
(
user1
.
getAreaId
()));
}
if
(
"2"
.
equals
(
type
))
{
if
(
"2"
.
equals
(
type
))
{
List
<
String
>
roleList
=
user1
.
getRoleList
();
List
<
String
>
roleList
=
user1
.
getRoleList
();
//如果是单位用户,只能查看本机构的单位用户
//如果是单位用户,只能查看本机构的单位用户
...
@@ -509,6 +513,7 @@ public class TUserController extends BaseController {
...
@@ -509,6 +513,7 @@ public class TUserController extends BaseController {
TUser
entity
=
new
TUser
();
TUser
entity
=
new
TUser
();
entity
.
setId
(
userId
);
entity
.
setId
(
userId
);
entity
.
setStatus
(
AuditOperationEnum
.
ENABLE
.
name
());
entity
.
setStatus
(
AuditOperationEnum
.
ENABLE
.
name
());
entity
.
setAuditStatus
(
AuditStatusEnum
.
APPROVED_FINAL
.
name
());
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
boolean
ret
=
this
.
userService
.
updateById
(
entity
);
boolean
ret
=
this
.
userService
.
updateById
(
entity
);
if
(!
ret
)
{
if
(!
ret
)
{
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/base/BaseController.java
View file @
031176d4
...
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.alibaba.fastjson.serializer.SimplePropertyPreFilter
;
import
com.alibaba.fastjson.serializer.SimplePropertyPreFilter
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -189,6 +190,8 @@ public class BaseController implements Serializable {
...
@@ -189,6 +190,8 @@ public class BaseController implements Serializable {
if
(
authorization
.
startsWith
(
"Bearer "
))
{
if
(
authorization
.
startsWith
(
"Bearer "
))
{
authorization
=
authorization
.
substring
(
7
);
authorization
=
authorization
.
substring
(
7
);
}
}
}
else
{
throw
new
AuthenticationException
(
"token失效,请重新登录"
);
}
}
return
JwtTokenUtil
.
getEmployeeId
(
authorization
);
return
JwtTokenUtil
.
getEmployeeId
(
authorization
);
}
}
...
@@ -204,6 +207,8 @@ public class BaseController implements Serializable {
...
@@ -204,6 +207,8 @@ public class BaseController implements Serializable {
if
(
authorization
.
startsWith
(
"Bearer "
))
{
if
(
authorization
.
startsWith
(
"Bearer "
))
{
authorization
=
authorization
.
substring
(
7
);
authorization
=
authorization
.
substring
(
7
);
}
}
}
else
{
throw
new
AuthenticationException
(
"token失效,请重新登录"
);
}
}
return
JwtTokenUtil
.
getUsername
(
authorization
);
return
JwtTokenUtil
.
getUsername
(
authorization
);
}
}
...
...
src/main/resources/mapper/TUserMapper.xml
View file @
031176d4
...
@@ -87,6 +87,9 @@
...
@@ -87,6 +87,9 @@
<if
test=
" user.areaId != null and user.areaId != '' "
>
<if
test=
" user.areaId != null and user.areaId != '' "
>
and u.area_id = #{user.areaId}
and u.area_id = #{user.areaId}
</if>
</if>
<if
test=
" user.areaName != null and user.areaName != '' "
>
and u.area_id LIKE concat(#{user.areaName}, '%')
</if>
and u.is_deleted = false
and u.is_deleted = false
order by u.create_time desc
order by u.create_time desc
</select>
</select>
...
...
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