Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
data_management_system
Project
Project
Details
Activity
Releases
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
张伯涛
data_management_system
Commits
e544abbf
Commit
e544abbf
authored
Dec 07, 2022
by
gaoyingwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 方舱导入
parent
82e29673
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
9 deletions
+71
-9
FcryController.java
.../java/com/ruoyi/web/controller/system/FcryController.java
+3
-2
FcryVo.java
...stem/src/main/java/com/ruoyi/system/domain/vo/FcryVo.java
+38
-0
IFcryService.java
.../src/main/java/com/ruoyi/system/service/IFcryService.java
+2
-1
FcryServiceImpl.java
...n/java/com/ruoyi/system/service/impl/FcryServiceImpl.java
+28
-6
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/FcryController.java
View file @
e544abbf
...
@@ -13,6 +13,7 @@ import com.ruoyi.common.utils.SecurityUtils;
...
@@ -13,6 +13,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.domain.FcryDTO
;
import
com.ruoyi.system.domain.FcryDTO
;
import
com.ruoyi.system.domain.Fkqk
;
import
com.ruoyi.system.domain.Fkqk
;
import
com.ruoyi.system.domain.vo.FcryVo
;
import
com.ruoyi.system.mapper.SysUserMapper
;
import
com.ruoyi.system.mapper.SysUserMapper
;
import
com.ruoyi.system.service.impl.FkqkServiceImpl
;
import
com.ruoyi.system.service.impl.FkqkServiceImpl
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
...
@@ -239,8 +240,8 @@ public class FcryController extends BaseController
...
@@ -239,8 +240,8 @@ public class FcryController extends BaseController
@PostMapping
(
"/import"
)
@PostMapping
(
"/import"
)
public
void
importResidential
(
MultipartFile
file
,
HttpServletResponse
response
)
throws
Exception
public
void
importResidential
(
MultipartFile
file
,
HttpServletResponse
response
)
throws
Exception
{
{
ExcelUtil
<
Fcry
>
util
=
new
ExcelUtil
<
Fcry
>(
Fcry
.
class
);
ExcelUtil
<
Fcry
Vo
>
util
=
new
ExcelUtil
<
FcryVo
>(
FcryVo
.
class
);
List
<
Fcry
>
residentialList
=
util
.
importExcel
(
file
.
getInputStream
());
List
<
Fcry
Vo
>
residentialList
=
util
.
importExcel
(
file
.
getInputStream
());
String
operName
=
getUsername
();
String
operName
=
getUsername
();
fcryService
.
importUser
(
residentialList
,
operName
,
response
);
fcryService
.
importUser
(
residentialList
,
operName
,
response
);
}
}
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/FcryVo.java
0 → 100644
View file @
e544abbf
package
com
.
ruoyi
.
system
.
domain
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ruoyi.common.annotation.Excel
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
com.ruoyi.system.domain.Fcry
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.apache.poi.ss.usermodel.IndexedColors
;
import
org.springframework.data.annotation.Transient
;
import
java.util.Date
;
import
java.util.List
;
/**
* 方舱人员对象 fcry
*
* @author ruoyi
* @date 2022-11-28
*/
public
class
FcryVo
extends
Fcry
{
private
static
final
long
serialVersionUID
=
1L
;
//错误提示
@Transient
@Excel
(
name
=
"错误提示"
,
type
=
Excel
.
Type
.
EXPORT
,
color
=
IndexedColors
.
RED
)
private
String
failure
;
public
String
getFailure
()
{
return
failure
;
}
public
void
setFailure
(
String
failure
)
{
this
.
failure
=
failure
;
}
}
ruoyi-system/src/main/java/com/ruoyi/system/service/IFcryService.java
View file @
e544abbf
...
@@ -3,6 +3,7 @@ package com.ruoyi.system.service;
...
@@ -3,6 +3,7 @@ package com.ruoyi.system.service;
import
java.util.List
;
import
java.util.List
;
import
com.ruoyi.system.domain.Fcry
;
import
com.ruoyi.system.domain.Fcry
;
import
com.ruoyi.system.domain.FcryDTO
;
import
com.ruoyi.system.domain.FcryDTO
;
import
com.ruoyi.system.domain.vo.FcryVo
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -69,5 +70,5 @@ public interface IFcryService
...
@@ -69,5 +70,5 @@ public interface IFcryService
*/
*/
public
int
deleteFcryById
(
Long
id
);
public
int
deleteFcryById
(
Long
id
);
void
importUser
(
List
<
Fcry
>
residentialList
,
String
operName
,
HttpServletResponse
response
);
void
importUser
(
List
<
Fcry
Vo
>
residentialList
,
String
operName
,
HttpServletResponse
response
);
}
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FcryServiceImpl.java
View file @
e544abbf
...
@@ -9,6 +9,7 @@ import com.ruoyi.common.exception.ServiceException;
...
@@ -9,6 +9,7 @@ import com.ruoyi.common.exception.ServiceException;
import
com.ruoyi.common.utils.*
;
import
com.ruoyi.common.utils.*
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.system.domain.*
;
import
com.ruoyi.system.domain.*
;
import
com.ruoyi.system.domain.vo.FcryVo
;
import
com.ruoyi.system.mapper.SysDictDataMapper
;
import
com.ruoyi.system.mapper.SysDictDataMapper
;
import
com.ruoyi.system.mapper.SysUserMapper
;
import
com.ruoyi.system.mapper.SysUserMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -144,15 +145,15 @@ public class FcryServiceImpl implements IFcryService
...
@@ -144,15 +145,15 @@ public class FcryServiceImpl implements IFcryService
}
}
@Override
@Override
public
void
importUser
(
List
<
Fcry
>
residentialList
,
String
operName
,
HttpServletResponse
response
)
{
public
void
importUser
(
List
<
Fcry
Vo
>
residentialList
,
String
operName
,
HttpServletResponse
response
)
{
if
(
StringUtils
.
isNull
(
residentialList
)
||
residentialList
.
size
()
==
0
)
if
(
StringUtils
.
isNull
(
residentialList
)
||
residentialList
.
size
()
==
0
)
{
{
throw
new
ServiceException
(
"导入方舱人员管理数据不能为空!"
);
throw
new
ServiceException
(
"导入方舱人员管理数据不能为空!"
);
}
}
List
<
Fcry
>
trueList
=
new
ArrayList
<>();
List
<
Fcry
>
trueList
=
new
ArrayList
<>();
List
<
Fcry
>
failureList
=
new
ArrayList
<>();
List
<
Fcry
Vo
>
failureList
=
new
ArrayList
<>();
List
<
Fcry
>
updateList
=
new
ArrayList
<>();
List
<
Fcry
>
updateList
=
new
ArrayList
<>();
for
(
Fcry
fcry
:
residentialList
){
for
(
Fcry
Vo
fcry
:
residentialList
){
if
(
StringUtils
.
isNotEmpty
(
fcry
.
getFcPlace
())
if
(
StringUtils
.
isNotEmpty
(
fcry
.
getFcPlace
())
&&
StringUtils
.
isNotEmpty
(
fcry
.
getJzName
())
&&
StringUtils
.
isNotEmpty
(
fcry
.
getCardNo
())
&&
StringUtils
.
isNotEmpty
(
fcry
.
getJzName
())
&&
StringUtils
.
isNotEmpty
(
fcry
.
getCardNo
())
&&
StringUtils
.
isNotEmpty
(
fcry
.
getPhone
())
&&
StringUtils
.
isNotEmpty
(
fcry
.
getArea
())
&&
StringUtils
.
isNotEmpty
(
fcry
.
getPhone
())
&&
StringUtils
.
isNotEmpty
(
fcry
.
getArea
())
...
@@ -169,6 +170,7 @@ public class FcryServiceImpl implements IFcryService
...
@@ -169,6 +170,7 @@ public class FcryServiceImpl implements IFcryService
if
(!
values
.
isEmpty
())
if
(!
values
.
isEmpty
())
communityValue
=
values
.
get
(
0
);
communityValue
=
values
.
get
(
0
);
else
{
else
{
fcry
.
setFailure
(
"小区不存在"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
continue
;
continue
;
}
}
...
@@ -180,6 +182,7 @@ public class FcryServiceImpl implements IFcryService
...
@@ -180,6 +182,7 @@ public class FcryServiceImpl implements IFcryService
if
(!
values
.
isEmpty
())
if
(!
values
.
isEmpty
())
committeeValue
=
values
.
get
(
0
);
committeeValue
=
values
.
get
(
0
);
else
{
else
{
fcry
.
setFailure
(
"居委会不存在"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
continue
;
continue
;
}
}
...
@@ -191,6 +194,7 @@ public class FcryServiceImpl implements IFcryService
...
@@ -191,6 +194,7 @@ public class FcryServiceImpl implements IFcryService
if
(!
values
.
isEmpty
())
if
(!
values
.
isEmpty
())
streetValue
=
values
.
get
(
0
);
streetValue
=
values
.
get
(
0
);
else
{
else
{
fcry
.
setFailure
(
"街道不存在"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
continue
;
continue
;
}
}
...
@@ -202,6 +206,7 @@ public class FcryServiceImpl implements IFcryService
...
@@ -202,6 +206,7 @@ public class FcryServiceImpl implements IFcryService
if
(!
values
.
isEmpty
())
if
(!
values
.
isEmpty
())
areaValue
=
values
.
get
(
0
);
areaValue
=
values
.
get
(
0
);
else
{
else
{
fcry
.
setFailure
(
"居住地所在区不存在"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
continue
;
continue
;
}
}
...
@@ -213,12 +218,14 @@ public class FcryServiceImpl implements IFcryService
...
@@ -213,12 +218,14 @@ public class FcryServiceImpl implements IFcryService
if
(!
values
.
isEmpty
())
if
(!
values
.
isEmpty
())
fcValue
=
values
.
get
(
0
);
fcValue
=
values
.
get
(
0
);
else
{
else
{
fcry
.
setFailure
(
"方舱不存在"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
continue
;
continue
;
}
}
}
}
if
((
StringUtils
.
isNotEmpty
(
fcry
.
getCommunity
())&&
StringUtils
.
isEmpty
(
fcry
.
getCommittee
()))||
if
((
StringUtils
.
isNotEmpty
(
fcry
.
getCommunity
())&&
StringUtils
.
isEmpty
(
fcry
.
getCommittee
()))||
(
StringUtils
.
isNotEmpty
(
fcry
.
getCommittee
())&&
StringUtils
.
isEmpty
(
fcry
.
getStreet
()))){
(
StringUtils
.
isNotEmpty
(
fcry
.
getCommittee
())&&
StringUtils
.
isEmpty
(
fcry
.
getStreet
()))){
fcry
.
setFailure
(
"街道或居委会不存在"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
continue
;
continue
;
}
}
...
@@ -233,10 +240,12 @@ public class FcryServiceImpl implements IFcryService
...
@@ -233,10 +240,12 @@ public class FcryServiceImpl implements IFcryService
}
}
else
{
else
{
fcrys
=
residentialList
.
stream
().
filter
(
l
->
fcry
.
getCardNo
().
equals
(
l
.
getCardNo
())).
collect
(
Collectors
.
toList
());
fcrys
=
residentialList
.
stream
().
filter
(
l
->
fcry
.
getCardNo
().
equals
(
l
.
getCardNo
())).
collect
(
Collectors
.
toList
());
if
(
fcrys
.
size
()>
1
)
if
(
fcrys
.
size
()>
1
)
{
fcry
.
setFailure
(
"存在重复数据"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
else
{
}
else
{
if
(!
CheckUtils
.
checkPhone
(
fcry
.
getPhone
()))
{
if
(!
CheckUtils
.
checkPhone
(
fcry
.
getPhone
()))
{
fcry
.
setFailure
(
"联系方式格式不正确"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
}
else
{
}
else
{
if
(
CheckUtils
.
checkCard
(
fcry
.
getCardNo
())){
if
(
CheckUtils
.
checkCard
(
fcry
.
getCardNo
())){
...
@@ -250,12 +259,25 @@ public class FcryServiceImpl implements IFcryService
...
@@ -250,12 +259,25 @@ public class FcryServiceImpl implements IFcryService
}
}
else
{
else
{
fcry
.
setCheckCard
(
"不正确"
);
fcry
.
setCheckCard
(
"不正确"
);
fcry
.
setFailure
(
"身份证格式不正确"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
}
}
}
}
}
}
}
}
}
else
{
}
else
{
if
(
StringUtils
.
isEmpty
(
fcry
.
getFcPlace
()))
fcry
.
setFailure
(
"方舱名称不能为空"
);
else
if
(
StringUtils
.
isEmpty
(
fcry
.
getJzName
()))
fcry
.
setFailure
(
"居住人姓名不能为空"
);
else
if
(
StringUtils
.
isEmpty
(
fcry
.
getCardNo
()))
fcry
.
setFailure
(
"身份证号码不能为空"
);
else
if
(
StringUtils
.
isEmpty
(
fcry
.
getPhone
()))
fcry
.
setFailure
(
"联系方式不能为空"
);
else
if
(
StringUtils
.
isEmpty
(
fcry
.
getArea
()))
fcry
.
setFailure
(
"居住地所在区不能为空"
);
else
if
(
fcry
.
getZrTime
()
==
null
)
fcry
.
setFailure
(
"转入时间不能为空"
);
failureList
.
add
(
fcry
);
failureList
.
add
(
fcry
);
}
}
}
}
...
@@ -276,7 +298,7 @@ public class FcryServiceImpl implements IFcryService
...
@@ -276,7 +298,7 @@ public class FcryServiceImpl implements IFcryService
fcryMapper
.
insertBatchFcry
(
trueList
);
fcryMapper
.
insertBatchFcry
(
trueList
);
}
}
if
(!
failureList
.
isEmpty
())
{
if
(!
failureList
.
isEmpty
())
{
ExcelUtil
<
Fcry
>
util
=
new
ExcelUtil
<
Fcry
>(
Fcry
.
class
);
ExcelUtil
<
Fcry
Vo
>
util
=
new
ExcelUtil
<
FcryVo
>(
FcryVo
.
class
);
util
.
exportExcel
(
response
,
failureList
,
"方舱人员管理数据"
);
util
.
exportExcel
(
response
,
failureList
,
"方舱人员管理数据"
);
}
}
}
}
...
...
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