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