|
|
@ -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(); |
|
|
|