提交代码

dev-discount
胡锐 2 years ago
parent c17032720e
commit c539ecd7ef
  1. 44
      hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapper.java
  2. 112
      hai-service/src/main/java/com/hai/dao/HighDiscountUserRelSqlProvider.java
  3. 129
      hai-service/src/main/java/com/hai/entity/HighDiscountUserRel.java
  4. 501
      hai-service/src/main/java/com/hai/entity/HighDiscountUserRelExample.java
  5. 14
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  6. 19
      hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java
  7. 2
      hai-user/src/main/java/com/web/controller/DiscountController.java
  8. 2
      hai-user/src/main/java/com/web/controller/TestController.java
  9. 10
      hai-user/src/main/java/com/web/controller/UserController.java

@ -39,12 +39,20 @@ public interface HighDiscountUserRelMapper extends HighDiscountUserRelMapperExt
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
@Insert({ @Insert({
"insert into high_discount_user_rel (discount_id, agent_id, ", "insert into high_discount_user_rel (discount_company_id, discount_id, ",
"discount_name, discount_img, ",
"discount_using_range, discount_use_scope, ",
"discount_type, discount_condition, ",
"discount_price, agent_id, ",
"discount_agent_code_id, user_id, ", "discount_agent_code_id, user_id, ",
"`status`, use_time, ", "`status`, use_time, ",
"create_time, use_end_time, ", "create_time, use_end_time, ",
"ext_1, ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{discountId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ", "values (#{discountCompanyId,jdbcType=BIGINT}, #{discountId,jdbcType=BIGINT}, ",
"#{discountName,jdbcType=VARCHAR}, #{discountImg,jdbcType=VARCHAR}, ",
"#{discountUsingRange,jdbcType=INTEGER}, #{discountUseScope,jdbcType=INTEGER}, ",
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ",
"#{discountPrice,jdbcType=DECIMAL}, #{agentId,jdbcType=BIGINT}, ",
"#{discountAgentCodeId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ", "#{discountAgentCodeId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ",
"#{status,jdbcType=INTEGER}, #{useTime,jdbcType=TIMESTAMP}, ", "#{status,jdbcType=INTEGER}, #{useTime,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{useEndTime,jdbcType=TIMESTAMP}, ", "#{createTime,jdbcType=TIMESTAMP}, #{useEndTime,jdbcType=TIMESTAMP}, ",
@ -60,7 +68,15 @@ public interface HighDiscountUserRelMapper extends HighDiscountUserRelMapperExt
@SelectProvider(type=HighDiscountUserRelSqlProvider.class, method="selectByExample") @SelectProvider(type=HighDiscountUserRelSqlProvider.class, method="selectByExample")
@Results({ @Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_company_id", property="discountCompanyId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_img", property="discountImg", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_using_range", property="discountUsingRange", jdbcType=JdbcType.INTEGER),
@Result(column="discount_use_scope", property="discountUseScope", jdbcType=JdbcType.INTEGER),
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_agent_code_id", property="discountAgentCodeId", jdbcType=JdbcType.BIGINT), @Result(column="discount_agent_code_id", property="discountAgentCodeId", jdbcType=JdbcType.BIGINT),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@ -76,14 +92,24 @@ public interface HighDiscountUserRelMapper extends HighDiscountUserRelMapperExt
@Select({ @Select({
"select", "select",
"id, discount_id, agent_id, discount_agent_code_id, user_id, `status`, use_time, ", "id, discount_company_id, discount_id, discount_name, discount_img, discount_using_range, ",
"create_time, use_end_time, ext_1, ext_2, ext_3", "discount_use_scope, discount_type, discount_condition, discount_price, agent_id, ",
"discount_agent_code_id, user_id, `status`, use_time, create_time, use_end_time, ",
"ext_1, ext_2, ext_3",
"from high_discount_user_rel", "from high_discount_user_rel",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@Results({ @Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="discount_company_id", property="discountCompanyId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_img", property="discountImg", jdbcType=JdbcType.VARCHAR),
@Result(column="discount_using_range", property="discountUsingRange", jdbcType=JdbcType.INTEGER),
@Result(column="discount_use_scope", property="discountUseScope", jdbcType=JdbcType.INTEGER),
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="discount_agent_code_id", property="discountAgentCodeId", jdbcType=JdbcType.BIGINT), @Result(column="discount_agent_code_id", property="discountAgentCodeId", jdbcType=JdbcType.BIGINT),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@ -108,7 +134,15 @@ public interface HighDiscountUserRelMapper extends HighDiscountUserRelMapperExt
@Update({ @Update({
"update high_discount_user_rel", "update high_discount_user_rel",
"set discount_id = #{discountId,jdbcType=BIGINT},", "set discount_company_id = #{discountCompanyId,jdbcType=BIGINT},",
"discount_id = #{discountId,jdbcType=BIGINT},",
"discount_name = #{discountName,jdbcType=VARCHAR},",
"discount_img = #{discountImg,jdbcType=VARCHAR},",
"discount_using_range = #{discountUsingRange,jdbcType=INTEGER},",
"discount_use_scope = #{discountUseScope,jdbcType=INTEGER},",
"discount_type = #{discountType,jdbcType=INTEGER},",
"discount_condition = #{discountCondition,jdbcType=DECIMAL},",
"discount_price = #{discountPrice,jdbcType=DECIMAL},",
"agent_id = #{agentId,jdbcType=BIGINT},", "agent_id = #{agentId,jdbcType=BIGINT},",
"discount_agent_code_id = #{discountAgentCodeId,jdbcType=BIGINT},", "discount_agent_code_id = #{discountAgentCodeId,jdbcType=BIGINT},",
"user_id = #{userId,jdbcType=BIGINT},", "user_id = #{userId,jdbcType=BIGINT},",

@ -28,10 +28,42 @@ public class HighDiscountUserRelSqlProvider {
SQL sql = new SQL(); SQL sql = new SQL();
sql.INSERT_INTO("high_discount_user_rel"); sql.INSERT_INTO("high_discount_user_rel");
if (record.getDiscountCompanyId() != null) {
sql.VALUES("discount_company_id", "#{discountCompanyId,jdbcType=BIGINT}");
}
if (record.getDiscountId() != null) { if (record.getDiscountId() != null) {
sql.VALUES("discount_id", "#{discountId,jdbcType=BIGINT}"); sql.VALUES("discount_id", "#{discountId,jdbcType=BIGINT}");
} }
if (record.getDiscountName() != null) {
sql.VALUES("discount_name", "#{discountName,jdbcType=VARCHAR}");
}
if (record.getDiscountImg() != null) {
sql.VALUES("discount_img", "#{discountImg,jdbcType=VARCHAR}");
}
if (record.getDiscountUsingRange() != null) {
sql.VALUES("discount_using_range", "#{discountUsingRange,jdbcType=INTEGER}");
}
if (record.getDiscountUseScope() != null) {
sql.VALUES("discount_use_scope", "#{discountUseScope,jdbcType=INTEGER}");
}
if (record.getDiscountType() != null) {
sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}");
}
if (record.getDiscountCondition() != null) {
sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}");
}
if (record.getDiscountPrice() != null) {
sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}");
}
if (record.getAgentId() != null) { if (record.getAgentId() != null) {
sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}"); sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}");
} }
@ -82,7 +114,15 @@ public class HighDiscountUserRelSqlProvider {
} else { } else {
sql.SELECT("id"); sql.SELECT("id");
} }
sql.SELECT("discount_company_id");
sql.SELECT("discount_id"); sql.SELECT("discount_id");
sql.SELECT("discount_name");
sql.SELECT("discount_img");
sql.SELECT("discount_using_range");
sql.SELECT("discount_use_scope");
sql.SELECT("discount_type");
sql.SELECT("discount_condition");
sql.SELECT("discount_price");
sql.SELECT("agent_id"); sql.SELECT("agent_id");
sql.SELECT("discount_agent_code_id"); sql.SELECT("discount_agent_code_id");
sql.SELECT("user_id"); sql.SELECT("user_id");
@ -114,10 +154,42 @@ public class HighDiscountUserRelSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("id = #{record.id,jdbcType=BIGINT}");
} }
if (record.getDiscountCompanyId() != null) {
sql.SET("discount_company_id = #{record.discountCompanyId,jdbcType=BIGINT}");
}
if (record.getDiscountId() != null) { if (record.getDiscountId() != null) {
sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}");
} }
if (record.getDiscountName() != null) {
sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}");
}
if (record.getDiscountImg() != null) {
sql.SET("discount_img = #{record.discountImg,jdbcType=VARCHAR}");
}
if (record.getDiscountUsingRange() != null) {
sql.SET("discount_using_range = #{record.discountUsingRange,jdbcType=INTEGER}");
}
if (record.getDiscountUseScope() != null) {
sql.SET("discount_use_scope = #{record.discountUseScope,jdbcType=INTEGER}");
}
if (record.getDiscountType() != null) {
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
}
if (record.getDiscountCondition() != null) {
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
}
if (record.getDiscountPrice() != null) {
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
}
if (record.getAgentId() != null) { if (record.getAgentId() != null) {
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
} }
@ -167,7 +239,15 @@ public class HighDiscountUserRelSqlProvider {
sql.UPDATE("high_discount_user_rel"); sql.UPDATE("high_discount_user_rel");
sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("discount_company_id = #{record.discountCompanyId,jdbcType=BIGINT}");
sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}");
sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}");
sql.SET("discount_img = #{record.discountImg,jdbcType=VARCHAR}");
sql.SET("discount_using_range = #{record.discountUsingRange,jdbcType=INTEGER}");
sql.SET("discount_use_scope = #{record.discountUseScope,jdbcType=INTEGER}");
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
sql.SET("discount_agent_code_id = #{record.discountAgentCodeId,jdbcType=BIGINT}"); sql.SET("discount_agent_code_id = #{record.discountAgentCodeId,jdbcType=BIGINT}");
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
@ -188,10 +268,42 @@ public class HighDiscountUserRelSqlProvider {
SQL sql = new SQL(); SQL sql = new SQL();
sql.UPDATE("high_discount_user_rel"); sql.UPDATE("high_discount_user_rel");
if (record.getDiscountCompanyId() != null) {
sql.SET("discount_company_id = #{discountCompanyId,jdbcType=BIGINT}");
}
if (record.getDiscountId() != null) { if (record.getDiscountId() != null) {
sql.SET("discount_id = #{discountId,jdbcType=BIGINT}"); sql.SET("discount_id = #{discountId,jdbcType=BIGINT}");
} }
if (record.getDiscountName() != null) {
sql.SET("discount_name = #{discountName,jdbcType=VARCHAR}");
}
if (record.getDiscountImg() != null) {
sql.SET("discount_img = #{discountImg,jdbcType=VARCHAR}");
}
if (record.getDiscountUsingRange() != null) {
sql.SET("discount_using_range = #{discountUsingRange,jdbcType=INTEGER}");
}
if (record.getDiscountUseScope() != null) {
sql.SET("discount_use_scope = #{discountUseScope,jdbcType=INTEGER}");
}
if (record.getDiscountType() != null) {
sql.SET("discount_type = #{discountType,jdbcType=INTEGER}");
}
if (record.getDiscountCondition() != null) {
sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}");
}
if (record.getDiscountPrice() != null) {
sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}");
}
if (record.getAgentId() != null) { if (record.getAgentId() != null) {
sql.SET("agent_id = #{agentId,jdbcType=BIGINT}"); sql.SET("agent_id = #{agentId,jdbcType=BIGINT}");
} }

@ -3,6 +3,7 @@ package com.hai.entity;
import com.hai.model.HighDiscountUserRelModel; import com.hai.model.HighDiscountUserRelModel;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
@ -20,11 +21,51 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser
*/ */
private Long id; private Long id;
/**
* 优惠券发放公司
*/
private Long discountCompanyId;
/** /**
* 优惠券id * 优惠券id
*/ */
private Long discountId; private Long discountId;
/**
* 优惠券名称
*/
private String discountName;
/**
* 优惠券图片
*/
private String discountImg;
/**
* 使用归属
*/
private Integer discountUsingRange;
/**
* 使用范围 1. 全场 2.卡券 3.话费
*/
private Integer discountUseScope;
/**
* 卡卷类型 1满减 2抵扣 3折扣
*/
private Integer discountType;
/**
* 优惠券条件(满减价格)
*/
private BigDecimal discountCondition;
/**
* 优惠券价格
*/
private BigDecimal discountPrice;
/** /**
* 代理商id * 代理商id
*/ */
@ -76,6 +117,14 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser
this.id = id; this.id = id;
} }
public Long getDiscountCompanyId() {
return discountCompanyId;
}
public void setDiscountCompanyId(Long discountCompanyId) {
this.discountCompanyId = discountCompanyId;
}
public Long getDiscountId() { public Long getDiscountId() {
return discountId; return discountId;
} }
@ -84,6 +133,62 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser
this.discountId = discountId; this.discountId = discountId;
} }
public String getDiscountName() {
return discountName;
}
public void setDiscountName(String discountName) {
this.discountName = discountName;
}
public String getDiscountImg() {
return discountImg;
}
public void setDiscountImg(String discountImg) {
this.discountImg = discountImg;
}
public Integer getDiscountUsingRange() {
return discountUsingRange;
}
public void setDiscountUsingRange(Integer discountUsingRange) {
this.discountUsingRange = discountUsingRange;
}
public Integer getDiscountUseScope() {
return discountUseScope;
}
public void setDiscountUseScope(Integer discountUseScope) {
this.discountUseScope = discountUseScope;
}
public Integer getDiscountType() {
return discountType;
}
public void setDiscountType(Integer discountType) {
this.discountType = discountType;
}
public BigDecimal getDiscountCondition() {
return discountCondition;
}
public void setDiscountCondition(BigDecimal discountCondition) {
this.discountCondition = discountCondition;
}
public BigDecimal getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public Long getAgentId() { public Long getAgentId() {
return agentId; return agentId;
} }
@ -177,7 +282,15 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser
} }
HighDiscountUserRel other = (HighDiscountUserRel) that; HighDiscountUserRel other = (HighDiscountUserRel) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDiscountCompanyId() == null ? other.getDiscountCompanyId() == null : this.getDiscountCompanyId().equals(other.getDiscountCompanyId()))
&& (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId())) && (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId()))
&& (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName()))
&& (this.getDiscountImg() == null ? other.getDiscountImg() == null : this.getDiscountImg().equals(other.getDiscountImg()))
&& (this.getDiscountUsingRange() == null ? other.getDiscountUsingRange() == null : this.getDiscountUsingRange().equals(other.getDiscountUsingRange()))
&& (this.getDiscountUseScope() == null ? other.getDiscountUseScope() == null : this.getDiscountUseScope().equals(other.getDiscountUseScope()))
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType()))
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition()))
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice()))
&& (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId())) && (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId()))
&& (this.getDiscountAgentCodeId() == null ? other.getDiscountAgentCodeId() == null : this.getDiscountAgentCodeId().equals(other.getDiscountAgentCodeId())) && (this.getDiscountAgentCodeId() == null ? other.getDiscountAgentCodeId() == null : this.getDiscountAgentCodeId().equals(other.getDiscountAgentCodeId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
@ -195,7 +308,15 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getDiscountCompanyId() == null) ? 0 : getDiscountCompanyId().hashCode());
result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode()); result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode());
result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode());
result = prime * result + ((getDiscountImg() == null) ? 0 : getDiscountImg().hashCode());
result = prime * result + ((getDiscountUsingRange() == null) ? 0 : getDiscountUsingRange().hashCode());
result = prime * result + ((getDiscountUseScope() == null) ? 0 : getDiscountUseScope().hashCode());
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode());
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode());
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode());
result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode());
result = prime * result + ((getDiscountAgentCodeId() == null) ? 0 : getDiscountAgentCodeId().hashCode()); result = prime * result + ((getDiscountAgentCodeId() == null) ? 0 : getDiscountAgentCodeId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
@ -216,7 +337,15 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser
sb.append(" ["); sb.append(" [");
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", discountCompanyId=").append(discountCompanyId);
sb.append(", discountId=").append(discountId); sb.append(", discountId=").append(discountId);
sb.append(", discountName=").append(discountName);
sb.append(", discountImg=").append(discountImg);
sb.append(", discountUsingRange=").append(discountUsingRange);
sb.append(", discountUseScope=").append(discountUseScope);
sb.append(", discountType=").append(discountType);
sb.append(", discountCondition=").append(discountCondition);
sb.append(", discountPrice=").append(discountPrice);
sb.append(", agentId=").append(agentId); sb.append(", agentId=").append(agentId);
sb.append(", discountAgentCodeId=").append(discountAgentCodeId); sb.append(", discountAgentCodeId=").append(discountAgentCodeId);
sb.append(", userId=").append(userId); sb.append(", userId=").append(userId);

