提交代码

pre
胡锐 3 weeks ago
parent 0e136424f0
commit 2c7b4c7bff
  1. 2
      bweb/src/main/java/com/bweb/controller/BsDiscountController.java
  2. 41
      service/src/main/java/com/hfkj/dao/BsDiscountMapper.java
  3. 14
      service/src/main/java/com/hfkj/dao/BsDiscountSqlProvider.java
  4. 35
      service/src/main/java/com/hfkj/dao/BsDiscountUserMapper.java
  5. 14
      service/src/main/java/com/hfkj/dao/BsDiscountUserSqlProvider.java
  6. 16
      service/src/main/java/com/hfkj/entity/BsDiscount.java
  7. 60
      service/src/main/java/com/hfkj/entity/BsDiscountExample.java
  8. 16
      service/src/main/java/com/hfkj/entity/BsDiscountUser.java
  9. 60
      service/src/main/java/com/hfkj/entity/BsDiscountUserExample.java
  10. 5
      service/src/main/java/com/hfkj/model/GasPayPriceModel.java
  11. 13
      service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java

@ -48,6 +48,7 @@ public class BsDiscountController {
if (StringUtils.isBlank(body.getString("discountName")) if (StringUtils.isBlank(body.getString("discountName"))
|| body.getInteger("discountType") == null || body.getInteger("discountType") == null
|| body.getBigDecimal("discountPrice") == null || body.getBigDecimal("discountPrice") == null
|| body.getBoolean("overlayDiscount") == null
|| StringUtils.isBlank(body.getString("useScope")) || StringUtils.isBlank(body.getString("useScope"))
|| body.getInteger("receiveExpirationDate") == null || body.getInteger("receiveExpirationDate") == null
|| body.getLong("endTime") == null || body.getLong("endTime") == null
@ -76,6 +77,7 @@ public class BsDiscountController {
discount.setDiscountType(body.getInteger("discountType")); discount.setDiscountType(body.getInteger("discountType"));
discount.setDiscountName(body.getString("discountName")); discount.setDiscountName(body.getString("discountName"));
discount.setDiscountPrice(body.getBigDecimal("discountPrice")); discount.setDiscountPrice(body.getBigDecimal("discountPrice"));
discount.setOverlayDiscount(body.getBoolean("overlayDiscount"));
discount.setDiscountCondition(body.getBigDecimal("discountCondition")); discount.setDiscountCondition(body.getBigDecimal("discountCondition"));
discount.setUseScope(body.getString("useScope")); discount.setUseScope(body.getString("useScope"));
discount.setReceiveExpirationDate(body.getInteger("receiveExpirationDate")); discount.setReceiveExpirationDate(body.getInteger("receiveExpirationDate"));

@ -41,24 +41,24 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
@Insert({ @Insert({
"insert into bs_discount (discount_no, discount_name, ", "insert into bs_discount (discount_no, discount_name, ",
"discount_type, discount_condition, ", "discount_type, discount_condition, ",
"discount_price, use_scope, ", "discount_price, overlay_discount, ",
"receive_expiration_date, start_time, ", "use_scope, receive_expiration_date, ",
"end_time, reality_end_time, ", "start_time, end_time, ",
"`status`, create_time, ", "reality_end_time, `status`, ",
"create_user_type, create_user_id, ", "create_time, create_user_type, ",
"create_user_name, create_user_mer_no, ", "create_user_id, create_user_name, ",
"update_time, ext_1, ", "create_user_mer_no, update_time, ",
"ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{discountNo,jdbcType=VARCHAR}, #{discountName,jdbcType=VARCHAR}, ", "values (#{discountNo,jdbcType=VARCHAR}, #{discountName,jdbcType=VARCHAR}, ",
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ", "#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ",
"#{discountPrice,jdbcType=DECIMAL}, #{useScope,jdbcType=VARCHAR}, ", "#{discountPrice,jdbcType=DECIMAL}, #{overlayDiscount,jdbcType=BIT}, ",
"#{receiveExpirationDate,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, ", "#{useScope,jdbcType=VARCHAR}, #{receiveExpirationDate,jdbcType=INTEGER}, ",
"#{endTime,jdbcType=TIMESTAMP}, #{realityEndTime,jdbcType=TIMESTAMP}, ", "#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{realityEndTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{createUserType,jdbcType=INTEGER}, #{createUserId,jdbcType=BIGINT}, ", "#{createTime,jdbcType=TIMESTAMP}, #{createUserType,jdbcType=INTEGER}, ",
"#{createUserName,jdbcType=VARCHAR}, #{createUserMerNo,jdbcType=VARCHAR}, ", "#{createUserId,jdbcType=BIGINT}, #{createUserName,jdbcType=VARCHAR}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{createUserMerNo,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsDiscount record); int insert(BsDiscount record);
@ -75,6 +75,7 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), @Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), @Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="overlay_discount", property="overlayDiscount", jdbcType=JdbcType.BIT),
@Result(column="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR), @Result(column="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR),
@Result(column="receive_expiration_date", property="receiveExpirationDate", jdbcType=JdbcType.INTEGER), @Result(column="receive_expiration_date", property="receiveExpirationDate", jdbcType=JdbcType.INTEGER),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@ -96,9 +97,9 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
@Select({ @Select({
"select", "select",
"id, discount_no, discount_name, discount_type, discount_condition, discount_price, ", "id, discount_no, discount_name, discount_type, discount_condition, discount_price, ",
"use_scope, receive_expiration_date, start_time, end_time, reality_end_time, ", "overlay_discount, use_scope, receive_expiration_date, start_time, end_time, ",
"`status`, create_time, create_user_type, create_user_id, create_user_name, create_user_mer_no, ", "reality_end_time, `status`, create_time, create_user_type, create_user_id, create_user_name, ",
"update_time, ext_1, ext_2, ext_3", "create_user_mer_no, update_time, ext_1, ext_2, ext_3",
"from bs_discount", "from bs_discount",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -109,6 +110,7 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), @Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), @Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="overlay_discount", property="overlayDiscount", jdbcType=JdbcType.BIT),
@Result(column="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR), @Result(column="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR),
@Result(column="receive_expiration_date", property="receiveExpirationDate", jdbcType=JdbcType.INTEGER), @Result(column="receive_expiration_date", property="receiveExpirationDate", jdbcType=JdbcType.INTEGER),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@ -143,6 +145,7 @@ public interface BsDiscountMapper extends BsDiscountMapperExt {
"discount_type = #{discountType,jdbcType=INTEGER},", "discount_type = #{discountType,jdbcType=INTEGER},",
"discount_condition = #{discountCondition,jdbcType=DECIMAL},", "discount_condition = #{discountCondition,jdbcType=DECIMAL},",
"discount_price = #{discountPrice,jdbcType=DECIMAL},", "discount_price = #{discountPrice,jdbcType=DECIMAL},",
"overlay_discount = #{overlayDiscount,jdbcType=BIT},",
"use_scope = #{useScope,jdbcType=VARCHAR},", "use_scope = #{useScope,jdbcType=VARCHAR},",
"receive_expiration_date = #{receiveExpirationDate,jdbcType=INTEGER},", "receive_expiration_date = #{receiveExpirationDate,jdbcType=INTEGER},",
"start_time = #{startTime,jdbcType=TIMESTAMP},", "start_time = #{startTime,jdbcType=TIMESTAMP},",

@ -48,6 +48,10 @@ public class BsDiscountSqlProvider {
sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}"); sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}");
} }
if (record.getOverlayDiscount() != null) {
sql.VALUES("overlay_discount", "#{overlayDiscount,jdbcType=BIT}");
}
if (record.getUseScope() != null) { if (record.getUseScope() != null) {
sql.VALUES("use_scope", "#{useScope,jdbcType=VARCHAR}"); sql.VALUES("use_scope", "#{useScope,jdbcType=VARCHAR}");
} }
@ -123,6 +127,7 @@ public class BsDiscountSqlProvider {
sql.SELECT("discount_type"); sql.SELECT("discount_type");
sql.SELECT("discount_condition"); sql.SELECT("discount_condition");
sql.SELECT("discount_price"); sql.SELECT("discount_price");
sql.SELECT("overlay_discount");
sql.SELECT("use_scope"); sql.SELECT("use_scope");
sql.SELECT("receive_expiration_date"); sql.SELECT("receive_expiration_date");
sql.SELECT("start_time"); sql.SELECT("start_time");
@ -179,6 +184,10 @@ public class BsDiscountSqlProvider {
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
} }
if (record.getOverlayDiscount() != null) {
sql.SET("overlay_discount = #{record.overlayDiscount,jdbcType=BIT}");
}
if (record.getUseScope() != null) { if (record.getUseScope() != null) {
sql.SET("use_scope = #{record.useScope,jdbcType=VARCHAR}"); sql.SET("use_scope = #{record.useScope,jdbcType=VARCHAR}");
} }
@ -253,6 +262,7 @@ public class BsDiscountSqlProvider {
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
sql.SET("overlay_discount = #{record.overlayDiscount,jdbcType=BIT}");
sql.SET("use_scope = #{record.useScope,jdbcType=VARCHAR}"); sql.SET("use_scope = #{record.useScope,jdbcType=VARCHAR}");
sql.SET("receive_expiration_date = #{record.receiveExpirationDate,jdbcType=INTEGER}"); sql.SET("receive_expiration_date = #{record.receiveExpirationDate,jdbcType=INTEGER}");
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}");
@ -298,6 +308,10 @@ public class BsDiscountSqlProvider {
sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}"); sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}");
} }
if (record.getOverlayDiscount() != null) {
sql.SET("overlay_discount = #{overlayDiscount,jdbcType=BIT}");
}
if (record.getUseScope() != null) { if (record.getUseScope() != null) {
sql.SET("use_scope = #{useScope,jdbcType=VARCHAR}"); sql.SET("use_scope = #{useScope,jdbcType=VARCHAR}");
} }

@ -42,21 +42,23 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
"insert into bs_discount_user (user_id, user_phone, ", "insert into bs_discount_user (user_id, user_phone, ",
"discount_id, discount_no, ", "discount_id, discount_no, ",
"discount_name, discount_type, ", "discount_name, discount_type, ",
"discount_condition, discount_price, ", "overlay_discount, discount_condition, ",
"discount_stock_code, use_scope, ", "discount_price, discount_stock_code, ",
"use_date, expiration_date, ", "use_scope, use_date, ",
"agent_appid, `status`, ", "expiration_date, agent_appid, ",
"create_time, update_time, ", "`status`, create_time, ",
"ext_1, ext_2, ext_3)", "update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ", "values (#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ",
"#{discountId,jdbcType=BIGINT}, #{discountNo,jdbcType=VARCHAR}, ", "#{discountId,jdbcType=BIGINT}, #{discountNo,jdbcType=VARCHAR}, ",
"#{discountName,jdbcType=VARCHAR}, #{discountType,jdbcType=INTEGER}, ", "#{discountName,jdbcType=VARCHAR}, #{discountType,jdbcType=INTEGER}, ",
"#{discountCondition,jdbcType=DECIMAL}, #{discountPrice,jdbcType=DECIMAL}, ", "#{overlayDiscount,jdbcType=BIT}, #{discountCondition,jdbcType=DECIMAL}, ",
"#{discountStockCode,jdbcType=BIGINT}, #{useScope,jdbcType=VARCHAR}, ", "#{discountPrice,jdbcType=DECIMAL}, #{discountStockCode,jdbcType=BIGINT}, ",
"#{useDate,jdbcType=TIMESTAMP}, #{expirationDate,jdbcType=TIMESTAMP}, ", "#{useScope,jdbcType=VARCHAR}, #{useDate,jdbcType=TIMESTAMP}, ",
"#{agentAppid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{expirationDate,jdbcType=TIMESTAMP}, #{agentAppid,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsDiscountUser record); int insert(BsDiscountUser record);
@ -74,6 +76,7 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
@Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR), @Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), @Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="overlay_discount", property="overlayDiscount", jdbcType=JdbcType.BIT),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), @Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_stock_code", property="discountStockCode", jdbcType=JdbcType.BIGINT), @Result(column="discount_stock_code", property="discountStockCode", jdbcType=JdbcType.BIGINT),
@ -93,9 +96,9 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
@Select({ @Select({
"select", "select",
"id, user_id, user_phone, discount_id, discount_no, discount_name, discount_type, ", "id, user_id, user_phone, discount_id, discount_no, discount_name, discount_type, ",
"discount_condition, discount_price, discount_stock_code, use_scope, use_date, ", "overlay_discount, discount_condition, discount_price, discount_stock_code, use_scope, ",
"expiration_date, agent_appid, `status`, create_time, update_time, ext_1, ext_2, ", "use_date, expiration_date, agent_appid, `status`, create_time, update_time, ",
"ext_3", "ext_1, ext_2, ext_3",
"from bs_discount_user", "from bs_discount_user",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -107,6 +110,7 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
@Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR), @Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), @Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="overlay_discount", property="overlayDiscount", jdbcType=JdbcType.BIT),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), @Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_stock_code", property="discountStockCode", jdbcType=JdbcType.BIGINT), @Result(column="discount_stock_code", property="discountStockCode", jdbcType=JdbcType.BIGINT),
@ -140,6 +144,7 @@ public interface BsDiscountUserMapper extends BsDiscountUserMapperExt {
"discount_no = #{discountNo,jdbcType=VARCHAR},", "discount_no = #{discountNo,jdbcType=VARCHAR},",
"discount_name = #{discountName,jdbcType=VARCHAR},", "discount_name = #{discountName,jdbcType=VARCHAR},",
"discount_type = #{discountType,jdbcType=INTEGER},", "discount_type = #{discountType,jdbcType=INTEGER},",
"overlay_discount = #{overlayDiscount,jdbcType=BIT},",
"discount_condition = #{discountCondition,jdbcType=DECIMAL},", "discount_condition = #{discountCondition,jdbcType=DECIMAL},",
"discount_price = #{discountPrice,jdbcType=DECIMAL},", "discount_price = #{discountPrice,jdbcType=DECIMAL},",
"discount_stock_code = #{discountStockCode,jdbcType=BIGINT},", "discount_stock_code = #{discountStockCode,jdbcType=BIGINT},",

@ -52,6 +52,10 @@ public class BsDiscountUserSqlProvider {
sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}"); sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}");
} }
if (record.getOverlayDiscount() != null) {
sql.VALUES("overlay_discount", "#{overlayDiscount,jdbcType=BIT}");
}
if (record.getDiscountCondition() != null) { if (record.getDiscountCondition() != null) {
sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}"); sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}");
} }
@ -120,6 +124,7 @@ public class BsDiscountUserSqlProvider {
sql.SELECT("discount_no"); sql.SELECT("discount_no");
sql.SELECT("discount_name"); sql.SELECT("discount_name");
sql.SELECT("discount_type"); sql.SELECT("discount_type");
sql.SELECT("overlay_discount");
sql.SELECT("discount_condition"); sql.SELECT("discount_condition");
sql.SELECT("discount_price"); sql.SELECT("discount_price");
sql.SELECT("discount_stock_code"); sql.SELECT("discount_stock_code");
@ -178,6 +183,10 @@ public class BsDiscountUserSqlProvider {
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
} }
if (record.getOverlayDiscount() != null) {
sql.SET("overlay_discount = #{record.overlayDiscount,jdbcType=BIT}");
}
if (record.getDiscountCondition() != null) { if (record.getDiscountCondition() != null) {
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
} }
@ -245,6 +254,7 @@ public class BsDiscountUserSqlProvider {
sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}"); sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}");
sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}");
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
sql.SET("overlay_discount = #{record.overlayDiscount,jdbcType=BIT}");
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
sql.SET("discount_stock_code = #{record.discountStockCode,jdbcType=BIGINT}"); sql.SET("discount_stock_code = #{record.discountStockCode,jdbcType=BIGINT}");
@ -292,6 +302,10 @@ public class BsDiscountUserSqlProvider {
sql.SET("discount_type = #{discountType,jdbcType=INTEGER}"); sql.SET("discount_type = #{discountType,jdbcType=INTEGER}");
} }
if (record.getOverlayDiscount() != null) {
sql.SET("overlay_discount = #{overlayDiscount,jdbcType=BIT}");
}
if (record.getDiscountCondition() != null) { if (record.getDiscountCondition() != null) {
sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}"); sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}");
} }

