dev-discount
袁野 4 years ago
parent 1c7ceec747
commit 84f9418d4c
  1. 10
      hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java
  2. 1
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  3. 2
      hai-cweb/src/main/resources/dev/application.yml
  4. 17
      hai-service/src/main/java/com/hai/dao/HighCouponMapper.java
  5. 14
      hai-service/src/main/java/com/hai/dao/HighCouponSqlProvider.java
  6. 18
      hai-service/src/main/java/com/hai/entity/HighCoupon.java
  7. 60
      hai-service/src/main/java/com/hai/entity/HighCouponExample.java
  8. 2
      hai-service/src/main/java/com/hai/service/impl/HighCouponHandselServiceImpl.java

@ -113,18 +113,20 @@ public class HighCouponController {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
// SessionObject sessionObject = userCenter.getSessionObject(request);
// HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>();
map.put("userId", userInfoModel.getHighUser().getId());
// map.put("userId", userInfoModel.getHighUser().getId());
map.put("userId", 24);
map.put("status", status);
PageHelper.startPage(pageNum, pageSize);
List<HighUserCouponModel> list = highUserCouponService.getUserCouponList(map);
for (HighUserCouponModel highUserCouponModel : list) {
highUserCouponModel.setHighCouponModel(highCouponService.getCouponById(highUserCouponModel.getCouponId()));
}
return ResponseMsgUtil.success(new PageInfo<>());
return ResponseMsgUtil.success(new PageInfo<>(list));
} catch (Exception e) {
log.error("HighCouponController --> getUserCouponList() error!", e);

@ -210,7 +210,6 @@ public class WechatController {
SessionObject so = new SessionObject(openId, 1 , highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
} catch (Exception e) {

@ -1,5 +1,5 @@
server:
port: 9301
port:
servlet:
context-path: /crest

@ -50,7 +50,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"create_time, update_time, ",
"operator_id, operator_name, ",
"pay_type, ext_1, ext_2, ",
"ext_3, `status`, display_area)",
"ext_3, `status`, display_area, ",
"coupon_source)",
"values (#{companyId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ",
"#{couponKey,jdbcType=VARCHAR}, #{couponName,jdbcType=VARCHAR}, ",
"#{couponPrice,jdbcType=DECIMAL}, #{couponImg,jdbcType=VARCHAR}, ",
@ -62,7 +63,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ",
"#{payType,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{displayArea,jdbcType=INTEGER})"
"#{ext3,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{displayArea,jdbcType=INTEGER}, ",
"#{couponSource,jdbcType=INTEGER})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighCoupon record);
@ -99,7 +101,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="display_area", property="displayArea", jdbcType=JdbcType.INTEGER)
@Result(column="display_area", property="displayArea", jdbcType=JdbcType.INTEGER),
@Result(column="coupon_source", property="couponSource", jdbcType=JdbcType.INTEGER)
})
List<HighCoupon> selectByExample(HighCouponExample example);
@ -109,7 +112,7 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"coupon_carousel_img, coupon_desc, coupon_type, sales_end_time, recycle_day, ",
"limit_number, sales_price, discount_price, sales_count, is_present, create_time, ",
"update_time, operator_id, operator_name, pay_type, ext_1, ext_2, ext_3, `status`, ",
"display_area",
"display_area, coupon_source",
"from high_coupon",
"where id = #{id,jdbcType=BIGINT}"
})
@ -140,7 +143,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="display_area", property="displayArea", jdbcType=JdbcType.INTEGER)
@Result(column="display_area", property="displayArea", jdbcType=JdbcType.INTEGER),
@Result(column="coupon_source", property="couponSource", jdbcType=JdbcType.INTEGER)
})
HighCoupon selectByPrimaryKey(Long id);
@ -180,7 +184,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"display_area = #{displayArea,jdbcType=INTEGER}",
"display_area = #{displayArea,jdbcType=INTEGER},",
"coupon_source = #{couponSource,jdbcType=INTEGER}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(HighCoupon record);

