|
@ -2,6 +2,8 @@ package com.yihu.wlyy.controller.synergy.customer;
|
|
|
|
|
|
import com.yihu.wlyy.controller.BaseController;
|
|
import com.yihu.wlyy.controller.BaseController;
|
|
import com.yihu.wlyy.entity.User;
|
|
import com.yihu.wlyy.entity.User;
|
|
|
|
import com.yihu.wlyy.entity.call.CallRecord;
|
|
|
|
import com.yihu.wlyy.repository.call.CallRecordDao;
|
|
import com.yihu.wlyy.service.manager.user.UserService;
|
|
import com.yihu.wlyy.service.manager.user.UserService;
|
|
import com.yihu.wlyy.service.synergy.SynergyManageService;
|
|
import com.yihu.wlyy.service.synergy.SynergyManageService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@ -10,6 +12,10 @@ import io.swagger.annotations.ApiParam;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@ -22,14 +28,21 @@ import java.util.Map;
|
|
* Created by 刘文彬 on 2018/9/27.
|
|
* Created by 刘文彬 on 2018/9/27.
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping(value = "/customer/synergy",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
|
|
|
@RequestMapping(value = "/synergy/customer", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
@Api(description = "集美客服系统")
|
|
@Api(description = "集美客服系统")
|
|
public class CustomerSynergyManageController extends BaseController {
|
|
public class CustomerSynergyManageController extends BaseController {
|
|
|
|
|
|
|
|
public static final String CALL_LABEL="CALL_LABEL";
|
|
@Autowired
|
|
@Autowired
|
|
private SynergyManageService synergyManageService;
|
|
private SynergyManageService synergyManageService;
|
|
@Autowired
|
|
@Autowired
|
|
private UserService userService;
|
|
private UserService userService;
|
|
|
|
@Autowired
|
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
@Autowired
|
|
|
|
private CallRecordDao callRecordDao;
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getWorkOrderInfo", method = {RequestMethod.GET, RequestMethod.POST})
|
|
@RequestMapping(value = "/getWorkOrderInfo", method = {RequestMethod.GET, RequestMethod.POST})
|
|
@ApiOperation(value = "获取协同服务工单信息")
|
|
@ApiOperation(value = "获取协同服务工单信息")
|
|
public String getWorkOrderInfo(@ApiParam(name="workorderCode",value="协同服务工单code")
|
|
public String getWorkOrderInfo(@ApiParam(name="workorderCode",value="协同服务工单code")
|
|
@ -39,11 +52,10 @@ public class CustomerSynergyManageController extends BaseController {
|
|
@ApiParam(name="role",value="1医生,2客服管理员,3普通客服")
|
|
@ApiParam(name="role",value="1医生,2客服管理员,3普通客服")
|
|
@RequestParam(required = true)Integer role){
|
|
@RequestParam(required = true)Integer role){
|
|
try {
|
|
try {
|
|
|
|
|
|
return write(200,"保存成功","data", synergyManageService.getWorkOrderInfo(workorderCode, patient, role));
|
|
|
|
|
|
return write(200,"请求成功","data", synergyManageService.getWorkOrderInfo(workorderCode, patient, role));
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
error(e);
|
|
error(e);
|
|
return error(-1,"保存失败");
|
|
|
|
|
|
return error(-1,"请求失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@ -103,15 +115,15 @@ public class CustomerSynergyManageController extends BaseController {
|
|
@ApiParam(name = "isAcceptTask", value = "1、我接收到的任务,2、我派发的任务,3、待接收(客服管理员),4、已接收(客服管理员)", required = true)
|
|
@ApiParam(name = "isAcceptTask", value = "1、我接收到的任务,2、我派发的任务,3、待接收(客服管理员),4、已接收(客服管理员)", required = true)
|
|
@RequestParam(value = "isAcceptTask", required = true)Integer isAcceptTask,
|
|
@RequestParam(value = "isAcceptTask", required = true)Integer isAcceptTask,
|
|
@ApiParam(name = "page", value = "第几页,从1开始", required = true)
|
|
@ApiParam(name = "page", value = "第几页,从1开始", required = true)
|
|
@RequestParam(value = "page", required = false,defaultValue = "1")Integer page,
|
|
|
|
|
|
@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
|
|
@ApiParam(name = "pageSize", value = "每页分页大小", required = true)
|
|
@ApiParam(name = "pageSize", value = "每页分页大小", required = true)
|
|
@RequestParam(value = "pageSize", required = false,defaultValue = "10")Integer pageSize){
|
|
|
|
|
|
@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
|
|
try {
|
|
try {
|
|
if(!StringUtils.isNotEmpty(userCode)){
|
|
if(!StringUtils.isNotEmpty(userCode)){
|
|
userCode = getUID();
|
|
userCode = getUID();
|
|
}
|
|
}
|
|
List<Map<String,Object>> result = synergyManageService.workorderList(userCode,keywords,workorderType,isMyTask,status,priority,timeout,workorderCode,
|
|
|
|
principal,serviceStartTime,serviceEndTime,patientName,ssc,idcard,userType,isAcceptTask);
|
|
|
|
|
|
Map<String,Object> result = synergyManageService.workorderList(userCode,keywords,workorderType,isMyTask,status,priority,timeout,workorderCode,
|
|
|
|
principal,serviceStartTime,serviceEndTime,patientName,ssc,idcard,userType,isAcceptTask,page,pageSize);
|
|
return write(200, "获取成功", "data", result);
|
|
return write(200, "获取成功", "data", result);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
error(e);
|
|
error(e);
|
|
@ -183,4 +195,76 @@ public class CustomerSynergyManageController extends BaseController {
|
|
return error(-1,"获取失败");
|
|
return error(-1,"获取失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "getCallLabelList",method = RequestMethod.GET)
|
|
|
|
@ApiOperation(value = "显示所有通话标签")
|
|
|
|
public String getCallLabelList(){
|
|
|
|
try{
|
|
|
|
String sql ="SELECT `code`,`value`,sort FROM system_dict WHERE dict_name='"+CALL_LABEL+"'";
|
|
|
|
return write(200,"查询成功!","data",jdbcTemplate.queryForList(sql));
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1,"查询失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "saveCallLabel",method = RequestMethod.POST)
|
|
|
|
@ApiOperation(value = "保存所有通话标签")
|
|
|
|
public String saveCallLabel(@ApiParam(name="callCode",value="通话记录code")@RequestParam(required = false)String callCode,
|
|
|
|
@ApiParam(name="callLabels",value="通话标签,多个用逗号隔开")@RequestParam(required = false)String callLabels){
|
|
|
|
try{
|
|
|
|
String sql ="UPDATE manage_call_record SET call_label='"+callLabels+"' WHERE `code`='"+callCode+"'";
|
|
|
|
jdbcTemplate.update(sql);
|
|
|
|
return write(200,"保存成功!");
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1,"保存失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "getCallInfo",method = RequestMethod.GET)
|
|
|
|
@ApiOperation(value = "获取通话的详情")
|
|
|
|
public String getCallTypeAndContent(@ApiParam(name="callCode",value="通话记录code")@RequestParam(required = false)String callCode){
|
|
|
|
try{
|
|
|
|
CallRecord callRecord = callRecordDao.findByCode(callCode);
|
|
|
|
return write(200,"查询成功!","data",callCode);
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1,"查询失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "saveCallInfo",method = RequestMethod.POST)
|
|
|
|
@ApiOperation(value = "显示所有通话标签")
|
|
|
|
public String saveCallInfo(@ApiParam(name="callCode",value="通话记录code")@RequestParam(required = false)String callCode,
|
|
|
|
@ApiParam(name="serviceType",value="服务类型,多个用逗号隔开")@RequestParam(required = false)String serviceType,
|
|
|
|
@ApiParam(name="serviceContent",value="服务记录")@RequestParam(required = false)String serviceContent){
|
|
|
|
try{
|
|
|
|
String sql ="UPDATE manage_call_record SET service_type='"+serviceType+"',service_content='"+serviceContent+"' WHERE `code`='"+callCode+"'";
|
|
|
|
jdbcTemplate.update(sql);
|
|
|
|
return write(200,"保存成功!");
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1,"保存失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/taskSubmit", method = RequestMethod.POST)
|
|
|
|
@ApiOperation(value = "协同任务提交")
|
|
|
|
public String taskSubmit(@ApiParam(name="workorderCode",value="协同服务工单code",required = true)
|
|
|
|
@RequestParam(required = true)String workorderCode,
|
|
|
|
@ApiParam(name="dealResultRemark",value="说明",required = true)
|
|
|
|
@RequestParam(required = true)String dealResultRemark,
|
|
|
|
@ApiParam(name="dealResultAccessory",value="附件路径(多个用逗号隔开)",required = true)
|
|
|
|
@RequestParam(required = true)String dealResultAccessory){
|
|
|
|
try{
|
|
|
|
|
|
|
|
synergyManageService.taskSubmit(workorderCode,dealResultRemark,dealResultAccessory);
|
|
|
|
return write(200,"提交成功");
|
|
|
|
}catch (Exception e){
|
|
|
|
error(e);
|
|
|
|
return error(-1,"提交失败");
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|