协议新增分类

This commit is contained in:
SjS 2025-04-26 16:08:04 +08:00
parent 5e0bfd58eb
commit 9686247e80
3 changed files with 10 additions and 4 deletions

View File

@ -46,8 +46,6 @@ public class Ad extends BaseEntity implements LogBizParam
@Excel(name = "运营区id")
@ApiModelProperty("运营区id")
@NotNull(message = "运营区ID不能为空", groups = {ValidGroup.Create.class})
@Min(value = 1, message = "运营区ID需大于0")
private Long areaId;
@Excel(name = "跳转链接")

View File

@ -1,6 +1,7 @@
package com.ruoyi.bst.ad.service.impl;
import com.ruoyi.bst.ad.domain.Ad;
import com.ruoyi.bst.ad.domain.enums.AdBlong;
import com.ruoyi.bst.ad.service.AdConverter;
import org.springframework.stereotype.Service;
@ -15,8 +16,11 @@ public class AdConverterImpl implements AdConverter {
return null;
}
Ad po = new Ad();
po.setAreaId(null);
// 基础信息
po.setAreaId(data.getAreaId());
if (po.getBelong().equals(AdBlong.STORE.getCode())) {
po.setAreaId(data.getAreaId());
}
po.setType(data.getType());
po.setPicture(data.getPicture());
po.setBelong(data.getBelong());
@ -32,7 +36,10 @@ public class AdConverterImpl implements AdConverter {
}
Ad po = new Ad();
// 基础信息
po.setAdId(data.getAdId());
po.setAreaId(null);
if (po.getBelong().equals(AdBlong.STORE.getCode())) {
po.setAreaId(data.getAreaId());
}
po.setAreaId(data.getAreaId());
po.setType(data.getType());
po.setPicture(data.getPicture());

View File

@ -114,6 +114,7 @@ public class AdController extends BaseController
if (!adValidator.canEdit(ad.getAdId())){
return AjaxResult.error("您没有权限修改id为" + ad.getAdId() + "的广告信息");
}
adConverter.toPoByUpdate(ad);
return toAjax(adService.updateAd(ad));
}