@ -132,6 +132,10 @@ public class HighCouponSqlProvider {
sql.VALUES("display_area", "#{displayArea,jdbcType=INTEGER}");
}
if (record.getCouponSource() != null) {
sql.VALUES("coupon_source", "#{couponSource,jdbcType=INTEGER}");
}
return sql.toString();
}
@ -168,6 +172,7 @@ public class HighCouponSqlProvider {
sql.SELECT("ext_3");
sql.SELECT("`status`");
sql.SELECT("display_area");
sql.SELECT("coupon_source");
sql.FROM("high_coupon");
applyWhere(sql, example, false);
@ -293,6 +298,10 @@ public class HighCouponSqlProvider {
sql.SET("display_area = #{record.displayArea,jdbcType=INTEGER}");
}
if (record.getCouponSource() != null) {
sql.SET("coupon_source = #{record.couponSource,jdbcType=INTEGER}");
}
applyWhere(sql, example, true);
return sql.toString();
}
@ -328,6 +337,7 @@ public class HighCouponSqlProvider {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("display_area = #{record.displayArea,jdbcType=INTEGER}");
sql.SET("coupon_source = #{record.couponSource,jdbcType=INTEGER}");
HighCouponExample example = (HighCouponExample) parameter.get("example");
applyWhere(sql, example, true);
@ -442,6 +452,10 @@ public class HighCouponSqlProvider {
sql.SET("display_area = #{displayArea,jdbcType=INTEGER}");
}
if (record.getCouponSource() != null) {
sql.SET("coupon_source = #{couponSource,jdbcType=INTEGER}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();

@ -140,6 +140,11 @@ public class HighCoupon implements Serializable {
*/
private Integer displayArea;
/**
* 卡券来源1.中石化
*/
private Integer couponSource;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -358,6 +363,14 @@ public class HighCoupon implements Serializable {
this.displayArea = displayArea;
}
public Integer getCouponSource() {
return couponSource;
}
public void setCouponSource(Integer couponSource) {
this.couponSource = couponSource;
}
@Override
public boolean equals(Object that) {
if (this == that) {
@ -396,7 +409,8 @@ public class HighCoupon implements Serializable {
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getDisplayArea() == null ? other.getDisplayArea() == null : this.getDisplayArea().equals(other.getDisplayArea()));
&& (this.getDisplayArea() == null ? other.getDisplayArea() == null : this.getDisplayArea().equals(other.getDisplayArea()))
&& (this.getCouponSource() == null ? other.getCouponSource() == null : this.getCouponSource().equals(other.getCouponSource()));
}
@Override
@ -430,6 +444,7 @@ public class HighCoupon implements Serializable {
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getDisplayArea() == null) ? 0 : getDisplayArea().hashCode());
result = prime * result + ((getCouponSource() == null) ? 0 : getCouponSource().hashCode());
return result;
}
@ -466,6 +481,7 @@ public class HighCoupon implements Serializable {
sb.append(", ext3=").append(ext3);
sb.append(", status=").append(status);
sb.append(", displayArea=").append(displayArea);
sb.append(", couponSource=").append(couponSource);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

@ -1835,6 +1835,66 @@ public class HighCouponExample {
addCriterion("display_area not between", value1, value2, "displayArea");
return (Criteria) this;
}
public Criteria andCouponSourceIsNull() {
addCriterion("coupon_source is null");
return (Criteria) this;
}
public Criteria andCouponSourceIsNotNull() {
addCriterion("coupon_source is not null");
return (Criteria) this;
}
public Criteria andCouponSourceEqualTo(Integer value) {
addCriterion("coupon_source =", value, "couponSource");
return (Criteria) this;
}
public Criteria andCouponSourceNotEqualTo(Integer value) {
addCriterion("coupon_source <>", value, "couponSource");
return (Criteria) this;
}
public Criteria andCouponSourceGreaterThan(Integer value) {
addCriterion("coupon_source >", value, "couponSource");
return (Criteria) this;
}
public Criteria andCouponSourceGreaterThanOrEqualTo(Integer value) {
addCriterion("coupon_source >=", value, "couponSource");
return (Criteria) this;
}
public Criteria andCouponSourceLessThan(Integer value) {
addCriterion("coupon_source <", value, "couponSource");
return (Criteria) this;
}
public Criteria andCouponSourceLessThanOrEqualTo(Integer value) {
addCriterion("coupon_source <=", value, "couponSource");
return (Criteria) this;
}
public Criteria andCouponSourceIn(List<Integer> values) {
addCriterion("coupon_source in", values, "couponSource");
return (Criteria) this;
}
public Criteria andCouponSourceNotIn(List<Integer> values) {
addCriterion("coupon_source not in", values, "couponSource");
return (Criteria) this;
}
public Criteria andCouponSourceBetween(Integer value1, Integer value2) {
addCriterion("coupon_source between", value1, value2, "couponSource");
return (Criteria) this;
}
public Criteria andCouponSourceNotBetween(Integer value1, Integer value2) {
addCriterion("coupon_source not between", value1, value2, "couponSource");
return (Criteria) this;
}
}
/**

@ -63,7 +63,7 @@ public class HighCouponHandselServiceImpl implements HighCouponHandselService {
for (HighCouponHandsel handsel : list) {
model = new HighCouponHandselModel();
BeanUtils.copyProperties(handsel, model);
model.setHighCouponModel(highCouponService.getCouponDetail(handsel.getId()));
model.setHighCouponModel(highCouponService.getCouponDetail(handsel.getHandselCouponId()));
modelList.add(model);
}
return modelList;

Loading…
Cancel
Save