Commit edaaab59 authored by zhangyingbin's avatar zhangyingbin

96333坐席功能相关接口开发

parent 4681ffab
...@@ -60,5 +60,10 @@ public class TzsCitInfoDto extends BaseDto { ...@@ -60,5 +60,10 @@ public class TzsCitInfoDto extends BaseDto {
private Integer countNum; private Integer countNum;
/**
* 坐席状态
*/
private Integer status;
} }
package com.yeejoin.amos.boot.module.tzs.api.dto;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 96333操作记录日志表Dto
*
* @author duanwei
* @date 2022-12-27
*/
@Data
public class TzsQyLogDto implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "添加时间")
/**
* 添加时间
*/
private String addTime;
@ApiModelProperty(value = "记录日志")
/**
* 记录日志
*/
private String log;
}
package com.yeejoin.amos.boot.module.tzs.api.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 96333操作记录日志表
*
* @author duanwei
* @date 2022-12-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tzs_qy_log")
@ApiModel(value="TzsQyLog对象", description="96333操作记录日志表")
public class TzsQyLog extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "添加时间")
private String addTime;
@ApiModelProperty(value = "记录日志")
private String log;
}
package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzsQyLog;
/**
* 96333操作记录日志表 Mapper 接口
*
* @author duanwei
* @date 2022-12-27
*/
public interface TzsQyLogMapper extends BaseMapper<TzsQyLog> {
}
...@@ -38,4 +38,10 @@ public interface ICtiService { ...@@ -38,4 +38,10 @@ public interface ICtiService {
* @return * @return
*/ */
Map<String, String> downLoadRecordFile(String connectionid); Map<String, String> downLoadRecordFile(String connectionid);
/**
* 获取坐席登录情况
* @return
*/
Map<Object, Object> getUserStatus();
} }
package com.yeejoin.amos.boot.module.tzs.api.service;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzsQyLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 96333操作记录日志表 服务类
*
* @author duanwei
* @date 2022-12-27
*/
public interface ITzsQyLogService extends IService<TzsQyLog> {
}
...@@ -64,6 +64,17 @@ public class CtiController extends BaseController { ...@@ -64,6 +64,17 @@ public class CtiController extends BaseController {
} }
/** /**
* 获取坐席登录情况
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserStatus")
@ApiOperation(httpMethod = "GET", value = "获取坐席状态", notes = "获取坐席坐席状态")
public ResponseModel<Map<Object, Object>> getUserStatus(){
return ResponseHelper.buildResponse(ctiService.getUserStatus());
}
/**
* 获取坐席登陆信息 * 获取坐席登陆信息
* 暴露公网 * 暴露公网
* @return * @return
......
package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzsQyLog;
import com.yeejoin.amos.boot.module.tzs.api.service.ITzsQyLogService;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyModel;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.Arrays;
import java.util.Date;
/**
* 96333操作记录日志表
*
* @author duanwei
* @date 2022-12-27
*/
@RestController
@Api(tags = "96333操作记录日志表Api")
@RequestMapping(value = "/tzs-qy-log", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class TzsQyLogController extends BaseController {
@Autowired
ITzsQyLogService iTzsQyLogService;
/**
* 新增96333操作记录日志表
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增96333操作记录日志表", notes = "新增96333操作记录日志表")
public boolean saveTzsQyLog(HttpServletRequest request,@RequestBody TzsQyLog data){
// AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
// data.setRecUserId(me.getUserId());
// data.setRecUserName(me.getUserName());
// data.setRecDate(new Date());
return iTzsQyLogService.save(data);
}
/**
* 根据id删除
* @param id
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public boolean deleteById(HttpServletRequest request, @PathVariable Long id){
return iTzsQyLogService.removeById(id);
}
/**
* 修改96333操作记录日志表
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改96333操作记录日志表", notes = "修改96333操作记录日志表")
public boolean updateByIdTzsQyLog(HttpServletRequest request, @RequestBody TzsQyLog tzsQyLog){
return iTzsQyLogService.updateById(tzsQyLog);
}
/**
* 根据id查询
* @param id
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public TzsQyLog selectById(HttpServletRequest request, @PathVariable Long id){
return iTzsQyLogService.getById(id);
}
/**
* 列表分页查询
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public IPage<TzsQyLog> listPage(String pageNum,String pageSize,
TzsQyLog tzsQyLog){
Page<TzsQyLog> pageBean;
QueryWrapper<TzsQyLog> tzsQyLogQueryWrapper = new QueryWrapper<>();
Class<? extends TzsQyLog> aClass = tzsQyLog.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
Object o = field.get(tzsQyLog);
if (o != null) {
Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(tzsQyLog);
tzsQyLogQueryWrapper.eq(name, fileValue);
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(tzsQyLog);
tzsQyLogQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(tzsQyLog);
tzsQyLogQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(tzsQyLog);
tzsQyLogQueryWrapper.eq(name, fileValue);
}
}
}catch (Exception e) {
}
});
IPage<TzsQyLog> page;
if (StringUtils.isBlank(pageNum) ||StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
}else{
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iTzsQyLogService.page(pageBean, tzsQyLogQueryWrapper);
return page;
}
}
...@@ -105,6 +105,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -105,6 +105,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Autowired @Autowired
TzsCitInfoServiceImpl citInfoService; TzsCitInfoServiceImpl citInfoService;
@Autowired
CtiServiceImpl ctiService;
@Value("${duty.seats.role.ids}") @Value("${duty.seats.role.ids}")
private String dutySeatsRoleIds; private String dutySeatsRoleIds;
...@@ -398,7 +401,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -398,7 +401,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
//服务评分写死100分 //服务评分写死100分
citInfoDto.setServiceSocre("100"); citInfoDto.setServiceSocre("100");
//在线 //在线
citInfoDto.setIsOnline(true); Map map = ctiService.getUserStatus();
citInfoDto.setStatus(0);
Integer status = (Integer) map.get(citInfo.getCode());
if(!ValidationUtil.isEmpty(status)){
if(status!=0&&status!=1){
status = 2;
}
citInfoDto.setStatus(status);
}
citInfoDto.setCountNum(countNum(citInfo.getCtiUserName())); citInfoDto.setCountNum(countNum(citInfo.getCtiUserName()));
citInfoDtoList.add(citInfoDto); citInfoDtoList.add(citInfoDto);
} }
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -17,7 +18,6 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -17,7 +18,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...@@ -128,6 +128,35 @@ public class CtiServiceImpl implements ICtiService { ...@@ -128,6 +128,35 @@ public class CtiServiceImpl implements ICtiService {
} }
} }
/**
* 获取坐席登录情况
* @return
*/
@Override
public Map<Object, Object> getUserStatus(){
Map<Object, Object> map = new HashMap<>();
String token = this.getAccessToken();
Map<String,Object> params = new HashMap<>();
params.put("accessToken",token);
String loginUrl = ctiUrl + "/cti/getagentinfomonitor" + "?accessToken=" + token;
String responseStr = HttpUtils.doPost(loginUrl,params);
JSONObject response = null;
try {
response = JSONObject.parseObject(responseStr);
} catch (Exception e) {
throw new BadRequest("获取登录状态出错:" + e.getMessage());
}
JSONArray jsonArray = response.getJSONArray("rows");
if(ValidationUtil.isEmpty(jsonArray)){
return map;
}
for (Object object : jsonArray) {
JSONObject jsonObject = JSON.parseObject(String.valueOf(object));
map.put(jsonObject.get("code"),jsonObject.get("state"));
}
return map;
}
@Override @Override
public JSONArray getCallInfo(String serviceconnectionid) { public JSONArray getCallInfo(String serviceconnectionid) {
String token = this.getAccessToken(); String token = this.getAccessToken();
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.yeejoin.amos.boot.module.tzs.api.dto.TzsQyLogDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzsQyLog;
import com.yeejoin.amos.boot.module.tzs.api.mapper.TzsQyLogMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.ITzsQyLogService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 96333操作记录日志表 服务实现类
*
* @author duanwei
* @date 2022-12-27
*/
@Service
public class TzsQyLogServiceImpl extends BaseService<TzsQyLogDto, TzsQyLog, TzsQyLogMapper> implements ITzsQyLogService {
}
...@@ -32,7 +32,13 @@ ...@@ -32,7 +32,13 @@
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId> <artifactId>amos-feign-privilege</artifactId>
<version>1.7.13-SNAPSHOT</version> <version>1.7.14-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
<dependencyManagement>
<dependencies>
</dependencies>
</dependencyManagement>
</project> </project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment