|
@@ -1,13 +1,13 @@
|
|
|
package cn.iocoder.yudao.module.crm.controller.admin.customer.vo.poolconfig;
|
|
|
|
|
|
import cn.hutool.core.util.BooleanUtil;
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
+import jakarta.validation.constraints.AssertTrue;
|
|
|
import lombok.Data;
|
|
|
import lombok.EqualsAndHashCode;
|
|
|
import lombok.ToString;
|
|
|
|
|
|
-import jakarta.validation.constraints.AssertTrue;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
@Schema(description = "管理后台 - CRM 客户公海配置的保存 Request VO")
|
|
@@ -16,19 +16,27 @@ import java.util.Objects;
|
|
|
@ToString(callSuper = true)
|
|
|
public class CrmCustomerPoolConfigSaveReqVO extends CrmCustomerPoolConfigBaseVO {
|
|
|
|
|
|
- // TODO @puhui999:AssertTrue 必须 is 开头哈;注意需要 json 忽略下,避免被序列化;
|
|
|
- @AssertTrue(message = "客户公海规则设置不正确")
|
|
|
- // TODO @puhui999:这个方法,是不是拆成 2 个,一个校验 contactExpireDays、一个校验 dealExpireDays;
|
|
|
- public boolean poolEnableValid() {
|
|
|
+ @AssertTrue(message = "未成交放入公海天数不能为空")
|
|
|
+ @JsonIgnore
|
|
|
+ public boolean isDealExpireDaysValid() {
|
|
|
+ if (!BooleanUtil.isTrue(getEnabled())) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return Objects.nonNull(getDealExpireDays());
|
|
|
+ }
|
|
|
+
|
|
|
+ @AssertTrue(message = "未跟进放入公海天数不能为空")
|
|
|
+ @JsonIgnore
|
|
|
+ public boolean isContactExpireDaysValid() {
|
|
|
if (!BooleanUtil.isTrue(getEnabled())) {
|
|
|
return true;
|
|
|
}
|
|
|
- return ObjectUtil.isAllNotEmpty(getContactExpireDays(), getDealExpireDays());
|
|
|
+ return Objects.nonNull(getContactExpireDays());
|
|
|
}
|
|
|
|
|
|
- @AssertTrue(message = "客户公海规则设置不正确")
|
|
|
- // TODO @puhui999:这个方法,是不是改成 isNotifyDaysValid() 更好点?本质校验的是 notifyDays 是否为空
|
|
|
- public boolean notifyEnableValid() {
|
|
|
+ @AssertTrue(message = "提前提醒天数不能为空")
|
|
|
+ @JsonIgnore
|
|
|
+ public boolean isNotifyDaysValid() {
|
|
|
if (!BooleanUtil.isTrue(getNotifyEnabled())) {
|
|
|
return true;
|
|
|
}
|