diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java index bf4c0fee3..7d4be7a49 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java @@ -1,17 +1,15 @@ package com.iformall.mapper; -import java.util.*; import com.iformall.common.CommonMapper; import com.iformall.domain.po.WxCardInfo; import com.iformall.domain.vo.WxCardVo; +import java.util.List; + public interface WxCardInfoMapper extends CommonMapper { List findVoList(WxCardVo wxCardVo); - - - - - + void updateTransferStatusByCouponId(Long couponId); + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index cd9193aed..b1b73dccf 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -13,6 +13,7 @@ import com.iformall.domain.vo.WxCouponChannelAddVo; import com.iformall.domain.vo.WxCouponChannelVo; import com.iformall.domain.vo.WxMerchantVo; import com.iformall.enums.*; +import com.iformall.mapper.WxCardInfoMapper; import com.iformall.mapper.WxCouponChannelMapper; import com.iformall.mapper.WxCouponMerchantMapper; import com.iformall.mapper.WxMerchantMapper; @@ -43,6 +44,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { WxOrderService wxOrderService; @Autowired QrCodeService qrCodeService; + @Autowired + WxCardInfoMapper wxCardInfoMapper; /** * B端业务端 @@ -107,6 +110,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { wxCoupon.setSupportTransfer(EnumCouponTransfer.NO.getCode()); wxCoupon.setUpdateDate(new Date()); wxCouponService.update(wxCoupon); + //修改卡状态 + wxCardInfoMapper.updateTransferStatusByCouponId(orignal.getCouponId()); } } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index bf903a781..7c7c27369 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -63,6 +63,9 @@ public class WxCouponServiceImpl implements WxCouponService { @Autowired WxCouponChannelMapper wxCouponChannelMapper; + @Autowired + WxCardInfoMapper wxCardInfoMapper; + @Override public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { if (null == wxCoupon) wxCoupon = new WxCoupon(); @@ -394,10 +397,15 @@ public class WxCouponServiceImpl implements WxCouponService { wxScreenAdService.updateStatusByCouponId(record.getId(), record.getTenantId(), EnumScreenAdStatus.INVALID.getCode()); //下架拼团券 wxOrderService.updateOrderGroupStatusByCouponId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); + //卡-转赠状态 + record.setSupportTransfer(EnumCouponTransfer.NO.getCode()); + //修改卡状态 + wxCardInfoMapper.updateTransferStatusByCouponId(record.getId()); } record.setUpdateDate(new Date()); wxCouponMapper.updateByPrimaryKeySelective(record); + } return new ResultData(record.getId()); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 57b036d0b..a6928d573 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -2018,9 +2018,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { Double total = new Double(0); int[] diff; - if(sd.format(start).equals("2019-07-01")){ - System.out.println(); - } + System.out.println(sd.format(start)); + System.out.println(sd.format(end)); + //同一天 if(sd.format(start).equals(sd.format(end))){ int dayCount = DateUtils.getMonthDayCount(start); @@ -2029,8 +2029,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { //同月 if(sdM.format(start).equals(sdM.format(end))){ - System.out.println(sd.format(start)); - System.out.println(sd.format(end)); diff = DateUtils.getDiff(start,end); int dayCount = DateUtils.getMonthDayCount(start); @@ -2043,8 +2041,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { int endInt = Integer.parseInt(sdD.format(DateUtils.getDaySet(end,Calendar.DATE,1))); if(startInt == endInt){ - int months = getMonths(sdM.format(start)+"-01",sdM.format(end)+"-01"); - return (months+1) * price; + int months = getMonths(sdM.format(start)+"-01",sdM.format(DateUtils.getDaySet(end,Calendar.DATE,1))+"-01"); + return (months) * price; } //第一个月 @@ -2237,4 +2235,4 @@ public class WxRentContractServiceImpl implements WxRentContractService { public WxRentContract getByBill(WxBillRent billRent) { return wxRentContractMapper.getByBill(billRent); } -} +} \ No newline at end of file diff --git a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml index 1119c84fc..ffcd1a720 100644 --- a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml @@ -206,5 +206,8 @@ + + update wx_card_info set support_transfer=0,update_date=now() where support_transfer=1 and coupon_id=#{couponId} + diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index 119318492..61ea320d3 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -950,13 +950,13 @@ co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date, c.cover_img,c.title,c.sub_title,c.detail,c.unit,c.remark, - a.amount,a.remaining_amount,case when c.status=1 then 0 else a.support_transfer end support_transfer + a.amount,a.remaining_amount,case when c.status=1 then 0 else c.support_transfer end support_transfer co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, c.cover_img,c.title,c.sub_title,c.sale_price,c.price,c.unit,c.detail,c.remark, - a.amount,a.remaining_amount,case when c.status=1 then 0 else a.support_transfer end support_transfer + a.amount,a.remaining_amount,case when c.status=1 then 0 else c.support_transfer end support_transfer diff --git a/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml b/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml index 6bb6f80b4..bf4600491 100644 --- a/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml @@ -36,11 +36,8 @@ and `type` = #{type} and `tenant_id` = #{tenantId} and `open` = #{open} - - and id not in( - select id from wx_msg_validationcode_model where content like '<%' and `tenant_id` = #{tenantId} - ) - + and `msg_type` = #{msgType} + and `role_type` = #{roleType} and id in