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

[修改券状态][修改] 券状态修改

release_toaliyun_real
masterspirit 7 лет назад
Родитель
Сommit
10aabc6b8a
1 измененных файлов: 15 добавлений и 4 удалений
  1. +15
    -4
      mallinkService/src/main/java/com/simple/service/impl/WxCouponChannelServiceImpl.java

+ 15
- 4
mallinkService/src/main/java/com/simple/service/impl/WxCouponChannelServiceImpl.java Просмотреть файл

@@ -11,6 +11,7 @@ import com.simple.domain.vo.WxCouponChannelVo;
import com.simple.mapper.WxCouponChannelMapper;
import com.simple.service.WxCouponChannelService;
import com.simple.service.WxCouponService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.simple.common.IdWorker;
@@ -24,6 +25,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
@Autowired
WxCouponService wxCouponService;

private Logger logger = Logger.getLogger(getClass());

/**
* B端业务端
@@ -77,14 +79,23 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
@Transactional
public void addCuponChannel(Long couponid,Integer channelId,String tanantId,Date beginTime,Date endTime){
WxCoupon wxCoupon = wxCouponService.getById(couponid);
if(wxCoupon.getStatus()!=1) {
wxCoupon.setStatus(1);
wxCouponService.saveOrUpdate(wxCoupon);
if(wxCoupon.getStatus()!=0) {
logger.debug(wxCoupon.getId()+"状态不对");
return;
}

if(wxCoupon.getValidEndDate().before(endTime)){
logger.debug(wxCoupon.getId()+"发放时间不能晚于使用时间");
return;
}
WxCouponChannel wxCouponChannel = new WxCouponChannel();
wxCouponChannel.setEndTime(endTime);
if(wxCoupon.getValidEndDate()!=null){
wxCouponChannel.setEndTime(wxCoupon.getValidEndDate());
}
wxCouponChannel.setStatus(0);
wxCouponChannel.setBeginTime(beginTime);
wxCouponChannel.setEndTime(endTime);
wxCouponChannel.setCouponId(couponid);
wxCouponChannel.setMerchantId(wxCoupon.getMerchantId());
wxCouponChannel.setType(wxCoupon.getType());


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