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
e7c8b6d1
Commit
e7c8b6d1
authored
Jul 06, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
事务
parent
a5e4688e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
37 deletions
+80
-37
EmployeeConstants.java
...ud/plus/v1/yifu/archives/constants/EmployeeConstants.java
+4
-0
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+53
-37
ExcelUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
+6
-0
AreaController.java
...u.cloud.plus.v1/yifu/admin/controller/AreaController.java
+17
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/constants/EmployeeConstants.java
View file @
e7c8b6d1
...
...
@@ -24,6 +24,10 @@ public class EmployeeConstants {
public
static
final
String
MAJOR
=
"专业必填"
;
public
static
final
String
ADMISSION_DATE
=
"入学时间必填"
;
public
static
final
String
GRADUTION_DATE
=
"毕业时间必填"
;
public
static
final
String
ID_ROVINCE_MUST
=
"更新户籍市,户籍省必填"
;
public
static
final
String
ID_CITY_MUST
=
"更新户籍县,户籍市必填"
;
public
static
final
String
FILE_ROVINCE_MUST
=
"更新档案市,档案省必填"
;
public
static
final
String
FILE_CITY_MUST
=
"更新档案县,档案市必填"
;
/**
* 无数据可更新
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
e7c8b6d1
...
...
@@ -825,22 +825,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
// 调用区域服务,渲染区域值
R
<
Map
<
String
,
Map
<
String
,
String
>>>
areaR
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
,
"/area/inner/getAreaToName"
,
null
,
Map
.
class
,
SecurityConstants
.
FROM_IN
);
Map
<
String
,
Map
<
String
,
String
>>
areaMapR
;
Map
<
String
,
String
>
areaMap
;
if
(
areaR
==
null
||
Common
.
isEmpty
(
areaR
.
getData
()))
{
return
R
.
failed
(
"获取区域失败!"
);
}
else
{
areaMapR
=
areaR
.
getData
();
areaMap
=
areaMapR
.
get
(
"data"
);
if
(
areaMap
==
null
)
{
return
R
.
failed
(
"获取区域失败!!"
);
}
}
/*R<Map<String, Map<String, String>>> areaR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/area/inner/getAreaToName", null, Map.class, SecurityConstants.FROM_IN);*/
TEmployeeInfo
checkPhone
;
List
<
TEmployeeInfo
>
phoneEmpList
;
String
areaStr
;
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
// 已有验证报错直接下一个
...
...
@@ -967,46 +957,52 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
// 户籍所在地
if
(
Common
.
isNotNull
(
excel
.
getIdProvince
()))
{
if
(
areaMap
.
get
(
excel
.
getIdProvince
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getIdProvince
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setIdProvince
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getIdProvince
())
));
saveEmp
.
setIdProvince
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getIdCity
()))
{
if
(
areaMap
.
get
(
excel
.
getIdCity
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getIdCity
()
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getIdProvince
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setIdCity
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getIdCity
())
));
saveEmp
.
setIdCity
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getIdTown
()))
{
if
(
areaMap
.
get
(
excel
.
getIdTown
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getIdTown
()
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getIdCity
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setIdTown
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getIdTown
())
));
saveEmp
.
setIdTown
(
Integer
.
parseInt
(
area
Str
));
}
}
// 档案所在地
if
(
Common
.
isNotNull
(
excel
.
getFileProvince
()))
{
if
(
areaMap
.
get
(
excel
.
getFileProvince
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getFileProvince
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setFileProvince
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getFileProvince
())
));
saveEmp
.
setFileProvince
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getFileCity
()))
{
if
(
areaMap
.
get
(
excel
.
getFileCity
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getFileCity
()
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getFileProvince
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setFileCity
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getFileCity
())
));
saveEmp
.
setFileCity
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getFileTown
()))
{
if
(
areaMap
.
get
(
excel
.
getFileTown
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getFileTown
()
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getFileCity
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setFileTown
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getFileTown
())
));
saveEmp
.
setFileTown
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getIsCollege
()))
{
...
...
@@ -1312,6 +1308,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
areaMap
=
areaMaps
.
get
(
"data"
);
}
String
areaStr
;
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
// 已有验证报错直接下一个
...
...
@@ -1408,47 +1405,54 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
// 户籍所在地
// 户籍所在地
if
(
Common
.
isNotNull
(
excel
.
getIdProvince
()))
{
if
(
areaMap
.
get
(
excel
.
getIdProvince
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getIdProvince
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setIdProvince
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getIdProvince
())
));
saveEmp
.
setIdProvince
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getIdCity
()))
{
if
(
areaMap
.
get
(
excel
.
getIdCity
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getIdCity
()
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getIdProvince
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setIdCity
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getIdCity
())
));
saveEmp
.
setIdCity
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getIdTown
()))
{
if
(
areaMap
.
get
(
excel
.
getIdTown
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getIdTown
()
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getIdCity
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setIdTown
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getIdTown
())
));
saveEmp
.
setIdTown
(
Integer
.
parseInt
(
area
Str
));
}
}
// 档案所在地
if
(
Common
.
isNotNull
(
excel
.
getFileProvince
()))
{
if
(
areaMap
.
get
(
excel
.
getFileProvince
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getFileProvince
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setFileProvince
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getFileProvince
())
));
saveEmp
.
setFileProvince
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getFileCity
()))
{
if
(
areaMap
.
get
(
excel
.
getFileCity
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getFileCity
()
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getFileProvince
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setFileCity
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getFileCity
())
));
saveEmp
.
setFileCity
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getFileTown
()))
{
if
(
areaMap
.
get
(
excel
.
getFileTown
())
==
null
)
{
areaStr
=
ExcelUtil
.
getRedisAreaValue
(
"area_"
+
excel
.
getFileTown
()
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getFileCity
().
trim
());
if
(
Common
.
isEmpty
(
areaStr
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR
,
excel
.
getEmpIdcard
()));
}
else
{
saveEmp
.
setFileTown
(
Integer
.
parseInt
(
area
Map
.
get
(
excel
.
getFileTown
())
));
saveEmp
.
setFileTown
(
Integer
.
parseInt
(
area
Str
));
}
}
if
(
Common
.
isNotNull
(
excel
.
getIsCollege
()))
{
...
...
@@ -1619,6 +1623,18 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
}
if
(
Common
.
isNotNull
(
employeeInfo
.
getIdCity
())
&&
Common
.
isEmpty
(
employeeInfo
.
getIdProvince
()))
{
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
ID_ROVINCE_MUST
));
}
if
(
Common
.
isNotNull
(
employeeInfo
.
getIdTown
())
&&
Common
.
isEmpty
(
employeeInfo
.
getIdCity
()))
{
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
ID_CITY_MUST
));
}
if
(
Common
.
isNotNull
(
employeeInfo
.
getFileCity
())
&&
Common
.
isEmpty
(
employeeInfo
.
getFileProvince
()))
{
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
FILE_ROVINCE_MUST
));
}
if
(
Common
.
isNotNull
(
employeeInfo
.
getFileTown
())
&&
Common
.
isEmpty
(
employeeInfo
.
getFileCity
()))
{
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
FILE_CITY_MUST
));
}
}
// 更新学历-房
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
View file @
e7c8b6d1
...
...
@@ -458,6 +458,12 @@ public class ExcelUtil <T> implements Serializable {
}
return
tempStr
;
}
// 简单的获取区域字典value
public
static
String
getRedisAreaValue
(
String
c
)
{
return
String
.
valueOf
(
RedisUtil
.
redis
.
opsForValue
().
get
(
c
));
}
private
String
getDicValue
(
String
c
,
String
tempStr
,
ExcelAttribute
attr
,
Integer
rowNum
,
ErrorMessage
errorTemp
)
{
Map
<
String
,
String
>
dicObj
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
attr
.
dataType
());
boolean
flag
=
true
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/AreaController.java
View file @
e7c8b6d1
...
...
@@ -16,7 +16,10 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysAreaService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
...
@@ -25,6 +28,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -68,4 +72,17 @@ public class AreaController {
return
sysAreaService
.
getAreaToName
();
}
/**
* @param
* @Description: 获取所有区域list
* @Author: hgw
* @Date: 2022-7-6 16:42:39
**/
@Inner
@PostMapping
(
"/inner/getSysAreaList"
)
public
List
<
SysArea
>
getSysAreaList
()
{
return
sysAreaService
.
list
(
Wrappers
.<
SysArea
>
query
().
lambda
()
.
eq
(
SysArea:
:
getStatus
,
CommonConstants
.
ZERO_INT
).
orderByAsc
(
SysArea:
:
getParentId
));
}
}
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