fix: mobile client adjust

This commit is contained in:
AgAngle
2025-04-03 17:52:03 +08:00
committed by jianxing
parent 5600e00c40
commit edb0078765
16 changed files with 22 additions and 22 deletions

View File

@@ -1,7 +1,6 @@
package io.cordys.common.resolver.field;
import io.cordys.common.constants.RuleValidatorConstants;
import io.cordys.common.exception.GenericException;
import io.cordys.common.util.JSON;
import io.cordys.common.util.Translator;
@@ -54,14 +53,7 @@ public abstract class AbstractModuleFieldResolver<T extends BaseField> {
}
protected void validateRequired(T customField, Object value) {
if (!hasValidatorKey(customField.getRules(), RuleValidatorConstants.REQUIRED)) {
return;
}
if (value == null
|| (value instanceof String && StringUtils.isBlank(value.toString()))
|| (value instanceof List listValue && CollectionUtils.isEmpty((listValue)))) {
throwValidateException(customField.getName());
}
// 移动端,不一定需要校验必填,暂时不校验
}
protected void validateArray(String name, Object value) {

View File

@@ -1,6 +1,5 @@
package io.cordys.common.resolver.field;
import io.cordys.common.resolver.RadioResolver;
import io.cordys.crm.system.constants.FieldType;
import java.util.HashMap;

View File

@@ -1,7 +1,6 @@
package io.cordys.common.resolver;
package io.cordys.common.resolver.field;
import io.cordys.common.resolver.field.AbstractModuleFieldResolver;
import io.cordys.crm.system.dto.field.RadioField;
/**

View File

@@ -22,7 +22,6 @@ public class ClueAddRequest {
@Schema(description = "客户名称")
private String name;
@NotBlank
@Size(max = 32)
@Schema(description = "负责人")
private String owner;

View File

@@ -224,6 +224,9 @@ public class ClueService {
clue.setId(IDGenerator.nextStr());
clue.setStage(ClueStatus.NEW.name());
clue.setInSharedPool(false);
if (StringUtils.isBlank(request.getOwner())) {
clue.setOwner(userId);
}
// 校验名称重复
checkAddExist(clue);

View File

@@ -1,10 +1,6 @@
package io.cordys.crm.customer.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.cordys.common.constants.PermissionConstants;
import io.cordys.common.pager.PageUtils;
import io.cordys.common.pager.Pager;
import io.cordys.common.pager.PagerWithOption;
import io.cordys.context.OrganizationContext;
import io.cordys.crm.follow.domain.FollowUpPlan;

View File

@@ -22,7 +22,6 @@ public class CustomerAddRequest {
@Schema(description = "客户名称")
private String name;
@NotBlank
@Size(max = 32)
@Schema(description = "负责人")
private String owner;

View File

@@ -21,7 +21,6 @@ public class CustomerContactAddRequest {
@Schema(description = "客户id", requiredMode = Schema.RequiredMode.REQUIRED)
private String customerId;
@NotBlank
@Size(max = 32)
@Schema(description = "负责人")
private String owner;

View File

@@ -203,6 +203,10 @@ public class CustomerContactService {
customerContact.setOrganizationId(orgId);
customerContact.setId(IDGenerator.nextStr());
customerContact.setEnable(true);
if (StringUtils.isBlank(request.getOwner())) {
customerContact.setOwner(userId);
}
// 校验名称重复
checkAddExist(customerContact);
customerContactMapper.insert(customerContact);

View File

@@ -249,6 +249,9 @@ public class CustomerService {
customer.setOrganizationId(orgId);
customer.setId(IDGenerator.nextStr());
customer.setInSharedPool(false);
if (StringUtils.isBlank(request.getOwner())) {
customer.setOwner(userId);
}
// 校验名称重复
checkAddExist(customer);

View File

@@ -33,7 +33,6 @@ public class FollowUpPlanAddRequest {
private String content;
@Size(max = 32)
@NotBlank
@Schema(description = "负责人", requiredMode = Schema.RequiredMode.REQUIRED)
private String owner;

View File

@@ -36,7 +36,6 @@ public class FollowUpRecordAddRequest {
private Long followTime;
@Size(max = 32)
@NotBlank
@Schema(description = "负责人", requiredMode = Schema.RequiredMode.REQUIRED)
private String owner;

View File

@@ -33,6 +33,7 @@ import io.cordys.crm.system.service.ModuleFormCacheService;
import io.cordys.crm.system.service.ModuleFormService;
import io.cordys.mybatis.BaseMapper;
import jakarta.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -80,6 +81,9 @@ public class FollowUpPlanService extends BaseFollowUpService {
followUpPlan.setCreateUser(userId);
followUpPlan.setId(IDGenerator.nextStr());
followUpPlan.setOrganizationId(orgId);
if (StringUtils.isBlank(request.getOwner())) {
followUpPlan.setOwner(userId);
}
followUpPlanMapper.insert(followUpPlan);
//保存自定义字段
followUpPlanFieldService.saveModuleField(followUpPlan.getId(), orgId, userId, request.getModuleFields());

View File

@@ -90,6 +90,9 @@ public class FollowUpRecordService extends BaseFollowUpService {
followUpRecord.setCreateUser(userId);
followUpRecord.setId(IDGenerator.nextStr());
followUpRecord.setOrganizationId(orgId);
if (StringUtils.isBlank(request.getOwner())) {
followUpRecord.setOwner(userId);
}
followUpRecordMapper.insert(followUpRecord);
//保存自定义字段

View File

@@ -37,7 +37,6 @@ public class OpportunityAddRequest {
private String contactId;
@Size(max = 32)
@NotBlank
@Schema(description = "负责人", requiredMode = Schema.RequiredMode.REQUIRED)
private String owner;

View File

@@ -195,6 +195,9 @@ public class OpportunityService {
opportunity.setUpdateTime(System.currentTimeMillis());
opportunity.setUpdateUser(operatorId);
opportunity.setStatus(true);
if (StringUtils.isBlank(request.getOwner())) {
opportunity.setOwner(operatorId);
}
opportunityMapper.insert(opportunity);
//自定义字段