提交 2fe6ad94 authored 作者: 吴德鹏's avatar 吴德鹏

首页统计

上级 eae44a16
......@@ -319,6 +319,7 @@ public class TbCfOrderController extends AbstractController {
amount = amount.setScale(2, BigDecimal.ROUND_UP);
return R.ok().put("amount", amount);
}
@GetMapping("/getOrderSumAmount")
@ResponseBody
public R getOrderSumAmount() {
......@@ -326,6 +327,13 @@ public class TbCfOrderController extends AbstractController {
amount = amount.setScale(2, BigDecimal.ROUND_UP);
return R.ok().put("amount", amount);
}
@GetMapping("/getDayOrderNum")
@ResponseBody
public R getDayOrderNum() {
int dayOrderNum = tbCfOrderService.getDayOrderNum();
return R.ok().put("dayOrderNum", dayOrderNum);
}
//==========================================================================================================
/**
......
......@@ -128,7 +128,7 @@ public class TbCfSearchController {
*/
@RequestMapping("/getTopSearch")
@ResponseBody
public R getTopSearch() {
public R getTopSearch(@RequestParam Map<String, Object> params) {
TopSearch topSearch = tbCfSearchService.getTopSearch();
......
......@@ -96,4 +96,6 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
BigDecimal getOrderSumAmount();
int getDayOrderNum();
}
......@@ -17,4 +17,6 @@ public interface TbCfSearchDao extends BaseDao<TbCfSearchEntity> {
List<SearchKeywords> getSearchKeywords();
TopSearch getTopSearch();
int getTotal();
}
......@@ -115,4 +115,6 @@ public interface TbCfOrderService {
BigDecimal getAverageSales();
BigDecimal getOrderSumAmount();
int getDayOrderNum();
}
......@@ -118,7 +118,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
Set<Integer> statusList = new HashSet<>();
if (orderItemList != null && orderItemList.size() > 0) {
for (TbCfItemDetailEntity itemList : orderItemList) {
if (itemList!=null){
if (itemList != null) {
TbCfItemOrderREntity tbCfItemOrder = tbCfItemOrderRDao.getOrderItemId(tbCfPlatformOrder.getOrderId(), itemList.getItemId());
Integer orderStatus = tbCfItemOrder.getOrderStatus();
statusList.add(orderStatus);
......@@ -196,4 +196,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
return tbCfOrderDao.getOrderSumAmount();
}
@Override
public int getDayOrderNum() {
return tbCfOrderDao.getDayOrderNum();
}
}
......@@ -8,7 +8,7 @@ package com.platform.vo;
public class TopSearch {
private Long total;
private Long average;
private Double average;
public Long getTotal() {
return total;
......@@ -18,11 +18,11 @@ public class TopSearch {
this.total = total;
}
public Long getAverage() {
public Double getAverage() {
return average;
}
public void setAverage(Long average) {
public void setAverage(Double average) {
this.average = average;
}
}
......@@ -243,7 +243,12 @@
left join tb_cf_item_detail d on d.item_id=i.item_id
WHERE 1=1 and i.enable_flag=1 and o.enable_flag=1
</select>
<select id="getDayOrderNum" resultType="int">
SELECT
count(DISTINCT user_id)
FROM
tb_cf_order where DATE_FORMAT(order_time,'%Y-%m-%d')=CURDATE()
</select>
<insert id="save" parameterType="com.platform.entity.TbCfOrderEntity">
insert into tb_cf_order(
......
......@@ -9,7 +9,7 @@
<result property="userId" column="user_id"/>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfSearchEntity">
<select id="queryObject" resultType="com.platform.entity.TbCfSearchEntity">
select
`id`,
`search_keywords`,
......@@ -17,55 +17,61 @@
from tb_cf_search
where id = #{id}
</select>
<select id="getSearchKeywords" resultType="com.platform.vo.SearchKeywords">
SELECT
search_keywords,
count( DISTINCT user_id ) count
FROM
tb_cf_search
GROUP BY
search_keywords
ORDER BY
count DESC
</select>
<select id="queryList" resultType="com.platform.entity.TbCfSearchEntity">
select
`id`,
`search_keywords`,
`user_id`
from tb_cf_search
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<select id="getSearchKeywords" resultType="com.platform.vo.SearchKeywords">
SELECT
search_keywords,
count( DISTINCT user_id ) count
FROM
tb_cf_search
GROUP BY
search_keywords
ORDER BY
count DESC
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryList" resultType="com.platform.entity.TbCfSearchEntity">
select
`id`,
`search_keywords`,
`user_id`
from tb_cf_search
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
<otherwise>
order by id desc
</otherwise>
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="getTopSearch" resultType="com.platform.vo.TopSearch">
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="getTopSearch" resultType="com.platform.vo.TopSearch">
SELECT
count( DISTINCT user_id ) total,
count( 1 ) / count( DISTINCT user_id ) average
FROM
tb_cf_search
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_search
WHERE 1=1
<select id="getTotal" resultType="int">
select count(DISTINCT search_keywords) from tb_cf_search
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_search
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.platform.entity.TbCfSearchEntity">
</select>
<insert id="save" parameterType="com.platform.entity.TbCfSearchEntity">
insert into tb_cf_search(
`id`,
`search_keywords`,
......@@ -75,25 +81,25 @@
#{searchKeywords},
#{userId})
</insert>
<update id="update" parameterType="com.platform.entity.TbCfSearchEntity">
update tb_cf_search
<set>
<if test="searchKeywords != null">`search_keywords` = #{searchKeywords}, </if>
<if test="userId != null">`user_id` = #{userId}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
<update id="update" parameterType="com.platform.entity.TbCfSearchEntity">
update tb_cf_search
<set>
<if test="searchKeywords != null">`search_keywords` = #{searchKeywords},</if>
<if test="userId != null">`user_id` = #{userId}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete from tb_cf_search where id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_search where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteBatch">
delete from tb_cf_search where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -2,13 +2,13 @@
#jdbc.username=root
#jdbc.password=root
jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
jdbc.username=root
jdbc.password=diaoyun666
#jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
#jdbc.username=root
#jdbc.password=diaoyun666
#jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
#jdbc.username: root
#jdbc.password: Diaoyunnuli.8
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root
jdbc.password: Diaoyunnuli.8
jdbc.initialSize=5
jdbc.maxActive=30
......
......@@ -2,13 +2,13 @@
#jdbc.username=root
#jdbc.password=root
jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
jdbc.username=root
jdbc.password=diaoyun666
#jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
#jdbc.username=root
#jdbc.password=diaoyun666
#jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
#jdbc.username: root
#jdbc.password: Diaoyunnuli.8
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root
jdbc.password: Diaoyunnuli.8
jdbc.initialSize=5
jdbc.maxActive=30
......
......@@ -584,7 +584,7 @@
<h4 class="m-card-title" ref='userSearchSum'>搜索用户数</h4>
<p>
<span>
8846
{{total}}
</span>
<span>
17.1%
......@@ -596,7 +596,7 @@
<h4 class="m-card-title" ref='userSearchPerCapita'>人均搜索次数</h4>
<p>
<span>
8846
{{average}}
</span>
<span>
17.1%
......
......@@ -2,6 +2,8 @@ let app = new Vue({
el: '#app',
data() {
return {
total: 0,
average: 0,
category2: null,
category3: null,
amount: 0,
......@@ -673,14 +675,20 @@ let app = new Vue({
this.$refs.middleEachrtsTitle.innerText = element.title + '趋势';
// this.initEchartsMiddleData[0].data.push(['2019-10-1'+Math.round(Math.random()*100), Math.round(Math.random()*1000)])
if (index === 0) {
this.initEchartsMiddleData[0].name = '注册量'
let url = '../tbcfuserinfo/getDailyRegistered';
this.templateMethod(url);
} else if (index === 1) {
this.initEchartsMiddleData[0].name = '访问量'
this.initEchartsMiddleData[0].data = []
} else if (index === 2) {
this.initEchartsMiddleData[0].name = '订单笔数'
console.log(123345455, this.initEchartsMiddleData[0].name)
let url = '../tbcforder/getOrderByDate';
this.templateMethod1(url);
} else if (index === 3) {
this.initEchartsMiddleData[0].name = '成交量'
console.log(123345455, this.initEchartsMiddleData[0].name)
let url = '../tbcforder/getOrderPaidByDate';
this.templateMethod1(url);
}
......@@ -693,9 +701,11 @@ let app = new Vue({
if (element.title === '热门搜索') {
this.$refs.userSearchSum.innerText = '搜索用户数'
this.$refs.userSearchPerCapita.innerText = '人均搜索次数'
this.getTopSearch();
} else {
this.$refs.userSearchSum.innerText = '下单用户数'
this.$refs.userSearchPerCapita.innerText = '人均流量次数'
this.getDayOrderNum();
}
},
/* 中间模块日期 */
......@@ -749,6 +759,11 @@ let app = new Vue({
})
})
},
getDayOrderNum() {
$.get('../tbcforder/getDayOrderNum', res => {
this.total = res.dayOrderNum;
})
},
getSearchKeywords() {
$.get('../tbcfsearch/getSearchKeywords', res => {
let list = JSON.parse(res).list;
......@@ -767,6 +782,12 @@ let app = new Vue({
this.amount = res.amount;
})
},
getTopSearch() {
$.get('../tbcfsearch/getTopSearch', res => {
this.total = JSON.parse(res).topSearch.total;
this.average = JSON.parse(res).topSearch.average;
})
},
getCategory() {
$.get('../tbcfgoodstype/queryAll', res => {
this.categoryList = res.list;
......@@ -789,6 +810,7 @@ let app = new Vue({
this.getOrderPaidNum();
this.getOrderRate();
this.getAverageSales();
this.getTopSearch();
$.get('../tbcfuserinfo/getDayRegistered', res => {
let objList = JSON.parse(res).list
this.newNum = objList[0].num;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论