Commit cc4348c3 by 张新旗

前进前进,继续上代码

parent 48f263f1
...@@ -170,7 +170,7 @@ public class OrderOperationLogServiceImpl implements IOrderOperationLogService ...@@ -170,7 +170,7 @@ public class OrderOperationLogServiceImpl implements IOrderOperationLogService
operationLog.setOperationUser("系统"); operationLog.setOperationUser("系统");
operationLog.setContent("用户完成退款"); operationLog.setContent("用户完成退款");
}else{ }else{
operationLog.setStatus("已完成"); operationLog.setStatus("已退款");
operationLog.setOperation("售后"); operationLog.setOperation("售后");
operationLog.setOperationUser(orderRefund.getCreateUserName()); operationLog.setOperationUser(orderRefund.getCreateUserName());
operationLog.setContent(orderRefund.getDesc()); operationLog.setContent(orderRefund.getDesc());
......
...@@ -136,6 +136,14 @@ public class OrderServiceImpl implements IOrderService ...@@ -136,6 +136,14 @@ public class OrderServiceImpl implements IOrderService
if(HttpStatus.SUCCESS != (int)result.get(result.CODE_TAG)){ if(HttpStatus.SUCCESS != (int)result.get(result.CODE_TAG)){
return result; return result;
} }
try{
checkBusinessTime(order.getShopId());
}catch (ServiceException e){
return AjaxResult.error(e.getMessage());
}
order.setState(OrderStatusConstant.Unpaid); order.setState(OrderStatusConstant.Unpaid);
order.setUserId(loginUser.getOpenId()); order.setUserId(loginUser.getOpenId());
order.setUserName(loginUser.getUsername()); order.setUserName(loginUser.getUsername());
...@@ -189,6 +197,26 @@ public class OrderServiceImpl implements IOrderService ...@@ -189,6 +197,26 @@ public class OrderServiceImpl implements IOrderService
} }
private void checkBusinessTime(String shopId) {
Shop shop = shopMapper.selectShopById(shopId);
String startTime = shop.getStartTime();
String endTime = shop.getEndTime();
String[] split = startTime.split(":");
String[] split1 = endTime.split(":");
Calendar startBusiness = Calendar.getInstance();
startBusiness.set(Calendar.HOUR_OF_DAY,Integer.parseInt(split[0]));
startBusiness.set(Calendar.MINUTE,Integer.parseInt(split[1]));
Calendar endBusiness = Calendar.getInstance();
endBusiness.set(Calendar.HOUR_OF_DAY,Integer.parseInt(split1[0]));
endBusiness.set(Calendar.MINUTE,Integer.parseInt(split1[1]));
long l = System.currentTimeMillis();
if(startBusiness.getTimeInMillis()>l||endBusiness.getTimeInMillis()<l){
throw new ServiceException("当前时间本店休息中,暂停点单~");
}
}
/** /**
*订单重写从这里开始,这里要承担大部分的业务逻辑,逻辑集中化处理 *订单重写从这里开始,这里要承担大部分的业务逻辑,逻辑集中化处理
*/ */
......
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