This commit is contained in:
cun-nan 2024-10-23 17:12:34 +08:00
parent 5dec74f184
commit 953c53696c
3 changed files with 82 additions and 37 deletions

View File

@ -150,21 +150,26 @@
</el-select>
</el-form-item>
<el-form-item label="接收用户" :required="true">
<div
style="border: 1px solid #DCDFE6;width: 100%;height: 100px; border-radius: 4px; flex-wrap: wrap;overflow-y: scroll;">
<div style="display: flex;margin: 10px;">
<div @click="clickAdd" style="height: 32px;display: flex;
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */ ">
<img src="../page/img/icon-adduser@3x.png">
</div>
<div v-for="item in form.recipientUser" :key="item.id">
<el-badge value="x" class="item" style="margin-left: 10px">
<el-button @click="clickUser(item.id)" size="mini">{{ item.userName }}</el-button>
</el-badge>
</div>
</div>
</div>
<!-- 原样式-->
<!-- <div style="border: 1px solid #DCDFE6;width: 100%;height: 100px; border-radius: 4px; flex-wrap: wrap;overflow-y: scroll;">-->
<!-- <div style="display: flex;margin: 10px;">-->
<!-- <div @click="clickAdd" style="height: 32px;display: flex;-->
<!-- justify-content: center; /* 水平居中 */-->
<!-- align-items: center; /* 垂直居中 */ ">-->
<!-- <img src="../page/img/icon-adduser@3x.png">-->
<!-- </div>-->
<!-- <div v-for="item in form.recipientUser" :key="item.id">-->
<!-- <el-badge value="x" class="item" style="margin-left: 10px">-->
<!-- <el-button @click="clickUser(item.id)" size="mini">{{ item.userName }}</el-button>-->
<!-- </el-badge>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- 新样式-->
<el-select v-model="form.recipientUser" multiple placeholder="请选择接收用户"
style="width: 100%;">
<el-option v-for="item in linshicunshu" :label="item.userName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<!-- 模板状态 -->
@ -327,13 +332,16 @@ export default {
let ids = this.form.recipientRoles.join(',')
getByRoleIdApi({roleIds: ids}).then(res => {
const getUsertList = res.data;
console.log(getUsertList,335)
// recipientUser
// this.form.recipientUser = []
getUsertList.forEach(item => {
this.form.recipientUser.push({
id: item.acctId,
userName: item.accountName,
})
this.form.recipientUser.push(item.acctId)
// this.form.recipientUser.push({
// id: item.acctId,
// staffId:item.staffId,
// userName: item.realName,
// })
this.getroleStaff.push({
id: item.acctId,
userName: item.accountName,
@ -371,8 +379,8 @@ export default {
page: 1,
pageSize: 10,
deviceName: '',
},
this.getList()
}
this.getList()
},
handleAdd(e) {
this.clean()
@ -380,6 +388,7 @@ export default {
this.getDutyList()
this.title = "新增通知"
this.onlyGetUser()
},
userEnter1() {
//
@ -417,7 +426,7 @@ export default {
// this.form.recipientUser = JSON.parse(this.form.recipientUser)
// this.form.recipientRoles = JSON.parse(this.form.recipientRoles)
// this.getDutyList()
this.onlyGetUser()
getSysNotifyInfo(e.id).then(res => {
this.open = true;
this.title = "编辑通知"
@ -494,8 +503,18 @@ export default {
// this.loading = true;
// console.log(this.queryParams,222)
// this.addDateRange(this.queryParams, this.dateRange)
this.linshicunshu = []
listUser1(this.queryParamsUser).then(response => {
this.userList = response.data.records;
this.userList = response.data.records
console.log(this.userList,507)
this.userList.forEach(item => {
this.linshicunshu.push({
id: item.acctId,
staffId: item.staffId,
userName: item.realName ? item.realName : '--'
})
})
// this.total = response.data.total;
// this.total = response.data.total;
// this.loading = false;

View File

@ -37,9 +37,8 @@
@click="goList()">更多 <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 class="hang_" v-for="(item,index) in noticeList" :key="index">
{{item.notificationType}}{{ item.templateContent }}
</div>
<div class="hang_" v-if="this.noticeList.length==0">暂无通知</div>
</div>
@ -706,7 +705,8 @@ export default {
getStoreAmount() {
getDataBoard(this.addDateRange(this.queryParams, this.value1)).then(res => {
this.storeAmount = res.data
// this.initChart()
this.getDataAnalysis()
this.initChart()
})
},
countPercentage(upNum, downNum) {

View File

@ -1647,7 +1647,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
Integer noOilNum = 0;
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setType("1");
allOrderInfo.setType("6");
Map<String, Object> sumAndNum = getSumAndNum(allOrderInfo, map);
oilAmount = Double.valueOf(sumAndNum.get("payMoney").toString());
oilNum = Integer.valueOf(sumAndNum.get("allNum").toString());
@ -1764,7 +1764,10 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
oilList.add(oilOrder);
}
}
double averageValue = (Double.parseDouble(String.valueOf(oilList.size())) / oilOrders.size()) * 100;
double averageValue = 0.0;
if (oilOrders.size() > 0) {
averageValue = (Double.parseDouble(String.valueOf(oilList.size())) / oilOrders.size()) * 100;
}
String formattedResult = getFormattedResult(averageValue);
homeDataAnalysisVo.setValue(Double.parseDouble(formattedResult));
list.add(homeDataAnalysisVo);
@ -1789,13 +1792,19 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
for (AllOrderInfo allOrderInfo : allOrderInfos) {
if ("1".equals(allOrderInfo.getType())) {
oilAllOrderInfos += 1;
} else if ("2".equals(allOrderInfo.getType()) || "3".equals(allOrderInfo.getType()) || "4".equals(allOrderInfo.getType()) || "5".equals(allOrderInfo.getType())) {
} else if ("2".equals(allOrderInfo.getType()) || "3".equals(allOrderInfo.getType()) || "4".equals(allOrderInfo.getType()) || "5".equals(allOrderInfo.getType()) || "6".equals(allOrderInfo.getType())) {
productionAllOrderInfos += 1;
}
}
Double i = ((double) oilAllOrderInfos / (oilAllOrderInfos + productionAllOrderInfos)) * 100;
Double i = 0.0;
if ((oilAllOrderInfos + productionAllOrderInfos) > 0) {
i = ((double) oilAllOrderInfos / (oilAllOrderInfos + productionAllOrderInfos)) * 100;
}
Double shareOfOilTransactions = Double.valueOf((getFormattedResult(i)));
Double shareOfNonOilTransactions = Double.valueOf(getFormattedResult(((double) productionAllOrderInfos / (oilAllOrderInfos + productionAllOrderInfos)) * 100));
Double shareOfNonOilTransactions = 0.0;
if ((oilAllOrderInfos + productionAllOrderInfos) > 0) {
shareOfNonOilTransactions = Double.valueOf(getFormattedResult(((double) productionAllOrderInfos / (oilAllOrderInfos + productionAllOrderInfos)) * 100));
}
HomeDataAnalysisVo oilhomeDataAnalysisVo = new HomeDataAnalysisVo();
oilhomeDataAnalysisVo.setName("油品交易占比");
@ -1833,25 +1842,41 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
HomeDataAnalysisVo mtUserVo = new HomeDataAnalysisVo();
mtUserVo.setName("会员充值占比");
mtUserVo.setType(3);
mtUserVo.setValue(Double.parseDouble(getFormattedResult(((double) mtUser / sum) * 100)));
double value = 0.0;
if (sum>0){
value = Double.parseDouble(getFormattedResult(((double) mtUser / sum) * 100));
}
mtUserVo.setValue(value);
list.add(mtUserVo);
HomeDataAnalysisVo productVo = new HomeDataAnalysisVo();
productVo.setName("商品交易占比");
productVo.setType(3);
productVo.setValue(Double.parseDouble(getFormattedResult(((double) product / sum) * 100)));
double value1 = 0.0;
if (sum>0){
value1 = Double.parseDouble(getFormattedResult(((double) product / sum) * 100));
}
productVo.setValue(value1);
list.add(productVo);
HomeDataAnalysisVo oilRechargeVo = new HomeDataAnalysisVo();
oilRechargeVo.setName("油品交易占比");
oilRechargeVo.setType(3);
oilRechargeVo.setValue(Double.parseDouble(getFormattedResult(((double) oilRecharge / sum) * 100)));
double value2 = 0.0;
if (sum>0){
value2 = Double.parseDouble(getFormattedResult(((double) oilRecharge / sum) * 100));
}
oilRechargeVo.setValue(value2);
list.add(oilRechargeVo);
HomeDataAnalysisVo pointMallVo = new HomeDataAnalysisVo();
pointMallVo.setName("积分商城交易占比");
pointMallVo.setType(3);
pointMallVo.setValue(Double.parseDouble(getFormattedResult((double) pointMall / sum * 100)));
double value3 = 0.0;
if (sum>0){
value3 = Double.parseDouble(getFormattedResult((double) pointMall / sum * 100));
}
pointMallVo.setValue(value3);
list.add(pointMallVo);
return list;
}
@ -1910,7 +1935,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
mapData.put("day", parse.toString("MM-dd HH:mm"));
dateTime = DateUtil.beginOfHour(DateUtil.parse(day));
dateTime1 = DateUtil.endOfHour(dateTime);
}else if (type == 3) {
} else if (type == 3) {
DateTime parse = DateUtil.parse(day);
mapData.put("day", parse.toString("yyyy-MM-dd"));
dateTime = DateUtil.beginOfDay(parse);
@ -1984,6 +2009,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
return dateList;
}
public List<String> getAllDatesBetweenMonth(String startTime, String endTime) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");