mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
去除car_vin_info
This commit is contained in:
@@ -1,99 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 车辆vinDTO
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/6/8 15:02
|
||||
*/
|
||||
@Data
|
||||
public class CarVinDTO {
|
||||
private String vinCode;
|
||||
|
||||
private String memberId;
|
||||
|
||||
private String phoneNumber;
|
||||
|
||||
private String verificationCode;
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
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<CarVinInfo> 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);
|
||||
|
||||
/**
|
||||
* 通过memberId查询绑定的车辆vin列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<CarVinInfoVO> getCarVinListByMemberId(String memberId);
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.CarVinInfo;
|
||||
import com.jsowell.pile.dto.CarVinDTO;
|
||||
import com.jsowell.pile.vo.CarVinInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.AuthCardVO;
|
||||
|
||||
/**
|
||||
* 车辆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<CarVinInfo> 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);
|
||||
|
||||
/**
|
||||
* 通过memberId查询绑定的车辆vin列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<CarVinInfoVO> getCarVinListByMemberId(String memberId);
|
||||
|
||||
/**
|
||||
* 用户绑定车辆vin
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int bindAuthCard(CarVinDTO dto);
|
||||
|
||||
/**
|
||||
* 用户解绑车辆vin信息
|
||||
* @param dto
|
||||
*/
|
||||
int unbindCarVin(CarVinDTO dto);
|
||||
}
|
||||
@@ -1,186 +0,0 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.domain.PileAuthCard;
|
||||
import com.jsowell.pile.dto.CarVinDTO;
|
||||
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||
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;
|
||||
|
||||
@Autowired
|
||||
private IMemberBasicInfoService memberBasicInfoService;
|
||||
|
||||
/**
|
||||
* 查询车辆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<CarVinInfo> 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过memberId查询绑定的车辆vin列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CarVinInfoVO> getCarVinListByMemberId(String memberId) {
|
||||
return carVinInfoMapper.getCarVinListByMemberId(memberId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户绑定车辆vin
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int bindAuthCard(CarVinDTO dto) {
|
||||
// String phoneNumber = dto.getPhoneNumber();
|
||||
// // 判断此用户是否已注册小程序账号
|
||||
// MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMobileNumber(phoneNumber);
|
||||
// if (memberBasicInfo == null) {
|
||||
// throw new BusinessException(ReturnCodeEnum.CODE_USER_IS_NOT_REGISTER);
|
||||
// }
|
||||
// 判断此vin号码是否已被绑定
|
||||
CarVinInfo carVinInfo = carVinInfoMapper.selectVinInfoByVin(dto.getVinCode());
|
||||
if (carVinInfo != null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
|
||||
}
|
||||
carVinInfo = new CarVinInfo();
|
||||
// 绑定操作
|
||||
carVinInfo.setVinCode(dto.getVinCode());
|
||||
carVinInfo.setStatus("1");
|
||||
carVinInfo.setMemberId(dto.getMemberId());
|
||||
carVinInfo.setCreateBy(dto.getMemberId());
|
||||
|
||||
return carVinInfoMapper.insertCarVinInfo(carVinInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户解绑车辆vin信息
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public int unbindCarVin(CarVinDTO dto) {
|
||||
// 根据传过来的vin号查询数据库
|
||||
CarVinInfo carVinInfo = selectVinInfoByVin(dto.getVinCode());
|
||||
if (carVinInfo == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
|
||||
}
|
||||
// 如果memberId对应的上,则进行解绑操作 (将数据库中 del_flag 改为 1)
|
||||
if (!StringUtils.equals(carVinInfo.getMemberId(), dto.getMemberId())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
|
||||
}
|
||||
carVinInfo.setDelFlag("1");
|
||||
return updateCarVinInfo(carVinInfo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user