Browse Source

/gov/voice/tag/queryAgencyTag

dev
yinzuomei 2 years ago
parent
commit
cdd94bd7e9
  1. 11
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java
  2. 8
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java
  3. 25
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java
  4. 3
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml

11
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<List<TagCustomerDTO>>().ok(tagCustomerService.getAgencyTag(gridId));
}
/**
* 工作端获取登录用户所属组织下的标签列表
*
* @param tokenDto
* @return
*/
@PostMapping("queryAgencyTag")
public Result<List<TagInfoResultDTO>> queryAgencyTag(@LoginUser TokenDto tokenDto) {
return new Result<List<TagInfoResultDTO>>().ok(tagCustomerService.queryAgencyTag(tokenDto.getCustomerId(),tokenDto.getUserId()));
}
}

8
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<TagCustomerEntity> {
* @return
*/
List<TagCustomerDTO> getAgencyTag(String gridId);
/**
* 工作端获取登录用户所属组织下的标签列表
* @param staffId
* @return
*/
List<TagInfoResultDTO> queryAgencyTag(String customerId,String staffId);
}

25
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<TagCustomerDao, TagC
List<TagCustomerDTO> list=baseDao.getAgencyTag(gridInfoCache.getPid(),gridInfoCache.getCustomerId());
return list;
}
/**
* 工作端获取登录用户所属组织下的标签列表
*
* @param staffId
* @return
*/
@Override
public List<TagInfoResultDTO> queryAgencyTag(String customerId,String staffId) {
CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(customerId,staffId);
List<TagCustomerDTO> list=baseDao.getAgencyTag(staffInfoCacheResult.getAgencyId(),customerId);
List<TagInfoResultDTO> 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;
}
}

3
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml

@ -80,7 +80,8 @@
<select id="getAgencyTag" parameterType="map" resultType="com.epmet.dto.TagCustomerDTO">
SELECT
tc.id,
tc.TAG_NAME
tc.TAG_NAME,
tc.TAG_COLOR as tagColor
FROM
tag_scope ts
INNER JOIN tag_customer tc ON ( ts.TAG_ID = tc.id AND ts.CUSTOMER_ID = tc.CUSTOMER_ID )

Loading…
Cancel
Save