Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7701b9f0
authored
Jul 08, 2023
by
wangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增过滤条件
1 parent
f72f9700
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
28 deletions
project-order/src/main/java/com/dituhui/pea/order/controller/OrderServiceListController.java
project-order/src/main/java/com/dituhui/pea/order/service/OrderServiceListService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderServiceListServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/controller/OrderServiceListController.java
View file @
7701b9f
...
...
@@ -2,35 +2,41 @@ package com.dituhui.pea.order.controller;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dto.OrderServiceListReq
;
import
com.dituhui.pea.order.service.OrderServiceListService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
/**
* @author wangl@zjhuixinyun.com
*/
@RestController
@RequestMapping
(
"/pea-order"
)
@Validated
public
class
OrderServiceListController
{
@Autowired
private
OrderServiceListService
orderServiceListService
;
@GetMapping
(
"/order/service/list"
)
public
Result
<?>
getOrderServiceList
(
@RequestParam
String
startDate
,
@RequestParam
String
endDate
,
@RequestParam
long
page
,
@RequestParam
long
size
,
@RequestParam
(
required
=
false
)
String
sort
,
@RequestParam
(
required
=
false
)
String
appointmentType
,
@RequestParam
(
required
=
false
)
String
appointmentStatus
,
@RequestParam
(
required
=
false
)
String
type
,
@RequestParam
(
required
=
false
)
String
brand
,
@RequestParam
(
required
=
false
)
String
skill
)
{
public
Result
<?>
getOrderServiceList
(
@Valid
@RequestParam
OrderServiceListReq
reqDTO
)
{
Result
<?>
res
=
null
;
try
{
res
=
orderServiceListService
.
getOrderServiceList
(
reqDTO
);
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
return
res
;
}
@PostMapping
(
"/order/service/list"
)
public
Result
<?>
getOrderServiceListPost
(
@Valid
@RequestBody
OrderServiceListReq
reqDTO
)
{
Result
<?>
res
=
null
;
try
{
res
=
orderServiceListService
.
getOrderServiceList
(
startDate
,
endDate
,
page
,
size
,
sort
,
appointmentType
,
appointmentStatus
,
type
,
brand
,
skill
);
res
=
orderServiceListService
.
getOrderServiceList
(
reqDTO
);
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
...
...
project-order/src/main/java/com/dituhui/pea/order/service/OrderServiceListService.java
View file @
7701b9f
...
...
@@ -2,12 +2,10 @@ package com.dituhui.pea.order.service;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dto.OrderServiceListReq
;
import
com.dituhui.pea.order.dto.OrderServiceListResp
;
public
interface
OrderServiceListService
{
Result
<
OrderServiceListResp
>
getOrderServiceList
(
String
startDate
,
String
endDate
,
long
page
,
long
size
,
String
sort
,
String
appointmentType
,
String
appointmentStatus
,
String
type
,
String
brand
,
String
skill
)
throws
BusinessException
;
Result
<?>
getOrderServiceList
(
OrderServiceListReq
reqDTO
)
throws
BusinessException
;
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderServiceListServiceImpl.java
View file @
7701b9f
...
...
@@ -5,19 +5,22 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.common.ListUtils
;
import
com.dituhui.pea.order.common.TimeUtils
;
import
com.dituhui.pea.order.dao.OrderAppointmentMPDao
;
import
com.dituhui.pea.order.dao.OrderRequestMPDao
;
import
com.dituhui.pea.order.dto.OrderServiceList
;
import
com.dituhui.pea.order.dto.OrderServiceListReq
;
import
com.dituhui.pea.order.dto.OrderServiceListResp
;
import
com.dituhui.pea.order.entity.OrderAppointment
;
import
com.dituhui.pea.order.entity.OrderRequest
;
import
com.dituhui.pea.order.service.OrderServiceListService
;
import
io.netty.util.internal.StringUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDate
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -32,21 +35,37 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
@Transactional
@Override
public
Result
<
OrderServiceListResp
>
getOrderServiceList
(
String
startDate
,
String
endDate
,
long
page
,
long
size
,
String
sort
,
String
appointmentType
,
String
appointmentStatus
,
String
type
,
String
brand
,
String
skill
)
throws
BusinessException
{
public
Result
<
OrderServiceListResp
>
getOrderServiceList
(
OrderServiceListReq
reqDTO
)
throws
BusinessException
{
//分页
Page
<
OrderRequest
>
pg
=
new
Page
(
page
,
size
);
Page
<
OrderRequest
>
pg
=
new
Page
(
reqDTO
.
getPage
(),
reqDTO
.
getSize
());
LocalDate
startDate
=
TimeUtils
.
IsoDate2LocalDate
(
reqDTO
.
getStartDate
());
LocalDate
endDate
=
TimeUtils
.
IsoDate2LocalDate
(
reqDTO
.
getEndDate
());
LambdaQueryWrapper
<
OrderRequest
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
ge
(
OrderRequest:
:
getExpectTimeBegin
,
TimeUtils
.
IsoDateTime2Timestamp
(
String
.
format
(
"%s 00:00:00"
,
startDate
)));
//预约开始日期
lqw
.
le
(
OrderRequest:
:
getExpectTimeBegin
,
TimeUtils
.
IsoDateTime2Timestamp
(
String
.
format
(
"%s 00:00:00"
,
endDate
)));
//预约结束日期
lqw
.
eq
(!
StringUtil
.
isNullOrEmpty
(
appointmentStatus
),
OrderRequest:
:
getAppointmentStatus
,
appointmentStatus
);
//指派状态
lqw
.
eq
(!
StringUtil
.
isNullOrEmpty
(
type
),
OrderRequest:
:
getType
,
type
);
//设备类型
lqw
.
eq
(!
StringUtil
.
isNullOrEmpty
(
brand
),
OrderRequest:
:
getBrand
,
brand
);
//品牌
lqw
.
eq
(!
StringUtil
.
isNullOrEmpty
(
skill
),
OrderRequest:
:
getSkill
,
skill
);
//技能
lqw
.
eq
(
reqDTO
.
getLevelType
().
equals
(
"cluster"
),
OrderRequest:
:
getOrgClusterId
,
reqDTO
.
getLevelValue
());
lqw
.
eq
(
reqDTO
.
getLevelType
().
equals
(
"branch"
),
OrderRequest:
:
getOrgBranchId
,
reqDTO
.
getLevelValue
());
lqw
.
eq
(
reqDTO
.
getLevelType
().
equals
(
"group"
),
OrderRequest:
:
getOrgGroupId
,
reqDTO
.
getLevelValue
());
lqw
.
ge
(
OrderRequest:
:
getDt
,
startDate
);
//预约开始日期
lqw
.
le
(
OrderRequest:
:
getDt
,
endDate
);
//预约开始日期
//筛选项
lqw
.
eq
(
StringUtils
.
isNotEmpty
(
reqDTO
.
getPhone
()),
OrderRequest:
:
getPhone
,
reqDTO
.
getPhone
());
lqw
.
eq
(
StringUtils
.
isNotEmpty
(
reqDTO
.
getOrderId
()),
OrderRequest:
:
getOrderId
,
reqDTO
.
getOrderId
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getBranchIds
()),
OrderRequest:
:
getOrgBranchId
,
reqDTO
.
getBranchIds
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getGroupIds
()),
OrderRequest:
:
getOrgGroupId
,
reqDTO
.
getGroupIds
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getTeamIds
()),
OrderRequest:
:
getOrgTeamId
,
reqDTO
.
getTeamIds
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getPriorities
()),
OrderRequest:
:
getPriority
,
reqDTO
.
getPriorities
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getProductCategory
()),
OrderRequest:
:
getType
,
reqDTO
.
getProductCategory
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getProductCategory
()),
OrderRequest:
:
getSkill
,
reqDTO
.
getServiceCategory
());
lqw
.
eq
(
StringUtils
.
isNotEmpty
(
reqDTO
.
getAppointmentType
()),
OrderRequest:
:
getAppointmentMethod
,
reqDTO
.
getAppointmentType
());
//指派状态
if
(
StringUtils
.
isNotEmpty
(
reqDTO
.
getAppointmentStatus
())
&&
reqDTO
.
getAppointmentStatus
().
equals
(
"0"
))
{
lqw
.
eq
(
OrderRequest:
:
getAppointmentStatus
,
"NOT_ASSIGNED"
);
}
else
if
(
StringUtils
.
isNotEmpty
(
reqDTO
.
getAppointmentStatus
())
&&
reqDTO
.
getAppointmentStatus
().
equals
(
"1"
))
{
lqw
.
ne
(
OrderRequest:
:
getAppointmentStatus
,
"NOT_ASSIGNED"
);
}
// 查询工单表列表
orderRequestMPDao
.
selectPage
(
pg
,
lqw
);
...
...
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