mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
新增 修改站点计费模板状态方法
This commit is contained in:
@@ -164,4 +164,15 @@ public class PileBillingTemplateController extends BaseController {
|
||||
public AjaxResult publishBillingTemplate(@RequestBody PublishBillingTemplateDTO dto) {
|
||||
return toAjax(pileRemoteService.publishBillingTemplate(dto));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改站点计费模板状态并下发
|
||||
* @param pileBillingTemplate
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/changeStationTemplate")
|
||||
public AjaxResult changeStationTemplate(@RequestBody PileBillingTemplate pileBillingTemplate) {
|
||||
return toAjax(pileBillingTemplateService.updatePileBillingTemplate(pileBillingTemplate));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,4 +160,11 @@ public interface IPileBillingTemplateService {
|
||||
CurrentTimePriceDetails getCurrentTimePriceDetails(String stationId);
|
||||
|
||||
List<PileBillingDetail> queryBillingDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 修改站点计费模板状态并下发最新模板
|
||||
* @param pileBillingTemplate
|
||||
* @return
|
||||
*/
|
||||
int changeStationTemplate(PileBillingTemplate pileBillingTemplate);
|
||||
}
|
||||
|
||||
@@ -379,6 +379,22 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
||||
return pileBillingDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改站点计费模板状态并下发最新模板
|
||||
* @param pileBillingTemplate
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int changeStationTemplate(PileBillingTemplate pileBillingTemplate) {
|
||||
// 先将以前正在使用的模板查出来,状态改为0
|
||||
|
||||
// 将当前这条模板状态改为1
|
||||
|
||||
// 下发站点下所有桩
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillingTemplateVO> queryPublicBillingTemplateList() {
|
||||
return pileBillingTemplateMapper.queryPublicBillingTemplateList();
|
||||
|
||||
@@ -28,6 +28,9 @@ public class BillingTemplateVO {
|
||||
// 计费模板名称
|
||||
private String templateName;
|
||||
|
||||
// 计费模板状态
|
||||
private String status;
|
||||
|
||||
// 计费模板备注
|
||||
private String remark;
|
||||
|
||||
|
||||
@@ -291,6 +291,7 @@
|
||||
t2.id as templateId,
|
||||
t2.template_code as templateCode,
|
||||
t2.name as templateName,
|
||||
t2.status,
|
||||
t2.remark as remark,
|
||||
t2.type as deviceType,
|
||||
t2.publish_time as publishTime,
|
||||
|
||||
@@ -97,4 +97,12 @@ export function publishBillingTemplate(data) {
|
||||
});
|
||||
}
|
||||
|
||||
export function changeStationTemplate(data) {
|
||||
return request({
|
||||
url: "/billing/template/changeStationTemplate",
|
||||
method: "post",
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 查询全部计费模板
|
||||
|
||||
@@ -88,6 +88,17 @@
|
||||
>
|
||||
<el-table-column label="模板编号" prop="templateCode" />
|
||||
<el-table-column label="名称" prop="templateName" />
|
||||
<el-table-column label="模板状态" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeStatus(scope.row)"
|
||||
>
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- matchCars 使用车辆描述 -->
|
||||
<el-table-column label="描述" prop="remark" />
|
||||
<el-table-column label="设备类型" prop="deviceType">
|
||||
@@ -195,9 +206,10 @@ import {
|
||||
queryStationBillingTemplateList,
|
||||
queryPublicBillingTemplateList,
|
||||
stationImportBillingTemplate,
|
||||
publishBillingTemplate, getTemplate,
|
||||
publishBillingTemplate, getTemplate, updateBillingTemplate, changeStationTemplate,
|
||||
} from "@/api/billing/template.js";
|
||||
import AddBilling from "../../../billing/template/components/addBilling.vue";
|
||||
import {updateStation} from "@/api/pile/station";
|
||||
|
||||
export default {
|
||||
components: { BondedDevice, Expenses, AddBilling },
|
||||
@@ -283,6 +295,17 @@ export default {
|
||||
this.publishTemplateId = "";
|
||||
});
|
||||
},
|
||||
changeStatus(info) {
|
||||
const param = {
|
||||
id: info.templateId,
|
||||
status: info.status,
|
||||
}
|
||||
console.log("param", param);
|
||||
changeStationTemplate(param).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getStationBillingTemplateList();
|
||||
});
|
||||
},
|
||||
/** 打开导入表弹窗 */
|
||||
openImportTable() {
|
||||
console.log("111");
|
||||
@@ -333,7 +356,7 @@ export default {
|
||||
getStationBillingTemplateList() {
|
||||
// console.log("通过站点id查询计费模板", this.stationId)
|
||||
queryStationBillingTemplateList(this.stationId).then((response) => {
|
||||
// console.log("通过站点id查询计费模板 result: ", response.rows);
|
||||
console.log("通过站点id查询计费模板 result: ", response.rows);
|
||||
this.stationBillingTemplate = response.rows;
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user