Browse Source

fix card

release_toaliyun_real
lin 3 years ago
parent
commit
7baaca7639
6 changed files with 12 additions and 8 deletions
  1. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCouponPasswordMapper.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java
  4. +6
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  5. +2
    -2
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml
  6. +1
    -1
      mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml

+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java View File

@@ -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);


+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCouponPasswordMapper.java View File

@@ -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);


} }

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java View File

@@ -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);
} }
} }

+ 6
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java View File

@@ -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();
} }


+ 2
- 2
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -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>

+ 1
- 1
mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml View File

@@ -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">


Loading…
Cancel
Save