Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
external
on-site-service
Commits
3b9f4b6d
Commit
3b9f4b6d
authored
Jul 22, 2022
by
lining
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 控制台mine接口
parent
e1669bfd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
12 deletions
+53
-12
ServiceOrderMapper.java
.../onsiteservice/dao/mapper/service/ServiceOrderMapper.java
+2
-0
ServiceOrderMapper.xml
dao/src/main/resources/mapper/service/ServiceOrderMapper.xml
+22
-10
ServiceOrderController.java
...vice/miniapp/controller/order/ServiceOrderController.java
+8
-1
ServiceOrderBizService.java
...service/miniapp/service/order/ServiceOrderBizService.java
+21
-1
No files found.
dao/src/main/java/com/onsiteservice/dao/mapper/service/ServiceOrderMapper.java
View file @
3b9f4b6d
...
...
@@ -10,4 +10,6 @@ public interface ServiceOrderMapper extends Mapper<ServiceOrder> {
List
<
ServiceOrder
>
selectServiceOrderPage
(
List
<
Integer
>
list
,
String
month
,
String
keyWord
,
Integer
roleType
,
Long
userId
);
List
<
ServiceOrder
>
selectServiceOrderMinePage
(
List
<
Integer
>
list
,
String
month
,
String
keyWord
,
Long
userId
);
}
\ No newline at end of file
dao/src/main/resources/mapper/service/ServiceOrderMapper.xml
View file @
3b9f4b6d
...
...
@@ -10,16 +10,28 @@
<foreach
collection=
"list"
item=
"orderStatus"
open=
"("
separator=
","
close=
")"
>
#{orderStatus}
</foreach>
<choose>
<when
test=
"roleType == 0"
>
<!-- 普通用户 -->
and account_no = #{userId}
</when>
<when
test=
"roleType == 1"
>
<!-- 客服 -->
</when>
<otherwise>
<!-- 估价员 -->
and valuator_id = #{userId}
</otherwise>
</choose>
<if
test=
"roleType == 2"
>
<!-- 估价员 -->
and valuator_id = #{userId}
</if>
<if
test=
"month != null and month != ''"
>
and date_format(create_time,'%Y%m') = #{month}
</if>
<if
test=
"keyWord != null and keyWord != ''"
>
<bind
name=
"p1"
value=
"'%' + keyWord + '%'"
/>
and (service_name like #{p1} or address like #{p1} or name like #{p1})
</if>
order by create_time asc
</select>
<select
id=
"selectServiceOrderMinePage"
resultType=
"com.onsiteservice.entity.order.ServiceOrder"
>
select *
from service_order
where
account_no = #{userId}
and order_status in
<foreach
collection=
"list"
item=
"orderStatus"
open=
"("
separator=
","
close=
")"
>
#{orderStatus}
</foreach>
<if
test=
"month != null and month != ''"
>
and date_format(create_time,'%Y%m') = #{month}
</if>
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/controller/order/ServiceOrderController.java
View file @
3b9f4b6d
...
...
@@ -61,12 +61,19 @@ public class ServiceOrderController {
}
@Dict
(
code
=
DictConstants
.
ORDER_STATUS
,
name
=
"orderStatus"
)
@ApiOperation
(
value
=
"分页查询订单"
)
@ApiOperation
(
value
=
"
工作台-
分页查询订单"
)
@PostMapping
(
"page"
)
public
Result
<
PageInfoVO
<
ServiceOrderVO
>>
getPage
(
@RequestBody
@NonNull
@Validated
PageServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderBizService
.
getPage
(
dto
,
userId
);
}
@Dict
(
code
=
DictConstants
.
ORDER_STATUS
,
name
=
"orderStatus"
)
@ApiOperation
(
value
=
"我的订单-分页查询订单"
)
@PostMapping
(
"mine-page"
)
public
Result
<
PageInfoVO
<
ServiceOrderVO
>>
getMinePage
(
@RequestBody
@NonNull
@Validated
PageServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderBizService
.
getMinePage
(
dto
,
userId
);
}
@ApiOperation
(
value
=
"订单预约"
)
@PostMapping
(
"reserve"
)
public
Result
reserve
(
@RequestBody
@NonNull
@Validated
ReserveServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/service/order/ServiceOrderBizService.java
View file @
3b9f4b6d
...
...
@@ -139,7 +139,8 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getSize
());
User
user
=
userMapper
.
selectByPrimaryKey
(
userId
);
if
(
Objects
.
isNull
(
user
)
||
!
checkRoleType
(
user
))
{
if
(
Objects
.
isNull
(
user
)
||
(!
user
.
getRoleType
().
equals
(
ServiceUserTypeEnum
.
ADMIN
.
getId
())
&&
!
user
.
getRoleType
().
equals
(
ServiceUserTypeEnum
.
VALUATOR
.
getId
())))
{
throw
new
ServiceException
(
BizCodeEnum
.
NO_AUTH
);
}
...
...
@@ -158,6 +159,25 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
}
public
Result
<
PageInfoVO
<
ServiceOrderVO
>>
getMinePage
(
PageServiceOrderDTO
dto
,
Long
userId
)
{
log
.
info
(
"order getMinePage dto: {}, userId: {}"
,
dto
,
userId
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getSize
());
if
(!
BizConstants
.
OrderConstants
.
FRONT_BACK_ORDER_STATUS_MAP
.
containsKey
(
dto
.
getOrderStatus
()))
{
throw
new
ServiceException
(
BizCodeEnum
.
SERVICE_ORDER_STATUS_ERROR
);
}
List
<
ServiceOrder
>
serviceOrderList
=
serviceOrderMapper
.
selectServiceOrderMinePage
(
BizConstants
.
OrderConstants
.
FRONT_BACK_ORDER_STATUS_MAP
.
get
(
dto
.
getOrderStatus
()),
dto
.
getMonth
(),
dto
.
getKeyWord
(),
userId
);
return
ResultGenerator
.
success
(
new
PageInfoVO
<>(
buildServiceOrderVO
(
serviceOrderList
)));
}
public
int
reserve
(
ReserveServiceOrderDTO
dto
,
Long
userId
,
ServiceOrderOpSourceEnum
sourceEnum
)
{
log
.
info
(
"order reserve dto: {}, userId: {}"
,
dto
,
userId
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment