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
a194047c
Commit
a194047c
authored
Mar 13, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
9c718f2d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
36 deletions
+121
-36
InformationDto.java
.../yeejoin/amos/boot/module/ugp/api/dto/InformationDto.java
+2
-0
ProjectController.java
...mos/boot/module/ugp/biz/controller/ProjectController.java
+9
-2
ProjectServiceImpl.java
.../boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
+110
-34
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/InformationDto.java
View file @
a194047c
...
@@ -12,6 +12,8 @@ public class InformationDto {
...
@@ -12,6 +12,8 @@ public class InformationDto {
private
List
<
Map
<
String
,
Object
>>
welderList
;
private
List
<
Map
<
String
,
Object
>>
welderList
;
private
List
<
Map
<
String
,
Object
>>
materialList
;
private
List
<
Map
<
String
,
Object
>>
materialList
;
private
List
<
Map
<
String
,
Object
>>
fileList
;
private
List
<
Map
<
String
,
Object
>>
fileList
;
private
JSONObject
fileJson
;
private
Long
projectId
;
private
Long
projectId
;
private
String
type
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectController.java
View file @
a194047c
...
@@ -430,13 +430,20 @@ public class ProjectController extends BaseController {
...
@@ -430,13 +430,20 @@ public class ProjectController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"资料提交
保存"
,
notes
=
"资料提交
保存"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"资料提交
/保存"
,
notes
=
"资料提交/
保存"
)
@PostMapping
(
value
=
"/informationSaveOrUpdate"
)
@PostMapping
(
value
=
"/informationSaveOrUpdate"
)
public
ResponseModel
<
Object
>
informationSaveOrUpdate
(
@RequestBody
InformationDto
dto
){
public
ResponseModel
<
Object
>
informationSaveOrUpdate
(
@RequestBody
InformationDto
dto
){
projectServiceImpl
.
informationSaveOrUpdate
(
dto
.
getEquipmentList
(),
dto
.
getWelderList
(),
dto
.
getMaterialList
(),
dto
.
getFile
List
(),
dto
.
getProjectId
());
projectServiceImpl
.
informationSaveOrUpdate
(
dto
.
getEquipmentList
(),
dto
.
getWelderList
(),
dto
.
getMaterialList
(),
dto
.
getFile
Json
(),
dto
.
getProjectId
(),
dto
.
getType
());
return
ResponseHelper
.
buildResponse
(
"ok"
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"资料保存、审核"
,
notes
=
"资料保存、审核"
)
@PostMapping
(
value
=
"/informationAudit"
)
public
ResponseModel
<
Object
>
informationAudit
(
@RequestBody
InformationDto
dto
){
projectServiceImpl
.
informationAudit
(
dto
.
getEquipmentList
(),
dto
.
getWelderList
(),
dto
.
getMaterialList
(),
dto
.
getFileList
(),
dto
.
getProjectId
(),
dto
.
getType
());
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
/**
* 审核资料详情
* 审核资料详情
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
View file @
a194047c
...
@@ -3,8 +3,8 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
...
@@ -3,8 +3,8 @@ 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.alibaba.fastjson.serializer.SerializerFeature
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
...
@@ -14,10 +14,12 @@ import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
...
@@ -14,10 +14,12 @@ import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PipeDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PipeDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectProcessDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectProcessDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.SuperviseRuleMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.SuperviseRuleMapper
;
...
@@ -41,6 +43,7 @@ import java.math.BigDecimal;
...
@@ -41,6 +43,7 @@ import java.math.BigDecimal;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
/**
/**
* 项目信息表服务实现类
* 项目信息表服务实现类
...
@@ -89,6 +92,9 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
...
@@ -89,6 +92,9 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
@Autowired
@Autowired
IPipeServiceImpl
pipeService
;
IPipeServiceImpl
pipeService
;
@Autowired
AttachmentMapper
attachmentMapper
;
public
ProjectDto
saveProjectInfo
(
ProjectDto
model
,
String
submitType
){
public
ProjectDto
saveProjectInfo
(
ProjectDto
model
,
String
submitType
){
String
regionName
=
""
,
regionCode
=
""
;
String
regionName
=
""
,
regionCode
=
""
;
...
@@ -337,7 +343,6 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
...
@@ -337,7 +343,6 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
JSONArray
installSubForm
=
JSON
.
parseArray
(
XJConstant
.
INSTALL_SUB_FORM
);
JSONArray
installSubForm
=
JSON
.
parseArray
(
XJConstant
.
INSTALL_SUB_FORM
);
JSONArray
designSubForm
=
JSON
.
parseArray
(
XJConstant
.
DESIGN_SUB_FORM
);
JSONArray
designSubForm
=
JSON
.
parseArray
(
XJConstant
.
DESIGN_SUB_FORM
);
if
(!
ValidationUtil
.
isEmpty
(
jsonObject
)){
if
(!
ValidationUtil
.
isEmpty
(
jsonObject
)){
installSubForm
=
jsonObject
.
getJSONArray
(
"installSubForm"
);
installSubForm
=
jsonObject
.
getJSONArray
(
"installSubForm"
);
designSubForm
=
jsonObject
.
getJSONArray
(
"designSubForm"
);
designSubForm
=
jsonObject
.
getJSONArray
(
"designSubForm"
);
}
}
...
@@ -649,96 +654,166 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
...
@@ -649,96 +654,166 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
return
projectDtoList
;
return
projectDtoList
;
}
}
public
Map
<
String
,
Object
>
getInformationDetail
(
Long
sequenceNbr
){
public
Map
<
String
,
Object
>
getInformationDetail
(
Long
sequenceNbr
)
{
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Attachment:
:
getSourceId
,
sequenceNbr
);
wrapper
.
eq
(
Attachment:
:
getSourceId
,
sequenceNbr
);
Attachment
attachment
=
attachmentService
.
getOne
(
wrapper
);
Attachment
attachment
=
attachmentService
.
getOne
(
wrapper
);
JSONObject
jsonObject
=
null
;
JSONObject
jsonObject
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
attachment
)
&&
!
ObjectUtils
.
isEmpty
(
attachment
.
getInfo
()))
{
if
(!
ObjectUtils
.
isEmpty
(
attachment
)
&&
!
ObjectUtils
.
isEmpty
(
attachment
.
getInfo
()))
{
jsonObject
=
JSON
.
parseObject
(
attachment
.
getInfo
());
jsonObject
=
JSON
.
parseObject
(
attachment
.
getInfo
());
return
jsonObject
;
return
jsonObject
;
}
else
{
}
else
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"installSubForm"
,
XJConstant
.
INSTALL_SUB_FORM_NEW
);
map
.
put
(
"installSubForm"
,
XJConstant
.
INSTALL_SUB_FORM_NEW
);
map
.
put
(
"designSubForm"
,
XJConstant
.
DESIGN_SUB_FORM_NEW
);
map
.
put
(
"designSubForm"
,
XJConstant
.
DESIGN_SUB_FORM_NEW
);
return
map
;
return
map
;
}
}
}
}
public
List
<
Map
<
String
,
Object
>>
getAuditInformationDetail
(
Long
sequenceNbr
){
public
List
<
Map
<
String
,
Object
>>
getAuditInformationDetail
(
Long
sequenceNbr
)
{
ArrayList
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
ArrayList
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Attachment:
:
getSourceId
,
sequenceNbr
);
wrapper
.
eq
(
Attachment:
:
getSourceId
,
sequenceNbr
);
Attachment
attachment
=
attachmentService
.
getOne
(
wrapper
);
Attachment
attachment
=
attachmentService
.
getOne
(
wrapper
);
if
(!
ObjectUtils
.
isEmpty
(
attachment
)
&&
!
ObjectUtils
.
isEmpty
(
attachment
.
getInfo
()))
{
if
(!
ObjectUtils
.
isEmpty
(
attachment
)
&&
!
ObjectUtils
.
isEmpty
(
attachment
.
getInfo
()))
{
Map
<
String
,
Object
>
map
=
JSON
.
parseObject
(
attachment
.
getInfo
());
Map
<
String
,
Object
>
map
=
JSON
.
parseObject
(
attachment
.
getInfo
());
List
<
Map
<
String
,
Object
>>
installSubForm
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"installSubForm"
);
List
<
Map
<
String
,
Object
>>
installSubForm
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"installSubForm"
);
data
(
"subFormInstall"
,
installSubForm
,
result
,
attachment
.
getRecDate
());
data
(
"subFormInstall"
,
installSubForm
,
result
,
attachment
.
getRecDate
());
List
<
Map
<
String
,
Object
>>
designSubForm
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"designSubForm"
);
List
<
Map
<
String
,
Object
>>
designSubForm
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"designSubForm"
);
data
(
"designSubForm"
,
designSubForm
,
result
,
attachment
.
getRecDate
());
data
(
"designSubForm"
,
designSubForm
,
result
,
attachment
.
getRecDate
());
}
}
return
result
;
return
result
;
}
}
private
List
<
Map
<
String
,
Object
>>
data
(
String
type
,
List
<
Map
<
String
,
Object
>>
data
,
List
<
Map
<
String
,
Object
>>
result
,
Date
date
)
{
private
List
<
Map
<
String
,
Object
>>
data
(
String
type
,
List
<
Map
<
String
,
Object
>>
data
,
List
<
Map
<
String
,
Object
>>
result
,
Date
date
)
{
data
.
forEach
(
item
->
{
data
.
forEach
(
item
->
{
HashMap
<
String
,
Object
>
messageData
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
messageData
=
new
HashMap
<>();
messageData
.
put
(
"name"
,
item
.
get
(
type
));
messageData
.
put
(
"name"
,
item
.
get
(
"type"
));
messageData
.
put
(
"date"
,
date
);
messageData
.
put
(
"date"
,
date
);
List
<
Map
<
String
,
Object
>>
infoList
=
(
List
<
Map
<
String
,
Object
>>)
item
.
get
(
"info"
);
messageData
.
put
(
"type"
,
type
);
infoList
.
forEach
(
itemInfo
->{
List
<
Map
<
String
,
Object
>>
infoList
=
(
List
<
Map
<
String
,
Object
>>)
item
.
get
(
"info"
);
infoList
.
forEach
(
itemInfo
->
{
messageData
.
put
(
"fileName"
,
itemInfo
.
get
(
"name"
));
messageData
.
put
(
"fileName"
,
itemInfo
.
get
(
"name"
));
messageData
.
put
(
"fileUrl"
,
itemInfo
.
get
(
"url"
));
messageData
.
put
(
"fileUrl"
,
itemInfo
.
get
(
"url"
));
messageData
.
put
(
"status"
,
"1"
);
messageData
.
put
(
"uid"
,
itemInfo
.
get
(
"uid"
));
messageData
.
put
(
"status"
,
itemInfo
.
getOrDefault
(
"auditStatus"
,
"1"
));
result
.
add
(
messageData
);
result
.
add
(
messageData
);
}
);
});
});
});
return
result
;
return
result
;
}
}
@Transactional
@Transactional
public
String
informationSaveOrUpdate
(
List
<
Map
<
String
,
Object
>>
equipmentList
,
public
String
informationSaveOrUpdate
(
List
<
Map
<
String
,
Object
>>
equipmentList
,
List
<
Map
<
String
,
Object
>>
welderList
,
List
<
Map
<
String
,
Object
>>
welderList
,
List
<
Map
<
String
,
Object
>>
materialList
,
List
<
Map
<
String
,
Object
>>
materialList
,
List
<
Map
<
String
,
Object
>>
fileList
,
JSONObject
fileJson
,
Long
projectId
)
{
Long
projectId
,
String
type
)
{
// 保存资源信息
saveResourceMessage
(
equipmentList
,
welderList
,
materialList
,
projectId
);
// 文件信息
Attachment
attachment
=
new
Attachment
();
attachment
.
setSourceId
(
projectId
);
attachment
.
setInfo
(
fileJson
.
toJSONString
());
attachment
.
setType
(
"project"
);
LambdaQueryWrapper
<
Attachment
>
attachmentLambda
=
new
QueryWrapper
<
Attachment
>().
lambda
();
attachmentLambda
.
eq
(
Attachment:
:
getSourceId
,
projectId
);
attachmentMapper
.
delete
(
attachmentLambda
);
attachmentService
.
save
(
attachment
);
if
(
"submit"
.
equals
(
type
))
{
// 触发流程 todo
}
return
"ok"
;
}
private
void
saveResourceMessage
(
List
<
Map
<
String
,
Object
>>
equipmentList
,
List
<
Map
<
String
,
Object
>>
welderList
,
List
<
Map
<
String
,
Object
>>
materialList
,
Long
projectId
)
{
ArrayList
<
ProjectResource
>
projectResources
=
new
ArrayList
<>();
ArrayList
<
ProjectResource
>
projectResources
=
new
ArrayList
<>();
// 焊机信息
// 焊机信息
equipmentList
.
forEach
(
item
->{
equipmentList
.
forEach
(
item
->
{
ProjectResource
projectResource
=
new
ProjectResource
();
ProjectResource
projectResource
=
new
ProjectResource
();
projectResource
.
setProjectId
(
projectId
);
projectResource
.
setProjectId
(
projectId
);
projectResource
.
setResourceId
(
Long
.
valueOf
(
String
.
valueOf
(
item
.
get
(
"sequenceNbr"
))));
projectResource
.
setResourceId
(
Long
.
valueOf
(
String
.
valueOf
(
item
.
get
(
"sequenceNbr"
))));
projectResource
.
setType
(
"equipment"
);
projectResource
.
setType
(
"equipment"
);
projectResource
.
setName
(
String
.
valueOf
(
item
.
get
(
"name"
)));
projectResource
.
setName
(
String
.
valueOf
(
item
.
get
(
"name"
)));
projectResource
.
setStatus
(
ObjectUtils
.
isEmpty
(
item
.
get
(
"status"
))
?
"0"
:
String
.
valueOf
(
item
.
get
(
"status"
)));
projectResources
.
add
(
projectResource
);
projectResources
.
add
(
projectResource
);
});
});
// 焊工信息
// 焊工信息
welderList
.
forEach
(
item
->{
welderList
.
forEach
(
item
->
{
ProjectResource
projectResource
=
new
ProjectResource
();
ProjectResource
projectResource
=
new
ProjectResource
();
projectResource
.
setProjectId
(
projectId
);
projectResource
.
setProjectId
(
projectId
);
projectResource
.
setResourceId
(
Long
.
valueOf
(
String
.
valueOf
(
item
.
get
(
"sequenceNbr"
))));
projectResource
.
setResourceId
(
Long
.
valueOf
(
String
.
valueOf
(
item
.
get
(
"sequenceNbr"
))));
projectResource
.
setType
(
"welder"
);
projectResource
.
setType
(
"welder"
);
projectResource
.
setName
(
String
.
valueOf
(
item
.
get
(
"name"
)));
projectResource
.
setName
(
String
.
valueOf
(
item
.
get
(
"name"
)));
projectResource
.
setStatus
(
ObjectUtils
.
isEmpty
(
item
.
get
(
"status"
))
?
"0"
:
String
.
valueOf
(
item
.
get
(
"status"
)));
projectResources
.
add
(
projectResource
);
projectResources
.
add
(
projectResource
);
});
});
// 管材信息
// 管材信息
materialList
.
forEach
(
item
->{
materialList
.
forEach
(
item
->
{
ProjectResource
projectResource
=
new
ProjectResource
();
ProjectResource
projectResource
=
new
ProjectResource
();
projectResource
.
setProjectId
(
projectId
);
projectResource
.
setProjectId
(
projectId
);
projectResource
.
setResourceId
(
Long
.
valueOf
(
String
.
valueOf
(
item
.
get
(
"sequenceNbr"
))));
projectResource
.
setResourceId
(
Long
.
valueOf
(
String
.
valueOf
(
item
.
get
(
"sequenceNbr"
))));
projectResource
.
setType
(
"material"
);
projectResource
.
setType
(
"material"
);
projectResource
.
setName
(
String
.
valueOf
(
item
.
get
(
"name"
)));
projectResource
.
setName
(
String
.
valueOf
(
item
.
get
(
"name"
)));
projectResource
.
setStatus
(
ObjectUtils
.
isEmpty
(
item
.
get
(
"status"
))
?
"0"
:
String
.
valueOf
(
item
.
get
(
"status"
)));
projectResources
.
add
(
projectResource
);
projectResources
.
add
(
projectResource
);
});
});
projectResourceService
.
saveOrUpdateBatch
(
projectResources
);
LambdaQueryWrapper
<
ProjectResource
>
lambda
=
new
QueryWrapper
<
ProjectResource
>().
lambda
();
lambda
.
eq
(
ProjectResource:
:
getProjectId
,
projectId
);
projectResourceMapper
.
delete
(
lambda
);
projectResourceService
.
saveBatch
(
projectResources
);
}
@Transactional
public
String
informationAudit
(
List
<
Map
<
String
,
Object
>>
equipmentList
,
List
<
Map
<
String
,
Object
>>
welderList
,
List
<
Map
<
String
,
Object
>>
materialList
,
List
<
Map
<
String
,
Object
>>
fileList
,
Long
projectId
,
String
type
)
{
// 保存资源信息
saveResourceMessage
(
equipmentList
,
welderList
,
materialList
,
projectId
);
// 文件信息
// 文件信息
Attachment
attachment
=
new
Attachment
();
AttachmentDto
attachmentDto
=
attachmentService
.
getAttachment
(
projectId
);
attachment
.
setSourceId
(
projectId
);
if
(!
ObjectUtils
.
isEmpty
(
attachmentDto
)
&&
!
ObjectUtils
.
isEmpty
(
attachmentDto
.
getInfo
()))
{
// attachment.setInfo(fileList.toJSONString());
Map
<
String
,
Object
>
map
=
JSON
.
parseObject
(
attachmentDto
.
getInfo
());
attachment
.
setType
(
"project"
);
List
<
Map
<
String
,
Object
>>
installSubForm
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"installSubForm"
);
attachmentService
.
save
(
attachment
);
// 文件信息json处理
changeStatus
(
installSubForm
,
fileList
);
List
<
Map
<
String
,
Object
>>
designSubForm
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"designSubForm"
);
// 文件信息json处理
changeStatus
(
designSubForm
,
fileList
);
Attachment
attachment
=
new
Attachment
();
attachment
.
setSourceId
(
projectId
);
attachment
.
setInfo
(
JSON
.
toJSONString
(
map
));
attachment
.
setType
(
"project"
);
LambdaQueryWrapper
<
Attachment
>
attachmentLambda
=
new
QueryWrapper
<
Attachment
>().
lambda
();
attachmentLambda
.
eq
(
Attachment:
:
getSourceId
,
projectId
);
attachmentMapper
.
delete
(
attachmentLambda
);
attachmentService
.
save
(
attachment
);
}
if
(
"submit"
.
equals
(
type
))
{
// 触发流程 todo
}
return
"ok"
;
return
"ok"
;
}
}
private
void
changeStatus
(
List
<
Map
<
String
,
Object
>>
data
,
List
<
Map
<
String
,
Object
>>
fileList
)
{
data
.
forEach
(
item
->
{
List
<
Map
<
String
,
Object
>>
installSubFormInfo
=
(
List
<
Map
<
String
,
Object
>>)
item
.
get
(
"info"
);
installSubFormInfo
.
forEach
(
infoItem
->
{
List
<
Map
<
String
,
Object
>>
collect
=
fileList
.
stream
().
filter
(
itemData
->
itemData
.
get
(
"uid"
).
equals
(
infoItem
.
get
(
"uid"
))).
collect
(
Collectors
.
toList
());
infoItem
.
put
(
"auditStatus"
,
ObjectUtils
.
isEmpty
(
collect
.
get
(
0
).
get
(
"status"
))
?
""
:
collect
.
get
(
0
).
get
(
"status"
));
});
});
}
}
}
\ 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