Browse Source

orgIdPath

dev
yinzuomei 3 years ago
parent
commit
66d975ecf3
  1. 6
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagScopeDTO.java
  2. 8
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java

6
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagScopeDTO.java

@ -1,7 +1,9 @@
package com.epmet.dto;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -11,6 +13,8 @@ import java.io.Serializable;
*/
@Data
public class TagScopeDTO implements Serializable {
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 标签ID
*/
@ -19,10 +23,12 @@ public class TagScopeDTO implements Serializable {
/**
* 应用范围这里只能是社区id
*/
@NotBlank(message = "agencyId不能为空",groups = AddUserShowGroup.class)
private String agencyId;
/**
* agency_id全路径包含自身
*/
@NotBlank(message = "orgIdPath不能为空",groups = AddUserShowGroup.class)
private String orgIdPath;
}

8
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java

@ -6,11 +6,13 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.TagCustomerDTO;
import com.epmet.dto.TagScopeDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CorrelationTagListResultDTO;
import com.epmet.dto.result.TagInfoResultDTO;
import com.epmet.service.TagCustomerService;
import com.epmet.service.TagService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -103,6 +105,9 @@ public class TagController {
@PostMapping("save")
public Result save(@LoginUser TokenDto tokenDto,@RequestBody TagCustomerFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
if(CollectionUtils.isNotEmpty(formDTO.getAgencyList())){
ValidatorUtils.validateEntity(formDTO.getAgencyList(), TagScopeDTO.AddUserShowGroup.class);
}
ValidatorUtils.validateEntity(formDTO,TagCustomerFormDTO.AddUserShowGroup.class,TagCustomerFormDTO.AddUserInternalGroup.class);
tagCustomerService.save(formDTO);
return new Result();
@ -117,6 +122,9 @@ public class TagController {
@PostMapping("update")
public Result update(@LoginUser TokenDto tokenDto,@RequestBody TagCustomerFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
if(CollectionUtils.isNotEmpty(formDTO.getAgencyList())){
ValidatorUtils.validateEntity(formDTO.getAgencyList(), TagScopeDTO.AddUserShowGroup.class);
}
ValidatorUtils.validateEntity(formDTO,TagCustomerFormDTO.UpdateUserShowGroup.class,TagCustomerFormDTO.UpdateUserInternalGroup.class);
tagCustomerService.update(formDTO);
return new Result();

Loading…
Cancel
Save