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
9c718f2d
Commit
9c718f2d
authored
Mar 13, 2023
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增根据资源id获取资源的附件信息接口,修改管材列表接口
parent
f49531f2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
11 deletions
+78
-11
MaterialDto.java
...com/yeejoin/amos/boot/module/ugp/api/dto/MaterialDto.java
+4
-0
MaterialController.java
...os/boot/module/ugp/biz/controller/MaterialController.java
+2
-2
AttachmentServiceImpl.java
...ot/module/ugp/biz/service/impl/AttachmentServiceImpl.java
+36
-3
MaterialServiceImpl.java
...boot/module/ugp/biz/service/impl/MaterialServiceImpl.java
+36
-6
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/MaterialDto.java
View file @
9c718f2d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* 材料信息表
* 材料信息表
...
@@ -69,4 +71,6 @@ public class MaterialDto extends BaseDto {
...
@@ -69,4 +71,6 @@ public class MaterialDto extends BaseDto {
@ApiModelProperty
(
value
=
"项目id"
)
@ApiModelProperty
(
value
=
"项目id"
)
private
Long
projectId
;
private
Long
projectId
;
private
List
<
JSONObject
>
files
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/MaterialController.java
View file @
9c718f2d
...
@@ -151,7 +151,7 @@ public class MaterialController extends BaseController {
...
@@ -151,7 +151,7 @@ public class MaterialController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/pageOutList"
)
@GetMapping
(
value
=
"/pageOutList"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表分页查询"
,
notes
=
"材料信息表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表分页查询"
,
notes
=
"材料信息表分页查询"
)
public
ResponseModel
<
IPage
<
Material
>>
queryPage
(
int
current
,
int
size
,
MaterialDto
material
)
{
public
ResponseModel
<
IPage
<
Material
Dto
>>
queryPage
(
int
current
,
int
size
,
MaterialDto
material
)
{
IPage
<
Material
>
page
=
new
Page
<>();
IPage
<
Material
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
.
setSize
(
size
);
...
@@ -168,7 +168,7 @@ public class MaterialController extends BaseController {
...
@@ -168,7 +168,7 @@ public class MaterialController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/pageInList"
)
@GetMapping
(
value
=
"/pageInList"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表分页查询"
,
notes
=
"材料信息表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表分页查询"
,
notes
=
"材料信息表分页查询"
)
public
ResponseModel
<
IPage
<
Material
>>
queryMaterialPage
(
int
current
,
int
size
,
MaterialDto
material
)
{
public
ResponseModel
<
IPage
<
Material
Dto
>>
queryMaterialPage
(
int
current
,
int
size
,
MaterialDto
material
)
{
IPage
<
Material
>
page
=
new
Page
<>();
IPage
<
Material
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
.
setSize
(
size
);
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/AttachmentServiceImpl.java
View file @
9c718f2d
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
...
@@ -20,9 +21,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
...
@@ -20,9 +21,7 @@ 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.HashMap
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.ugp.biz.controller.ProjectController
;
import
com.yeejoin.amos.boot.module.ugp.biz.controller.ProjectController
;
...
@@ -111,4 +110,37 @@ public class AttachmentServiceImpl extends BaseService<AttachmentDto,Attachment,
...
@@ -111,4 +110,37 @@ public class AttachmentServiceImpl extends BaseService<AttachmentDto,Attachment,
}
}
public
List
<
JSONObject
>
getFilesBySourceId
(
Long
sourceId
){
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Attachment
::
getSourceId
,
sourceId
);
List
<
Attachment
>
attachmentList
=
this
.
list
(
wrapper
);
Iterator
<
Attachment
>
iterator
=
attachmentList
.
iterator
();
List
<
JSONObject
>
jsonList
=
new
ArrayList
<>();
while
(
iterator
.
hasNext
())
{
Attachment
attachment
=
iterator
.
next
();
String
info
=
attachment
.
getInfo
();
JSONArray
jsonArray
;
if
(!
ValidationUtil
.
isEmpty
(
info
)){
try
{
jsonArray
=
JSON
.
parseArray
(
info
);
}
catch
(
Exception
e
)
{
continue
;
}
if
(!
ValidationUtil
.
isEmpty
(
jsonArray
)){
for
(
Object
object:
jsonArray
){
JSONObject
jo
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
object
));
JSONArray
ja
=
jo
.
getJSONArray
(
"info"
);
if
(!
ValidationUtil
.
isEmpty
(
ja
)){
for
(
Object
o
:
ja
)
{
JSONObject
jot
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
o
));
jsonList
.
add
(
jot
);
}
}
}
}
}
}
return
jsonList
;
}
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/MaterialServiceImpl.java
View file @
9c718f2d
...
@@ -62,6 +62,9 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
...
@@ -62,6 +62,9 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
@Autowired
@Autowired
ProjectResourceServiceImpl
projectResourceServiceImpl
;
ProjectResourceServiceImpl
projectResourceServiceImpl
;
@Autowired
AttachmentServiceImpl
attachmentService
;
/**
/**
* 分页查询
* 分页查询
*/
*/
...
@@ -82,7 +85,7 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
...
@@ -82,7 +85,7 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
/**
/**
* 提交资料 获取管材列表 分页查询 projectId关联的资源
* 提交资料 获取管材列表 分页查询 projectId关联的资源
*/
*/
public
IPage
<
Material
>
queryOutPage
(
IPage
<
Material
>
page
,
MaterialDto
material
)
{
public
IPage
<
Material
Dto
>
queryOutPage
(
IPage
<
Material
>
page
,
MaterialDto
material
)
{
LambdaQueryWrapper
<
Material
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
Material
>
wrapper
=
new
LambdaQueryWrapper
<>();
List
materialIds
=
new
ArrayList
<>();
List
materialIds
=
new
ArrayList
<>();
LambdaQueryWrapper
<
ProjectResource
>
resourceWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
ProjectResource
>
resourceWrapper
=
new
LambdaQueryWrapper
<>();
...
@@ -100,14 +103,27 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
...
@@ -100,14 +103,27 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
}
}
getWrapper
(
wrapper
,
material
);
getWrapper
(
wrapper
,
material
);
wrapper
.
in
(
Material:
:
getCompanyId
,
getCompanyIds
());
page
=
this
.
page
(
page
,
wrapper
);
return
this
.
page
(
page
,
wrapper
);
IPage
<
MaterialDto
>
dtoPage
=
new
Page
<>();
BeanUtils
.
copyProperties
(
page
,
dtoPage
);
List
<
Material
>
materialList
=
page
.
getRecords
();
List
<
MaterialDto
>
materialDtoList
=
new
ArrayList
<>();
if
(!
ValidationUtil
.
isEmpty
(
materialList
))
{
for
(
Material
mt
:
materialList
)
{
MaterialDto
materialDto
=
new
MaterialDto
();
BeanUtils
.
copyProperties
(
mt
,
materialDto
);
materialDto
.
setFiles
(
attachmentService
.
getFilesBySourceId
(
mt
.
getSequenceNbr
()));
materialDtoList
.
add
(
materialDto
);
}
}
dtoPage
.
setRecords
(
materialDtoList
);
return
dtoPage
;
}
}
/**
/**
* 提交资料 获取管材列表 分页查询 projectId关联的资源和空闲的资源
* 提交资料 获取管材列表 分页查询 projectId关联的资源和空闲的资源
*/
*/
public
IPage
<
Material
>
queryInPage
(
IPage
<
Material
>
page
,
MaterialDto
material
)
{
public
IPage
<
Material
Dto
>
queryInPage
(
IPage
<
Material
>
page
,
MaterialDto
material
)
{
LambdaQueryWrapper
<
Material
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
Material
>
wrapper
=
new
LambdaQueryWrapper
<>();
List
materialIds
=
new
ArrayList
<>();
List
materialIds
=
new
ArrayList
<>();
LambdaQueryWrapper
<
ProjectResource
>
resourceWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
ProjectResource
>
resourceWrapper
=
new
LambdaQueryWrapper
<>();
...
@@ -123,10 +139,24 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
...
@@ -123,10 +139,24 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
getWrapper
(
wrapper
,
material
);
getWrapper
(
wrapper
,
material
);
wrapper
.
in
(
Material:
:
getCompanyId
,
getCompanyIds
());
wrapper
.
in
(
Material:
:
getCompanyId
,
getCompanyIds
());
return
this
.
page
(
page
,
wrapper
);
}
page
=
this
.
page
(
page
,
wrapper
);
IPage
<
MaterialDto
>
dtoPage
=
new
Page
<>();
BeanUtils
.
copyProperties
(
page
,
dtoPage
);
List
<
Material
>
materialList
=
page
.
getRecords
();
List
<
MaterialDto
>
materialDtoList
=
new
ArrayList
<>();
if
(!
ValidationUtil
.
isEmpty
(
materialList
))
{
for
(
Material
mt
:
materialList
)
{
MaterialDto
materialDto
=
new
MaterialDto
();
BeanUtils
.
copyProperties
(
mt
,
materialDto
);
materialDto
.
setFiles
(
attachmentService
.
getFilesBySourceId
(
mt
.
getSequenceNbr
()));
materialDtoList
.
add
(
materialDto
);
}
}
dtoPage
.
setRecords
(
materialDtoList
);
return
dtoPage
;
}
public
void
getWrapper
(
LambdaQueryWrapper
<
Material
>
wrapper
,
MaterialDto
material
){
public
void
getWrapper
(
LambdaQueryWrapper
<
Material
>
wrapper
,
MaterialDto
material
){
if
(!
ValidationUtil
.
isEmpty
(
material
.
getName
())){
if
(!
ValidationUtil
.
isEmpty
(
material
.
getName
())){
...
...
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