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
47ad5b19
Commit
47ad5b19
authored
Nov 02, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改根据type获取当前登录所在单位下的项目中的所有资源列表接口
parent
f75e7df6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
ProjectResourceController.java
.../module/ugp/biz/controller/ProjectResourceController.java
+3
-3
ProjectResourceServiceImpl.java
...dule/ugp/biz/service/impl/ProjectResourceServiceImpl.java
+18
-7
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectResourceController.java
View file @
47ad5b19
...
@@ -238,9 +238,9 @@ public class ProjectResourceController extends BaseController {
...
@@ -238,9 +238,9 @@ public class ProjectResourceController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@
Ge
tMapping
(
value
=
"/getResourceInfo"
)
@
Pos
tMapping
(
value
=
"/getResourceInfo"
)
@ApiOperation
(
httpMethod
=
"
GE
T"
,
value
=
"根据type获取当前登录所在单位下的项目中的所有资源列表"
,
notes
=
"根据type获取当前登录所在单位下的项目中的所有资源列表"
)
@ApiOperation
(
httpMethod
=
"
POS
T"
,
value
=
"根据type获取当前登录所在单位下的项目中的所有资源列表"
,
notes
=
"根据type获取当前登录所在单位下的项目中的所有资源列表"
)
public
ResponseModel
<
IPage
>
getResourceInfo
(
String
type
,
String
current
,
String
size
){
public
ResponseModel
<
IPage
>
getResourceInfo
(
String
type
,
String
current
,
String
size
,
@RequestBody
JSONObject
jsonObject
){
IPage
page
=
new
Page
();
IPage
page
=
new
Page
();
page
.
setSize
(
Long
.
parseLong
(
size
));
page
.
setSize
(
Long
.
parseLong
(
size
));
page
.
setCurrent
(
Long
.
parseLong
(
current
));
page
.
setCurrent
(
Long
.
parseLong
(
current
));
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectResourceServiceImpl.java
View file @
47ad5b19
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectMaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
...
@@ -30,11 +31,8 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
...
@@ -30,11 +31,8 @@ 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
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
.
ProjectResourceEnum
.*;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
.
ProjectResourceEnum
.*;
...
@@ -214,8 +212,10 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
...
@@ -214,8 +212,10 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
List
<
Long
>
projectIdList
=
new
ArrayList
<>();
List
<
Long
>
projectIdList
=
new
ArrayList
<>();
List
<
Long
>
idList
=
new
ArrayList
<>();
List
<
Long
>
idList
=
new
ArrayList
<>();
List
list
=
new
ArrayList
<>();
List
list
=
new
ArrayList
<>();
Map
map
=
new
HashMap
();
for
(
Project
project:
projectList
){
for
(
Project
project:
projectList
){
projectIdList
.
add
(
project
.
getSequenceNbr
());
projectIdList
.
add
(
project
.
getSequenceNbr
());
map
.
put
(
project
.
getSequenceNbr
(),
project
.
getName
());
}
}
for
(
Long
projectId:
projectIdList
){
for
(
Long
projectId:
projectIdList
){
LambdaQueryWrapper
<
ProjectResource
>
projectResourceWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
ProjectResource
>
projectResourceWrapper
=
new
LambdaQueryWrapper
<>();
...
@@ -224,22 +224,33 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
...
@@ -224,22 +224,33 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
IPage
<
ProjectResource
>
projectResourceList
=
this
.
page
(
page
,
projectResourceWrapper
);
IPage
<
ProjectResource
>
projectResourceList
=
this
.
page
(
page
,
projectResourceWrapper
);
for
(
ProjectResource
projectResource
:
projectResourceList
.
getRecords
()){
for
(
ProjectResource
projectResource
:
projectResourceList
.
getRecords
()){
idList
.
add
(
projectResource
.
getResourceId
());
idList
.
add
(
projectResource
.
getResourceId
());
map
.
put
(
projectResource
.
getResourceId
(),
map
.
get
(
projectId
));
}
}
}
}
if
(
焊工资源
.
getCode
().
equals
(
type
)){
if
(
焊工资源
.
getCode
().
equals
(
type
)){
List
<
Map
>
mapList
=
new
ArrayList
<>();
List
<
Map
>
mapList
=
new
ArrayList
<>();
for
(
Long
welderId:
idList
){
for
(
Long
welderId:
idList
){
mapList
.
add
(
orgService
.
getdetialInfo
(
String
.
valueOf
(
welderId
)));
Map
detailMap
=
orgService
.
getdetialInfo
(
String
.
valueOf
(
welderId
));
detailMap
.
put
(
"projectName"
,
map
.
get
(
welderId
));
mapList
.
add
(
detailMap
);
}
}
page
.
setRecords
(
mapList
);
page
.
setRecords
(
mapList
);
}
else
if
(
管材资源
.
getCode
().
equals
(
type
)){
}
else
if
(
管材资源
.
getCode
().
equals
(
type
)){
for
(
Long
id:
idList
){
for
(
Long
id:
idList
){
list
.
add
(
materialService
.
getById
(
id
));
ProjectMaterialDto
projectMaterialDto
=
new
ProjectMaterialDto
();
BeanUtils
.
copyProperties
(
materialService
.
getById
(
id
),
projectMaterialDto
);
projectMaterialDto
.
setProjectName
(
String
.
valueOf
(
map
.
get
(
id
)));
projectMaterialDto
.
setProjectResourceId
(
id
);
list
.
add
(
projectMaterialDto
);
}
}
page
.
setRecords
(
list
);
page
.
setRecords
(
list
);
}
else
{
}
else
{
for
(
Long
id:
idList
){
for
(
Long
id:
idList
){
list
.
add
(
equipmentService
.
getById
(
id
));
WelderEquipmentDto
welderEquipmentDto
=
new
WelderEquipmentDto
();
BeanUtils
.
copyProperties
(
equipmentService
.
getById
(
id
),
welderEquipmentDto
);
welderEquipmentDto
.
setProjectName
(
String
.
valueOf
(
map
.
get
(
id
)));
welderEquipmentDto
.
setProjectResourceId
(
String
.
valueOf
(
id
));
list
.
add
(
welderEquipmentDto
);
}
}
page
.
setRecords
(
list
);
page
.
setRecords
(
list
);
}
}
...
...
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