Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nnjcy-data-model
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
梁家彪
nnjcy-data-model
Commits
725709bd
Commit
725709bd
authored
Jan 12, 2024
by
wqc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
青秀模型导出
parent
4c4686b4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
191 additions
and
8 deletions
+191
-8
model-server/src/main/java/com.zq.model/controller/FfzdController.java
+32
-0
model-server/src/main/java/com.zq.model/entity/CityManageEnforceLaw.java
+3
-0
model-server/src/main/java/com.zq.model/entity/NonLitigationForceCase.java
+46
-0
model-server/src/main/java/com.zq.model/mapper/FsxzqzzxCaseDao.java
+11
-0
model-server/src/main/java/com.zq.model/service/FfzdService.java
+78
-8
sys-server/src/main/java/com/zq/system/utils/FileUtil.java
+21
-0
No files found.
model-server/src/main/java/com.zq.model/controller/FfzdController.java
View file @
725709bd
package
com
.
zq
.
model
.
controller
;
package
com
.
zq
.
model
.
controller
;
import
com.zq.common.annotation.AnonymousAccess
;
import
com.zq.common.utils.AssertUtils
;
import
com.zq.common.utils.AssertUtils
;
import
com.zq.common.vo.ResultVo
;
import
com.zq.common.vo.ResultVo
;
import
com.zq.model.service.FfzdService
;
import
com.zq.model.service.FfzdService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -10,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -10,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
@RestController
@RestController
@RequestMapping
(
"/model/ffzd"
)
@RequestMapping
(
"/model/ffzd"
)
...
@@ -19,6 +22,8 @@ public class FfzdController {
...
@@ -19,6 +22,8 @@ public class FfzdController {
private
FfzdService
ffzdService
;
private
FfzdService
ffzdService
;
@PostMapping
(
"/uploadFile"
)
@PostMapping
(
"/uploadFile"
)
@ApiOperation
(
"上传解析公示表"
)
@AnonymousAccess
public
ResultVo
uploadFile
(
@RequestParam
(
"file"
)
MultipartFile
[]
multipartFiles
)
{
public
ResultVo
uploadFile
(
@RequestParam
(
"file"
)
MultipartFile
[]
multipartFiles
)
{
AssertUtils
.
notNull
(
multipartFiles
,
"文件不能为空!"
);
AssertUtils
.
notNull
(
multipartFiles
,
"文件不能为空!"
);
try
{
try
{
...
@@ -28,4 +33,31 @@ public class FfzdController {
...
@@ -28,4 +33,31 @@ public class FfzdController {
return
ResultVo
.
fail
(
500
,
"文件解析失败"
);
return
ResultVo
.
fail
(
500
,
"文件解析失败"
);
}
}
}
}
@PostMapping
(
"/analyFile"
)
@ApiOperation
(
"上传解析非诉行政强制执行案件"
)
@AnonymousAccess
public
ResultVo
analyFile
(
@RequestParam
(
"file"
)
MultipartFile
[]
multipartFiles
)
{
AssertUtils
.
notNull
(
multipartFiles
,
"文件不能为空!"
);
try
{
return
ResultVo
.
success
(
ffzdService
.
analyFile
(
multipartFiles
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResultVo
.
fail
(
500
,
"文件解析失败"
);
}
}
@PostMapping
(
"/queryData"
)
@ApiOperation
(
"数据碰撞"
)
public
ResultVo
queryData
(){
return
ResultVo
.
success
(
ffzdService
.
queryData
());
}
@PostMapping
(
"/downloadData"
)
@ApiOperation
(
"导出数据表"
)
public
ResultVo
downloadData
(
HttpServletResponse
response
){
return
ResultVo
.
success
(
ffzdService
.
downloadData
(
response
));
}
}
}
model-server/src/main/java/com.zq.model/entity/CityManageEnforceLaw.java
View file @
725709bd
...
@@ -24,6 +24,9 @@ public class CityManageEnforceLaw {
...
@@ -24,6 +24,9 @@ public class CityManageEnforceLaw {
@TableId
(
type
=
IdType
.
AUTO
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Integer
id
;
@ApiModelProperty
(
"xuhao"
)
private
String
xuhao
;
@ApiModelProperty
(
"ajlb"
)
@ApiModelProperty
(
"ajlb"
)
private
String
cfjg
;
private
String
cfjg
;
...
...
model-server/src/main/java/com.zq.model/entity/NonLitigationForceCase.java
0 → 100644
View file @
725709bd
package
com
.
zq
.
model
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName
(
value
=
"non_litigation_force_case"
)
public
class
NonLitigationForceCase
{
/**
* id
*/
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"xuhao"
)
private
String
xuhao
;
@ApiModelProperty
(
"caseNo"
)
private
String
caseNo
;
@ApiModelProperty
(
"caseName"
)
private
String
caseName
;
@ApiModelProperty
(
"standDate"
)
private
String
standDate
;
@ApiModelProperty
(
"ruleResult"
)
private
String
ruleResult
;
private
Date
createTime
;
}
model-server/src/main/java/com.zq.model/mapper/FsxzqzzxCaseDao.java
0 → 100644
View file @
725709bd
package
com
.
zq
.
model
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zq.model.entity.CityManageEnforceLaw
;
import
com.zq.model.entity.NonLitigationForceCase
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
FsxzqzzxCaseDao
extends
BaseMapper
<
NonLitigationForceCase
>
{
}
model-server/src/main/java/com.zq.model/service/FfzdService.java
View file @
725709bd
...
@@ -5,15 +5,23 @@ import cn.hutool.core.convert.Convert;
...
@@ -5,15 +5,23 @@ import cn.hutool.core.convert.Convert;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.poi.excel.ExcelReader
;
import
cn.hutool.poi.excel.ExcelReader
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.zq.common.exception.BusinessException
;
import
com.zq.common.exception.BusinessException
;
import
com.zq.model.entity.CityManageEnforceLaw
;
import
com.zq.model.entity.CityManageEnforceLaw
;
import
com.zq.model.entity.NonLitigationForceCase
;
import
com.zq.model.mapper.CgzfInfoDao
;
import
com.zq.model.mapper.CgzfInfoDao
;
import
com.zq.model.mapper.FsxzqzzxCaseDao
;
import
com.zq.system.utils.FileUtil
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Service
public
class
FfzdService
{
public
class
FfzdService
{
...
@@ -21,6 +29,9 @@ public class FfzdService {
...
@@ -21,6 +29,9 @@ public class FfzdService {
@Resource
@Resource
private
CgzfInfoDao
cgzfInfoDao
;
private
CgzfInfoDao
cgzfInfoDao
;
@Resource
private
FsxzqzzxCaseDao
fsxzqzzxCaseDao
;
public
Object
uploadFile
(
MultipartFile
[]
multipartFiles
)
{
public
Object
uploadFile
(
MultipartFile
[]
multipartFiles
)
{
for
(
MultipartFile
file
:
multipartFiles
)
{
for
(
MultipartFile
file
:
multipartFiles
)
{
ExcelReader
reader
;
ExcelReader
reader
;
...
@@ -31,10 +42,11 @@ public class FfzdService {
...
@@ -31,10 +42,11 @@ public class FfzdService {
throw
new
BusinessException
(
"文件解析失败"
);
throw
new
BusinessException
(
"文件解析失败"
);
}
}
CityManageEnforceLaw
enforceLaw
=
new
CityManageEnforceLaw
();
CityManageEnforceLaw
enforceLaw
=
new
CityManageEnforceLaw
();
List
<
List
<
Object
>>
readList
=
reader
.
read
(
1
);
List
<
List
<
Object
>>
readList
=
reader
.
read
(
2
);
for
(
List
<
Object
>
objectList
:
readList
)
{
for
(
List
<
Object
>
objectList
:
readList
)
{
int
index
=
0
;
int
index
=
0
;
enforceLaw
.
setCfjg
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
)));
enforceLaw
.
setXuhao
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
)));
enforceLaw
.
setCfjg
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
enforceLaw
.
setAjlb
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
enforceLaw
.
setAjlb
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
enforceLaw
.
setCfzl
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
enforceLaw
.
setCfzl
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
enforceLaw
.
setXzxdrmc
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
enforceLaw
.
setXzxdrmc
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
...
@@ -50,16 +62,74 @@ public class FfzdService {
...
@@ -50,16 +62,74 @@ public class FfzdService {
enforceLaw
.
setCreateTime
(
DateUtil
.
date
());
enforceLaw
.
setCreateTime
(
DateUtil
.
date
());
cgzfInfoDao
.
insert
(
enforceLaw
);
cgzfInfoDao
.
insert
(
enforceLaw
);
}
}
}
}
return
null
;
List
<
CityManageEnforceLaw
>
enforceLaws
=
cgzfInfoDao
.
selectList
(
new
LambdaQueryWrapper
<
CityManageEnforceLaw
>());
return
enforceLaws
;
}
}
public
Object
analyFile
(
MultipartFile
[]
multipartFiles
)
{
for
(
MultipartFile
file
:
multipartFiles
)
{
ExcelReader
reader
;
try
{
reader
=
ExcelUtil
.
getReader
(
file
.
getInputStream
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
BusinessException
(
"文件解析失败"
);
}
NonLitigationForceCase
aCase
=
new
NonLitigationForceCase
();
List
<
List
<
Object
>>
readList
=
reader
.
read
(
2
);
for
(
List
<
Object
>
objectList
:
readList
)
{
int
index
=
1
;
aCase
.
setXuhao
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
)));
aCase
.
setCaseNo
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
aCase
.
setCaseName
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
aCase
.
setStandDate
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
aCase
.
setRuleResult
(
Convert
.
toStr
(
CollUtil
.
get
(
objectList
,
index
++)));
aCase
.
setCreateTime
(
DateUtil
.
date
());
fsxzqzzxCaseDao
.
insert
(
aCase
);
}
}
List
<
NonLitigationForceCase
>
caseList
=
fsxzqzzxCaseDao
.
selectList
(
new
LambdaQueryWrapper
<
NonLitigationForceCase
>());
return
caseList
;
}
public
List
<
NonLitigationForceCase
>
queryData
()
{
List
<
NonLitigationForceCase
>
caseList
=
fsxzqzzxCaseDao
.
selectList
(
new
LambdaQueryWrapper
<
NonLitigationForceCase
>());
String
caseName
=
null
;
for
(
NonLitigationForceCase
forceCase
:
caseList
)
{
caseName
=
forceCase
.
getCaseName
();
List
<
CityManageEnforceLaw
>
lawList
=
cgzfInfoDao
.
selectList
(
new
LambdaQueryWrapper
<
CityManageEnforceLaw
>());
String
xzxdrlb
=
null
;
for
(
CityManageEnforceLaw
law
:
lawList
)
{
xzxdrlb
=
law
.
getXzxdrlb
();
if
(
caseName
.
contains
(
xzxdrlb
))
{
LambdaQueryWrapper
<
NonLitigationForceCase
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
like
(
NonLitigationForceCase:
:
getCaseName
,
xzxdrlb
);
List
<
NonLitigationForceCase
>
forceCases
=
fsxzqzzxCaseDao
.
selectList
(
wrapper
);
return
forceCases
;
}
}
}
return
null
;
}
public
Object
downloadData
(
HttpServletResponse
response
)
{
List
<
NonLitigationForceCase
>
caseList
=
queryData
();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
for
(
NonLitigationForceCase
cases
:
caseList
)
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"案号"
,
cases
.
getCaseNo
());
map
.
put
(
"案件名称"
,
cases
.
getCaseName
());
map
.
put
(
"立案日期"
,
cases
.
getStandDate
());
map
.
put
(
"裁定结果"
,
cases
.
getRuleResult
());
list
.
add
(
map
);
}
try
{
FileUtil
.
downloadNameExcel
(
list
,
response
,
"怠于申请强制执行线索数据"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
}
sys-server/src/main/java/com/zq/system/utils/FileUtil.java
View file @
725709bd
...
@@ -176,6 +176,27 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
...
@@ -176,6 +176,27 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
IoUtil
.
close
(
out
);
IoUtil
.
close
(
out
);
}
}
/**
* 导出excel
*/
public
static
void
downloadNameExcel
(
List
<
Map
<
String
,
Object
>>
list
,
HttpServletResponse
response
,
String
fileName
)
throws
IOException
{
String
tempPath
=
fileName
+
".xlsx"
;
File
file
=
new
File
(
tempPath
);
BigExcelWriter
writer
=
ExcelUtil
.
getBigWriter
(
file
);
// 一次性写出内容,使用默认样式,强制输出标题
writer
.
write
(
list
,
true
);
//response为HttpServletResponse对象
response
.
setContentType
(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
);
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename=file.xlsx"
);
ServletOutputStream
out
=
response
.
getOutputStream
();
// 终止后删除临时文件
file
.
deleteOnExit
();
writer
.
flush
(
out
,
true
);
//此处记得关闭输出Servlet流
IoUtil
.
close
(
out
);
}
public
static
String
getFileType
(
String
type
)
{
public
static
String
getFileType
(
String
type
)
{
String
documents
=
"txt doc pdf ppt pps xlsx xls docx"
;
String
documents
=
"txt doc pdf ppt pps xlsx xls docx"
;
String
music
=
"mp3 wav wma mpa ram ra aac aif m4a"
;
String
music
=
"mp3 wav wma mpa ram ra aac aif m4a"
;
...
...
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