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
538b9d29
Commit
538b9d29
authored
Apr 24, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
6a09e0a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
12 deletions
+68
-12
ExcelServiceImpl.java
.../boot/module/jxiop/biz/service/impl/ExcelServiceImpl.java
+65
-10
PersonBasicServiceImpl.java
...module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
+3
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/ExcelServiceImpl.java
View file @
538b9d29
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.biz.common.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.EXPersonUser
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.EXPersonUser
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.ExStationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.ExStationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.
StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.
*
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -20,15 +22,27 @@ import java.util.*;
...
@@ -20,15 +22,27 @@ import java.util.*;
@Service
@Service
public
class
ExcelServiceImpl
{
public
class
ExcelServiceImpl
{
//
@Autowired
//
@Autowired
PersonBasicMapper
personBasicMapper
;
//
PersonBasicMapper personBasicMapper;
@Autowired
@Autowired
ExDataSourcesImpl
dataSourcesImpl
;
ExDataSourcesImpl
dataSourcesImpl
;
@Autowired
//
@Autowired
StationBasicMapper
stationBasicMapper
;
//
StationBasicMapper stationBasicMapper;
@Autowired
@Autowired
StationBasicServiceImpl
stationBasicServiceImpl
;
StationBasicServiceImpl
stationBasicServiceImpl
;
@Autowired
PersonBasicServiceImpl
personBasicServiceImpl
;
// //人员资质信息service
// @Autowired
// PersonCertificateServiceImpl personCertificateService;
// //人员教育信息
// @Autowired
// PersonSkillEducationServiceImpl personSkillEducationService;
// @Autowired
// PersonAccountServiceImpl personAccountServiceImpl;
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
,
Map
par
)
throws
ClassNotFoundException
{
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
,
Map
par
)
throws
ClassNotFoundException
{
String
url
=
excelDto
.
getClassUrl
();
String
url
=
excelDto
.
getClassUrl
();
...
@@ -74,6 +88,9 @@ public class ExcelServiceImpl {
...
@@ -74,6 +88,9 @@ public class ExcelServiceImpl {
case
"CZXX"
:
case
"CZXX"
:
this
.
addExStationBasicDto
(
multipartFile
);
this
.
addExStationBasicDto
(
multipartFile
);
break
;
break
;
case
"RYXX"
:
this
.
updateEXPersonUser
(
multipartFile
);
break
;
}
}
return
;
return
;
}
}
...
@@ -84,14 +101,14 @@ public class ExcelServiceImpl {
...
@@ -84,14 +101,14 @@ public class ExcelServiceImpl {
public
List
<
ExStationBasicDto
>
getExStationBasicDto
(
Map
<
String
,
Object
>
map
){
public
List
<
ExStationBasicDto
>
getExStationBasicDto
(
Map
<
String
,
Object
>
map
){
List
<
ExStationBasicDto
>
data
=
null
;
List
<
ExStationBasicDto
>
data
=
null
;
if
(!
map
.
isEmpty
()){
if
(!
map
.
isEmpty
()){
data
=
stationBasicMapper
.
getExStationBasicDto
(
map
.
get
(
"stationMasterName"
).
toString
(),
map
.
get
(
"stationName"
).
toString
(),
map
.
get
(
"stationType"
).
toString
(),
map
.
get
(
"orgCode"
).
toString
());
data
=
stationBasic
ServiceImpl
.
stationBasic
Mapper
.
getExStationBasicDto
(
map
.
get
(
"stationMasterName"
).
toString
(),
map
.
get
(
"stationName"
).
toString
(),
map
.
get
(
"stationType"
).
toString
(),
map
.
get
(
"orgCode"
).
toString
());
}
}
return
data
;
return
data
;
}
}
//场站导入
//场站导入
private
void
addExStationBasicDto
(
MultipartFile
multipartFile
)
throws
Exception
{
private
void
addExStationBasicDto
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
ExStationBasicDto
>
excelDtoList
=
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
excel
.
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
ExStationBasicDto
.
class
,
1
);
List
<
ExStationBasicDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
ExStationBasicDto
.
class
,
1
);
List
<
StationBasic
>
excelEntityList
=
new
ArrayList
<>();
List
<
StationBasic
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
excelDtoList
.
forEach
(
item
->
{
StationBasic
fireChemical
=
new
StationBasic
();
StationBasic
fireChemical
=
new
StationBasic
();
...
@@ -109,7 +126,7 @@ public class ExcelServiceImpl {
...
@@ -109,7 +126,7 @@ public class ExcelServiceImpl {
//获取人员数据
//获取人员数据
public
List
<
EXPersonUser
>
getEXPersonUser
(
Map
map
){
public
List
<
EXPersonUser
>
getEXPersonUser
(
Map
map
){
List
<
EXPersonUser
>
listdata
=
personBasicMapper
.
getEXPersonUser
(
List
<
EXPersonUser
>
listdata
=
personBasic
ServiceImpl
.
personBasic
Mapper
.
getEXPersonUser
(
map
.
get
(
"name"
).
toString
(),
map
.
get
(
"name"
).
toString
(),
map
.
get
(
"accountName"
).
toString
(),
map
.
get
(
"accountName"
).
toString
(),
map
.
get
(
"projectName"
).
toString
(),
map
.
get
(
"projectName"
).
toString
(),
...
@@ -120,7 +137,7 @@ public class ExcelServiceImpl {
...
@@ -120,7 +137,7 @@ public class ExcelServiceImpl {
//人员导出
//人员导出
public
List
<
EXPersonUser
>
getEXPersonUserAll
(
Map
map
){
public
List
<
EXPersonUser
>
getEXPersonUserAll
(
Map
map
){
List
<
EXPersonUser
>
listdata
=
personBasicMapper
.
getEXPersonUserAll
(
List
<
EXPersonUser
>
listdata
=
personBasic
ServiceImpl
.
personBasic
Mapper
.
getEXPersonUserAll
(
map
.
get
(
"name"
).
toString
(),
map
.
get
(
"name"
).
toString
(),
map
.
get
(
"accountName"
).
toString
(),
map
.
get
(
"accountName"
).
toString
(),
map
.
get
(
"projectName"
).
toString
(),
map
.
get
(
"projectName"
).
toString
(),
...
@@ -128,8 +145,46 @@ public class ExcelServiceImpl {
...
@@ -128,8 +145,46 @@ public class ExcelServiceImpl {
return
listdata
;
return
listdata
;
}
}
//人员导入更新
private
void
updateEXPersonUser
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
EXPersonUser
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
EXPersonUser
.
class
,
1
);
this
.
updateEXPersonUserda
(
excelDtoList
);
}
@Transactional
public
void
updateEXPersonUserda
(
List
<
EXPersonUser
>
excelDtoList
)
{
List
<
PersonBasic
>
listPersonBasic
=
new
ArrayList
<>();
List
<
PersonSkillEducation
>
listPersonSkillEducation
=
new
ArrayList
<>();
List
<
PersonCertificate
>
listPersonCertificate
=
new
ArrayList
<>();
for
(
EXPersonUser
exPersonUser
:
excelDtoList
)
{
//根据平台账号获取用户id
QueryWrapper
<
PersonAccount
>
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"account_name"
,
exPersonUser
.
getAccountName
());
PersonAccount
personAccount
=
personBasicServiceImpl
.
personAccountService
.
getOne
(
wrapper
);
//获取基本信息
PersonBasic
personBasic
=
personBasicServiceImpl
.
personBasicMapper
.
selectById
(
personAccount
.
getPersonId
());
BeanUtils
.
copyProperties
(
exPersonUser
,
personBasic
);
listPersonBasic
.
add
(
personBasic
);
//人员技能
QueryWrapper
<
PersonSkillEducation
>
wrapper1
=
new
QueryWrapper
();
wrapper1
.
eq
(
"person_id"
,
personAccount
.
getPersonId
());
PersonSkillEducation
personSkillEducation
=
personBasicServiceImpl
.
personSkillEducationService
.
getOne
(
wrapper1
);
BeanUtils
.
copyProperties
(
exPersonUser
,
personSkillEducation
);
listPersonSkillEducation
.
add
(
personSkillEducation
);
//人员资质
QueryWrapper
<
PersonCertificate
>
wrapper2
=
new
QueryWrapper
();
wrapper2
.
eq
(
"person_id"
,
personAccount
.
getPersonId
());
PersonCertificate
personCertificate
=
personBasicServiceImpl
.
personCertificateService
.
getOne
(
wrapper2
);
BeanUtils
.
copyProperties
(
exPersonUser
,
personCertificate
);
listPersonCertificate
.
add
(
personCertificate
);
}
personBasicServiceImpl
.
saveOrUpdateBatch
(
listPersonBasic
);
personBasicServiceImpl
.
personSkillEducationService
.
saveOrUpdateBatch
(
listPersonSkillEducation
);
personBasicServiceImpl
.
personCertificateService
.
saveOrUpdateBatch
(
listPersonCertificate
);
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
View file @
538b9d29
...
@@ -9,7 +9,6 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper;
...
@@ -9,7 +9,6 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IPersonBasicService
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IPersonBasicService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.client.DepartmentClient
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
...
@@ -22,7 +21,6 @@ import org.springframework.web.bind.annotation.*;
...
@@ -22,7 +21,6 @@ import org.springframework.web.bind.annotation.*;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
import
java.util.*
;
...
@@ -361,4 +359,6 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
...
@@ -361,4 +359,6 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
}
}
\ No newline at end of file
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