| @@ -0,0 +1,56 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.service.WxChartDataService; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RequestParam; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import java.util.Map; | |||
| @Api(description = "图表") | |||
| @RestController | |||
| @RequestMapping("chart") | |||
| public class WxChartDataController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxChartDataService wxChartDataService; | |||
| @ApiOperation("queryData") | |||
| @GetMapping("/queryData") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "chart", value = "chart", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "querytime", value = "querytime", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData queryData(@RequestParam Map<String, String> params) { | |||
| logger.debug("[" + getIpAddr() + "] WxChartDataController::queryData"); | |||
| Integer chart = Integer.valueOf(params.get("chart")); | |||
| String querytime = params.get("querytime"); | |||
| String startdate = DateUtils.getSystemTime("yyyy-MM-dd"); | |||
| String enddate = startdate; | |||
| if (!StringUtils.isEmpty(querytime)) { | |||
| String[] split = querytime.split(","); | |||
| if (split.length == 2) { | |||
| startdate = split[0]; | |||
| enddate = split[1]; | |||
| } else { | |||
| startdate = split[0]; | |||
| enddate = split[0]; | |||
| } | |||
| } | |||
| return wxChartDataService.queryData(getTenantId(), chart, startdate, enddate); | |||
| } | |||
| } | |||
| @@ -0,0 +1,77 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumChart { | |||
| CZL(1, "出租率"), | |||
| ZJSJL(2, "租金收缴率"), | |||
| ZRBDL(3, "昨日报单率"), | |||
| CLSJ(4, "车流数据"), | |||
| QJYSJ(5, "券交易数据"), | |||
| HYYHSJ(6, "活跃用户数据"), | |||
| XSSJ(7, "销售数据"), | |||
| JDSJ(8, "解单数据"), | |||
| JRCNCLL(9, "今日场内车流量"), | |||
| JRYBCPL(10, "今日已绑车牌量"), | |||
| SSCLL(11, "实时车流量"), | |||
| LSCLL(12, "历史车流量"), | |||
| JYZXXZTCHY(13, "近一周新增停车会员"), | |||
| JYZXSJFCL(14, "近一周线上缴费车辆"), | |||
| JYZXSJFJE(15, "近一周线上缴费金额"), | |||
| JYZXZHYS(16, "近一周新增会员数"), | |||
| ZRCDYH(17, "昨日触达用户"), | |||
| JRQJYSJ(18, "今日券交易数据"), | |||
| JRCJYX(19, "今日场景营销"), | |||
| CDYHS(20, "触达用户数"), | |||
| CJYXSJ(21, "场景营销数据"), | |||
| XZYH(22, "新增用户"), | |||
| HYYH(23, "活跃用户"), | |||
| XSJY(24, "线上交易"), | |||
| JYZXZYHS(25, "近一周新增用户数"), | |||
| JYZHYYHS(26, "近一周活跃用户数"), | |||
| JYZXSJYJE(27, "近一周线上交易金额"), | |||
| XZYHQS(28, "新增用户趋势"), | |||
| HYYHQS(29, "活跃用户趋势"), | |||
| XSJYQS(30, "线上交易趋势"), | |||
| WXYHZS(31, "微信用户总数"), | |||
| HYZS(32, "会员总数"), | |||
| WXYHLJQS(33, "微信用户累计趋势"), | |||
| HYLJQS(34, "会员累计趋势"), | |||
| WXYHXZQS(35, "微信用户新增趋势"), | |||
| HYXZQS(36, "会员新增趋势"), | |||
| TKQD(37, "拓客渠道"), | |||
| CJPM(38, "场景排名"), | |||
| HYXBBL(39, "会员性别比例"), | |||
| HYBDCPL(40, "会员绑定车牌率"), | |||
| HYNLCC(41, "会员年龄层次"), | |||
| HYCZZ(42, "会员成长值"), | |||
| HYSJPP(43, "会员手机品牌"), | |||
| HYHYD(44, "会员活跃度"),; | |||
| public static EnumChart getEnum(Integer code) { | |||
| for (EnumChart value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumChart(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,8 @@ | |||
| package com.iformall.service; | |||
| import com.iformall.common.ResultData; | |||
| public interface WxChartDataService { | |||
| ResultData queryData(String tenantId, Integer chart, String startdate, String enddate); | |||
| } | |||
| @@ -0,0 +1,152 @@ | |||
| package com.iformall.service.impl; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.enums.EnumChart; | |||
| import com.iformall.service.WxChartDataService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.stereotype.Service; | |||
| @Service | |||
| public class WxChartServiceImpl implements WxChartDataService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Override | |||
| public ResultData queryData(String tenantId, Integer chart, String startdate, String enddate) { | |||
| //出租率 | |||
| if (chart.equals(EnumChart.CZL.getCode())) { | |||
| } | |||
| //租金收缴率 | |||
| if (chart.equals(EnumChart.ZJSJL.getCode())) { | |||
| } | |||
| //昨日报单率 | |||
| if (chart.equals(EnumChart.ZRBDL.getCode())) { | |||
| } | |||
| //车流数据 | |||
| if (chart.equals(EnumChart.CLSJ.getCode())) { | |||
| } | |||
| //券交易数据 | |||
| if (chart.equals(EnumChart.QJYSJ.getCode())) { | |||
| } | |||
| //活跃用户数据 | |||
| if (chart.equals(EnumChart.HYYHSJ.getCode())) { | |||
| } | |||
| //销售数据 | |||
| if (chart.equals(EnumChart.XSSJ.getCode())) { | |||
| } | |||
| //解单数据 | |||
| if (chart.equals(EnumChart.JDSJ.getCode())) { | |||
| } | |||
| //今日场内车流量 | |||
| if (chart.equals(EnumChart.JRCNCLL.getCode())) { | |||
| } | |||
| //今日已绑车牌量 | |||
| if (chart.equals(EnumChart.JRYBCPL.getCode())) { | |||
| } | |||
| //实时车流量 | |||
| if (chart.equals(EnumChart.SSCLL.getCode())) { | |||
| } | |||
| //历史车流量 | |||
| if (chart.equals(EnumChart.LSCLL.getCode())) { | |||
| } | |||
| //近一周新增停车会员 | |||
| if (chart.equals(EnumChart.JYZXXZTCHY.getCode())) { | |||
| } | |||
| //近一周线上缴费车辆 | |||
| if (chart.equals(EnumChart.JYZXSJFCL.getCode())) { | |||
| } | |||
| //近一周线上缴费金额 | |||
| if (chart.equals(EnumChart.JYZXSJFJE.getCode())) { | |||
| } | |||
| //近一周新增会员数 | |||
| if (chart.equals(EnumChart.JYZXZHYS.getCode())) { | |||
| } | |||
| //昨日触达用户 | |||
| if (chart.equals(EnumChart.ZRCDYH.getCode())) { | |||
| } | |||
| //今日券交易数据 | |||
| if (chart.equals(EnumChart.JRQJYSJ.getCode())) { | |||
| } | |||
| //今日场景营销 | |||
| if (chart.equals(EnumChart.JRCJYX.getCode())) { | |||
| } | |||
| //触达用户数 | |||
| if (chart.equals(EnumChart.CDYHS.getCode())) { | |||
| } | |||
| //场景营销数据 | |||
| if (chart.equals(EnumChart.CJYXSJ.getCode())) { | |||
| } | |||
| //新增用户 | |||
| if (chart.equals(EnumChart.XZYH.getCode())) { | |||
| } | |||
| //活跃用户 | |||
| if (chart.equals(EnumChart.HYYH.getCode())) { | |||
| } | |||
| //线上交易 | |||
| if (chart.equals(EnumChart.XSJY.getCode())) { | |||
| } | |||
| //近一周新增用户数 | |||
| if (chart.equals(EnumChart.JYZXZYHS.getCode())) { | |||
| } | |||
| //近一周活跃用户数 | |||
| if (chart.equals(EnumChart.JYZHYYHS.getCode())) { | |||
| } | |||
| //近一周线上交易金额(元) | |||
| if (chart.equals(EnumChart.JYZXSJYJE.getCode())) { | |||
| } | |||
| //新增用户趋势 | |||
| if (chart.equals(EnumChart.XZYHQS.getCode())) { | |||
| } | |||
| //活跃用户趋势 | |||
| if (chart.equals(EnumChart.HYYHQS.getCode())) { | |||
| } | |||
| //线上交易趋势 | |||
| if (chart.equals(EnumChart.XSJYQS.getCode())) { | |||
| } | |||
| //微信用户总数 | |||
| if (chart.equals(EnumChart.WXYHZS.getCode())) { | |||
| } | |||
| //会员总数 | |||
| if (chart.equals(EnumChart.HYZS.getCode())) { | |||
| } | |||
| //微信用户累计趋势 | |||
| if (chart.equals(EnumChart.WXYHLJQS.getCode())) { | |||
| } | |||
| //会员累计趋势 | |||
| if (chart.equals(EnumChart.HYLJQS.getCode())) { | |||
| } | |||
| //微信用户新增趋势 | |||
| if (chart.equals(EnumChart.WXYHXZQS.getCode())) { | |||
| } | |||
| //会员新增趋势 | |||
| if (chart.equals(EnumChart.HYXZQS.getCode())) { | |||
| } | |||
| //拓客渠道 | |||
| if (chart.equals(EnumChart.TKQD.getCode())) { | |||
| } | |||
| //场景排名 | |||
| if (chart.equals(EnumChart.CJPM.getCode())) { | |||
| } | |||
| //会员性别比例 | |||
| if (chart.equals(EnumChart.HYXBBL.getCode())) { | |||
| } | |||
| //会员绑定车牌率 | |||
| if (chart.equals(EnumChart.HYBDCPL.getCode())) { | |||
| } | |||
| //会员年龄层次 | |||
| if (chart.equals(EnumChart.HYNLCC.getCode())) { | |||
| } | |||
| //会员成长值 | |||
| if (chart.equals(EnumChart.HYCZZ.getCode())) { | |||
| } | |||
| //会员手机品牌 | |||
| if (chart.equals(EnumChart.HYSJPP.getCode())) { | |||
| } | |||
| //会员活跃度 | |||
| if (chart.equals(EnumChart.HYHYD.getCode())) { | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| } | |||