Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-java
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PeiZhen-Java
peizhen-java
Commits
eee4e28a
Commit
eee4e28a
authored
Sep 15, 2023
by
Wangmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增 完成服务
parent
dc985e34
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
237 additions
and
8 deletions
+237
-8
pz-accompany/src/main/java/com/pz/accompany/AccompanyController.java
+17
-1
pz-system/src/main/java/com/pz/merchant/service/ISonOrderService.java
+5
-3
pz-system/src/main/java/com/pz/system/domain/DbmyOrder.java
+1
-1
pz-system/src/main/java/com/pz/system/service/impl/DbghOrderServiceImpl.java
+70
-1
pz-system/src/main/java/com/pz/system/service/impl/DbmyOrderServiceImpl.java
+36
-1
pz-system/src/main/java/com/pz/system/service/impl/DbwzOrderServiceImpl.java
+37
-0
pz-system/src/main/java/com/pz/system/service/impl/YypzOrderServiceImpl.java
+35
-0
pz-system/src/main/java/com/pz/system/service/impl/ZyphOrderServiceImpl.java
+35
-0
pz-system/src/main/resources/mapper/system/DbmyOrderMapper.xml
+1
-1
No files found.
pz-accompany/src/main/java/com/pz/accompany/AccompanyController.java
View file @
eee4e28a
...
...
@@ -14,6 +14,7 @@ import com.pz.merchant.service.ISonOrderService;
import
com.pz.merchant.service.impl.SonOrderServiceBuilder
;
import
com.pz.system.domain.bo.AccompanyAddressBo
;
import
com.pz.system.domain.bo.OrderCommonBo
;
import
com.pz.system.domain.bo.OrderFinishedBo
;
import
com.pz.system.domain.vo.AccompanyDemandVo
;
import
com.pz.system.domain.vo.OrderCommonVo
;
import
com.pz.system.service.IDbmyOrderService
;
...
...
@@ -108,7 +109,7 @@ public class AccompanyController extends BaseController {
}
/**
* 陪诊员
取消订单
* 陪诊员
开始服务
*
* @param bo 订单参数
* @return 操作结果
...
...
@@ -123,6 +124,21 @@ public class AccompanyController extends BaseController {
}
/**
* 陪诊员 完成服务
*
* @param bo 订单参数
* @return 操作结果
*/
@PutMapping
(
"/finishedService"
)
public
R
<
Boolean
>
startOrderService
(
@Validated
(
EditGroup
.
class
)
@RequestBody
OrderFinishedBo
bo
)
{
ISonOrderService
orderService
=
sonOrderServiceBuilder
.
getSonOrderService
(
bo
.
getBusinessId
());
if
(
orderService
==
null
)
{
throw
new
ServiceException
(
"业务异常"
);
}
return
R
.
ok
(
orderService
.
finishedService
(
bo
));
}
/**
* 设置代办买药 陪诊员地址
*
* @param bo 地址
...
...
pz-system/src/main/java/com/pz/merchant/service/ISonOrderService.java
View file @
eee4e28a
package
com
.
pz
.
merchant
.
service
;
import
com.pz.merchant.domain.vo.SonOrderVo
;
import
com.pz.system.domain.bo.OrderFinishedBo
;
/**
* 子订单业务
...
...
@@ -57,16 +58,17 @@ public interface ISonOrderService {
* @param totalId 主订单ID
* @return 操作结果
*/
default
boolean
accompanyStartService
(
Integer
totalId
)
{
default
boolean
accompanyStartService
(
Integer
totalId
)
{
throw
new
UnsupportedOperationException
(
"不支持该操作"
);
}
/**
* 陪诊员完成服务
* @param totalId 主订单ID
*
* @param orderData 主订单数据
* @return 操作结果
*/
default
boolean
finishedService
(
Integer
totalId
)
{
default
boolean
finishedService
(
OrderFinishedBo
orderData
)
{
throw
new
UnsupportedOperationException
(
"不支持该操作"
);
}
...
...
pz-system/src/main/java/com/pz/system/domain/DbmyOrder.java
View file @
eee4e28a
...
...
@@ -57,7 +57,7 @@ public class DbmyOrder extends BaseEntity {
/**
* 收获地址
*/
private
String
adress
;
private
String
ad
d
ress
;
/**
* 详细地址
*/
...
...
pz-system/src/main/java/com/pz/system/service/impl/DbghOrderServiceImpl.java
View file @
eee4e28a
...
...
@@ -2,6 +2,7 @@ package com.pz.system.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.extension.toolkit.Db
;
import
com.pz.common.core.page.TableDataInfo
;
import
com.pz.common.core.domain.PageQuery
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -16,6 +17,7 @@ import com.pz.merchant.service.ISonOrderService;
import
com.pz.system.domain.DbwzOrder
;
import
com.pz.system.domain.TotalOrder
;
import
com.pz.system.domain.YypzOrder
;
import
com.pz.system.domain.bo.OrderFinishedBo
;
import
com.pz.system.mapper.TotalOrderMapper
;
import
com.pz.system.mapper.UserVsitorMapper
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -233,8 +235,75 @@ public class DbghOrderServiceImpl implements IDbghOrderService, ISonOrderService
return
true
;
}
/**
* 陪诊员开始服务代办挂号
*
* @param totalId 主订单ID
* @return 操作结果
*/
@Override
public
boolean
accompanyStartService
(
Integer
totalId
)
{
throw
new
UnsupportedOperationException
(
"此类业务订单不支持该操作"
);
TotalOrder
totalOrder
=
totalOrderMapper
.
selectById
(
totalId
);
Objects
.
requireNonNull
(
totalOrder
,
"主订单不存在"
);
if
(
totalOrder
.
getStatus
()
!=
1
||
totalOrder
.
getEmId
()
==
0
)
{
// 用户已付款
throw
new
ServiceException
(
"主订单不符合开始服务要求"
);
}
DbghOrder
suborder
=
baseMapper
.
selectOne
(
Wrappers
.<
DbghOrder
>
lambdaQuery
().
eq
(
DbghOrder:
:
getOrderId
,
totalId
));
Objects
.
requireNonNull
(
suborder
,
"子订单不存在"
);
if
(
suborder
.
getStatus
()
!=
1
)
{
// 订单已接单
throw
new
ServiceException
(
"子订单不符合开始服务要求"
);
}
// 操作时间若未到达开始时间,则拒绝该操作
if
(
suborder
.
getVisitTime
()
!=
null
)
{
LocalDateTime
visitTime
=
LocalDateTime
.
ofInstant
(
suborder
.
getVisitTime
().
toInstant
(),
ZoneId
.
systemDefault
());
LocalDateTime
currentDate
=
LocalDateTime
.
ofInstant
(
new
Date
().
toInstant
(),
ZoneId
.
systemDefault
());
if
(
currentDate
.
isBefore
(
visitTime
))
{
throw
new
ServiceException
(
"请在到达陪诊时间后再点击开始服务"
);
}
}
// 修改子订单状态为开始服务
suborder
.
setStatus
(
6
);
totalOrder
.
setSuborderStatus
(
6
);
if
(
baseMapper
.
updateById
(
suborder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,子订单异常"
);
}
if
(
totalOrderMapper
.
updateById
(
totalOrder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,主订单异常"
);
}
return
true
;
}
/**
* 陪诊员完成服务 代办挂号
*
* @param orderData 主订单ID
* @return 操作结果
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
finishedService
(
OrderFinishedBo
orderData
)
{
TotalOrder
totalOrder
=
totalOrderMapper
.
selectById
(
orderData
.
getOrderId
());
Objects
.
requireNonNull
(
totalOrder
,
"主订单不存在"
);
if
(
totalOrder
.
getStatus
()
!=
1
||
totalOrder
.
getEmId
()
==
0
)
{
// 用户已付款
throw
new
ServiceException
(
"主订单不符合开始服务要求"
);
}
DbghOrder
suborder
=
baseMapper
.
selectOne
(
Wrappers
.<
DbghOrder
>
lambdaQuery
().
eq
(
DbghOrder:
:
getOrderId
,
totalOrder
.
getId
()));
Objects
.
requireNonNull
(
suborder
,
"子订单不存在"
);
if
(
suborder
.
getStatus
()
!=
6
)
{
// 订单已接单
throw
new
ServiceException
(
"子订单不符合开始服务要求"
);
}
// 修改子订单状态为完成服务
suborder
.
setStatus
(
2
);
suborder
.
setOverTime
(
new
Date
());
suborder
.
setVoucher
(
orderData
.
getVoucher
());
suborder
.
setRemark
(
orderData
.
getRemark
());
totalOrder
.
setSuborderStatus
(
2
);
if
(
baseMapper
.
updateById
(
suborder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,子订单异常"
);
}
if
(
totalOrderMapper
.
updateById
(
totalOrder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,主订单异常"
);
}
return
true
;
}
}
pz-system/src/main/java/com/pz/system/service/impl/DbmyOrderServiceImpl.java
View file @
eee4e28a
...
...
@@ -18,6 +18,7 @@ import com.pz.system.domain.DbwzOrder;
import
com.pz.system.domain.TotalOrder
;
import
com.pz.system.domain.YypzOrder
;
import
com.pz.system.domain.bo.AccompanyAddressBo
;
import
com.pz.system.domain.bo.OrderFinishedBo
;
import
com.pz.system.mapper.TotalOrderMapper
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
...
...
@@ -83,7 +84,7 @@ public class DbmyOrderServiceImpl implements IDbmyOrderService, ISonOrderService
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPrescriptionAttachment
()),
DbmyOrder:
:
getPrescriptionAttachment
,
bo
.
getPrescriptionAttachment
());
lqw
.
eq
(
bo
.
getWay
()
!=
null
,
DbmyOrder:
:
getWay
,
bo
.
getWay
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getRecipient
()),
DbmyOrder:
:
getRecipient
,
bo
.
getRecipient
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getAdress
()),
DbmyOrder:
:
getAdress
,
bo
.
getAdress
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getAdress
()),
DbmyOrder:
:
getAd
d
ress
,
bo
.
getAdress
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getAddressInfo
()),
DbmyOrder:
:
getAddressInfo
,
bo
.
getAddressInfo
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPhone
()),
DbmyOrder:
:
getPhone
,
bo
.
getPhone
());
lqw
.
eq
(
bo
.
getIsRefrigerate
()
!=
null
,
DbmyOrder:
:
getIsRefrigerate
,
bo
.
getIsRefrigerate
());
...
...
@@ -253,4 +254,38 @@ public class DbmyOrderServiceImpl implements IDbmyOrderService, ISonOrderService
}
return
true
;
}
/**
* 陪诊员完成服务 代办买药
*
* @param orderData 主订单ID
* @return 操作结果
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
finishedService
(
OrderFinishedBo
orderData
)
{
TotalOrder
totalOrder
=
totalOrderMapper
.
selectById
(
orderData
.
getOrderId
());
Objects
.
requireNonNull
(
totalOrder
,
"主订单不存在"
);
if
(
totalOrder
.
getStatus
()
!=
1
||
totalOrder
.
getEmId
()
==
0
)
{
// 用户已付款
throw
new
ServiceException
(
"主订单不符合开始服务要求"
);
}
DbmyOrder
suborder
=
baseMapper
.
selectOne
(
Wrappers
.<
DbmyOrder
>
lambdaQuery
().
eq
(
DbmyOrder:
:
getOrderId
,
totalOrder
.
getId
()));
Objects
.
requireNonNull
(
suborder
,
"子订单不存在"
);
if
(
suborder
.
getStatus
()
!=
6
)
{
// 订单已接单
throw
new
ServiceException
(
"子订单不符合开始服务要求"
);
}
// 修改子订单状态为完成服务
suborder
.
setStatus
(
2
);
suborder
.
setOverTime
(
new
Date
());
suborder
.
setVoucher
(
orderData
.
getVoucher
());
suborder
.
setRemark
(
orderData
.
getRemark
());
totalOrder
.
setSuborderStatus
(
2
);
if
(
baseMapper
.
updateById
(
suborder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,子订单异常"
);
}
if
(
totalOrderMapper
.
updateById
(
totalOrder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,主订单异常"
);
}
return
true
;
}
}
pz-system/src/main/java/com/pz/system/service/impl/DbwzOrderServiceImpl.java
View file @
eee4e28a
...
...
@@ -15,6 +15,7 @@ import com.pz.merchant.mapper.EmployeesMapper;
import
com.pz.merchant.service.ISonOrderService
;
import
com.pz.system.domain.TotalOrder
;
import
com.pz.system.domain.YypzOrder
;
import
com.pz.system.domain.bo.OrderFinishedBo
;
import
com.pz.system.mapper.TotalOrderMapper
;
import
com.pz.system.mapper.UserVsitorMapper
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -272,4 +273,40 @@ public class DbwzOrderServiceImpl implements IDbwzOrderService, ISonOrderService
}
return
true
;
}
/**
* 陪诊员完成服务 代办问诊
*
* @param orderData 主订单ID
* @return 操作结果
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
finishedService
(
OrderFinishedBo
orderData
)
{
TotalOrder
totalOrder
=
totalOrderMapper
.
selectById
(
orderData
.
getOrderId
());
Objects
.
requireNonNull
(
totalOrder
,
"主订单不存在"
);
if
(
totalOrder
.
getStatus
()
!=
1
||
totalOrder
.
getEmId
()
==
0
)
{
// 用户已付款
throw
new
ServiceException
(
"主订单不符合开始服务要求"
);
}
DbwzOrder
suborder
=
baseMapper
.
selectOne
(
Wrappers
.<
DbwzOrder
>
lambdaQuery
().
eq
(
DbwzOrder:
:
getOrderId
,
totalOrder
.
getId
()));
Objects
.
requireNonNull
(
suborder
,
"子订单不存在"
);
if
(
suborder
.
getStatus
()
!=
6
)
{
// 订单已接单
throw
new
ServiceException
(
"子订单不符合开始服务要求"
);
}
// 修改子订单状态为完成服务
suborder
.
setStatus
(
2
);
suborder
.
setOverTime
(
new
Date
());
suborder
.
setVoucher
(
orderData
.
getVoucher
());
suborder
.
setIndications
(
orderData
.
getDoctor
());
suborder
.
setRemark
(
orderData
.
getRemark
());
totalOrder
.
setSuborderStatus
(
2
);
if
(
baseMapper
.
updateById
(
suborder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,子订单异常"
);
}
if
(
totalOrderMapper
.
updateById
(
totalOrder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,主订单异常"
);
}
return
true
;
}
}
pz-system/src/main/java/com/pz/system/service/impl/YypzOrderServiceImpl.java
View file @
eee4e28a
...
...
@@ -15,6 +15,7 @@ import com.pz.merchant.mapper.EmployeesMapper;
import
com.pz.merchant.service.ISonOrderService
;
import
com.pz.system.domain.DbwzOrder
;
import
com.pz.system.domain.TotalOrder
;
import
com.pz.system.domain.bo.OrderFinishedBo
;
import
com.pz.system.mapper.CityMapper
;
import
com.pz.system.mapper.TotalOrderMapper
;
import
com.pz.system.mapper.UserVsitorMapper
;
...
...
@@ -274,4 +275,38 @@ public class YypzOrderServiceImpl implements IYypzOrderService, ISonOrderService
}
return
true
;
}
/**
* 陪诊员完成服务 预约陪诊
*
* @param orderData 主订单ID
* @return 操作结果
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
finishedService
(
OrderFinishedBo
orderData
)
{
TotalOrder
totalOrder
=
totalOrderMapper
.
selectById
(
orderData
.
getOrderId
());
Objects
.
requireNonNull
(
totalOrder
,
"主订单不存在"
);
if
(
totalOrder
.
getStatus
()
!=
1
||
totalOrder
.
getEmId
()
==
0
)
{
// 用户已付款
throw
new
ServiceException
(
"主订单不符合开始服务要求"
);
}
YypzOrder
suborder
=
baseMapper
.
selectOne
(
Wrappers
.<
YypzOrder
>
lambdaQuery
().
eq
(
YypzOrder:
:
getOrderId
,
totalOrder
.
getId
()));
Objects
.
requireNonNull
(
suborder
,
"子订单不存在"
);
if
(
suborder
.
getStatus
()
!=
6
)
{
// 订单已接单
throw
new
ServiceException
(
"子订单不符合开始服务要求"
);
}
// 修改子订单状态为完成服务
suborder
.
setStatus
(
2
);
suborder
.
setOverTime
(
new
Date
());
suborder
.
setVoucher
(
orderData
.
getVoucher
());
suborder
.
setRemark
(
orderData
.
getRemark
());
totalOrder
.
setSuborderStatus
(
2
);
if
(
baseMapper
.
updateById
(
suborder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,子订单异常"
);
}
if
(
totalOrderMapper
.
updateById
(
totalOrder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,主订单异常"
);
}
return
true
;
}
}
pz-system/src/main/java/com/pz/system/service/impl/ZyphOrderServiceImpl.java
View file @
eee4e28a
...
...
@@ -16,6 +16,7 @@ import com.pz.merchant.service.ISonOrderService;
import
com.pz.system.domain.DbwzOrder
;
import
com.pz.system.domain.TotalOrder
;
import
com.pz.system.domain.YypzOrder
;
import
com.pz.system.domain.bo.OrderFinishedBo
;
import
com.pz.system.mapper.TotalOrderMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -285,4 +286,38 @@ public class ZyphOrderServiceImpl implements IZyphOrderService, ISonOrderService
}
return
true
;
}
/**
* 陪诊员完成服务 住院陪护
*
* @param orderData 主订单ID
* @return 操作结果
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
finishedService
(
OrderFinishedBo
orderData
)
{
TotalOrder
totalOrder
=
totalOrderMapper
.
selectById
(
orderData
.
getOrderId
());
Objects
.
requireNonNull
(
totalOrder
,
"主订单不存在"
);
if
(
totalOrder
.
getStatus
()
!=
1
||
totalOrder
.
getEmId
()
==
0
)
{
// 用户已付款
throw
new
ServiceException
(
"主订单不符合开始服务要求"
);
}
ZyphOrder
suborder
=
baseMapper
.
selectOne
(
Wrappers
.<
ZyphOrder
>
lambdaQuery
().
eq
(
ZyphOrder:
:
getOrderId
,
totalOrder
.
getId
()));
Objects
.
requireNonNull
(
suborder
,
"子订单不存在"
);
if
(
suborder
.
getStatus
()
!=
6
)
{
// 订单已接单
throw
new
ServiceException
(
"子订单不符合开始服务要求"
);
}
// 修改子订单状态为完成服务
suborder
.
setStatus
(
2
);
suborder
.
setOverTime
(
new
Date
());
suborder
.
setVoucher
(
orderData
.
getVoucher
());
suborder
.
setRemark
(
orderData
.
getRemark
());
totalOrder
.
setSuborderStatus
(
2
);
if
(
baseMapper
.
updateById
(
suborder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,子订单异常"
);
}
if
(
totalOrderMapper
.
updateById
(
totalOrder
)
<
0
)
{
throw
new
ServiceException
(
"操作失败,主订单异常"
);
}
return
true
;
}
}
pz-system/src/main/resources/mapper/system/DbmyOrderMapper.xml
View file @
eee4e28a
...
...
@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dbmy_order.prescription_attachment,
dbmy_order.phone,
dbmy_order.recipient,
dbmy_order.adress as address,
dbmy_order.ad
d
ress as address,
dbmy_order.address_info,
dbmy_order.is_refrigerate,
total_order.remark as description,
...
...
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