Commit d2e19209 by sdif

Merge remote-tracking branch 'origin/dev' into dev

parents 1d455689 ec2115c7
...@@ -20,11 +20,16 @@ public class AccompanyDemandVo { ...@@ -20,11 +20,16 @@ public class AccompanyDemandVo {
private Integer orderId; private Integer orderId;
/** /**
* 项目名称 * 服务名称
*/ */
private String project; private String project;
/** /**
* 业务名称
*/
private String businessName;
/**
* 订单佣金 * 订单佣金
*/ */
private Float commission; private Float commission;
......
...@@ -134,7 +134,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -134,7 +134,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
// TODO 待优化 // TODO 待优化
TotalOrderVo totalOrderVo = baseMapper.selectByOrderId(id); TotalOrderVo totalOrderVo = baseMapper.selectByOrderId(id);
//获取陪诊员用户id // 获取陪诊员用户id
Optional.ofNullable(employeesMapper.selectVoById(totalOrderVo.getEmId())) Optional.ofNullable(employeesMapper.selectVoById(totalOrderVo.getEmId()))
.map(EmployeesVo::getUid) .map(EmployeesVo::getUid)
.ifPresent(totalOrderVo::setEUserId); .ifPresent(totalOrderVo::setEUserId);
...@@ -147,7 +147,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -147,7 +147,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrderVo.setServiceStatus( totalOrderVo.setServiceStatus(
yypzOrder.getStatus() yypzOrder.getStatus()
); );
//totalOrderVo = BeanUtil.toBean(yypzOrder, TotalOrderVo.class); // totalOrderVo = BeanUtil.toBean(yypzOrder, TotalOrderVo.class);
totalOrderVo.setHospital(hospitalMapper.selectById(yypzOrder.getHid()).getName()); totalOrderVo.setHospital(hospitalMapper.selectById(yypzOrder.getHid()).getName());
totalOrderVo.setVisitor(userVsitorMapper.selectById(yypzOrder.getVisitor()).getName()); totalOrderVo.setVisitor(userVsitorMapper.selectById(yypzOrder.getVisitor()).getName());
totalOrderVo.setDepartment(departmentMapper.selectById(yypzOrder.getDid()).getTitle()); totalOrderVo.setDepartment(departmentMapper.selectById(yypzOrder.getDid()).getTitle());
...@@ -180,7 +180,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -180,7 +180,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
dbwzOrder.getStatus() dbwzOrder.getStatus()
); );
// totalOrderVo = BeanUtil.toBean(dbwzOrder, TotalOrderVo.class); // totalOrderVo = BeanUtil.toBean(dbwzOrder, TotalOrderVo.class);
//totalOrderVo = BeanUtil.toBean(dbwzOrder, TotalOrderVo.class); // totalOrderVo = BeanUtil.toBean(dbwzOrder, TotalOrderVo.class);
totalOrderVo.setProject(servicesMapper.selectVoById(totalOrderVo.getServiceId()).getName()); totalOrderVo.setProject(servicesMapper.selectVoById(totalOrderVo.getServiceId()).getName());
totalOrderVo.setDepartment(departmentMapper.selectById(dbwzOrder.getDid()).getTitle()); totalOrderVo.setDepartment(departmentMapper.selectById(dbwzOrder.getDid()).getTitle());
totalOrderVo.setVisitor(userVsitorMapper.selectById(dbwzOrder.getVisitor()).getName()); totalOrderVo.setVisitor(userVsitorMapper.selectById(dbwzOrder.getVisitor()).getName());
...@@ -298,7 +298,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -298,7 +298,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
// 业务 // 业务
Business business = businessMapper.selectById(totalOrderVo.getBusinessId()); Business business = businessMapper.selectById(totalOrderVo.getBusinessId());
if(null != business){ if (null != business) {
totalOrderVo.setName(business.getName()); totalOrderVo.setName(business.getName());
} }
...@@ -516,29 +516,29 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -516,29 +516,29 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
Objects.requireNonNull(orderService, "订单业务属性出错"); Objects.requireNonNull(orderService, "订单业务属性出错");
SonOrderVo sonOrderSimpleDataByTotalId = orderService.getSonOrderSimpleDataByTotalId(totalOrder.getId().intValue()); SonOrderVo sonOrderSimpleDataByTotalId = orderService.getSonOrderSimpleDataByTotalId(totalOrder.getId().intValue());
//待办问诊 已接单下取消订单调用退款接口 // 待办问诊 已接单下取消订单调用退款接口
//已接单、待服务状态下等待陪诊员开始服务或取消订单 // 已接单、待服务状态下等待陪诊员开始服务或取消订单
TotalOrderBo totalOrderBo = new TotalOrderBo(); TotalOrderBo totalOrderBo = new TotalOrderBo();
totalOrderBo.setId(totalOrder.getId()); totalOrderBo.setId(totalOrder.getId());
if(totalOrder.getBusinessId() == 3 && totalOrder.getStatus() == 1 ){ if (totalOrder.getBusinessId() == 3 && totalOrder.getStatus() == 1) {
totalOrderBo.setIsRefund(0); totalOrderBo.setIsRefund(0);
return this.refundOrder(totalOrderBo); return this.refundOrder(totalOrderBo);
} }
//进行中、待完成状态下等待陪诊员完成服务 // 进行中、待完成状态下等待陪诊员完成服务
if(totalOrder.getBusinessId() == 3 && totalOrder.getStatus() == 6 ){ if (totalOrder.getBusinessId() == 3 && totalOrder.getStatus() == 6) {
totalOrderBo.setIsRefund(1); totalOrderBo.setIsRefund(1);
return this.refundOrder(totalOrderBo); return this.refundOrder(totalOrderBo);
} }
//待办买药已接单 代发货下取消订单调用退款接口 // 待办买药已接单 代发货下取消订单调用退款接口
if(totalOrder.getBusinessId() == 5 && totalOrder.getStatus() == 1){ if (totalOrder.getBusinessId() == 5 && totalOrder.getStatus() == 1) {
totalOrderBo.setIsRefund(0); totalOrderBo.setIsRefund(0);
return this.refundOrder(totalOrderBo); return this.refundOrder(totalOrderBo);
} }
//已接单、待收货状态下等待药品到达后确认 // 已接单、待收货状态下等待药品到达后确认
if(totalOrder.getBusinessId() == 5 && totalOrder.getStatus() == 2){ if (totalOrder.getBusinessId() == 5 && totalOrder.getStatus() == 2) {
totalOrderBo.setIsRefund(1); totalOrderBo.setIsRefund(1);
return this.refundOrder(totalOrderBo); return this.refundOrder(totalOrderBo);
} }
...@@ -650,12 +650,12 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -650,12 +650,12 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
throw new ServiceException("子订单状态出错!"); throw new ServiceException("子订单状态出错!");
} }
//订单退款金额 // 订单退款金额
double money = 0; double money = 0;
if(bo.getIsRefund() == 0){//陪诊员订单未完成用户主动退款 if (bo.getIsRefund() == 0) {// 陪诊员订单未完成用户主动退款
//主订单必须为付款并且子订单为已接单 // 主订单必须为付款并且子订单为已接单
if(totalOrder.getStatus() != 1 && sonOrderSimpleDataByTotalId.getOrderStatus() != 1){ if (totalOrder.getStatus() != 1 && sonOrderSimpleDataByTotalId.getOrderStatus() != 1) {
throw new ServiceException("退款出错!"); throw new ServiceException("退款出错!");
} }
/** /**
...@@ -668,7 +668,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -668,7 +668,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
* (3)订单开始前3小时取消--需承担服务项目金额的50% * (3)订单开始前3小时取消--需承担服务项目金额的50%
*/ */
//待办问诊和待办买药走取消订单退款 // 待办问诊和待办买药走取消订单退款
/*if(totalOrder.getBusinessId() == 3 || totalOrder.getBusinessId() == 5){ /*if(totalOrder.getBusinessId() == 3 || totalOrder.getBusinessId() == 5){
throw new ServiceException("待办问诊和待办买药退款失败!"); throw new ServiceException("待办问诊和待办买药退款失败!");
}*/ }*/
...@@ -676,16 +676,16 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -676,16 +676,16 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
/** /**
* 待办买药 * 待办买药
*/ */
if(totalOrder.getBusinessId() == 5){ if (totalOrder.getBusinessId() == 5) {
money = totalOrder.getPayMoney(); money = totalOrder.getPayMoney();
}else if(totalOrder.getBusinessId() == 0){//商城订单 } else if (totalOrder.getBusinessId() == 0) {// 商城订单
}else {//一般陪诊订单 } else {// 一般陪诊订单
//一般订单开始服务时间 // 一般订单开始服务时间
String serveTime = orderService.getFinishTime(totalOrder.getBusinessId()); String serveTime = orderService.getFinishTime(totalOrder.getBusinessId());
if(StringUtils.isNotEmpty(serveTime)) { if (StringUtils.isNotEmpty(serveTime)) {
money = getMoney(serveTime,totalOrder.getPayMoney());//计算退款金额 money = getMoney(serveTime, totalOrder.getPayMoney());// 计算退款金额
} }
} }
...@@ -703,8 +703,8 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -703,8 +703,8 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
e.printStackTrace(); e.printStackTrace();
} }
totalOrder.setRefundAmount(totalOrder.getPayMoney()); totalOrder.setRefundAmount(totalOrder.getPayMoney());
}else if (bo.getIsRefund() == 1){//陪诊员订单完成走审批流程 } else if (bo.getIsRefund() == 1) {// 陪诊员订单完成走审批流程
if(sonOrderSimpleDataByTotalId.getOrderStatus() != 2){ if (sonOrderSimpleDataByTotalId.getOrderStatus() != 2) {
throw new ServiceException("订单状态错误"); throw new ServiceException("订单状态错误");
} }
// 修改主订单退款理由 // 修改主订单退款理由
...@@ -790,7 +790,8 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -790,7 +790,8 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
wrapper.eq("total_order.em_id", emId) // 未分配陪诊员订单 wrapper.eq("total_order.em_id", emId) // 未分配陪诊员订单
.eq("total_order.status", 2) // 订单已完成 .eq("total_order.status", 2) // 订单已完成
.between("total_order.business_id", 1, 5) .between("total_order.business_id", 1, 5)
.orderByDesc("total_order.id");; .orderByDesc("total_order.id");
;
IPage<AccompanyDemandVo> result = baseMapper.selectUndistributedTotalOrder(page.build(), wrapper); IPage<AccompanyDemandVo> result = baseMapper.selectUndistributedTotalOrder(page.build(), wrapper);
// 装载子订单信息 // 装载子订单信息
result.getRecords().forEach(order -> { result.getRecords().forEach(order -> {
...@@ -826,11 +827,11 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -826,11 +827,11 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
Objects.requireNonNull(orderService, "订单业务属性出错"); Objects.requireNonNull(orderService, "订单业务属性出错");
// 已接单状态 // 已接单状态
int target = 1; int target = 1;
// 代办挂号需额外处理 // 代办挂号需额外处理(去除判断)
if (totalOrder.getBusinessId() == 2 && totalOrder.getStatus() == 1) { /* if (totalOrder.getBusinessId() == 2 && totalOrder.getStatus() == 1) {
// 若接单(待办挂号)时,订单已支付,则子订单状态应该修改为6(进行中) // 若接单(待办挂号)时,订单已支付,则子订单状态应该修改为6(进行中)
target = 6; target = 6;
} } */
// 修改子订单状态 // 修改子订单状态
boolean sonOrderFlag = orderService.switchSonOrderStatus(totalOrder.getId(), target); boolean sonOrderFlag = orderService.switchSonOrderStatus(totalOrder.getId(), target);
if (!sonOrderFlag) { if (!sonOrderFlag) {
...@@ -992,7 +993,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -992,7 +993,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
} }
} }
public long getHour(String date){ public long getHour(String date) {
LocalDateTime startTime = LocalDateTime.parse(date); LocalDateTime startTime = LocalDateTime.parse(date);
// 获取当前时间 // 获取当前时间
...@@ -1004,7 +1005,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService { ...@@ -1004,7 +1005,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
return duration.toHours(); return duration.toHours();
} }
public double getMoney(String serveTime,double payMoney){ public double getMoney(String serveTime, double payMoney) {
double money = 0; double money = 0;
double deduction = 0; double deduction = 0;
double remainingAmount = 0; double remainingAmount = 0;
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<sql id="OrderCommon"> <sql id="OrderCommon">
select total_order.id as orderId, select total_order.id as orderId,
business.name as project, services.name as project,
business.name as businessName,
CONVERT((1 - services.fenmo / 100), decimal(10, 2)) * CONVERT((1 - services.fenmo / 100), decimal(10, 2)) *
CONVERT(services.price, decimal(10, 2)) as commission, CONVERT(services.price, decimal(10, 2)) as commission,
total_order.business_id, total_order.business_id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment