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