@ -1,5 +1,6 @@
package com.hai.entity; package com.hai.entity;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -185,6 +186,66 @@ public class HighDiscountUserRelExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDiscountCompanyIdIsNull() {
addCriterion("discount_company_id is null");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdIsNotNull() {
addCriterion("discount_company_id is not null");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdEqualTo(Long value) {
addCriterion("discount_company_id =", value, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdNotEqualTo(Long value) {
addCriterion("discount_company_id <>", value, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdGreaterThan(Long value) {
addCriterion("discount_company_id >", value, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("discount_company_id >=", value, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdLessThan(Long value) {
addCriterion("discount_company_id <", value, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("discount_company_id <=", value, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdIn(List<Long> values) {
addCriterion("discount_company_id in", values, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdNotIn(List<Long> values) {
addCriterion("discount_company_id not in", values, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdBetween(Long value1, Long value2) {
addCriterion("discount_company_id between", value1, value2, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("discount_company_id not between", value1, value2, "discountCompanyId");
return (Criteria) this;
}
public Criteria andDiscountIdIsNull() { public Criteria andDiscountIdIsNull() {
addCriterion("discount_id is null"); addCriterion("discount_id is null");
return (Criteria) this; return (Criteria) this;
@ -245,6 +306,446 @@ public class HighDiscountUserRelExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDiscountNameIsNull() {
addCriterion("discount_name is null");
return (Criteria) this;
}
public Criteria andDiscountNameIsNotNull() {
addCriterion("discount_name is not null");
return (Criteria) this;
}
public Criteria andDiscountNameEqualTo(String value) {
addCriterion("discount_name =", value, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameNotEqualTo(String value) {
addCriterion("discount_name <>", value, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameGreaterThan(String value) {
addCriterion("discount_name >", value, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameGreaterThanOrEqualTo(String value) {
addCriterion("discount_name >=", value, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameLessThan(String value) {
addCriterion("discount_name <", value, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameLessThanOrEqualTo(String value) {
addCriterion("discount_name <=", value, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameLike(String value) {
addCriterion("discount_name like", value, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameNotLike(String value) {
addCriterion("discount_name not like", value, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameIn(List<String> values) {
addCriterion("discount_name in", values, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameNotIn(List<String> values) {
addCriterion("discount_name not in", values, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameBetween(String value1, String value2) {
addCriterion("discount_name between", value1, value2, "discountName");
return (Criteria) this;
}
public Criteria andDiscountNameNotBetween(String value1, String value2) {
addCriterion("discount_name not between", value1, value2, "discountName");
return (Criteria) this;
}
public Criteria andDiscountImgIsNull() {
addCriterion("discount_img is null");
return (Criteria) this;
}
public Criteria andDiscountImgIsNotNull() {
addCriterion("discount_img is not null");
return (Criteria) this;
}
public Criteria andDiscountImgEqualTo(String value) {
addCriterion("discount_img =", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgNotEqualTo(String value) {
addCriterion("discount_img <>", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgGreaterThan(String value) {
addCriterion("discount_img >", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgGreaterThanOrEqualTo(String value) {
addCriterion("discount_img >=", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgLessThan(String value) {
addCriterion("discount_img <", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgLessThanOrEqualTo(String value) {
addCriterion("discount_img <=", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgLike(String value) {
addCriterion("discount_img like", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgNotLike(String value) {
addCriterion("discount_img not like", value, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgIn(List<String> values) {
addCriterion("discount_img in", values, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgNotIn(List<String> values) {
addCriterion("discount_img not in", values, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgBetween(String value1, String value2) {
addCriterion("discount_img between", value1, value2, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountImgNotBetween(String value1, String value2) {
addCriterion("discount_img not between", value1, value2, "discountImg");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeIsNull() {
addCriterion("discount_using_range is null");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeIsNotNull() {
addCriterion("discount_using_range is not null");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeEqualTo(Integer value) {
addCriterion("discount_using_range =", value, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeNotEqualTo(Integer value) {
addCriterion("discount_using_range <>", value, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeGreaterThan(Integer value) {
addCriterion("discount_using_range >", value, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeGreaterThanOrEqualTo(Integer value) {
addCriterion("discount_using_range >=", value, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeLessThan(Integer value) {
addCriterion("discount_using_range <", value, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeLessThanOrEqualTo(Integer value) {
addCriterion("discount_using_range <=", value, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeIn(List<Integer> values) {
addCriterion("discount_using_range in", values, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeNotIn(List<Integer> values) {
addCriterion("discount_using_range not in", values, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeBetween(Integer value1, Integer value2) {
addCriterion("discount_using_range between", value1, value2, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUsingRangeNotBetween(Integer value1, Integer value2) {
addCriterion("discount_using_range not between", value1, value2, "discountUsingRange");
return (Criteria) this;
}
public Criteria andDiscountUseScopeIsNull() {
addCriterion("discount_use_scope is null");
return (Criteria) this;
}
public Criteria andDiscountUseScopeIsNotNull() {
addCriterion("discount_use_scope is not null");
return (Criteria) this;
}
public Criteria andDiscountUseScopeEqualTo(Integer value) {
addCriterion("discount_use_scope =", value, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountUseScopeNotEqualTo(Integer value) {
addCriterion("discount_use_scope <>", value, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountUseScopeGreaterThan(Integer value) {
addCriterion("discount_use_scope >", value, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountUseScopeGreaterThanOrEqualTo(Integer value) {
addCriterion("discount_use_scope >=", value, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountUseScopeLessThan(Integer value) {
addCriterion("discount_use_scope <", value, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountUseScopeLessThanOrEqualTo(Integer value) {
addCriterion("discount_use_scope <=", value, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountUseScopeIn(List<Integer> values) {
addCriterion("discount_use_scope in", values, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountUseScopeNotIn(List<Integer> values) {
addCriterion("discount_use_scope not in", values, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountUseScopeBetween(Integer value1, Integer value2) {
addCriterion("discount_use_scope between", value1, value2, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountUseScopeNotBetween(Integer value1, Integer value2) {
addCriterion("discount_use_scope not between", value1, value2, "discountUseScope");
return (Criteria) this;
}
public Criteria andDiscountTypeIsNull() {
addCriterion("discount_type is null");
return (Criteria) this;
}
public Criteria andDiscountTypeIsNotNull() {
addCriterion("discount_type is not null");
return (Criteria) this;
}
public Criteria andDiscountTypeEqualTo(Integer value) {
addCriterion("discount_type =", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeNotEqualTo(Integer value) {
addCriterion("discount_type <>", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeGreaterThan(Integer value) {
addCriterion("discount_type >", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("discount_type >=", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeLessThan(Integer value) {
addCriterion("discount_type <", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeLessThanOrEqualTo(Integer value) {
addCriterion("discount_type <=", value, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeIn(List<Integer> values) {
addCriterion("discount_type in", values, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeNotIn(List<Integer> values) {
addCriterion("discount_type not in", values, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeBetween(Integer value1, Integer value2) {
addCriterion("discount_type between", value1, value2, "discountType");
return (Criteria) this;
}
public Criteria andDiscountTypeNotBetween(Integer value1, Integer value2) {
addCriterion("discount_type not between", value1, value2, "discountType");
return (Criteria) this;
}
public Criteria andDiscountConditionIsNull() {
addCriterion("discount_condition is null");
return (Criteria) this;
}
public Criteria andDiscountConditionIsNotNull() {
addCriterion("discount_condition is not null");
return (Criteria) this;
}
public Criteria andDiscountConditionEqualTo(BigDecimal value) {
addCriterion("discount_condition =", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionNotEqualTo(BigDecimal value) {
addCriterion("discount_condition <>", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionGreaterThan(BigDecimal value) {
addCriterion("discount_condition >", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("discount_condition >=", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionLessThan(BigDecimal value) {
addCriterion("discount_condition <", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionLessThanOrEqualTo(BigDecimal value) {
addCriterion("discount_condition <=", value, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionIn(List<BigDecimal> values) {
addCriterion("discount_condition in", values, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionNotIn(List<BigDecimal> values) {
addCriterion("discount_condition not in", values, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_condition between", value1, value2, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountConditionNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_condition not between", value1, value2, "discountCondition");
return (Criteria) this;
}
public Criteria andDiscountPriceIsNull() {
addCriterion("discount_price is null");
return (Criteria) this;
}
public Criteria andDiscountPriceIsNotNull() {
addCriterion("discount_price is not null");
return (Criteria) this;
}
public Criteria andDiscountPriceEqualTo(BigDecimal value) {
addCriterion("discount_price =", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceNotEqualTo(BigDecimal value) {
addCriterion("discount_price <>", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceGreaterThan(BigDecimal value) {
addCriterion("discount_price >", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("discount_price >=", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceLessThan(BigDecimal value) {
addCriterion("discount_price <", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("discount_price <=", value, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceIn(List<BigDecimal> values) {
addCriterion("discount_price in", values, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceNotIn(List<BigDecimal> values) {
addCriterion("discount_price not in", values, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_price between", value1, value2, "discountPrice");
return (Criteria) this;
}
public Criteria andDiscountPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_price not between", value1, value2, "discountPrice");
return (Criteria) this;
}
public Criteria andAgentIdIsNull() { public Criteria andAgentIdIsNull() {
addCriterion("agent_id is null"); addCriterion("agent_id is null");
return (Criteria) this; return (Criteria) this;

@ -117,7 +117,7 @@ public class OrderServiceImpl implements OrderService {
// 使用优惠券 // 使用优惠券
if (createOrderModel.getMemDiscountId() != null) { if (createOrderModel.getMemDiscountId() != null) {
// 卡优惠券信息 // 卡优惠券信息
discountUserRel = discountUserRelService.getRelById(createOrderModel.getMemId()); discountUserRel = discountUserRelService.getRelById(createOrderModel.getMemDiscountId());
if (discountUserRel == null || discountUserRel.getStatus() != 1) { if (discountUserRel == null || discountUserRel.getStatus() != 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券不可用"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券不可用");
} }
@ -265,8 +265,15 @@ public class OrderServiceImpl implements OrderService {
order.setHighChildOrderList(childOrderList); order.setHighChildOrderList(childOrderList);
/*********** 组装处理子订单 商品业务************/ /*********** 组装处理子订单 商品业务************/
// 计算订单金额
Map<String, Object> calculateOrderPrice = OrderUtil.calculateOrderPrice(order.getHighChildOrderList());
order.setTotalPrice(new BigDecimal(calculateOrderPrice.get("totalPrice").toString()));
order.setPayablePrice(new BigDecimal(calculateOrderPrice.get("payablePrice").toString()));
// 是否使用了优惠券 // 是否使用了优惠券
if (discountUserRel != null) { if (discountUserRel != null) {
order.setMemDiscountId(discountUserRel.getId());
order.setMemDiscountName(discountUserRel.getHighDiscount().getDiscountName()); order.setMemDiscountName(discountUserRel.getHighDiscount().getDiscountName());
// 优惠券使用范围 // 优惠券使用范围
if (discountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type1.getType())) { if (discountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type1.getType())) {
@ -326,13 +333,8 @@ public class OrderServiceImpl implements OrderService {
} }
} }
// 计算订单金额
Map<String, Object> calculateOrderPrice = OrderUtil.calculateOrderPrice(order.getHighChildOrderList());
order.setTotalPrice(new BigDecimal(calculateOrderPrice.get("totalPrice").toString()));
order.setDeductionCouponPrice(order.getDeductionCouponPrice());
order.setDeductionProductPrice(new BigDecimal(calculateOrderPrice.get("deductionPrice").toString())); order.setDeductionProductPrice(new BigDecimal(calculateOrderPrice.get("deductionPrice").toString()));
order.setTotalDeductionPrice(order.getDeductionCouponPrice().add(order.getDeductionProductPrice())); order.setTotalDeductionPrice(order.getDeductionCouponPrice().add(order.getDeductionProductPrice()));
order.setPayablePrice(new BigDecimal(calculateOrderPrice.get("payablePrice").toString()));
order.setPayPrice(order.getPayablePrice()); order.setPayPrice(order.getPayablePrice());
// 积分抵扣 // 积分抵扣

@ -94,7 +94,15 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic
}*/ }*/
HighDiscountUserRel userRel = new HighDiscountUserRel(); HighDiscountUserRel userRel = new HighDiscountUserRel();
userRel.setDiscountCompanyId(discount.getCompanyId());
userRel.setDiscountId(rel.getDiscountId()); userRel.setDiscountId(rel.getDiscountId());
userRel.setDiscountName(discount.getDiscountName());
userRel.setDiscountImg(discount.getDiscountImg());
userRel.setDiscountUseScope(discount.getUseScope());
userRel.setDiscountUsingRange(discount.getUsingRange());
userRel.setDiscountType(discount.getDiscountType());
userRel.setDiscountCondition(discount.getDiscountCondition());
userRel.setDiscountPrice(discount.getDiscountPrice());
userRel.setAgentId(rel.getAgentId()); userRel.setAgentId(rel.getAgentId());
userRel.setUserId(userId); userRel.setUserId(userId);
userRel.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 userRel.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
@ -233,13 +241,12 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
} }
example.setOrderByClause("create_time desc"); if (MapUtils.getInteger(map, "discountUseScope") != null) {
List<HighDiscountUserRel> list = highDiscountUserRelMapper.selectByExample(example); criteria.andDiscountUseScopeEqualTo(MapUtils.getInteger(map, "discountUseScope"));
for (HighDiscountUserRel rel : list) {
rel.setHighDiscount(highDiscountService.getDiscountById(rel.getDiscountId()));
rel.setHighAgent(highAgentService.findByAgentMsgId(rel.getAgentId()));
} }
return list;
example.setOrderByClause("create_time desc");
return highDiscountUserRelMapper.selectByExample(example);
} }
@Override @Override

@ -43,7 +43,7 @@ public class DiscountController {
public ResponseData getUserDiscountList(@RequestParam(name = "status", required = false) Integer status, public ResponseData getUserDiscountList(@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "useScope", required = false) Integer useScope, @RequestParam(name = "useScope", required = false) Integer useScope,
@RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "ppageSizeageNum", required = true) Integer pageSize) { @RequestParam(name = "pageSize", required = true) Integer pageSize) {
try { try {
HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class);

File diff suppressed because one or more lines are too long

@ -108,10 +108,12 @@ public class UserController {
// 贵州汇联通工会卡 // 贵州汇联通工会卡
List<HighUserCard> hltCardList = userCardService.getListByUser(userInfoModel.getHighUser().getId(), UserCardType.type1.getType()); List<HighUserCard> hltCardList = userCardService.getListByUser(userInfoModel.getHighUser().getId(), UserCardType.type1.getType());
if (hltCardList.size() > 0) { if (hltCardList.size() > 0) {
// 查询油卡 // 查询工会卡
JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(oilCardList.get(0).getCardNo()); JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(hltCardList.get(0).getCardNo());
if (StringUtils.isBlank(cardInfo.getString("data"))) { if (cardInfo.getInteger("respCode").equals(0000)) {
map.put("hltCardPrice", cardInfo.getString("data")); // 解密响应参数
JSONObject resolveResponse = HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data"));
map.put("hltCardPrice", resolveResponse.getBigDecimal("balance"));
} }
} }
return ResponseMsgUtil.success(map); return ResponseMsgUtil.success(map);

Loading…
Cancel
Save