Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
9d58b762
Commit
9d58b762
authored
Dec 12, 2024
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huych-户配置调整
parent
dea4ef0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
17 deletions
+52
-17
SysHouseHoldInfoServiceImpl.java
...yifu/social/service/impl/SysHouseHoldInfoServiceImpl.java
+52
-17
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/SysHouseHoldInfoServiceImpl.java
View file @
9d58b762
...
...
@@ -28,9 +28,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckMobile
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.Area
Map
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.Area
Vo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
...
...
@@ -129,6 +130,16 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
if
(
Common
.
isEmpty
(
sysHouseHoldInfo
.
getAuditUser
())
||
Common
.
isEmpty
(
sysHouseHoldInfo
.
getHandleUser
()))
{
return
R
.
failed
(
"审核人或办理人必填!"
);
}
//获取行政区化代码
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
sysHouseHoldInfo
.
getType
()))
{
HashMap
<
String
,
SysArea
>
map
=
initAreaMap
();
if
(
Common
.
isNotNull
(
map
)
&&
map
.
size
()
>
0
)
{
SysArea
area
=
map
.
get
(
sysHouseHoldInfo
.
getCity
());
if
(
Common
.
isNotNull
(
area
))
{
sysHouseHoldInfo
.
setAreaCode
(
area
.
getAreaCode
());
}
}
}
baseMapper
.
insert
(
sysHouseHoldInfo
);
//维护附件信息
if
(
Common
.
isNotNull
(
sysHouseHoldInfo
.
getAttaId
()))
{
...
...
@@ -225,6 +236,16 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
.
ge
(
SysBaseSetInfo:
:
getApplyEndDate
,
DateUtil
.
getCurrentDateTime
())))
>
CommonConstants
.
ZERO_INT
){
return
R
.
failed
(
"户下存在可用基数配置,请禁用可用基数配置后禁用户配置!"
);
}
//更新行政区划代码
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
hold
.
getType
())
&&
Common
.
isNotNull
(
hold
.
getCity
()))
{
HashMap
<
String
,
SysArea
>
map
=
initAreaMap
();
if
(
Common
.
isNotNull
(
map
)
&&
map
.
size
()
>
0
)
{
SysArea
area
=
map
.
get
(
hold
.
getCity
());
if
(
Common
.
isNotNull
(
area
))
{
hold
.
setAreaCode
(
area
.
getAreaCode
());
}
}
}
int
res
=
baseMapper
.
updateById
(
hold
);
if
(
res
>=
0
){
if
(
isEdit
)
{
...
...
@@ -401,11 +422,8 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
return
;
}
//获取所有区域数据
Map
<
String
,
String
>
areaMap
=
new
HashMap
<>();
R
<
AreaMap
>
areaListR
=
upmsDaprUtils
.
getAreaMapR
();
if
(
null
!=
areaListR
&&
!
Common
.
isEmpty
(
areaListR
.
getData
()))
{
areaMap
=
areaListR
.
getData
().
getIdLabelMap
();
}
else
{
HashMap
<
String
,
SysArea
>
areaMap
=
initAreaMap
();
if
(
Common
.
isEmpty
(
areaMap
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
1
,
"获取区域数据失败"
));
}
//获取所有的人员信息
...
...
@@ -433,10 +451,10 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
excel
.
setOrganName
(
excel
.
getOrganName
().
trim
());
SysHouseHoldInfo
household
=
new
SysHouseHoldInfo
();
BeanCopyUtils
.
copyProperties
(
excel
,
household
);
excel
.
setProvince
(
areaMap
.
get
(
excel
.
getProvince
()));
excel
.
setCity
(
areaMap
.
get
(
excel
.
getCity
()));
excel
.
setProvince
(
areaMap
.
get
(
excel
.
getProvince
())
.
getAreaName
()
);
excel
.
setCity
(
areaMap
.
get
(
excel
.
getCity
())
.
getAreaName
()
);
if
(
Common
.
isNotNull
(
excel
.
getTown
()))
{
excel
.
setTown
(
areaMap
.
get
(
excel
.
getTown
()));
excel
.
setTown
(
areaMap
.
get
(
excel
.
getTown
())
.
getAreaName
()
);
}
//判断模板中是否有户重复的数据
if
(
null
==
exitNameMap
.
get
(
excel
.
getName
()))
{
...
...
@@ -490,6 +508,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
continue
;
}
//封装和插入数据
household
.
setAreaCode
(
areaMap
.
get
(
household
.
getCity
()).
getAreaCode
());
household
.
setAutoStatus
(
excel
.
getAutoStatus
().
equals
(
CommonConstants
.
IS_TRUE
)
?
"0"
:
"1"
);
household
.
setType
(
"0"
);
household
.
setHouseType
(
excel
.
getHouseType
().
equals
(
HouseConfigConstants
.
HOUSE_TYPE_ONE
)
?
"0"
:
"1"
);
...
...
@@ -511,11 +530,8 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
return
;
}
//获取所有区域数据
Map
<
String
,
String
>
areaMap
=
new
HashMap
<>();
R
<
AreaMap
>
areaListR
=
upmsDaprUtils
.
getAreaMapR
();
if
(
null
!=
areaListR
&&
!
Common
.
isEmpty
(
areaListR
.
getData
()))
{
areaMap
=
areaListR
.
getData
().
getIdLabelMap
();
}
else
{
HashMap
<
String
,
SysArea
>
areaMap
=
initAreaMap
();
if
(
Common
.
isEmpty
(
areaMap
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
1
,
"获取区域数据失败"
));
}
//获取所有的人员信息
...
...
@@ -548,6 +564,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
if
(
Common
.
isNotNull
(
excel
.
getProvince
())
&&
Common
.
isNotNull
(
excel
.
getCity
()))
{
info
.
setProvince
(
excel
.
getProvince
());
info
.
setCity
(
excel
.
getCity
());
info
.
setAreaCode
(
areaMap
.
get
(
excel
.
getCity
()).
getAreaCode
());
if
(
Common
.
isNotNull
(
excel
.
getTown
()))
{
info
.
setTown
(
excel
.
getTown
());
}
else
{
...
...
@@ -555,13 +572,13 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
}
}
if
(
Common
.
isNotNull
(
excel
.
getProvince
()))
{
excel
.
setProvince
(
areaMap
.
get
(
excel
.
getProvince
()));
excel
.
setProvince
(
areaMap
.
get
(
excel
.
getProvince
())
.
getAreaName
()
);
}
if
(
Common
.
isNotNull
(
excel
.
getCity
()))
{
excel
.
setCity
(
areaMap
.
get
(
excel
.
getCity
()));
excel
.
setCity
(
areaMap
.
get
(
excel
.
getCity
())
.
getAreaName
()
);
}
if
(
Common
.
isNotNull
(
excel
.
getTown
()))
{
excel
.
setTown
(
areaMap
.
get
(
excel
.
getTown
()));
excel
.
setTown
(
areaMap
.
get
(
excel
.
getTown
())
.
getAreaName
()
);
}
if
(
Common
.
isEmpty
(
info
)){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
HouseConfigConstants
.
ERROR_NOT_EXIT
,
excel
));
...
...
@@ -696,4 +713,22 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
}
baseMapper
.
updateById
(
info
);
}
//获取所有区域数据
private
HashMap
<
String
,
SysArea
>
initAreaMap
()
{
HashMap
<
String
,
SysArea
>
areaMap
=
new
HashMap
<>();
R
<
AreaVo
>
areaListR
=
upmsDaprUtils
.
getAreaListR
();
if
(
null
==
areaListR
||
areaListR
.
getCode
()
!=
CommonConstants
.
SUCCESS
)
{
return
new
HashMap
<>();
}
AreaVo
areaList
=
areaListR
.
getData
();
if
(
null
!=
areaList
&&
!
areaList
.
getSysAreaList
().
isEmpty
())
{
for
(
SysArea
area
:
areaList
.
getSysAreaList
())
{
areaMap
.
put
(
Integer
.
toString
(
area
.
getId
()),
area
);
}
}
else
{
return
new
HashMap
<>();
}
return
areaMap
;
}
}
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