mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-04 10:00:11 +08:00
update
This commit is contained in:
@@ -123,7 +123,7 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
||||
String logicCard = "";
|
||||
byte[] authenticationFlagByteArr = Constants.zeroByteArray;
|
||||
byte[] accountBalanceByteArr = Constants.zeroByteArray;
|
||||
String transactionCode = IdUtils.generateTransactionCode(pileSn, connectorCode);
|
||||
String transactionCode = "";
|
||||
try {
|
||||
if (StringUtils.equals("01", startMode)) {
|
||||
// 刷卡启动充电
|
||||
@@ -149,10 +149,12 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
||||
BigDecimal principalBalance = memberVO.getPrincipalBalance(); // 本金金额
|
||||
double accountBalance = principalBalance.add(memberVO.getGiftBalance()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
accountBalanceByteArr = YKCUtils.getPriceByte(String.valueOf(accountBalance), 2);
|
||||
if (StringUtils.equals("1", cardStatus)) {
|
||||
// 鉴权成功标识 0x00 失败 0x01 成功
|
||||
authenticationFlagByteArr = Constants.oneByteArray;
|
||||
if (!StringUtils.equals("1", cardStatus)) {
|
||||
return null;
|
||||
}
|
||||
// 鉴权成功标识 0x00 失败 0x01 成功
|
||||
authenticationFlagByteArr = Constants.oneByteArray;
|
||||
transactionCode = IdUtils.generateTransactionCode(pileSn, connectorCode);
|
||||
// 通过桩号查询所属站点
|
||||
PileBasicInfo pileBasicInfo = pileBasicInfoService.selectPileBasicInfoBySN(pileSn);
|
||||
Long stationId = pileBasicInfo.getStationId();
|
||||
@@ -198,6 +200,11 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
|
||||
.orderDetail(orderDetail)
|
||||
.build();
|
||||
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
||||
|
||||
// 将卡状态改为启动锁定
|
||||
pileAuthCard.setId(pileAuthCardInfo.getId());
|
||||
pileAuthCard.setStatus("2");
|
||||
pileAuthCardService.updatePileAuthCard(pileAuthCard);
|
||||
}
|
||||
} catch (BusinessException e){
|
||||
log.error("刷卡启动充电鉴权 error:{}, {}", e.getCode(), e.getMessage());
|
||||
|
||||
@@ -544,7 +544,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
||||
if (Objects.isNull(orderBasicInfo.getChargeEndTime())) { // 结束时间
|
||||
orderBasicInfo.setChargeEndTime(DateUtils.parseDate(data.getEndTime()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(data.getLogicCard())) {
|
||||
if (!StringUtils.equals("0000000000000000", data.getLogicCard())) {
|
||||
// 根据物理卡号查出所属用户
|
||||
PileAuthCard pileAuthCard = PileAuthCard.builder()
|
||||
.logicCard(data.getLogicCard())
|
||||
@@ -552,7 +552,12 @@ public class TransactionRecordsRequestHandler extends AbstractHandler {
|
||||
PileAuthCard cardInfo = pileAuthCardService.selectPileAuthCardInfo(pileAuthCard);
|
||||
if (cardInfo != null) {
|
||||
orderBasicInfo.setMemberId(cardInfo.getMemberId());
|
||||
// 将此卡状态改为正常
|
||||
pileAuthCard.setId(cardInfo.getId());
|
||||
pileAuthCard.setStatus("1");
|
||||
pileAuthCardService.updatePileAuthCard(pileAuthCard);
|
||||
}
|
||||
|
||||
}
|
||||
orderBasicInfoService.updateOrderBasicInfo(orderBasicInfo);
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
|
||||
.id(dto.getId())
|
||||
.logicCard(dto.getLogicCard())
|
||||
.memberId(memberBasicInfo.getMemberId())
|
||||
.status(dto.getStatus())
|
||||
.status("1")
|
||||
.build();
|
||||
return pileAuthCardMapper.updatePileAuthCard(pileAuthCard);
|
||||
}
|
||||
|
||||
@@ -133,25 +133,25 @@
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="逻辑卡号" prop="logicCard">
|
||||
<el-input v-model="form.logicCard" placeholder="请输入逻辑卡号" />
|
||||
<el-input v-model="form.logicCard" :disabled = "isDisabled" placeholder="请输入逻辑卡号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phoneNumber">
|
||||
<el-input v-model="form.phoneNumber" placeholder="请输入会员的手机号码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="选择状态" prop="status">
|
||||
<el-select
|
||||
placeholder="请选择状态"
|
||||
v-model="form.status"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.type.card_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="选择状态" prop="status">-->
|
||||
<!-- <el-select-->
|
||||
<!-- placeholder="请选择状态"-->
|
||||
<!-- v-model="form.status"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in dict.type.card_status"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- >-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="物理卡号" prop="physicsCard">-->
|
||||
<!-- <el-input v-model="form.physicsCard" placeholder="请输入物理卡号" />-->
|
||||
<!-- </el-form-item>-->
|
||||
@@ -196,6 +196,8 @@ export default {
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 卡号是否可填写
|
||||
isDisabled: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -274,6 +276,7 @@ export default {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加充电站鉴权卡";
|
||||
this.isDisabled = false;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@@ -282,6 +285,7 @@ export default {
|
||||
getCard(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.isDisabled = true;
|
||||
this.title = "修改充电站鉴权卡";
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user