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 ef11ee50
authored
Jan 19, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[add] 点位设计详情页面添加设备序列号列表字段
[chg] 优化工单流转逻辑
1 parent
e29cfbb6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
24 deletions
src/main/java/vion/service/impl/PointInfoServiceImpl.java
src/main/java/vion/service/impl/TaskServiceImpl.java
src/main/java/vion/vo/PointInfoVO.java
src/main/java/vion/service/impl/PointInfoServiceImpl.java
View file @
ef11ee5
...
...
@@ -168,6 +168,12 @@ public class PointInfoServiceImpl extends MPJBaseServiceImpl<PointInfoMapper, Po
" \n #### 联系人:{}"
,
existPoint
.
getProjectName
(),
existPoint
.
getContact
());
dingMod
.
robotPush
(
DING_GROUP_TOKEN
,
buildMsg
(
"点位设计提醒"
,
content
));
}
if
(
ObjUtil
.
isNotNull
(
dto
.
getSourceType
())
&&
dto
.
getSourceType
().
equals
(
20
))
{
String
content
=
StrUtil
.
format
(
"### 门店回执单已上传请及时处理"
+
" \n #### 项目名称:{}"
+
" \n #### 联系人:{}"
,
existPoint
.
getProjectName
(),
existPoint
.
getContact
());
dingMod
.
robotPush
(
DING_GROUP_TOKEN
,
buildMsg
(
"点位设计提醒"
,
content
));
}
saveFile
(
finalId
,
infile
,
dto
);
}));
if
(
ObjUtil
.
isNotNull
(
dto
.
getIsConstruct
())
&&
dto
.
getIsConstruct
().
equals
(
1
))
{
...
...
@@ -267,11 +273,13 @@ public class PointInfoServiceImpl extends MPJBaseServiceImpl<PointInfoMapper, Po
MPJLambdaWrapper
<
PointInfo
>
wrapper
=
new
MPJLambdaWrapper
<
PointInfo
>()
.
selectAll
(
PointInfo
.
class
)
.
selectCollection
(
RPointWx
.
class
,
PointInfoVO:
:
getWxNameList
,
map
->
map
.
result
(
RPointWx:
:
getWxName
))
.
selectCollection
(
RPointDevice
.
class
,
PointInfoVO:
:
getDeviceNoList
,
map
->
map
.
result
(
RPointDevice:
:
getDeviceNo
))
.
selectAs
(
Account:
:
getName
,
PointInfoVO:
:
getAccountName
)
.
selectAs
(
Contract:
:
getTotalAmount
,
PointInfoVO:
:
getContractAmount
)
.
leftJoin
(
Account
.
class
,
Account:
:
getId
,
PointInfo:
:
getAccountId
)
.
leftJoin
(
Contract
.
class
,
Contract:
:
getContractNo
,
PointInfo:
:
getContractNo
)
.
leftJoin
(
RPointWx
.
class
,
RPointWx:
:
getPointId
,
PointInfo:
:
getId
)
.
leftJoin
(
RPointDevice
.
class
,
RPointDevice:
:
getPointId
,
PointInfo:
:
getId
)
.
eq
(
ObjUtil
.
isNotEmpty
(
id
),
PointInfo:
:
getId
,
id
)
.
eq
(
StrUtil
.
isNotBlank
(
uuid
),
PointInfo:
:
getUuid
,
uuid
)
.
orderByDesc
(
PointInfo:
:
getCreateTime
);
...
...
src/main/java/vion/service/impl/TaskServiceImpl.java
View file @
ef11ee5
...
...
@@ -125,17 +125,24 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
circTask
(
TaskDTO
data
,
String
token
)
{
UserVO
user
=
(
UserVO
)
StpUtil
.
getTokenSession
().
get
(
"curLoginUser"
);
Task
task
=
converter
.
convert
(
data
,
Task
.
class
);
if
(
task
.
getId
()
==
null
)
{
task
.
setCreateUser
(
user
.
getId
());
handleTaskTemp
(
data
);
Task
task
=
prepareTask
(
data
,
user
);
sendNotifications
(
data
,
task
,
user
);
handleFiles
(
data
,
task
,
user
);
return
task
.
getId
();
}
// 可能直接提工单,而不是预工单确认之后生成的工单
/**
* <p>创建工单前,先判断预工单是否已经确认。</p>
* <p>如果未确认,将预工单状态改为已确认。后面的流程进行创建工单。</p>
*
* @param data 前端传参
*/
private
void
handleTaskTemp
(
TaskDTO
data
)
{
if
(
ObjUtil
.
isNotNull
(
data
.
getTaskTempId
()))
{
Task
existTask
=
this
.
lambdaQuery
().
eq
(
Task:
:
getTaskTempId
,
data
.
getTaskTempId
()).
one
();
Assert
.
isNull
(
existTask
,
"工单已创建,无需再次确认"
);
taskTempService
.
lambdaUpdate
()
.
set
(
TaskTemp:
:
getStatus
,
3
)
.
set
(
TaskTemp:
:
getOperator
,
data
.
getActiveUser
())
...
...
@@ -143,14 +150,23 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
.
eq
(
TaskTemp:
:
getId
,
data
.
getTaskTempId
())
.
update
(
new
TaskTemp
());
}
}
if
(
data
.
getId
()
==
null
)
{
//添加新工单
/**
* 根据前端是否传参工单id,来判断是更新工单还是新增工单,并创建对应的工单日志
*
* @param data 前端传参
* @param user 当前登录用户
* @return vion.model.Task
*/
private
Task
prepareTask
(
TaskDTO
data
,
UserVO
user
)
{
Task
task
=
converter
.
convert
(
data
,
Task
.
class
);
if
(
task
.
getId
()
==
null
)
{
task
.
setCreateUser
(
user
.
getId
());
task
.
setUuid
(
IdUtil
.
nanoId
());
this
.
save
(
task
);
List
<
FaultLog
>
saveList
=
new
ArrayList
<>();
// 预工单提交,客户名称不在系统用户表内
// 预工单提交,客户名称不在系统用户表内
。单独处理客户提交的预工单日志
FaultLog
faultLog
=
new
FaultLog
();
faultLog
.
setTaskId
(
task
.
getId
());
faultLog
.
setStoreId
(
task
.
getStoreId
());
...
...
@@ -159,7 +175,8 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
faultLog
.
setCreateTime
(
task
.
getRepairTime
());
saveList
.
add
(
faultLog
);
//添加工单处理日志
// 添加工单处理日志
// 预工单确认,变为工单,添加日志
FaultLog
faultLog1
=
new
FaultLog
();
faultLog1
.
setTaskId
(
task
.
getId
());
faultLog1
.
setStoreId
(
task
.
getStoreId
());
...
...
@@ -170,28 +187,52 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
faultLogService
.
saveBatch
(
saveList
);
}
else
{
this
.
updateById
(
task
);
handleFaultLog
(
data
,
user
,
task
);
}
return
task
;
}
//根据状态判断是否要添加工单处理日志(状态:1待确认2进行中3已完成4挂起)
/**
* 工单日志处理
*
* @param data 前端传参
* @param user 当前登录用户
* @param task 工单
*/
private
void
handleFaultLog
(
TaskDTO
data
,
UserVO
user
,
Task
task
)
{
FaultLog
faultLog
=
new
FaultLog
();
faultLog
.
setTaskId
(
task
.
getId
());
faultLog
.
setStoreId
(
task
.
getStoreId
());
faultLog
.
setOperator
(
user
.
getId
());
faultLog
.
setRemark
(
task
.
getRemark
());
faultLog
.
setManHour
(
data
.
getManHour
());
if
(
task
.
getStatus
()
==
2
)
{
faultLog
.
setContent
(
"工单正在处理中"
);
}
if
(
task
.
getStatus
()
==
3
)
{
faultLog
.
setContent
(
"工单处理完成"
);
}
if
(
task
.
getStatus
()
==
4
)
{
faultLog
.
setContent
(
"工单挂起"
);
faultLog
.
setContent
(
getFaultLogContent
(
task
.
getStatus
()));
faultLogService
.
save
(
faultLog
);
}
if
(
task
.
getStatus
()
==
5
)
{
faultLog
.
setContent
(
"工单已关闭"
);
private
String
getFaultLogContent
(
int
status
)
{
switch
(
status
)
{
case
2
:
return
"工单正在处理中"
;
case
3
:
return
"工单处理完成"
;
case
4
:
return
"工单挂起"
;
case
5
:
return
"工单已关闭"
;
default
:
return
""
;
}
faultLogService
.
save
(
faultLog
);
}
/**
* 钉钉提醒和微信提醒
*
* @param data 前端传参
* @param task 工单
* @param user 当前登录用户
*/
private
void
sendNotifications
(
TaskDTO
data
,
Task
task
,
UserVO
user
)
{
// todo 异步发送钉钉消息通知
Store
store
=
storeService
.
getById
(
task
.
getStoreId
());
Task
existTask
=
this
.
getById
(
task
.
getId
());
...
...
@@ -230,7 +271,16 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
String
sentMsg
=
wechatMod
.
sendMsg
(
"H3zWJysLWrcxrUlrgqPnjDV7LyWLaml_Ap9WsLuQDCs"
,
openid
,
wxMpTemplateDataList
,
null
);
});
}
}
/**
* 文件处理
*
* @param data 前端传参
* @param task 工单
* @param user 当前登录用户
*/
private
void
handleFiles
(
TaskDTO
data
,
Task
task
,
UserVO
user
)
{
Opt
.
ofNullable
(
data
.
getFiles
())
.
ifPresent
(
fileList
->
Arrays
.
stream
(
fileList
).
forEach
(
infile
->
{
...
...
@@ -257,7 +307,6 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
fileInfo
.
setUploader
(
user
.
getUsername
());
fileService
.
save
(
fileInfo
);
}));
return
task
.
getId
();
}
@Override
...
...
src/main/java/vion/vo/PointInfoVO.java
View file @
ef11ee5
...
...
@@ -229,8 +229,12 @@ public class PointInfoVO {
*/
private
String
uuid
;
/** 绑定单子的微信昵称列表 */
private
List
<
String
>
wxNameList
;
/** 单子施工后的设备序列号列表 */
private
List
<
String
>
deviceNoList
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
...
...
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