parent
a9110ac39f
commit
dc99a4399a
@ -0,0 +1,21 @@
|
|||||||
|
package au.com.royalpay.payment.manage.mappers.payment;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
|
||||||
|
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
|
||||||
|
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by todking on 2019-06-15.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@AutoMapper(tablename = "paysuccess_count", pkName = "id")
|
||||||
|
public interface PaySuccessCountMapper {
|
||||||
|
|
||||||
|
@AutoSql(type = SqlType.SELECT)
|
||||||
|
List<JSONObject> findCount(@Param("in_time") String time);
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package au.com.royalpay.payment.manage.posters.beans;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* created by todking at 2019-6-15
|
||||||
|
*/
|
||||||
|
public class paySuccessCountBean {
|
||||||
|
|
||||||
|
@JSONField(name = "in_time")
|
||||||
|
private String inTime;
|
||||||
|
|
||||||
|
@JSONField(name = "count")
|
||||||
|
private int count;
|
||||||
|
|
||||||
|
public String getInTime() {
|
||||||
|
return inTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInTime(String inTime) {
|
||||||
|
this.inTime = inTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCount() {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCount(int count) {
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONObject toJson() {
|
||||||
|
JSONObject jsons = new JSONObject();
|
||||||
|
|
||||||
|
jsons.put("inTime", inTime);
|
||||||
|
|
||||||
|
jsons.put("count", count);
|
||||||
|
|
||||||
|
return jsons;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package au.com.royalpay.payment.manage.posters.core;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create by todking at 2019-6-3
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface PaySuccessCountService {
|
||||||
|
|
||||||
|
//查询支付成功页面次数
|
||||||
|
JSONObject selectCount(String time);
|
||||||
|
}
|
@ -1,9 +1,14 @@
|
|||||||
package au.com.royalpay.payment.manage.posters.core;
|
package au.com.royalpay.payment.manage.posters.core;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create by todking at 2019-6-3
|
* create by todking at 2019-6-3
|
||||||
*/
|
*/
|
||||||
public interface PosterService {
|
public interface PosterService {
|
||||||
void updatePoster(String imgUrl);
|
void updatePoster(String imgUrl);
|
||||||
|
|
||||||
|
JSONObject getPoster();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
package au.com.royalpay.payment.manage.posters.core.impls;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.mappers.payment.PaySuccessCountMapper;
|
||||||
|
import au.com.royalpay.payment.manage.posters.core.PaySuccessCountService;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* created by todking at 2019-6-15
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PaySuccessCountServiceImpl implements PaySuccessCountService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PaySuccessCountMapper paySuccessCountMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject selectCount(String time) {
|
||||||
|
String gmt = time.replace("GMT", "").replaceAll("\\(.*\\)", "");
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy hh:mm:ss z", Locale.ENGLISH);
|
||||||
|
Date dateTrans = null;
|
||||||
|
try {
|
||||||
|
dateTrans = format.parse(gmt);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
String s = new SimpleDateFormat("yyyy-MM-dd").format(dateTrans);
|
||||||
|
List<JSONObject> object = paySuccessCountMapper.findCount(s);
|
||||||
|
if(object.size() != 0){
|
||||||
|
return object.get(0);
|
||||||
|
}else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package au.com.royalpay.payment.manage.posters.web;
|
||||||
|
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.posters.core.PaySuccessCountService;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.text.ParseException;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* created by todking at 2019-6-15
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/statistics/click")
|
||||||
|
public class paySuccessCountController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PaySuccessCountService paySuccessCountService;
|
||||||
|
|
||||||
|
@RequestMapping(value = "/paySuccess_count/{time}",method = RequestMethod.GET)
|
||||||
|
public Long selectCount(@PathVariable String time) throws ParseException {
|
||||||
|
JSONObject jsonObject = paySuccessCountService.selectCount(time);
|
||||||
|
if(jsonObject == null){
|
||||||
|
return 0L;
|
||||||
|
}else {
|
||||||
|
Long count = (Long) jsonObject.get("count");
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
<div ui-view xmlns:th="http://www.w3.org/1999/xhtml">
|
||||||
|
<section class="content-header">
|
||||||
|
<h1>广告点击统计</h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-sitemap"></i> Content Management
|
||||||
|
</li>
|
||||||
|
<li class="active">广告点击统计</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
<section class="content">
|
||||||
|
<div class="box box-default">
|
||||||
|
<p style="margin-left: 20px;margin-top: 20px;">支付成功页面开启次数统计</p>
|
||||||
|
<div class="box-body" style="display: flex;justify-content: flex-start;align-items: center">
|
||||||
|
<div class="form-group col-xs-12" style="display: flex;align-items: center">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2" style="display: flex;justify-content: center">Date
|
||||||
|
Range</label>
|
||||||
|
<div class="col-sm-10 col-xs-8">
|
||||||
|
<div class="form-control-static form-inline">
|
||||||
|
<div style="display: inline-block">
|
||||||
|
<input class="form-control" id="date-from-input" ng-model="params.datefrom"
|
||||||
|
uib-datepicker-popup size="10" placeholder="From"
|
||||||
|
is-open="dateBegin.open" ng-click="dateBegin.open=true"
|
||||||
|
datepicker-options="{maxDate:params.dateto||today}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--<div class="btn-group">-->
|
||||||
|
<!--<a role="button" class="btn btn-default btn-sm"-->
|
||||||
|
<!--ng-click="chooseToday()">Today</a>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--<div class="btn-group">-->
|
||||||
|
<!--<a role="button" class="btn btn-default btn-sm"-->
|
||||||
|
<!--ng-click="chooseYesterday()">Yesterday</a>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--<div class="btn-group">-->
|
||||||
|
<!--<a role="button" class="btn btn-default btn-sm"-->
|
||||||
|
<!--ng-click="chooseLast7Days()">Last 7 Days</a>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--<div class="btn-group">-->
|
||||||
|
<!--<a role="button" class="btn btn-default btn-sm" ng-click="thisMonth()">This Month</a>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--<div class="btn-group">-->
|
||||||
|
<!--<a role="button" class="btn btn-default btn-sm" ng-click="lastMonth()">Last Month</a>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<button class="btn btn-success" type="button" ng-click="loadTradeLogs(1)">
|
||||||
|
<i class="fa fa-search"></i> Search
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-success" type="button" ng-click="viewAdvertisements()">
|
||||||
|
<i class="fa fa-search"></i> 查看广告点击次数
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p style="padding: 20px" title="未搜索具体日期,其显示次数为当前日期的前一天">支付成功页面开启次数:{{count}}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<view ng-if="posters != null">
|
||||||
|
<!--<div ng-repeat="poster in posters">-->
|
||||||
|
<!--<p style="text-align: center;">-->
|
||||||
|
<!--<img src="" width="100%"/>-->
|
||||||
|
<!--<p>点击次数:{{posters.count}}</p>-->
|
||||||
|
<!--</p>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<div class="box box-default">
|
||||||
|
<div class="box-body table-responsive">
|
||||||
|
<table class="table table-bordered table-hover table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Count</th>
|
||||||
|
<th>Picture Address</th>
|
||||||
|
<th>Picture Name</th>
|
||||||
|
<th>Link</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="poster in posters">
|
||||||
|
<td ng-bind="poster.count"></td>
|
||||||
|
<td ng-bind="poster.img_url"></td>
|
||||||
|
<td ng-bind="poster.img_alt"></td>
|
||||||
|
<td ng-bind="poster.link_url"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</section>
|
||||||
|
</div>
|
Loading…
Reference in new issue