新增 车辆绑定优惠券记录表、实体类、Service、controller

This commit is contained in:
Lemon
2024-10-14 15:52:00 +08:00
parent 1acb03f56e
commit 1776075ac2
11 changed files with 544 additions and 2 deletions

View File

@@ -0,0 +1,126 @@
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;
/**
* 车辆绑定优惠券记录对象 car_coupon_record
*
* @author jsowell
* @date 2024-10-14
*/
public class CarCouponRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 订单编号
*/
@Excel(name = "订单编号")
private String orderCode;
/**
* 站点id
*/
@Excel(name = "站点id")
private Long stationId;
/**
* 车牌号码
*/
@Excel(name = "车牌号码")
private String plateNumber;
/**
* 绑定优惠券返回码
*/
@Excel(name = "绑定优惠券返回码")
private String returnCode;
/**
* 返回信息
*/
@Excel(name = "返回信息")
private String returnMsg;
/**
* 删除标识0-否1-是)
*/
private String delFlag;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setStationId(Long stationId) {
this.stationId = stationId;
}
public Long getStationId() {
return stationId;
}
public void setPlateNumber(String plateNumber) {
this.plateNumber = plateNumber;
}
public String getPlateNumber() {
return plateNumber;
}
public void setReturnCode(String returnCode) {
this.returnCode = returnCode;
}
public String getReturnCode() {
return returnCode;
}
public void setReturnMsg(String returnMsg) {
this.returnMsg = returnMsg;
}
public String getReturnMsg() {
return returnMsg;
}
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("orderCode", getOrderCode())
.append("stationId", getStationId())
.append("plateNumber", getPlateNumber())
.append("returnCode", getReturnCode())
.append("returnMsg", getReturnMsg())
.append("createTime", getCreateTime())
.append("delFlag", getDelFlag())
.toString();
}
}

View File

