Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c68ac62f
authored
Aug 22, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[add] 返修设备发货钉钉消息通知添加设备序列号字段
1 parent
7a99f27e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
src/main/java/vion/service/impl/RepairRecServiceImpl.java
src/main/java/vion/service/impl/RepairRecServiceImpl.java
View file @
c68ac62
package
vion
.
service
.
impl
;
import
cn.dev33.satoken.stp.StpUtil
;
import
com.github.yulichang.base.MPJBaseServiceImpl
;
import
com.github.yulichang.wrapper.MPJLambdaWrapper
;
import
io.github.linpeilie.Converter
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.hutool.core.array.ArrayUtil
;
import
org.dromara.hutool.core.data.id.IdUtil
;
import
org.dromara.hutool.core.date.DateUtil
;
import
org.dromara.hutool.core.io.file.FileNameUtil
;
import
org.dromara.hutool.core.io.file.FileUtil
;
import
org.dromara.hutool.core.lang.Opt
;
import
org.dromara.hutool.core.map.MapUtil
;
import
org.dromara.hutool.core.data.id.IdUtil
;
import
org.dromara.hutool.core.util.ObjUtil
;
import
org.dromara.hutool.core.text.StrUtil
;
import
org.dromara.hutool.core.util.ObjUtil
;
import
org.dromara.hutool.crypto.SecureUtil
;
import
com.github.yulichang.base.MPJBaseServiceImpl
;
import
com.github.yulichang.wrapper.MPJLambdaWrapper
;
import
io.github.linpeilie.Converter
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.hutool.json.JSONUtil
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
...
...
@@ -32,6 +32,7 @@ import java.io.IOException;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author HlQ
...
...
@@ -126,7 +127,16 @@ public class RepairRecServiceImpl extends MPJBaseServiceImpl<RepairRecMapper, Re
@Override
public
Boolean
notify
(
Long
id
,
String
userid
)
{
var
repairRec
=
this
.
getById
(
id
);
MPJLambdaWrapper
<
RepairRec
>
wrapper
=
new
MPJLambdaWrapper
<
RepairRec
>()
.
selectAll
(
RepairRec
.
class
)
.
selectCollection
(
RRepairDevice
.
class
,
RepairRecVO:
:
getRepairDeviceList
)
.
leftJoin
(
RRepairDevice
.
class
,
on
->
on
.
eq
(
RRepairDevice:
:
getRId
,
RepairRec:
:
getId
).
eq
(
RRepairDevice:
:
getRType
,
2
))
.
eq
(
SparePart:
:
getId
,
id
);
var
repairRecVO
=
this
.
selectJoinOne
(
RepairRecVO
.
class
,
wrapper
);
var
deviceNoStr
=
Opt
.
ofEmptyAble
(
repairRecVO
.
getRepairDeviceList
())
.
map
(
l
->
l
.
stream
().
map
(
RRepairDevice:
:
getDeviceNo
).
collect
(
Collectors
.
joining
(
","
)))
.
orElse
(
"暂无"
);
var
jsonObj
=
JSONUtil
.
ofObj
()
.
set
(
"agent_id"
,
2358374016L
)
...
...
@@ -138,10 +148,12 @@ public class RepairRecServiceImpl extends MPJBaseServiceImpl<RepairRecMapper, Re
### 返修设备已发货
### 项目名称:{}
### 快递单号:{}
### 设备序列号:{}
### 发货日期:{}
### 发送时间:{}
"""
,
repairRec
.
getProjectName
(),
Opt
.
ofBlankAble
(
repairRec
.
getTrackingNumber
()).
orElse
(
"暂无"
),
Opt
.
ofBlankAble
(
DateUtil
.
formatDate
(
repairRec
.
getShipDate
())).
orElse
(
"暂无"
),
DateUtil
.
now
());
"""
,
repairRecVO
.
getProjectName
(),
Opt
.
ofBlankAble
(
repairRecVO
.
getTrackingNumber
()).
orElse
(
"暂无"
),
deviceNoStr
,
Opt
.
ofBlankAble
(
DateUtil
.
formatDate
(
repairRecVO
.
getShipDate
())).
orElse
(
"暂无"
),
DateUtil
.
now
());
content
.
set
(
"text"
,
text
);
msg
.
set
(
"msgtype"
,
"markdown"
).
set
(
"markdown"
,
content
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment