This commit is contained in:
cun-nan 2024-07-29 16:13:24 +08:00
parent dc3716765f
commit eb9abc6777
6 changed files with 166 additions and 30 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -42,7 +42,7 @@
<div class="right-box">
<div class="title_">
<div>通知中心</div>
<div style="font-size: 12px;color: #BBBBBB;display: flex;align-items: center">更多 <i class="el-icon-arrow-right"></i> </div>
<div style="font-size: 12px;color: #BBBBBB;display: flex;align-items: center" @click="goRoute">更多 <i class="el-icon-arrow-right"></i> </div>
</div>
<!-- <div class="hang_" v-for="(item,index) in 4" :key="index" >到期提醒百业兴智慧油站系统将于2024年07月10日到期...</div>-->
<div class="hang_" v-for="(item,index) in noticeList" :key="index" >{{ item.notificationType }}{{ item.templateContent }}</div>
@ -124,7 +124,22 @@
</div>
</div>
<div class="right-box-t">
<div class="h-tt" >硬件设备</div>
<!-- <div class="h-tt" >硬件设备</div>-->
<div class="title_">
<div>硬件设备</div>
<div style="font-size: 12px;color: #BBBBBB;display: flex;align-items: center">
<el-popover
placement="bottom"
width="200"
trigger="click">
<div>
联系人张总<br>
联系电话15666665287
</div>
<el-button slot="reference" style="border: 0px" type="text"><img src="@/assets/images/phone.png"></el-button>
</el-popover>
</div>
</div>
<div class="d-s" style="margin: 30px 0px" v-for="(item,index) in hardwareList" :key="index" >
<!-- <div class="r-img">-->
<!-- <img src="../../assets/images/pcin.png" style="width: 84px;height: 70px">-->
@ -241,6 +256,9 @@ export default {
// this.initChart()
},
methods:{
goRoute(){
this.$router.push("system/notify/page/getNotify")
},
getNoticeList(){
getNotificationlogList({pageNo: 1, pageSize: 4,sentTo:this.accountId}).then(res => {
this.noticeList = res.data.records
@ -341,24 +359,25 @@ export default {
let tradeAmountList = []
let tradeNumList = []
if (this.storeList.length>0) {
for (let i = 0; i < 24; i++) {
let flag = false;
let hour = i.toString().padStart(2, '0') + ":00"; //
// for (let i = 0; i < 24; i++) {
// let flag = false;
// let hour = i.toString().padStart(2, '0') + ":00"; //
this.storeList.forEach(item => {
if (item.tradeTime == hour){
flag = true
// if (item.tradeTime == hour){
// flag = true
hourList.push(item.tradeTime);
storeNumList.push(item.storeNum)
tradeAmountList.push(item.tradeAmount)
tradeNumList.push(item.tradeNum)
}
// }
})
hourList.push(hour);
if (!flag) {
storeNumList.push(0)
tradeAmountList.push(0)
tradeNumList.push(0)
}
}
// hourList.push(hour);
// if (!flag) {
// storeNumList.push(0)
// tradeAmountList.push(0)
// tradeNumList.push(0)
// }
// }
}else {
hourList = ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00']
storeNumList = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
@ -399,8 +418,10 @@ export default {
show: false
},
data: [
{ value: 1548, name: '非七日活跃' },
{ value: 775, name: '七日活跃' }
// { value: 1548, name: '' },
// { value: 775, name: '' }
{ value: Number(this.storeAmount.noWeekStoreTotal), name: '本月新增非七日活跃油站' },
{ value: Number(this.storeAmount.weekStoreTotal), name: '本月新增七日活跃油站' }
]
},
{
@ -428,8 +449,10 @@ export default {
}
},
data: [
{ value: 1048, name: '本月新增' },
{ value: 335, name: '非本月新增' }
// { value: 1048, name: '' },
// { value: 335, name: '' }
{ value: Number(this.storeAmount.noAddStoreTotal), name: '非本月新增' },
{ value: Number(this.storeAmount.addStoreTotal), name: '本月新增' },
]
}
]
@ -491,10 +514,10 @@ export default {
},
data: [
{ value: 50, name: '富友交易金额占比 ' },
{ value: 50, name: '拉卡拉交易金额占比' }
// { value: this.countPercentage(Number(this.storeAmount.fuYouAmount),Number(this.storeAmount.fuYouAmount) + Number(this.storeAmount.laKaLaAmount)), name: '' },
// { value: this.countPercentage(Number(this.storeAmount.laKaLaAmount),Number(this.storeAmount.fuYouAmount) + Number(this.storeAmount.laKaLaAmount)), name: '' }
// { value: 50, name: ' ' },
// { value: 50, name: '' }
{ value: this.countPercentage(Number(this.storeAmount.fuYouAmount),Number(this.storeAmount.fuYouAmount) + Number(this.storeAmount.laKaLaAmount)), name: '富友交易金额占比' },
{ value: this.countPercentage(Number(this.storeAmount.laKaLaAmount),Number(this.storeAmount.fuYouAmount) + Number(this.storeAmount.laKaLaAmount)), name: '拉卡拉交易金额占比' }
],
label: {
show: true,
@ -633,10 +656,10 @@ export default {
},
data: [
{ value: 50, name: '富友交易金额占比 ' },
{ value: 50, name: '拉卡拉交易金额占比' }
// { value: this.countPercentage(Number(this.storeAmount.fuYouAmount),Number(this.storeAmount.fuYouAmount) + Number(this.storeAmount.laKaLaAmount)), name: '' },
// { value: this.countPercentage(Number(this.storeAmount.laKaLaAmount),Number(this.storeAmount.fuYouAmount) + Number(this.storeAmount.laKaLaAmount)), name: '' }
// { value: 50, name: '7 ' },
// { value: 50, name: '7' }
{ value: this.countPercentage(Number(this.storeAmount.storeTotal),Number(this.storeAmount.storeTotal) + Number(this.storeAmount.noStoreTotal)), name: '7日活跃油站' },
{ value: this.countPercentage(Number(this.storeAmount.noStoreTotal),Number(this.storeAmount.storeTotal) + Number(this.storeAmount.noStoreTotal)), name: '非7日活跃油站' }
],
label: {
show: true,

View File

@ -131,7 +131,22 @@
</div>
</div>
<div class="right-box-t">
<div class="h-tt" >硬件设备</div>
<!-- <div class="h-tt" >硬件设备</div>-->
<div class="title_">
<div>硬件设备</div>
<div style="font-size: 12px;color: #BBBBBB;display: flex;align-items: center">
<el-popover
placement="bottom"
width="200"
trigger="click">
<div>
联系人张总<br>
联系电话15666665287
</div>
<el-button slot="reference" style="border: 0px" type="text"><img src="@/assets/images/phone.png"></el-button>
</el-popover>
</div>
</div>
<div class="d-s" style="margin: 30px 0px" v-for="(item,index) in hardwareList" :key="index" >
<!-- <div class="r-img">-->
<!-- <img src="../../assets/images/pcin.png" style="width: 84px;height: 70px">-->

View File

@ -53,5 +53,27 @@ public interface MtStoreMapper extends BaseMapper<MtStore> {
List<MtStore> selectStoreList(@Param("storeVo") MtStore store,@Param("ownDeptStr") String ownDeptStr);
/**
* 查询今日时间段内数据信息
* @param store
* @param storeIds
* @return
*/
List<StoreNumVo> selectStoreNum(@Param("storeVo") MtStore store,@Param("storeIds") List<Integer> storeIds);
/**
* 查询周/月内天数数据信息
* @param store
* @param storeIds
* @return
*/
List<StoreNumVo> selectStoreNumByDay(@Param("storeVo") MtStore store,@Param("storeIds") List<Integer> storeIds);
/**
* 查询年内月数数据信息
* @param store
* @param storeIds
* @return
*/
List<StoreNumVo> selectStoreNumByMonth(@Param("storeVo") MtStore store,@Param("storeIds") List<Integer> storeIds);
}

View File

@ -100,4 +100,48 @@
tradeTime) t
GROUP BY t.tradeTime
</select>
<select id="selectStoreNumByDay" resultType="com.fuint.business.store.vo.StoreNumVo">
SELECT t.tradeTime,count(t.store_id) storeNum,sum(t.tradeNum) tradeNum,sum(t.tradeAmount) tradeAmount
FROM (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') AS tradeTime,count(id) tradeNum,SUM(pay_money) AS tradeAmount,store_id
FROM all_order_info
<where>
store_id in
<foreach collection="storeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="storeVo.params.beginTime != null and storeVo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{storeVo.params.beginTime},'%y%m%d')
</if>
<if test="storeVo.params.endTime != null and storeVo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{storeVo.params.endTime},'%y%m%d')
</if>
</where>
GROUP BY
tradeTime,store_id
ORDER BY
tradeTime) t
GROUP BY t.tradeTime
</select>
<select id="selectStoreNumByMonth" resultType="com.fuint.business.store.vo.StoreNumVo">
SELECT t.tradeTime,count(t.store_id) storeNum,sum(t.tradeNum) tradeNum,sum(t.tradeAmount) tradeAmount
FROM (SELECT DATE_FORMAT(create_time, '%Y-%m') AS tradeTime,count(id) tradeNum,SUM(pay_money) AS tradeAmount,store_id
FROM all_order_info
<where>
store_id in
<foreach collection="storeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="storeVo.params.beginTime != null and storeVo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{storeVo.params.beginTime},'%y%m%d')
</if>
<if test="storeVo.params.endTime != null and storeVo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{storeVo.params.endTime},'%y%m%d')
</if>
</where>
GROUP BY
tradeTime,store_id
ORDER BY
tradeTime) t
GROUP BY t.tradeTime
</select>
</mapper>

View File

@ -58,6 +58,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
@ -737,7 +738,7 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
}
@Override
public List<StoreNumVo> getStoreAmountByTime(MtStore store) {
public List<StoreNumVo> getStoreAmountByTime(MtStore store){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
SysDept sysDept = deptService.getById(nowAccountInfo.getDeptId());
String ancestors = sysDept.getAncestors();
@ -751,7 +752,38 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
for (MtStore mtStore : mtStores) {
storeIds.add(mtStore.getId());
}
return baseMapper.selectStoreNum(store,storeIds);
List<StoreNumVo> storeNumVos = null;
if (ObjectUtil.isNotEmpty(store.getParams()) && ObjectUtil.isNotEmpty(store.getParams().get("beginTime"))
&& ObjectUtil.isNotEmpty(store.getParams().get("endTime"))){
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date today = calendar.getTime();
Calendar calendar1 = Calendar.getInstance();
calendar1.add(Calendar.YEAR, -1); // 将年份减去1
long oneYearAgo = calendar1.getTimeInMillis();
Date yearDay = new Date(oneYearAgo);
try {
if (!today.after( dateFormat.parse(store.getParams().get("beginTime").toString()) )){
storeNumVos = baseMapper.selectStoreNum(store, storeIds);
}else {
if (yearDay.before(dateFormat.parse(store.getParams().get("beginTime").toString()))){
storeNumVos = baseMapper.selectStoreNumByDay(store, storeIds);
}else {
storeNumVos = baseMapper.selectStoreNumByMonth(store, storeIds);
}
}
}catch (Exception e){
e.printStackTrace();
}
}
return storeNumVos;
}
@Override