Browse Source

Merge commit 'refs/tags/jenkins-back-end-152^{}' into release

release_toaliyun_real
Stormeye.Wu 7 years ago
parent
commit
4e9396a0e4
8 changed files with 93 additions and 69 deletions
  1. +4
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java
  2. +6
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/WxLevelConfigController.java
  3. +18
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxLevelConfigMapper.java
  5. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxLevelConfigService.java
  6. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxLevelConfigServiceImpl.java
  7. +3
    -0
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
  8. +58
    -62
      mallinkService/src/main/resources/mapper/WxLevelConfigMapper.xml

+ 4
- 1
mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java View File

@@ -9,6 +9,7 @@ import com.iformall.domain.po.WxCoupon;
import com.iformall.domain.po.WxCouponChannel;
import com.iformall.domain.po.WxMerchant;
import com.iformall.enums.EnumCouponStatus;
import com.iformall.enums.EnumMerchantStatus;
import com.iformall.service.WxCouponChannelService;
import com.iformall.service.WxCouponService;
import com.iformall.service.WxMerchantService;
@@ -146,9 +147,11 @@ public class WxCouponController extends BaseController {
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData findById(Long id) {
WxCoupon c = wxCouponService.getById(id);
WxMerchant merchant = wxMerchantService.getById(c.getMerchantId());
if(merchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode()))
return new ResultData(Result.ERROR, "此券的商户已禁用");
WxCounponDto dto = new WxCounponDto();
org.springframework.beans.BeanUtils.copyProperties(c, dto);
WxMerchant merchant = wxMerchantService.getById(c.getMerchantId());
dto.setWxMerchant(merchant);
return new ResultData(Result.SUCCESS, "查询成功", dto);
}


+ 6
- 2
mallinkAdmin/src/main/java/com/iformall/controller/WxLevelConfigController.java View File

@@ -52,14 +52,18 @@ public class WxLevelConfigController extends BaseController {
String[] points = dto.getPoints().split("&");
String[] level = dto.getLevel().split("&");
String[] descs =dto.getDescription().split("&");
if (points.length != level.length) {
return new ResultData(Result.ERROR, "请同时设置成长值和等级");
}
String tenantId = getTenantId();
wxLevelConfigService.deleteAll();
wxLevelConfigService.deleteAll(tenantId);
for(int i=0;i<points.length;i++) {
WxLevelConfig wxLevelConfig = new WxLevelConfig();
wxLevelConfig.setTenantId(tenantId);
wxLevelConfig.setPoints(Integer.parseInt(points[i]));
wxLevelConfig.setLevel(level[i]);
wxLevelConfig.setDescription(descs[i]);
if (descs.length > 0 && i < descs.length)
wxLevelConfig.setDescription(descs[i]);
wxLevelConfigService.saveOrUpdate(wxLevelConfig);
}
return new ResultData();


+ 18
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java View File

@@ -109,6 +109,10 @@ public class WxCUserBasicInfo implements Serializable {
private String tagNames;
@Transient
private long count;
@Transient
private Date startTime;
@Transient
private Date endTime;

public String getLevel() {
return level;
@@ -225,7 +229,21 @@ public class WxCUserBasicInfo implements Serializable {
name = _name;
}

public Date getStartTime() {
return startTime;
}

public void setStartTime(Date startTime) {
this.startTime = startTime;
}

public Date getEndTime() {
return endTime;
}

public void setEndTime(Date endTime) {
this.endTime = endTime;
}

public static enum Field
{


+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxLevelConfigMapper.java View File

@@ -10,7 +10,7 @@ public interface WxLevelConfigMapper extends CommonMapper<WxLevelConfig, Long> {
List<WxLevelConfig> findList(WxLevelConfig wxLevelConfig);
void deleteAll();
void deleteAll(@Param("tenantId")String tenantId);

String getLevel(@Param("tenantId")String tenantId,@Param("poins")Integer poins);


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxLevelConfigService.java View File

@@ -47,7 +47,7 @@ public interface WxLevelConfigService {
void deleteById(Long id);
void deleteAll();
void deleteAll(String tenantId);
/**
* 根据积分获取会员等级
* @param tenantId


+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxLevelConfigServiceImpl.java View File

@@ -57,8 +57,8 @@ public class WxLevelConfigServiceImpl implements WxLevelConfigService {
}

@Override
public void deleteAll() {
wxLevelConfigMapper.deleteAll();
public void deleteAll(String tenantId) {
wxLevelConfigMapper.deleteAll(tenantId);
}



+ 3
- 0
mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml View File

@@ -78,6 +78,9 @@
<if test=" null != name ">
and `name` like concat('%', #{name},'%')
</if>
<if test=" null != startTime and null!=endTime">
and `create_date` between #{startTime} and #{endTime}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


+ 58
- 62
mallinkService/src/main/resources/mapper/WxLevelConfigMapper.xml View File

@@ -1,72 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.iformall.mapper.WxLevelConfigMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxLevelConfig">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="points" jdbcType="INTEGER" property="points" />
<result column="level" jdbcType="VARCHAR" property="level" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
</resultMap>
<sql id="allColumns">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxLevelConfig">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="points" jdbcType="INTEGER" property="points"/>
<result column="level" jdbcType="VARCHAR" property="level"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
</resultMap>
<sql id="allColumns">
`id`,`points`,`level`,`description`,`create_date`,`tenant_id`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != points ">
and `points` = #{points}
</if>
<if test=" null != level ">
and `level` like concat('%', #{level},'%')
</if>
<if test=" null != description ">
and `description` like concat('%', #{description},'%')
</if>
<if test=" null != createDate ">
and `create_date` = #{createDate}
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>
<select id="findList" parameterType="com.iformall.domain.po.WxLevelConfig" resultMap="BaseResultMap">
select <include refid="allColumns" /> from wx_level_config
<include refid="dynamicWhereConditions" />
</select>
<delete id="deleteAll">
delete from wx_level_config;
</delete>
<sql id="dynamicWhereConditions">
where 1 = 1

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

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

<if test=" null != level ">
and `level` like concat('%', #{level},'%')
</if>

<if test=" null != description ">
and `description` like concat('%', #{description},'%')
</if>

<select id="getLevel" parameterType="com.iformall.domain.po.WxLevelConfig" resultType="String">
<if test=" null != createDate ">
and `create_date` = #{createDate}
</if>

<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>

<select id="findList" parameterType="com.iformall.domain.po.WxLevelConfig" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_level_config
<include refid="dynamicWhereConditions"/>
</select>

<delete id="deleteAll" parameterType="com.iformall.domain.po.WxLevelConfig">
delete from wx_level_config where `tenant_id` = #{tenantId};
</delete>

<select id="getLevel" parameterType="com.iformall.domain.po.WxLevelConfig" resultType="String">
SELECT `level` FROM `wx_level_config` where tenant_id=#{tenantId} and points &lt;= #{points} ORDER BY points desc LIMIT 1
</select>
</mapper>

Loading…
Cancel
Save