Просмотр исходного кода

[专题][添加][添加专题功能]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
4ca540c776
7 измененных файлов: 68 добавлений и 13 удалений
  1. +0
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/WxTopicController.java
  2. +22
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCouponTopic.java
  3. +3
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxTopic.java
  4. +2
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCouponTopicMapper.java
  5. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java
  6. +37
    -3
      mallinkService/src/main/resources/mapper/WxCouponTopicMapper.xml
  7. +3
    -4
      mallinkService/src/main/resources/mapper/WxTopicMapper.xml

+ 0
- 1
mallinkAdmin/src/main/java/com/iformall/controller/WxTopicController.java Просмотреть файл

@@ -39,5 +39,4 @@ public class WxTopicController extends BaseController {
return new ResultData();
}


}

+ 22
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCouponTopic.java Просмотреть файл

@@ -4,6 +4,7 @@ import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

@Table(name = "wx_coupon_topic")
public class WxCouponTopic implements Serializable {
@@ -19,6 +20,10 @@ public class WxCouponTopic implements Serializable {
private String busType;
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="busId")
private String busId;
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime")
private Date createtime;
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime")
private Date updatetime;

@io.swagger.annotations.ApiModelProperty(value="卷名称",name="couponName")
@Transient
@@ -30,6 +35,23 @@ public class WxCouponTopic implements Serializable {
@Transient
private String couponId;


public Date getCreatetime() {
return createtime;
}

public void setCreatetime(Date createtime) {
this.createtime = createtime;
}

public Date getUpdatetime() {
return updatetime;
}

public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}

public String getCouponName() {
return couponName;
}


+ 3
- 3
mallinkService/src/main/java/com/iformall/domain/po/WxTopic.java Просмотреть файл

@@ -52,14 +52,14 @@ public class WxTopic implements Serializable {
/*商品列表**/
@io.swagger.annotations.ApiModelProperty(value="商品列表",name="couponList")
@Transient
private List<WxCouponTopic> couponList;
private List<WxCoupon> couponList;


public List<WxCouponTopic> getCouponList() {
public List<WxCoupon> getCouponList() {
return couponList;
}

public void setCouponList(List<WxCouponTopic> couponList) {
public void setCouponList(List<WxCoupon> couponList) {
this.couponList = couponList;
}



+ 2
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCouponTopicMapper.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.iformall.mapper;

import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxCoupon;
import com.iformall.domain.po.WxCouponTopic;
import com.iformall.domain.po.WxTopic;

@@ -10,5 +11,5 @@ public interface WxCouponTopicMapper extends CommonMapper<WxCouponTopic, String>

void del(WxCouponTopic couponTopic);

List<WxCouponTopic> findList(WxTopic wxTopic);
List<WxCoupon> findList(WxTopic wxTopic);
}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java Просмотреть файл

@@ -38,7 +38,7 @@ public class WxTopicServiceImpl implements WxTopicService {
public WxTopic show(WxTopic record) {
WxTopic wxTopic = wxTopicMapper.show(record);
if(wxTopic != null) {
wxTopic.setCouponList(wxCouponTopicMapper.findList(record));
wxTopic.setCouponList(wxCouponTopicMapper.findList(wxTopic));
}
return wxTopic;
}


+ 37
- 3
mallinkService/src/main/resources/mapper/WxCouponTopicMapper.xml Просмотреть файл

@@ -18,7 +18,41 @@
<result column="couponPic" property="couponPic" />
<result column="couponId" property="couponId" />
</resultMap>

<resultMap id="couponResultMap" type="com.iformall.domain.po.WxCoupon">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="type" jdbcType="INTEGER" property="type"/>
<result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
<result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
<result column="use_price" jdbcType="INTEGER" property="usePrice"/>
<result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/>
<result column="send_type" jdbcType="INTEGER" property="sendType"/>
<result column="valid_type" jdbcType="INTEGER" property="validType"/>
<result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/>
<result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
<result column="valid_days" jdbcType="INTEGER" property="validDays"/>
<result column="detail" jdbcType="VARCHAR" property="detail"/>
<result column="price" jdbcType="INTEGER" property="price"/>
<result column="unit" jdbcType="INTEGER" property="unit"/>
<result column="remain_inventory" jdbcType="INTEGER" property="remainInventory"/>
<result column="inventory" jdbcType="INTEGER" property="inventory"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="business" jdbcType="INTEGER" property="business"/>
<result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
<result column="subsidy_type" jdbcType="INTEGER" property="subsidyType"/>
<result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"/>
<result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/>
<result column="press_limit_hours" jdbcType="INTEGER" property="pressLimitHours"/>
<result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/>

</resultMap>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
@@ -44,8 +78,8 @@
order by createtime desc
</sql>
<select id="findList" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap">
select ct.*,wc.title as couponName,wc.`cover_img` as couponPic,wc.id as couponId from wx_coupon_topic ct left join
<select id="findList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="couponResultMap">
select wc.*,wc.title as couponName,wc.`cover_img` as couponPic,wc.id as couponId from wx_coupon_topic ct left join
wx_coupon wc on wc.id = ct.bus_id
where ct.`topic_id` = #{id}
</select>


+ 3
- 4
mallinkService/src/main/resources/mapper/WxTopicMapper.xml Просмотреть файл

@@ -48,10 +48,9 @@
</select>

<select id="show" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap">
select t.*,wc.title as couponName,wc.`cover_img` as couponPic,wc.id as couponId
from wx_topic t left join wx_coupon_topic ct on t.id = ct.`topic_id`
left join wx_coupon wc on ct.bus_id = wc.id
where t.status = 1 order by t.createtime desc limit 1
select * from wx_topic t where t.status = 1
and now() >= t.begin_time and now() &lt;= t.end_time
order by t.createtime desc limit 1
</select>




Загрузка…
Отмена
Сохранить