@@ -0,0 +1,63 @@
package com.jsowell.pile.mapper;
import java.util.List;
import com.jsowell.pile.domain.CarCouponRecord;
import org.springframework.stereotype.Repository;
/**
* 车辆绑定优惠券记录Mapper接口
*
* @author jsowell
* @date 2024-10-14
*/
@Repository
public interface CarCouponRecordMapper {
/**
* 查询车辆绑定优惠券记录
*
* @param id 车辆绑定优惠券记录主键
* @return 车辆绑定优惠券记录
*/
public CarCouponRecord selectCarCouponRecordById(Long id);
/**
* 查询车辆绑定优惠券记录列表
*
* @param carCouponRecord 车辆绑定优惠券记录
* @return 车辆绑定优惠券记录集合
*/
public List<CarCouponRecord> selectCarCouponRecordList(CarCouponRecord carCouponRecord);
/**
* 新增车辆绑定优惠券记录
*
* @param carCouponRecord 车辆绑定优惠券记录
* @return 结果
*/
public int insertCarCouponRecord(CarCouponRecord carCouponRecord);
/**
* 修改车辆绑定优惠券记录
*
* @param carCouponRecord 车辆绑定优惠券记录
* @return 结果
*/
public int updateCarCouponRecord(CarCouponRecord carCouponRecord);
/**
* 删除车辆绑定优惠券记录
*
* @param id 车辆绑定优惠券记录主键
* @return 结果
*/
public int deleteCarCouponRecordById(Long id);
/**
* 批量删除车辆绑定优惠券记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteCarCouponRecordByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.CarCouponRecord;
/**
* 车辆绑定优惠券记录Service接口
*
* @author jsowell
* @date 2024-10-14
*/
public interface CarCouponRecordService {
/**
* 查询车辆绑定优惠券记录
*
* @param id 车辆绑定优惠券记录主键
* @return 车辆绑定优惠券记录
*/
public CarCouponRecord selectCarCouponRecordById(Long id);
/**
* 查询车辆绑定优惠券记录列表
*
* @param carCouponRecord 车辆绑定优惠券记录
* @return 车辆绑定优惠券记录集合
*/
public List<CarCouponRecord> selectCarCouponRecordList(CarCouponRecord carCouponRecord);
/**
* 新增车辆绑定优惠券记录
*
* @param carCouponRecord 车辆绑定优惠券记录
* @return 结果
*/
public int insertCarCouponRecord(CarCouponRecord carCouponRecord);
/**
* 修改车辆绑定优惠券记录
*
* @param carCouponRecord 车辆绑定优惠券记录
* @return 结果
*/
public int updateCarCouponRecord(CarCouponRecord carCouponRecord);
/**
* 批量删除车辆绑定优惠券记录
*
* @param ids 需要删除的车辆绑定优惠券记录主键集合
* @return 结果
*/
public int deleteCarCouponRecordByIds(Long[] ids);
/**
* 删除车辆绑定优惠券记录信息
*
* @param id 车辆绑定优惠券记录主键
* @return 结果
*/
public int deleteCarCouponRecordById(Long id);
}

View File

@@ -0,0 +1,89 @@
package com.jsowell.pile.service.impl;
import java.util.List;
import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.service.CarCouponRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jsowell.pile.mapper.CarCouponRecordMapper;
import com.jsowell.pile.domain.CarCouponRecord;
/**
* 车辆绑定优惠券记录Service业务层处理
*
* @author jsowell
* @date 2024-10-14
*/
@Service
public class CarCouponRecordServiceImpl implements CarCouponRecordService {
@Autowired
private CarCouponRecordMapper carCouponRecordMapper;
/**
* 查询车辆绑定优惠券记录
*
* @param id 车辆绑定优惠券记录主键
* @return 车辆绑定优惠券记录
*/
@Override
public CarCouponRecord selectCarCouponRecordById(Long id) {
return carCouponRecordMapper.selectCarCouponRecordById(id);
}
/**
* 查询车辆绑定优惠券记录列表
*
* @param carCouponRecord 车辆绑定优惠券记录
* @return 车辆绑定优惠券记录
*/
@Override
public List<CarCouponRecord> selectCarCouponRecordList(CarCouponRecord carCouponRecord) {
return carCouponRecordMapper.selectCarCouponRecordList(carCouponRecord);
}
/**
* 新增车辆绑定优惠券记录
*
* @param carCouponRecord 车辆绑定优惠券记录
* @return 结果
*/
@Override
public int insertCarCouponRecord(CarCouponRecord carCouponRecord) {
carCouponRecord.setCreateTime(DateUtils.getNowDate());
return carCouponRecordMapper.insertCarCouponRecord(carCouponRecord);
}
/**
* 修改车辆绑定优惠券记录
*
* @param carCouponRecord 车辆绑定优惠券记录
* @return 结果
*/
@Override
public int updateCarCouponRecord(CarCouponRecord carCouponRecord) {
return carCouponRecordMapper.updateCarCouponRecord(carCouponRecord);
}
/**
* 批量删除车辆绑定优惠券记录
*
* @param ids 需要删除的车辆绑定优惠券记录主键
* @return 结果
*/
@Override
public int deleteCarCouponRecordByIds(Long[] ids) {
return carCouponRecordMapper.deleteCarCouponRecordByIds(ids);
}
/**
* 删除车辆绑定优惠券记录信息
*
* @param id 车辆绑定优惠券记录主键
* @return 结果
*/
@Override
public int deleteCarCouponRecordById(Long id) {
return carCouponRecordMapper.deleteCarCouponRecordById(id);
}
}

View File

@@ -4096,9 +4096,14 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
vo.setEndSOC(orderVO.getEndSoc());
vo.setChargeTime(orderVO.getChargingTime());
vo.setChargeDegree(orderVO.getChargingDegree());
vo.setSettleAmount(orderVO.getSettleAmount());
vo.setPayMode(orderVO.getPayMode());
vo.setMemberId(orderVO.getMemberId());
return vo;
}
@Override
public List<OrderBasicInfo> queryOrdersByPileConnectorCodeAndStatus(String pileConnectorCode, String orderStatus, String payStatus) {
return orderBasicInfoMapper.queryOrdersByPileConnectorCodeAndStatus(pileConnectorCode, orderStatus, payStatus);

View File

@@ -978,8 +978,8 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
detailVO.setStartSOC(startSoc);
detailVO.setEndSOC(endSoc);
detailVO.setChargeDegree(realTimeMonitorData.getChargingDegree());
detailVO.setTimeRemaining(realTimeMonitorData.getTimeRemaining());
detailVO.setChargeDegree(realTimeMonitorData.getChargingDegree()); // 充电度数
detailVO.setTimeRemaining(realTimeMonitorData.getTimeRemaining()); // 剩余时长
} else if (StringUtils.equals(PileConnectorDataBaseStatusEnum.FAULT.getValue(), status)) {
// 故障
// 查询故障原因

View File

@@ -175,4 +175,14 @@ public class BusinessOrderDetailInfoVO {
*/
private String createTime;
/**
* 支付方式
*/
private String payMode;
/**
* 会员id
*/
private String memberId;
}

View File

@@ -146,4 +146,9 @@ public class OrderVO {
* 订单创建时间
*/
private String createTime;
/**
* 会员id
*/
private String memberId;
}

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsowell.pile.mapper.CarCouponRecordMapper">
<resultMap type="com.jsowell.pile.domain.CarCouponRecord" id="CarCouponRecordResult">
<result property="id" column="id" />
<result property="orderCode" column="order_code" />
<result property="stationId" column="station_id" />
<result property="plateNumber" column="plate_number" />
<result property="returnCode" column="return_code" />
<result property="returnMsg" column="return_msg" />
<result property="createTime" column="create_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectCarCouponRecordVo">
select id, order_code, station_id, plate_number, return_code, return_msg, create_time, del_flag from car_coupon_record
</sql>
<select id="selectCarCouponRecordList" parameterType="com.jsowell.pile.domain.CarCouponRecord" resultMap="CarCouponRecordResult">
<include refid="selectCarCouponRecordVo"/>
<where>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="stationId != null "> and station_id = #{stationId}</if>
<if test="plateNumber != null and plateNumber != ''"> and plate_number = #{plateNumber}</if>
<if test="returnCode != null and returnCode != ''"> and return_code = #{returnCode}</if>
<if test="returnMsg != null and returnMsg != ''"> and return_msg = #{returnMsg}</if>
</where>
</select>
<select id="selectCarCouponRecordById" parameterType="Long" resultMap="CarCouponRecordResult">
<include refid="selectCarCouponRecordVo"/>
where id = #{id}
</select>
<insert id="insertCarCouponRecord" parameterType="com.jsowell.pile.domain.CarCouponRecord" useGeneratedKeys="true" keyProperty="id">
insert into car_coupon_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null">order_code,</if>
<if test="stationId != null">station_id,</if>
<if test="plateNumber != null">plate_number,</if>
<if test="returnCode != null and returnCode != ''">return_code,</if>
<if test="returnMsg != null">return_msg,</if>
<if test="createTime != null">create_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null">#{orderCode},</if>
<if test="stationId != null">#{stationId},</if>
<if test="plateNumber != null">#{plateNumber},</if>
<if test="returnCode != null and returnCode != ''">#{returnCode},</if>
<if test="returnMsg != null">#{returnMsg},</if>
<if test="createTime != null">#{createTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateCarCouponRecord" parameterType="com.jsowell.pile.domain.CarCouponRecord">
update car_coupon_record
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="stationId != null">station_id = #{stationId},</if>
<if test="plateNumber != null">plate_number = #{plateNumber},</if>
<if test="returnCode != null and returnCode != ''">return_code = #{returnCode},</if>
<if test="returnMsg != null">return_msg = #{returnMsg},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCarCouponRecordById" parameterType="Long">
delete from car_coupon_record where id = #{id}
</delete>
<delete id="deleteCarCouponRecordByIds" parameterType="String">
delete from car_coupon_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -2846,6 +2846,7 @@
t1.order_status AS orderStatus,
t1.station_id AS stationId,
t1.pile_sn AS pileSn,
t1.member_id as memberId,
t1.connector_code AS connectorCode,
t1.pile_connector_code AS pileConnectorCode,
t1.pay_mode AS payMode,