|
@@ -1,25 +1,21 @@
|
|
package com.care.client.controller;
|
|
package com.care.client.controller;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
-import com.care.bms.service.BmsEventOrderService;
|
|
|
|
|
|
+import com.care.client.service.PassportService;
|
|
|
|
+import com.care.client.service.PinanbaoService;
|
|
|
|
+import com.care.client.vo.HouseContactVO;
|
|
|
|
+import com.care.client.vo.MemberInfoVO;
|
|
import com.care.common.annotation.Permission;
|
|
import com.care.common.annotation.Permission;
|
|
-import com.care.common.enums.OrderStatusEnum;
|
|
|
|
import com.care.common.exception.BDException;
|
|
import com.care.common.exception.BDException;
|
|
-import com.care.common.util.PageResult;
|
|
|
|
import com.care.common.util.Result;
|
|
import com.care.common.util.Result;
|
|
-import com.care.common.util.WebPageUtils;
|
|
|
|
-import com.care.common.vo.PageReqVO;
|
|
|
|
-import com.care.common.vo.UserLogindConvertVO;
|
|
|
|
-import com.care.common.vo.event.*;
|
|
|
|
-import com.care.common.vo.outcall.CcCallResultVO;
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
-import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -29,175 +25,36 @@ import java.util.List;
|
|
* @Desc:
|
|
* @Desc:
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
-@Api(value = "EventHandleController", tags = { "我的紧急联系人" })
|
|
|
|
|
|
+@Api(value = "ContactApiController", tags = { "我的紧急联系人" })
|
|
@Slf4j
|
|
@Slf4j
|
|
@RequestMapping("/pinanbao/contact")
|
|
@RequestMapping("/pinanbao/contact")
|
|
@Permission
|
|
@Permission
|
|
public class ContactApiController {
|
|
public class ContactApiController {
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private BmsEventOrderService bmsEventOrderService;
|
|
|
|
-
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private PinanbaoService pinanbaoService;
|
|
|
|
+ @Resource
|
|
|
|
+ private PassportService passportService;
|
|
|
|
|
|
/**
|
|
/**
|
|
- *未处理事件查询 分页
|
|
|
|
|
|
+ * 紧急联系人列表
|
|
* @param request
|
|
* @param request
|
|
- * @param pageReqVo
|
|
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @GetMapping("/not-handle/list")
|
|
|
|
- @ApiOperation(tags = {"未处理事件"},value = "未处理事件查询-分页")
|
|
|
|
- public PageResult<List<EventOrderVO>> listNotHandle(HttpServletRequest request, @RequestHeader(value = "token") String token,
|
|
|
|
- PageReqVO pageReqVo){
|
|
|
|
|
|
+ @GetMapping("/my/list")
|
|
|
|
+ @ApiOperation(tags = {"我的紧急联系人"},value = "紧急联系人列表")
|
|
|
|
+ public Result<List<HouseContactVO>> myHouseContactList(HttpServletRequest request, @RequestHeader(value = "token") String token){
|
|
|
|
+ MemberInfoVO current = passportService.checkToken(token);
|
|
try {
|
|
try {
|
|
- UserLogindConvertVO loginUser = WebPageUtils.getCurrentLoginedUser(request);
|
|
|
|
- IPage<EventOrderVO> pageResponse = this.bmsEventOrderService.listEvent(OrderStatusEnum.TODO.getValue(), null,loginUser ,pageReqVo);
|
|
|
|
- return PageResult.success(pageResponse.getRecords(),pageResponse.getCurrent(),pageResponse.getSize(),pageResponse.getTotal());
|
|
|
|
|
|
+ List<HouseContactVO> datas = pinanbaoService.queryContactByMemberId(current.getId());
|
|
|
|
+ return Result.success(datas);
|
|
}catch (BDException e) {
|
|
}catch (BDException e) {
|
|
- log.error("未处理事件查询-分页列表出现异常",e);
|
|
|
|
- return PageResult.error(e.getMessage());
|
|
|
|
|
|
+ return Result.error(e.getMessage());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.error("事件处理: 未处理事件查询出现异常",e);
|
|
|
|
- return PageResult.error( "获取列表失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- @GetMapping("/my-handle/list")
|
|
|
|
- @ApiOperation(tags = {"我的处理事件"},value = "我的处理事件查询 分页")
|
|
|
|
- @ApiImplicitParams(value = {
|
|
|
|
- @ApiImplicitParam(paramType = "header", name = "status", value = "状态"),
|
|
|
|
- @ApiImplicitParam(paramType = "query", name = "status", value = "状态"),
|
|
|
|
- @ApiImplicitParam(paramType = "query", name = "olderName", value = "老人姓名"),
|
|
|
|
- })
|
|
|
|
- public PageResult<List<EventOrderVO>> listMyHandle(HttpServletRequest request,@RequestHeader(value = "token") String token,
|
|
|
|
- @RequestParam(value = "status", required = false) String status,
|
|
|
|
- @RequestParam(value = "olderName", required = false) String olderName,
|
|
|
|
- PageReqVO pageReqVo){
|
|
|
|
- try {
|
|
|
|
- UserLogindConvertVO loginUser = WebPageUtils.getCurrentLoginedUser(request);
|
|
|
|
- IPage<EventOrderVO> pageResponse = this.bmsEventOrderService.listEvent4MyDo(status, olderName,loginUser ,pageReqVo);
|
|
|
|
- return PageResult.success(pageResponse.getRecords(),pageResponse.getCurrent(),pageResponse.getSize(),pageResponse.getTotal());
|
|
|
|
- }catch (BDException e) {
|
|
|
|
- log.error("我的处理事件查询-分页列表出现异常",e);
|
|
|
|
- return PageResult.error(e.getMessage());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error("事件处理: 未处理事件查询出现异常",e);
|
|
|
|
- return PageResult.error( "获取列表失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping("/list")
|
|
|
|
- @ApiOperation(tags = {"事件查询"},value = "事件查询 分页")
|
|
|
|
- public PageResult<List<EventOrderVO>> list(HttpServletRequest request,
|
|
|
|
- @RequestParam(value = "status", required = false) String status,
|
|
|
|
- @RequestParam(value = "olderName", required = false) String olderName,
|
|
|
|
- PageReqVO pageReqVo){
|
|
|
|
- try {
|
|
|
|
- UserLogindConvertVO loginUser = WebPageUtils.getCurrentLoginedUser(request);
|
|
|
|
- IPage<EventOrderVO> pageResponse = this.bmsEventOrderService.listEvent(status, olderName,loginUser ,pageReqVo);
|
|
|
|
- return PageResult.success(pageResponse.getRecords(),pageResponse.getCurrent(),pageResponse.getSize(),pageResponse.getTotal());
|
|
|
|
- }catch (BDException e) {
|
|
|
|
- log.error("我的处理事件查询-分页列表出现异常",e);
|
|
|
|
- return PageResult.error(e.getMessage());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error("事件处理: 未处理事件查询出现异常",e);
|
|
|
|
- return PageResult.error( "获取列表失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- @PostMapping("/receive/{orderId}")
|
|
|
|
- @ApiOperation(tags = {"未处理事件"},value = "立即处理-领取工单")
|
|
|
|
- public Result<Object> receiveOrder(HttpServletRequest request,@RequestHeader("token") String token,@PathVariable("orderId") Long orderId){
|
|
|
|
- UserLogindConvertVO loginUser = WebPageUtils.getCurrentLoginedUser(request);
|
|
|
|
- this.bmsEventOrderService.receiveOrder(orderId,loginUser);
|
|
|
|
- return Result.success("领取工单成功!");
|
|
|
|
- }
|
|
|
|
- @GetMapping("/getEventInfo/{orderId}")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "事件详情")
|
|
|
|
- public Result<EventOrderVO> getEventInfo(HttpServletRequest request,@RequestHeader("token") String token,@PathVariable("orderId") Long orderId){
|
|
|
|
- EventOrderVO orderInfo = this.bmsEventOrderService.getOrderInfo(orderId);
|
|
|
|
- return Result.success("查询成功!",orderInfo);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping("/getOlderList/{orderId}")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "被监护人信息列表")
|
|
|
|
- public Result<List<OrderOlderVO>> getOlderInfo(HttpServletRequest request,@RequestHeader("token") String token,@PathVariable("orderId") Long orderId){
|
|
|
|
- List<OrderOlderVO> older = this.bmsEventOrderService.queryOrderOlderList(orderId);
|
|
|
|
- return Result.success("查询成功!",older);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping("/queryDoHis/{orderId}")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "事件处理历史记录")
|
|
|
|
- public Result<List<OrderHandleHisVO>> queryDoHis(HttpServletRequest request, @RequestHeader("token") String token, @PathVariable("orderId") Long orderId){
|
|
|
|
- return Result.success("查询成功!",this.bmsEventOrderService.queryOrderHandleHis(orderId));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping("/queryContactList/{orderId}")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "跟事件相关的联系人列表")
|
|
|
|
- public Result<Object> queryContactList(HttpServletRequest request,@RequestHeader("token") String token,@PathVariable("orderId") Long orderId){
|
|
|
|
- return Result.success("查询成功!",this.bmsEventOrderService.queryContactList(orderId));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @PostMapping("/complete/{orderId}")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "完成工单")
|
|
|
|
- public Result<Object> complete(HttpServletRequest request,@RequestHeader("token") String token,@PathVariable("orderId") Long orderId){
|
|
|
|
- this.bmsEventOrderService.updateOrderStatus(orderId,OrderStatusEnum.COMPLETE);
|
|
|
|
- return Result.success("操作成功!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping("/keyAuth/list/{orderId}")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "钥匙申请列表")
|
|
|
|
- public Result<List<OrderKeyApplyVO>> queryKeyAuthList(HttpServletRequest request, @RequestHeader("token") String token, @PathVariable("orderId") Long orderId){
|
|
|
|
- return Result.success("查询成功!",this.bmsEventOrderService.queryKeyAuthList(orderId));
|
|
|
|
- }
|
|
|
|
- @PostMapping("/key/auth/{applyId}")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "钥匙授权")
|
|
|
|
- public Result<Object> keyAuth(HttpServletRequest request,@RequestHeader("token") String token,@PathVariable("applyId") Long applyId){
|
|
|
|
- UserLogindConvertVO loginUser = WebPageUtils.getCurrentLoginedUser(request);
|
|
|
|
- if (this.bmsEventOrderService.keyAuth(applyId,loginUser)) {
|
|
|
|
- return Result.success("钥匙授权成功!");
|
|
|
|
- }else{
|
|
|
|
- return Result.error("钥匙授权失败!");
|
|
|
|
|
|
+ log.error("我的紧急联系人: 紧急联系人列表查询出现异常",e);
|
|
|
|
+ return Result.error( "获取失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- @PostMapping("/contact/updateStatus/{orderContactId}/{status}")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "更新联系人状态")
|
|
|
|
- public Result<Object> updateOrderContactStatus(HttpServletRequest request,@RequestHeader("token") String token,
|
|
|
|
- @PathVariable("orderContactId") Long orderContactId,
|
|
|
|
- @PathVariable("status") Integer status){
|
|
|
|
- UserLogindConvertVO loginUser = WebPageUtils.getCurrentLoginedUser(request);
|
|
|
|
- if (this.bmsEventOrderService.updateOrderContactStatus(orderContactId,status,loginUser)) {
|
|
|
|
- return Result.success("更新成功!");
|
|
|
|
- }else{
|
|
|
|
- return Result.error("更新失败!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- @PostMapping("/sendSms")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "发送短信")
|
|
|
|
- public Result<Object> sendSms(HttpServletRequest request,@RequestHeader("token") String token,@PathVariable("orderId") Long orderId){
|
|
|
|
- UserLogindConvertVO loginUser = WebPageUtils.getCurrentLoginedUser(request);
|
|
|
|
|
|
|
|
- return Result.success("发送短信成功!");
|
|
|
|
- }
|
|
|
|
- @GetMapping("/getCallRadio/{hisId}")
|
|
|
|
- @ApiOperation(tags = {"事件处理"},value = "获取通话录音")
|
|
|
|
- public Result<Object> getCallRadio(HttpServletRequest request,@RequestHeader("token") String token,@PathVariable("hisId") Long hisId){
|
|
|
|
- CcCallResultVO ccCallResultVO = this.bmsEventOrderService.getCallRadio(hisId);
|
|
|
|
- if (ccCallResultVO != null) {
|
|
|
|
- return Result.success("获取通话录音!");
|
|
|
|
- }else{
|
|
|
|
- return Result.error("通话记录不存在!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- @GetMapping("/stat")
|
|
|
|
- @ApiOperation(tags = {"事件查询"},value = "查询事件统计信息")
|
|
|
|
- public Result<Object> stat(HttpServletRequest request,@RequestHeader("token") String token){
|
|
|
|
- UserLogindConvertVO loginUser = WebPageUtils.getCurrentLoginedUser(request);
|
|
|
|
- EventStaVO ccCallResultVO = this.bmsEventOrderService.statOrder(loginUser);
|
|
|
|
- if (ccCallResultVO != null) {
|
|
|
|
- return Result.success("查询成功!");
|
|
|
|
- }else{
|
|
|
|
- return Result.error("查询失败!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
}
|
|
}
|