Просмотр исходного кода

fix card

release_toaliyun_real
lin 3 лет назад
Родитель
Сommit
8130b0cf39
4 измененных файлов: 5 добавлений и 5 удалений
  1. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  4. +1
    -1
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 2
- 2
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java Просмотреть файл

@@ -445,13 +445,13 @@ public class WxCouponController extends BaseController {
}
if (EnumCouponSubsidyType.WECHAT_COUPON.getCode().equals(coupon.getSubsidyType())) {
// 微信 立减
if (coupon.getSubsidyNum() > coupon.getSalePrice()) {
if (wxCoupon.getSubsidyNum() > coupon.getSalePrice()) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于售价");
}
} else if (EnumCouponSubsidyType.OFFLINE_SUBSIDY.getCode().equals(coupon.getSubsidyType())) {
// 线下补贴
int subsidy_num = wxCoupon.getPrice() - coupon.getSalePrice();
if (coupon.getSubsidyNum() > subsidy_num) {
if (wxCoupon.getSubsidyNum() > subsidy_num) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于面额与售价的差值");
}
}


+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java Просмотреть файл

@@ -42,7 +42,7 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
void deleteById(@Param("id")Long id,@Param("tenantId")String tenantId);
Integer setPrice(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("price")Integer price);
Integer setPrice(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("price")Integer price,@Param("subsidyNum")Integer subsidyNum);

Integer reduceInventory(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("number")Integer number);


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Просмотреть файл

@@ -1022,7 +1022,7 @@ public class WxCouponServiceImpl implements WxCouponService {
@Override
@Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
public ResultData setPrice(WxCoupon record) {
Integer count = wxCouponMapper.setPrice(record.getId(), record.getTenantId(), record.getPrice());
Integer count = wxCouponMapper.setPrice(record.getId(), record.getTenantId(), record.getPrice(),record.getSubsidyNum());
if (null == count || count <= 0 ) {
return new ResultData(Result.ERROR,"设置失败");
}


+ 1
- 1
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -1525,7 +1525,7 @@
</update>
<update id="setPrice" parameterType="HashMap">
update wx_coupon set price = #{price} where id = #{id} and tenant_id = #{tenantId} and price = 0
update wx_coupon set price = #{price},subsidy_num={subsidyNum} where id = #{id} and tenant_id = #{tenantId} and price = 0
</update>

</mapper>

Загрузка…
Отмена
Сохранить