|
@@ -107,6 +107,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
|
|
private MerchantSmsTimingService merchantSmsTimingService;
|
|
private MerchantSmsTimingService merchantSmsTimingService;
|
|
@Autowired
|
|
@Autowired
|
|
private MerchantSmsTemplateService merchantSmsTemplateService;
|
|
private MerchantSmsTemplateService merchantSmsTemplateService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private UserBypassAccountService userBypassAccountService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据订单编号获取订单
|
|
* 根据订单编号获取订单
|
|
@@ -166,7 +168,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
|
|
Page<Order> page = PageHelper.startPage(pageRequest.getPage(), pageRequest.getLimit());
|
|
Page<Order> page = PageHelper.startPage(pageRequest.getPage(), pageRequest.getLimit());
|
|
LambdaQueryWrapper<Order> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<Order> lqw = Wrappers.lambdaQuery();
|
|
User userInfo = userService.getInfo();
|
|
User userInfo = userService.getInfo();
|
|
-
|
|
|
|
if (null != userInfo.getIsAllOrders() && 1 == userInfo.getIsAllOrders()) {
|
|
if (null != userInfo.getIsAllOrders() && 1 == userInfo.getIsAllOrders()) {
|
|
List<Integer> parents = userService.getParentId(userId);
|
|
List<Integer> parents = userService.getParentId(userId);
|
|
if (null != parents && parents.size() > 0) {
|
|
if (null != parents && parents.size() > 0) {
|
|
@@ -193,12 +194,20 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
|
|
lqw.in(Order::getType, OrderConstants.ORDER_TYPE_NORMAL, OrderConstants.ORDER_TYPE_SECKILL);
|
|
lqw.in(Order::getType, OrderConstants.ORDER_TYPE_NORMAL, OrderConstants.ORDER_TYPE_SECKILL);
|
|
lqw.eq(Order::getIsDel, false);
|
|
lqw.eq(Order::getIsDel, false);
|
|
Integer isEnterpriseUser = userInfo.getIsEnterpriseUser();
|
|
Integer isEnterpriseUser = userInfo.getIsEnterpriseUser();
|
|
- if (null != isEnterpriseUser){
|
|
|
|
|
|
+ if (null != isEnterpriseUser) {
|
|
lqw.eq(Order::getIsEnterpriseUser, isEnterpriseUser);
|
|
lqw.eq(Order::getIsEnterpriseUser, isEnterpriseUser);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
lqw.eq(Order::getIsEnterpriseUser, 999);
|
|
lqw.eq(Order::getIsEnterpriseUser, 999);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ Integer enterpriseId = 0;
|
|
|
|
+ if (3 == isEnterpriseUser) {
|
|
|
|
+ LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.eq(UserBypassAccount::getUserId, userInfo.getId());
|
|
|
|
+ queryWrapper.eq(UserBypassAccount::getIsDelete, 0);
|
|
|
|
+ UserBypassAccount one = userBypassAccountService.getOne(queryWrapper);
|
|
|
|
+ enterpriseId = one.getEnterpriseId();
|
|
|
|
+ lqw.eq(Order::getEnterpriseId, enterpriseId);
|
|
|
|
+ }
|
|
lqw.orderByDesc(Order::getId);
|
|
lqw.orderByDesc(Order::getId);
|
|
List<Order> orderList = dao.selectList(lqw);
|
|
List<Order> orderList = dao.selectList(lqw);
|
|
return CommonPage.copyPageInfo(page, orderList);
|
|
return CommonPage.copyPageInfo(page, orderList);
|
|
@@ -240,7 +249,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
String mDateTime = formatter.format(c.getTime());
|
|
String mDateTime = formatter.format(c.getTime());
|
|
lqw.apply(StringUtils.isNotBlank(mDateTime), "DATE(create_time) >= STR_TO_DATE('" + mDateTime + "','%Y-%m-%d')");
|
|
lqw.apply(StringUtils.isNotBlank(mDateTime), "DATE(create_time) >= STR_TO_DATE('" + mDateTime + "','%Y-%m-%d')");
|
|
- lqw.in(Order::getIsEnterpriseUser, 2,3);
|
|
|
|
|
|
+ lqw.in(Order::getIsEnterpriseUser, 2, 3);
|
|
lqw.orderByDesc(Order::getId);
|
|
lqw.orderByDesc(Order::getId);
|
|
List<Order> orderList = dao.selectList(lqw);
|
|
List<Order> orderList = dao.selectList(lqw);
|
|
return CommonPage.copyPageInfo(page, orderList);
|
|
return CommonPage.copyPageInfo(page, orderList);
|
|
@@ -944,21 +953,32 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public Integer getCountByStatusAndUid(Integer status, Integer userId) {
|
|
public Integer getCountByStatusAndUid(Integer status, Integer userId) {
|
|
- User user = userService.getInfo();
|
|
|
|
|
|
+ User user = userService.getById(58);
|
|
|
|
+ userId=58;
|
|
|
|
|
|
if (status < 0) {
|
|
if (status < 0) {
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
LambdaQueryWrapper<Order> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<Order> lqw = Wrappers.lambdaQuery();
|
|
lqw.eq(Order::getUid, userId);
|
|
lqw.eq(Order::getUid, userId);
|
|
- if (2 == user.getIsEnterpriseUser() ) {
|
|
|
|
- lqw.in(Order::getIsEnterpriseUser, 2,3);
|
|
|
|
- } else if (3 == user.getIsEnterpriseUser()){
|
|
|
|
|
|
+ if (2 == user.getIsEnterpriseUser()) {
|
|
|
|
+ lqw.in(Order::getIsEnterpriseUser, 2, 3);
|
|
|
|
+ } else if (3 == user.getIsEnterpriseUser()) {
|
|
lqw.eq(Order::getIsEnterpriseUser, 3);
|
|
lqw.eq(Order::getIsEnterpriseUser, 3);
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
lqw.eq(Order::getIsEnterpriseUser, 1);
|
|
lqw.eq(Order::getIsEnterpriseUser, 1);
|
|
}
|
|
}
|
|
|
|
+ Integer integer = dao.selectCount(lqw);
|
|
|
|
+
|
|
|
|
+ Integer enterpriseId = 0;
|
|
|
|
+ if (3 == user.getIsEnterpriseUser()) {
|
|
|
|
+ LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.eq(UserBypassAccount::getUserId, user.getId());
|
|
|
|
+ UserBypassAccount one = userBypassAccountService.getOne(queryWrapper);
|
|
|
|
+ enterpriseId = one.getEnterpriseId();
|
|
|
|
+ lqw.eq(Order::getEnterpriseId, enterpriseId);
|
|
|
|
+ }
|
|
|
|
+ Integer integer1 = dao.selectCount(lqw);
|
|
lqw.eq(Order::getIsDel, false);
|
|
lqw.eq(Order::getIsDel, false);
|
|
lqw.and(i -> i.ne(Order::getIsIntegral, 1).or().isNull(Order::getIsIntegral));
|
|
lqw.and(i -> i.ne(Order::getIsIntegral, 1).or().isNull(Order::getIsIntegral));
|
|
if (OrderConstants.ORDER_STATUS_WAIT_SHIPPING.equals(status)) {
|
|
if (OrderConstants.ORDER_STATUS_WAIT_SHIPPING.equals(status)) {
|