|
@ -1,6 +1,8 @@
|
|
|
package com.yihu.wlyy.web.common.im;
|
|
|
|
|
|
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.util.ImUtill;
|
|
|
import io.swagger.annotations.Api;
|
|
@ -26,12 +28,14 @@ public class imController extends BaseController {
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private SignFamilyDao signFamilyDao;
|
|
|
@Autowired
|
|
|
private DoctorDao doctorDao;
|
|
|
|
|
|
/**
|
|
|
* 获取列表
|
|
|
* status = 10 已结束的咨询,status=0,reply = 1 已回复 ,status=0,reply=0未回复
|
|
|
* 第一次列表为当前医生(很可能团队长)待回复列表 传参:doctor有后台获取 status=0,reply=0未回复
|
|
|
* 后 取团队内单各医生的咨询情况 doctor、status、reply均有前端传入
|
|
|
* 后 取团队内单个医生的咨询情况 doctor、status、reply均有前端传入
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
@ -49,16 +53,30 @@ public class imController extends BaseController {
|
|
|
doctor = getUID();
|
|
|
}
|
|
|
String consult = ImUtill.getConsultByStatus(doctor, status, reply, page, pagesize);
|
|
|
// Doctor dct = doctorDao.findByCode(doctor);
|
|
|
/*String photo = dct.getPhoto();
|
|
|
String dctName = dct.getName();*/
|
|
|
JSONArray jsonArray = new JSONArray(consult);
|
|
|
Iterator<Object> it = jsonArray.iterator();
|
|
|
List list = new ArrayList();
|
|
|
while (it.hasNext()) {
|
|
|
Map map = new HashMap();
|
|
|
JSONObject ob = (JSONObject) it.next();
|
|
|
String id = ob.get("id").toString();
|
|
|
String avatar = ob.get("avatar").toString();
|
|
|
String session_id = ob.get("session_id").toString();
|
|
|
String name = ob.get("name").toString();
|
|
|
map.put("name", name);
|
|
|
String name = ob.get("patient_name").toString();
|
|
|
String createTime = ob.get("create_time").toString();
|
|
|
String description = ob.get("description").toString();
|
|
|
String sex = ob.get("sex").toString();
|
|
|
map.put("id", id);
|
|
|
map.put("session_id", session_id);
|
|
|
map.put("photo", avatar);
|
|
|
map.put("patientName", name);
|
|
|
map.put("sex", sex);
|
|
|
map.put("create_time", createTime);
|
|
|
map.put("description", description);
|
|
|
|
|
|
list.add(map);
|
|
|
}
|
|
|
return write(200, "查询成功", "data", list);
|
|
@ -79,6 +97,7 @@ public class imController extends BaseController {
|
|
|
public String getTeamData() {
|
|
|
try {
|
|
|
String uid = getUID();
|
|
|
// String uid = "6c0cfe5065e011e69f7c005056850d66";
|
|
|
List<Map<String, Object>> doctors = getMemberByDoctor(uid);
|
|
|
JSONObject json = new JSONObject();
|
|
|
List list = new ArrayList();
|
|
@ -114,7 +133,7 @@ public class imController extends BaseController {
|
|
|
json.put("totalReply", countReply);
|
|
|
json.put("totalConsult", countConsult);
|
|
|
json.put("doctors", list);
|
|
|
return write(200, "查询成功");
|
|
|
return write(200, "查询成功", "data", json);
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "查询失败!");
|
|
@ -159,9 +178,9 @@ public class imController extends BaseController {
|
|
|
// 2.判断团队长和当前咨询居民是否存在签约关系
|
|
|
String doctor = getUID();
|
|
|
// Boolean flag = consultTeamService.getConsultByPatient(patient,doctor);
|
|
|
int count = signFamilyDao.findByPatientAndDoctor(patient,doctor);
|
|
|
boolean flag = (count ==0)? false : true;
|
|
|
return write(200, "查询成功", "data", flag);
|
|
|
int count = signFamilyDao.findByPatientAndDoctor(patient, doctor);
|
|
|
boolean flag = (count == 0) ? false : true;
|
|
|
return write(200, "查询成功", "data", flag);
|
|
|
// return write(200, "查询成功");
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|