Browse Source

Merge remote-tracking branch 'origin/yantai_zhengwu_master' into dev

master
yinzuomei 3 years ago
parent
commit
2f27344841
  1. 19
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java
  2. 5
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java
  3. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java
  4. 19
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java
  5. 16
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml

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

@ -11,11 +11,9 @@ import com.epmet.dto.result.CorrelationTagListResultDTO;
import com.epmet.dto.result.TagInfoResultDTO; import com.epmet.dto.result.TagInfoResultDTO;
import com.epmet.service.TagCustomerService; import com.epmet.service.TagCustomerService;
import com.epmet.service.TagService; import com.epmet.service.TagService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -146,4 +144,17 @@ public class TagController {
tagCustomerService.initTagScope(tokenDto.getCustomerId()); tagCustomerService.initTagScope(tokenDto.getCustomerId());
return new Result(); return new Result();
} }
/**
* 钉钉实时动态获取网格所属社区下 的标签列表 只返回tagIdtagName
* @param gridId
* @return
*/
@PostMapping("getAgencyTag/{gridId}")
public Result<List<TagCustomerDTO>> getAgencyTag(@PathVariable("gridId")String gridId){
if(StringUtils.isBlank(gridId)){
return new Result<>();
}
return new Result<List<TagCustomerDTO>>().ok(tagCustomerService.getAgencyTag(gridId));
}
} }

5
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java

@ -65,4 +65,9 @@ public interface TagCustomerDao extends BaseDao<TagCustomerEntity> {
*/ */
List<TagCustomerDTO> pageList(@Param("customerId") String customerId, @Param("tagName")String tagName); List<TagCustomerDTO> pageList(@Param("customerId") String customerId, @Param("tagName")String tagName);
/**
* 钉钉实时动态获取网格所属社区下 的标签列表
* 只返回tagIdtagName
*/
List<TagCustomerDTO> getAgencyTag(@Param("agencyId")String agencyId,@Param("customerId") String customerId);
} }

10
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java

@ -25,6 +25,8 @@ import com.epmet.dto.form.TagCustomerPageFormDTO;
import com.epmet.dto.result.UpdateTagUseCountsResultDTO; import com.epmet.dto.result.UpdateTagUseCountsResultDTO;
import com.epmet.entity.TagCustomerEntity; import com.epmet.entity.TagCustomerEntity;
import java.util.List;
/** /**
* 客户标签表 * 客户标签表
* *
@ -104,4 +106,12 @@ public interface TagCustomerService extends BaseService<TagCustomerEntity> {
* @return * @return
*/ */
void initTagScope(String customerId); void initTagScope(String customerId);
/**
* 钉钉实时动态获取网格所属社区下 的标签列表
* 只返回tagIdtagName
* @param gridId
* @return
*/
List<TagCustomerDTO> getAgencyTag(String gridId);
} }

19
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java

@ -25,6 +25,8 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -247,4 +249,21 @@ public class TagCustomerServiceImpl extends BaseServiceImpl<TagCustomerDao, TagC
} }
/**
* 钉钉实时动态获取网格所属社区下 的标签列表
* 只返回tagIdtagName
*
* @param gridId
* @return
*/
@Override
public List<TagCustomerDTO> getAgencyTag(String gridId) {
GridInfoCache gridInfoCache= CustomerOrgRedis.getGridInfo(gridId);
if(null==gridInfoCache){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询网格信息异常gridId:"+gridId,"查询网格信息异常");
}
List<TagCustomerDTO> list=baseDao.getAgencyTag(gridInfoCache.getPid(),gridInfoCache.getCustomerId());
return list;
}
} }

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

@ -75,4 +75,20 @@
and tc.TAG_NAME like concat('%',#{tagName},'%') and tc.TAG_NAME like concat('%',#{tagName},'%')
</if> </if>
</select> </select>
<!-- 钉钉实时动态,获取网格所属社区下, 的标签列表 -->
<select id="getAgencyTag" parameterType="map" resultType="com.epmet.dto.TagCustomerDTO">
SELECT
tc.id,
tc.TAG_NAME
FROM
tag_scope ts
INNER JOIN tag_customer tc ON ( ts.TAG_ID = tc.id AND ts.CUSTOMER_ID = tc.CUSTOMER_ID )
WHERE
ts.CUSTOMER_ID = #{customerId}
AND tc.CUSTOMER_ID
AND ts.AGENCY_ID = #{agencyId}
ORDER BY
convert(tc.TAG_NAME USING gbk) ASC;
</select>
</mapper> </mapper>

Loading…
Cancel
Save