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
96edbe07
Commit
96edbe07
authored
Nov 18, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改根据项目id查询项目下的管材接口
修改根据项目id查询项目下的设备接口
parent
318d5d80
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
ProjectResourceController.java
.../module/ugp/biz/controller/ProjectResourceController.java
+13
-3
ProjectResourceServiceImpl.java
...dule/ugp/biz/service/impl/ProjectResourceServiceImpl.java
+22
-5
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 @
96edbe07
...
...
@@ -15,6 +15,7 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.MaterialServiceImpl
;
import
org.aspectj.bridge.Message
;
import
org.springframework.validation.ValidationUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -22,14 +23,17 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectResourceServiceImpl
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.xml.bind.ValidationEvent
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -221,7 +225,7 @@ public class ProjectResourceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/projectEquipment"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据项目id获取项目使用到的设备"
,
notes
=
"根据项目id获取项目使用到的设备"
)
public
ResponseModel
<
List
<
ProjectResource
>>
projectEquipment
(
@RequestParam
String
projectId
){
public
ResponseModel
<
List
<
JSONObject
>>
projectEquipment
(
@RequestParam
String
projectId
){
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
getProjectEquipment
(
projectId
));
}
...
...
@@ -234,7 +238,7 @@ public class ProjectResourceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/projectMaterial"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据项目ID获取项目使用到的管材"
,
notes
=
"根据项目ID获取项目使用到的管材"
)
public
ResponseModel
<
List
<
ProjectResource
>>
projectMaterial
(
@RequestParam
String
projectId
){
public
ResponseModel
<
List
<
JSONObject
>>
projectMaterial
(
@RequestParam
String
projectId
){
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
getProjectMaterial
(
projectId
));
}
...
...
@@ -281,7 +285,13 @@ public class ProjectResourceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/getResourceInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据type获取当前登录所在单位下的项目中的所有资源列表"
,
notes
=
"根据type获取当前登录所在单位下的项目中的所有资源列表"
)
public
ResponseModel
<
IPage
>
getResourceInfo
(
Long
current
,
Long
size
,
String
type
,
@RequestBody
(
required
=
false
)
ProjectResourceDto
projectResourceinfo
){
public
ResponseModel
<
IPage
>
getResourceInfo
(
@RequestParam
(
required
=
false
)
Long
current
,
@RequestParam
(
required
=
false
)
Long
size
,
String
type
,
@RequestBody
(
required
=
false
)
ProjectResourceDto
projectResourceinfo
){
if
(
ValidationUtil
.
isEmpty
(
size
)){
size
=
Long
.
MAX_VALUE
;
}
if
(
ValidationUtil
.
isEmpty
(
current
)){
current
=
0L
;
}
IPage
page
=
new
Page
();
page
.
setSize
(
size
);
page
.
setCurrent
(
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 @
96edbe07
...
...
@@ -201,9 +201,17 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
* @param projectId
* @return
*/
public
List
<
ProjectResource
>
getProjectEquipment
(
String
projectId
){
return
getProjectResources
(
projectId
,
设备资源
);
public
List
<
JSONObject
>
getProjectEquipment
(
String
projectId
){
List
<
ProjectResource
>
resourceList
=
getProjectResources
(
projectId
,
设备资源
);
List
<
JSONObject
>
mapList
=
new
ArrayList
<>();
for
(
ProjectResource
projectResource
:
resourceList
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
projectResource
));
LambdaQueryWrapper
<
Equipment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Equipment:
:
getSequenceNbr
,
projectResource
.
getResourceId
());
jsonObject
.
putAll
(
equipmentService
.
getMap
(
wrapper
));
mapList
.
add
(
jsonObject
);
}
return
mapList
;
}
/**
...
...
@@ -211,8 +219,17 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
* @param projectId
* @return
*/
public
List
<
ProjectResource
>
getProjectMaterial
(
String
projectId
){
return
getProjectResources
(
projectId
,
管材资源
);
public
List
<
JSONObject
>
getProjectMaterial
(
String
projectId
){
List
<
ProjectResource
>
resourceList
=
getProjectResources
(
projectId
,
管材资源
);
List
<
JSONObject
>
mapList
=
new
ArrayList
<>();
for
(
ProjectResource
projectResource
:
resourceList
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
projectResource
));
LambdaQueryWrapper
<
Equipment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Equipment:
:
getSequenceNbr
,
projectResource
.
getResourceId
());
jsonObject
.
putAll
(
equipmentService
.
getMap
(
wrapper
));
mapList
.
add
(
jsonObject
);
}
return
mapList
;
}
/**
...
...
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