Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_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
赵啸非
smart_gov_platform
Commits
d873402e
Commit
d873402e
authored
Mar 24, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加自定义导入
parent
4a6ee7e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
209 additions
and
10 deletions
+209
-10
base-manager/src/main/java/com/mortals/xhx/module/matter/model/vo/MatterCustomImportEntity.java
.../xhx/module/matter/model/vo/MatterCustomImportEntity.java
+72
-0
base-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
.../com/mortals/xhx/module/matter/service/MatterService.java
+5
-0
base-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
...als/xhx/module/matter/service/impl/MatterServiceImpl.java
+123
-0
base-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
...a/com/mortals/xhx/module/matter/web/MatterController.java
+9
-10
No files found.
base-manager/src/main/java/com/mortals/xhx/module/matter/model/vo/MatterCustomImportEntity.java
View file @
d873402e
package
com.mortals.xhx.module.matter.model.vo
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.matter.model.*
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.Objects
;
/**
* 自定义导入对象
*
* @author: zxfei
* @date: 2025/3/24 9:44
*/
@Data
public
class
MatterCustomImportEntity
extends
BaseEntityLong
{
/**
* 区域编码
*/
@Excel
(
name
=
"区域编码"
)
private
String
areaCode
;
/**
* 事项名称
*/
@Excel
(
name
=
"事项名称"
)
private
String
matterName
;
/**
* 部门名称
*/
@Excel
(
name
=
"部门名称"
)
private
String
deptName
;
/**
* 承诺办结时限
*/
@Excel
(
name
=
"承诺办结时限"
)
private
String
promiseTimeLimitShow
;
/**
* 事项详情链接
*/
@Excel
(
name
=
"办事指南地址"
,
type
=
Excel
.
Type
.
IMPORT
)
private
String
url
;
/**
* pc详细地址
*/
@Excel
(
name
=
"网办地址"
)
private
String
netApplyUrl
;
/**
* 备注信息
*/
@Excel
(
name
=
"流程描述"
)
private
String
flowDesc
;
/**
* 备注信息
*/
@Excel
(
name
=
"备注"
)
private
String
remark
;
/**
* 投诉电话
*/
private
String
cousultingTelephoneShow
;
/**
* 事项类型
*/
@Excel
(
name
=
"事项类型"
)
private
String
eventTypeShow
;
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
this
.
areaCode
,
this
.
getMatterName
());
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
null
)
return
false
;
if
(
obj
instanceof
MatterCustomImportEntity
)
{
MatterCustomImportEntity
tmp
=
(
MatterCustomImportEntity
)
obj
;
if
((
this
.
getAreaCode
()
+
this
.
getMatterName
()).
equals
(
tmp
.
getAreaCode
()
+
tmp
.
getMatterName
()))
{
if
(
this
.
getId
()
==
tmp
.
getId
())
{
return
true
;
}
}
}
return
false
;
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
View file @
d873402e
...
...
@@ -9,10 +9,12 @@ import com.mortals.framework.service.ICRUDService;
import
com.mortals.xhx.module.matter.dao.MatterDao
;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
com.mortals.xhx.module.matter.model.MatterQuery
;
import
com.mortals.xhx.module.matter.model.vo.MatterCustomImportEntity
;
import
com.mortals.xhx.module.matter.model.vo.MatterInfo
;
import
com.mortals.xhx.module.site.model.SiteEntity
;
import
com.mortals.xhx.module.site.model.SiteMatterEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -89,4 +91,7 @@ public interface MatterService extends ICRUDService<MatterEntity, Long> {
Rest
<
Void
>
genMatterTXT
(
MatterQuery
matterQuery
,
Context
context
);
Rest
<
String
>
doImportCustomData
(
List
<
MatterCustomImportEntity
>
list
,
Context
context
);
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
View file @
d873402e
...
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.module.matter.service.impl;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.PageUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.ReflectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.setting.Setting
;
...
...
@@ -36,6 +37,7 @@ import com.mortals.xhx.module.dept.model.DeptQuery;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.matter.dao.MatterDao
;
import
com.mortals.xhx.module.matter.model.*
;
import
com.mortals.xhx.module.matter.model.vo.MatterCustomImportEntity
;
import
com.mortals.xhx.module.matter.model.vo.MatterInfo
;
import
com.mortals.xhx.module.matter.service.*
;
import
com.mortals.xhx.module.matters.model.MattersDetailEntity
;
...
...
@@ -2056,6 +2058,127 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
}
public
Rest
<
String
>
doImportCustomData
(
List
<
MatterCustomImportEntity
>
list
,
Context
context
)
{
//内部先去重复
list
=
list
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
int
SucessCount
=
0
;
int
failCount
=
0
;
for
(
MatterCustomImportEntity
matterCustomImportEntity
:
list
)
{
if
(
ObjectUtils
.
isEmpty
(
matterCustomImportEntity
.
getAreaCode
()))
{
failCount
++;
continue
;
}
//通过判断事项区域和名称,判断是否存在 存在则不添加
MatterEntity
matterEntity
=
this
.
selectOne
(
new
MatterQuery
().
areaCode
(
matterCustomImportEntity
.
getAreaCode
()).
matterName
(
matterCustomImportEntity
.
getMatterName
()));
if
(
ObjectUtils
.
isEmpty
(
matterEntity
))
{
matterEntity
=
new
MatterEntity
();
matterEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
matterCustomImportEntity
,
matterEntity
,
BeanUtil
.
getNullPropertyNames
(
matterCustomImportEntity
));
matterEntity
.
setMatterNo
(
RandomUtil
.
randomString
(
12
));
matterEntity
.
setTid
(
"/file/fileupload/flow.jpg"
);
matterEntity
.
setCreateTime
(
new
Date
());
matterEntity
.
setCreateUserId
(
1L
);
this
.
save
(
matterEntity
);
//保存区域站点部门
DeptEntity
deptEntity
=
deptService
.
selectOne
(
new
DeptQuery
().
name
(
matterEntity
.
getDeptName
()));
if
(
ObjectUtils
.
isEmpty
(
deptEntity
))
{
deptEntity
=
new
DeptEntity
();
deptEntity
.
initAttrValue
();
deptEntity
.
setName
(
matterEntity
.
getDeptName
());
deptEntity
.
setDeptNumber
(
RandomUtil
.
randomString
(
12
));
SiteEntity
siteEntity
=
siteService
.
selectOne
(
new
SiteQuery
().
areaCode
(
matterEntity
.
getAreaCode
()));
if
(!
ObjectUtils
.
isEmpty
(
siteEntity
))
{
deptEntity
.
setSiteId
(
siteEntity
.
getId
());
}
else
{
//创建一个本级站点
siteEntity
=
new
SiteEntity
();
siteEntity
.
initAttrValue
();
siteEntity
.
setAreaCode
(
matterEntity
.
getAreaCode
());
siteEntity
.
setAreaName
(
matterEntity
.
getAreaName
());
siteEntity
.
setSiteName
(
matterEntity
.
getAreaName
());
siteEntity
.
setCreateTime
(
new
Date
());
siteEntity
.
setCreateUserId
(
1L
);
siteService
.
save
(
siteEntity
);
deptEntity
.
setSiteId
(
siteEntity
.
getId
());
}
deptEntity
.
setCreateTime
(
new
Date
());
deptEntity
.
setCreateUserId
(
1L
);
deptService
.
save
(
deptEntity
);
matterEntity
.
setDeptCode
(
deptEntity
.
getDeptNumber
());
this
.
update
(
matterEntity
);
}
//todo 固定新增办事流程
ArrayList
<
MatterFlowlimitEntity
>
matterFlowlimitEntities
=
new
ArrayList
<>();
MatterFlowlimitEntity
matterFlowlimitEntity
=
new
MatterFlowlimitEntity
();
matterFlowlimitEntity
.
setMatterId
(
matterEntity
.
getId
());
matterFlowlimitEntity
.
setMatterName
(
matterEntity
.
getMatterName
());
matterFlowlimitEntity
.
setMatterCode
(
matterEntity
.
getMatterNo
());
matterFlowlimitEntity
.
setFlowName
(
"1. 申请准备。"
);
matterFlowlimitEntity
.
setFlowDesc
(
"(1)访问对应的网上办理渠道,完成用户注册登录;\n"
+
"(2)找到企业登记一件事办理事项,了解办事指南,准备申请材料;将申请材料处理为电子版。"
);
matterFlowlimitEntity
.
setCreateTime
(
new
Date
());
matterFlowlimitEntity
.
setCreateUserId
(
1L
);
matterFlowlimitEntities
.
add
(
matterFlowlimitEntity
);
matterFlowlimitEntity
=
new
MatterFlowlimitEntity
();
matterFlowlimitEntity
.
setMatterId
(
matterEntity
.
getId
());
matterFlowlimitEntity
.
setMatterName
(
matterEntity
.
getMatterName
());
matterFlowlimitEntity
.
setMatterCode
(
matterEntity
.
getMatterNo
());
matterFlowlimitEntity
.
setFlowName
(
"2. 在线申请。"
);
matterFlowlimitEntity
.
setFlowDesc
(
"(1)自行在线申请,上传申请材料(清晰可见)。如需补正材料,按系统的补正流程进行。\n"
+
"(2)向政务大厅申请帮办代办服务。"
);
matterFlowlimitEntity
.
setCreateTime
(
new
Date
());
matterFlowlimitEntity
.
setCreateUserId
(
1L
);
matterFlowlimitEntities
.
add
(
matterFlowlimitEntity
);
matterFlowlimitEntity
=
new
MatterFlowlimitEntity
();
matterFlowlimitEntity
.
setMatterId
(
matterEntity
.
getId
());
matterFlowlimitEntity
.
setMatterName
(
matterEntity
.
getMatterName
());
matterFlowlimitEntity
.
setMatterCode
(
matterEntity
.
getMatterNo
());
matterFlowlimitEntity
.
setFlowName
(
"3. 领取结果。"
);
matterFlowlimitEntity
.
setFlowDesc
(
"(1)电子化结果。选择对应申请的网上办理渠道领取。\n"
+
"(2)纸质档结果。可选择免费快递邮寄或窗口领取。"
);
matterFlowlimitEntity
.
setCreateTime
(
new
Date
());
matterFlowlimitEntity
.
setCreateUserId
(
1L
);
matterFlowlimitEntities
.
add
(
matterFlowlimitEntity
);
matterFlowlimitService
.
save
(
matterFlowlimitEntities
);
SucessCount
++;
}
else
{
failCount
++;
}
}
return
Rest
.
ok
(
"成功:"
+
SucessCount
+
" 失败:"
+
failCount
);
}
public
static
void
main
(
String
[]
args
)
{
...
...
base-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
View file @
d873402e
...
...
@@ -343,15 +343,15 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
boolean
setnx
=
cacheService
.
setnx
(
"genMatterTxt:"
+
areaCode
,
"1"
,
60
*
20
);
if
(!
setnx
)
{
return
baseAreaEntity
.
getName
()
+
".txt 正在生成中,请稍后查看文件!"
;
return
baseAreaEntity
.
getName
()
+
".txt 正在生成中,请稍后查看文件!"
;
}
new
Thread
(()
->
{
Rest
<
Void
>
voidRest
=
this
.
service
.
genMatterTXT
(
query
,
getContext
());
cacheService
.
del
(
"genMatterTxt:"
+
areaCode
);
}).
start
();
//http://192.168.0.98:11071/home/txt/
// model.put(MESSAGE_INFO, "异步生成文件中,请稍后查看文件!,文件访问地址:http://192.168.0.98:11071" + genFilePath+"/");
//http://192.168.0.98:11071/home/txt/
// model.put(MESSAGE_INFO, "异步生成文件中,请稍后查看文件!,文件访问地址:http://192.168.0.98:11071" + genFilePath+"/");
return
"异步生成文件中,请稍后查看文件!,文件访问地址: http://192.168.0.98:11071"
+
genFilePath
;
...
...
@@ -366,9 +366,8 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
}
@PostMapping
(
"/importDataCustom"
)
@UnAuth
public
String
importDataCustom
(
MultipartFile
file
,
boolean
updateSupport
)
{
JSONObject
ret
=
new
JSONObject
();
Map
<
String
,
Object
>
model
=
new
HashMap
<>();
...
...
@@ -381,12 +380,12 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
int
code
=
VALUE_RESULT_SUCCESS
;
try
{
ExcelUtil
<
MatterCustomImportEntity
,
Long
>
util
=
new
ExcelUtil
<>(
MatterCustomImportEntity
.
class
);
doImportExcelBefore
(
excelConfData
);
List
<
MatterCustomImportEntity
>
list
=
util
.
importExcel
((
String
)
excelConfData
.
get
(
"sheetName"
),
file
.
getInputStream
(),
(
Integer
)
excelConfData
.
get
(
"headereRow"
),
(
Integer
)
excelConfData
.
get
(
"dataRow"
));
// doImportDataBefore(list, updateSupport, context);
// String message = this.service.importList(list, updateSupport, getContext());
// doImportExcelAfter(file, list, getContext());
//model.put(MESSAGE_INFO, message);
Rest
<
String
>
rest
=
this
.
service
.
doImportCustomData
(
list
,
context
);
// doImportDataBefore(list, updateSupport, context);
// String message = this.service.importList(list, updateSupport, getContext());
// doImportExcelAfter(file, list, getContext());
model
.
put
(
MESSAGE_INFO
,
rest
.
getMsg
());
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
code
=
VALUE_RESULT_FAILURE
;
...
...
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