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

[问券][修改]:增加问券的出现概率配置项

release_toaliyun_real
hupeng 7 лет назад
Родитель
Сommit
c793746b59
3 измененных файлов: 29 добавлений и 10 удалений
  1. +2
    -1
      mallinkCApi/src/main/java/com/iformall/controller/WxQuestionController.java
  2. +21
    -8
      mallinkService/src/main/java/com/iformall/domain/po/WxQuestionConfig.java
  3. +6
    -1
      mallinkService/src/main/resources/mapper/WxQuestionConfigMapper.xml

+ 2
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxQuestionController.java Просмотреть файл

@@ -68,7 +68,8 @@ public class WxQuestionController extends BaseController {
q.remove();
}
}
if (listQuestion.size() > 0)
if (listQuestion.size() > 0 &&
(new Random().nextInt(100) < listConfig.get(0).getStrength()))
return new ResultData(listQuestion.get(new Random().nextInt(listQuestion.size())));
}
}


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

@@ -57,18 +57,15 @@ public class WxQuestionConfig implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime")
private Date updateTime;

public Integer getStatus() {
return status;
}

public void setStatus(Integer status) {
this.status = status;
}

/**状态**/
@io.swagger.annotations.ApiModelProperty(value="状态",name="status")
private Integer status;

/**状态**/
@io.swagger.annotations.ApiModelProperty(value="调查力度0-100",name="strength")
private Integer strength;


public String getTenantId() {
return tenantId;
}
@@ -109,6 +106,22 @@ public class WxQuestionConfig implements Serializable {
this.updateTime = updateTime;
}

public Integer getStatus() {
return status;
}

public void setStatus(Integer status) {
this.status = status;
}


public Integer getStrength() {
return strength;
}

public void setStrength(Integer strength) {
this.strength = strength;
}

@Transient
protected List<WxQuestion> questions;


+ 6
- 1
mallinkService/src/main/resources/mapper/WxQuestionConfigMapper.xml Просмотреть файл

@@ -9,10 +9,11 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="strength" jdbcType="INTEGER" property="strength" />
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`question_list`,`coupon_type_list`,`create_time`,`update_time`,`status`
`id`,`tenant_id`,`question_list`,`coupon_type_list`,`create_time`,`update_time`,`status`,`strength`
</sql>

<sql id="dynamicWhereConditions">
@@ -46,6 +47,10 @@
and `status` = #{status}
</if>

<if test=" null != strength ">
and `strength` = #{strength}
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


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