diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java index a23f93d4a0..42b845210c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java @@ -165,4 +165,15 @@ public class TagController { } return new Result>().ok(tagCustomerService.getAgencyTag(gridId)); } + + /** + * 工作端获取登录用户所属组织下的标签列表 + * + * @param tokenDto + * @return + */ + @PostMapping("queryAgencyTag") + public Result> queryAgencyTag(@LoginUser TokenDto tokenDto) { + return new Result>().ok(tagCustomerService.queryAgencyTag(tokenDto.getCustomerId(),tokenDto.getUserId())); + } } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java index bd27a21f14..9bf4022967 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.TagCustomerDTO; import com.epmet.dto.form.TagCustomerFormDTO; import com.epmet.dto.form.TagCustomerPageFormDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.dto.result.UpdateTagUseCountsResultDTO; import com.epmet.entity.TagCustomerEntity; @@ -114,4 +115,11 @@ public interface TagCustomerService extends BaseService { * @return */ List getAgencyTag(String gridId); + + /** + * 工作端获取登录用户所属组织下的标签列表 + * @param staffId + * @return + */ + List queryAgencyTag(String customerId,String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java index 0ba38de2d5..dd37b13abf 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java @@ -22,10 +22,12 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; @@ -37,6 +39,7 @@ import com.epmet.dto.form.TagCustomerFormDTO; import com.epmet.dto.form.TagCustomerPageFormDTO; import com.epmet.dto.form.UpdateTagFormDTO; import com.epmet.dto.result.AgencyResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.dto.result.UpdateTagUseCountsResultDTO; import com.epmet.entity.TagCustomerEntity; import com.epmet.entity.TagScopeEntity; @@ -54,6 +57,7 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -266,4 +270,25 @@ public class TagCustomerServiceImpl extends BaseServiceImpl list=baseDao.getAgencyTag(gridInfoCache.getPid(),gridInfoCache.getCustomerId()); return list; } + + /** + * 工作端获取登录用户所属组织下的标签列表 + * + * @param staffId + * @return + */ + @Override + public List queryAgencyTag(String customerId,String staffId) { + CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(customerId,staffId); + List list=baseDao.getAgencyTag(staffInfoCacheResult.getAgencyId(),customerId); + List resultDTOList=new ArrayList<>(); + list.forEach(tagCustomerDTO->{ + TagInfoResultDTO resultDTO=new TagInfoResultDTO(); + resultDTO.setTagId(tagCustomerDTO.getId()); + resultDTO.setTagColor(tagCustomerDTO.getTagColor()); + resultDTO.setTagName(tagCustomerDTO.getTagName()); + resultDTOList.add(resultDTO); + }); + return resultDTOList; + } } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml index 05778b1921..8d10cda3fa 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml @@ -80,7 +80,8 @@