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
c364e077
Commit
c364e077
authored
Dec 18, 2023
by
xixinzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jyjc): 检验结果技术参数修改
parent
2fb30a20
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
34 deletions
+56
-34
JyjcInspectionResultParam.java
...oot/module/jyjc/api/entity/JyjcInspectionResultParam.java
+8
-0
JyjcInspectionResultServiceImpl.java
...yjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
+48
-34
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/entity/JyjcInspectionResultParam.java
View file @
c364e077
...
@@ -39,4 +39,12 @@ public class JyjcInspectionResultParam extends BaseEntity {
...
@@ -39,4 +39,12 @@ public class JyjcInspectionResultParam extends BaseEntity {
@TableField
(
"remark"
)
@TableField
(
"remark"
)
private
String
remark
;
private
String
remark
;
/**
* 备注
*/
@TableField
(
"param_type"
)
private
String
paramType
;
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
View file @
c364e077
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
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.JSONPObject
;
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.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
...
@@ -115,7 +117,14 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
...
@@ -115,7 +117,14 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
public
JyjcInspectionResultModel
updateJyjcInspectionResult
(
Map
<
String
,
Map
<
String
,
Object
>>
tableModel
)
{
public
JyjcInspectionResultModel
updateJyjcInspectionResult
(
Map
<
String
,
Map
<
String
,
Object
>>
tableModel
)
{
Map
<
String
,
Object
>
map
=
tableModel
.
get
(
JYJC_SUBMIT_KEY
);
Map
<
String
,
Object
>
map
=
tableModel
.
get
(
JYJC_SUBMIT_KEY
);
JyjcInspectionResultModel
model
=
BeanUtil
.
mapToBean
(
map
,
JyjcInspectionResultModel
.
class
,
true
);
JyjcInspectionResultModel
model
=
BeanUtil
.
mapToBean
(
map
,
JyjcInspectionResultModel
.
class
,
true
);
String
inspector
=
model
.
getInspector
();
if
(
StringUtil
.
isNotEmpty
(
inspector
))
{
List
jsonArray
=
JSONArray
.
parseArray
(
inspector
);
Object
inspectors
=
jsonArray
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
));
model
.
setInspector
(
String
.
valueOf
(
inspectors
));
}
// 更新结果主表
// 更新结果主表
updateWithModel
(
model
);
updateWithModel
(
model
);
...
@@ -123,46 +132,49 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
...
@@ -123,46 +132,49 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
// 更新附件表
// 更新附件表
List
<
JyjcInspectionResultAttachment
>
attachmentList
=
new
ArrayList
<>();
List
<
JyjcInspectionResultAttachment
>
attachmentList
=
new
ArrayList
<>();
LambdaQueryWrapper
<
JyjcInspectionResultAttachment
>
fileWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
JyjcInspectionResultAttachment
>
fileWrapper
=
new
LambdaQueryWrapper
<>();
Map
<
String
,
Object
>
fileMap
=
new
HashMap
<>();
fileWrapper
.
eq
(
JyjcInspectionResultAttachment:
:
getResultSeq
,
model
.
getSequenceNbr
());
map
.
forEach
((
k
,
v
)
->
{
if
(
k
.
contains
(
JYJC_SUBMIT_FILE_PREFIX
)
&&
!
ObjectUtils
.
isEmpty
(
map
.
get
(
k
)))
{
fileWrapper
.
or
(
wrapper
->
wrapper
.
eq
(
JyjcInspectionResultAttachment:
:
getAttachmentType
,
k
).
eq
(
JyjcInspectionResultAttachment:
:
getResultSeq
,
model
.
getSequenceNbr
()));
fileMap
.
put
(
k
,
map
.
get
(
k
));
}
});
List
<
JyjcInspectionResultAttachment
>
fileList
=
attachmentService
.
list
(
fileWrapper
);
List
<
JyjcInspectionResultAttachment
>
fileList
=
attachmentService
.
list
(
fileWrapper
);
fileMap
.
forEach
((
k
,
v
)
->
{
JyjcInspectionResultAttachment
attachment
=
new
JyjcInspectionResultAttachment
();
map
.
forEach
((
k
,
v
)
->
{
attachment
.
setResultSeq
(
model
.
getSequenceNbr
());
if
(
k
.
contains
(
JYJC_SUBMIT_FILE_PREFIX
))
{
attachment
.
setAttachmentUrl
(
JSON
.
toJSONString
(
map
.
get
(
k
)));
JyjcInspectionResultAttachment
attachment
=
new
JyjcInspectionResultAttachment
();
attachment
.
setAttachmentType
(
k
);
attachment
.
setResultSeq
(
model
.
getSequenceNbr
());
// 新增时需要判断之前有就更新
attachment
.
setAttachmentUrl
(
JSON
.
toJSONString
(
map
.
get
(
k
)));
if
(!
CollectionUtils
.
isEmpty
(
fileList
))
{
attachment
.
setAttachmentType
(
k
);
List
<
JyjcInspectionResultAttachment
>
collect
=
fileList
.
stream
().
filter
(
obj
->
k
.
equals
(
obj
.
getAttachmentType
())).
collect
(
Collectors
.
toList
());
// 新增时需要判断之前有就更新
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
if
(!
CollectionUtils
.
isEmpty
(
fileList
))
{
JyjcInspectionResultAttachment
jyjcInspectionResultAttachment
=
collect
.
get
(
0
);
List
<
JyjcInspectionResultAttachment
>
collect
=
fileList
.
stream
().
filter
(
obj
->
k
.
equals
(
obj
.
getAttachmentType
())).
collect
(
Collectors
.
toList
());
attachment
.
setSequenceNbr
(
jyjcInspectionResultAttachment
.
getSequenceNbr
());
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
JyjcInspectionResultAttachment
jyjcInspectionResultAttachment
=
collect
.
get
(
0
);
attachment
.
setSequenceNbr
(
jyjcInspectionResultAttachment
.
getSequenceNbr
());
}
}
}
attachmentList
.
add
(
attachment
);
}
}
attachmentList
.
add
(
attachment
);
});
});
if
(!
CollectionUtils
.
isEmpty
(
attachmentList
))
{
if
(!
CollectionUtils
.
isEmpty
(
attachmentList
))
{
attachmentService
.
saveOrUpdateBatch
(
attachmentList
);
attachmentService
.
saveOrUpdateBatch
(
attachmentList
);
}
}
// 更新参数表
// 更新参数表
if
(!
CollectionUtils
.
isEmpty
(
model
.
getResultParamModelMap
())){
LambdaQueryWrapper
<
JyjcInspectionResultParam
>
paramWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
JyjcInspectionResultParam
>
paramWrapper
=
new
LambdaQueryWrapper
<>();
paramWrapper
.
eq
(
JyjcInspectionResultParam:
:
getResultSeq
,
model
.
getSequenceNbr
());
paramWrapper
.
eq
(
JyjcInspectionResultParam:
:
getResultSeq
,
model
.
getSequenceNbr
());
List
<
JyjcInspectionResultParam
>
params
=
resultParamService
.
list
(
paramWrapper
);
List
<
JyjcInspectionResultParam
>
params
=
resultParamService
.
list
(
paramWrapper
);
List
<
JyjcInspectionResultParam
>
paramList
=
new
ArrayList
<>();
JyjcInspectionResultParam
resultParam
=
new
JyjcInspectionResultParam
();
tableModel
.
forEach
((
k
,
v
)
->
{
resultParam
.
setResultSeq
(
model
.
getSequenceNbr
());
if
(!
JYJC_SUBMIT_KEY
.
equals
(
k
)
&&
!
ObjectUtils
.
isEmpty
(
tableModel
.
get
(
k
)))
{
resultParam
.
setParamJson
(
JSON
.
toJSONString
(
model
.
getResultParamModelMap
()));
List
<
JyjcInspectionResultParam
>
collect
=
params
.
stream
().
filter
(
p
->
k
.
equals
(
p
.
getParamType
())).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
params
))
{
JyjcInspectionResultParam
resultParam
=
new
JyjcInspectionResultParam
();
JyjcInspectionResultParam
jyjcInspectionResultParam
=
params
.
get
(
0
);
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
resultParam
.
setSequenceNbr
(
jyjcInspectionResultParam
.
getSequenceNbr
());
resultParam
.
setSequenceNbr
(
collect
.
get
(
0
).
getSequenceNbr
());
}
resultParam
.
setResultSeq
(
model
.
getSequenceNbr
());
resultParam
.
setParamJson
(
JSON
.
toJSONString
(
tableModel
.
get
(
k
)));
paramList
.
add
(
resultParam
);
}
}
resultParamService
.
saveOrUpdate
(
resultParam
);
});
if
(!
CollectionUtils
.
isEmpty
(
paramList
)){
resultParamService
.
saveOrUpdateBatch
(
paramList
);
}
}
//插入操作历史记录
//插入操作历史记录
...
@@ -211,6 +223,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
...
@@ -211,6 +223,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
@Override
@Override
public
Map
<
String
,
Object
>
queryDetailBySeq
(
Long
sequenceNbr
)
{
public
Map
<
String
,
Object
>
queryDetailBySeq
(
Long
sequenceNbr
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>(
9
);
JyjcInspectionResultModel
jyjcInspectionResultModel
=
this
.
queryBySeq
(
sequenceNbr
);
JyjcInspectionResultModel
jyjcInspectionResultModel
=
this
.
queryBySeq
(
sequenceNbr
);
if
(!
ObjectUtils
.
isEmpty
(
jyjcInspectionResultModel
))
{
if
(!
ObjectUtils
.
isEmpty
(
jyjcInspectionResultModel
))
{
...
@@ -231,17 +244,18 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
...
@@ -231,17 +244,18 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
// 获取技术参数
// 获取技术参数
List
<
JyjcInspectionResultParam
>
paramList
=
iJyjcInspectionResultParamService
.
getParamByResultSeq
(
sequenceNbr
);
List
<
JyjcInspectionResultParam
>
paramList
=
iJyjcInspectionResultParamService
.
getParamByResultSeq
(
sequenceNbr
);
Map
<
String
,
Object
>
mapParam
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
paramList
))
{
if
(!
CollectionUtils
.
isEmpty
(
paramList
))
{
Map
<
String
,
Object
>
finalMap
=
map
;
paramList
.
forEach
(
param
->
{
paramList
.
forEach
(
param
->
{
if
(!
ObjectUtils
.
isEmpty
(
param
.
getParamJson
()))
{
if
(!
ObjectUtils
.
isEmpty
(
param
.
getParamJson
()))
{
mapParam
.
putAll
(
JSON
.
parseObject
(
param
.
getParamJson
()));
JSONObject
paramObj
=
JSON
.
parseObject
(
String
.
valueOf
(
param
.
getParamJson
()));
paramObj
.
put
(
"equList"
,
finalMap
.
get
(
"equList"
));
paramObj
.
put
(
"equCategory"
,
finalMap
.
get
(
"equCategory"
));
resultMap
.
put
(
param
.
getParamType
(),
paramObj
);
}
}
});
});
map
.
put
(
"paramJson"
,
mapParam
);
}
}
}
}
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
JYJC_SUBMIT_KEY
,
map
);
resultMap
.
put
(
JYJC_SUBMIT_KEY
,
map
);
return
resultMap
;
return
resultMap
;
}
}
...
...
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