Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chuanshan_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖旭伟
chuanshan_gov_platform
Commits
55c35bdf
Commit
55c35bdf
authored
2 years ago
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
纠错管理bug修改
parent
920d332c
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1730 additions
and
352 deletions
+1730
-352
knowledge-base/src/main/java/com/mortals/xhx/module/error/service/impl/ErrorRecoveryServiceImpl.java
...x/module/error/service/impl/ErrorRecoveryServiceImpl.java
+1
-0
knowledge-base/src/main/java/com/mortals/xhx/module/matter/model/MatterDatumFileEntity.java
...ortals/xhx/module/matter/model/MatterDatumFileEntity.java
+31
-10
knowledge-base/src/main/java/com/mortals/xhx/module/matter/model/MatterDatumFileQuery.java
...mortals/xhx/module/matter/model/MatterDatumFileQuery.java
+298
-12
knowledge-base/src/main/java/com/mortals/xhx/module/matter/service/MatterDatumService.java
...mortals/xhx/module/matter/service/MatterDatumService.java
+10
-0
knowledge-base/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumFileServiceImpl.java
...odule/matter/service/impl/MatterDatumFileServiceImpl.java
+69
-0
knowledge-base/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumServiceImpl.java
...hx/module/matter/service/impl/MatterDatumServiceImpl.java
+73
-0
knowledge-base/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
...als/xhx/module/matter/service/impl/MatterServiceImpl.java
+4
-0
knowledge-base/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
...a/com/mortals/xhx/module/matter/web/MatterController.java
+5
-0
knowledge-base/src/main/java/com/mortals/xhx/module/matter/web/MatterDatumController.java
.../mortals/xhx/module/matter/web/MatterDatumController.java
+30
-0
knowledge-base/src/main/java/com/mortals/xhx/module/site/dao/SiteMatterDao.java
...n/java/com/mortals/xhx/module/site/dao/SiteMatterDao.java
+2
-1
knowledge-base/src/main/java/com/mortals/xhx/module/site/dao/ibatis/SiteMatterDaoImpl.java
...mortals/xhx/module/site/dao/ibatis/SiteMatterDaoImpl.java
+1
-1
knowledge-base/src/main/java/com/mortals/xhx/module/site/model/SiteMatterEntity.java
...a/com/mortals/xhx/module/site/model/SiteMatterEntity.java
+94
-28
knowledge-base/src/main/java/com/mortals/xhx/module/site/model/SiteMatterQuery.java
...va/com/mortals/xhx/module/site/model/SiteMatterQuery.java
+610
-104
knowledge-base/src/main/java/com/mortals/xhx/module/site/model/vo/SiteMatterVo.java
...va/com/mortals/xhx/module/site/model/vo/SiteMatterVo.java
+9
-25
knowledge-base/src/main/java/com/mortals/xhx/module/site/service/SiteMatterService.java
...om/mortals/xhx/module/site/service/SiteMatterService.java
+13
-15
knowledge-base/src/main/java/com/mortals/xhx/module/site/service/impl/SiteMatterServiceImpl.java
...s/xhx/module/site/service/impl/SiteMatterServiceImpl.java
+38
-50
knowledge-base/src/main/java/com/mortals/xhx/module/site/web/SiteMatterController.java
...com/mortals/xhx/module/site/web/SiteMatterController.java
+27
-25
knowledge-base/src/main/resources/sqlmap/module/matter/MatterDatumFileMapper.xml
.../resources/sqlmap/module/matter/MatterDatumFileMapper.xml
+139
-10
knowledge-base/src/main/resources/sqlmap/module/matter/MatterDatumMapper.xml
...main/resources/sqlmap/module/matter/MatterDatumMapper.xml
+5
-2
knowledge-base/src/main/resources/sqlmap/module/site/SiteMatterMapper.xml
...rc/main/resources/sqlmap/module/site/SiteMatterMapper.xml
+271
-69
No files found.
knowledge-base/src/main/java/com/mortals/xhx/module/error/service/impl/ErrorRecoveryServiceImpl.java
View file @
55c35bdf
...
...
@@ -38,6 +38,7 @@ public class ErrorRecoveryServiceImpl extends AbstractCRUDServiceImpl<ErrorRecov
entity
.
setAnswerUserId
(
context
.
getUser
().
getId
());
entity
.
setAnswerUserName
(
context
.
getUser
().
getRealName
());
}
entity
.
setAnswerDate
(
new
Date
());
}
super
.
updateBefore
(
entity
,
context
);
}
...
...
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/matter/model/MatterDatumFileEntity.java
View file @
55c35bdf
...
...
@@ -7,10 +7,10 @@ import com.mortals.framework.annotation.Excel;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.matter.model.vo.MatterDatumFileVo
;
/**
* 材料附件实体对象
* 材料附件
业务
实体对象
*
* @author zxfei
* @date 202
2-11-16
* @date 202
3-03-11
*/
public
class
MatterDatumFileEntity
extends
MatterDatumFileVo
{
...
...
@@ -37,17 +37,21 @@ public class MatterDatumFileEntity extends MatterDatumFileVo {
*/
private
String
fileUrl
;
/**
*
附件本地下载
地址
*
本地文件
地址
*/
private
String
localFileUrl
;
/**
* 附件类型 (
示例样表.示例样表,空白表格
.空白表格)
* 附件类型 (
1.示例样表,2
.空白表格)
*/
private
String
filetype
;
/**
* 附件来源 (0.政务网,1.自定义)
*/
private
Integer
source
;
/**
* 预览地址
*/
private
String
previewUrl
;
...
...
@@ -123,28 +127,28 @@ public class MatterDatumFileEntity extends MatterDatumFileVo {
this
.
fileUrl
=
fileUrl
;
}
/**
* 获取
附件本地下载
地址
* 获取
本地文件
地址
* @return String
*/
public
String
getLocalFileUrl
(){
return
localFileUrl
;
}
/**
* 设置
附件本地下载
地址
* 设置
本地文件
地址
* @param localFileUrl
*/
public
void
setLocalFileUrl
(
String
localFileUrl
){
this
.
localFileUrl
=
localFileUrl
;
}
/**
* 获取 附件类型 (
示例样表.示例样表,空白表格
.空白表格)
* 获取 附件类型 (
1.示例样表,2
.空白表格)
* @return String
*/
public
String
getFiletype
(){
return
filetype
;
}
/**
* 设置 附件类型 (
示例样表.示例样表,空白表格
.空白表格)
* 设置 附件类型 (
1.示例样表,2
.空白表格)
* @param filetype
*/
public
void
setFiletype
(
String
filetype
){
...
...
@@ -164,6 +168,20 @@ public class MatterDatumFileEntity extends MatterDatumFileVo {
public
void
setSource
(
Integer
source
){
this
.
source
=
source
;
}
/**
* 获取 预览地址
* @return String
*/
public
String
getPreviewUrl
(){
return
previewUrl
;
}
/**
* 设置 预览地址
* @param previewUrl
*/
public
void
setPreviewUrl
(
String
previewUrl
){
this
.
previewUrl
=
previewUrl
;
}
...
...
@@ -194,6 +212,7 @@ public class MatterDatumFileEntity extends MatterDatumFileVo {
sb
.
append
(
",localFileUrl:"
).
append
(
getLocalFileUrl
());
sb
.
append
(
",filetype:"
).
append
(
getFiletype
());
sb
.
append
(
",source:"
).
append
(
getSource
());
sb
.
append
(
",previewUrl:"
).
append
(
getPreviewUrl
());
return
sb
.
toString
();
}
...
...
@@ -211,8 +230,10 @@ public class MatterDatumFileEntity extends MatterDatumFileVo {
this
.
localFileUrl
=
""
;
this
.
filetype
=
"示例样表"
;
this
.
filetype
=
""
;
this
.
source
=
0
;
this
.
source
=
1
;
this
.
previewUrl
=
""
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/matter/model/MatterDatumFileQuery.java
View file @
55c35bdf
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/matter/service/MatterDatumService.java
View file @
55c35bdf
package
com.mortals.xhx.module.matter.service
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.matter.model.MatterDatumEntity
;
/**
...
...
@@ -11,4 +13,12 @@ import com.mortals.xhx.module.matter.model.MatterDatumEntity;
*/
public
interface
MatterDatumService
extends
ICRUDService
<
MatterDatumEntity
,
Long
>{
/**
* 添加材料到公共库
*
* @param datumIds
* @param siteId
* @param context
*/
Rest
<
String
>
addToLibrary
(
String
datumIds
,
Long
siteId
,
Context
context
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumFileServiceImpl.java
View file @
55c35bdf
package
com.mortals.xhx.module.matter.service.impl
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.xhx.common.utils.HttpDownloadUtil
;
import
com.mortals.xhx.common.utils.WordUtil
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.module.matter.dao.MatterDatumFileDao
;
...
...
@@ -6,6 +12,8 @@ import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
import
com.mortals.xhx.module.matter.service.MatterDatumFileService
;
import
javax.naming.Context
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -19,10 +27,71 @@ import java.util.Map;
@Service
(
"matterDatumFileService"
)
public
class
MatterDatumFileServiceImpl
extends
AbstractCRUDServiceImpl
<
MatterDatumFileDao
,
MatterDatumFileEntity
,
Long
>
implements
MatterDatumFileService
{
@Value
(
"${upload.path}"
)
private
String
filePath
;
public
static
String
word
[]
=
{
"doc"
,
"dot"
,
"wps"
,
"wpt"
,
"docx"
,
"dotx"
,
"docm"
,
"dotm"
};
public
static
String
imgs
[]
=
{
"jpg"
,
"png"
,
"jpeg"
,
"gif"
};
public
static
String
pdf
[]
=
{
"pdf"
};
@Override
public
void
deleteFileByDatumId
(
Long
datumId
,
Context
context
)
{
Map
<
String
,
Object
>
condition
=
new
HashMap
<>();
condition
.
put
(
"datumId"
,
datumId
);
this
.
dao
.
delete
(
condition
);
}
@Override
protected
void
saveBefore
(
MatterDatumFileEntity
entity
,
com
.
mortals
.
framework
.
model
.
Context
context
)
throws
AppException
{
this
.
validData
(
entity
,
context
);
String
rootPath
=
this
.
filePath
.
endsWith
(
"/"
)
?
this
.
filePath
:
this
.
filePath
+
"/"
;
String
prePath
=
"file/preview/"
;
String
savePath
=
entity
.
getLocalFileUrl
();
String
newName
=
genPreviewPath
(
rootPath
,
prePath
,
savePath
);
entity
.
setPreviewUrl
(
prePath
+
newName
);
}
protected
void
updateBefore
(
MatterDatumFileEntity
entity
,
com
.
mortals
.
framework
.
model
.
Context
context
)
throws
AppException
{
this
.
validData
(
entity
,
context
);
String
rootPath
=
this
.
filePath
.
endsWith
(
"/"
)
?
this
.
filePath
:
this
.
filePath
+
"/"
;
String
prePath
=
"file/preview/"
;
String
savePath
=
entity
.
getLocalFileUrl
();
String
newName
=
genPreviewPath
(
rootPath
,
prePath
,
savePath
);
entity
.
setPreviewUrl
(
prePath
+
newName
);
}
private
String
genPreviewPath
(
String
rootPath
,
String
prePath
,
String
tempPath
)
{
//生成样表预览图片
String
samplePath
=
rootPath
+
tempPath
;
String
filePath
=
rootPath
+
prePath
;
File
pathDir
=
new
File
(
filePath
);
if
(!
pathDir
.
exists
())
{
pathDir
.
mkdirs
();
}
String
newName
=
RandomUtil
.
randomNumbers
(
12
)
+
".jpg"
;
String
filePathAll
=
filePath
+
newName
;
//判断文件类型是否为doc pdf jpg png 等
String
extName
=
FileUtil
.
getSuffix
(
samplePath
);
if
(
this
.
isExsitArry
(
extName
,
word
))
{
WordUtil
.
convertWordToJPEG
(
samplePath
,
filePathAll
);
}
else
if
(
this
.
isExsitArry
(
extName
,
pdf
))
{
WordUtil
.
pdfToImages
(
samplePath
,
filePathAll
);
}
else
if
(
this
.
isExsitArry
(
extName
,
imgs
))
{
try
{
com
.
mortals
.
framework
.
util
.
FileUtil
.
copyFile
(
samplePath
,
filePathAll
);
}
catch
(
FileNotFoundException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
return
newName
;
}
public
boolean
isExsitArry
(
String
chex
,
String
arry
[])
{
for
(
String
ex
:
arry
)
{
if
(
chex
.
equalsIgnoreCase
(
ex
))
{
return
true
;
}
}
return
false
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterDatumServiceImpl.java
View file @
55c35bdf
package
com.mortals.xhx.module.matter.service.impl
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.base.system.upload.service.UploadService
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.module.matter.model.*
;
import
com.mortals.xhx.module.matter.service.MatterDatumFileService
;
import
com.mortals.xhx.module.matter.service.MatterService
;
import
com.mortals.xhx.module.site.model.*
;
import
com.mortals.xhx.module.site.service.SiteDatumLibraryService
;
import
com.mortals.xhx.module.site.service.SiteService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
...
...
@@ -13,7 +19,11 @@ import com.mortals.xhx.module.matter.dao.MatterDatumDao;
import
com.mortals.xhx.module.matter.service.MatterDatumService
;
import
org.springframework.util.ObjectUtils
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* MatterDatumService
...
...
@@ -31,6 +41,10 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
private
MatterDatumFileService
matterDatumFileService
;
@Autowired
private
UploadService
uploadService
;
@Autowired
private
SiteDatumLibraryService
siteDatumLibraryService
;
@Autowired
private
SiteService
siteService
;
@Override
...
...
@@ -83,4 +97,63 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
}
@Override
public
Rest
<
String
>
addToLibrary
(
String
datumIds
,
Long
siteId
,
Context
context
)
{
if
(
ObjectUtils
.
isEmpty
(
siteId
))
{
throw
new
AppException
(
"请选择对应站点"
);
}
List
<
Long
>
datumIdList
=
Arrays
.
asList
(
datumIds
.
split
(
","
)).
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
MatterDatumQuery
datumQuery
=
new
MatterDatumQuery
();
datumQuery
.
setIdList
(
datumIdList
);
List
<
MatterDatumEntity
>
entities
=
this
.
find
(
datumQuery
);
int
success
=
0
;
int
fail
=
0
;
List
<
SiteDatumLibraryEntity
>
addEntities
=
new
ArrayList
<>();
for
(
MatterDatumEntity
datum
:
entities
)
{
SiteDatumLibraryEntity
datumLibrary
=
updateOrSave
(
datum
,
siteId
,
context
);
//SiteMatterEntity siteMatterEntity = updateOrSave(matterEntity, siteId, context);
if
(!
ObjectUtils
.
isEmpty
(
datumLibrary
))
{
addEntities
.
add
(
datumLibrary
);
success
++;
}
else
{
fail
++;
}
}
if
(!
ObjectUtils
.
isEmpty
(
addEntities
))
{
siteDatumLibraryService
.
save
(
addEntities
,
context
);
}
String
msg
=
"当前加入材料已存在!"
;
if
(
datumIdList
.
size
()
==
1
)
{
if
(
success
>
0
)
{
msg
=
"加入材料成功!"
;
}
}
else
if
(
datumIdList
.
size
()
>
1
)
{
if
(
success
>
0
&&
fail
==
0
)
{
msg
=
String
.
format
(
"加入材料成功%d条!"
,
success
);
}
else
if
(
success
>
0
&&
fail
>
0
)
{
msg
=
String
.
format
(
"加入材料成功%d条,重复加入材料%d条!"
,
success
,
fail
);
}
else
if
(
success
==
0
&&
fail
>
0
)
{
msg
=
String
.
format
(
"重复加入材料%d条!"
,
fail
);
}
}
return
Rest
.
ok
(
msg
);
}
private
SiteDatumLibraryEntity
updateOrSave
(
MatterDatumEntity
item
,
Long
siteId
,
Context
context
)
{
SiteDatumLibraryEntity
siteDatumLibraryEntity
=
siteDatumLibraryService
.
selectOne
(
new
SiteDatumLibraryQuery
().
siteId
(
siteId
).
datumId
(
item
.
getId
()));
if
(
ObjectUtils
.
isEmpty
(
siteDatumLibraryEntity
))
{
SiteEntity
siteEntity
=
siteService
.
getCache
(
siteId
.
toString
());
SiteDatumLibraryEntity
datumLibraryEntity
=
BeanUtil
.
covert
(
item
,
SiteDatumLibraryEntity
.
class
);
datumLibraryEntity
.
setDatumId
(
item
.
getId
());
datumLibraryEntity
.
setSiteId
(
siteId
);
datumLibraryEntity
.
setSiteName
(
siteEntity
==
null
?
""
:
siteEntity
.
getSiteName
());
datumLibraryEntity
.
setCreateTime
(
new
Date
());
if
(
context
!=
null
&&
context
.
getUser
()!=
null
)
{
datumLibraryEntity
.
setCreateUserId
(
context
.
getUser
().
getId
());
}
return
datumLibraryEntity
;
}
return
null
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
View file @
55c35bdf
...
...
@@ -259,9 +259,13 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
siteMatterEntity
.
setMatterId
(
item
.
getId
());
siteMatterEntity
.
setMatterCode
(
item
.
getMatterNo
());
siteMatterEntity
.
setMatterName
(
item
.
getMatterName
());
siteMatterEntity
.
setMatterCode
(
item
.
getTcode
());
siteMatterEntity
.
setDeptCode
(
item
.
getDeptCode
());
siteMatterEntity
.
setSource
(
item
.
getSource
());
siteMatterEntity
.
setEventTypeShow
(
item
.
getEventTypeShow
());
siteMatterEntity
.
setViewsCount
(
0
l
);
siteMatterEntity
.
setIsConvert
(
0
);
siteMatterEntity
.
setUrl
(
item
.
getUrl
());
siteMatterEntity
.
setDeptName
(
deptEntity
==
null
?
""
:
deptEntity
.
getName
());
siteMatterEntity
.
setDeptId
(
deptEntity
==
null
?
-
1L
:
deptEntity
.
getId
());
siteMatterEntity
.
setCreateUserId
(
context
==
null
?
1L
:
context
.
getUser
()
==
null
?
1L
:
context
.
getUser
().
getId
());
...
...
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
View file @
55c35bdf
...
...
@@ -165,6 +165,11 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
int
code
=
VALUE_RESULT_SUCCESS
;
try
{
PageInfo
pageInfo
=
buildPageInfo
(
query
);
if
(
ObjectUtils
.
isEmpty
(
query
.
getEventTypeShowNotList
())){
ArrayList
<
String
>
notList
=
new
ArrayList
<>();
notList
.
add
(
"行政处罚"
);
query
.
setEventTypeShowNotList
(
notList
);
}
Result
<
MatterEntity
>
result
=
this
.
getService
().
findSubList
(
query
,
pageInfo
,
context
);
model
.
put
(
KEY_RESULT_DATA
,
result
.
getList
());
model
.
put
(
PAGEINFO_KEY
,
result
.
getPageInfo
());
...
...
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/matter/web/MatterDatumController.java
View file @
55c35bdf
package
com.mortals.xhx.module.matter.web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BasePhpCRUDJsonMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
...
...
@@ -11,9 +14,12 @@ import com.mortals.xhx.module.matter.model.MatterDatumFileQuery;
import
com.mortals.xhx.module.matter.service.MatterDatumFileService
;
import
com.mortals.xhx.module.matter.service.MatterDatumService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -59,4 +65,28 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
entity
.
setDatumFileList
(
matterDatumFileEntities
);
return
super
.
viewAfter
(
id
,
model
,
entity
,
context
);
}
/**
* 添加事项到站点
*/
@PostMapping
(
value
=
"addToLibrary"
)
public
String
addToLibrary
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
JSONObject
jsonObject
=
new
JSONObject
();
Map
<
String
,
Object
>
model
=
new
HashMap
<
String
,
Object
>();
String
datumIds
=
(
String
)
map
.
get
(
"datumIds"
);
Long
siteId
=
DataUtil
.
converStr2Long
(
map
.
get
(
"siteId"
).
toString
(),
0L
);
try
{
Rest
<
String
>
rest
=
this
.
service
.
addToLibrary
(
datumIds
,
siteId
,
getContext
());
jsonObject
.
put
(
KEY_RESULT_MSG
,
rest
.
getMsg
());
jsonObject
.
put
(
KEY_RESULT_DATA
,
model
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
this
.
recordSysLog
(
this
.
request
,
rest
.
getMsg
());
}
catch
(
Exception
e
)
{
log
.
error
(
"获取异常"
,
e
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
jsonObject
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
}
return
jsonObject
.
toJSONString
();
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/site/dao/SiteMatterDao.java
View file @
55c35bdf
...
...
@@ -8,8 +8,9 @@ import java.util.List;
* 站点事项 DAO接口
*
* @author zxfei
* @date 202
2-01-12
* @date 202
3-03-10
*/
public
interface
SiteMatterDao
extends
ICRUDDao
<
SiteMatterEntity
,
Long
>{
...
...
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/site/dao/ibatis/SiteMatterDaoImpl.java
View file @
55c35bdf
...
...
@@ -11,7 +11,7 @@ import java.util.List;
* 站点事项DaoImpl DAO接口
*
* @author zxfei
* @date 202
2-01-12
* @date 202
3-03-10
*/
@Repository
(
"siteMatterDao"
)
public
class
SiteMatterDaoImpl
extends
BaseCRUDDaoMybatis
<
SiteMatterEntity
,
Long
>
implements
SiteMatterDao
{
...
...
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/site/model/SiteMatterEntity.java
View file @
55c35bdf
package
com.mortals.xhx.module.site.model
;
import
com.mortals.xhx.common.code.SourceEnum
;
import
java.util.List
;
import
java.util.ArrayList
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.site.model.vo.SiteMatterVo
;
/**
* 站点事项实体对象
*
* @author zxfei
* @date 202
2-11-16
* @date 202
3-03-11
*/
public
class
SiteMatterEntity
extends
SiteMatterVo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 站点
ID
* 站点
id
*/
private
Long
siteId
;
/**
...
...
@@ -41,30 +45,42 @@ public class SiteMatterEntity extends SiteMatterVo {
*/
private
String
deptName
;
/**
*
事项类型
*
部门编码
*/
private
String
eventTypeShow
;
private
String
deptCode
;
/**
* 事项来源
*/
private
Integer
source
;
/**
*
部门编号
*
事项类型
*/
private
String
deptCode
;
private
String
eventTypeShow
;
/**
* 浏览次数
*/
private
Long
viewsCount
;
/**
* 是否生成本地附件
*/
private
Integer
isConvert
;
/**
* 事项详情链接
*/
private
String
url
;
public
SiteMatterEntity
(){}
/**
* 获取 站点
ID
* 获取 站点
id
* @return Long
*/
public
Long
getSiteId
(){
return
siteId
;
}
/**
* 设置 站点
ID
* 设置 站点
id
* @param siteId
*/
public
void
setSiteId
(
Long
siteId
){
...
...
@@ -155,25 +171,24 @@ public class SiteMatterEntity extends SiteMatterVo {
this
.
deptName
=
deptName
;
}
/**
* 获取
事项类型
* 获取
部门编码
* @return String
*/
public
String
get
EventTypeShow
(){
return
eventTypeShow
;
public
String
get
DeptCode
(){
return
deptCode
;
}
/**
* 设置
事项类型
* @param
eventTypeShow
* 设置
部门编码
* @param
deptCode
*/
public
void
set
EventTypeShow
(
String
eventTypeShow
){
this
.
eventTypeShow
=
eventTypeShow
;
public
void
set
DeptCode
(
String
deptCode
){
this
.
deptCode
=
deptCode
;
}
/**
* 获取 事项来源
* @return Integer
*/
public
Integer
getSource
(){
return
source
;
}
/**
...
...
@@ -184,18 +199,60 @@ public class SiteMatterEntity extends SiteMatterVo {
this
.
source
=
source
;
}
/**
* 获取
部门编号
* 获取
事项类型
* @return String
*/
public
String
get
DeptCode
(){
return
deptCode
;
public
String
get
EventTypeShow
(){
return
eventTypeShow
;
}
/**
* 设置
部门编号
* @param
deptCode
* 设置
事项类型
* @param
eventTypeShow
*/
public
void
setDeptCode
(
String
deptCode
){
this
.
deptCode
=
deptCode
;
public
void
setEventTypeShow
(
String
eventTypeShow
){
this
.
eventTypeShow
=
eventTypeShow
;
}
/**
* 获取 浏览次数
* @return Long
*/
public
Long
getViewsCount
(){
return
viewsCount
;
}
/**
* 设置 浏览次数
* @param viewsCount
*/
public
void
setViewsCount
(
Long
viewsCount
){
this
.
viewsCount
=
viewsCount
;
}
/**
* 获取 是否生成本地附件
* @return Integer
*/
public
Integer
getIsConvert
(){
return
isConvert
;
}
/**
* 设置 是否生成本地附件
* @param isConvert
*/
public
void
setIsConvert
(
Integer
isConvert
){
this
.
isConvert
=
isConvert
;
}
/**
* 获取 事项详情链接
* @return String
*/
public
String
getUrl
(){
return
url
;
}
/**
* 设置 事项详情链接
* @param url
*/
public
void
setUrl
(
String
url
){
this
.
url
=
url
;
}
...
...
@@ -226,9 +283,12 @@ public class SiteMatterEntity extends SiteMatterVo {
sb
.
append
(
",matterCode:"
).
append
(
getMatterCode
());
sb
.
append
(
",deptId:"
).
append
(
getDeptId
());
sb
.
append
(
",deptName:"
).
append
(
getDeptName
());
sb
.
append
(
",eventTypeShow:"
).
append
(
getEventTypeShow
());
sb
.
append
(
",source:"
).
append
(
getSource
());
sb
.
append
(
",deptCode:"
).
append
(
getDeptCode
());
sb
.
append
(
",source:"
).
append
(
getSource
());
sb
.
append
(
",eventTypeShow:"
).
append
(
getEventTypeShow
());
sb
.
append
(
",viewsCount:"
).
append
(
getViewsCount
());
sb
.
append
(
",isConvert:"
).
append
(
getIsConvert
());
sb
.
append
(
",url:"
).
append
(
getUrl
());
return
sb
.
toString
();
}
...
...
@@ -248,10 +308,16 @@ public class SiteMatterEntity extends SiteMatterVo {
this
.
deptName
=
""
;
this
.
deptCode
=
""
;
this
.
source
=
null
;
this
.
eventTypeShow
=
""
;
this
.
source
=
0
;
this
.
viewsCount
=
0L
;
this
.
deptCode
=
""
;
this
.
isConvert
=
0
;
this
.
url
=
""
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/site/model/SiteMatterQuery.java
View file @
55c35bdf
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/site/model/vo/SiteMatterVo.java
View file @
55c35bdf
package
com.mortals.xhx.module.site.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.site.model.SiteMatterEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 站点事项视图对象
*
* @author zxfei
* @date 202
2-01-12
* @date 202
3-03-10
*/
@Data
public
class
SiteMatterVo
extends
BaseEntityLong
{
/**
* 所属部门
*/
private
String
belongDept
;
/**
* 窗口到现场次数
*/
private
Integer
windowToTheSceneNum
;
/**
* 网办到现场次数
*/
private
Integer
onlineToTheSceneNum
;
/**
* 区域编码
*/
private
String
areaCode
;
/** 材料数量 */
private
Integer
datumCount
;
/** 事项类型排除列表 */
private
List
<
String
>
eventTypeShowNotList
;
public
Integer
getDatumCount
()
{
return
datumCount
;
}
public
void
setDatumCount
(
Integer
datumCount
)
{
this
.
datumCount
=
datumCount
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/site/service/SiteMatterService.java
View file @
55c35bdf
package
com.mortals.xhx.module.site.service
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.site.dao.SiteMatterDao
;
import
com.mortals.xhx.module.site.model.SiteMatterEntity
;
/**
* SiteMatterService
* <p>
* 站点事项 service接口
*
* @author zxfei
* @date 2022-01-12
*/
public
interface
SiteMatterService
extends
ICRUDService
<
SiteMatterEntity
,
Long
>
{
SiteMatterDao
getDao
();
* SiteMatterService
*
* 站点事项 service接口
*
* @author zxfei
* @date 2023-03-10
*/
public
interface
SiteMatterService
extends
ICRUDService
<
SiteMatterEntity
,
Long
>{
void
deleteBysiteIdAndSource
(
Long
siteId
,
Integer
source
,
Context
context
);
/**
* 增加浏览次数
* @param id
*/
void
addViewsCount
(
Long
id
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/site/service/impl/SiteMatterServiceImpl.java
View file @
55c35bdf
package
com.mortals.xhx.module.site.service.impl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
com.mortals.xhx.module.matter.model.MatterQuery
;
import
com.mortals.xhx.module.matter.service.MatterService
;
import
com.mortals.xhx.module.matter.model.MatterDatumEntity
;
import
com.mortals.xhx.module.matter.model.MatterDatumFileEntity
;
import
com.mortals.xhx.module.matter.model.MatterDatumFileQuery
;
import
com.mortals.xhx.module.matter.model.MatterDatumQuery
;
import
com.mortals.xhx.module.matter.service.MatterDatumService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.module.site.dao.SiteMatterDao
;
import
com.mortals.xhx.module.site.model.SiteMatterEntity
;
import
com.mortals.xhx.module.site.service.SiteMatterService
;
import
org.springframework.util.ObjectUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* SiteMatterService
* 站点事项 service实现
*
* @author zxfei
* @date 2022-01-12
*/
* SiteMatterService
* 站点事项 service实现
*
* @author zxfei
* @date 2023-03-10
*/
@Service
(
"siteMatterService"
)
public
class
SiteMatterServiceImpl
extends
AbstractCRUDServiceImpl
<
SiteMatterDao
,
SiteMatterEntity
,
Long
>
implements
SiteMatterService
{
@Autowired
private
Matter
Service
matter
Service
;
private
Matter
DatumService
matterDatum
Service
;
@Override
protected
void
findAfter
(
SiteMatterEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
SiteMatterEntity
>
list
)
throws
AppException
{
// List<Long> matterIdlist = list.parallelStream().map(item -> item.getMatterId()).collect(Collectors.toList());
//Map<Long, MatterEntity> matterEntityMap = matterService.find(new MatterQuery().idList(matterIdlist)).parallelStream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
list
.
forEach
(
item
->
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getMatterId
()))
{
MatterEntity
matterEntity
=
matterService
.
get
(
item
.
getMatterId
());
if
(!
ObjectUtils
.
isEmpty
(
matterEntity
))
{
item
.
setBelongDept
(
matterEntity
.
getBelongDept
());
item
.
setWindowToTheSceneNum
(
matterEntity
.
getWindowToTheSceneNum
());
item
.
setOnlineToTheSceneNum
(
matterEntity
.
getOnlineToTheSceneNum
());
item
.
setDeptCode
(
matterEntity
.
getDeptCode
());
item
.
setAreaCode
(
matterEntity
.
getAreaCode
());
}
list
.
stream
().
peek
(
item
->{
List
<
MatterDatumEntity
>
matterDatumFileEntities
=
matterDatumService
.
find
(
new
MatterDatumQuery
().
matterId
(
item
.
getMatterId
()));
if
(
CollectionUtils
.
isNotEmpty
(
matterDatumFileEntities
))
{
item
.
setDatumCount
(
matterDatumFileEntities
.
size
());
}
else
{
item
.
setDatumCount
(
0
);
}
});
super
.
findAfter
(
params
,
pageInfo
,
context
,
list
);
})
.
count
()
;
super
.
findAfter
(
params
,
context
,
list
);
}
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected
void
updateBefore
(
SiteMatterEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateBefore
(
entity
,
context
);
SiteMatterEntity
beforeSiteMatterEntity
=
this
.
get
(
entity
.
getId
(),
context
);
if
(!
ObjectUtils
.
isEmpty
(
beforeSiteMatterEntity
.
getDeptId
())
&&
!
beforeSiteMatterEntity
.
getDeptId
().
equals
(
entity
.
getDeptId
()))
{
//更新事项中的部门编号
MatterEntity
matterEntity
=
matterService
.
get
(
entity
.
getMatterId
(),
context
);
if
(!
ObjectUtils
.
isEmpty
(
matterEntity
))
{
matterEntity
.
setDeptCode
(
entity
.
getDeptCode
());
matterEntity
.
setDeptName
(
entity
.
getDeptName
());
matterService
.
update
(
matterEntity
,
context
);
protected
void
findAfter
(
SiteMatterEntity
params
,
Context
context
,
List
<
SiteMatterEntity
>
list
)
throws
AppException
{
list
.
stream
().
peek
(
item
->{
List
<
MatterDatumEntity
>
matterDatumFileEntities
=
matterDatumService
.
find
(
new
MatterDatumQuery
().
matterId
(
item
.
getMatterId
()));
if
(
CollectionUtils
.
isNotEmpty
(
matterDatumFileEntities
))
{
item
.
setDatumCount
(
matterDatumFileEntities
.
size
());
}
else
{
item
.
setDatumCount
(
0
);
}
}
}).
count
();
super
.
findAfter
(
params
,
context
,
list
);
}
@Override
public
void
deleteBysiteIdAndSource
(
Long
siteId
,
Integer
source
,
Context
context
)
{
Map
<
String
,
Object
>
condition
=
new
HashMap
<>();
condition
.
put
(
"siteId"
,
siteId
);
condition
.
put
(
"source"
,
source
);
this
.
dao
.
delete
(
condition
);
public
void
addViewsCount
(
Long
id
)
{
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"viewsCountIncrement"
,
1
);
Map
<
String
,
Object
>
condition
=
new
HashMap
<>();
condition
.
put
(
"id"
,
id
);
dao
.
update
(
data
,
condition
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/java/com/mortals/xhx/module/site/web/SiteMatterController.java
View file @
55c35bdf
...
...
@@ -3,49 +3,51 @@ package com.mortals.xhx.module.site.web;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BasePhpCRUDJsonMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.site.model.SiteMatterEntity
;
import
com.mortals.xhx.module.site.model.SiteMatterQuery
;
import
com.mortals.xhx.module.site.service.SiteMatterService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.
ArrayList
;
import
java.util.
HashMap
;
import
java.util.Map
;
/**
* 站点事项
*
* @author zxfei
* @date 2022-01-20
*/
*
* 站点事项
*
* @author zxfei
* @date 2023-03-10
*/
@RestController
@RequestMapping
(
"site/matter"
)
public
class
SiteMatterController
extends
BaseCRUDJsonBodyMappingController
<
SiteMatterService
,
SiteMatterEntity
,
Long
>
{
public
class
SiteMatterController
extends
BaseCRUDJsonBodyMappingController
<
SiteMatterService
,
SiteMatterEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
public
SiteMatterController
()
{
super
.
setFormClass
(
SiteMatterForm
.
class
);
super
.
setModuleDesc
(
"站点事项"
);
public
SiteMatterController
(){
super
.
setModuleDesc
(
"站点事项"
);
}
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"source"
,
paramService
.
getParamBySecondOrganize
(
"SiteMatter"
,
"source"
));
super
.
init
(
model
,
context
);
}
/**
* @param query
* @param model
* @param context
* @throws AppException
*/
@Override
protected
void
doListBefore
(
SiteMatterEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
super
.
doListBefore
(
query
,
model
,
context
);
if
(
ObjectUtils
.
isEmpty
(
query
.
getEventTypeShowNotList
())){
ArrayList
<
String
>
notList
=
new
ArrayList
<>();
notList
.
add
(
"行政处罚"
);
query
.
setEventTypeShowNotList
(
notList
);
}
Map
<
String
,
String
>
orderMap
=
new
HashMap
<>();
orderMap
.
put
(
"viewsCount"
,
"DESC"
);
query
.
setOrderCols
(
orderMap
);
super
.
doListBefore
(
query
,
model
,
context
);
}
@Override
protected
int
viewAfter
(
Long
id
,
Map
<
String
,
Object
>
model
,
SiteMatterEntity
entity
,
Context
context
)
throws
AppException
{
this
.
service
.
addViewsCount
(
id
);
return
1
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/resources/sqlmap/module/matter/MatterDatumFileMapper.xml
View file @
55c35bdf
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/resources/sqlmap/module/matter/MatterDatumMapper.xml
View file @
55c35bdf
...
...
@@ -36,14 +36,17 @@
<resultMap
type=
"MatterDatumFileEntity"
id=
"MatterDatumFileEntity-Map"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"datumId"
column=
"datumId"
/>
<result
property=
"matterCode"
column=
"matterCode"
/>
<result
property=
"materialName"
column=
"materialName"
/>
<result
property=
"fileName"
column=
"fileName"
/>
<result
property=
"fileUrl"
column=
"fileUrl"
/>
<result
property=
"localFileUrl"
column=
"localFileUrl"
/>
<result
property=
"filetype"
column=
"filetype"
/>
<result
property=
"source"
column=
"source"
/>
<result
property=
"previewUrl"
column=
"previewUrl"
/>
<result
property=
"createTime"
column=
"createTime"
/>
<result
property=
"createUserId"
column=
"createUserId"
/>
<result
property=
"updateTime"
column=
"updateTime"
/>
<result
property=
"materialName"
column=
"materialName"
/>
</resultMap>
...
...
@@ -133,7 +136,7 @@
<!-- 子表所有列 -->
<sql
id=
"_columns_sub"
>
<trim
suffixOverrides=
","
suffix=
""
>
b.id,b.datumId,b.
fileName,b.fileUrl,b.filetype,b.source
,b.createTime,b.createUserId,b.updateTime,b.materialName,
b.id,b.datumId,b.
matterCode,b.materialName,b.fileName,b.fileUrl,b.filetype,b.source,b.localFileUrl,b.previewUrl
,b.createTime,b.createUserId,b.updateTime,b.materialName,
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
...
...
This diff is collapsed.
Click to expand it.
knowledge-base/src/main/resources/sqlmap/module/site/SiteMatterMapper.xml
View file @
55c35bdf
This diff is collapsed.
Click to expand it.
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