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
2cf6e347
Commit
2cf6e347
authored
Mar 18, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
bb5a9983
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
515 additions
and
145 deletions
+515
-145
MysqlGenerator.java
...energy/chnmuseum/party/common/mybatis/MysqlGenerator.java
+2
-2
GlobalExceptionAdvisor.java
...museum/party/common/validator/GlobalExceptionAdvisor.java
+216
-0
HttpResult.java
...isenergy/chnmuseum/party/common/validator/HttpResult.java
+58
-0
FastJsonHttpMessageConvertersConfig.java
...useum/party/conf/FastJsonHttpMessageConvertersConfig.java
+7
-5
ShiroConfig.java
...n/java/cn/wisenergy/chnmuseum/party/conf/ShiroConfig.java
+2
-4
CopyrightOwnerAssetTypeMapper.java
...chnmuseum/party/mapper/CopyrightOwnerAssetTypeMapper.java
+18
-0
CopyrightOwnerBoardTypeMapper.java
...chnmuseum/party/mapper/CopyrightOwnerBoardTypeMapper.java
+18
-0
AssetType.java
...in/java/cn/wisenergy/chnmuseum/party/model/AssetType.java
+4
-0
CopyrightOwner.java
...va/cn/wisenergy/chnmuseum/party/model/CopyrightOwner.java
+13
-0
CopyrightOwnerAssetType.java
...energy/chnmuseum/party/model/CopyrightOwnerAssetType.java
+24
-14
CopyrightOwnerBoardType.java
...energy/chnmuseum/party/model/CopyrightOwnerBoardType.java
+3
-3
ExhibitionBoard.java
...a/cn/wisenergy/chnmuseum/party/model/ExhibitionBoard.java
+6
-17
CopyrightOwnerAssetTypeService.java
...nmuseum/party/service/CopyrightOwnerAssetTypeService.java
+16
-0
CopyrightOwnerBoardTypeService.java
...nmuseum/party/service/CopyrightOwnerBoardTypeService.java
+16
-0
CopyrightOwnerAssetTypeServiceImpl.java
...arty/service/impl/CopyrightOwnerAssetTypeServiceImpl.java
+23
-0
CopyrightOwnerBoardTypeServiceImpl.java
...arty/service/impl/CopyrightOwnerBoardTypeServiceImpl.java
+22
-0
CopyrightOwnerController.java
...museum/party/web/controller/CopyrightOwnerController.java
+53
-15
CopyrightOwnerAssetTypeMapper.xml
src/main/resources/mapper/CopyrightOwnerAssetTypeMapper.xml
+6
-6
CopyrightOwnerBoardTypeMapper.xml
src/main/resources/mapper/CopyrightOwnerBoardTypeMapper.xml
+6
-6
mapper.java.vm
src/main/resources/templates/mapper.java.vm
+0
-29
service.java.vm
src/main/resources/templates/service.java.vm
+1
-21
serviceImpl.java.vm
src/main/resources/templates/serviceImpl.java.vm
+1
-23
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/mybatis/MysqlGenerator.java
View file @
2cf6e347
...
@@ -7,8 +7,8 @@ public class MysqlGenerator {
...
@@ -7,8 +7,8 @@ public class MysqlGenerator {
"asset_type"
,
"asset_type"
,
"board_talking"
,
"board_talking"
,
"copyright_owner"
,
"copyright_owner"
,
"copy
t
ight_owner_asset_type"
,
"copy
r
ight_owner_asset_type"
,
"copy
t
ight_owner_board_type"
,
"copy
r
ight_owner_board_type"
,
"exhibition_board"
,
"exhibition_board"
,
"exhibition_board_cat"
,
"exhibition_board_cat"
,
"learning_content"
,
"learning_content"
,
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/validator/GlobalExceptionAdvisor.java
0 → 100644
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
;
import
cn.wisenergy.chnmuseum.party.common.enums.RESPONSE_CODE_ENUM
;
import
cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException
;
import
com.google.common.base.Splitter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.apache.shiro.authz.UnauthenticatedException
;
import
org.apache.shiro.authz.UnauthorizedException
;
import
org.springframework.beans.ConversionNotSupportedException
;
import
org.springframework.context.support.DefaultMessageSourceResolvable
;
import
org.springframework.dao.DataAccessException
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.http.converter.HttpMessageConversionException
;
import
org.springframework.http.converter.HttpMessageNotWritableException
;
import
org.springframework.validation.BindException
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.ObjectError
;
import
org.springframework.web.HttpMediaTypeNotAcceptableException
;
import
org.springframework.web.HttpMediaTypeNotSupportedException
;
import
org.springframework.web.HttpRequestMethodNotSupportedException
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
import
javax.validation.ConstraintViolation
;
import
javax.validation.ConstraintViolationException
;
import
java.sql.SQLIntegrityConstraintViolationException
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 全局异常处理
*
* @author Danny Lee
* @date 2019/8/1
*/
@Slf4j
@RestControllerAdvice
public
class
GlobalExceptionAdvisor
{
/**
* 捕获全局异常,处理所有不可知的异常
*
* @param exception 异常对象
*/
@ExceptionHandler
(
Exception
.
class
)
public
Object
handleException
(
Exception
exception
)
{
log
.
error
(
"\r\n ************** 操作出现异常:{}"
,
ExceptionUtils
.
getStackTrace
(
exception
));
Class
<?>
eClass
=
exception
.
getClass
();
HttpResult
httpResult
=
new
HttpResult
();
if
(
eClass
.
equals
(
HttpRequestMethodNotSupportedException
.
class
))
{
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
METHOD_NOT_SUPPORTED
,
httpResult
);
}
else
if
(
eClass
.
equals
(
HttpMediaTypeNotAcceptableException
.
class
))
{
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
MEDIA_TYPE_NOT_ACCEPT
,
httpResult
);
}
else
if
(
eClass
.
equals
(
HttpMediaTypeNotSupportedException
.
class
))
{
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
MEDIA_TYPE_NOT_SUPPORTED
,
httpResult
);
}
else
if
(
eClass
.
equals
(
ConversionNotSupportedException
.
class
))
{
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
SERVER_ERROR
,
httpResult
);
}
else
if
(
eClass
.
equals
(
HttpMessageNotWritableException
.
class
))
{
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
SERVER_ERROR
,
httpResult
);
}
else
{
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
SERVER_ERROR
,
httpResult
);
}
return
httpResult
;
}
@ExceptionHandler
(
BindException
.
class
)
@ResponseBody
public
HttpResult
handle
(
BindException
ex
)
{
String
message
=
ex
.
getBindingResult
().
getAllErrors
().
stream
().
map
(
DefaultMessageSourceResolvable:
:
getDefaultMessage
).
collect
(
Collectors
.
joining
(
" \n "
));
// BindingResult bindingResult = ex.getBindingResult();
// StringBuilder errMsg = new StringBuilder(bindingResult.getFieldErrors().size() * 16);
// errMsg.append("Invalid request:");
// for (int i = 0; i < bindingResult.getFieldErrors().size(); i++) {
// if (i > 0) {
// errMsg.append(",");
// }
// FieldError error = bindingResult.getFieldErrors().get(i);
// errMsg.append(error.getField()).append(":").append(error.getDefaultMessage());
// }
return
new
HttpResult
(
400
,
message
);
//throw new InterfaceException(RESPONSE_CODE_ENUM.PARAM_NOT_VALID.getCode(), errMsg.toString());
}
//处理请求参数格式错误 @RequestParam上validate失败后抛出的异常是javax.validation.ConstraintViolationException
@ExceptionHandler
(
ConstraintViolationException
.
class
)
@ResponseBody
public
String
constraintViolationExceptionHandler
(
ConstraintViolationException
e
)
{
return
e
.
getConstraintViolations
().
stream
().
map
(
ConstraintViolation:
:
getMessage
).
collect
(
Collectors
.
joining
());
}
/**
* 处理请求参数格式错误 @RequestBody上validate失败后抛出的异常是MethodArgumentNotValidException异常。
*
* @param exception 错误信息集合
* @return 错误信息
*/
@ExceptionHandler
(
MethodArgumentNotValidException
.
class
)
public
HttpResult
validationBodyException
(
MethodArgumentNotValidException
exception
)
{
BindingResult
result
=
exception
.
getBindingResult
();
String
msg
=
null
;
if
(
result
.
hasErrors
())
{
List
<
ObjectError
>
errors
=
result
.
getAllErrors
();
for
(
ObjectError
objectError
:
errors
)
{
FieldError
fieldError
=
(
FieldError
)
objectError
;
if
(
fieldError
.
getDefaultMessage
()
!=
null
)
{
log
.
info
(
"Data check failure : object{"
+
fieldError
.
getObjectName
()
+
"},field{"
+
fieldError
.
getField
()
+
"},errorMessage{"
+
fieldError
.
getDefaultMessage
()
+
"}"
);
msg
=
fieldError
.
getDefaultMessage
();
}
}
}
return
new
HttpResult
(
400
,
msg
);
}
@ExceptionHandler
(
DataAccessException
.
class
)
public
HttpResult
dataAccessException
(
DataAccessException
exception
)
{
return
new
HttpResult
(
400
,
exception
.
getLocalizedMessage
());
}
@ExceptionHandler
(
DuplicateKeyException
.
class
)
@ResponseBody
public
HttpResult
duplicateKeyException
(
DuplicateKeyException
e
)
{
String
localizedMessage
=
e
.
getLocalizedMessage
();
String
message
=
Splitter
.
on
(
System
.
lineSeparator
()).
trimResults
().
splitToList
(
localizedMessage
).
get
(
1
);
String
substring
=
message
.
substring
(
message
.
indexOf
(
"Exception:"
));
if
(
substring
.
toUpperCase
().
contains
(
"NAME"
))
{
return
new
HttpResult
(
400
,
"名称已存在"
);
}
else
if
(
substring
.
toUpperCase
().
contains
(
"CODE"
))
{
return
new
HttpResult
(
400
,
"编码已存在"
);
}
return
new
HttpResult
(
400
,
message
);
}
@ExceptionHandler
(
SQLIntegrityConstraintViolationException
.
class
)
@ResponseBody
public
HttpResult
sqlIntegrityConstraintViolationException
(
SQLIntegrityConstraintViolationException
e
)
{
String
localizedMessage
=
e
.
getLocalizedMessage
();
String
message
=
Splitter
.
on
(
System
.
lineSeparator
()).
trimResults
().
splitToList
(
localizedMessage
).
get
(
1
);
String
substring
=
message
.
substring
(
message
.
indexOf
(
"Exception:"
));
if
(
substring
.
toUpperCase
().
contains
(
"NAME"
))
{
return
new
HttpResult
(
400
,
"名称已存在"
);
}
else
if
(
substring
.
toUpperCase
().
contains
(
"CODE"
))
{
return
new
HttpResult
(
400
,
"编码已存在"
);
}
return
new
HttpResult
(
400
,
message
);
}
/**
* 参数类型转换错误
*
* @param exception 错误
* @return 错误信息
*/
@ExceptionHandler
(
HttpMessageConversionException
.
class
)
public
HttpResult
httpMessageConversionException
(
HttpMessageConversionException
exception
)
{
log
.
error
(
exception
.
getCause
().
getLocalizedMessage
());
return
new
HttpResult
(
400
,
exception
.
getCause
().
getLocalizedMessage
());
}
/**
* 捕获业务异常
*
* @param exception 自定义接口异常类
* @return 返回的异常信息map
*/
@ExceptionHandler
(
InterfaceException
.
class
)
public
HttpResult
handleInterfaceException
(
InterfaceException
exception
)
{
HttpResult
httpResult
=
new
HttpResult
();
httpResult
.
setCode
(
Integer
.
parseInt
(
exception
.
getErrorCode
()));
httpResult
.
setMsg
(
exception
.
getErrorMsg
());
return
httpResult
;
}
/**
* 捕获Shiro无权限异常 未授权异常
*
* @param exception 无权限异常
* @return 返回的异常信息map
*/
@ExceptionHandler
(
UnauthorizedException
.
class
)
public
Object
handleUnauthorizedException
(
UnauthorizedException
exception
)
{
HttpResult
httpResult
=
new
HttpResult
();
// 无权限
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
UNAUTHORIZED
,
httpResult
);
return
httpResult
;
}
/**
* 捕获Shiro无权限异常 未认证异常
*
* @param exception 无权限异常
* @return 返回的异常信息map
*/
@ExceptionHandler
(
UnauthenticatedException
.
class
)
public
Object
handleUnauthenticatedException
(
UnauthenticatedException
exception
)
{
HttpResult
httpResult
=
new
HttpResult
();
// 无权限
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
UNAUTHORIZED
,
httpResult
);
return
httpResult
;
}
/**
* 添加异常信息到map中
*
* @param responseCodeEnum 错误响应编码枚举类对象
* @param httpResult 响应对象
*/
private
void
addResCodeToMap
(
RESPONSE_CODE_ENUM
responseCodeEnum
,
HttpResult
httpResult
)
{
httpResult
.
setCode
(
Integer
.
parseInt
(
responseCodeEnum
.
getCode
()));
httpResult
.
setMsg
(
responseCodeEnum
.
getMsg
());
}
}
src/main/java/cn/wisenergy/chnmuseum/party/common/validator/HttpResult.java
0 → 100644
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
;
public
class
HttpResult
{
// 响应的状态码
private
int
code
;
// 响应的响应信息
private
String
msg
;
// 响应的响应体
private
Object
body
;
public
HttpResult
()
{
}
public
HttpResult
(
int
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
HttpResult
(
int
code
,
Object
body
)
{
this
.
code
=
code
;
this
.
body
=
body
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
Object
getBody
()
{
return
body
;
}
public
void
setBody
(
Object
body
)
{
this
.
body
=
body
;
}
@Override
public
String
toString
()
{
return
"{"
+
"\"code\":"
+
code
+
", \"msg\":"
+
"\""
+
msg
+
"\""
+
", \"body\":"
+
body
+
'}'
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/conf/FastJsonHttpMessageConvertersConfig.java
View file @
2cf6e347
...
@@ -38,18 +38,20 @@ public class FastJsonHttpMessageConvertersConfig {
...
@@ -38,18 +38,20 @@ public class FastJsonHttpMessageConvertersConfig {
SerializerFeature
.
WriteMapNullValue
,
SerializerFeature
.
WriteMapNullValue
,
SerializerFeature
.
DisableCircularReferenceDetect
SerializerFeature
.
DisableCircularReferenceDetect
);
);
// 处理ie浏览器保存数据时出现下载json数据问题
// 全局时间配置
fastJsonConfig
.
setDateFormat
(
"yyyy-MM-dd"
);
// 处理中文乱码问题
List
<
MediaType
>
mediaTypes
=
new
ArrayList
<>();
List
<
MediaType
>
mediaTypes
=
new
ArrayList
<>();
mediaTypes
.
add
(
MediaType
.
APPLICATION_JSON
);
mediaTypes
.
add
(
MediaType
.
APPLICATION_JSON
);
mediaTypes
.
add
(
MediaType
.
TEXT_PLAIN
);
mediaTypes
.
add
(
MediaType
.
TEXT_PLAIN
);
//mediaTypes.add(new MediaType("text", "plain", Charset.forName("UTF-8")));
//mediaTypes.add(new MediaType("text", "plain", Charset.forName("UTF-8")));
converter
.
setSupportedMediaTypes
(
mediaTypes
);
converter
.
setSupportedMediaTypes
(
mediaTypes
);
// o 是class,s 是key值,o1 是value值
// o 是class,s 是key值,o1 是value值
ValueFilter
valueFilter
=
(
o
,
s
,
o1
)
->
{
ValueFilter
valueFilter
=
(
o
1
,
s
,
o2
)
->
{
if
(
null
==
o
1
)
{
if
(
null
==
o
2
)
{
o
1
=
""
;
o
2
=
""
;
}
}
return
o
1
;
return
o
2
;
};
};
fastJsonConfig
.
setSerializeFilters
(
valueFilter
);
fastJsonConfig
.
setSerializeFilters
(
valueFilter
);
converter
.
setFastJsonConfig
(
fastJsonConfig
);
converter
.
setFastJsonConfig
(
fastJsonConfig
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/conf/ShiroConfig.java
View file @
2cf6e347
...
@@ -18,9 +18,7 @@ import org.slf4j.LoggerFactory;
...
@@ -18,9 +18,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
;
import
org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.DependsOn
;
import
org.springframework.context.annotation.DependsOn
;
import
org.springframework.core.annotation.Order
;
import
redis.clients.jedis.JedisPoolConfig
;
import
redis.clients.jedis.JedisPoolConfig
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -29,8 +27,8 @@ import java.util.LinkedHashMap;
...
@@ -29,8 +27,8 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
@Configuration
//
@Configuration
@Order
(
1
)
//
@Order(1)
public
class
ShiroConfig
{
public
class
ShiroConfig
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ShiroConfig
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ShiroConfig
.
class
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/mapper/Copy
t
ightOwnerAssetTypeMapper.java
→
src/main/java/cn/wisenergy/chnmuseum/party/mapper/Copy
r
ightOwnerAssetTypeMapper.java
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
cn.wisenergy.chnmuseum.party.model.Copy
t
ightOwnerAssetType
;
import
cn.wisenergy.chnmuseum.party.model.Copy
r
ightOwnerAssetType
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
/**
/**
* <p>
* <p
re
>
* 版权方视频分类 Mapper 接口
* 版权方视频分类 Mapper 接口
* </p>
* </p
re
>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-1
6
* @since 2021-03-1
8
*/
*/
public
interface
CopytightOwnerAssetTypeMapper
extends
BaseMapper
<
CopytightOwnerAssetType
>
{
@Repository
public
interface
CopyrightOwnerAssetTypeMapper
extends
BaseMapper
<
CopyrightOwnerAssetType
>
{
}
}
src/main/java/cn/wisenergy/chnmuseum/party/mapper/Copy
t
ightOwnerBoardTypeMapper.java
→
src/main/java/cn/wisenergy/chnmuseum/party/mapper/Copy
r
ightOwnerBoardTypeMapper.java
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
cn.wisenergy.chnmuseum.party.model.Copy
t
ightOwnerBoardType
;
import
cn.wisenergy.chnmuseum.party.model.Copy
r
ightOwnerBoardType
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
/**
/**
* <p>
* <p
re
>
* 版权方展板分类 Mapper 接口
* 版权方展板分类 Mapper 接口
* </p>
* </p
re
>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-1
6
* @since 2021-03-1
8
*/
*/
public
interface
CopytightOwnerBoardTypeMapper
extends
BaseMapper
<
CopytightOwnerBoardType
>
{
@Repository
public
interface
CopyrightOwnerBoardTypeMapper
extends
BaseMapper
<
CopyrightOwnerBoardType
>
{
}
}
src/main/java/cn/wisenergy/chnmuseum/party/model/AssetType.java
View file @
2cf6e347
...
@@ -59,4 +59,8 @@ public class AssetType implements Serializable {
...
@@ -59,4 +59,8 @@ public class AssetType implements Serializable {
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
"版权方"
)
@TableField
(
exist
=
false
)
private
String
copyrightOwnerName
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/model/CopyrightOwner.java
View file @
2cf6e347
...
@@ -12,6 +12,7 @@ import javax.validation.constraints.NotBlank;
...
@@ -12,6 +12,7 @@ import javax.validation.constraints.NotBlank;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
/**
* <p>
* <p>
...
@@ -69,4 +70,16 @@ public class CopyrightOwner implements Serializable {
...
@@ -69,4 +70,16 @@ public class CopyrightOwner implements Serializable {
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
"视频分类ID集合(详情使用)"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
assetTypeIdList
;
@ApiModelProperty
(
"视频分类名称集合(详情使用)"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
assetTypeNameList
;
@ApiModelProperty
(
"视频分类名称(列表使用)"
)
@TableField
(
exist
=
false
)
private
String
assetTypeNames
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/model/Copy
t
ightOwnerAssetType.java
→
src/main/java/cn/wisenergy/chnmuseum/party/model/Copy
r
ightOwnerAssetType.java
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.
TableField
;
import
com.baomidou.mybatisplus.annotation.
Version
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
com.baomidou.mybatisplus.annotations.Version
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
com.baomidou.mybatisplus.annotation.TableField
;
/**
/**
* <p>
* <p>
...
@@ -21,7 +28,7 @@ import java.io.Serializable;
...
@@ -21,7 +28,7 @@ import java.io.Serializable;
* </p>
* </p>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-1
7
* @since 2021-03-1
8
*/
*/
@Data
@Data
@Builder
@Builder
...
@@ -29,9 +36,9 @@ import java.io.Serializable;
...
@@ -29,9 +36,9 @@ import java.io.Serializable;
@NoArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"copy
t
ight_owner_asset_type"
)
@TableName
(
"copy
r
ight_owner_asset_type"
)
@ApiModel
(
value
=
"版权方视频分类"
,
description
=
"版权方视频分类"
)
@ApiModel
(
value
=
"版权方视频分类"
,
description
=
"版权方视频分类"
)
public
class
Copy
t
ightOwnerAssetType
implements
Serializable
{
public
class
Copy
r
ightOwnerAssetType
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -49,4 +56,7 @@ public class CopytightOwnerAssetType implements Serializable {
...
@@ -49,4 +56,7 @@ public class CopytightOwnerAssetType implements Serializable {
@NotBlank
(
message
=
"视频分类ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
@NotBlank
(
message
=
"视频分类ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
assetTypeId
;
private
String
assetTypeId
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/model/Copy
t
ightOwnerBoardType.java
→
src/main/java/cn/wisenergy/chnmuseum/party/model/Copy
r
ightOwnerBoardType.java
View file @
2cf6e347
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
* </p>
* </p>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-1
7
* @since 2021-03-1
8
*/
*/
@Data
@Data
@Builder
@Builder
...
@@ -29,9 +29,9 @@ import java.io.Serializable;
...
@@ -29,9 +29,9 @@ import java.io.Serializable;
@NoArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"copy
t
ight_owner_board_type"
)
@TableName
(
"copy
r
ight_owner_board_type"
)
@ApiModel
(
value
=
"版权方展板分类"
,
description
=
"版权方展板分类"
)
@ApiModel
(
value
=
"版权方展板分类"
,
description
=
"版权方展板分类"
)
public
class
Copy
t
ightOwnerBoardType
implements
Serializable
{
public
class
Copy
r
ightOwnerBoardType
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/model/ExhibitionBoard.java
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
com.baomidou.mybatisplus.annotation.Version
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
com.baomidou.mybatisplus.annotations.Version
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
/**
* <p>
* <p>
...
...
src/main/java/cn/wisenergy/chnmuseum/party/service/Copy
t
ightOwnerAssetTypeService.java
→
src/main/java/cn/wisenergy/chnmuseum/party/service/Copy
r
ightOwnerAssetTypeService.java
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.model.Copy
t
ightOwnerAssetType
;
import
cn.wisenergy.chnmuseum.party.model.Copy
r
ightOwnerAssetType
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
/**
* <p>
* <p>
* 版权方视频分类 服务
类
* 版权方视频分类 服务
接口
* </p>
* </p>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-1
6
* @since 2021-03-1
8
*/
*/
public
interface
Copy
tightOwnerAssetTypeService
extends
IService
<
Copyt
ightOwnerAssetType
>
{
public
interface
Copy
rightOwnerAssetTypeService
extends
IService
<
Copyr
ightOwnerAssetType
>
{
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/Copy
t
ightOwnerBoardTypeService.java
→
src/main/java/cn/wisenergy/chnmuseum/party/service/Copy
r
ightOwnerBoardTypeService.java
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.model.Copy
t
ightOwnerBoardType
;
import
cn.wisenergy.chnmuseum.party.model.Copy
r
ightOwnerBoardType
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
/**
* <p>
* <p>
* 版权方展板分类 服务
类
* 版权方展板分类 服务
接口
* </p>
* </p>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-1
6
* @since 2021-03-1
8
*/
*/
public
interface
Copy
tightOwnerBoardTypeService
extends
IService
<
Copyt
ightOwnerBoardType
>
{
public
interface
Copy
rightOwnerBoardTypeService
extends
IService
<
Copyr
ightOwnerBoardType
>
{
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/Copy
t
ightOwnerAssetTypeServiceImpl.java
→
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/Copy
r
ightOwnerAssetTypeServiceImpl.java
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.m
odel.CopytightOwnerAssetType
;
import
cn.wisenergy.chnmuseum.party.m
apper.CopyrightOwnerAssetTypeMapper
;
import
cn.wisenergy.chnmuseum.party.m
apper.CopytightOwnerAssetTypeMapper
;
import
cn.wisenergy.chnmuseum.party.m
odel.CopyrightOwnerAssetType
;
import
cn.wisenergy.chnmuseum.party.service.Copy
t
ightOwnerAssetTypeService
;
import
cn.wisenergy.chnmuseum.party.service.Copy
r
ightOwnerAssetTypeService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
* <p>
* <p
re
>
* 版权方视频分类 服务实现类
* 版权方视频分类 服务实现类
* </p>
* </p
re
>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-1
6
* @since 2021-03-1
8
*/
*/
@Slf4j
@Service
@Service
public
class
CopytightOwnerAssetTypeServiceImpl
extends
ServiceImpl
<
CopytightOwnerAssetTypeMapper
,
CopytightOwnerAssetType
>
implements
CopytightOwnerAssetTypeService
{
public
class
CopyrightOwnerAssetTypeServiceImpl
extends
ServiceImpl
<
CopyrightOwnerAssetTypeMapper
,
CopyrightOwnerAssetType
>
implements
CopyrightOwnerAssetTypeService
{
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/Copy
t
ightOwnerBoardTypeServiceImpl.java
→
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/Copy
r
ightOwnerBoardTypeServiceImpl.java
View file @
2cf6e347
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.m
odel.CopytightOwnerBoardType
;
import
cn.wisenergy.chnmuseum.party.m
apper.CopyrightOwnerBoardTypeMapper
;
import
cn.wisenergy.chnmuseum.party.m
apper.CopytightOwnerBoardTypeMapper
;
import
cn.wisenergy.chnmuseum.party.m
odel.CopyrightOwnerBoardType
;
import
cn.wisenergy.chnmuseum.party.service.Copy
t
ightOwnerBoardTypeService
;
import
cn.wisenergy.chnmuseum.party.service.Copy
r
ightOwnerBoardTypeService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
* <p>
* <p
re
>
* 版权方展板分类 服务实现类
* 版权方展板分类 服务实现类
* </p>
* </p
re
>
*
*
* @author Danny Lee
* @author Danny Lee
* @since 2021-03-1
6
* @since 2021-03-1
8
*/
*/
@Slf4j
@Service
@Service
public
class
Copy
tightOwnerBoardTypeServiceImpl
extends
ServiceImpl
<
CopytightOwnerBoardTypeMapper
,
CopytightOwnerBoardType
>
implements
Copyt
ightOwnerBoardTypeService
{
public
class
Copy
rightOwnerBoardTypeServiceImpl
extends
ServiceImpl
<
CopyrightOwnerBoardTypeMapper
,
CopyrightOwnerBoardType
>
implements
Copyr
ightOwnerBoardTypeService
{
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/CopyrightOwnerController.java
View file @
2cf6e347
...
@@ -4,12 +4,8 @@ import cn.wisenergy.chnmuseum.party.common.enums.CopyrightOwnerTypeEnum;
...
@@ -4,12 +4,8 @@ import cn.wisenergy.chnmuseum.party.common.enums.CopyrightOwnerTypeEnum;
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
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.Asset
;
import
cn.wisenergy.chnmuseum.party.model.*
;
import
cn.wisenergy.chnmuseum.party.model.CopyrightOwner
;
import
cn.wisenergy.chnmuseum.party.service.*
;
import
cn.wisenergy.chnmuseum.party.model.ExhibitionBoard
;
import
cn.wisenergy.chnmuseum.party.service.AssetService
;
import
cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService
;
import
cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService
;
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.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
@@ -26,8 +22,10 @@ import org.springframework.validation.annotation.Validated;
...
@@ -26,8 +22,10 @@ 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.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* <pre>
* <pre>
...
@@ -49,6 +47,12 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -49,6 +47,12 @@ public class CopyrightOwnerController extends BaseController {
@Resource
@Resource
private
AssetService
assetService
;
private
AssetService
assetService
;
@Resource
private
AssetTypeService
assetTypeService
;
@Resource
private
CopyrightOwnerAssetTypeService
copyrightOwnerAssetTypeService
;
@Resource
@Resource
private
ExhibitionBoardService
exhibitionBoardService
;
private
ExhibitionBoardService
exhibitionBoardService
;
...
@@ -59,6 +63,19 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -59,6 +63,19 @@ public class CopyrightOwnerController extends BaseController {
copyrightOwner
.
setOwnerType
(
copyrightOwnerTypeEnum
.
name
());
copyrightOwner
.
setOwnerType
(
copyrightOwnerTypeEnum
.
name
());
// 保存业务节点信息
// 保存业务节点信息
boolean
result
=
copyrightOwnerService
.
save
(
copyrightOwner
);
boolean
result
=
copyrightOwnerService
.
save
(
copyrightOwner
);
List
<
String
>
assetTypeIdList
=
copyrightOwner
.
getAssetTypeIdList
();
if
(
assetTypeIdList
!=
null
&&
!
assetTypeIdList
.
isEmpty
())
{
List
<
CopyrightOwnerAssetType
>
copyrightOwnerAssetTypeList
=
new
ArrayList
<>();
for
(
String
assetTypeId
:
assetTypeIdList
)
{
copyrightOwnerAssetTypeList
.
add
(
CopyrightOwnerAssetType
.
builder
()
.
assetTypeId
(
assetTypeId
)
.
copyrightOwnerId
(
copyrightOwner
.
getId
())
.
build
());
}
this
.
copyrightOwnerAssetTypeService
.
saveBatch
(
copyrightOwnerAssetTypeList
);
}
// 返回操作结果
// 返回操作结果
if
(
result
)
{
if
(
result
)
{
return
getSuccessResult
();
return
getSuccessResult
();
...
@@ -74,6 +91,21 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -74,6 +91,21 @@ public class CopyrightOwnerController extends BaseController {
public
Map
<
String
,
Object
>
updateCopyrightOwner
(
@Validated
(
value
=
{
Update
.
class
})
CopyrightOwner
copyrightOwner
,
@RequestParam
(
"copyrightOwnerType"
)
CopyrightOwnerTypeEnum
copyrightOwnerTypeEnum
)
{
public
Map
<
String
,
Object
>
updateCopyrightOwner
(
@Validated
(
value
=
{
Update
.
class
})
CopyrightOwner
copyrightOwner
,
@RequestParam
(
"copyrightOwnerType"
)
CopyrightOwnerTypeEnum
copyrightOwnerTypeEnum
)
{
copyrightOwner
.
setOwnerType
(
copyrightOwnerTypeEnum
.
name
());
copyrightOwner
.
setOwnerType
(
copyrightOwnerTypeEnum
.
name
());
boolean
flag
=
copyrightOwnerService
.
updateById
(
copyrightOwner
);
boolean
flag
=
copyrightOwnerService
.
updateById
(
copyrightOwner
);
List
<
String
>
assetTypeIdList
=
copyrightOwner
.
getAssetTypeIdList
();
if
(
assetTypeIdList
!=
null
&&
!
assetTypeIdList
.
isEmpty
())
{
LambdaUpdateWrapper
<
CopyrightOwnerAssetType
>
updateWrapper
=
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaUpdate
().
eq
(
CopyrightOwnerAssetType:
:
getCopyrightOwnerId
,
copyrightOwner
.
getId
());
this
.
copyrightOwnerAssetTypeService
.
remove
(
updateWrapper
);
List
<
CopyrightOwnerAssetType
>
copyrightOwnerAssetTypeList
=
new
ArrayList
<>();
for
(
String
assetTypeId
:
assetTypeIdList
)
{
copyrightOwnerAssetTypeList
.
add
(
CopyrightOwnerAssetType
.
builder
()
.
assetTypeId
(
assetTypeId
)
.
copyrightOwnerId
(
copyrightOwner
.
getId
())
.
build
());
}
this
.
copyrightOwnerAssetTypeService
.
saveBatch
(
copyrightOwnerAssetTypeList
);
}
if
(
flag
)
{
if
(
flag
)
{
return
getSuccessResult
();
return
getSuccessResult
();
}
}
...
@@ -87,17 +119,19 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -87,17 +119,19 @@ public class CopyrightOwnerController extends BaseController {
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
})
public
Map
<
String
,
Object
>
deleteCopyrightOwner
(
@PathVariable
(
"id"
)
String
id
)
{
public
Map
<
String
,
Object
>
deleteCopyrightOwner
(
@PathVariable
(
"id"
)
String
id
)
{
boolean
result
=
copyrightOwnerService
.
removeById
(
id
);
LambdaUpdateWrapper
<
Asset
>
updateWrapper
=
Wrappers
.<
Asset
>
lambdaUpdate
().
eq
(
Asset:
:
getAssetCopyrightOwnerId
,
id
);
updateWrapper
.
set
(
Asset:
:
getAssetCopyrightOwnerId
,
null
);
boolean
result1
=
this
.
assetService
.
update
(
updateWrapper
);
LambdaUpdateWrapper
<
Asset
>
updateWrapper1
=
Wrappers
.<
Asset
>
lambdaUpdate
().
eq
(
Asset:
:
getAss
etCopyrightOwnerId
,
id
);
LambdaUpdateWrapper
<
ExhibitionBoard
>
updateWrapper1
=
Wrappers
.<
ExhibitionBoard
>
lambdaUpdate
().
eq
(
ExhibitionBoard:
:
g
etCopyrightOwnerId
,
id
);
updateWrapper1
.
set
(
Asset:
:
getAss
etCopyrightOwnerId
,
null
);
updateWrapper1
.
set
(
ExhibitionBoard:
:
g
etCopyrightOwnerId
,
null
);
boolean
result
1
=
this
.
asset
Service
.
update
(
updateWrapper1
);
boolean
result
2
=
this
.
exhibitionBoard
Service
.
update
(
updateWrapper1
);
LambdaUpdateWrapper
<
ExhibitionBoard
>
updateWrapper
=
Wrappers
.<
ExhibitionBoard
>
lambdaUpdate
().
eq
(
ExhibitionBoard:
:
getCopyrightOwnerId
,
id
);
LambdaUpdateWrapper
<
CopyrightOwnerAssetType
>
updateWrapper2
=
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaUpdate
().
eq
(
CopyrightOwnerAssetType:
:
getCopyrightOwnerId
,
id
);
updateWrapper
.
set
(
ExhibitionBoard:
:
getCopyrightOwnerId
,
null
);
boolean
result3
=
this
.
copyrightOwnerAssetTypeService
.
remove
(
updateWrapper2
);
boolean
result2
=
this
.
exhibitionBoardService
.
update
(
updateWrapper
);
if
(
result
&&
result1
&&
result2
)
{
boolean
result
=
this
.
copyrightOwnerService
.
removeById
(
id
);
if
(
result
&&
result1
&&
result2
&&
result3
)
{
return
getSuccessResult
();
return
getSuccessResult
();
}
}
return
getFailResult
();
return
getFailResult
();
...
@@ -142,7 +176,11 @@ public class CopyrightOwnerController extends BaseController {
...
@@ -142,7 +176,11 @@ public class CopyrightOwnerController extends BaseController {
CopyrightOwner:
:
getUpdateTime
);
CopyrightOwner:
:
getUpdateTime
);
Page
<
CopyrightOwner
>
page
=
this
.
copyrightOwnerService
.
page
(
getPage
(),
queryWrapper
);
Page
<
CopyrightOwner
>
page
=
this
.
copyrightOwnerService
.
page
(
getPage
(),
queryWrapper
);
for
(
CopyrightOwner
copyrightOwner
:
page
.
getRecords
())
{
for
(
CopyrightOwner
copyrightOwner
:
page
.
getRecords
())
{
final
List
<
CopyrightOwnerAssetType
>
CopyrightOwnerAssetTypeList
=
this
.
copyrightOwnerAssetTypeService
.
list
(
Wrappers
.<
CopyrightOwnerAssetType
>
lambdaQuery
().
eq
(
CopyrightOwnerAssetType:
:
getCopyrightOwnerId
,
copyrightOwner
.
getId
()));
final
List
<
String
>
idList
=
CopyrightOwnerAssetTypeList
.
stream
().
map
(
CopyrightOwnerAssetType:
:
getAssetTypeId
).
collect
(
Collectors
.
toList
());
List
<
AssetType
>
assetTypeList
=
this
.
assetTypeService
.
listByIds
(
idList
);
final
String
assetTypeNameList
=
assetTypeList
.
stream
().
map
(
AssetType:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
copyrightOwner
.
setAssetTypeNames
(
assetTypeNameList
);
}
}
return
getResult
(
page
);
return
getResult
(
page
);
}
}
...
...
src/main/resources/mapper/Copy
t
ightOwnerAssetTypeMapper.xml
→
src/main/resources/mapper/Copy
r
ightOwnerAssetTypeMapper.xml
View file @
2cf6e347
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wisenergy.chnmuseum.party.mapper.Copy
t
ightOwnerAssetTypeMapper"
>
<mapper
namespace=
"cn.wisenergy.chnmuseum.party.mapper.Copy
r
ightOwnerAssetTypeMapper"
>
<!-- 通用查询映射结果 -->
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.Copy
t
ightOwnerAssetType"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.Copy
r
ightOwnerAssetType"
>
<id
column=
"id"
property=
"id"
/>
<id
column=
"id"
property=
"id"
/>
<result
column=
"copyright_owner_id"
property=
"copyrightOwnerId"
/>
<result
column=
"copyright_owner_id"
property=
"copyrightOwnerId"
/>
<result
column=
"asset_type_id"
property=
"assetTypeId"
/>
<result
column=
"asset_type_id"
property=
"assetTypeId"
/>
</resultMap>
</resultMap>
<!-- 通用查询结果列 -->
<!-- 通用查询结果列 -->
...
...
src/main/resources/mapper/Copy
t
ightOwnerBoardTypeMapper.xml
→
src/main/resources/mapper/Copy
r
ightOwnerBoardTypeMapper.xml
View file @
2cf6e347
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wisenergy.chnmuseum.party.mapper.Copy
t
ightOwnerBoardTypeMapper"
>
<mapper
namespace=
"cn.wisenergy.chnmuseum.party.mapper.Copy
r
ightOwnerBoardTypeMapper"
>
<!-- 通用查询映射结果 -->
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.Copy
t
ightOwnerBoardType"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.Copy
r
ightOwnerBoardType"
>
<id
column=
"id"
property=
"id"
/>
<id
column=
"id"
property=
"id"
/>
<result
column=
"copyright_owner_id"
property=
"copyrightOwnerId"
/>
<result
column=
"copyright_owner_id"
property=
"copyrightOwnerId"
/>
<result
column=
"board_type_id"
property=
"boardTypeId"
/>
<result
column=
"board_type_id"
property=
"boardTypeId"
/>
</resultMap>
</resultMap>
<!-- 通用查询结果列 -->
<!-- 通用查询结果列 -->
...
...
src/main/resources/templates/mapper.java.vm
View file @
2cf6e347
package
${
package
.
Mapper
};
package
${
package
.
Mapper
};
import
com
.
baomidou
.
mybatisplus
.
core
.
metadata
.
IPage
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
;
import
${
superMapperClassPackage
};
import
${
superMapperClassPackage
};
import
${
package
.
Entity
}.${
entity
};
import
${
package
.
Entity
}.${
entity
};
import
${
cfg
.
paging
};
import
${
cfg
.
pageParamPath
};
import
${
cfg
.
queryVoPath
};
import
org
.
apache
.
ibatis
.
annotations
.
Param
;
import
org
.
springframework
.
stereotype
.
Repository
;
import
java
.
io
.
Serializable
;
/**
/**
*
<
pre
>
*
<
pre
>
...
@@ -23,27 +14,7 @@ import java.io.Serializable;
...
@@ -23,27 +14,7 @@ import java.io.Serializable;
#
if
(${
kotlin
})
#
if
(${
kotlin
})
interface
${
table
.
mapperName
}
:
${
superMapperClass
}<${
entity
}>
interface
${
table
.
mapperName
}
:
${
superMapperClass
}<${
entity
}>
#
else
#
else
@
Repository
public
interface
${
table
.
mapperName
}
extends
${
superMapperClass
}<${
entity
}>
{
public
interface
${
table
.
mapperName
}
extends
${
superMapperClass
}<${
entity
}>
{
#
if
(${
cfg
.
generatorStrategy
})
/*
*
根据
ID
获取查询对象
*
*
@
param
id
*
@
return
*/
${
entity
}
QueryVo
get
${
entity
}
ById
(
Serializable
id
);
/*
*
获取分页对象
*
*
@
param
page
*
@
param
${
cfg
.
entityObjectName
}
PageParam
*
@
return
*/
IPage
<${
entity
}
QueryVo
>
get
${
entity
}
PageList
(@
Param
(
"page"
)
Page
page
,
@
Param
(
"param"
)
${
entity
}
PageParam
${
cfg
.
entityObjectName
}
PageParam
);
#
end
}
}
#
end
#
end
src/main/resources/templates/service.java.vm
View file @
2cf6e347
package
${
package
.
Service
}
package
${
package
.
Service
}
;
import
${
package
.
Entity
}.${
entity
};
import
${
package
.
Entity
}.${
entity
};
import
${
superServiceClassPackage
};
import
${
superServiceClassPackage
};
import
${
cfg
.
paging
};
import
${
cfg
.
pageParamPath
};
import
${
cfg
.
queryVoPath
};
/**
/**
*
<
p
>
*
<
p
>
...
@@ -49,23 +46,6 @@ public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
...
@@ -49,23 +46,6 @@ public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
boolean
delete
${
entity
}(
Long
id
)
throws
Exception
;
boolean
delete
${
entity
}(
Long
id
)
throws
Exception
;
#
end
#
end
/**
*
根据
ID
获取查询对象
*
*
@
param
id
*
@
return
*
@
throws
Exception
*/
${
entity
}
QueryVo
get
${
entity
}
ById
(
Serializable
id
)
throws
Exception
;
/**
*
获取分页对象
*
*
@
param
${
cfg
.
entityObjectName
}
PageParam
*
@
return
*
@
throws
Exception
*/
Paging
<${
entity
}
QueryVo
>
get
${
entity
}
PageList
(${
entity
}
PageParam
${
cfg
.
entityObjectName
}
PageParam
)
throws
Exception
;
#
end
#
end
}
}
#
end
#
end
src/main/resources/templates/serviceImpl.java.vm
View file @
2cf6e347
...
@@ -3,10 +3,6 @@ package ${package.ServiceImpl};
...
@@ -3,10 +3,6 @@ package ${package.ServiceImpl};
import
${
package
.
Entity
}.${
entity
};
import
${
package
.
Entity
}.${
entity
};
import
${
package
.
Mapper
}.${
table
.
mapperName
};
import
${
package
.
Mapper
}.${
table
.
mapperName
};
import
${
package
.
Service
}.${
table
.
serviceName
};
import
${
package
.
Service
}.${
table
.
serviceName
};
import
${
cfg
.
paging
};
import
${
cfg
.
pageParamPath
};
import
${
cfg
.
commonPageUtilPath
};
import
${
cfg
.
queryVoPath
};
import
${
superServiceImplClassPackage
};
import
${
superServiceImplClassPackage
};
import
lombok
.
extern
.
slf4j
.
Slf4j
;
import
lombok
.
extern
.
slf4j
.
Slf4j
;
...
@@ -14,12 +10,6 @@ import org.springframework.stereotype.Service;
...
@@ -14,12 +10,6 @@ import org.springframework.stereotype.Service;
import
org
.
springframework
.
transaction
.
annotation
.
Transactional
;
import
org
.
springframework
.
transaction
.
annotation
.
Transactional
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
com
.
baomidou
.
mybatisplus
.
core
.
metadata
.
IPage
;
import
com
.
baomidou
.
mybatisplus
.
core
.
metadata
.
OrderItem
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
;
import
java
.
io
.
Serializable
;
/**
/**
*
<
pre
>
*
<
pre
>
*
$
!{table.comment} 服务实现类
*
$
!{table.comment} 服务实现类
...
@@ -35,7 +25,7 @@ open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperNam
...
@@ -35,7 +25,7 @@ open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperNam
}
}
#
else
#
else
public
class
${
table
.
serviceImplName
}
extends
Base
ServiceImpl
<${
table
.
mapperName
},
${
entity
}>
implements
${
table
.
serviceName
}
{
public
class
${
table
.
serviceImplName
}
extends
ServiceImpl
<${
table
.
mapperName
},
${
entity
}>
implements
${
table
.
serviceName
}
{
@
Autowired
@
Autowired
private
${
table
.
mapperName
}
${
cfg
.
mapperObjectName
};
private
${
table
.
mapperName
}
${
cfg
.
mapperObjectName
};
...
@@ -60,18 +50,6 @@ public class ${table.serviceImplName} extends BaseServiceImpl<${table.mapperName
...
@@ -60,18 +50,6 @@ public class ${table.serviceImplName} extends BaseServiceImpl<${table.mapperName
return
super
.
removeById
(
id
);
return
super
.
removeById
(
id
);
}
}
#
end
#
end
@
Override
public
${
entity
}
QueryVo
get
${
entity
}
ById
(
Serializable
id
)
throws
Exception
{
return
${
cfg
.
mapperObjectName
}.
get
${
entity
}
ById
(
id
);
}
@
Override
public
Paging
<${
entity
}
QueryVo
>
get
${
entity
}
PageList
(${
entity
}
PageParam
${
cfg
.
entityObjectName
}
PageParam
)
throws
Exception
{
Page
page
=
PageUtil
.
getPage
(${
cfg
.
entityObjectName
}
PageParam
,
OrderItem
.
desc
(
getLambdaColumn
(${
entity
}::
getCreateTime
)));
IPage
<${
entity
}
QueryVo
>
iPage
=
${
cfg
.
mapperObjectName
}.
get
${
entity
}
PageList
(
page
,
${
cfg
.
entityObjectName
}
PageParam
);
return
new
Paging
(
iPage
);
}
#
end
#
end
}
}
...
...
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