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

[券库存有效期][修改]:修改投放渠道库存有效期

release_toaliyun_real
Stormeye Wu 7 лет назад
Родитель
Сommit
8327b7e1d6
3 измененных файлов: 29 добавлений и 8 удалений
  1. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java
  2. +10
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  3. +17
    -8
      mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml

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

@@ -22,6 +22,8 @@ public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, Str

void updateStatusByCouponId(WxCouponChannel wxCouponChannel);

int updateEndTimeByCouponId(WxCouponChannel wxCouponChannel);

void offExpiriedCouponChannelByEndTime();

void offExpiriedCouponChannelByValidDate();


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

@@ -524,6 +524,16 @@ public class WxCouponServiceImpl implements WxCouponService {
if(ret != 1) {
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "数据库更新数量错误");
}

// 5. 更新coupon channel 有效期
if(wxCoupon.getValidType().equals(EnumCouponValidType.BETWEEN_TWO_TIME.getCode())) {
WxCouponChannel couponChannel = new WxCouponChannel();
couponChannel.setTenantId(wxCoupon.getTenantId());
couponChannel.setCouponId(wxCoupon.getId());
couponChannel.setEndTime(wxCoupon.getValidEndDate());
wxCouponChannelMapper.updateEndTimeByCouponId(couponChannel);
}

return new ResultData();
}



+ 17
- 8
mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml Просмотреть файл

@@ -101,14 +101,23 @@
<include refid="dynamicWhereConditions" />
</select>

<update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
update wx_coupon_channel
set status=#{status}, update_date=#{updateDate}
where coupon_id=#{couponId}
<if test=" null != tenantId ">
and tenant_id = #{tenantId}
</if>
</update>
<update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
update wx_coupon_channel
set status=#{status}, update_date=#{updateDate}
where coupon_id=#{couponId}
<if test=" null != tenantId ">
and tenant_id = #{tenantId}
</if>
</update>

<update id="updateEndTimeByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
update wx_coupon_channel
set end_time = #{endTime}
where coupon_id=#{couponId}
<if test=" null != tenantId ">
and tenant_id = #{tenantId}
</if>
</update>

<sql id="CouponChannelVoColumns">
<include refid="allColumns" />,


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