| @@ -17,7 +17,7 @@ public interface WxCouponPasswordMapper extends CommonMapper<WxCouponPassword, L | |||||
| void insertCouponPasswds(List<WxCouponPassword> pwdlist); | void insertCouponPasswds(List<WxCouponPassword> pwdlist); | ||||
| int disableByCouponId(Long couponId); | int disableByCouponId(Long couponId); | ||||
| int downloadByCouponId(Long couponId); | |||||
| int downloadByCouponId(@Param("couponId")Long couponId,@Param("price")Integer price); | |||||
| List<WxCouponPassword> findCouponGroupList(WxCouponPassword wxCouponPassword); | List<WxCouponPassword> findCouponGroupList(WxCouponPassword wxCouponPassword); | ||||
| List<WxCouponPasswordCountInfoVO> findCouponCountInfo(WxCouponPassword wxCouponPassword); | List<WxCouponPasswordCountInfoVO> findCouponCountInfo(WxCouponPassword wxCouponPassword); | ||||
| @@ -305,7 +305,11 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||||
| @Override | @Override | ||||
| public void exportData(HttpServletRequest request, HttpServletResponse response, WxCouponPassword couponPassword) { | public void exportData(HttpServletRequest request, HttpServletResponse response, WxCouponPassword couponPassword) { | ||||
| if (couponPassword.getCouponId() != null) { | if (couponPassword.getCouponId() != null) { | ||||
| wxCouponPasswordMapper.downloadByCouponId(couponPassword.getCouponId()); | |||||
| WxCoupon coupon = wxCouponMapper.selectById(couponPassword.getCouponId(), couponPassword.getTenantId()); | |||||
| if (null == coupon) { | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"券未查询到"); | |||||
| } | |||||
| wxCouponPasswordMapper.downloadByCouponId(couponPassword.getCouponId(),coupon.getPrice()); | |||||
| } | } | ||||
| List<WxCouponPassword> pwdList = wxCouponPasswordMapper.findAvaPasswordListByCouponId(couponPassword); | List<WxCouponPassword> pwdList = wxCouponPasswordMapper.findAvaPasswordListByCouponId(couponPassword); | ||||
| excelService.exportExcel(pwdList, null, "兑换码", WxCouponPassword.class, "卡兑换码.xlsx", response, false); | excelService.exportExcel(pwdList, null, "兑换码", WxCouponPassword.class, "卡兑换码.xlsx", response, false); | ||||
| @@ -132,10 +132,16 @@ | |||||
| where status != 3 and coupon_id=#{couponId} | where status != 3 and coupon_id=#{couponId} | ||||
| </update> | </update> | ||||
| <update id="downloadByCouponId" parameterType="Long"> | |||||
| <update id="downloadByCouponId" parameterType="map"> | |||||
| update wx_coupon_password | update wx_coupon_password | ||||
| set status=1, update_date=now(), expire_date=date_add(now(),interval 365 DAY) | set status=1, update_date=now(), expire_date=date_add(now(),interval 365 DAY) | ||||
| <if test=" null != price and price > 0"> | |||||
| ,and `price` = #{price} | |||||
| </if> | |||||
| where status=0 and coupon_id=#{couponId} | where status=0 and coupon_id=#{couponId} | ||||
| <if test=" null != price and price > 0"> | |||||
| and `price` = 0 | |||||
| </if> | |||||
| </update> | </update> | ||||
| <select id="findCouponGroupList" parameterType="com.iformall.domain.po.WxCouponPassword" resultMap="BaseResultMap"> | <select id="findCouponGroupList" parameterType="com.iformall.domain.po.WxCouponPassword" resultMap="BaseResultMap"> | ||||