Commit abb42b0c by 章家宝

feat:新增接口根据手机号查询录音解析情况

1 parent b6adf109
package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.InspectionCustomerTagDTO;
import cn.com.glsx.dj.mindworkplate.dto.InspectionCustomerTagByPhonesRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.InspectionCustomerTagPageRequestDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
......@@ -9,6 +10,8 @@ import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
@ApiService(value = "智享车生活-客户标签分析结果管理", owner = "linyj")
public interface InspectionCustomerTagRemote {
......@@ -16,4 +19,9 @@ public interface InspectionCustomerTagRemote {
@ApiParam(name = "req", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("客户标签分析结果列表")
RpcResponse<RpcPagination<InspectionCustomerTagDTO>> inspectionCustomerTagPage(RpcPagination<InspectionCustomerTagPageRequestDTO> req);
@ApiMethod("根据手机号列表查询客户标签分析结果")
@ApiParam(name = "req", notes = "查询条件(包含手机号列表)", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("客户标签分析结果列表")
RpcResponse<List<InspectionCustomerTagDTO>> queryByPhoneNumbers(InspectionCustomerTagByPhonesRequestDTO req);
}
......@@ -51,7 +51,7 @@
<dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-mindworkplate-api</artifactId>
<version>5.8.2-SNAPSHOT</version>
<version>5.8.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
......
......@@ -37,4 +37,14 @@ public interface InspectionCustomerTagMapper extends OreMapper<InspectionCustome
* 分页查询客户标签分析结果(关联客户手机号)
*/
List<InspectionCustomerTagDTO> selectPageList(@Param("req") InspectionCustomerTagPageRequestDTO req);
/**
* 根据手机号列表查询客户标签分析结果
*
* @param phoneNumbers 手机号列表
* @param resultFlag 结果状态(可选)
* @return 标签结果列表
*/
List<InspectionCustomerTagDTO> selectByPhoneNumbers(@Param("phoneNumbers") List<String> phoneNumbers,
@Param("resultFlag") Integer resultFlag);
}
package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.InspectionCustomerTagDTO;
import cn.com.glsx.dj.mindworkplate.dto.InspectionCustomerTagByPhonesRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.InspectionCustomerTagPageRequestDTO;
import cn.com.glsx.dj.mindworkplate.service.InspectionCustomerTagService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
......@@ -11,6 +12,8 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@DubboService(protocol = "dubbo")
public class InspectionCustomerTagRemoteImpl implements InspectionCustomerTagRemote {
......@@ -28,4 +31,15 @@ public class InspectionCustomerTagRemoteImpl implements InspectionCustomerTagRem
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<InspectionCustomerTagDTO>> queryByPhoneNumbers(InspectionCustomerTagByPhonesRequestDTO req) {
try {
List<InspectionCustomerTagDTO> list = inspectionCustomerTagService.queryByPhoneNumbers(req);
return RpcResponse.success(list);
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
......@@ -3,6 +3,7 @@ package cn.com.glsx.dj.mindworkplate.service;
import cn.com.glsx.dj.mindworkplate.client.CustomerTagApiClient;
import cn.com.glsx.dj.mindworkplate.client.CustomerTagResult;
import cn.com.glsx.dj.mindworkplate.dto.InspectionCustomerTagDTO;
import cn.com.glsx.dj.mindworkplate.dto.InspectionCustomerTagByPhonesRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.InspectionCustomerTagPageRequestDTO;
import cn.com.glsx.dj.mindworkplate.mapper.InspectionCustomerTagMapper;
import cn.com.glsx.dj.mindworkplate.model.ConversationBatch;
......@@ -15,7 +16,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Collections;
import java.util.Date;
import java.util.List;
......@@ -137,4 +140,26 @@ public class InspectionCustomerTagService {
List<InspectionCustomerTagDTO> list = inspectionCustomerTagMapper.selectPageList(requestDTO);
return (Page<InspectionCustomerTagDTO>) list;
}
/**
* 根据手机号列表查询客户标签分析结果
*
* @param req 查询条件(包含手机号列表)
* @return 标签结果列表
*/
public List<InspectionCustomerTagDTO> queryByPhoneNumbers(InspectionCustomerTagByPhonesRequestDTO req) {
if (req == null || CollectionUtils.isEmpty(req.getPhoneNumbers())) {
log.warn("手机号列表为空,返回空列表");
return Collections.emptyList();
}
log.info("根据手机号列表查询客户标签,phoneNumbers.size={}, resultFlag={}",
req.getPhoneNumbers().size(), req.getResultFlag());
List<InspectionCustomerTagDTO> list = inspectionCustomerTagMapper.selectByPhoneNumbers(
req.getPhoneNumbers(), req.getResultFlag());
log.info("查询完成,结果数量={}", list.size());
return list;
}
}
......@@ -99,4 +99,32 @@
ORDER BY t.created_date DESC
</select>
<select id="selectByPhoneNumbers" resultMap="DTOResultMap">
SELECT
t.id,
t.batch_id,
t.record_id,
t.task_id,
t.result_flag,
t.tag_result,
t.err_message,
t.created_by,
t.created_date,
t.updated_by,
t.updated_date,
rci.phone_number AS customer_phone
FROM inspection_customer_tag t
LEFT JOIN inspection_conversation_batch icb ON t.batch_id = icb.id
LEFT JOIN reception_customer_info rci ON icb.task_id = rci.id
WHERE t.deleted_flag = 'N'
AND rci.phone_number IN
<foreach collection="phoneNumbers" item="phone" open="(" separator="," close=")">
#{phone}
</foreach>
<if test="resultFlag != null">
AND t.result_flag = #{resultFlag}
</if>
ORDER BY t.created_date DESC
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!