Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nrgl
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
nrgl
Commits
72388b74
提交
72388b74
authored
4月 25, 2019
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
dada582b
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
86 行增加
和
168 行删除
+86
-168
ClauseLibraryController.java
.../bg/controller/clauseLibrary/ClauseLibraryController.java
+3
-2
AnimationLibrarySerivceImpl.java
...service/animationlibrary/AnimationLibrarySerivceImpl.java
+6
-10
ArticleLibrarySerivceImpl.java
.../bg/service/articlelibrary/ArticleLibrarySerivceImpl.java
+6
-11
AudioLibrarySerivceImpl.java
...urce/bg/service/audiolibrary/AudioLibrarySerivceImpl.java
+5
-10
AuthorLibraryServiceImpl.java
...ce/bg/service/authorLibrary/AuthorLibraryServiceImpl.java
+0
-8
ClauseLibraryService.java
...source/bg/service/clauseLibrary/ClauseLibraryService.java
+2
-1
ClauseLibraryServiceImpl.java
...ce/bg/service/clauseLibrary/ClauseLibraryServiceImpl.java
+15
-34
CoursewareLibrarySerivceImpl.java
...rvice/coursewarelibrary/CoursewareLibrarySerivceImpl.java
+5
-10
EbookServiceImpl.java
.../com/zrqx/resource/bg/service/ebook/EbookServiceImpl.java
+12
-19
ImageLibrarySerivceImpl.java
...urce/bg/service/imagelibrary/ImageLibrarySerivceImpl.java
+6
-11
PdfLibrarySerivceImpl.java
...resource/bg/service/pdflibrary/PdfLibrarySerivceImpl.java
+6
-10
StatuteLibraryServiceImpl.java
.../bg/service/statuteLibrary/StatuteLibraryServiceImpl.java
+15
-32
VideoLibrarySerivceImpl.java
...urce/bg/service/videolibrary/VideoLibrarySerivceImpl.java
+5
-10
没有找到文件。
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/clauseLibrary/ClauseLibraryController.java
浏览文件 @
72388b74
...
...
@@ -7,6 +7,7 @@ package com.zrqx.resource.bg.controller.clauseLibrary;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -96,7 +97,7 @@ public class ClauseLibraryController {
@ApiOperation
(
value
=
"新增"
,
notes
=
"新增一个"
)
@PostMapping
(
value
=
ResourceRequestPath
.
SAVE
)
public
CallBack
<
Boolean
>
save
(
@RequestBody
SaveUpdateClauseLibraryForm
form
)
{
public
CallBack
<
Boolean
>
save
(
@RequestBody
SaveUpdateClauseLibraryForm
form
)
throws
ParseException
{
if
(!
service
.
saveOrUpdate
(
form
))
{
throw
new
BaseException
(
ResponseCodeEnum
.
FAIL
);
}
...
...
@@ -105,7 +106,7 @@ public class ClauseLibraryController {
@ApiOperation
(
value
=
"更新"
,
notes
=
"更新"
)
@PostMapping
(
value
=
ResourceRequestPath
.
UPDATE
)
public
CallBack
<
Boolean
>
update
(
@RequestBody
SaveUpdateClauseLibraryForm
form
)
{
public
CallBack
<
Boolean
>
update
(
@RequestBody
SaveUpdateClauseLibraryForm
form
)
throws
ParseException
{
if
(!
service
.
saveOrUpdate
(
form
))
{
throw
new
BaseException
(
ResponseCodeEnum
.
FAIL
);
}
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/animationlibrary/AnimationLibrarySerivceImpl.java
浏览文件 @
72388b74
...
...
@@ -86,16 +86,13 @@ public class AnimationLibrarySerivceImpl extends BaseServiceImpl<AnimationLibrar
@Override
public
boolean
saveOrUpdate
(
SaveUpdateAnimationLibraryForm
form
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
AnimationLibrary
entity
=
new
AnimationLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
form
.
getDiyTypeId
().
size
()
!=
form
.
getDiyTypeCode
().
size
()){
throw
new
BaseException
(
"自定义分类数据错误"
);
}
if
(
form
.
getId
()==
null
){
Integer
countName
=
animationMapper
.
isRepeat
(
form
.
getName
(),
""
);
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
AnimationLibrary
entity
=
new
AnimationLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
//添加动画信息
entity
.
setStatus
(
0
);
entity
.
setResourceType
(
8
);
...
...
@@ -104,10 +101,8 @@ public class AnimationLibrarySerivceImpl extends BaseServiceImpl<AnimationLibrar
animationMapper
.
insert
(
entity
);
}
else
{
Integer
countName
=
animationMapper
.
isRepeat
(
entity
.
getName
(),
entity
.
getId
());
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
AnimationLibrary
entity
=
animationMapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
entity
);
//修改动画资源
entity
.
setUpdateTime
(
new
Date
());
animationMapper
.
updateByPrimaryKeySelective
(
entity
);
...
...
@@ -124,6 +119,7 @@ public class AnimationLibrarySerivceImpl extends BaseServiceImpl<AnimationLibrar
label
.
setObjectId
(
entity
.
getId
());
labelMapper
.
delete
(
label
);
}
AnimationLibrary
entity
=
animationMapper
.
selectByPrimaryKey
(
form
.
getId
());
//添加商品信息
AnimationGoods
goods
=
new
AnimationGoods
();
BeanUtils
.
copyProperties
(
form
,
goods
);
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/articlelibrary/ArticleLibrarySerivceImpl.java
浏览文件 @
72388b74
...
...
@@ -89,16 +89,12 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,In
@Override
public
boolean
saveOrUpdate
(
SaveUpdateArticleLibraryForm
form
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
ArticleLibrary
entity
=
new
ArticleLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
form
.
getDiyTypeId
()
==
null
||
form
.
getDiyTypeId
().
size
()
!=
form
.
getDiyTypeCode
().
size
()){
throw
new
BaseException
(
"自定义分类数据错误"
);
}
if
(
entity
.
getId
()
==
null
){
Integer
countName
=
articleMapper
.
isRepeat
(
form
.
getName
(),
""
);
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
if
(
form
.
getId
()
==
null
){
ArticleLibrary
entity
=
new
ArticleLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
//添加
entity
.
setStatus
(
0
);
entity
.
setResourceType
(
2
);
...
...
@@ -180,10 +176,8 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,In
articleMapper
.
insert
(
entity
);
}
else
{
//修改
Integer
listName
=
articleMapper
.
isRepeat
(
entity
.
getName
(),
entity
.
getId
());
if
(
listName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
ArticleLibrary
entity
=
articleMapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setUpdateTime
(
new
Date
());
if
(
form
.
getPdfResourceType
()!=
null
){
if
(
form
.
getPdfResourceType
().
equals
(
1
)){
...
...
@@ -272,6 +266,7 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,In
label
.
setObjectId
(
entity
.
getId
());
alcdMapper
.
delete
(
label
);
}
ArticleLibrary
entity
=
articleMapper
.
selectByPrimaryKey
(
form
.
getId
());
// 维护合同的关联关系
if
(
StringUtils
.
isNotBlank
(
form
.
getRelatedContracts
()))
{
Copyright
copyright
=
copyrightService
.
selectByPrimaryKey
(
form
.
getRelatedContracts
());
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/audiolibrary/AudioLibrarySerivceImpl.java
浏览文件 @
72388b74
...
...
@@ -72,16 +72,12 @@ public class AudioLibrarySerivceImpl extends BaseServiceImpl<AudioLibrary,Intege
@Override
public
boolean
saveOrUpdate
(
SaveUpdateAudioLibraryForm
form
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
AudioLibrary
entity
=
new
AudioLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
form
.
getDiyTypeId
().
size
()
>
0
&&
form
.
getDiyTypeId
().
size
()
!=
form
.
getDiyTypeCode
().
size
()){
throw
new
BaseException
(
"自定义分类数据错误"
);
}
if
(
form
.
getId
()==
null
){
List
<
AudioLibrary
>
list
=
audioMapper
.
isRepeat
(
form
.
getName
());
if
(
list
.
size
()>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
AudioLibrary
entity
=
new
AudioLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
//添加
entity
.
setStatus
(
0
);
entity
.
setResourceType
(
7
);
...
...
@@ -90,10 +86,8 @@ public class AudioLibrarySerivceImpl extends BaseServiceImpl<AudioLibrary,Intege
audioMapper
.
insert
(
entity
);
}
else
{
//修改
Integer
countName
=
audioMapper
.
isRepeatById
(
entity
.
getName
(),
entity
.
getId
());
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
AudioLibrary
entity
=
audioMapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setUpdateTime
(
new
Date
());
audioMapper
.
updateByPrimaryKeySelective
(
entity
);
// 商品信息
...
...
@@ -109,6 +103,7 @@ public class AudioLibrarySerivceImpl extends BaseServiceImpl<AudioLibrary,Intege
label
.
setObjectId
(
entity
.
getId
());
labelMapper
.
delete
(
label
);
}
AudioLibrary
entity
=
audioMapper
.
selectByPrimaryKey
(
form
.
getId
());
// 维护合同的关联关系
if
(
StringUtils
.
isNotBlank
(
form
.
getRelatedContracts
()))
{
Copyright
copyright
=
copyrightService
.
selectByPrimaryKey
(
form
.
getRelatedContracts
());
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/authorLibrary/AuthorLibraryServiceImpl.java
浏览文件 @
72388b74
...
...
@@ -82,20 +82,12 @@ public class AuthorLibraryServiceImpl extends BaseServiceImpl<AuthorLibrary, Int
}
if
(
form
.
getId
()==
null
){
//添加
Integer
countName
=
authorMapper
.
isRepeat
(
form
.
getName
(),
""
);
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
authorLibrary
.
setResourceType
(
16
);
authorLibrary
.
setIsDelete
(
0
);
authorLibrary
.
setStatus
(
0
);
authorLibrary
.
setCreateTime
(
new
Date
());
authorMapper
.
insert
(
authorLibrary
);
}
else
{
Integer
countName
=
authorMapper
.
isRepeat
(
authorLibrary
.
getName
(),
authorLibrary
.
getId
());
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
authorLibrary
.
setUpdateTime
(
new
Date
());
authorMapper
.
updateByPrimaryKeySelective
(
authorLibrary
);
// 删除原有关系表中的关系
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/clauseLibrary/ClauseLibraryService.java
浏览文件 @
72388b74
...
...
@@ -4,6 +4,7 @@
*/
package
com
.
zrqx
.
resource
.
bg
.
service
.
clauseLibrary
;
import
java.text.ParseException
;
import
java.util.List
;
import
com.zrqx.core.form.resource.bg.ImportForm
;
...
...
@@ -24,7 +25,7 @@ import com.zrqx.core.vo.resource.clauseLibrary.ClauseLibraryListVo;
public
interface
ClauseLibraryService
extends
BaseService
<
ClauseLibrary
,
Integer
>
{
/** 新增/更新 */
boolean
saveOrUpdate
(
SaveUpdateClauseLibraryForm
form
);
boolean
saveOrUpdate
(
SaveUpdateClauseLibraryForm
form
)
throws
ParseException
;
/** 批量删除 */
String
batchDelete
(
List
<
String
>
ids
);
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/clauseLibrary/ClauseLibraryServiceImpl.java
浏览文件 @
72388b74
...
...
@@ -4,6 +4,7 @@
*/
package
com
.
zrqx
.
resource
.
bg
.
service
.
clauseLibrary
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -88,30 +89,20 @@ public class ClauseLibraryServiceImpl extends BaseServiceImpl<ClauseLibrary, Int
return
mapper
;
}
/** 新增/更新 */
/** 新增/更新
* @throws ParseException */
@Override
public
boolean
saveOrUpdate
(
SaveUpdateClauseLibraryForm
form
)
{
public
boolean
saveOrUpdate
(
SaveUpdateClauseLibraryForm
form
)
throws
ParseException
{
if
(
form
.
getDiyTypeId
()
==
null
||
form
.
getDiyTypeId
().
size
()
!=
form
.
getDiyTypeCode
().
size
())
{
throw
new
BaseException
(
7
,
"自定义分类数据错误"
);
}
ClauseLibrary
entity
=
new
ClauseLibrary
();
// 保存条文库
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
try
{
BeanUtils
.
copyProperties
(
form
,
entity
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BaseException
(
7
,
"复制对象时创建对象失败。"
);
}
// 新增/修改后,状态为未审核
entity
.
setStatus
(
ResourceStatusEnum
.
ENTRY
.
getValue
());
String
objectId
=
form
.
getId
();
if
(
objectId
==
null
)
{
// 添加
Integer
countName
=
mapper
.
isRepeat
(
form
.
getContent
(),
""
);
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
ClauseLibrary
entity
=
new
ClauseLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setUploadTime
(
new
Date
());
entity
.
setIsDelete
(
0
);
entity
.
setStatus
(
0
);
...
...
@@ -194,10 +185,8 @@ public class ClauseLibraryServiceImpl extends BaseServiceImpl<ClauseLibrary, Int
}
}
else
{
// 更新
Integer
countName
=
mapper
.
isRepeat
(
entity
.
getContent
(),
entity
.
getId
());
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
ClauseLibrary
entity
=
mapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setId
(
objectId
);
entity
.
setUpdateTime
(
new
Date
());
if
(
form
.
getPdfResourceType
()!=
null
){
...
...
@@ -286,24 +275,16 @@ public class ClauseLibraryServiceImpl extends BaseServiceImpl<ClauseLibrary, Int
label
.
setObjectId
(
objectId
);
labelMapper
.
delete
(
label
);
}
objectId
=
entity
.
getId
();
ClauseLibrary
entity
=
mapper
.
selectByPrimaryKey
(
form
.
getId
());
objectId
=
form
.
getId
();
// 保存商品信息
ClauseGoods
goods
=
new
ClauseGoods
();
try
{
BeanUtils
.
copyProperties
(
form
,
goods
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BaseException
(
7
,
"复制对象时创建对象失败。"
);
BeanUtils
.
copyProperties
(
form
,
goods
);
if
(
StringUtils
.
isNotBlank
(
form
.
getStartDate
()))
{
goods
.
setStartDate
(
sdf
.
parse
(
form
.
getStartDate
()));
}
try
{
if
(
StringUtils
.
isNotBlank
(
form
.
getStartDate
()))
{
goods
.
setStartDate
(
sdf
.
parse
(
form
.
getStartDate
()));
}
if
(
StringUtils
.
isNotBlank
(
form
.
getEndDate
()))
{
goods
.
setEndDate
(
sdf
.
parse
(
form
.
getEndDate
()));
}
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
7
,
"时间格式不正确"
);
if
(
StringUtils
.
isNotBlank
(
form
.
getEndDate
()))
{
goods
.
setEndDate
(
sdf
.
parse
(
form
.
getEndDate
()));
}
goods
.
setObjectId
(
objectId
);
if
(
goodsMapper
.
insert
(
goods
)
!=
1
)
{
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/coursewarelibrary/CoursewareLibrarySerivceImpl.java
浏览文件 @
72388b74
...
...
@@ -70,16 +70,12 @@ public class CoursewareLibrarySerivceImpl extends BaseServiceImpl<CoursewareLibr
@Override
public
boolean
saveOrUpdate
(
SaveUpdateCoursewareLibraryForm
form
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
CoursewareLibrary
entity
=
new
CoursewareLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
form
.
getDiyTypeId
().
size
()
!=
form
.
getDiyTypeCode
().
size
()){
throw
new
BaseException
(
"自定义分类数据错误"
);
}
if
(
form
.
getId
()==
null
){
Integer
countName
=
coursewareMapper
.
isRepeat
(
form
.
getName
(),
""
);
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
CoursewareLibrary
entity
=
new
CoursewareLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setStatus
(
0
);
entity
.
setIsDelete
(
0
);
entity
.
setResourceType
(
9
);
...
...
@@ -87,10 +83,8 @@ public class CoursewareLibrarySerivceImpl extends BaseServiceImpl<CoursewareLibr
coursewareMapper
.
insert
(
entity
);
}
else
{
//修改
Integer
countName
=
coursewareMapper
.
isRepeat
(
form
.
getName
(),
form
.
getId
());
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
CoursewareLibrary
entity
=
coursewareMapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setUpdateTime
(
new
Date
());
coursewareMapper
.
updateByPrimaryKeySelective
(
entity
);
// 商品信息
...
...
@@ -106,6 +100,7 @@ public class CoursewareLibrarySerivceImpl extends BaseServiceImpl<CoursewareLibr
label
.
setObjectId
(
entity
.
getId
());
labelMapper
.
delete
(
label
);
}
CoursewareLibrary
entity
=
coursewareMapper
.
selectByPrimaryKey
(
form
.
getId
());
// 维护合同的关联关系
if
(
StringUtils
.
isNotBlank
(
form
.
getRelatedContracts
()))
{
Copyright
copyright
=
copyrightService
.
selectByPrimaryKey
(
form
.
getRelatedContracts
());
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/ebook/EbookServiceImpl.java
浏览文件 @
72388b74
...
...
@@ -107,24 +107,16 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
public
boolean
saveOrUpdate
(
SaveUpdateEbookForm
form
)
throws
ParseException
{
List
<
BookDiyType
>
dtList
=
new
ArrayList
<
BookDiyType
>();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Book
book
=
new
Book
();
BeanUtils
.
copyProperties
(
form
,
book
);
Ebook
ebook
=
new
Ebook
();
BeanUtils
.
copyProperties
(
form
,
ebook
);
if
(
form
.
getDiyTypeId
()
==
null
||
form
.
getDiyTypeId
().
size
()
==
0
)
{
throw
new
BaseException
(
"参数验证失败。"
);
}
else
{
if
(
book
.
getId
()
==
null
)
{
Integer
listName
=
bookMapper
.
isRepeat
(
form
.
getName
(),
""
);
if
(
listName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
try
{
if
(
form
.
getPublishTime
()
!=
null
)
{
book
.
setPublishTime
(
sdf
.
parse
(
form
.
getPublishTime
()));
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
if
(
form
.
getId
()
==
null
)
{
Book
book
=
new
Book
();
BeanUtils
.
copyProperties
(
form
,
book
);
Ebook
ebook
=
new
Ebook
();
BeanUtils
.
copyProperties
(
form
,
ebook
);
if
(
form
.
getPublishTime
()
!=
null
)
{
book
.
setPublishTime
(
sdf
.
parse
(
form
.
getPublishTime
()));
}
book
.
setStatus
(
0
);
book
.
setIsDelete
(
0
);
...
...
@@ -224,10 +216,10 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
}
}
}
else
{
Integer
listName
=
bookMapper
.
isRepeat
(
book
.
getName
(),
book
.
getId
());
if
(
listName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
Book
book
=
bookMapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
book
);
Ebook
ebook
=
ebookMapper
.
selectByPrimaryKey
(
form
.
getId
()
);
BeanUtils
.
copyProperties
(
form
,
ebook
);
book
.
setUpdateTime
(
new
Date
());
// 图书信息
book
.
setDepartmentId
(
form
.
getDepartmentId
());
bookMapper
.
updateByPrimaryKey
(
book
);
...
...
@@ -331,6 +323,7 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
issued
.
setObjectId
(
book
.
getId
());
bookIssuedMapper
.
delete
(
issued
);
}
Book
book
=
bookMapper
.
selectByPrimaryKey
(
form
.
getId
());
BookGoods
goods
=
new
BookGoods
();
BeanUtils
.
copyProperties
(
form
,
goods
);
//添加商品信息
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/imagelibrary/ImageLibrarySerivceImpl.java
浏览文件 @
72388b74
...
...
@@ -80,17 +80,13 @@ public class ImageLibrarySerivceImpl extends BaseServiceImpl<ImageLibrary,Intege
@Override
public
boolean
saveOrUpdate
(
SaveUpdateImageLibraryForm
form
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
ImageLibrary
entity
=
new
ImageLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
form
.
getDiyTypeId
().
size
()
!=
form
.
getDiyTypeCode
().
size
()){
throw
new
BaseException
(-
7
,
"自定义分类数据错误"
);
}
if
(
entity
.
getId
()
==
null
){
if
(
form
.
getId
()
==
null
){
//添加图片信息
Integer
countName
=
imageMapper
.
isRepeat
(
form
.
getName
(),
""
);
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
ImageLibrary
entity
=
new
ImageLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setIsDelete
(
0
);
entity
.
setStatus
(
0
);
entity
.
setResourceType
(
5
);
...
...
@@ -100,10 +96,8 @@ public class ImageLibrarySerivceImpl extends BaseServiceImpl<ImageLibrary,Intege
}
}
else
{
//修改
Integer
countName
=
imageMapper
.
isRepeat
(
entity
.
getName
(),
entity
.
getId
());
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
ImageLibrary
entity
=
imageMapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setUpdateTime
(
new
Date
());
imageMapper
.
updateByPrimaryKeySelective
(
entity
);
//删除商品信息
...
...
@@ -119,6 +113,7 @@ public class ImageLibrarySerivceImpl extends BaseServiceImpl<ImageLibrary,Intege
label
.
setObjectId
(
entity
.
getId
());
labelMapper
.
delete
(
label
);
}
ImageLibrary
entity
=
imageMapper
.
selectByPrimaryKey
(
form
.
getId
());
// 维护合同的关联关系
if
(
StringUtils
.
isNotBlank
(
form
.
getRelatedContracts
()))
{
Copyright
copyright
=
copyrightService
.
selectByPrimaryKey
(
form
.
getRelatedContracts
());
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/pdflibrary/PdfLibrarySerivceImpl.java
浏览文件 @
72388b74
...
...
@@ -81,17 +81,14 @@ public class PdfLibrarySerivceImpl extends BaseServiceImpl<PdfLibrary,Integer> i
@Override
public
boolean
saveOrUpdate
(
SaveUpdatePdfLibraryForm
form
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
PdfLibrary
entity
=
new
PdfLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
form
.
getDiyTypeId
().
size
()
!=
form
.
getDiyTypeCode
().
size
()){
throw
new
BaseException
(
"自定义分类数据错误"
);
}
if
(
form
.
getId
()==
null
){
//添加
List
<
PdfLibrary
>
listName
=
pdfMapper
.
isRepeat
(
form
.
getName
());
if
(
listName
.
size
()>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
PdfLibrary
entity
=
new
PdfLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setStatus
(
0
);
entity
.
setIsDelete
(
0
);
entity
.
setResourceType
(
15
);
...
...
@@ -112,10 +109,8 @@ public class PdfLibrarySerivceImpl extends BaseServiceImpl<PdfLibrary,Integer> i
}
}
else
{
//修改
Integer
countName
=
pdfMapper
.
isRepeatById
(
entity
.
getName
(),
entity
.
getId
());
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
PdfLibrary
entity
=
pdfMapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setUpdateTime
(
new
Date
());
pdfMapper
.
updateByPrimaryKeySelective
(
entity
);
//商品信息
...
...
@@ -144,6 +139,7 @@ public class PdfLibrarySerivceImpl extends BaseServiceImpl<PdfLibrary,Integer> i
label
.
setObjectId
(
entity
.
getId
());
labelMapper
.
delete
(
label
);
}
PdfLibrary
entity
=
pdfMapper
.
selectByPrimaryKey
(
form
.
getId
());
//添加商品信息
PdfGoods
goods
=
new
PdfGoods
();
BeanUtils
.
copyProperties
(
form
,
goods
);
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/statuteLibrary/StatuteLibraryServiceImpl.java
浏览文件 @
72388b74
...
...
@@ -98,24 +98,18 @@ public class StatuteLibraryServiceImpl extends BaseServiceImpl<StatuteLibrary, I
if
(
form
.
getDiyTypeId
()
==
null
||
form
.
getDiyTypeId
().
size
()
!=
form
.
getDiyTypeCode
().
size
())
{
throw
new
BaseException
(
7
,
"自定义分类数据错误"
);
}
StatuteLibrary
entity
=
new
StatuteLibrary
();
// 保存法规库
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
StringUtils
.
isNotBlank
(
form
.
getIssuingTime
()))
{
entity
.
setIssuingTime
(
sdf
.
parse
(
form
.
getIssuingTime
()));
}
if
(
StringUtils
.
isNotBlank
(
form
.
getImplementTime
()))
{
entity
.
setImplementTime
(
sdf
.
parse
(
form
.
getImplementTime
()));
}
// 新增/修改后,状态为未审核
entity
.
setStatus
(
ResourceStatusEnum
.
ENTRY
.
getValue
());
String
objectId
=
form
.
getId
();
if
(
objectId
==
null
)
{
// 添加
Integer
countName
=
mapper
.
isRepeat
(
form
.
getName
(),
""
);
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
StatuteLibrary
entity
=
new
StatuteLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
StringUtils
.
isNotBlank
(
form
.
getIssuingTime
()))
{
entity
.
setIssuingTime
(
sdf
.
parse
(
form
.
getIssuingTime
()));
}
if
(
StringUtils
.
isNotBlank
(
form
.
getImplementTime
()))
{
entity
.
setImplementTime
(
sdf
.
parse
(
form
.
getImplementTime
()));
}
entity
.
setUploadTime
(
new
Date
());
entity
.
setIsDelete
(
0
);
...
...
@@ -201,11 +195,8 @@ public class StatuteLibraryServiceImpl extends BaseServiceImpl<StatuteLibrary, I
}
}
else
{
// 更新
Integer
countName
=
mapper
.
isRepeat
(
entity
.
getName
(),
entity
.
getId
());
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
entity
.
setId
(
objectId
);
StatuteLibrary
entity
=
mapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setUpdateTime
(
new
Date
());
if
(
form
.
getPdfResourceType
()!=
null
){
if
(
form
.
getPdfResourceType
().
equals
(
1
)){
...
...
@@ -294,23 +285,15 @@ public class StatuteLibraryServiceImpl extends BaseServiceImpl<StatuteLibrary, I
label
.
setObjectId
(
objectId
);
labelMapper
.
delete
(
label
);
}
StatuteLibrary
entity
=
mapper
.
selectByPrimaryKey
(
form
.
getId
());
// 保存商品信息
StatuteGoods
goods
=
new
StatuteGoods
();
try
{
BeanUtils
.
copyProperties
(
form
,
goods
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BaseException
(
7
,
"复制对象时创建对象失败。"
);
BeanUtils
.
copyProperties
(
form
,
goods
);
if
(
StringUtils
.
isNotBlank
(
form
.
getStartDate
()))
{
goods
.
setStartDate
(
sdf
.
parse
(
form
.
getStartDate
()));
}
try
{
if
(
StringUtils
.
isNotBlank
(
form
.
getStartDate
()))
{
goods
.
setStartDate
(
sdf
.
parse
(
form
.
getStartDate
()));
}
if
(
StringUtils
.
isNotBlank
(
form
.
getEndDate
()))
{
goods
.
setEndDate
(
sdf
.
parse
(
form
.
getEndDate
()));
}
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
7
,
"时间格式不正确"
);
if
(
StringUtils
.
isNotBlank
(
form
.
getEndDate
()))
{
goods
.
setEndDate
(
sdf
.
parse
(
form
.
getEndDate
()));
}
goods
.
setObjectId
(
objectId
);
if
(
goodsMapper
.
insert
(
goods
)
!=
1
)
{
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/videolibrary/VideoLibrarySerivceImpl.java
浏览文件 @
72388b74
...
...
@@ -76,17 +76,13 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,Intege
@Override
public
boolean
saveOrUpdate
(
SaveUpdateVideoLibraryForm
form
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
VideoLibrary
entity
=
new
VideoLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
form
.
getDiyTypeId
().
size
()
!=
form
.
getDiyTypeCode
().
size
()){
throw
new
BaseException
(
"自定义分类数据错误"
);
}
if
(
form
.
getId
()==
null
){
//添加视频信息
List
<
VideoLibrary
>
listName
=
videoMapper
.
isRepeat
(
form
.
getName
());
if
(
listName
.
size
()>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
VideoLibrary
entity
=
new
VideoLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setStatus
(
0
);
entity
.
setIsDelete
(
0
);
entity
.
setResourceType
(
6
);
...
...
@@ -94,10 +90,8 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,Intege
videoMapper
.
insert
(
entity
);
}
else
{
//修改
Integer
countName
=
videoMapper
.
isRepeatById
(
entity
.
getName
(),
entity
.
getId
());
if
(
countName
>
0
){
throw
new
BaseException
(
ResponseCodeEnum
.
REPEST
);
}
VideoLibrary
entity
=
videoMapper
.
selectByPrimaryKey
(
form
.
getId
());
BeanUtils
.
copyProperties
(
form
,
entity
);
entity
.
setUpdateTime
(
new
Date
());
videoMapper
.
updateByPrimaryKeySelective
(
entity
);
//删除商品信息
...
...
@@ -113,6 +107,7 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,Intege
label
.
setObjectId
(
entity
.
getId
());
labelMapper
.
delete
(
label
);
}
VideoLibrary
entity
=
videoMapper
.
selectByPrimaryKey
(
form
.
getId
());
//添加商品信息
VideoGoods
goods
=
new
VideoGoods
();
BeanUtils
.
copyProperties
(
form
,
goods
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论