Parcourir la source

[C端首页][修改][换一换拼团与砍价]

release_toaliyun_real
gongbiao il y a 6 ans
Parent
révision
6396b676a6
3 fichiers modifiés avec 12 ajouts et 7 suppressions
  1. +1
    -2
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java
  3. +10
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java

+ 1
- 2
mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java Voir le fichier

@@ -106,8 +106,7 @@ public class WxCouponChannelController extends BaseController {
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
wxCouponChannel.setCouponStatus(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode());
wxCouponChannel.setSortColumns(BaseEntity.SortField.UpdateDate_DESC, BaseEntity.SortField.Id_DESC);
WxCouponChannelVo vo = wxCouponChannelService.change(wxCouponChannel);
return new ResultData(vo);
return wxCouponChannelService.change(wxCouponChannel);
}




+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java Voir le fichier

@@ -70,6 +70,6 @@ public interface WxCouponChannelService {

void updateStatusByCouponId(Long couponId,String tenantId,int status);

WxCouponChannelVo change(WxCouponChannel wxCouponChannel);
ResultData change(WxCouponChannel wxCouponChannel);

}

+ 10
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java Voir le fichier

@@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode;
import com.iformall.common.IdWorker;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxCoupon;
import com.iformall.domain.po.WxCouponChannel;
@@ -138,7 +139,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
}

@Override
public WxCouponChannelVo change(WxCouponChannel record) {
public ResultData change(WxCouponChannel record) {
Long couponId = 0L;
if (record.getCouponId() != null) {
couponId = record.getCouponId();
@@ -146,10 +147,13 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
}
List<WxCouponChannelVo> voList = wxCouponChannelMapper.findVoList(record);
if (voList.isEmpty()) {
return null;
return new ResultData(Result.SUCCESS, "查询成功", null);
}
Map<String, Object> data = new HashMap<>();
if (voList.size() == 1) {
return voList.get(0);
data.put("size", 1);
data.put("data", voList.get(0));
return new ResultData(Result.SUCCESS, "查询成功", data);
}
Long finalCouponId = couponId;
voList = voList.stream()
@@ -157,7 +161,9 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
.collect(Collectors.toList());
int size = voList.size();
Random random = new Random();
return voList.get(random.nextInt(size));
data.put("size", size);
data.put("data", voList.get(random.nextInt(size)));
return new ResultData(Result.SUCCESS, "查询成功", data);
}

private boolean isCouponMerchantValid(Long couponId) {


Chargement…
Annuler
Enregistrer