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

场景投放配置接口,添加默认配置

release_toaliyun_real
Burce 6 лет назад
Родитель
Сommit
41221866dd
3 измененных файлов: 12 добавлений и 1 удалений
  1. +7
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponSendConfigController.java
  2. +1
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCouponSend.java
  3. +4
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendConfigServiceImpl.java

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

@@ -7,6 +7,7 @@ import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxCouponSendConfig;
import com.iformall.enums.EnumCouponSendSendType;
import com.iformall.enums.EnumValidStatus;
import com.iformall.service.WxCouponSendConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -38,8 +39,13 @@ public class WxCouponSendConfigController extends BaseController {
PageInfo<WxCouponSendConfig> page = wxCouponSendConfigService.listAsPage(wxCouponSendConfig, 1, 1);
if (page.getSize() > 0) {
return new ResultData(page.getList().get(0));
} else {
//配置不存在,添加默认配置(停用)
wxCouponSendConfig.setRemark(EnumCouponSendSendType.getEnum(wxCouponSendConfig.getSendType()).getMessage() + "开关");
wxCouponSendConfig.setValue(1);
wxCouponSendConfigService.saveOrUpdate(wxCouponSendConfig);
return new ResultData(wxCouponSendConfig);
}
return new ResultData();
}




+ 1
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCouponSend.java Просмотреть файл

@@ -41,6 +41,7 @@ public class WxCouponSend extends BaseEntity {
/**
* 商户购券数
*/
@Transient
protected Integer merchantLnventory;

/**发卷所属商户名**/


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

@@ -11,6 +11,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;


@Service
public class WxCouponSendConfigServiceImpl implements WxCouponSendConfigService {
@@ -36,8 +38,10 @@ public class WxCouponSendConfigServiceImpl implements WxCouponSendConfigService
//record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
record.setCreateTime(new Date());
wxCouponSendConfigMapper.insertSelective(record);
} else {
record.setUpdateTime(new Date());
wxCouponSendConfigMapper.updateByPrimaryKeySelective(record);
}
}


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