|
@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.discussion.WlyyTalkGroup;
|
|
|
import com.yihu.wlyy.entity.discussion.WlyyTalkGroupMember;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.service.common.account.PatientService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@ -49,7 +50,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param patientInclude 病人是否加入讨论组
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/create",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/create", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String createTalkGroup(
|
|
|
@RequestParam(required = true) String name,
|
|
@ -57,6 +58,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
@RequestParam(required = true) String talkDoctor,
|
|
|
@RequestParam(required = true) String talkDoctorName,
|
|
|
@RequestParam(required = true) int doctorType,
|
|
|
@RequestParam(required = false) String consult,
|
|
|
@RequestParam(required = false) String patient,
|
|
|
@RequestParam(required = false) String patientName,
|
|
|
@RequestParam(required = false) String patientInclude) {
|
|
@ -96,7 +98,10 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
talkGroup.setCreator(doctor.getCode());
|
|
|
talkGroup.setCreatorName(doctor.getName());
|
|
|
talkGroup.setHospitalCode(doctor.getHospital());
|
|
|
talkGroup.setHospitalName(doctor.getHosptialName());
|
|
|
talkGroup.setHospitalName(doctor.getHospitalName());
|
|
|
if (StringUtils.isNotEmpty(consult)) {
|
|
|
talkGroup.setConsultCode(consult);
|
|
|
}
|
|
|
talkGroup.setPatient(patient);
|
|
|
talkGroup.setPatientName(patientName);
|
|
|
talkGroup.setCzrq(new Date());
|
|
@ -183,16 +188,18 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param name 讨论组名称
|
|
|
* @param type 讨论组类型
|
|
|
* @param members 讨论组成员 [{"doctor":"xxx","doctorName":"xxx","doctorType":1}]
|
|
|
* @param consult 咨询code
|
|
|
* @param patient 患者
|
|
|
* @param patientName 患者姓名
|
|
|
* @param patientInclude 患者是否加入
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/create/members",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/create/members", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String createTalkGroupMany(@RequestParam(required = true) String name,
|
|
|
@RequestParam(required = true) int type,
|
|
|
@RequestParam(required = true) String members,
|
|
|
@RequestParam(required = false) String consult,
|
|
|
@RequestParam(required = false) String patient,
|
|
|
@RequestParam(required = false) String patientName,
|
|
|
@RequestParam(required = false) String patientInclude) {
|
|
@ -229,7 +236,10 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
talkGroup.setCreator(doctor.getCode());
|
|
|
talkGroup.setCreatorName(doctor.getName());
|
|
|
talkGroup.setHospitalCode(doctor.getHospital());
|
|
|
talkGroup.setHospitalName(doctor.getHosptialName());
|
|
|
talkGroup.setHospitalName(doctor.getHospitalName());
|
|
|
if (StringUtils.isNotEmpty(consult)) {
|
|
|
talkGroup.setConsultCode(consult);
|
|
|
}
|
|
|
talkGroup.setPatient(patient);
|
|
|
talkGroup.setPatientName(patientName);
|
|
|
talkGroup.setCzrq(new Date());
|
|
@ -318,6 +328,42 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取查询对应的求助
|
|
|
*
|
|
|
* @param cosnult
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/group/consult", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getConsultTalkGroup(@RequestParam(required = true) String cosnult) {
|
|
|
try {
|
|
|
JSONObject group = talkGroupService.getConsultGroup(cosnult);
|
|
|
|
|
|
return write(200, "查询成功", "data", group);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取常用医生
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/common_doctors", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getCommonDoctors() {
|
|
|
try {
|
|
|
JSONArray result = talkGroupService.getCommonDoctors(getUID());
|
|
|
return write(200, "查询成功", "data", result);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 添加讨论组成员
|
|
|
*
|
|
@ -328,28 +374,35 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param doctorType 医生类型
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "addmember",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "addmember", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String addTalkMember(
|
|
|
@RequestParam(required = true) String groupCode,
|
|
|
@RequestParam(required = true) String groupName,
|
|
|
@RequestParam(required = false) String groupName,
|
|
|
@RequestParam(required = true) String doctor,
|
|
|
@RequestParam(required = true) String doctorName, int doctorType) {
|
|
|
@RequestParam(required = false) String doctorName,
|
|
|
@RequestParam(required = false, defaultValue = "0") int doctorType) {
|
|
|
try {
|
|
|
|
|
|
WlyyTalkGroup group = talkGroupService.findTalkGroup(groupCode);
|
|
|
if(group == null){
|
|
|
return error(-1,"讨论组不存在");
|
|
|
}
|
|
|
if (talkGroupService.isMemberExists(groupCode, groupName)) {
|
|
|
return error(-2, "成员已在该讨论组");
|
|
|
}
|
|
|
|
|
|
WlyyTalkGroupMember member = new WlyyTalkGroupMember();
|
|
|
Doctor doc = doctorService.findDoctorByCode(doctor);
|
|
|
if(doc == null){
|
|
|
return error(-1,"添加的医生的信息查询失败");
|
|
|
}
|
|
|
|
|
|
member.setGroupCode(groupCode);
|
|
|
member.setGroupName(groupName);
|
|
|
member.setGroupName(group.getName());
|
|
|
member.setMemberCode(doctor);
|
|
|
member.setMemberName(doctorName);
|
|
|
member.setMemberName(doc.getName());
|
|
|
member.setStatus(1);
|
|
|
member.setCzrq(new Date());
|
|
|
member.setType(doctorType);
|
|
|
member.setType(doc.getLevel());
|
|
|
|
|
|
talkGroupService.saveTalkMember(member);
|
|
|
|
|
@ -385,9 +438,11 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param members 讨论组成员[{"doctor":"xxx","doctorName":"xxx","doctorType":1}]
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/addmembers",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/addmembers", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String addMembers(String groupCode, String groupName, String members) {
|
|
|
public String addMembers(@RequestParam(required = true)String groupCode,
|
|
|
@RequestParam(required = false)String groupName,
|
|
|
@RequestParam(required = true)String members) {
|
|
|
try {
|
|
|
List<WlyyTalkGroupMember> talkMembers = new ArrayList<>();
|
|
|
JSONArray membersJArray = new JSONArray(members);
|
|
@ -460,7 +515,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param memberCode 讨论组成员标识
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "removemember",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "removemember", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String removeTalkMember(
|
|
|
@RequestParam(required = true) String groupCode,
|
|
@ -480,7 +535,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param members
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/removemembers",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/removemembers", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String removeMembers(String groupCode, String members) {
|
|
|
try {
|
|
@ -500,7 +555,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "mytalkgroups",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "mytalkgroups", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getMyTalkGroup(
|
|
|
@RequestParam(required = false) String doctorName,
|
|
@ -546,7 +601,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param groups
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/group_sign",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/group_sign", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getMyTalkGroupSign(String groups) {
|
|
|
try {
|
|
@ -563,7 +618,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "groupmembers",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "groupmembers", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getTalkGroupMembers(@RequestParam(required = true) String groupCode) {
|
|
|
try {
|
|
@ -606,7 +661,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param patient
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "histories",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "histories", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getTalkGroupHistory(@RequestParam(required = true) String patient) {
|
|
|
try {
|
|
@ -623,7 +678,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param member
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "related",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "related", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getTalkGroupRelated(@RequestParam(required = true) String member, @RequestParam(required = false) String groupType) {
|
|
|
try {
|
|
@ -659,7 +714,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "count",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "count", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getMyTalkGroupCount() {
|
|
|
try {
|
|
@ -677,7 +732,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param doctorName
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/one_to_one_im",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/one_to_one_im", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getOneToOneIm(@RequestParam(required = false) String doctorName
|
|
|
, @RequestParam(required = false) Integer page
|
|
@ -712,7 +767,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param filter 搜索字段
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/doctor_im_search",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/doctor_im_search", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String imSearch(@RequestParam(required = true) String filter) {
|
|
|
try {
|
|
@ -735,7 +790,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param type 类型: 1居民 2医生
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/im_list",method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/im_list", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getImList(@RequestParam(required = true) int type,
|
|
|
@RequestParam(required = true) int page,
|
|
@ -759,7 +814,7 @@ public class DoctorDiscussionGroupController extends BaseController {
|
|
|
* @param type 类型: 1居民 2医生
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/recent_im_list" ,method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/recent_im_list", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public String getRecentImList(@RequestParam(required = true) int type) {
|
|
|
try {
|