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

fix wx_coupon分表

release_toaliyun_real
xiaohanzi 5 лет назад
Родитель
Сommit
0269a7c789
3 измененных файлов: 8 добавлений и 8 удалений
  1. +2
    -2
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java
  2. +2
    -2
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  3. +4
    -4
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 2
- 2
mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java Просмотреть файл

@@ -52,8 +52,8 @@ public class CouponExpiringSchedule {
List<WxMall> malls = getMalls();
for (WxMall mall : malls) {
try {
wxCouponMapper.offExpiriedCouponByValidDate();
wxCouponMapper.offExpiriedCouponByMerchantStatus();
wxCouponMapper.offExpiriedCouponByValidDate(mall.getTenantId());
wxCouponMapper.offExpiriedCouponByMerchantStatus(mall.getTenantId());
wxCouponSendMapper.offExpiriedCouponSendByCouponStatus();
wxCouponChannelMapper.offExpiriedCouponChannelByCouponStatus(mall.getTenantId());


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

@@ -28,9 +28,9 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {

Integer backInventory(@Param("id")Long id,@Param("tenantId")String tenantId, @Param("number")Integer number,@Param("remainInventory")Integer remainInventory);

void offExpiriedCouponByValidDate();
void offExpiriedCouponByValidDate(@Param("tenantId")String tenantId);

void offExpiriedCouponByMerchantStatus();
void offExpiriedCouponByMerchantStatus(@Param("tenantId")String tenantId);

/**
* 查询时间段内销售金额


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

@@ -684,15 +684,15 @@
update wx_coupon SET remain_inventory = remain_inventory + #{number} where id = #{id} and tenant_id =#{tenantId} and remain_inventory + #{number} &lt;= inventory
</update>

<update id="offExpiriedCouponByValidDate">
<update id="offExpiriedCouponByValidDate" parameterType="String">
update wx_coupon SET status = 1, update_date = now()
where status = 0 and valid_type = 1 and valid_end_date &lt; now()
where status = 0 and tenant_id =#{tenantId} and valid_type = 1 and valid_end_date &lt; now()
</update>

<update id="offExpiriedCouponByMerchantStatus">
<update id="offExpiriedCouponByMerchantStatus" parameterType="String">
update wx_coupon c
SET c.status = 1, c.update_date = now()
where c.status = 0 and
where c.status = 0 and c.tenant_id =#{tenantId} and
(select count(*) from wx_coupon_merchant cm, wx_merchant m
where m.id = cm.merchant_id
and c.id = cm.product_id


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