mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-16 15:58:41 +08:00
手动结算订单支持自定义输入金额和充电度数
This commit is contained in:
@@ -32,6 +32,7 @@ import com.jsowell.pile.domain.OrderPayRecord;
|
|||||||
import com.jsowell.pile.domain.WxpayCallbackRecord;
|
import com.jsowell.pile.domain.WxpayCallbackRecord;
|
||||||
import com.jsowell.pile.dto.BasicPileDTO;
|
import com.jsowell.pile.dto.BasicPileDTO;
|
||||||
import com.jsowell.pile.dto.GenerateOrderDTO;
|
import com.jsowell.pile.dto.GenerateOrderDTO;
|
||||||
|
import com.jsowell.pile.dto.ManualSettlementDTO;
|
||||||
import com.jsowell.pile.dto.PayOrderDTO;
|
import com.jsowell.pile.dto.PayOrderDTO;
|
||||||
import com.jsowell.pile.dto.PayOrderSuccessCallbackDTO;
|
import com.jsowell.pile.dto.PayOrderSuccessCallbackDTO;
|
||||||
import com.jsowell.pile.dto.PaymentScenarioDTO;
|
import com.jsowell.pile.dto.PaymentScenarioDTO;
|
||||||
@@ -812,7 +813,7 @@ public class OrderService {
|
|||||||
* 人工结算订单
|
* 人工结算订单
|
||||||
* @param dto
|
* @param dto
|
||||||
*/
|
*/
|
||||||
public boolean manualSettlementOrder(QueryOrderDTO dto) {
|
public boolean manualSettlementOrder(ManualSettlementDTO dto) {
|
||||||
log.info("人工结算订单-begin orderCode:{}", dto.getOrderCode());
|
log.info("人工结算订单-begin orderCode:{}", dto.getOrderCode());
|
||||||
// 查询订单
|
// 查询订单
|
||||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(dto.getOrderCode());
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(dto.getOrderCode());
|
||||||
@@ -833,18 +834,22 @@ public class OrderService {
|
|||||||
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
|
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取最后一次实时数据
|
String chargingAmount = dto.getChargingAmount();
|
||||||
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode());
|
String chargingDegree = dto.getChargingDegree();
|
||||||
if (CollectionUtils.isEmpty(chargingRealTimeData)) {
|
if (StringUtils.isBlank(chargingAmount) || StringUtils.isBlank(chargingDegree)) {
|
||||||
log.info("人工结算订单-根据订单号:{},查不到充电桩上传的实时数据,无法进行结算", dto.getOrderCode());
|
// 获取最后一次实时数据
|
||||||
return false;
|
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode());
|
||||||
|
if (CollectionUtils.isNotEmpty(chargingRealTimeData)) {
|
||||||
|
RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
|
||||||
|
chargingAmount = realTimeMonitorData.getChargingAmount();
|
||||||
|
chargingDegree = realTimeMonitorData.getChargingDegree();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
|
|
||||||
|
|
||||||
// 组装交易记录数据
|
// 组装交易记录数据
|
||||||
TransactionRecordsData data = new TransactionRecordsData();
|
TransactionRecordsData data = new TransactionRecordsData();
|
||||||
data.setConsumptionAmount(realTimeMonitorData.getChargingAmount()); // 总消费金额
|
data.setConsumptionAmount(chargingAmount); // 总消费金额
|
||||||
data.setTotalElectricity(realTimeMonitorData.getChargingDegree()); // 总用电量
|
data.setTotalElectricity(chargingDegree); // 总用电量
|
||||||
data.setStopReasonMsg("人工结算订单,操作人:" + SecurityUtils.getUsername()); // 停止原因
|
data.setStopReasonMsg("人工结算订单,操作人:" + SecurityUtils.getUsername()); // 停止原因
|
||||||
|
|
||||||
// 结算订单
|
// 结算订单
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.jsowell.common.core.page.TableDataInfo;
|
|||||||
import com.jsowell.common.enums.BusinessType;
|
import com.jsowell.common.enums.BusinessType;
|
||||||
import com.jsowell.common.util.poi.ExcelUtil;
|
import com.jsowell.common.util.poi.ExcelUtil;
|
||||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||||
|
import com.jsowell.pile.dto.ManualSettlementDTO;
|
||||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||||
import com.jsowell.pile.service.IOrderBasicInfoService;
|
import com.jsowell.pile.service.IOrderBasicInfoService;
|
||||||
import com.jsowell.pile.vo.web.OrderListVO;
|
import com.jsowell.pile.vo.web.OrderListVO;
|
||||||
@@ -108,7 +109,7 @@ public class OrderBasicInfoController extends BaseController {
|
|||||||
* http://localhost:8080/order/manualSettlementOrder
|
* http://localhost:8080/order/manualSettlementOrder
|
||||||
*/
|
*/
|
||||||
@PostMapping("/manualSettlementOrder")
|
@PostMapping("/manualSettlementOrder")
|
||||||
public AjaxResult manualSettlementOrder(@RequestBody QueryOrderDTO dto) {
|
public AjaxResult manualSettlementOrder(@RequestBody ManualSettlementDTO dto) {
|
||||||
return toAjax(orderService.manualSettlementOrder(dto));
|
return toAjax(orderService.manualSettlementOrder(dto));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.jsowell.pile.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ManualSettlementDTO {
|
||||||
|
// 订单编号
|
||||||
|
private String orderCode;
|
||||||
|
|
||||||
|
// 充电金额
|
||||||
|
private String chargingAmount;
|
||||||
|
|
||||||
|
// 充电度数
|
||||||
|
private String chargingDegree;
|
||||||
|
}
|
||||||
@@ -13,7 +13,15 @@
|
|||||||
>
|
>
|
||||||
<span>平台收到充电桩传来的最后一次实时监测数据<br/></span>
|
<span>平台收到充电桩传来的最后一次实时监测数据<br/></span>
|
||||||
<span v-if="lastMonitorData != null">时间:{{lastMonitorData.dateTime}}, 消费金额:{{lastMonitorData.chargingAmount}}, 充电度数:{{lastMonitorData.chargingDegree}}</span>
|
<span v-if="lastMonitorData != null">时间:{{lastMonitorData.dateTime}}, 消费金额:{{lastMonitorData.chargingAmount}}, 充电度数:{{lastMonitorData.chargingDegree}}</span>
|
||||||
<el-empty v-if="lastMonitorData == null" description="未查询到实时监测数据"/>
|
<el-empty v-if="lastMonitorData == null" :image-size="50" description="未查询到实时监测数据"/>
|
||||||
|
<el-form :model="manualSettlementParam">
|
||||||
|
<el-form-item label="消费金额" label-width="80px">
|
||||||
|
<el-input v-model="manualSettlementParam.chargingAmount" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="充电度数" label-width="80px">
|
||||||
|
<el-input v-model="manualSettlementParam.chargingDegree" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="confirmManualSettlement">确 定</el-button>
|
<el-button type="primary" @click="confirmManualSettlement">确 定</el-button>
|
||||||
@@ -196,8 +204,12 @@ export default {
|
|||||||
orderDetail:[],
|
orderDetail:[],
|
||||||
pileIn: [],
|
pileIn: [],
|
||||||
orderRealTimeInfo: null,
|
orderRealTimeInfo: null,
|
||||||
|
// 手动结算对话框Visible
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
// 最后一次实时监测数据
|
||||||
lastMonitorData: {},
|
lastMonitorData: {},
|
||||||
|
// 手动结算参数
|
||||||
|
manualSettlementParam: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -208,11 +220,9 @@ export default {
|
|||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
confirmManualSettlement() {
|
confirmManualSettlement() {
|
||||||
var data = {
|
this.manualSettlementParam.orderCode = this.orderInfo[0].orderCode;
|
||||||
orderCode: this.orderInfo[0].orderCode
|
console.log("确认手动结算订单param:", this.manualSettlementParam);
|
||||||
};
|
manualSettlementOrder(this.manualSettlementParam).then(response => {
|
||||||
console.log("确认手动结算订单", data);
|
|
||||||
manualSettlementOrder(data).then(response => {
|
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.getOrderDetail();
|
this.getOrderDetail();
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user