@ -44,6 +44,11 @@ public class BsDiscount implements Serializable {
*/ */
private BigDecimal discountPrice; private BigDecimal discountPrice;
/**
* 叠加优惠
*/
private Boolean overlayDiscount;
/** /**
* 使用范围支持多选 1加油 2商城 * 使用范围支持多选 1加油 2商城
*/ */
@ -160,6 +165,14 @@ public class BsDiscount implements Serializable {
this.discountPrice = discountPrice; this.discountPrice = discountPrice;
} }
public Boolean getOverlayDiscount() {
return overlayDiscount;
}
public void setOverlayDiscount(Boolean overlayDiscount) {
this.overlayDiscount = overlayDiscount;
}
public String getUseScope() { public String getUseScope() {
return useScope; return useScope;
} }
@ -298,6 +311,7 @@ public class BsDiscount implements Serializable {
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType())) && (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType()))
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition())) && (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition()))
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice())) && (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice()))
&& (this.getOverlayDiscount() == null ? other.getOverlayDiscount() == null : this.getOverlayDiscount().equals(other.getOverlayDiscount()))
&& (this.getUseScope() == null ? other.getUseScope() == null : this.getUseScope().equals(other.getUseScope())) && (this.getUseScope() == null ? other.getUseScope() == null : this.getUseScope().equals(other.getUseScope()))
&& (this.getReceiveExpirationDate() == null ? other.getReceiveExpirationDate() == null : this.getReceiveExpirationDate().equals(other.getReceiveExpirationDate())) && (this.getReceiveExpirationDate() == null ? other.getReceiveExpirationDate() == null : this.getReceiveExpirationDate().equals(other.getReceiveExpirationDate()))
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
@ -325,6 +339,7 @@ public class BsDiscount implements Serializable {
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode()); result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode());
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode()); result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode());
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode()); result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode());
result = prime * result + ((getOverlayDiscount() == null) ? 0 : getOverlayDiscount().hashCode());
result = prime * result + ((getUseScope() == null) ? 0 : getUseScope().hashCode()); result = prime * result + ((getUseScope() == null) ? 0 : getUseScope().hashCode());
result = prime * result + ((getReceiveExpirationDate() == null) ? 0 : getReceiveExpirationDate().hashCode()); result = prime * result + ((getReceiveExpirationDate() == null) ? 0 : getReceiveExpirationDate().hashCode());
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
@ -355,6 +370,7 @@ public class BsDiscount implements Serializable {
sb.append(", discountType=").append(discountType); sb.append(", discountType=").append(discountType);
sb.append(", discountCondition=").append(discountCondition); sb.append(", discountCondition=").append(discountCondition);
sb.append(", discountPrice=").append(discountPrice); sb.append(", discountPrice=").append(discountPrice);
sb.append(", overlayDiscount=").append(overlayDiscount);
sb.append(", useScope=").append(useScope); sb.append(", useScope=").append(useScope);
sb.append(", receiveExpirationDate=").append(receiveExpirationDate); sb.append(", receiveExpirationDate=").append(receiveExpirationDate);
sb.append(", startTime=").append(startTime); sb.append(", startTime=").append(startTime);

@ -506,6 +506,66 @@ public class BsDiscountExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOverlayDiscountIsNull() {
addCriterion("overlay_discount is null");
return (Criteria) this;
}
public Criteria andOverlayDiscountIsNotNull() {
addCriterion("overlay_discount is not null");
return (Criteria) this;
}
public Criteria andOverlayDiscountEqualTo(Boolean value) {
addCriterion("overlay_discount =", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountNotEqualTo(Boolean value) {
addCriterion("overlay_discount <>", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountGreaterThan(Boolean value) {
addCriterion("overlay_discount >", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountGreaterThanOrEqualTo(Boolean value) {
addCriterion("overlay_discount >=", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountLessThan(Boolean value) {
addCriterion("overlay_discount <", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountLessThanOrEqualTo(Boolean value) {
addCriterion("overlay_discount <=", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountIn(List<Boolean> values) {
addCriterion("overlay_discount in", values, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountNotIn(List<Boolean> values) {
addCriterion("overlay_discount not in", values, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountBetween(Boolean value1, Boolean value2) {
addCriterion("overlay_discount between", value1, value2, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountNotBetween(Boolean value1, Boolean value2) {
addCriterion("overlay_discount not between", value1, value2, "overlayDiscount");
return (Criteria) this;
}
public Criteria andUseScopeIsNull() { public Criteria andUseScopeIsNull() {
addCriterion("use_scope is null"); addCriterion("use_scope is null");
return (Criteria) this; return (Criteria) this;

@ -49,6 +49,11 @@ public class BsDiscountUser implements Serializable {
*/ */
private Integer discountType; private Integer discountType;
/**
* 叠加优惠
*/
private Boolean overlayDiscount;
/** /**
* 优惠券条件(满减价格) * 优惠券条件(满减价格)
*/ */
@ -163,6 +168,14 @@ public class BsDiscountUser implements Serializable {
this.discountType = discountType; this.discountType = discountType;
} }
public Boolean getOverlayDiscount() {
return overlayDiscount;
}
public void setOverlayDiscount(Boolean overlayDiscount) {
this.overlayDiscount = overlayDiscount;
}
public BigDecimal getDiscountCondition() { public BigDecimal getDiscountCondition() {
return discountCondition; return discountCondition;
} }
@ -286,6 +299,7 @@ public class BsDiscountUser implements Serializable {
&& (this.getDiscountNo() == null ? other.getDiscountNo() == null : this.getDiscountNo().equals(other.getDiscountNo())) && (this.getDiscountNo() == null ? other.getDiscountNo() == null : this.getDiscountNo().equals(other.getDiscountNo()))
&& (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName())) && (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName()))
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType())) && (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType()))
&& (this.getOverlayDiscount() == null ? other.getOverlayDiscount() == null : this.getOverlayDiscount().equals(other.getOverlayDiscount()))
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition())) && (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition()))
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice())) && (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice()))
&& (this.getDiscountStockCode() == null ? other.getDiscountStockCode() == null : this.getDiscountStockCode().equals(other.getDiscountStockCode())) && (this.getDiscountStockCode() == null ? other.getDiscountStockCode() == null : this.getDiscountStockCode().equals(other.getDiscountStockCode()))
@ -312,6 +326,7 @@ public class BsDiscountUser implements Serializable {
result = prime * result + ((getDiscountNo() == null) ? 0 : getDiscountNo().hashCode()); result = prime * result + ((getDiscountNo() == null) ? 0 : getDiscountNo().hashCode());
result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode()); result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode());
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode()); result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode());
result = prime * result + ((getOverlayDiscount() == null) ? 0 : getOverlayDiscount().hashCode());
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode()); result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode());
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode()); result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode());
result = prime * result + ((getDiscountStockCode() == null) ? 0 : getDiscountStockCode().hashCode()); result = prime * result + ((getDiscountStockCode() == null) ? 0 : getDiscountStockCode().hashCode());
@ -341,6 +356,7 @@ public class BsDiscountUser implements Serializable {
sb.append(", discountNo=").append(discountNo); sb.append(", discountNo=").append(discountNo);
sb.append(", discountName=").append(discountName); sb.append(", discountName=").append(discountName);
sb.append(", discountType=").append(discountType); sb.append(", discountType=").append(discountType);
sb.append(", overlayDiscount=").append(overlayDiscount);
sb.append(", discountCondition=").append(discountCondition); sb.append(", discountCondition=").append(discountCondition);
sb.append(", discountPrice=").append(discountPrice); sb.append(", discountPrice=").append(discountPrice);
sb.append(", discountStockCode=").append(discountStockCode); sb.append(", discountStockCode=").append(discountStockCode);

@ -576,6 +576,66 @@ public class BsDiscountUserExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOverlayDiscountIsNull() {
addCriterion("overlay_discount is null");
return (Criteria) this;
}
public Criteria andOverlayDiscountIsNotNull() {
addCriterion("overlay_discount is not null");
return (Criteria) this;
}
public Criteria andOverlayDiscountEqualTo(Boolean value) {
addCriterion("overlay_discount =", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountNotEqualTo(Boolean value) {
addCriterion("overlay_discount <>", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountGreaterThan(Boolean value) {
addCriterion("overlay_discount >", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountGreaterThanOrEqualTo(Boolean value) {
addCriterion("overlay_discount >=", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountLessThan(Boolean value) {
addCriterion("overlay_discount <", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountLessThanOrEqualTo(Boolean value) {
addCriterion("overlay_discount <=", value, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountIn(List<Boolean> values) {
addCriterion("overlay_discount in", values, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountNotIn(List<Boolean> values) {
addCriterion("overlay_discount not in", values, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountBetween(Boolean value1, Boolean value2) {
addCriterion("overlay_discount between", value1, value2, "overlayDiscount");
return (Criteria) this;
}
public Criteria andOverlayDiscountNotBetween(Boolean value1, Boolean value2) {
addCriterion("overlay_discount not between", value1, value2, "overlayDiscount");
return (Criteria) this;
}
public Criteria andDiscountConditionIsNull() { public Criteria andDiscountConditionIsNull() {
addCriterion("discount_condition is null"); addCriterion("discount_condition is null");
return (Criteria) this; return (Criteria) this;

@ -63,6 +63,11 @@ public class GasPayPriceModel {
*/ */
private BigDecimal discount; private BigDecimal discount;
/**
* 是否叠加优惠
*/
private Boolean overlayDiscount;
/** /**
* 每升优惠 * 每升优惠
*/ */

@ -70,7 +70,7 @@ public class BsGasServiceImpl implements BsGasService {
if (merchant == null) { if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站");
} }
BsDiscountUser discountUser = null;
GasPayPriceModel payPriceModel = new GasPayPriceModel(); GasPayPriceModel payPriceModel = new GasPayPriceModel();
payPriceModel.setDeductionCouponPrice(new BigDecimal("0")); payPriceModel.setDeductionCouponPrice(new BigDecimal("0"));
@ -97,7 +97,7 @@ public class BsGasServiceImpl implements BsGasService {
} }
} else { } else {
// 查询用户优惠券 // 查询用户优惠券
BsDiscountUser discountUser = discountUserService.getDetail(userDiscountId); discountUser = discountUserService.getDetail(userDiscountId);
if (discountUser == null) { if (discountUser == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户优惠券"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户优惠券");
} }
@ -112,6 +112,7 @@ public class BsGasServiceImpl implements BsGasService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未达到满减金额,无法使用此优惠券"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未达到满减金额,无法使用此优惠券");
} }
payPriceModel.setDeductionCouponPrice(discountUser.getDiscountPrice()); payPriceModel.setDeductionCouponPrice(discountUser.getDiscountPrice());
} else if (DiscountTypeEnum.type2.getCode().equals(discountUser.getDiscountType())) { } else if (DiscountTypeEnum.type2.getCode().equals(discountUser.getDiscountType())) {
payPriceModel.setDeductionCouponPrice(discountUser.getDiscountPrice()); payPriceModel.setDeductionCouponPrice(discountUser.getDiscountPrice());
@ -121,7 +122,7 @@ public class BsGasServiceImpl implements BsGasService {
refuelPrice.multiply(discountUser.getDiscountPrice().divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_DOWN) refuelPrice.multiply(discountUser.getDiscountPrice().divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_DOWN)
)); ));
} else { } else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券类型");
} }
} }
@ -139,7 +140,11 @@ public class BsGasServiceImpl implements BsGasService {
// 油站直降 // 油站直降
BigDecimal gasStationDrop = gasOilPrice.getGasStationDrop(); BigDecimal gasStationDrop = gasOilPrice.getGasStationDrop();
// 油站优惠价 // 油站优惠价
BigDecimal priceVip = userDiscountId==null?gasOilPrice.getPriceVip():priceGun; BigDecimal priceVip = gasOilPrice.getPriceVip();
if (discountUser != null && !discountUser.getOverlayDiscount()) {
// 优惠券与油价不叠加
priceVip = priceGun;
}
// 嗨森逛平台价 油站优惠价 * 折扣 // 嗨森逛平台价 油站优惠价 * 折扣
BigDecimal pricePlatform = priceVip.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP); BigDecimal pricePlatform = priceVip.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);

Loading…
Cancel
Save