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
22b835ec
Commit
22b835ec
authored
Mar 29, 2021
by
wzp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改展板管理
parent
12f2edff
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
113 additions
and
87 deletions
+113
-87
RESPONSE_CODE_ENUM.java
...ergy/chnmuseum/party/common/enums/RESPONSE_CODE_ENUM.java
+15
-25
SystemOperationLogService.java
...chnmuseum/party/common/log/SystemOperationLogService.java
+8
-2
GlobalExceptionAdvisor.java
...gy/chnmuseum/party/common/mvc/GlobalExceptionAdvisor.java
+4
-4
InterfaceException.java
...energy/chnmuseum/party/common/mvc/InterfaceException.java
+3
-3
RequestParamValidAspect.java
...y/chnmuseum/party/common/mvc/RequestParamValidAspect.java
+1
-1
HttpResult.java
...isenergy/chnmuseum/party/common/validator/HttpResult.java
+25
-25
Audit.java
src/main/java/cn/wisenergy/chnmuseum/party/model/Audit.java
+5
-5
AuditController.java
...nergy/chnmuseum/party/web/controller/AuditController.java
+21
-6
FileUploadController.java
.../chnmuseum/party/web/controller/FileUploadController.java
+8
-8
TOrganController.java
...ergy/chnmuseum/party/web/controller/TOrganController.java
+15
-0
BaseController.java
...y/chnmuseum/party/web/controller/base/BaseController.java
+8
-8
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/enums/RESPONSE_CODE_ENUM.java
View file @
22b835ec
...
@@ -97,42 +97,32 @@ public enum RESPONSE_CODE_ENUM {
...
@@ -97,42 +97,32 @@ public enum RESPONSE_CODE_ENUM {
// 错误编码
// 错误编码
private
String
c
ode
;
private
String
resultC
ode
;
// 错误信息
// 错误信息
private
String
m
sg
;
private
String
m
essage
;
// 相应编码有参构造函数
// 相应编码有参构造函数
RESPONSE_CODE_ENUM
(
String
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
RESPONSE_CODE_ENUM
(
String
resultCode
,
String
message
)
{
this
.
resultCode
=
resultCode
;
this
.
message
=
message
;
}
}
/**
public
String
getResultCode
()
{
* 获取编码
return
resultCode
;
*/
public
String
getCode
()
{
return
code
;
}
}
/**
public
String
getMessage
()
{
* 设置编码
return
message
;
*/
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
/**
public
void
setResultCode
(
String
resultCode
)
{
* 获取编码信息
this
.
resultCode
=
resultCode
;
*/
public
String
getMsg
()
{
return
msg
;
}
}
/**
public
void
setMessage
(
String
message
)
{
* 设置编码信息
this
.
message
=
message
;
*/
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
}
}
}
src/main/java/cn/wisenergy/chnmuseum/party/common/log/SystemOperationLogService.java
View file @
22b835ec
...
@@ -90,6 +90,12 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
...
@@ -90,6 +90,12 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
MethodLog
methodLog
=
getAnnotationLog
(
point
);
MethodLog
methodLog
=
getAnnotationLog
(
point
);
String
ip
=
getIp
(
request
);
String
ip
=
getIp
(
request
);
TUser
user
=
getCurAdmin
(
request
);
TUser
user
=
getCurAdmin
(
request
);
// if (user==null){
// HashMap<String, Object> resultMap = new HashMap<>();
// resultMap.put("resultCode", "500");
// resultMap.put("message", "用户未登录!");
// return resultMap;
// }
String
methodName
=
user
.
getUserName
()
+
"登录本系统"
;
String
methodName
=
user
.
getUserName
()
+
"登录本系统"
;
if
(
user
.
getOrgName
()
!=
null
)
{
if
(
user
.
getOrgName
()
!=
null
)
{
methodName
+=
",机构"
+
user
.
getOrgName
();
methodName
+=
",机构"
+
user
.
getOrgName
();
...
@@ -170,8 +176,8 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
...
@@ -170,8 +176,8 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
protected
Map
<
String
,
Object
>
getFailResult
()
{
protected
Map
<
String
,
Object
>
getFailResult
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
get
Result
Code
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getM
sg
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getM
essage
());
return
map
;
return
map
;
}
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/mvc/GlobalExceptionAdvisor.java
View file @
22b835ec
...
@@ -169,8 +169,8 @@ public class GlobalExceptionAdvisor {
...
@@ -169,8 +169,8 @@ public class GlobalExceptionAdvisor {
@ExceptionHandler
(
InterfaceException
.
class
)
@ExceptionHandler
(
InterfaceException
.
class
)
public
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
handleInterfaceException
(
InterfaceException
exception
)
{
public
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
handleInterfaceException
(
InterfaceException
exception
)
{
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
httpResult
=
new
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
();
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
httpResult
=
new
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
();
httpResult
.
setCode
(
Integer
.
parseInt
(
exception
.
getErrorCode
()));
httpResult
.
set
Result
Code
(
Integer
.
parseInt
(
exception
.
getErrorCode
()));
httpResult
.
setM
sg
(
exception
.
getErrorMsg
());
httpResult
.
setM
essage
(
exception
.
getErrorMsg
());
return
httpResult
;
return
httpResult
;
}
}
...
@@ -209,7 +209,7 @@ public class GlobalExceptionAdvisor {
...
@@ -209,7 +209,7 @@ public class GlobalExceptionAdvisor {
* @param httpResult 响应对象
* @param httpResult 响应对象
*/
*/
private
void
addResCodeToMap
(
RESPONSE_CODE_ENUM
responseCodeEnum
,
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
httpResult
)
{
private
void
addResCodeToMap
(
RESPONSE_CODE_ENUM
responseCodeEnum
,
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
httpResult
)
{
httpResult
.
set
Code
(
Integer
.
parseInt
(
responseCodeEnum
.
ge
tCode
()));
httpResult
.
set
ResultCode
(
Integer
.
parseInt
(
responseCodeEnum
.
getResul
tCode
()));
httpResult
.
setM
sg
(
responseCodeEnum
.
getMsg
());
httpResult
.
setM
essage
(
responseCodeEnum
.
getMessage
());
}
}
}
}
\ No newline at end of file
src/main/java/cn/wisenergy/chnmuseum/party/common/mvc/InterfaceException.java
View file @
22b835ec
...
@@ -43,9 +43,9 @@ public class InterfaceException extends RuntimeException {
...
@@ -43,9 +43,9 @@ public class InterfaceException extends RuntimeException {
* @param responseCode 响应编码枚举
* @param responseCode 响应编码枚举
*/
*/
public
InterfaceException
(
RESPONSE_CODE_ENUM
responseCode
)
{
public
InterfaceException
(
RESPONSE_CODE_ENUM
responseCode
)
{
super
(
"errorCode:"
+
responseCode
.
get
Code
()
+
" errorMsg:"
+
responseCode
.
getMsg
());
super
(
"errorCode:"
+
responseCode
.
get
ResultCode
()
+
" errorMsg:"
+
responseCode
.
getMessage
());
this
.
errorCode
=
responseCode
.
getCode
();
this
.
errorCode
=
responseCode
.
get
Result
Code
();
this
.
errorMsg
=
responseCode
.
getM
sg
();
this
.
errorMsg
=
responseCode
.
getM
essage
();
}
}
/**
/**
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/mvc/RequestParamValidAspect.java
View file @
22b835ec
...
@@ -89,7 +89,7 @@ public class RequestParamValidAspect {
...
@@ -89,7 +89,7 @@ public class RequestParamValidAspect {
}
}
//返回第一条校验失败信息,也可以拼接起来返回所有的
//返回第一条校验失败信息,也可以拼接起来返回所有的
String
message
=
validResult
.
iterator
().
next
().
getMessage
();
String
message
=
validResult
.
iterator
().
next
().
getMessage
();
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
PARAM_NOT_VALID
.
getCode
(),
message
);
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
PARAM_NOT_VALID
.
get
Result
Code
(),
message
);
}
}
}
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/validator/HttpResult.java
View file @
22b835ec
...
@@ -2,57 +2,57 @@ package cn.wisenergy.chnmuseum.party.common.validator;
...
@@ -2,57 +2,57 @@ package cn.wisenergy.chnmuseum.party.common.validator;
public
class
HttpResult
{
public
class
HttpResult
{
// 响应的状态码
// 响应的状态码
private
int
c
ode
;
private
int
resultC
ode
;
// 响应的响应信息
// 响应的响应信息
private
String
m
sg
;
private
String
m
essage
;
// 响应的响应体
// 响应的响应体
private
Object
body
;
private
Object
data
;
public
HttpResult
()
{
public
HttpResult
()
{
}
}
public
HttpResult
(
int
code
,
String
msg
)
{
public
HttpResult
(
int
resultCode
,
String
message
)
{
this
.
code
=
c
ode
;
this
.
resultCode
=
resultC
ode
;
this
.
m
sg
=
msg
;
this
.
m
essage
=
message
;
}
}
public
HttpResult
(
int
code
,
Object
body
)
{
public
HttpResult
(
int
resultCode
,
Object
data
)
{
this
.
code
=
c
ode
;
this
.
resultCode
=
resultC
ode
;
this
.
body
=
body
;
this
.
data
=
data
;
}
}
public
int
getCode
()
{
public
int
get
Result
Code
()
{
return
c
ode
;
return
resultC
ode
;
}
}
public
void
set
Code
(
int
c
ode
)
{
public
void
set
ResultCode
(
int
resultC
ode
)
{
this
.
code
=
c
ode
;
this
.
resultCode
=
resultC
ode
;
}
}
public
String
getM
sg
()
{
public
String
getM
essage
()
{
return
m
sg
;
return
m
essage
;
}
}
public
void
setM
sg
(
String
msg
)
{
public
void
setM
essage
(
String
message
)
{
this
.
m
sg
=
msg
;
this
.
m
essage
=
message
;
}
}
public
Object
get
Body
()
{
public
Object
get
Data
()
{
return
body
;
return
data
;
}
}
public
void
set
Body
(
Object
body
)
{
public
void
set
Data
(
Object
data
)
{
this
.
body
=
body
;
this
.
data
=
data
;
}
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"{"
+
return
"
HttpResult
{"
+
"
\"code\":"
+
c
ode
+
"
resultCode="
+
resultC
ode
+
",
\"msg\":"
+
"\""
+
msg
+
"\""
+
",
message='"
+
message
+
'\''
+
",
\"body\":"
+
body
+
",
data="
+
data
+
'}'
;
'}'
;
}
}
}
}
src/main/java/cn/wisenergy/chnmuseum/party/model/Audit.java
View file @
22b835ec
...
@@ -35,7 +35,7 @@ public class Audit implements Serializable {
...
@@ -35,7 +35,7 @@ public class Audit implements Serializable {
@ApiModelProperty
(
"审核ID"
)
@ApiModelProperty
(
"审核ID"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"审核ID不能为空"
,
groups
=
{
Update
.
class
}
)
@NotNull
(
message
=
"审核ID不能为空"
)
private
String
id
;
private
String
id
;
@ApiModelProperty
(
"审核内容"
)
@ApiModelProperty
(
"审核内容"
)
...
@@ -48,17 +48,17 @@ public class Audit implements Serializable {
...
@@ -48,17 +48,17 @@ public class Audit implements Serializable {
@ApiModelProperty
(
"审核项ID"
)
@ApiModelProperty
(
"审核项ID"
)
@TableField
(
"ref_item_id"
)
@TableField
(
"ref_item_id"
)
@NotBlank
(
message
=
"审核项ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
@NotBlank
(
message
=
"审核项ID不能为空"
,
groups
=
{
Add
.
class
})
private
String
refItemId
;
private
String
refItemId
;
@ApiModelProperty
(
"提交人员"
)
@ApiModelProperty
(
"提交人员"
)
@TableField
(
value
=
"user_id"
,
fill
=
FieldFill
.
INSERT
)
@TableField
(
value
=
"user_id"
,
fill
=
FieldFill
.
INSERT
)
@NotBlank
(
message
=
"提交人员不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
@NotBlank
(
message
=
"提交人员不能为空"
,
groups
=
{
Add
.
class
})
private
String
userId
;
private
String
userId
;
@ApiModelProperty
(
value
=
"审核内容"
,
allowableValues
=
"视频内容 ASSET, 展板内容 EXHIBITION_BOARD, 学习内容 LEARNING_CONTENT, 账户 ACCOUNT"
)
@ApiModelProperty
(
value
=
"审核内容"
,
allowableValues
=
"视频内容 ASSET, 展板内容 EXHIBITION_BOARD, 学习内容 LEARNING_CONTENT, 账户 ACCOUNT"
)
@TableField
(
"type"
)
@TableField
(
"type"
)
@NotBlank
(
message
=
"0,看板;1 视频;2 学习内容;3 账号禁用不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
@NotBlank
(
message
=
"0,看板;1 视频;2 学习内容;3 账号禁用不能为空"
,
groups
=
{
Add
.
class
})
private
String
type
;
private
String
type
;
@ApiModelProperty
(
"操作类型"
)
@ApiModelProperty
(
"操作类型"
)
...
@@ -71,7 +71,7 @@ public class Audit implements Serializable {
...
@@ -71,7 +71,7 @@ public class Audit implements Serializable {
@ApiModelProperty
(
"创建日期"
)
@ApiModelProperty
(
"创建日期"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
@NotNull
(
message
=
"创建日期不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
@NotNull
(
message
=
"创建日期不能为空"
,
groups
=
{
Add
.
class
})
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"更新日期"
)
@ApiModelProperty
(
"更新日期"
)
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AuditController.java
View file @
22b835ec
...
@@ -11,6 +11,7 @@ import cn.wisenergy.chnmuseum.party.service.AuditService;
...
@@ -11,6 +11,7 @@ import cn.wisenergy.chnmuseum.party.service.AuditService;
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
;
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
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -23,6 +24,7 @@ import org.springframework.validation.annotation.Validated;
...
@@ -23,6 +24,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -57,7 +59,7 @@ public class AuditController extends BaseController {
...
@@ -57,7 +59,7 @@ public class AuditController extends BaseController {
@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
=
"level"
,
value
=
"初审 TBC,复审 TBCA"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"level"
,
value
=
"初审 TBC,复审 TBCA"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
})
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
user1
=
getcurUser
();
...
@@ -72,7 +74,7 @@ public class AuditController extends BaseController {
...
@@ -72,7 +74,7 @@ public class AuditController extends BaseController {
user
.
setAuditStatus
(
level
);
user
.
setAuditStatus
(
level
);
}
}
user
.
setOrgCode
(
user1
.
getOrgCode
());
user
.
setOrgCode
(
user1
.
getOrgCode
());
auditList
=
auditService
.
getUserList
(
getPage
(),
user
);
auditList
=
auditService
.
getUserList
(
getPage
(),
user
);
return
getResult
(
auditList
);
return
getResult
(
auditList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -85,10 +87,10 @@ public class AuditController extends BaseController {
...
@@ -85,10 +87,10 @@ public class AuditController extends BaseController {
@ApiOperation
(
value
=
"修改禁用审核信息"
,
notes
=
"修改禁用审核信息"
)
@ApiOperation
(
value
=
"修改禁用审核信息"
,
notes
=
"修改禁用审核信息"
)
public
Map
<
String
,
Object
>
updateAudit
(
@Validated
(
value
=
{
Update
.
class
})
Audit
audit
)
{
public
Map
<
String
,
Object
>
updateAudit
(
@Validated
(
value
=
{
Update
.
class
})
Audit
audit
)
{
boolean
flag
;
boolean
flag
;
if
(!
AuditStatusEnum
.
TBCA
.
name
().
equals
(
audit
.
getStatus
())){
if
(!
AuditStatusEnum
.
TBCA
.
name
().
equals
(
audit
.
getStatus
()))
{
audit
.
setLevel
(
AuditStatusEnum
.
TBCA
.
name
());
audit
.
setLevel
(
AuditStatusEnum
.
TBCA
.
name
());
}
}
if
(!
AuditStatusEnum
.
REFUSED
.
name
().
equals
(
audit
.
getStatus
())){
if
(!
AuditStatusEnum
.
REFUSED
.
name
().
equals
(
audit
.
getStatus
()))
{
audit
.
setRemarks
(
""
);
audit
.
setRemarks
(
""
);
}
}
try
{
try
{
...
@@ -174,8 +176,21 @@ public class AuditController extends BaseController {
...
@@ -174,8 +176,21 @@ public class AuditController extends BaseController {
@GetMapping
(
"/getById"
)
@GetMapping
(
"/getById"
)
@RequiresPermissions
(
"/audit/getById"
)
@RequiresPermissions
(
"/audit/getById"
)
public
Map
<
String
,
Object
>
getById
(
String
id
)
{
public
Map
<
String
,
Object
>
getById
(
String
id
)
{
Audit
audit
=
auditService
.
getById
(
id
);
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
return
getResult
(
audit
);
try
{
Audit
audit
=
new
Audit
();
UpdateWrapper
<
Audit
>
wrapper
=
new
UpdateWrapper
<>();
wrapper
.
eq
(
"ref_item_id"
,
id
);
audit
=
auditService
.
getOne
(
wrapper
);
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"message"
,
"用户未登录!"
);
resultMap
.
put
(
"data"
,
audit
);
return
resultMap
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
getFailResult
();
}
}
}
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/FileUploadController.java
View file @
22b835ec
...
@@ -105,7 +105,7 @@ public class FileUploadController {
...
@@ -105,7 +105,7 @@ public class FileUploadController {
@ApiOperation
(
value
=
"资料上传"
,
notes
=
"资料上传"
)
@ApiOperation
(
value
=
"资料上传"
,
notes
=
"资料上传"
)
public
ResponseEntity
<
BatchUploadResVO
>
uploadFile
(
@RequestPart
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
files
)
throws
IOException
{
public
ResponseEntity
<
BatchUploadResVO
>
uploadFile
(
@RequestPart
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
files
)
throws
IOException
{
if
(
files
.
length
==
0
)
{
if
(
files
.
length
==
0
)
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
getCode
(),
"没有文件可供上传"
);
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
get
Result
Code
(),
"没有文件可供上传"
);
}
}
int
successCount
=
0
;
int
successCount
=
0
;
int
failureCount
=
0
;
int
failureCount
=
0
;
...
@@ -160,16 +160,16 @@ public class FileUploadController {
...
@@ -160,16 +160,16 @@ public class FileUploadController {
@ApiOperation
(
value
=
"单图片上传"
,
notes
=
"单图片上传"
)
@ApiOperation
(
value
=
"单图片上传"
,
notes
=
"单图片上传"
)
public
ResponseEntity
<
ImageUploadResult
>
uploadImage
(
@RequestParam
(
value
=
"file"
)
MultipartFile
uploadFile
)
throws
Exception
{
public
ResponseEntity
<
ImageUploadResult
>
uploadImage
(
@RequestParam
(
value
=
"file"
)
MultipartFile
uploadFile
)
throws
Exception
{
if
(
uploadFile
==
null
||
uploadFile
.
getSize
()
==
0
)
{
if
(
uploadFile
==
null
||
uploadFile
.
getSize
()
==
0
)
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
getCode
(),
"没有文件可供上传"
);
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
get
Result
Code
(),
"没有文件可供上传"
);
}
}
String
fileName
=
uploadFile
.
getOriginalFilename
();
String
fileName
=
uploadFile
.
getOriginalFilename
();
String
extension
=
FilenameUtils
.
getExtension
(
fileName
);
String
extension
=
FilenameUtils
.
getExtension
(
fileName
);
if
(
StringUtils
.
isBlank
(
extension
))
{
if
(
StringUtils
.
isBlank
(
extension
))
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
getCode
(),
"文件格式不支持"
);
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
get
Result
Code
(),
"文件格式不支持"
);
}
}
boolean
anyMatch
=
Arrays
.
stream
(
IMAGE_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extension
.
toUpperCase
()));
boolean
anyMatch
=
Arrays
.
stream
(
IMAGE_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extension
.
toUpperCase
()));
if
(!
anyMatch
)
{
if
(!
anyMatch
)
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
getCode
(),
"文件格式不支持"
);
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
get
Result
Code
(),
"文件格式不支持"
);
}
}
String
url
=
FastDFSUtils
.
uploadFile
(
uploadFile
.
getInputStream
(),
uploadFile
.
getSize
(),
fileName
);
String
url
=
FastDFSUtils
.
uploadFile
(
uploadFile
.
getInputStream
(),
uploadFile
.
getSize
(),
fileName
);
...
@@ -189,11 +189,11 @@ public class FileUploadController {
...
@@ -189,11 +189,11 @@ public class FileUploadController {
@ApiOperation
(
value
=
"多音频上传"
,
notes
=
"多音频上传"
)
@ApiOperation
(
value
=
"多音频上传"
,
notes
=
"多音频上传"
)
public
ResponseEntity
<
BatchUploadResVO
>
uploadAudio
(
@RequestPart
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
files
)
throws
IOException
{
public
ResponseEntity
<
BatchUploadResVO
>
uploadAudio
(
@RequestPart
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
files
)
throws
IOException
{
if
(
files
.
length
==
0
)
{
if
(
files
.
length
==
0
)
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
getCode
(),
"没有文件可供上传"
);
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
get
Result
Code
(),
"没有文件可供上传"
);
}
}
final
boolean
existChineseAudio
=
Arrays
.
stream
(
files
).
anyMatch
(
s
->
Objects
.
requireNonNull
(
s
.
getOriginalFilename
()).
contains
(
"汉语"
));
final
boolean
existChineseAudio
=
Arrays
.
stream
(
files
).
anyMatch
(
s
->
Objects
.
requireNonNull
(
s
.
getOriginalFilename
()).
contains
(
"汉语"
));
if
(!
existChineseAudio
)
{
if
(!
existChineseAudio
)
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
getCode
(),
"必须包含汉语音频"
);
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
get
Result
Code
(),
"必须包含汉语音频"
);
}
}
int
successCount
=
0
;
int
successCount
=
0
;
...
@@ -252,11 +252,11 @@ public class FileUploadController {
...
@@ -252,11 +252,11 @@ public class FileUploadController {
@ApiOperation
(
value
=
"多视频上传"
,
notes
=
"多视频上传"
)
@ApiOperation
(
value
=
"多视频上传"
,
notes
=
"多视频上传"
)
public
ResponseEntity
<
BatchUploadResVO
>
uploadVideo
(
@RequestPart
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
files
)
throws
IOException
{
public
ResponseEntity
<
BatchUploadResVO
>
uploadVideo
(
@RequestPart
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
files
)
throws
IOException
{
if
(
files
==
null
||
files
.
length
==
0
)
{
if
(
files
==
null
||
files
.
length
==
0
)
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
getCode
(),
"没有文件可供上传"
);
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
get
Result
Code
(),
"没有文件可供上传"
);
}
}
final
boolean
matchChinese
=
Arrays
.
stream
(
files
).
anyMatch
(
s
->
Objects
.
requireNonNull
(
s
.
getOriginalFilename
()).
contains
(
"汉语"
));
final
boolean
matchChinese
=
Arrays
.
stream
(
files
).
anyMatch
(
s
->
Objects
.
requireNonNull
(
s
.
getOriginalFilename
()).
contains
(
"汉语"
));
if
(!
matchChinese
)
{
if
(!
matchChinese
)
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
getCode
(),
"必须包含汉语视频"
);
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
REQUEST_PARAMS_ERROR
.
get
Result
Code
(),
"必须包含汉语视频"
);
}
}
int
successCount
=
0
;
int
successCount
=
0
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TOrganController.java
View file @
22b835ec
...
@@ -9,6 +9,7 @@ import cn.wisenergy.chnmuseum.party.model.TArea;
...
@@ -9,6 +9,7 @@ import cn.wisenergy.chnmuseum.party.model.TArea;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.service.TAreaService
;
import
cn.wisenergy.chnmuseum.party.service.TAreaService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -70,6 +71,20 @@ public class TOrganController extends BaseController {
...
@@ -70,6 +71,20 @@ public class TOrganController extends BaseController {
@ApiOperation
(
value
=
"添加机构"
,
notes
=
"添加机构"
)
@ApiOperation
(
value
=
"添加机构"
,
notes
=
"添加机构"
)
// @MethodLog(operModule = OperModule.ORG,operType = OperType.ADD)
// @MethodLog(operModule = OperModule.ORG,operType = OperType.ADD)
public
Map
<
String
,
Object
>
add
(
TOrgan
organ
)
{
public
Map
<
String
,
Object
>
add
(
TOrgan
organ
)
{
QueryWrapper
<
TOrgan
>
ew
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNoneBlank
(
organ
.
getName
()))
{
organ
.
setName
(
organ
.
getName
().
trim
());
ew
.
eq
(
"is_deleted"
,
0
);
ew
.
eq
(
"name"
,
organ
.
getName
());
List
<
TOrgan
>
list
=
this
.
tOrganService
.
list
(
ew
);
if
(
list
!=
null
&&
list
.
get
(
0
)!=
null
)
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"message"
,
"机构名称不能重复!"
);
return
resultMap
;
}
}
organ
.
setCreateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
organ
.
setCreateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
organ
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
organ
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
String
organCode
=
getOrganCode
(
organ
.
getParentId
());
String
organCode
=
getOrganCode
(
organ
.
getParentId
());
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/base/BaseController.java
View file @
22b835ec
...
@@ -64,8 +64,8 @@ public class BaseController implements Serializable {
...
@@ -64,8 +64,8 @@ public class BaseController implements Serializable {
*/
*/
protected
Map
<
String
,
Object
>
getResult
(
Object
obj
)
{
protected
Map
<
String
,
Object
>
getResult
(
Object
obj
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
get
Result
Code
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getM
sg
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getM
essage
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_BODY
.
getKey
(),
obj
);
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_BODY
.
getKey
(),
obj
);
return
map
;
return
map
;
}
}
...
@@ -77,8 +77,8 @@ public class BaseController implements Serializable {
...
@@ -77,8 +77,8 @@ public class BaseController implements Serializable {
*/
*/
protected
Map
<
String
,
Object
>
getSuccessResult
()
{
protected
Map
<
String
,
Object
>
getSuccessResult
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
get
Result
Code
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getM
sg
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getM
essage
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_BODY
.
getKey
(),
""
);
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_BODY
.
getKey
(),
""
);
return
map
;
return
map
;
}
}
...
@@ -105,8 +105,8 @@ public class BaseController implements Serializable {
...
@@ -105,8 +105,8 @@ public class BaseController implements Serializable {
*/
*/
protected
Map
<
String
,
Object
>
getFailResult
(
RESPONSE_CODE_ENUM
responseCodeEnum
)
{
protected
Map
<
String
,
Object
>
getFailResult
(
RESPONSE_CODE_ENUM
responseCodeEnum
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
responseCodeEnum
.
getCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
responseCodeEnum
.
get
Result
Code
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
responseCodeEnum
.
getM
sg
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
responseCodeEnum
.
getM
essage
());
return
map
;
return
map
;
}
}
...
@@ -117,8 +117,8 @@ public class BaseController implements Serializable {
...
@@ -117,8 +117,8 @@ public class BaseController implements Serializable {
*/
*/
protected
Map
<
String
,
Object
>
getFailResult
()
{
protected
Map
<
String
,
Object
>
getFailResult
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
get
Result
Code
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getM
sg
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getM
essage
());
return
map
;
return
map
;
}
}
...
...
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