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 8548f1e4
authored
Aug 23, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[chg] 代码优化,TODO 解决
1 parent
c3e92131
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
16 deletions
src/main/java/vion/controller/AccountController.java
src/main/java/vion/controller/DeviceController.java
src/main/java/vion/controller/ServiceOrderController.java
src/main/java/vion/service/impl/DeliveryRecordServiceImpl.java
src/main/java/vion/service/impl/PointInfoServiceImpl.java
src/main/java/vion/controller/AccountController.java
View file @
8548f1e
...
...
@@ -51,7 +51,6 @@ public class AccountController {
@DeleteMapping
(
"/account/{id}"
)
@SaCheckPermission
(
value
=
"account:remove"
,
orRole
=
"admin"
)
public
String
remove
(
@PathVariable
(
name
=
"id"
)
Integer
id
)
{
// todo 删除时,得判断集团下是否关联其他东西
accountService
.
removeById
(
id
);
return
"集团删除成功"
;
}
...
...
src/main/java/vion/controller/DeviceController.java
View file @
8548f1e
...
...
@@ -47,7 +47,7 @@ public class DeviceController {
}
@PostMapping
(
"/circulate"
)
@SaCheckPermission
(
value
=
"device:circulate
Batch
"
,
orRole
=
"admin"
)
@SaCheckPermission
(
value
=
"device:circulate"
,
orRole
=
"admin"
)
public
String
circulateBatch
(
@RequestBody
List
<
DeviceDTO
>
dtoList
)
{
return
deviceService
.
circulateBatch
(
dtoList
);
}
...
...
src/main/java/vion/controller/ServiceOrderController.java
View file @
8548f1e
package
vion
.
controller
;
import
cn.dev33.satoken.annotation.SaCheckPermission
;
import
org.dromara.hutool.core.lang.Assert
;
import
org.dromara.hutool.core.data.id.IdUtil
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.github.linpeilie.Converter
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.hutool.core.data.id.IdUtil
;
import
org.dromara.hutool.core.lang.Assert
;
import
org.redisson.api.RMap
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.web.bind.annotation.*
;
import
vion.constant.RedisKeyEnum
;
import
vion.dto.ServiceOrderDTO
;
import
vion.model.Dictionary
;
import
vion.model.ServiceOrder
;
import
vion.service.IDictionaryService
;
import
vion.service.IServiceOrderService
;
import
vion.vo.ServiceOrderVO
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 服务单
*
...
...
@@ -30,7 +27,7 @@ import java.util.stream.Collectors;
public
class
ServiceOrderController
{
private
final
IServiceOrderService
serviceOrderService
;
private
final
IDictionaryService
dictionaryService
;
private
final
RedissonClient
redissonClient
;
private
final
Converter
converter
;
@GetMapping
(
"/orders"
)
...
...
@@ -71,9 +68,7 @@ public class ServiceOrderController {
@GetMapping
(
"/order/sign/{unid}"
)
public
ServiceOrderVO
getOrderByUnid
(
@PathVariable
String
unid
)
{
// todo 字典加入缓存
List
<
Dictionary
>
dictionaryList
=
dictionaryService
.
lambdaQuery
().
eq
(
Dictionary:
:
getType
,
"service_type"
).
list
();
Map
<
Integer
,
String
>
serviceTypeMap
=
dictionaryList
.
stream
().
collect
(
Collectors
.
toMap
(
Dictionary:
:
getKey
,
Dictionary:
:
getValue
));
RMap
<
Integer
,
String
>
serviceTypeMap
=
redissonClient
.
getMap
(
RedisKeyEnum
.
DICT_PREFIX
.
getVal
()
+
RedisKeyEnum
.
SERVICE_TYPE
.
getVal
());
ServiceOrder
order
=
serviceOrderService
.
lambdaQuery
().
eq
(
ServiceOrder:
:
getUnid
,
unid
).
one
();
ServiceOrderVO
vo
=
converter
.
convert
(
order
,
ServiceOrderVO
.
class
);
vo
.
setServiceType
(
serviceTypeMap
.
get
(
order
.
getServiceType
()));
...
...
src/main/java/vion/service/impl/DeliveryRecordServiceImpl.java
View file @
8548f1e
...
...
@@ -93,6 +93,7 @@ public class DeliveryRecordServiceImpl extends MPJBaseServiceImpl<DeliveryRecord
@Override
public
String
saveBatch
(
List
<
DeliveryRecordDTO
>
dto
)
{
List
<
DeliveryRecord
>
records
=
converter
.
convert
(
dto
,
DeliveryRecord
.
class
);
// todo 合同编号如何和合同id关联起来
if
(
this
.
saveBatch
(
records
))
{
records
.
forEach
(
this
::
updStatusAndPushMsg
);
return
"新增成功"
;
...
...
src/main/java/vion/service/impl/PointInfoServiceImpl.java
View file @
8548f1e
...
...
@@ -331,8 +331,10 @@ public class PointInfoServiceImpl extends MPJBaseServiceImpl<PointInfoMapper, Po
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
delById
(
Long
id
)
{
if
(
this
.
removeById
(
id
))
{
// todo 文件删除
fileService
.
lambdaUpdate
().
eq
(
FileInfo:
:
getSourceId
,
id
).
in
(
FileInfo:
:
getSourceType
,
ListUtil
.
of
(
5
,
16
,
17
,
18
,
19
,
20
)).
remove
();
var
fileList
=
fileService
.
lambdaQuery
().
eq
(
FileInfo:
:
getSourceId
,
id
).
in
(
FileInfo:
:
getSourceType
,
ListUtil
.
of
(
5
,
16
,
17
,
18
,
19
,
20
)).
list
();
fileList
.
forEach
(
f
->
FileUtil
.
del
(
f
.
getUrl
()));
fileService
.
removeBatchByIds
(
fileList
.
stream
().
map
(
FileInfo:
:
getId
).
collect
(
Collectors
.
toList
()));
pointWxService
.
lambdaUpdate
().
eq
(
RPointWx:
:
getPointId
,
id
).
remove
();
rejectInfoService
.
lambdaUpdate
().
eq
(
RejectInfo:
:
getPointId
,
id
).
remove
();
pointDeviceService
.
lambdaUpdate
().
eq
(
RPointDevice:
:
getPointId
,
id
).
remove
();
...
...
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