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
7ef92938
Commit
7ef92938
authored
Oct 28, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reafact(jg): 压力管道管道长度
1.压力管道管道长度调整为字符串/分隔开
parent
24d166b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
18 deletions
+36
-18
JgReformNoticeServiceImpl.java
...module/jg/biz/service/impl/JgReformNoticeServiceImpl.java
+6
-18
PipLenCalUtils.java
...yeejoin/amos/boot/module/jg/biz/utils/PipLenCalUtils.java
+30
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgReformNoticeServiceImpl.java
View file @
7ef92938
...
...
@@ -40,6 +40,7 @@ import com.yeejoin.amos.boot.module.jg.biz.event.CancellationEvent;
import
com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.*
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.PipLenCalUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
...
...
@@ -80,8 +81,6 @@ import java.util.concurrent.TimeUnit;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
common
.
BizCommonConstant
.
PIPE_LENGTH
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
common
.
BizCommonConstant
.
PIPE_LENGTH_SPILT
;
/**
* 改造告知服务实现类
...
...
@@ -653,24 +652,13 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
* @return 管道长度变化,正值为增长,负值为减少
*/
private
String
calculatePipeLengthChange
(
JSONArray
oldPipData
,
JSONArray
newPipData
)
{
double
oldPipLen
=
getPipLen
(
oldPipData
);
;
double
newPipLen
=
getPipLen
(
newPipData
);
double
oldPipLen
=
PipLenCalUtils
.
getPipLen
(
oldPipData
);
;
double
newPipLen
=
PipLenCalUtils
.
getPipLen
(
newPipData
);
double
change
=
newPipLen
-
oldPipLen
;
return
change
==
0
?
"0"
:
String
.
format
(
"%+.2f"
,
change
);
}
private
static
double
getPipLen
(
JSONArray
oldPipData
)
{
return
oldPipData
.
stream
()
.
map
(
p
->
JSON
.
parseObject
(
p
.
toString
()))
.
filter
(
s
->
StringUtil
.
isNotEmpty
(
s
.
getString
(
PIPE_LENGTH
)))
.
map
(
d
->
Arrays
.
stream
(
d
.
getString
(
PIPE_LENGTH
).
split
(
PIPE_LENGTH_SPILT
))
// 分割字符串
.
map
(
BigDecimal:
:
new
)
// 转 BigDecimal
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
)
// 分段求和
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
)
// 全局求和
.
doubleValue
();
}
private
JSONObject
getNowPipJsonData
(
String
projectContraptionId
)
{
return
new
JSONObject
(
Optional
.
ofNullable
(
idxBizJgProjectContraptionMapper
.
getDetail
(
projectContraptionId
))
...
...
@@ -1135,7 +1123,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 产品质量合格证明 PRODUCT_QUALIFICATION_CERTIFICATE 其他附件 OTHER_ACCESSORIES 管道总长度
// String productQualificationCertificate = JSON.toJSONString(newData.get(PRODUCT_QUALIFICATION_CERTIFICATE));
// String otherAccessories = JSON.toJSONString(newData.get(OTHER_ACCESSORIES));
double
pipLengthLastSum
=
getPipLen
(
newPipData
);
// 最终转 double
double
pipLengthLastSum
=
PipLenCalUtils
.
getPipLen
(
newPipData
);
// 最终转 double
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>
updateWrapper
=
new
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>()
.
eq
(
IdxBizJgProjectContraption:
:
getSequenceNbr
,
notice
.
getProjectContraptionId
())
// .set(IdxBizJgProjectContraption::getProductQualificationCertificate, productQualificationCertificate)
...
...
@@ -1477,7 +1465,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
JSONArray
alreadyDelPipData
=
Optional
.
ofNullable
(
JSONArray
.
parseArray
(
newData
.
getString
(
DEL_DEVICE_LIST
))).
orElse
(
new
JSONArray
());
JSONObject
oldData
=
Optional
.
ofNullable
(
JSONObject
.
parseObject
(
registrationHistory
.
getOldData
())).
orElse
(
new
JSONObject
());
JSONArray
oldPipData
=
Optional
.
ofNullable
(
JSONArray
.
parseArray
(
oldData
.
getString
(
DEVICE_LIST
))).
orElse
(
new
JSONArray
());
double
oldPipLength
=
getPipLen
(
oldPipData
);
double
oldPipLength
=
PipLenCalUtils
.
getPipLen
(
oldPipData
);
List
<
String
>
oldPipDataRecords
=
oldPipData
.
stream
().
map
(
item
->
JSON
.
parseObject
(
item
.
toString
()).
getString
(
RECORD
)).
collect
(
Collectors
.
toList
());
List
<
String
>
nowPipDataRecords
=
idxBizJgProjectContraptionMapper
.
selectEquipList
(
notice
.
getProjectContraptionId
()).
stream
().
map
(
item
->
String
.
valueOf
(
item
.
get
(
"record"
))).
collect
(
Collectors
.
toList
());
List
<
JSONObject
>
toAddPipData
=
alreadyDelPipData
.
stream
().
map
(
item
->
JSON
.
parseObject
(
item
.
toString
())).
collect
(
Collectors
.
toList
());
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/utils/PipLenCalUtils.java
0 → 100644
View file @
7ef92938
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
utils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.github.pagehelper.util.StringUtil
;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
common
.
BizCommonConstant
.
PIPE_LENGTH
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
common
.
BizCommonConstant
.
PIPE_LENGTH_SPILT
;
/**
* 管道长度计算公共类-便于统一维护口
*/
public
class
PipLenCalUtils
{
public
static
double
getPipLen
(
JSONArray
oldPipData
)
{
return
oldPipData
.
stream
()
.
map
(
p
->
JSON
.
parseObject
(
p
.
toString
()))
.
filter
(
s
->
StringUtil
.
isNotEmpty
(
s
.
getString
(
PIPE_LENGTH
)))
.
map
(
d
->
Arrays
.
stream
(
d
.
getString
(
PIPE_LENGTH
).
split
(
PIPE_LENGTH_SPILT
))
// 分割字符串
.
map
(
BigDecimal:
:
new
)
// 转 BigDecimal
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
)
// 分段求和
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
)
// 全局求和
.
doubleValue
();
}
}
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