Переглянути джерело

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

release_toaliyun_real
Burce 6 роки тому
джерело
коміт
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.controller.base.BaseController;
import com.iformall.domain.po.WxCouponSendConfig; import com.iformall.domain.po.WxCouponSendConfig;
import com.iformall.enums.EnumCouponSendSendType; import com.iformall.enums.EnumCouponSendSendType;
import com.iformall.enums.EnumValidStatus;
import com.iformall.service.WxCouponSendConfigService; import com.iformall.service.WxCouponSendConfigService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -38,8 +39,13 @@ public class WxCouponSendConfigController extends BaseController {
PageInfo<WxCouponSendConfig> page = wxCouponSendConfigService.listAsPage(wxCouponSendConfig, 1, 1); PageInfo<WxCouponSendConfig> page = wxCouponSendConfigService.listAsPage(wxCouponSendConfig, 1, 1);
if (page.getSize() > 0) { if (page.getSize() > 0) {
return new ResultData(page.getList().get(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; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;


import java.util.Date;



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


Завантаження…
Відмінити
Зберегти