Commit 071fc320417dc29c20f9ded2c2dc3b1f93e45f0b

Authored by changpengfei
1 parent b831afc27f
Exists in master

聊天记录+结束问诊

Showing 2 changed files with 38 additions and 0 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ChatGroupController.java View file @ 071fc32
... ... @@ -15,6 +15,7 @@
15 15 import org.springframework.web.bind.annotation.RequestMapping;
16 16 import org.springframework.web.bind.annotation.RestController;
17 17  
  18 +import java.util.Date;
18 19 import java.util.HashMap;
19 20 import java.util.List;
20 21 import java.util.Map;
... ... @@ -79,6 +80,7 @@
79 80 @PostMapping("saveMsg")
80 81 public BaseResponse saveMsg(LymsMessage message) {
81 82 BaseResponse baseResponse = new BaseResponse();
  83 + message.setSendtime(new Date());
82 84 boolean f = lymsMessageService.saveOrUpdate(message);
83 85 baseResponse.setErrorcode(f == true ? 0 : 1);
84 86 return baseResponse;
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/CommonController.java View file @ 071fc32
  1 +package com.lyms.talkonlineweb.controller;
  2 +
  3 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  4 +import com.fasterxml.jackson.databind.ser.Serializers;
  5 +import com.lyms.talkonlineweb.domain.LymsTkrecord;
  6 +import com.lyms.talkonlineweb.result.BaseResponse;
  7 +import com.lyms.talkonlineweb.service.LymsTkrecordService;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.GetMapping;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import java.util.Collections;
  14 +import java.util.List;
  15 +
  16 +@RestController
  17 +@RequestMapping("com")
  18 +public class CommonController {
  19 + @Autowired
  20 + private LymsTkrecordService lymsTkrecordService;
  21 +
  22 + @GetMapping("endTalk")
  23 + public BaseResponse endTalk(LymsTkrecord tkrecord){
  24 + BaseResponse baseResponse=new BaseResponse();
  25 + tkrecord.setStat(0);
  26 + baseResponse.setErrorcode(1);
  27 + List<LymsTkrecord> tLst=lymsTkrecordService.list(Wrappers.query(tkrecord));
  28 + if (tLst.size()>0){
  29 + tkrecord=tLst.get(0);
  30 + tkrecord.setStat(1);
  31 + boolean f=lymsTkrecordService.save(tkrecord);
  32 + baseResponse.setErrorcode(f==true?0:1);
  33 + }
  34 + return baseResponse;
  35 + }
  36 +}