# Conflicts: # mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.javarelease_toaliyun_real
| @@ -1,17 +1,15 @@ | |||||
| package com.iformall.mapper; | package com.iformall.mapper; | ||||
| import java.util.*; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxCardInfo; | import com.iformall.domain.po.WxCardInfo; | ||||
| import com.iformall.domain.vo.WxCardVo; | import com.iformall.domain.vo.WxCardVo; | ||||
| import java.util.List; | |||||
| public interface WxCardInfoMapper extends CommonMapper<WxCardInfo, Long> { | public interface WxCardInfoMapper extends CommonMapper<WxCardInfo, Long> { | ||||
| List<WxCardVo> findVoList(WxCardVo wxCardVo); | List<WxCardVo> findVoList(WxCardVo wxCardVo); | ||||
| void updateTransferStatusByCouponId(Long couponId); | |||||
| } | } | ||||
| @@ -13,6 +13,7 @@ import com.iformall.domain.vo.WxCouponChannelAddVo; | |||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.mapper.WxCardInfoMapper; | |||||
| import com.iformall.mapper.WxCouponChannelMapper; | import com.iformall.mapper.WxCouponChannelMapper; | ||||
| import com.iformall.mapper.WxCouponMerchantMapper; | import com.iformall.mapper.WxCouponMerchantMapper; | ||||
| import com.iformall.mapper.WxMerchantMapper; | import com.iformall.mapper.WxMerchantMapper; | ||||
| @@ -43,6 +44,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| WxOrderService wxOrderService; | WxOrderService wxOrderService; | ||||
| @Autowired | @Autowired | ||||
| QrCodeService qrCodeService; | QrCodeService qrCodeService; | ||||
| @Autowired | |||||
| WxCardInfoMapper wxCardInfoMapper; | |||||
| /** | /** | ||||
| * B端业务端 | * B端业务端 | ||||
| @@ -107,6 +110,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| wxCoupon.setSupportTransfer(EnumCouponTransfer.NO.getCode()); | wxCoupon.setSupportTransfer(EnumCouponTransfer.NO.getCode()); | ||||
| wxCoupon.setUpdateDate(new Date()); | wxCoupon.setUpdateDate(new Date()); | ||||
| wxCouponService.update(wxCoupon); | wxCouponService.update(wxCoupon); | ||||
| //修改卡状态 | |||||
| wxCardInfoMapper.updateTransferStatusByCouponId(orignal.getCouponId()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -63,6 +63,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| @Autowired | @Autowired | ||||
| WxCouponChannelMapper wxCouponChannelMapper; | WxCouponChannelMapper wxCouponChannelMapper; | ||||
| @Autowired | |||||
| WxCardInfoMapper wxCardInfoMapper; | |||||
| @Override | @Override | ||||
| public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | if (null == wxCoupon) wxCoupon = new WxCoupon(); | ||||
| @@ -394,10 +397,15 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| wxScreenAdService.updateStatusByCouponId(record.getId(), record.getTenantId(), EnumScreenAdStatus.INVALID.getCode()); | wxScreenAdService.updateStatusByCouponId(record.getId(), record.getTenantId(), EnumScreenAdStatus.INVALID.getCode()); | ||||
| //下架拼团券 | //下架拼团券 | ||||
| wxOrderService.updateOrderGroupStatusByCouponId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.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()); | record.setUpdateDate(new Date()); | ||||
| wxCouponMapper.updateByPrimaryKeySelective(record); | wxCouponMapper.updateByPrimaryKeySelective(record); | ||||
| } | } | ||||
| return new ResultData(record.getId()); | return new ResultData(record.getId()); | ||||
| } | } | ||||
| @@ -2018,9 +2018,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| Double total = new Double(0); | Double total = new Double(0); | ||||
| int[] diff; | 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))){ | if(sd.format(start).equals(sd.format(end))){ | ||||
| int dayCount = DateUtils.getMonthDayCount(start); | int dayCount = DateUtils.getMonthDayCount(start); | ||||
| @@ -2029,8 +2029,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| //同月 | //同月 | ||||
| if(sdM.format(start).equals(sdM.format(end))){ | 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); | diff = DateUtils.getDiff(start,end); | ||||
| int dayCount = DateUtils.getMonthDayCount(start); | 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))); | int endInt = Integer.parseInt(sdD.format(DateUtils.getDaySet(end,Calendar.DATE,1))); | ||||
| if(startInt == endInt){ | 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) { | public WxRentContract getByBill(WxBillRent billRent) { | ||||
| return wxRentContractMapper.getByBill(billRent); | return wxRentContractMapper.getByBill(billRent); | ||||
| } | } | ||||
| } | |||||
| } | |||||
| @@ -206,5 +206,8 @@ | |||||
| <include refid="dynamicVoWhereConditions" /> | <include refid="dynamicVoWhereConditions" /> | ||||
| </select> | </select> | ||||
| <update id="updateTransferStatusByCouponId" parameterType="Long"> | |||||
| update wx_card_info set support_transfer=0,update_date=now() where support_transfer=1 and coupon_id=#{couponId} | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||
| @@ -950,13 +950,13 @@ | |||||
| <sql id="allCUserCardListColumns"> | <sql id="allCUserCardListColumns"> | ||||
| co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date, | 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, | 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 | |||||
| </sql> | </sql> | ||||
| <sql id="allCUserCardDetailColumns"> | <sql id="allCUserCardDetailColumns"> | ||||
| 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, | 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, | 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 | |||||
| </sql> | </sql> | ||||
| @@ -36,11 +36,8 @@ | |||||
| <if test=" null != type "> and `type` = #{type} </if> | <if test=" null != type "> and `type` = #{type} </if> | ||||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | ||||
| <if test=" null != open "> and `open` = #{open} </if> | <if test=" null != open "> and `open` = #{open} </if> | ||||
| <if test="1 == msgType"> | |||||
| and id not in( | |||||
| select id from wx_msg_validationcode_model where content like '<%' and `tenant_id` = #{tenantId} | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != msgType "> and `msg_type` = #{msgType} </if> | |||||
| <if test=" null != roleType "> and `role_type` = #{roleType} </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||