Commit 8cd1b7e6 by 邹磊浩

修改代码

parent 40016aa2
......@@ -506,12 +506,12 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
} else if (bo.getBusinessId() == 0) {// 商城订单
StoreOrder storeOrder = BeanUtil.toBean(bo, StoreOrder.class);
StoreGoods storeGoods1 = storeGoodsMapper.selectById(storeOrder.getGoodsId());
if (storeGoods1.getInventory() == 0) {
throw new ServiceException("商品库存不足!");
}
storeOrder.setStoreId(storeGoods1.getStoreId());
// 扣除库存
storeGoods1.setId(storeOrder.getId());
storeGoods1.setInventory(storeGoods1.getInventory() - storeOrder.getNum());
......@@ -561,7 +561,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
if (totalOrder.getBusinessId() == 5
&& totalOrder.getStatus() == 1
&& sonOrderSimpleDataByTotalId.getOrderStatus() == 1
) {
) {
totalOrderBo.setIsRefund(0);
return this.refundOrder(totalOrderBo);
}
......@@ -729,7 +729,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
boolean sonOrderFlag = orderService.switchSonOrderStatus(totalOrder.getId(), CommonOrderStatus.REFUND.getCode());
//除了商城订单和诊前挂号不需要给陪诊员和商户分成
if(totalOrder.getBusinessId() != 0 && totalOrder.getBusinessId() != 6 && totalOrder.getStatus() == 2) {
if (totalOrder.getBusinessId() != 0 && totalOrder.getBusinessId() != 6 && totalOrder.getStatus() == 2) {
Services services = servicesMapper.selectById(totalOrder.getServiceId());
if (services.getFenmo() != 0) {
double money = 0;
......@@ -793,7 +793,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
if (null == sonOrderSimpleDataByTotalId) {
throw new ServiceException("子订单状态出错!");
}
int IsRefund = getIsRefund(totalOrder.getBusinessId(),totalOrder.getStatus(),sonOrderSimpleDataByTotalId.getSonOrderId());
int IsRefund = getIsRefund(totalOrder.getBusinessId(), totalOrder.getStatus(), sonOrderSimpleDataByTotalId.getSonOrderId());
// 订单退款金额
double money = 0;
......@@ -1188,13 +1188,13 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
return money;
}
public int getIsRefund(int businessId,int businessStatus,int ServiceStatus){
public int getIsRefund(int businessId, int businessStatus, int ServiceStatus) {
int IsRefund = 0;
if((businessStatus == 1 && ServiceStatus == 0) || (businessStatus == 1 && ServiceStatus == 1)){
if ((businessStatus == 1 && ServiceStatus == 0) || (businessStatus == 1 && ServiceStatus == 1)) {
IsRefund = 0;
}else if(businessStatus == 2 && ServiceStatus == 2){
} else if (businessStatus == 2 && ServiceStatus == 2) {
IsRefund = 1;
}else if(businessId == 3 && businessStatus == 1 && ServiceStatus == 2){
} else if (businessId == 3 && businessStatus == 1 && ServiceStatus == 2) {
IsRefund = 1;
}
return IsRefund;
......
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