配置充电停车优惠

This commit is contained in:
Guoqs
2025-02-17 16:15:54 +08:00
parent f7057f925f
commit bf673bc5bf
9 changed files with 252 additions and 106 deletions

View File

@@ -1,6 +1,5 @@
package com.jsowell.pile.domain;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -8,9 +7,12 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import java.time.LocalTime;
import java.util.Date;
/**
* 充电停车优惠表
*/
* 充电停车优惠表
*/
@Data
@Accessors(chain = true)
@SuperBuilder
@@ -19,66 +21,66 @@ import lombok.experimental.SuperBuilder;
@NoArgsConstructor
public class ChargeParkingDiscount {
/**
* 主键
*/
* 主键
*/
private Integer id;
/**
* 站点id
*/
* 站点id
*/
private String stationId;
/**
* 道闸平台id
*/
* 道闸平台id
*/
private Integer parkingPlatformId;
/**
* 条件类型(1-固定电量2-固定时长)
*/
* 条件类型(1-固定电量2-固定时长)
*/
private String conditionType;
private String conditionValue;
/**
* 优惠类型(1-减时间单位分钟; 2-减金额单位元)
*/
* 优惠类型(1-减时间单位分钟; 2-减金额单位元)
*/
private String discountType;
private String discountValue;
/**
* 开始时间
*/
private Date startTime;
* 开始时间
*/
private LocalTime startTime;
/**
* 结束时间
*/
private Date endTime;
* 结束时间
*/
private LocalTime endTime;
/**
* 创建人
*/
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
* 创建时间
*/
private Date createTime;
/**
* 更新人
*/
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
* 更新时间
*/
private Date updateTime;
/**
* 删除标识(0-正常; 1-删除)
*/
* 删除标识(0-正常; 1-删除)
*/
private String delFlag;
}

View File

@@ -1,10 +1,11 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.ChargeParkingDiscount;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ChargeParkingDiscountMapper {
int deleteByPrimaryKey(Integer id);

View File

@@ -1,6 +1,6 @@
package com.jsowell.pile.service.impl;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.ChargeParkingDiscount;
import com.jsowell.pile.mapper.ChargeParkingDiscountMapper;
@@ -52,8 +52,8 @@ public class ChargeParkingDiscountServiceImpl implements ChargeParkingDiscountSe
discountVO.setConditionValue(chargeParkingDiscount.getConditionValue());
discountVO.setDiscountType(chargeParkingDiscount.getDiscountType());
discountVO.setDiscountValue(chargeParkingDiscount.getDiscountValue());
discountVO.setStartTime(DateUtils.formatDateTime(chargeParkingDiscount.getStartTime()));
discountVO.setEndTime(DateUtils.formatDateTime(chargeParkingDiscount.getEndTime()));
discountVO.setStartTime(chargeParkingDiscount.getStartTime());
discountVO.setEndTime(chargeParkingDiscount.getEndTime());
return discountVO;
}
@@ -79,6 +79,11 @@ public class ChargeParkingDiscountServiceImpl implements ChargeParkingDiscountSe
@Override
public int insertOrUpdateSelective(ChargeParkingDiscount record) {
if (record.getId() == null) {
record.setCreateBy(SecurityUtils.getUsername());
} else {
record.setUpdateBy(SecurityUtils.getUsername());
}
return chargeParkingDiscountMapper.insertOrUpdateSelective(record);
}

View File

@@ -2,6 +2,8 @@ package com.jsowell.pile.vo.web;
import lombok.Data;
import java.time.LocalTime;
/**
* 充电停车优惠VO
*/
@@ -37,10 +39,10 @@ public class ChargeParkingDiscountVO {
/**
* 优惠生效时间
*/
private String startTime;
private LocalTime startTime;
/**
* 优惠失效时间
*/
private String endTime;
private LocalTime endTime;
}

View File

@@ -11,8 +11,8 @@
<result column="condition_value" jdbcType="VARCHAR" property="conditionValue" />
<result column="discount_type" jdbcType="VARCHAR" property="discountType" />
<result column="discount_value" jdbcType="VARCHAR" property="discountValue" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="start_time" jdbcType="TIME" property="startTime" />
<result column="end_time" jdbcType="TIME" property="endTime" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
@@ -146,10 +146,10 @@
discount_value = #{discountValue,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
start_time = #{startTime,jdbcType=TIME},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIME},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
@@ -218,14 +218,14 @@
<trim prefix="start_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.startTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.startTime,jdbcType=TIMESTAMP}
when id = #{item.id,jdbcType=INTEGER} then #{item.startTime,jdbcType=TIME}
</if>
</foreach>
</trim>
<trim prefix="end_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.endTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.endTime,jdbcType=TIMESTAMP}
when id = #{item.id,jdbcType=INTEGER} then #{item.endTime,jdbcType=TIME}
</if>
</foreach>
</trim>
@@ -281,7 +281,7 @@
(#{item.stationId,jdbcType=VARCHAR}, #{item.parkingPlatformId,jdbcType=INTEGER},
#{item.conditionType,jdbcType=VARCHAR}, #{item.conditionValue,jdbcType=VARCHAR},
#{item.discountType,jdbcType=VARCHAR}, #{item.discountValue,jdbcType=VARCHAR},
#{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.createBy,jdbcType=VARCHAR},
#{item.startTime,jdbcType=TIME}, #{item.endTime,jdbcType=TIME}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.delFlag,jdbcType=CHAR})
</foreach>
@@ -337,8 +337,8 @@
condition_value = #{conditionValue,jdbcType=VARCHAR},
discount_type = #{discountType,jdbcType=VARCHAR},
discount_value = #{discountValue,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
start_time = #{startTime,jdbcType=TIME},
end_time = #{endTime,jdbcType=TIME},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
@@ -462,10 +462,10 @@
discount_value = #{discountValue,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
start_time = #{startTime,jdbcType=TIME},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIME},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},