From 0cad2dcfa4b3aea2eb2b597ee03b88411c52e528 Mon Sep 17 00:00:00 2001 From: Lemon Date: Wed, 7 Jun 2023 15:14:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0vin=E7=A0=81=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/enums/ykc/StartModeEnum.java | 1 + .../ConfirmStartChargingRequestHandler.java | 36 +++++- .../com/jsowell/pile/domain/CarVinInfo.java | 99 +++++++++++++++ .../jsowell/pile/domain/OrderBasicInfo.java | 6 + .../jsowell/pile/dto/GenerateOrderDTO.java | 6 + .../jsowell/pile/mapper/CarVinInfoMapper.java | 78 ++++++++++++ .../pile/service/ICarVinInfoService.java | 76 ++++++++++++ .../service/impl/CarVinInfoServiceImpl.java | 117 ++++++++++++++++++ .../impl/OrderBasicInfoServiceImpl.java | 52 ++++++-- .../com/jsowell/pile/vo/CarVinInfoVO.java | 37 ++++++ .../mapper/pile/CarVinInfoMapper.xml | 113 +++++++++++++++++ .../mapper/pile/OrderBasicInfoMapper.xml | 2 + 12 files changed, 610 insertions(+), 13 deletions(-) create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/domain/CarVinInfo.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/mapper/CarVinInfoMapper.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/service/ICarVinInfoService.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/service/impl/CarVinInfoServiceImpl.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/vo/CarVinInfoVO.java create mode 100644 jsowell-pile/src/main/resources/mapper/pile/CarVinInfoMapper.xml diff --git a/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/StartModeEnum.java b/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/StartModeEnum.java index 2dd128413..37ea07eb8 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/StartModeEnum.java +++ b/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/StartModeEnum.java @@ -9,6 +9,7 @@ public enum StartModeEnum { AUTH_CARD("2", "鉴权卡启动"), OFFLINE_CARD("3", "离线卡启动"), LIAN_LIAN("4", "联联平台启动"), + VIN_CODE("5", "车辆vin码启动"), ; private String value; diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/handler/ConfirmStartChargingRequestHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/handler/ConfirmStartChargingRequestHandler.java index f1e0cb6b0..f548b3936 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/handler/ConfirmStartChargingRequestHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/handler/ConfirmStartChargingRequestHandler.java @@ -7,6 +7,7 @@ import com.jsowell.common.core.domain.ykc.YKCDataProtocol; import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode; import com.jsowell.common.enums.ykc.CardStatusEnum; import com.jsowell.common.enums.ykc.ReturnCodeEnum; +import com.jsowell.common.enums.ykc.StartModeEnum; import com.jsowell.common.exception.BusinessException; import com.jsowell.common.util.BytesUtil; import com.jsowell.common.util.StringUtils; @@ -14,8 +15,10 @@ import com.jsowell.common.util.YKCUtils; import com.jsowell.netty.factory.YKCOperateFactory; import com.jsowell.pile.domain.PileAuthCard; import com.jsowell.pile.dto.GenerateOrderDTO; +import com.jsowell.pile.service.ICarVinInfoService; import com.jsowell.pile.service.IOrderBasicInfoService; import com.jsowell.pile.service.IPileAuthCardService; +import com.jsowell.pile.vo.CarVinInfoVO; import io.netty.channel.Channel; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -41,6 +44,9 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{ @Autowired private IOrderBasicInfoService orderBasicInfoService; + @Autowired + private ICarVinInfoService carVinInfoService; + @Override public void afterPropertiesSet() throws Exception { YKCOperateFactory.register(type, this); @@ -97,13 +103,14 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{ startIndex += length; length = 17; byte[] vinCodeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length); + String vinCode = BytesUtil.ascii2Str(vinCodeByteArr); /** * 刷卡启动充电 */ String logicCard = ""; - byte[] authenticationFlagByteArr = Constants.zeroByteArray; - byte[] accountBalanceByteArr = Constants.zeroByteArray; + byte[] authenticationFlagByteArr = Constants.zeroByteArray; // 鉴权成功标识 + byte[] accountBalanceByteArr = Constants.zeroByteArray; // 账户余额 String transactionCode = ""; try { if (StringUtils.equals("01", startMode)) { @@ -127,6 +134,7 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{ dto.setPileAuthCardInfo(pileAuthCardInfo); dto.setPileSn(pileSn); dto.setConnectorCode(connectorCode); + dto.setStartMode(StartModeEnum.AUTH_CARD.getValue()); Map map = orderBasicInfoService.generateOrderByCard(dto); if (map != null) { transactionCode = (String) map.get("transactionCode"); @@ -144,6 +152,30 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{ /** * TODO VIN码启动充电 */ + if (StringUtils.equals("03", startMode)) { + // 通过vin码查询数据库绑定用户信息 + CarVinInfoVO memberInfo = carVinInfoService.getMemberInfoByVinCode(vinCode); + if (memberInfo == null) { + throw new BusinessException("", ""); + } + if (!StringUtils.equals("1", memberInfo.getStatus())) { + // 1- 正常使用 + throw new BusinessException("", ""); + } + // vin码生成订单 vin启动充电 + GenerateOrderDTO dto = new GenerateOrderDTO(); + dto.setCarVinInfoVO(memberInfo); + dto.setPileSn(pileSn); + dto.setConnectorCode(connectorCode); + dto.setStartMode(StartModeEnum.VIN_CODE.getValue()); + Map map = orderBasicInfoService.generateOrderByCard(dto); + if (map != null) { + transactionCode = (String) map.get("transactionCode"); + accountBalanceByteArr = YKCUtils.getPriceByte(String.valueOf(map.get("accountBalance")), 2); + // 鉴权成功标识 0x00 失败 0x01 成功 + authenticationFlagByteArr = Constants.oneByteArray; + } + } // 应答 // 交易流水号 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/CarVinInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/CarVinInfo.java new file mode 100644 index 000000000..b2de19e25 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/CarVinInfo.java @@ -0,0 +1,99 @@ +package com.jsowell.pile.domain; + +import com.jsowell.common.annotation.Excel; +import com.jsowell.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 车辆vin码对象 car_vin_info + * + * @author jsowell + * @date 2023-06-07 + */ +public class CarVinInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + + /** + * 车辆vin码 + */ + @Excel(name = "车辆vin码") + private String vinCode; + + /** + * 状态(1-正常使用; 2-启动锁定;9-停用) + */ + @Excel(name = "状态", readConverterExp = "1=-正常使用;,2=-启动锁定;9-停用") + private String status; + + /** + * 会员id + */ + @Excel(name = "会员id") + private String memberId; + + /** + * 删除标识 + */ + private String delFlag; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setVinCode(String vinCode) { + this.vinCode = vinCode; + } + + public String getVinCode() { + return vinCode; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getMemberId() { + return memberId; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.JSON_STYLE) + .append("id", getId()) + .append("vinCode", getVinCode()) + .append("status", getStatus()) + .append("memberId", getMemberId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderBasicInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderBasicInfo.java index a18b2bc00..2b4f93e7e 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderBasicInfo.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderBasicInfo.java @@ -85,6 +85,12 @@ public class OrderBasicInfo extends BaseEntity { @Excel(name = "逻辑卡号") private String logicCard; + /** + * 车辆vin码 + */ + @Excel(name = "车辆vin码") + private String vinCode; + /** * 启动方式 * 0-后管启动;1-用户app启动 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/GenerateOrderDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/GenerateOrderDTO.java index fd6a5db2f..265e96d05 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/GenerateOrderDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/GenerateOrderDTO.java @@ -1,6 +1,7 @@ package com.jsowell.pile.dto; import com.jsowell.pile.domain.PileAuthCard; +import com.jsowell.pile.vo.CarVinInfoVO; import com.jsowell.pile.vo.uniapp.PileConnectorDetailVO; import com.jsowell.pile.vo.web.BillingTemplateVO; import lombok.Data; @@ -66,4 +67,9 @@ public class GenerateOrderDTO extends BasicPileDTO{ * 使用刷卡创建订单时有值 */ private PileAuthCard pileAuthCardInfo; + + /** + * vin启动有值 + */ + private CarVinInfoVO carVinInfoVO; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/CarVinInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/CarVinInfoMapper.java new file mode 100644 index 000000000..6b1723949 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/CarVinInfoMapper.java @@ -0,0 +1,78 @@ +package com.jsowell.pile.mapper; + +import java.util.List; + +import com.jsowell.pile.domain.CarVinInfo; +import com.jsowell.pile.vo.CarVinInfoVO; +import org.springframework.stereotype.Component; + +/** + * 车辆vin码Mapper接口 + * + * @author jsowell + * @date 2023-06-07 + */ +@Component +public interface CarVinInfoMapper { + /** + * 查询车辆vin码 + * + * @param id 车辆vin码主键 + * @return 车辆vin码 + */ + public CarVinInfo selectCarVinInfoById(Long id); + + /** + * 查询车辆vin码列表 + * + * @param carVinInfo 车辆vin码 + * @return 车辆vin码集合 + */ + public List selectCarVinInfoList(CarVinInfo carVinInfo); + + /** + * 通过vin查询信息 + * @param vinCode + * @return + */ + CarVinInfo selectVinInfoByVin(String vinCode); + + /** + * 新增车辆vin码 + * + * @param carVinInfo 车辆vin码 + * @return 结果 + */ + public int insertCarVinInfo(CarVinInfo carVinInfo); + + /** + * 修改车辆vin码 + * + * @param carVinInfo 车辆vin码 + * @return 结果 + */ + public int updateCarVinInfo(CarVinInfo carVinInfo); + + /** + * 删除车辆vin码 + * + * @param id 车辆vin码主键 + * @return 结果 + */ + public int deleteCarVinInfoById(Long id); + + /** + * 批量删除车辆vin码 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCarVinInfoByIds(Long[] ids); + + /** + * 通过vin查询用户信息 + * @param vinCode + * @return + */ + CarVinInfoVO getMemberInfoByVinCode(String vinCode); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/ICarVinInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/ICarVinInfoService.java new file mode 100644 index 000000000..0dca570c6 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/ICarVinInfoService.java @@ -0,0 +1,76 @@ +package com.jsowell.pile.service; + +import java.util.List; + +import com.jsowell.pile.domain.CarVinInfo; +import com.jsowell.pile.vo.CarVinInfoVO; + +/** + * 车辆vin码Service接口 + * + * @author jsowell + * @date 2023-06-07 + */ +public interface ICarVinInfoService { + /** + * 查询车辆vin码 + * + * @param id 车辆vin码主键 + * @return 车辆vin码 + */ + public CarVinInfo selectCarVinInfoById(Long id); + + /** + * 查询车辆vin码列表 + * + * @param carVinInfo 车辆vin码 + * @return 车辆vin码集合 + */ + public List selectCarVinInfoList(CarVinInfo carVinInfo); + + /** + * 通过vin查询信息 + * @param vinCode + * @return + */ + CarVinInfo selectVinInfoByVin(String vinCode); + + /** + * 新增车辆vin码 + * + * @param carVinInfo 车辆vin码 + * @return 结果 + */ + public int insertCarVinInfo(CarVinInfo carVinInfo); + + /** + * 修改车辆vin码 + * + * @param carVinInfo 车辆vin码 + * @return 结果 + */ + public int updateCarVinInfo(CarVinInfo carVinInfo); + + /** + * 批量删除车辆vin码 + * + * @param ids 需要删除的车辆vin码主键集合 + * @return 结果 + */ + public int deleteCarVinInfoByIds(Long[] ids); + + /** + * 删除车辆vin码信息 + * + * @param id 车辆vin码主键 + * @return 结果 + */ + public int deleteCarVinInfoById(Long id); + + /** + * 通过vin查询用户信息 + * @param vinCode + * @return + */ + CarVinInfoVO getMemberInfoByVinCode(String vinCode); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/CarVinInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/CarVinInfoServiceImpl.java new file mode 100644 index 000000000..ff062aa1c --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/CarVinInfoServiceImpl.java @@ -0,0 +1,117 @@ +package com.jsowell.pile.service.impl; + +import java.math.BigDecimal; +import java.util.List; + +import com.jsowell.common.util.DateUtils; +import com.jsowell.pile.vo.CarVinInfoVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.jsowell.pile.mapper.CarVinInfoMapper; +import com.jsowell.pile.domain.CarVinInfo; +import com.jsowell.pile.service.ICarVinInfoService; + +/** + * 车辆vin码Service业务层处理 + * + * @author jsowell + * @date 2023-06-07 + */ +@Service +public class CarVinInfoServiceImpl implements ICarVinInfoService { + @Autowired + private CarVinInfoMapper carVinInfoMapper; + + /** + * 查询车辆vin码 + * + * @param id 车辆vin码主键 + * @return 车辆vin码 + */ + @Override + public CarVinInfo selectCarVinInfoById(Long id) { + return carVinInfoMapper.selectCarVinInfoById(id); + } + + /** + * 查询车辆vin码列表 + * + * @param carVinInfo 车辆vin码 + * @return 车辆vin码 + */ + @Override + public List selectCarVinInfoList(CarVinInfo carVinInfo) { + return carVinInfoMapper.selectCarVinInfoList(carVinInfo); + } + + /** + * 新增车辆vin码 + * + * @param carVinInfo 车辆vin码 + * @return 结果 + */ + @Override + public int insertCarVinInfo(CarVinInfo carVinInfo) { + carVinInfo.setCreateTime(DateUtils.getNowDate()); + return carVinInfoMapper.insertCarVinInfo(carVinInfo); + } + + /** + * 通过vin查询信息 + * @param vinCode + * @return + */ + @Override + public CarVinInfo selectVinInfoByVin(String vinCode) { + return carVinInfoMapper.selectVinInfoByVin(vinCode); + } + + /** + * 修改车辆vin码 + * + * @param carVinInfo 车辆vin码 + * @return 结果 + */ + @Override + public int updateCarVinInfo(CarVinInfo carVinInfo) { + carVinInfo.setUpdateTime(DateUtils.getNowDate()); + return carVinInfoMapper.updateCarVinInfo(carVinInfo); + } + + /** + * 批量删除车辆vin码 + * + * @param ids 需要删除的车辆vin码主键 + * @return 结果 + */ + @Override + public int deleteCarVinInfoByIds(Long[] ids) { + return carVinInfoMapper.deleteCarVinInfoByIds(ids); + } + + /** + * 删除车辆vin码信息 + * + * @param id 车辆vin码主键 + * @return 结果 + */ + @Override + public int deleteCarVinInfoById(Long id) { + return carVinInfoMapper.deleteCarVinInfoById(id); + } + + /** + * 通过vin查询用户信息 + * @param vinCode + * @return + */ + @Override + public CarVinInfoVO getMemberInfoByVinCode(String vinCode){ + CarVinInfoVO memberInfo = carVinInfoMapper.getMemberInfoByVinCode(vinCode); + if (memberInfo == null) { + return null; + } + memberInfo.setAccountBalance(memberInfo.getPrincipalBalance().add(memberInfo.getGiftBalance()).setScale(2, BigDecimal.ROUND_HALF_UP)); + return memberInfo; + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index bd336db9d..d363d20e6 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -32,6 +32,7 @@ import com.jsowell.pile.mapper.OrderBasicInfoMapper; import com.jsowell.pile.service.*; import com.jsowell.pile.transaction.dto.OrderTransactionDTO; import com.jsowell.pile.transaction.service.TransactionService; +import com.jsowell.pile.vo.CarVinInfoVO; import com.jsowell.pile.vo.base.OrderAmountDetailVO; import com.jsowell.pile.vo.base.OrderPeriodAmountVO; import com.jsowell.pile.vo.base.PileInfoVO; @@ -133,6 +134,9 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { @Autowired private IPileMerchantInfoService pileMerchantInfoService; + @Autowired + private ICarVinInfoService carVinInfoService; + @Value("${adapay.refundCallback}") private String ADAPAY_REFUND_CALLBACK_URL; @@ -1548,9 +1552,25 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { public Map generateOrderByCard(GenerateOrderDTO dto) { String pileSn = dto.getPileSn(); String connectorCode = dto.getConnectorCode(); - PileAuthCard pileAuthCardInfo = dto.getPileAuthCardInfo(); + String startMode = dto.getStartMode(); + String logicCard = ""; + String memberId = ""; + String vinCode = ""; + PileAuthCard pileAuthCardInfo = new PileAuthCard(); + CarVinInfoVO carVinInfoVO = new CarVinInfoVO(); + if (StringUtils.equals(StartModeEnum.AUTH_CARD.getValue(), startMode)) { + // 刷卡启动充电 + pileAuthCardInfo = dto.getPileAuthCardInfo(); + memberId = pileAuthCardInfo.getMemberId(); + logicCard = pileAuthCardInfo.getLogicCard(); + }else if (StringUtils.equals(StartModeEnum.VIN_CODE.getValue(), startMode)) { + // vin启动充电 + carVinInfoVO = dto.getCarVinInfoVO(); + memberId = carVinInfoVO.getMemberId(); + vinCode = carVinInfoVO.getVinCode(); + } // 通过memberId获取账户余额 - MemberVO memberVO = memberBasicInfoService.queryMemberInfoByMemberId(pileAuthCardInfo.getMemberId()); + MemberVO memberVO = memberBasicInfoService.queryMemberInfoByMemberId(memberId); if (memberVO == null) { throw new BusinessException(ReturnCodeEnum.CODE_GET_MEMBER_ACCOUNT_AMOUNT_ERROR); } @@ -1578,8 +1598,9 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { .pileSn(pileSn) .connectorCode(connectorCode) .pileConnectorCode(pileSn + connectorCode) - .logicCard(pileAuthCardInfo.getLogicCard()) - .startMode(StartModeEnum.AUTH_CARD.getValue()) + .logicCard(logicCard) + .vinCode(vinCode) + .startMode(startMode) .payStatus(Constants.ONE) .payAmount(totalAccountAmount) .payTime(new Date()) @@ -1609,13 +1630,22 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { .build(); pileTransactionService.doCreateOrder(createOrderTransactionDTO); - // 将卡状态改为启动锁定 - PileAuthCard pileAuthCard = PileAuthCard.builder() - .id(pileAuthCardInfo.getId()) - .logicCard(pileAuthCardInfo.getLogicCard()) - .status("2") - .build(); - pileAuthCardService.updatePileAuthCard(pileAuthCard); + if (StringUtils.equals(StartModeEnum.AUTH_CARD.getValue(), startMode)) { + // 将卡状态改为启动锁定 + PileAuthCard pileAuthCard = PileAuthCard.builder() + .id(pileAuthCardInfo.getId()) + .logicCard(pileAuthCardInfo.getLogicCard()) + .status("2") + .build(); + pileAuthCardService.updatePileAuthCard(pileAuthCard); + } else if (StringUtils.equals(StartModeEnum.VIN_CODE.getValue(), startMode)) { + // 将vin码改成启动锁定 + CarVinInfo carVinInfo = new CarVinInfo(); + carVinInfo.setId(Long.parseLong(carVinInfoVO.getId())); + carVinInfo.setVinCode(carVinInfoVO.getVinCode()); + carVinInfo.setStatus("2"); + carVinInfoService.updateCarVinInfo(carVinInfo); + } // 组装结果集 Map resultMap = Maps.newHashMap(); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/CarVinInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/CarVinInfoVO.java new file mode 100644 index 000000000..786d6acf3 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/CarVinInfoVO.java @@ -0,0 +1,37 @@ +package com.jsowell.pile.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 车辆vin基本信息VO + * + * @author JS-ZZA + * @date 2023/6/7 10:14 + */ +@Data +public class CarVinInfoVO { + private String id; + + // 车辆vin码 + private String vinCode; + + // 状态 + private String status; + + // 会员id + private String memberId; + + // 手机号码 + private String phoneNumber; + + // 本金余额 + private BigDecimal principalBalance; + + // 赠送余额 + private BigDecimal giftBalance; + + // 账户总余额 + private BigDecimal accountBalance; +} diff --git a/jsowell-pile/src/main/resources/mapper/pile/CarVinInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/CarVinInfoMapper.xml new file mode 100644 index 000000000..a591c3ae8 --- /dev/null +++ b/jsowell-pile/src/main/resources/mapper/pile/CarVinInfoMapper.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + select id, vin_code, status, member_id, create_by, create_time, update_by, update_time, del_flag from car_vin_info + + + + id, vin_code, status, member_id, create_by, create_time, update_by, update_time, del_flag + + + + + + + + insert into car_vin_info + + vin_code, + status, + member_id, + create_by, + create_time, + update_by, + update_time, + del_flag, + + + #{vinCode}, + #{status}, + #{memberId}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{delFlag}, + + + + + update car_vin_info + + vin_code = #{vinCode}, + status = #{status}, + member_id = #{memberId}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from car_vin_info where id = #{id} + + + + delete from car_vin_info where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml index 76c976551..e0f149be4 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml @@ -14,6 +14,7 @@ + @@ -94,6 +95,7 @@ connector_code, pile_connector_code, logic_card, + vin_code, start_mode, pay_mode, pay_status,