Commit 891a9fa2 by zhengxj

finish 获取检修单统计数据 on 20190129 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@17203 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent f9786013
...@@ -63,7 +63,7 @@ public class SubOrders implements Serializable { ...@@ -63,7 +63,7 @@ public class SubOrders implements Serializable {
return repair; return repair;
} }
public void setRepair(Integer repair) { public void setRepair(long repair) {
this.repair = repair; this.repair = repair;
} }
......
...@@ -362,12 +362,14 @@ public class OrderServiceImpl implements IOrderService { ...@@ -362,12 +362,14 @@ public class OrderServiceImpl implements IOrderService {
byte orderStatus = 8; byte orderStatus = 8;
// 如果当前用户是运营 // 如果当前用户是运营
int userType = user.getUserType(); int userType = user.getUserType();
long totalOrders = 0; long dismantled = 0;
long repair = 0;
SysMerchant merchant = null; SysMerchant merchant = null;
List<Byte> orderTypeList = new ArrayList<>(); List<Byte> orderTypeList = new ArrayList<>();
// 1.安装单、2.拆除单、3.检修单
orderTypeList.add((byte) 2); orderTypeList.add((byte) 2);
orderTypeList.add((byte) 3); orderTypeList.add((byte) 3);
criteria.andActiveStatusNotEqualTo(orderStatus).andCanceledNotEqualTo((byte) 0).andOrderTypeIn(orderTypeList); criteria.andActiveStatusNotEqualTo(orderStatus).andCanceledNotEqualTo((byte) 0).andOrderTypeEqualTo((byte) 2);
// 当前用户:服务商或者门店 // 当前用户:服务商或者门店
if (userType == 1 || userType == 2) { if (userType == 1 || userType == 2) {
SysMerchantExample merExample = new SysMerchantExample(); SysMerchantExample merExample = new SysMerchantExample();
...@@ -379,10 +381,16 @@ public class OrderServiceImpl implements IOrderService { ...@@ -379,10 +381,16 @@ public class OrderServiceImpl implements IOrderService {
criteria.andShopIdEqualTo(merchant.getId()); criteria.andShopIdEqualTo(merchant.getId());
} }
} }
totalOrders = orderDao.countByExample(example); // 拆除单
// 业务总量 dismantled = orderDao.countByExample(example);
subOrders.setTotalOrders(totalOrders);
criteria.andOrderTypeEqualTo((byte) 3);
// 检修单
repair = orderDao.countByExample(example);
// 业务总量
subOrders.setTotalOrders(dismantled + repair);
subOrders.setDismantled(dismantled);
subOrders.setRepair(repair);
example.clear(); example.clear();
// 周环比 // 周环比
...@@ -445,7 +453,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -445,7 +453,7 @@ public class OrderServiceImpl implements IOrderService {
criteria.andShopIdEqualTo(merchant.getId()); criteria.andShopIdEqualTo(merchant.getId());
} }
BigDecimal lastMonthOrders = new BigDecimal(orderDao.countByExample(example)); BigDecimal lastMonthOrders = new BigDecimal(orderDao.countByExample(example));
// 上上个月订单数量 // 上上个月订单数量
Date pastMonthFistDay = DateUtil.getPastMonthFirstDay(2); Date pastMonthFistDay = DateUtil.getPastMonthFirstDay(2);
pastMonthFistDay.setHours(0); pastMonthFistDay.setHours(0);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!