Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
4f8c790a
Commit
4f8c790a
authored
Jun 08, 2022
by
xixinzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员导入
parent
2532f8b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
388 additions
and
15 deletions
+388
-15
OrgUsrExcelDto.java
...ejoin/amos/boot/module/common/api/dto/OrgUsrExcelDto.java
+129
-4
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+15
-9
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+244
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/OrgUsrExcelDto.java
View file @
4f8c790a
...
...
@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint
;
...
...
@@ -12,7 +13,9 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -59,6 +62,10 @@ public class OrgUsrExcelDto extends BaseDto {
private
String
parentId
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"机构名称"
)
private
String
parentName
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"扩展属性1"
)
private
String
orgExpandAttr1
;
@ExcelIgnore
...
...
@@ -94,11 +101,11 @@ public class OrgUsrExcelDto extends BaseDto {
@ExcelProperty
(
value
=
"审核周期"
,
index
=
3
)
@ExplicitConstraint
(
type
=
"SHZQ"
,
indexNum
=
3
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内
private
String
auditCycle
;
//审核周期
@ExcelProperty
(
value
=
"证件号码"
,
index
=
4
)
private
String
certificatesNumber
;
// 证件号码
@ExcelProperty
(
value
=
"证件类型"
,
index
=
5
)
@ExplicitConstraint
(
type
=
"RYZJLX"
,
indexNum
=
5
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内
@ExcelProperty
(
value
=
"证件类型"
,
index
=
4
)
@ExplicitConstraint
(
type
=
"RYZJLX"
,
indexNum
=
4
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内
private
String
certificatesTypeCode
;
//证件类型
@ExcelProperty
(
value
=
"证件号码"
,
index
=
5
)
private
String
certificatesNumber
;
// 证件号码
@ExcelProperty
(
value
=
"持证类别"
,
index
=
6
)
@ExplicitConstraint
(
type
=
"CZLB"
,
indexNum
=
6
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内
private
String
certificateType
;
//持证类别
...
...
@@ -113,19 +120,137 @@ public class OrgUsrExcelDto extends BaseDto {
private
String
internalPositionCode
;
//消防管理组织机构内部职务
@ExcelProperty
(
value
=
"员工编号"
,
index
=
10
)
private
String
personNumber
;
//员工编号
@ExcelProperty
(
value
=
"岗位类型"
,
index
=
11
)
@ExplicitConstraint
(
type
=
"GWMC"
,
indexNum
=
11
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内
private
String
positionType
;
//岗位类型
@ExcelProperty
(
value
=
"是否进行安全培训"
,
index
=
12
)
@ExplicitConstraint
(
type
=
"AQPX"
,
indexNum
=
12
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内
private
String
safetyTraining
;
//是否进行安全培训
@ExcelProperty
(
value
=
"人员状态"
,
index
=
13
)
@ExplicitConstraint
(
type
=
"RYZT"
,
indexNum
=
13
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内
private
String
stateCode
;
//人员状态
@ExcelProperty
(
value
=
"联系电话"
,
index
=
14
)
private
String
telephone
;
//联系电话
@ExcelProperty
(
value
=
"人员类型"
,
index
=
15
)
@ExplicitConstraint
(
type
=
"DWRYLX"
,
indexNum
=
15
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内
private
String
peopleType
;
//人员类型
@ExplicitConstraint
(
indexNum
=
16
,
sourceClass
=
CommonExplicitConstraint
.
class
,
method
=
"getNations"
)
//固定下拉内容
@ExcelProperty
(
value
=
"民族"
,
index
=
16
)
@ApiModelProperty
(
value
=
"民族"
)
private
String
nation
;
@ExcelProperty
(
value
=
"出生日期"
,
index
=
17
)
@ApiModelProperty
(
value
=
"出生日期"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
birthdayTime
;
@ExplicitConstraint
(
indexNum
=
18
,
sourceClass
=
CommonExplicitConstraint
.
class
,
method
=
"getMaritalStatus"
)
//固定下拉内容
@ExcelProperty
(
value
=
"婚姻状况"
,
index
=
18
)
@ApiModelProperty
(
value
=
"婚姻状况"
)
private
String
maritalStatus
;
@ExplicitConstraint
(
indexNum
=
19
,
sourceClass
=
CommonExplicitConstraint
.
class
,
method
=
"getCitys"
)
//动态下拉内容
@ExcelProperty
(
value
=
"户籍所在地"
,
index
=
19
)
@ApiModelProperty
(
value
=
"籍贯/户口所在地的值"
)
private
String
nativePlaceValue
;
@ExcelProperty
(
value
=
"籍贯/户口所在地详细地址"
,
index
=
20
)
@ApiModelProperty
(
value
=
"籍贯/户口所在地详细地址"
)
private
String
nativePlaceVal
;
@ExplicitConstraint
(
indexNum
=
21
,
sourceClass
=
CommonExplicitConstraint
.
class
,
method
=
"getPoliticalOutlook"
)
//固定下拉内容
@ExcelProperty
(
value
=
"政治面貌"
,
index
=
21
)
@ApiModelProperty
(
value
=
"政治面貌代码"
)
private
String
politicalOutlook
;
@ExplicitConstraint
(
indexNum
=
22
,
sourceClass
=
CommonExplicitConstraint
.
class
,
method
=
"getCitys"
)
//动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty
(
value
=
"现居住地"
,
index
=
22
)
@ApiModelProperty
(
value
=
"现居住地"
)
private
String
residence
;
@ExcelProperty
(
value
=
"现居住地详细地址"
,
index
=
23
)
@ApiModelProperty
(
value
=
"现居住地详细地址"
)
private
String
residenceDetailVal
;
@ExcelProperty
(
value
=
"住宿情况"
,
index
=
24
)
@ApiModelProperty
(
value
=
"住宿情况"
)
private
String
airportAccommodation
;
@ExcelProperty
(
value
=
"紧急联系人"
,
index
=
25
)
@ApiModelProperty
(
value
=
"紧急联系人"
)
private
String
emergencyContact
;
@ExplicitConstraint
(
type
=
"RJGX"
,
indexNum
=
26
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"与紧急联系人关系"
,
index
=
26
)
@ApiModelProperty
(
value
=
"紧急联系人与本人所属关系"
)
private
String
relationship
;
@ExcelProperty
(
value
=
"紧急联系人电话"
,
index
=
27
)
@ApiModelProperty
(
value
=
"紧急联系人电话"
)
private
String
emergencyContactPhone
;
@ApiModelProperty
(
value
=
"员工层级"
)
@ExcelProperty
(
value
=
"员工层级"
,
index
=
28
)
@ExplicitConstraint
(
type
=
"YGCJ"
,
indexNum
=
28
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内容
private
String
employeeHierarchy
;
@ApiModelProperty
(
value
=
"岗位资质"
)
@ExplicitConstraint
(
type
=
"GWZZ"
,
indexNum
=
29
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"岗位资质"
,
index
=
29
)
private
String
postQualification
;
/*************************学历教育***********************/
@ApiModelProperty
(
value
=
"第一学历"
)
@ExplicitConstraint
(
type
=
"XLLX"
,
indexNum
=
30
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"第一学历"
,
index
=
30
)
private
String
firstDegree
;
@ApiModelProperty
(
value
=
"最高学历"
)
@ExplicitConstraint
(
type
=
"XLLX"
,
indexNum
=
31
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"最高学历"
,
index
=
31
)
private
String
highestEducation
;
@ApiModelProperty
(
value
=
"学位"
)
@ExplicitConstraint
(
type
=
"XWLX"
,
indexNum
=
32
,
sourceClass
=
CommonExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"学位"
,
index
=
32
)
private
String
academicDegree
;
@ApiModelProperty
(
value
=
"毕业院校"
)
@ExcelProperty
(
value
=
"毕业院校"
,
index
=
33
)
private
String
school
;
@ApiModelProperty
(
value
=
"毕业专业名称"
)
@ExcelProperty
(
value
=
"毕业专业名称"
,
index
=
34
)
private
String
professionalName
;
/*************************工作履历岗***********************/
@ApiModelProperty
(
value
=
"参加工作时间"
)
@ExcelProperty
(
value
=
"参加工作时间"
,
index
=
35
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
workingHours
;
@ApiModelProperty
(
value
=
"参加消防部门工作时间"
)
@ExcelProperty
(
value
=
"参加消防部门工作时间"
,
index
=
36
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
fireWorkingHours
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"单位人员id"
)
private
String
orgUsrId
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"消防人员id"
)
private
Long
firefightersId
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
4f8c790a
...
...
@@ -612,15 +612,17 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
String
chargePersonId
=
iOrgUsrService
.
getIdNumberByAmosId
(
t
.
get
(
"amosOrgId"
).
toString
());
t
.
put
(
"chargePersonId"
,
chargePersonId
);
if
(!
ObjectUtils
.
isEmpty
(
t
.
get
(
"state"
)))
{
DataDictionary
gwmc
=
dataDictionaryService
.
getByCode
(
t
.
get
(
"state"
).
toString
(),
"RYZT"
);
if
(!
ObjectUtils
.
isEmpty
(
gwmc
))
{
t
.
put
(
"stateName"
,
gwmc
.
getName
());
}
}
}
else
{
t
.
put
(
"chargePersonId"
,
null
);
}
if
(!
ObjectUtils
.
isEmpty
(
t
.
get
(
"state"
)))
{
DataDictionary
gwmc
=
dataDictionaryService
.
getByCode
(
t
.
get
(
"state"
).
toString
(),
"RYZT"
);
if
(!
ObjectUtils
.
isEmpty
(
gwmc
))
{
t
.
put
(
"stateName"
,
gwmc
.
getName
());
}
else
{
t
.
put
(
"stateName"
,
t
.
get
(
"state"
));
}
}
});
/* Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束 */
...
...
@@ -816,7 +818,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
FirefightersPost
firefightersPost
=
iFirefightersPostService
.
getOne
(
queryWrapperf
);
if
(!
ObjectUtils
.
isEmpty
(
result
.
get
(
"stateCode"
)))
{
DataDictionary
gwmc
=
dataDictionaryService
.
getByCode
(
result
.
get
(
"stateCode"
).
toString
(),
"RYZT"
);
result
.
put
(
"state"
,
gwmc
.
getName
());
if
(!
ObjectUtils
.
isEmpty
(
gwmc
))
{
result
.
put
(
"state"
,
gwmc
.
getName
());
}
else
{
result
.
put
(
"state"
,
result
.
get
(
"stateCode"
));
}
}
if
(!
ObjectUtils
.
isEmpty
(
firefightersPost
))
{
result
.
put
(
"fireManagementPostCode"
,
firefightersPost
.
getFireManagementPost
());
...
...
@@ -916,7 +922,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
getDynamicFormValue
());
}
public
void
saveOrgPersonExcel
(
OrgUsrExcelDto
OrgPersonVo
)
throws
Exception
{
public
OrgUsrDto
saveOrgPersonExcel
(
OrgUsrExcelDto
OrgPersonVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
...
...
@@ -934,7 +940,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgPersonVo
.
setAmosOrgCode
(
user
.
getRealName
());
}
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
getDynamicFormValue
());
return
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
getDynamicFormValue
());
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
View file @
4f8c790a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.io.InputStream
;
import
java.lang.reflect.Field
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
...
...
@@ -14,16 +15,20 @@ import java.util.stream.Collectors;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint
;
import
org.apache.commons.beanutils.ConvertUtils
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
...
...
@@ -129,7 +134,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
*/
@Service
public
class
ExcelServiceImpl
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
OrgUsrServiceImpl
.
class
);
private
static
final
String
NOT_DUTY
=
"休班"
;
private
static
final
String
PERSON
=
"PERSON"
;
private
static
final
String
MAINTENANCE_PERSON
=
"maintenancePerson"
;
...
...
@@ -460,7 +465,8 @@ public class ExcelServiceImpl {
excelImportKeySite
(
multipartFile
);
break
;
case
"JCDWRY"
:
excelImportOrgUsrExcelDto
(
multipartFile
);
// excelImportOrgUsrExcelDto(multipartFile);
excelImportOrgUsrExcelDtoNew
(
multipartFile
);
break
;
case
"LDDW"
:
excelImportLinkageUnitZhDto
(
multipartFile
);
...
...
@@ -712,6 +718,242 @@ public class ExcelServiceImpl {
}
private
void
excelImportOrgUsrExcelDtoNew
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
OrgUsrExcelDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
OrgUsrExcelDto
.
class
,
1
);
if
(!
ObjectUtils
.
isEmpty
(
excelDtoList
))
{
excelDtoList
.
forEach
(
orgUsrExcelDto
->
{
if
(
orgUsrExcelDto
.
getParentId
()
!=
null
)
{
String
[]
certificates
=
orgUsrExcelDto
.
getParentId
().
split
(
"@"
);
orgUsrExcelDto
.
setParentName
(
certificates
[
0
]);
orgUsrExcelDto
.
setParentId
(
certificates
[
1
]);
}
// 动态字段填充
List
<
DynamicFormInitDto
>
dynamicFormColumn
=
dynamicFormColumnServiceImpl
.
getFormlist
(
"246"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// 获取对象属性和值
Field
[]
fields
=
orgUsrExcelDto
.
getClass
().
getDeclaredFields
();
for
(
Field
field
:
fields
)
{
try
{
field
.
setAccessible
(
true
);
Object
value
=
field
.
get
(
orgUsrExcelDto
);
String
name
=
field
.
getName
();
// 解析注解信息
ExplicitConstraint
explicitConstraint
=
field
.
getAnnotation
(
ExplicitConstraint
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
explicitConstraint
))
{
name
=
name
+
"@"
;
}
map
.
put
(
name
,
value
);
}
catch
(
Exception
ex
){
logger
.
error
(
"获取{}字段值失败, {}"
,
field
.
getName
(),
ex
);
}
}
List
<
DynamicFormInstanceDto
>
dynamicFormValue
=
new
ArrayList
<>();
List
<
DynamicFormInstance
>
dynamicFormInstancelist
=
new
ArrayList
<>();
dynamicFormColumn
.
forEach
(
DynamicFormInitDto
->
{
dynamicFormValue
.
add
(
DynamicFormInitDto
.
getFormItemDescr
());
});
dynamicFormValue
.
forEach
(
dynamicFormInstanceDto
->
{
String
key
=
dynamicFormInstanceDto
.
getFieldCode
();
Object
value
=
map
.
get
(
key
);
if
(
value
!=
null
)
{
dynamicFormInstanceDto
.
setFieldValue
(
value
.
toString
());
}
else
{
Object
o
=
map
.
get
(
key
+
"@"
);
if
(!
ObjectUtils
.
isEmpty
(
o
))
{
if
(
o
.
toString
().
contains
(
"@"
))
{
String
[]
certificates
=
o
.
toString
().
split
(
"@"
);
dynamicFormInstanceDto
.
setFieldValue
(
certificates
[
1
]);
dynamicFormInstanceDto
.
setFieldValueLabel
(
certificates
[
0
]);
}
else
{
dynamicFormInstanceDto
.
setFieldValue
(
o
.
toString
());
}
}
}
DynamicFormInstance
dynamicFormInstance
=
new
DynamicFormInstance
();
BeanUtils
.
copyProperties
(
dynamicFormInstanceDto
,
dynamicFormInstance
);
dynamicFormInstancelist
.
add
(
dynamicFormInstance
);
});
orgUsrExcelDto
.
setDynamicFormValue
(
dynamicFormInstancelist
);
Bean
.
toPo
(
getCurrentInfo
(),
orgUsrExcelDto
);
try
{
// 保存动态表单和人员单位表
OrgUsrDto
orgUsrDto
=
orgUsrService
.
saveOrgPersonExcel
(
orgUsrExcelDto
);
if
(!
ObjectUtils
.
isEmpty
(
orgUsrDto
))
{
// 保存其余项
orgUsrExcelDto
.
setOrgUsrId
(
orgUsrDto
.
getSequenceNbr
().
toString
());
savePeopleItem
(
orgUsrExcelDto
);
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"导入失败!"
);
}
});
}
}
private
void
savePeopleItem
(
OrgUsrExcelDto
item
)
{
FirefightersContacts
firefightersContacts
=
new
FirefightersContacts
();
// 手动添加主键,以便于给岗位、职位等实体赋值id
Long
sequenceId
=
null
;
firefightersContacts
=
Bean
.
toPo
(
item
,
firefightersContacts
);
if
(
firefightersContacts
.
getRelationship
()
!=
null
)
{
String
relationship
=
firefightersContacts
.
getRelationship
().
split
(
"@"
)[
1
];
firefightersContacts
.
setRelationship
(
relationship
);
}
if
(!
ObjectUtils
.
isEmpty
(
item
.
getPeopleType
())
&&
item
.
getPeopleType
().
contains
(
"@"
)
&&
"2"
.
equals
(
item
.
getPeopleType
().
split
(
"@"
)[
1
]))
{
// 保存消防队伍人员和紧急联系人
Firefighters
firefighters
=
new
Firefighters
();
firefighters
=
Bean
.
toPo
(
item
,
firefighters
);
firefighters
=
Bean
.
toPo
(
getCurrentInfo
(),
firefighters
);
sequenceId
=
sequence
.
nextId
();
firefighters
.
setSequenceNbr
(
sequenceId
);
firefighters
.
setName
(
item
.
getBizOrgName
());
if
(
firefighters
.
getCertificatesType
()
!=
null
)
{
String
[]
certificates
=
firefighters
.
getCertificatesType
().
split
(
"@"
);
firefighters
.
setCertificatesType
(
certificates
[
0
]);
firefighters
.
setCertificatesTypeCode
(
certificates
[
1
]);
}
if
(
firefighters
.
getState
()
!=
null
)
{
String
[]
state
=
firefighters
.
getState
().
split
(
"@"
);
firefighters
.
setState
(
state
[
0
]);
firefighters
.
setStateCode
(
state
[
1
]);
}
if
(
firefighters
.
getJobTitle
()
!=
null
)
{
String
[]
jobTitle
=
firefighters
.
getJobTitle
().
split
(
"@"
);
firefighters
.
setJobTitle
(
jobTitle
[
0
]);
firefighters
.
setJobTitleCode
(
jobTitle
[
1
]);
}
if
(
item
.
getParentId
()
!=
null
)
{
// String[] tempCompany = item.getParentId().split("@");
firefighters
.
setCompanyName
(
item
.
getParentName
());
firefighters
.
setCompanyCode
(
item
.
getParentId
());
firefighters
.
setCompany
(
item
.
getParentId
());
OrgUsr
result
=
orgUsrService
.
getById
(
Long
.
valueOf
(
item
.
getParentId
()));
firefighters
.
setBizOrgName
(
item
.
getParentName
());
firefighters
.
setBizOrgCode
(
result
.
getBizOrgCode
());
}
if
(
firefighters
.
getNativePlaceValue
()
!=
null
)
{
String
[]
tempCity
=
firefighters
.
getNativePlaceValue
().
split
(
"@"
);
firefighters
.
setNativePlaceValue
(
tempCity
[
0
]);
firefighters
.
setNativePlace
(
tempCity
[
1
]);
}
if
(
firefighters
.
getResidence
()
!=
null
)
{
String
[]
tempCity
=
firefighters
.
getResidence
().
split
(
"@"
);
firefighters
.
setResidence
(
tempCity
[
0
]);
firefighters
.
setResidenceDetails
(
tempCity
[
1
]);
}
if
(
firefighters
.
getGender
()
!=
null
)
{
String
[]
tempCity
=
firefighters
.
getGender
().
split
(
"@"
);
firefighters
.
setGender
(
tempCity
[
0
]);
}
if
(
firefighters
.
getPeopleType
()
!=
null
)
{
String
[]
tempCity
=
firefighters
.
getPeopleType
().
split
(
"@"
);
firefighters
.
setPeopleType
(
tempCity
[
1
]);
}
if
(
firefighters
.
getStateCode
()
!=
null
)
{
String
[]
tempCity
=
firefighters
.
getStateCode
().
split
(
"@"
);
firefighters
.
setState
(
tempCity
[
0
]);
firefighters
.
setStateCode
(
tempCity
[
1
]);
}
if
(
firefighters
.
getCertificatesTypeCode
()
!=
null
)
{
String
[]
tempCity
=
firefighters
.
getCertificatesTypeCode
().
split
(
"@"
);
firefighters
.
setCertificatesType
(
tempCity
[
0
]);
firefighters
.
setCertificatesTypeCode
(
tempCity
[
1
]);
}
if
(
firefighters
.
getSafetyTraining
()
!=
null
)
{
String
[]
tempCity
=
firefighters
.
getSafetyTraining
().
split
(
"@"
);
firefighters
.
setSafetyTraining
(
tempCity
[
1
]);
}
if
(
item
.
getPositionType
()
!=
null
)
{
String
[]
tempCity
=
item
.
getPositionType
().
split
(
"@"
);
firefighters
.
setJobTitle
(
tempCity
[
0
]);
firefighters
.
setJobTitleCode
(
tempCity
[
1
]);
}
if
(
item
.
getTelephone
()
!=
null
)
{
firefighters
.
setMobilePhone
(
item
.
getTelephone
());
}
FirefightersInfoDto
firefightersInfo
=
new
FirefightersInfoDto
(
firefighters
,
firefightersContacts
);
firefightersService
.
saveFirefighters
(
firefightersInfo
);
}
else
{
// 保存紧急联系人
ifirefightersContactsService
.
save
(
firefightersContacts
);
}
item
.
setFirefightersId
(
sequenceId
);
FirefightersWorkexperience
firefightersWorkexperience
=
new
FirefightersWorkexperience
();
FirefightersEducation
firefightersEducation
=
new
FirefightersEducation
();
FirefightersPost
firefightersPost
=
new
FirefightersPost
();
firefightersWorkexperience
=
Bean
.
toPo
(
item
,
firefightersWorkexperience
);
firefightersEducation
=
Bean
.
toPo
(
item
,
firefightersEducation
);
firefightersPost
=
Bean
.
toPo
(
item
,
firefightersPost
);
/************************* 岗位职级 ***********************/
if
(
item
.
getEmployeeHierarchy
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getEmployeeHierarchy
().
split
(
"@"
);
firefightersPost
.
setEmployeeHierarchy
(
employeeHierarchy
[
0
]);
firefightersPost
.
setEmployeeHierarchyCode
(
employeeHierarchy
[
1
]);
}
if
(
item
.
getAdministrativePositionCode
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getAdministrativePositionCode
().
split
(
"@"
);
firefightersPost
.
setAdministrativePosition
(
employeeHierarchy
[
0
]);
firefightersPost
.
setAdministrativePositionCode
(
employeeHierarchy
[
1
]);
}
if
(
item
.
getPositionType
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getPositionType
().
split
(
"@"
);
firefightersPost
.
setJobTitle
(
employeeHierarchy
[
0
]);
firefightersPost
.
setJobTitleCode
(
employeeHierarchy
[
1
]);
}
if
(
item
.
getPostQualification
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getPostQualification
().
split
(
"@"
);
firefightersPost
.
setPostQualification
(
employeeHierarchy
[
0
]);
firefightersPost
.
setPostQualificationCode
(
employeeHierarchy
[
1
]);
}
if
(
item
.
getInternalPositionCode
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getInternalPositionCode
().
split
(
"@"
);
firefightersPost
.
setInternalPosition
(
employeeHierarchy
[
0
]);
firefightersPost
.
setInternalPositionCode
(
employeeHierarchy
[
1
]);
}
if
(
item
.
getFireManagementPostCode
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getFireManagementPostCode
().
split
(
"@"
);
firefightersPost
.
setFireManagementPost
(
employeeHierarchy
[
0
]);
firefightersPost
.
setFireManagementPostCode
(
employeeHierarchy
[
1
]);
}
if
(
item
.
getCertificateType
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getCertificateType
().
split
(
"@"
);
firefightersPost
.
setCertificateType
(
employeeHierarchy
[
0
]);
firefightersPost
.
setCertificateTypeCode
(
employeeHierarchy
[
1
]);
}
if
(
item
.
getAuditCycle
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getAuditCycle
().
split
(
"@"
);
firefightersPost
.
setAuditCycle
(
employeeHierarchy
[
1
]);
}
/************************* 学历教育 ***********************/
if
(
item
.
getFirstDegree
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getFirstDegree
().
split
(
"@"
);
firefightersEducation
.
setFirstDegree
(
employeeHierarchy
[
1
]);
}
if
(
item
.
getHighestEducation
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getHighestEducation
().
split
(
"@"
);
firefightersEducation
.
setHighestEducation
(
employeeHierarchy
[
1
]);
}
if
(
item
.
getAcademicDegree
()
!=
null
)
{
String
[]
employeeHierarchy
=
item
.
getAcademicDegree
().
split
(
"@"
);
firefightersEducation
.
setAcademicDegree
(
employeeHierarchy
[
1
]);
}
iFirefightersPostService
.
save
(
firefightersPost
);
ifirefightersEducationService
.
save
(
firefightersEducation
);
ifirefightersWorkexperienceService
.
save
(
firefightersWorkexperience
);
}
private
void
excelImportFirefighters
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FirefightersExcelDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FirefightersExcelDto
.
class
,
1
);
...
...
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