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

Merge branch 'release_toaliyun_real_20230403' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_20230403

release_toaliyun_real
xhxu 3 лет назад
Родитель
Сommit
eb7886f11e
3 измененных файлов: 18 добавлений и 4 удалений
  1. +7
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java
  2. +10
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java
  3. +1
    -1
      mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml

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

@@ -20,6 +20,7 @@ import com.iformall.domain.vo.WxCouponPasswordCountInfoVO;
import com.iformall.domain.vo.WxCouponPasswordVo;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxCardInfoService;
import com.iformall.service.WxCouponPasswordService;
import com.iformall.utils.Constant;

@@ -66,6 +67,8 @@ public class WxCouponPasswordController extends BaseController {
private AsyncTask asyncTask;
@Autowired
private String fmUploadDir;
@Autowired
private WxCardInfoService wxCardInfoService;

@ApiOperation("分页列表接口")
@GetMapping("/list")
@@ -203,8 +206,10 @@ public class WxCouponPasswordController extends BaseController {
if (couponPassword.getIsStop().intValue() == EnumYesOrNo.YES.getCode().intValue() ) {
return new ResultData(ResultData.ERROR, "已停用,不能设置。");
}
if (couponPassword.getPrice() > 0 ) {
return new ResultData(ResultData.ERROR, "已设置面额,不能再次设置面额。");
//已经绑定了的不能设置
WxCardInfo cardInfo = wxCardInfoService.getByCouponPasswordId(wxCouponPassword.getId(), wxCouponPassword);
if (null != cardInfo) {
return new ResultData(ResultData.ERROR, "卡已绑定,不能再次设置面额。");
}
wxCouponPasswordService.setPrice(wxCouponPassword);
return new ResultData();


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

@@ -23,6 +23,7 @@ import com.iformall.mapper.WxCouponPasswordMapper;
import com.iformall.service.ExcelService;
import com.iformall.service.SysConfigService;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.WxCardInfoService;
import com.iformall.service.WxCouponPasswordService;

import com.iformall.utils.sign.AppUtils;
@@ -72,6 +73,10 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {

@Autowired
SysConfigService sysConfigService;
@Lazy
@Autowired
WxCardInfoService wxCardInfoService;

@Override
public PageInfo<WxCouponPassword> listAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize) {
@@ -337,7 +342,11 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {

@Override
public Integer setPrice(WxCouponPassword wxCouponPassword) {
return wxCouponPasswordMapper.setPrice(wxCouponPassword);
WxCardInfo cardInfo = wxCardInfoService.getByCouponPasswordId(wxCouponPassword.getId(), wxCouponPassword);
if (null == cardInfo) {
return wxCouponPasswordMapper.setPrice(wxCouponPassword);
}
return 0;
}

@Override


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

@@ -226,7 +226,7 @@
<update id="setPrice" parameterType="com.iformall.domain.po.WxCouponPassword">
update wx_coupon_password set price = #{price} , update_date = now()
where tenant_id = #{tenantId} and price = 0
where tenant_id = #{tenantId}
<if test=" null != couponId">
and coupon_id = #{couponId}
</if>


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