| @@ -12,6 +12,7 @@ import java.util.Map; | |||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.domain.po.WxCouponOrder; | import com.iformall.domain.po.WxCouponOrder; | ||||
| import com.iformall.utils.DataUtil; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -117,6 +118,12 @@ public class WxCUserDataController extends BaseController { | |||||
| map.put("monthVos", monthVos);//月用户增加数列表 | map.put("monthVos", monthVos);//月用户增加数列表 | ||||
| map.put("dayPercentage", dayPercentage);//日环比 | map.put("dayPercentage", dayPercentage);//日环比 | ||||
| map.put("weekPercentage", weekPercentage); //周同比 | map.put("weekPercentage", weekPercentage); //周同比 | ||||
| long weekVosCount = 0l; | |||||
| for (UserStructureVo us:weekVos) { | |||||
| weekVosCount += us.getCount(); | |||||
| } | |||||
| map.put("weekVosCount", weekVosCount); //周新增会员 | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } | } | ||||
| @@ -145,6 +152,12 @@ public class WxCUserDataController extends BaseController { | |||||
| List<UserStructureVo> weekVos = new ArrayList<>();//每周uv | List<UserStructureVo> weekVos = new ArrayList<>();//每周uv | ||||
| List<UserStructureVo> monthVos = new ArrayList<>();//每月uv | List<UserStructureVo> monthVos = new ArrayList<>();//每月uv | ||||
| //今日活跃数 | |||||
| String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |||||
| params.put("startTime",today+" 00:00:00"); | |||||
| params.put("endTime",today+" 23:59:59"); | |||||
| long todayVisitCount = wxUserVisitService.queryVisitUv(params); | |||||
| long yesterdayCount = 0;//昨天活跃数 | long yesterdayCount = 0;//昨天活跃数 | ||||
| long beforeYesterdayCount = 0;//前天活跃数 | long beforeYesterdayCount = 0;//前天活跃数 | ||||
| long thisMonthCount = 0;//月总数 | long thisMonthCount = 0;//月总数 | ||||
| @@ -207,6 +220,13 @@ public class WxCUserDataController extends BaseController { | |||||
| mapVo.put("monthVos", monthVos);//月活跃数列表 | mapVo.put("monthVos", monthVos);//月活跃数列表 | ||||
| mapVo.put("dayPercentage", dayPercentage);//日环比 | mapVo.put("dayPercentage", dayPercentage);//日环比 | ||||
| mapVo.put("weekPercentage", weekPercentage); //周同比 | mapVo.put("weekPercentage", weekPercentage); //周同比 | ||||
| mapVo.put("todayVisitCount", todayVisitCount); //今日活跃数 | |||||
| long weekVosCount = 0l; | |||||
| for (UserStructureVo us:weekVos) { | |||||
| weekVosCount += us.getCount(); | |||||
| } | |||||
| mapVo.put("weekVosCount", weekVosCount);//周活跃数总数 | |||||
| return new ResultData(mapVo); | return new ResultData(mapVo); | ||||
| } | } | ||||
| @@ -60,7 +60,6 @@ public enum EnumChart { | |||||
| INDEX_BILL_RECE_RATE(50, "费用收缴数据"), | INDEX_BILL_RECE_RATE(50, "费用收缴数据"), | ||||
| INDEX_COUPON_SCENE(51, "场景发券"), | INDEX_COUPON_SCENE(51, "场景发券"), | ||||
| INDEX_SALE_DATA(52, "营销数据"), | INDEX_SALE_DATA(52, "营销数据"), | ||||
| INDEX_DATA(53, "首页数据"), | |||||
| ; | ; | ||||
| public static EnumChart getEnum(Integer code) { | public static EnumChart getEnum(Integer code) { | ||||
| @@ -16,4 +16,5 @@ public interface WxUserVisitMapper extends CommonMapper<WxUserVisit, Long> { | |||||
| List<TouchUsersReportVo> touchUsersReportData(HashMap<String,Object> params); | List<TouchUsersReportVo> touchUsersReportData(HashMap<String,Object> params); | ||||
| Long queryVisitUv(HashMap<String,Object> params); | |||||
| } | } | ||||
| @@ -1,6 +1,5 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -50,8 +50,8 @@ public interface WxUserVisitService { | |||||
| List<TouchUsersReportVo> touchUsersReportList(HashMap<String,Object> params); | List<TouchUsersReportVo> touchUsersReportList(HashMap<String,Object> params); | ||||
| Long queryVisitUv(HashMap<String,Object> params); | |||||
| } | } | ||||
| @@ -384,7 +384,6 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| dataMap.put("contract", contractRunning(tenantId)); | dataMap.put("contract", contractRunning(tenantId)); | ||||
| dataMap.put("message", messageRunning(tenantId)); | dataMap.put("message", messageRunning(tenantId)); | ||||
| dataMap.put("bill", billRunning(tenantId)); | dataMap.put("bill", billRunning(tenantId)); | ||||
| return dataMap; | return dataMap; | ||||
| } | } | ||||
| @@ -303,10 +303,6 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| return getSaleDataHistory(tenantId, startdate, enddate); | return getSaleDataHistory(tenantId, startdate, enddate); | ||||
| } | } | ||||
| //首页营销数据 | |||||
| if (chart.equals(EnumChart.INDEX_DATA.getCode())) { | |||||
| return getIndexData(tenantId, startdate, enddate); | |||||
| } | |||||
| return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN); | return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN); | ||||
| @@ -2482,47 +2478,4 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| return new ResultData(datamap); | return new ResultData(datamap); | ||||
| } | } | ||||
| /** | |||||
| * 首页数据 | |||||
| * @param tenantId | |||||
| * @return | |||||
| */ | |||||
| private ResultData getIndexData(String tenantId, String startdate,String enddate) { | |||||
| Date startDate = DateUtils.getDateFromString(startdate,"yyyy-MM-dd HH:mm:ss").getTime(); | |||||
| Date endDate = DateUtils.getDateFromString(enddate,"yyyy-MM-dd HH:mm:ss").getTime(); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | |||||
| datamap.put("todayNewUserCount",0); | |||||
| datamap.put("weekNewUserCount",0); | |||||
| datamap.put("todayActiveUserCount",0); | |||||
| datamap.put("weekActiveUserCount",0); | |||||
| datamap.put("userTotalCount",0); | |||||
| datamap.put("growUserCount",0); | |||||
| datamap.put("importUserCount",0); | |||||
| datamap.put("rentRate","10%"); | |||||
| datamap.put("rentCount",0); | |||||
| datamap.put("notRentCount",0); | |||||
| datamap.put("notSignContract",0); | |||||
| datamap.put("signContract",0); | |||||
| datamap.put("onlineActivity",0); | |||||
| datamap.put("todayReceive",0); | |||||
| datamap.put("todayUserCount",0); | |||||
| datamap.put("growRate","10%"); | |||||
| datamap.put("todayCarCount",0); | |||||
| datamap.put("downRate","10%"); | |||||
| datamap.put("carParkStatus","正常"); | |||||
| datamap.put("msgLeave",0); | |||||
| datamap.put("msgHasUse",123); | |||||
| return new ResultData(datamap); | |||||
| } | |||||
| } | } | ||||
| @@ -57,12 +57,10 @@ public class WxUserVisitServiceImpl implements WxUserVisitService { | |||||
| public List<TouchUsersReportVo> touchUsersReportList(HashMap<String, Object> params) { | public List<TouchUsersReportVo> touchUsersReportList(HashMap<String, Object> params) { | ||||
| return wxUserVisitMapper.touchUsersReportList(params); | return wxUserVisitMapper.touchUsersReportList(params); | ||||
| } | } | ||||
| @Override | |||||
| public Long queryVisitUv(HashMap<String, Object> params) { | |||||
| return wxUserVisitMapper.queryVisitUv(params); | |||||
| } | |||||
| } | } | ||||
| @@ -126,5 +126,15 @@ | |||||
| </if> | </if> | ||||
| order by day_date desc | order by day_date desc | ||||
| </select> | </select> | ||||
| <select id="queryVisitUv" resultType="Long" parameterType="hashmap"> | |||||
| select count(visit_uv) from wx_user_visit where tenant_id=#{tenantId} | |||||
| <if test="startTime != null"> | |||||
| and day_date >= #{startTime} | |||||
| </if> | |||||
| <if test="endTime != null"> | |||||
| and day_date <= #{endTime} | |||||
| </if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||