| @@ -42,7 +42,7 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||||
| void deleteById(@Param("id")Long id,@Param("tenantId")String tenantId); | void deleteById(@Param("id")Long id,@Param("tenantId")String tenantId); | ||||
| Integer setPrice(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("price")Integer price,@Param("subsidyNum")Integer subsidyNum); | |||||
| Integer setPrice(WxCoupon wxCoupon); | |||||
| Integer reduceInventory(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("number")Integer number); | Integer reduceInventory(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("number")Integer number); | ||||
| @@ -30,6 +30,6 @@ public interface WxCouponPasswordMapper extends CommonMapper<WxCouponPassword, L | |||||
| void updateIsStop(@Param("tenantId")String tenantId,@Param("id")Long Id,@Param("isStop")Integer isStop); | void updateIsStop(@Param("tenantId")String tenantId,@Param("id")Long Id,@Param("isStop")Integer isStop); | ||||
| void setPrice(@Param("tenantId")String tenantId,@Param("id")Long id,@Param("couponId")Long couponId,@Param("price")Integer price); | |||||
| void setPrice(WxCouponPassword wxCouponPassword); | |||||
| } | } | ||||
| @@ -334,7 +334,7 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||||
| @Override | @Override | ||||
| public void setPrice(WxCouponPassword wxCouponPassword) { | public void setPrice(WxCouponPassword wxCouponPassword) { | ||||
| wxCouponPasswordMapper.setPrice(wxCouponPassword.getTenantId(),wxCouponPassword.getId(),wxCouponPassword.getCouponId(), wxCouponPassword.getPrice()); | |||||
| wxCouponPasswordMapper.setPrice(wxCouponPassword); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1022,12 +1022,16 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| @Override | @Override | ||||
| @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | ||||
| public ResultData setPrice(WxCoupon record) { | public ResultData setPrice(WxCoupon record) { | ||||
| Integer count = wxCouponMapper.setPrice(record.getId(), record.getTenantId(), record.getPrice(),record.getSubsidyNum()); | |||||
| Integer count = wxCouponMapper.setPrice(record); | |||||
| if (null == count || count <= 0 ) { | if (null == count || count <= 0 ) { | ||||
| return new ResultData(Result.ERROR,"设置失败"); | return new ResultData(Result.ERROR,"设置失败"); | ||||
| } | } | ||||
| //设置卡密price | //设置卡密price | ||||
| couponPasswordMapper.setPrice(record.getTenantId(), null,record.getId(), record.getPrice()); | |||||
| WxCouponPassword couponPassword = new WxCouponPassword(); | |||||
| couponPassword.updateTenantInfo(record); | |||||
| couponPassword.setCouponId(record.getId()); | |||||
| couponPassword.setPrice(record.getPrice()); | |||||
| couponPasswordMapper.setPrice(couponPassword); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -1524,8 +1524,8 @@ | |||||
| update wx_coupon set make_merchant_id = #{makeMerchantId} where id = #{id} and tenant_id = #{tenantId} | update wx_coupon set make_merchant_id = #{makeMerchantId} where id = #{id} and tenant_id = #{tenantId} | ||||
| </update> | </update> | ||||
| <update id="setPrice" parameterType="HashMap"> | |||||
| update wx_coupon set price = #{price},subsidy_num={subsidyNum} where id = #{id} and tenant_id = #{tenantId} and price = 0 | |||||
| <update id="setPrice" parameterType="com.iformall.domain.po.WxCoupon"> | |||||
| update wx_coupon set price = #{price},subsidy_num=#{subsidyNum} where id = #{id} and tenant_id = #{tenantId} and price = 0 | |||||
| </update> | </update> | ||||
| </mapper> | </mapper> | ||||
| @@ -215,7 +215,7 @@ | |||||
| update wx_coupon_password set is_stop = #{isStop} , update_date = now() where id = #{id} and tenant_id = #{tenantId} | update wx_coupon_password set is_stop = #{isStop} , update_date = now() where id = #{id} and tenant_id = #{tenantId} | ||||
| </update> | </update> | ||||
| <update id="setPrice" parameterType="map"> | |||||
| <update id="setPrice" parameterType="com.iformall.domain.po.WxCouponPassword"> | |||||
| update wx_coupon_password set price = #{price} , update_date = now() | update wx_coupon_password set price = #{price} , update_date = now() | ||||
| where tenant_id = #{tenantId} and price = 0 | where tenant_id = #{tenantId} and price = 0 | ||||
| <if test=" null != couponId"> | <if test=" null != couponId"> | ||||