|
|
|
@@ -1,13 +1,14 @@ |
|
|
|
package com.iformall.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.EnumCarCmd; |
|
|
|
import com.iformall.enums.EnumCouponChannelStatus; |
|
|
|
import com.iformall.enums.EnumMerchantStatus; |
|
|
|
import com.iformall.enums.EnumShopStatus; |
|
|
|
import com.iformall.domain.vo.WxBillAll; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.DataTowerService; |
|
|
|
import com.iformall.service.WxRentContractService; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import com.iformall.utils.HashUtil; |
|
|
|
import com.iformall.utils.HttpUtil; |
|
|
|
@@ -57,6 +58,15 @@ public class DataTowerServiceImpl implements DataTowerService { |
|
|
|
@Autowired |
|
|
|
WxCouponChannelMapper wxCouponChannelMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxRentContractMapper wxRentContractMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxBillAllMapper wxBillAllMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMsgConfigMapper wxMsgConfigMapper; |
|
|
|
|
|
|
|
|
|
|
|
//出租与未出租*********************************************** |
|
|
|
private Map<String, Object> shopRunning(String tenantId){ |
|
|
|
@@ -246,6 +256,76 @@ public class DataTowerServiceImpl implements DataTowerService { |
|
|
|
return visitorMap; |
|
|
|
} |
|
|
|
|
|
|
|
//合同*********************************************** |
|
|
|
private Map<String, Object> contractRunning(String tenantId) { |
|
|
|
|
|
|
|
Map<String, Object> contractMap = new HashMap(); |
|
|
|
WxRentContract wxRentContract = new WxRentContract(); |
|
|
|
wxRentContract.setTenantId(tenantId); |
|
|
|
|
|
|
|
//待签约 |
|
|
|
wxRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); |
|
|
|
int waitSignCount = wxRentContractMapper.queryRentContractWaitSignStatus(wxRentContract); |
|
|
|
contractMap.put("waitSignCount", waitSignCount); |
|
|
|
|
|
|
|
//计租中 |
|
|
|
wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode()); |
|
|
|
int rendPaidCount = wxRentContractMapper.queryRentContractPaidStatus(wxRentContract); |
|
|
|
contractMap.put("rendPaidCount", rendPaidCount); |
|
|
|
|
|
|
|
//将到期 |
|
|
|
wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode()); |
|
|
|
int endSoonCount = wxRentContractMapper.queryRentContractEndSoonStatus(wxRentContract); |
|
|
|
contractMap.put("endSoonCount", endSoonCount); |
|
|
|
|
|
|
|
//到期 |
|
|
|
wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END.getCode()); |
|
|
|
int endCount = wxRentContractMapper.queryRentContractEndStatus(wxRentContract); |
|
|
|
contractMap.put("endCount", endCount); |
|
|
|
|
|
|
|
return contractMap; |
|
|
|
} |
|
|
|
|
|
|
|
//短信*********************************************** |
|
|
|
private Map<String, Object> messageRunning(String tenantId) { |
|
|
|
HashMap<String, Object> messageMap = new HashMap<>(); |
|
|
|
|
|
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
|
wxMsgConfig.setTenantId(wxMsgConfig.getTenantId()); |
|
|
|
List<WxMsgConfig> wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig); |
|
|
|
|
|
|
|
long usedCount = 0; |
|
|
|
long remainsCount = 0; |
|
|
|
long totalCount = 0; |
|
|
|
if (wxMsgConfigs.size() > 0) { |
|
|
|
wxMsgConfig = wxMsgConfigs.get(0); |
|
|
|
totalCount = wxMsgConfig.getTotal(); |
|
|
|
remainsCount = wxMsgConfig.getRemains(); |
|
|
|
usedCount = totalCount - remainsCount; |
|
|
|
} |
|
|
|
|
|
|
|
messageMap.put("usedCount",usedCount); |
|
|
|
messageMap.put("totalCount",totalCount); |
|
|
|
messageMap.put("remainsCount",remainsCount); |
|
|
|
|
|
|
|
return messageMap; |
|
|
|
} |
|
|
|
|
|
|
|
//账单*********************************************** |
|
|
|
private Map<String, Object> billRunning(String tenantId) { |
|
|
|
HashMap<String, Object> billMap = new HashMap<>(); |
|
|
|
WxBillAll record = new WxBillAll(); |
|
|
|
record.setTenantId(tenantId); |
|
|
|
record.setMonth(DateUtils.getSystemTime("yyyy-MM")); |
|
|
|
record.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); |
|
|
|
Map<String, Object> oweInfo = wxBillAllMapper.queryOweInfo(record); |
|
|
|
record.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
Map<String, Object> paidInfo = wxBillAllMapper.queryPaidInfo(record); |
|
|
|
|
|
|
|
billMap.putAll(oweInfo); |
|
|
|
billMap.putAll(paidInfo); |
|
|
|
return billMap; |
|
|
|
} |
|
|
|
|
|
|
|
//移动端首页 |
|
|
|
@Override |
|
|
|
@@ -262,7 +342,23 @@ public class DataTowerServiceImpl implements DataTowerService { |
|
|
|
return dataMap; |
|
|
|
} |
|
|
|
|
|
|
|
//登陆页数据快速概览 |
|
|
|
@Override |
|
|
|
public Map<String, Object> queryRunningPotal(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)); |
|
|
|
dataMap.put("contract",contractRunning(tenantId)); |
|
|
|
dataMap.put("message",messageRunning(tenantId)); |
|
|
|
dataMap.put("bill",billRunning(tenantId)); |
|
|
|
|
|
|
|
return dataMap; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|