| @@ -22,6 +22,8 @@ public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, Str | |||||
| void updateStatusByCouponId(WxCouponChannel wxCouponChannel); | void updateStatusByCouponId(WxCouponChannel wxCouponChannel); | ||||
| int updateEndTimeByCouponId(WxCouponChannel wxCouponChannel); | |||||
| void offExpiriedCouponChannelByEndTime(); | void offExpiriedCouponChannelByEndTime(); | ||||
| void offExpiriedCouponChannelByValidDate(); | void offExpiriedCouponChannelByValidDate(); | ||||
| @@ -524,6 +524,16 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| if(ret != 1) { | if(ret != 1) { | ||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "数据库更新数量错误"); | 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(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -101,14 +101,23 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </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"> | <sql id="CouponChannelVoColumns"> | ||||
| <include refid="allColumns" />, | <include refid="allColumns" />, | ||||