Commit 4af92fd9 by zhengxj

finish 数据权限限制 on 20190319 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18696 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 19e849a1
...@@ -498,6 +498,13 @@ public class OrderServiceImpl implements IOrderService { ...@@ -498,6 +498,13 @@ public class OrderServiceImpl implements IOrderService {
} else { } else {
dataRight = orderChannelDao.getDataRight(userId, null); dataRight = orderChannelDao.getDataRight(userId, null);
} }
// 用户数据权限先无数据
if(dataRight==null||dataRight.size()==0){
finishedOrders.setDayOrders(0);
finishedOrders.setMonthGrowth(new BigDecimal(-10000));
finishedOrders.setOrderNumber(0);
finishedOrders.setWeekGrowth(new BigDecimal(-10000));
}
criteria.andShopIdIn(dataRight); criteria.andShopIdIn(dataRight);
totalOrders = orderDao.countByExample(example); totalOrders = orderDao.countByExample(example);
...@@ -527,8 +534,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -527,8 +534,7 @@ public class OrderServiceImpl implements IOrderService {
lastSunday.setSeconds(59); lastSunday.setSeconds(59);
criteria = example.createCriteria().andActiveStatusEqualTo(orderStatus).andCanceledNotEqualTo((byte) 0) criteria = example.createCriteria().andActiveStatusEqualTo(orderStatus).andCanceledNotEqualTo((byte) 0)
.andCompleteTimeGreaterThanOrEqualTo(lastMonday).andCompleteTimeLessThanOrEqualTo(lastSunday) .andCompleteTimeGreaterThanOrEqualTo(lastMonday).andCompleteTimeLessThanOrEqualTo(lastSunday)
.andShopIdIn(dataRight).andOrderTypeEqualTo((byte) OrderTypeEnum.INSTALL.getOrderType()); .andShopIdIn(dataRight).andOrderTypeEqualTo((byte) OrderTypeEnum.INSTALL.getOrderType());
;
BigDecimal lastWeekOrders = new BigDecimal(orderDao.countByExample(example)); BigDecimal lastWeekOrders = new BigDecimal(orderDao.countByExample(example));
...@@ -538,8 +544,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -538,8 +544,7 @@ public class OrderServiceImpl implements IOrderService {
criteria = example.createCriteria().andActiveStatusEqualTo(orderStatus).andCanceledNotEqualTo((byte) 0) criteria = example.createCriteria().andActiveStatusEqualTo(orderStatus).andCanceledNotEqualTo((byte) 0)
.andCompleteTimeGreaterThanOrEqualTo(DateUtil.getLastWeekMonday(lastMonday)) .andCompleteTimeGreaterThanOrEqualTo(DateUtil.getLastWeekMonday(lastMonday))
.andCompleteTimeLessThanOrEqualTo(DateUtil.getLastWeekSunday(lastSunday)).andShopIdIn(dataRight) .andCompleteTimeLessThanOrEqualTo(DateUtil.getLastWeekSunday(lastSunday)).andShopIdIn(dataRight)
.andOrderTypeEqualTo((byte) OrderTypeEnum.INSTALL.getOrderType()); .andOrderTypeEqualTo((byte) OrderTypeEnum.INSTALL.getOrderType());
;
BigDecimal twoWeekAgoOrders = new BigDecimal(orderDao.countByExample(example)); BigDecimal twoWeekAgoOrders = new BigDecimal(orderDao.countByExample(example));
...@@ -622,6 +627,13 @@ public class OrderServiceImpl implements IOrderService { ...@@ -622,6 +627,13 @@ public class OrderServiceImpl implements IOrderService {
} else { } else {
dataRight = orderChannelDao.getDataRight(userId, null); dataRight = orderChannelDao.getDataRight(userId, null);
} }
// 用户数据权限先无数据
if (dataRight == null || dataRight.size() == 0) {
unfinishedOrders.setRatio(new BigDecimal(-10000));
unfinishedOrders.setUnfinished(0);
}
criteria.andShopIdIn(dataRight); criteria.andShopIdIn(dataRight);
// 未完成的安装单 // 未完成的安装单
long totalUnfinishedOrders = orderDao.countByExample(example); long totalUnfinishedOrders = orderDao.countByExample(example);
...@@ -676,7 +688,13 @@ public class OrderServiceImpl implements IOrderService { ...@@ -676,7 +688,13 @@ public class OrderServiceImpl implements IOrderService {
} else { } else {
dataRight = orderChannelDao.getDataRight(userId, null); dataRight = orderChannelDao.getDataRight(userId, null);
} }
// 用户数据权限先无数据
if (dataRight == null || dataRight.size() == 0) {
subOrders.setDismantled(0);
subOrders.setMonthGrowth(new BigDecimal(-10000));
subOrders.setRepair(0);
subOrders.setWeekGrowth(new BigDecimal(-10000));
}
criteria.andShopIdIn(dataRight); criteria.andShopIdIn(dataRight);
// 未完成的拆除单 // 未完成的拆除单
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!