| @@ -51,14 +51,16 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| @Autowired | |||
| WxBillRentMapper wxBillRentMapper; | |||
| @Autowired | |||
| WxCouponOrderMapper wxCouponOrderMapper; | |||
| @Autowired | |||
| WxCouponChannelMapper wxCouponChannelMapper; | |||
| @Override | |||
| public Map<String, Object> queryRunningMobile(String tenantId) { | |||
| //出租与未出租*********************************************** | |||
| private Map<String, Object> shopRunning(String tenantId){ | |||
| WxShop wxShop = new WxShop(); | |||
| wxShop.setTenantId(tenantId); | |||
| wxShop.setStatus(EnumShopStatus.RENT.getCode()); | |||
| @@ -66,9 +68,6 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode()); | |||
| List<WxShop> unrentedList = wxShopMapper.findList(wxShop); | |||
| HashMap<String, Object> dataMap = new HashMap<>(); | |||
| //出租与未出租*********************************************** | |||
| HashMap<String, Object> shopMap = new HashMap<>(); | |||
| int rentedCount = rentedList.size(); | |||
| int unrentedCount = unrentedList.size(); | |||
| @@ -86,10 +85,12 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| shopMap.put("rentedPercent", rentedPercent + "%"); | |||
| shopMap.put("unrentedPercent", unrentedPercent + "%"); | |||
| } | |||
| return shopMap; | |||
| } | |||
| dataMap.put("shop",shopMap); | |||
| //租金*********************************************** | |||
| private Map<String, Object> rentRunning(String tenantId) { | |||
| //租金*********************************************** | |||
| HashMap<String, Object> rentMap = new HashMap<>(); | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", tenantId); | |||
| @@ -117,10 +118,12 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| rentMap.put("arrearsAmount", 0); | |||
| rentMap.put("receivedPercent", "--"); | |||
| } | |||
| return rentMap; | |||
| } | |||
| dataMap.put("rent",rentMap); | |||
| //上报解单*********************************************** | |||
| private Map<String, Object> reportRunning(String tenantId) { | |||
| //上报*********************************************** | |||
| HashMap<String, Object> reportMap = new HashMap<>(); | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(tenantId); | |||
| @@ -145,11 +148,12 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| int reportTotal = tradeList.stream().mapToInt(WxMerchantTradeDaily::getTradeAmt).sum(); | |||
| reportMap.put("reportTotal", reportTotal); | |||
| dataMap.put("report",reportMap); | |||
| return reportMap; | |||
| } | |||
| //今日车流量*********************************************** | |||
| //今日车流量*********************************************** | |||
| private Map<String, Object> carRunning(String tenantId) { | |||
| HashMap<String, Object> carMap = new HashMap<>(); | |||
| HashMap<Object, Object> paramsCar = new HashMap<>(); | |||
| paramsCar.put("tenantId", tenantId); | |||
| @@ -203,10 +207,12 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| carMap.put("increasedPercentWeek", "--"); | |||
| } | |||
| dataMap.put("car",carMap); | |||
| return carMap; | |||
| } | |||
| //今日券数据*********************************************** | |||
| private Map<String, Object> couponRunning(String tenantId) { | |||
| //今日券数据*********************************************** | |||
| HashMap<String, Object> couponMap = new HashMap<>(); | |||
| Calendar cal = Calendar.getInstance(); | |||
| cal.setTime(new Date()); | |||
| @@ -228,21 +234,37 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| long couponCount = wxCouponChannelMapper.countCoupon(wxCouponChannel); | |||
| couponMap.put("couponCount", couponCount); | |||
| dataMap.put("coupon",couponMap); | |||
| return couponMap; | |||
| } | |||
| //客流*********************************************** | |||
| //今日客流*********************************************** | |||
| private Map<String, Object> visitorRunning(String tenantId) { | |||
| HashMap<String, Object> visitorMap = new HashMap<>(); | |||
| visitorMap.put("todayCount", 8888); | |||
| visitorMap.put("increasedPercent", "5%"); | |||
| visitorMap.put("increasedPercentWeek", "5%"); | |||
| dataMap.put("visitor",visitorMap); | |||
| return visitorMap; | |||
| } | |||
| //移动端首页 | |||
| @Override | |||
| public Map<String, Object> queryRunningMobile(String tenantId) { | |||
| HashMap<String, Object> dataMap = new HashMap<>(); | |||
| dataMap.put("shop",shopRunning(tenantId)); | |||
| dataMap.put("rent",rentRunning(tenantId)); | |||
| dataMap.put("report",reportRunning(tenantId)); | |||
| dataMap.put("car",carRunning(tenantId)); | |||
| dataMap.put("coupon",couponRunning(tenantId)); | |||
| dataMap.put("visitor",visitorRunning(tenantId)); | |||
| return dataMap; | |||
| } | |||
| @Override | |||
| public Map<String, Object> queryRunning(String tenantId) { | |||
| WxShop wxShop = new WxShop(); | |||