wangjun 4 роки тому
батько
коміт
f003273d2c

+ 20 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/rehabilitation/RehabilitationRequestMapping.java

@ -56,6 +56,26 @@ public class RehabilitationRequestMapping {
        public static final String updatePlanStatusById = "/updatePlanStatusById";
        public static final String updatePatientImgById = "/updatePatientImgById";
        public static final String findServicePackageItem = "/findServicePackageItem";
        public static final String findServiceItemInBase = "/findServiceItemInBase";
    }
    public static class PatientRehabilitationManage {
        public static final String Perfix = "/patientRehabilitationManage";
        public static final String patientRehabilitationDetail = "/patientRehabilitationDetail";
        public static final String calendarPlanDetail = "/calendarPlanDetail";
        public static final String serviceDoctorList = "/serviceDoctorList";
        public static final String calendarPlanDetailList = "/calendarPlanDetailList";
        public static final String sendMessageIm = "/sendMessageIm";
        public static final String checkAfterQrCode = "/checkAfterQrCode";
        public static final String saveRehabilitationOperateRecord = "/saveRehabilitationOperateRecord";
        public static final String recentPlanDetailRecord = "/recentPlanDetailRecord";
        public static final String serviceItemList = "/serviceItemList";
        public static final String serviceItem = "/serviceItem";
        public static final String planSchedule = "/planSchedule";
        public static final String updatePatientImgById = "/updatePatientImgById";
        public static final String getServiceItemsAfterStop = "/getServiceItemsAfterStop";
    }
    public static class DoctorRehabilitationManage {

+ 5 - 0
svr/svr-rehabilitation/pom.xml

@ -108,6 +108,11 @@
			<version>2.0.0</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.yihu.jw</groupId>
			<artifactId>im-service</artifactId>
			<version>2.0.0</version>
		</dependency>
	</dependencies>
	<build>

+ 5 - 1
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/config/jpa/HibernateProperties.java

@ -1,3 +1,4 @@
/*
package com.yihu.rehabilitation.config.jpa;
import org.springframework.beans.factory.annotation.Value;
@ -6,9 +7,11 @@ import org.springframework.stereotype.Component;
import java.util.Properties;
*/
/**
 * Created by chenweida on 2017/4/6.
 */
 *//*
@Component
@RefreshScope
public class HibernateProperties {
@ -27,3 +30,4 @@ public class HibernateProperties {
        return properties;
    }
}
*/

+ 3 - 3
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/doctor/DoctorRehabilitationManageController.java

@ -1,6 +1,7 @@
package com.yihu.rehabilitation.controller.doctor;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -11,7 +12,6 @@ import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.rehabilitation.service.RehabilitationManageService;
import com.yihu.rehabilitation.service.RehabilitationPlanService;
import com.yihu.rehabilitation.util.ImUtill;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -33,7 +33,7 @@ public class DoctorRehabilitationManageController extends EnvelopRestEndpoint {
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
    @Autowired
    private ImUtill imUtill;
    private ImUtil imUtill;
    @Autowired
    private RehabilitationPlanService rehabilitationPlanService;
    @Autowired
@ -376,7 +376,7 @@ public class DoctorRehabilitationManageController extends EnvelopRestEndpoint {
                                    @ApiParam(name = "contentJsonStr", value = "contentJsonStr")
                                    @RequestParam(value = "contentJsonStr", required = true) String contentJsonStr){
        try {
            imUtill.sendImMsg(doctorCode,doctorName,sessionId,ImUtill.ContentType.Rehabilitation.getValue(),contentJsonStr,businessType);
            imUtill.sendImMsg(doctorCode,doctorName,sessionId,ImUtil.ContentType.Rehabilitation.getValue(),contentJsonStr,businessType,"");
            return Envelop.getSuccess(SpecialistMapping.api_success);
        }catch (Exception e){
            e.printStackTrace();

+ 15 - 1
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/doctor/DoctorRehabilitationPlanController.java

@ -155,7 +155,6 @@ public class DoctorRehabilitationPlanController extends EnvelopRestEndpoint {
                json.put("doctorName",doctor!=null?doctor.getName():"");
            }
            RehabilitationOperateRecordsDO rehabilitationOperateRecordsDO= toEntity(json.toString(), RehabilitationOperateRecordsDO.class);
            rehabilitationPlanService.saveRehabilitationRecord(rehabilitationOperateRecordsDO);
            return MixEnvelop.getSuccess(SpecialistMapping.api_success,rehabilitationPlanService.saveRehabilitationRecord(rehabilitationOperateRecordsDO));
        }catch (Exception e){
            e.printStackTrace();
@ -205,5 +204,20 @@ public class DoctorRehabilitationPlanController extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = RehabilitationRequestMapping.DoctorRehabilitationPlan.findServiceItemInBase)
    @ApiOperation(value = "查询康复计划项目")
    public ObjEnvelop findServiceItemInBase(@ApiParam(name = "code", value = "项目", required = true)
                                             @RequestParam(value = "code")String code,
                                            @ApiParam(name = "name", value = "项目name", required = true)
                                            @RequestParam(value = "name")String name,
                                            @ApiParam(name = "teamCode", value = "团队code", required = true)
                                                @RequestParam(value = "teamCode")String teamCode){
        try {
            return ObjEnvelop.getSuccess("操作成功",rehabilitationPlanService.findServiceItemInBase( code, name, teamCode));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}

+ 18 - 17
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/patient/PatientRehabilitationManageController.java

@ -9,16 +9,17 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationOperateRecordsDO;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.rehabilitation.RehabilitationRequestMapping;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.rehabilitation.service.RehabilitationManageService;
import com.yihu.rehabilitation.service.RehabilitationPlanService;
import com.yihu.rehabilitation.util.ImUtill;
import com.yihu.rehabilitation.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -32,14 +33,14 @@ import org.springframework.web.bind.annotation.*;
 * Created by 刘文彬 on 2018/8/30.
 */
@RestController
@RequestMapping(value = "/patient/specialist/rehabilitation", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value =  RehabilitationRequestMapping.PatientRehabilitationManage.Perfix, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "居民端-康复管理")
public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
    @Autowired
    private ImUtill imUtill;
    private ImUtil imUtill;
    @Autowired
    private RehabilitationPlanService rehabilitationPlanService;
    @Autowired
@ -47,7 +48,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
    @Autowired
    private BasePatientDao basePatientDao;
    @RequestMapping(value = "patientRehabilitationDetail", method = RequestMethod.GET)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.patientRehabilitationDetail, method = RequestMethod.GET)
    @ApiOperation("康复管理-微信端-居民详情页")
    public ObjEnvelop patientRehabilitationDetail(){
@ -60,7 +61,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "calendarPlanDetail", method = RequestMethod.GET)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.calendarPlanDetail, method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划按日历展示")
    public ObjEnvelop calendarPlanDetail(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                     @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
@ -79,7 +80,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "serviceDoctorList", method = RequestMethod.GET)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.serviceDoctorList, method = RequestMethod.GET)
    @ApiOperation("康复管理-微信端居民服务医生列表")
    public ObjEnvelop serviceDoctorList(){
@ -92,7 +93,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "calendarPlanDetailList", method = RequestMethod.GET)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.calendarPlanDetailList, method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划按列表展示")
    public ObjEnvelop calendarPlanDetailList(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
@ -113,7 +114,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "sendMessageIm", method = RequestMethod.POST)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.sendMessageIm, method = RequestMethod.POST)
    @ApiOperation("康复管理-扫描二维码发送消息")
    public Envelop sendMessageIm(@ApiParam(name = "sendId", value = "发送者id")@RequestParam(value = "sendId", required = true)String sendId,
                                @ApiParam(name = "receiverId", value = "接受者id", required = true)@RequestParam(value = "receiverId", required = true)String receiverId,
@ -128,7 +129,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "checkAfterQrCode", method = RequestMethod.POST)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.checkAfterQrCode, method = RequestMethod.POST)
    @ApiOperation("康复管理-居民扫码后验证是否是关联的居民扫码")
    public ObjEnvelop checkAfterQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                    @ApiParam(name = "patientCode", value = "居民端登录的居民code")@RequestParam(value = "patientCode", required = true)String patientCode){
@ -141,7 +142,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "saveRehabilitationOperateRecord", method = RequestMethod.POST)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.saveRehabilitationOperateRecord, method = RequestMethod.POST)
    @ApiOperation("康复管理-新增operateRecord")
    public MixEnvelop saveRehabilitationOperateRecord(@ApiParam(name = "dataJson", value = "实体json",defaultValue = "{\"rehabilitationDetailId\":\"402803f6657f195301657f4fbd3c0001\",\"patientCode\":\"00\",\"patientName\":\"11\",\"doctorCode\":\"22\",\"doctorName\":\"33\",\"node\":\"jjjjjj\",\"relationRecordType\":\"4\",\"relation_record_code\":\"55\",\"relationRecordImg\":\"666666\",\"status\":\"0\"}")@RequestParam(value = "dataJson", required = true)String dataJson){
        try {
@ -163,7 +164,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "recentPlanDetailRecord", method = RequestMethod.GET)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.recentPlanDetailRecord, method = RequestMethod.GET)
    @ApiOperation("康复管理-近期康复相关记录")
    public ObjEnvelop recentPlanDetailRecord(@ApiParam(name = "patientCode", value = "居民code", required = false)
                                         @RequestParam(value = "patientCode", required = false)String patientCode,
@ -188,7 +189,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "serviceItemList", method = RequestMethod.GET)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.serviceItemList, method = RequestMethod.GET)
    @ApiOperation("康复管理-多个康复计划服务项目内容列表")
    public ObjEnvelop serviceItemList(@ApiParam(name = "planDetailIds", value = "康复计划多个服务项目id(多个‘,’分隔)", required = true)
                                  @RequestParam(value = "planDetailIds", required = true)String planDetailIds){
@ -201,7 +202,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "serviceItem", method = RequestMethod.GET)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.serviceItem, method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划服务项目确认详情页")
    public ObjEnvelop serviceItem(@ApiParam(name = "planDetailId", value = "康复计划服务项目id", required = true)
                              @RequestParam(value = "planDetailId", required = true)String planDetailId){
@ -215,7 +216,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "planSchedule", method = RequestMethod.GET)
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.planSchedule, method = RequestMethod.GET)
    @ApiOperation("康复管理-计划总进度")
    public ObjEnvelop planSchedule(@ApiParam(name = "planId", value = "计划id", required = true)
                               @RequestParam(value = "planId", required = true)String planId,
@ -234,7 +235,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "updatePatientImgById", method = RequestMethod.POST)
    @RequestMapping(value =RehabilitationRequestMapping.PatientRehabilitationManage.updatePatientImgById, method = RequestMethod.POST)
    @ApiOperation("更新康复计划居民签名照/证件照")
    public Envelop updatePatientImgById(@ApiParam(name = "planId", value = "康复计划id", required = true)
                                       @RequestParam(value = "planId")String planId,
@ -250,7 +251,7 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = SpecialistMapping.serviceItem.getServiceItemsAfterStop)
    @GetMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.getServiceItemsAfterStop)
    @ApiOperation(value = "康复管理-中止康复计划结算项目清单")
    public ObjEnvelop getServiceItemsAfterStop(@ApiParam(name = "planId", value = "康复计划id", required = true)
                                               @RequestParam(value = "planId", required = true)String planId){

+ 18 - 18
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationManageService.java

@ -390,8 +390,8 @@ public class RehabilitationManageService {
            planCondition .append(",'"+planIdlist[i]+"'");
        }
        String sql = " select d.* from wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id " +
                " where  d.plan_id in ("+planCondition+") " ;
                " LEFT JOIN base_service_package_item i on i.id = d.hospital_service_item_id " +
                " where  d.plan_id in ("+planCondition+") and i.service_package_id='system' " ;
        if(StringUtils.isNotBlank(executeStartTime)){
            sql += " and d.execute_time>='"+executeStartTime+"' ";
        }
@ -536,8 +536,8 @@ public class RehabilitationManageService {
            planCondition .append(",'"+planIdlist[i]+"'");
        }
        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.code,i.name from wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id  " +
                " where  d.plan_id in ("+planCondition+" )AND  d.execute_time IS NOT NULL  and d.execute_time <>'' " ;
                " LEFT JOIN base_service_package_item i on i.id = d.hospital_service_item_id  " +
                " where  d.plan_id in ("+planCondition+" )AND  d.execute_time IS NOT NULL and i.service_package_id ='system'   and d.execute_time <>'' " ;
        if(searchTask!=null){
            if(searchTask==8){//
                sql+="and d.doctor='"+doctorCode+"' ";
@ -547,10 +547,10 @@ public class RehabilitationManageService {
                sql+=" and i.reserve=1 " ;
            }*/
        }
        if(taskExecutor.equals("1")){ //我的任务
        if("1".equals(taskExecutor)){ //我的任务
            sql+="and d.doctor='"+doctorCode+"' ";
        }
        if(taskExecutor.equals("2")){//他人任务
        if("2".equals(taskExecutor)){//他人任务
            sql+="and d.doctor <>'"+doctorCode+"' ";
        }
        if (StringUtils.isNoneBlank(executeEndTime)&&StringUtils.isNoneBlank(executeStartTime)){
@ -578,12 +578,12 @@ public class RehabilitationManageService {
            planDetailList +=",'"+one+"'";
        }
        String planDetailResult = StringUtils.isNotEmpty(planDetailList)?planDetailList.substring(1):"";
        String sql = "select i.name,i.code,i.content,d.execute_time,d.hospital_name,d.id,d.status,d.type as detailType,d.expense,d.doctor as executeDoctor," +
        String sql = "select i.name,i.code,i.introduce,d.execute_time,d.hospital_name,d.id,d.status,d.type as detailType,d.expense,d.doctor as executeDoctor," +
                " d.doctor_name as executeDoctorName,p.patient ,p.id AS planId,p.create_user as createDoctor,p.create_user_name as createDoctorName, p.status as planStatus  " +
                " from wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id " +
                " LEFT JOIN base_service_package_item i on i.id = d.hospital_service_item_id " +
                " LEFT JOIN wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " where d.id in ("+planDetailResult+") order BY d.execute_time ASC ";
                " where d.id in ("+planDetailResult+")   and i.service_package_id='system'  order BY d.execute_time ASC";
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planCreateName(sql);
        sql = TransforSqlUtl.wlyy_rehabilitation_plan_detailDoctorName(sql);
        List<Map<String,Object>> serviceItemList = jdbcTemplate.queryForList(sql);
@ -684,15 +684,15 @@ public class RehabilitationManageService {
     *
     */
    public ObjEnvelop serviceItem(String planDetailId,String doctorCode,String recordId) throws Exception{
        String sql = "select h.name as title,h.content as content,h.code as itemType,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as executeDoctor, " +
        String sql = "select h.name as title,h.introduce as content,h.code as itemType,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as executeDoctor, " +
                " d.doctor_name as executeDoctorName,p.patient ,p.name as patientName,p.create_user as createDoctor,p.create_user_name as createDoctorName, p.status as planStatus," +
                " p.disease,p.disease_name as diseaseName,p.title as planTitle,d.plan_id as planId,d.relation_code as relationCode,d.frequency_code as frequencyCode,d.remark  "+
                " ,a.appointment_time appointmentTime,a.appointment_doctor appointmentDoctor,a.appointment_doctor_name appointmentDoctorName,d.reservation_type reservationType" +
                " from wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_rehabilitation_service_item h on d.hospital_service_item_id = h.code "+
                " LEFT JOIN base_service_package_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " LEFT JOIN wlyy_plan_detail_appointment a on d.id=.a.rehabilitation_plan_detail_id " +
                " where d.id = '"+planDetailId+"'";
                " where d.id = '"+planDetailId+"' and  h.service_package_id='system'";
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planName2(sql);
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planCreateName(sql);
        sql = TransforSqlUtl.wlyy_plan_detail_appointmentAppDoctorName(sql);
@ -1005,10 +1005,10 @@ public class RehabilitationManageService {
        Map<String,Object> resultMap = new HashMap<>();
        //近期康复相关记录
//        String currentTime = DateUtil.getStringDate();
        String planDetailSql = " select d.*,h.name,h.code,s.complete_time from wlyy_rehabilitation_plan_detail d LEFT JOIN wlyy_rehabilitation_service_item h on d.hospital_service_item_id=h.code" +
        String planDetailSql = " select d.*,h.name,h.code,s.complete_time from wlyy_rehabilitation_plan_detail d LEFT JOIN base_service_package_item h on d.hospital_service_item_id=h.id " +
                " LEFT JOIN wlyy_patient_rehabilitation_plan p on d.plan_id=p.id" +
                " left join wlyy_rehabilitation_operate_records s on s.rehabilitation_detail_id=d.id " +
                " where d.status=1 and p.patient='"+patientCode+"' and d.frequency_code IS NOT NULL AND d.frequency_code <>'' ";
                " where d.status=1 and p.patient='"+patientCode+"' and d.frequency_code IS NOT NULL and h.service_package_id='system'  AND d.frequency_code <>'' ";
        if(StringUtils.isNotEmpty(startTime)){
            planDetailSql += "  and d.execute_Time>='"+startTime+"' ";
        }
@ -1045,8 +1045,8 @@ public class RehabilitationManageService {
            planDetailList.add(map);
        }
        resultMap.put("planDetailList",planDetailList);//康复相关记录列表
        String planDetailCountSql = " select d.status as num from wlyy_rehabilitation_plan_detail d LEFT JOIN wlyy_rehabilitation_service_item h on d.hospital_service_item_id=h.code" +
                "  LEFT JOIN wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where p.patient='"+patientCode+"'";
        String planDetailCountSql = " select d.status as num from wlyy_rehabilitation_plan_detail d LEFT JOIN base_service_package_item h on d.hospital_service_item_id=h.id" +
                "  LEFT JOIN wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where p.patient='"+patientCode+"' and h.service_package_id='system' ";
        List<Map<String,Object>> planDetailList2 = jdbcTemplate.queryForList(planDetailCountSql);
        Integer planDetailFinish = 0;
        Integer planDetailUnfinish = 0;
@ -1658,11 +1658,11 @@ public class RehabilitationManageService {
                "  i.code as item_type " +
                "  FROM" +
                "  wlyy_rehabilitation_plan_detail d" +
                "  LEFT JOIN wlyy_rehabilitation_service_item i ON d.hospital_service_item_id = i.code  "+
                "  LEFT JOIN base_service_package_item i ON d.hospital_service_item_id = i.id  "+
                "  LEFT JOIN wlyy_rehabilitation_operate_records r ON d.id = r.rehabilitation_detail_id" +
                "  WHERE" +
                "  r.`status` = 1" +
                " ) a ON p.id = a.plan_id" +
                " and i.service_package_id='system') a ON p.id = a.plan_id" +
                " WHERE" +
                " p.id = '"+planId+"'";
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planName(sql);

+ 55 - 21
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationPlanService.java

@ -146,7 +146,7 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
        }
        throw new Exception("请求获取模板列表失败!");
    }*/
    public List<RehabilitationDetailDO> createRehabilitationDetail(List<RehabilitationDetailDO> details, String planId) {
    public List<RehabilitationDetailDO> createRehabilitationDetail(List<RehabilitationDetailDO> details, String planId,String createUser,String createUserName) {
        for(RehabilitationDetailDO detail : details) {
            /*List<String> list = new ArrayList<>();
            list.add(detail.getHospitalServiceItemId());
@ -158,6 +158,8 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
            detail.setCreateTime(new Date());
            detail.setStatus(0);
            detail.setUpdateTime(new Date());
            detail.setCreateUser(createUser);
            detail.setCreateUserName(createUserName);
        }
        return (List<RehabilitationDetailDO>)rehabilitationDetailDao.save(details);
    }
@ -187,29 +189,31 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
            String executeTimes = jsonObject.getString("executeTimes");
            String[] executeTime = executeTimes.split(",");
            List<String> list = new ArrayList<>();
            for (int i=0;i<executeTime.length;i++){
                List<String> times = getFrequencyDate(frequency.getCode(),executeTime[i],frequency.getUnit(),frequency.getTime(),timeType);
                for (int j=0;j<times.size();j++){
                    if (list!=null&&list.size()!=0){
                        if (!list.contains(times.get(j))){
            if (StringUtils.isNoneBlank(executeTimes)){
                for (int i=0;i<executeTime.length;i++){
                    List<String> times = getFrequencyDate(frequency.getCode(),executeTime[i],frequency.getUnit(),frequency.getTime(),timeType);
                    for (int j=0;j<times.size();j++){
                        if (list!=null&&list.size()!=0){
                            if (!list.contains(times.get(j))){
                                list.add(times.get(j));
                            }
                        }else {
                            list.add(times.get(j));
                        }
                    }else {
                        list.add(times.get(j));
                    }
                }
            }
            StringBuffer buffer = new StringBuffer();
            if(list!=null&&list.size()!=0){
                for (int i=0;i<list.size();i++){
                    buffer.append(list.get(i)+",");
                }
                if (StringUtils.isNoneBlank(buffer)){
                    buffer.deleteCharAt(buffer.length()-1);
                StringBuffer buffer = new StringBuffer();
                if(list!=null&&list.size()!=0){
                    for (int i=0;i<list.size();i++){
                        buffer.append(list.get(i)+",");
                    }
                    if (StringUtils.isNoneBlank(buffer)){
                        buffer.deleteCharAt(buffer.length()-1);
                    }
                }
                jsonObject.put("executeTime",buffer);
            }
            jsonObject.remove("executeTimes");
            jsonObject.put("executeTime",buffer);
        }
        object.put("createUser", doctor.getId());
        object.put("createUserName", doctor.getName());
@ -217,8 +221,10 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm"));
        List<RehabilitationDetailDO> details = objectMapper.readValue(planDetails, new TypeReference<List<RehabilitationDetailDO>>(){});
        PatientRehabilitationPlanDO planDO = objectMapper.readValue(json.toString(), PatientRehabilitationPlanDO.class);
        planDO.setCreateUser(doctor.getId());
        planDO.setCreateUserName(doctor.getName());
        planDO = createPatientRehabilitationPlan(planDO);
        details = createRehabilitationDetail(details, planDO.getId());
        details = createRehabilitationDetail(details, planDO.getId(),doctor.getId(),doctor.getName());
        //康复计划创建完给执行者发送消息
        String planId = null;
        HashSet set = new HashSet();
@ -279,8 +285,8 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
            }else {
                // 得到文件的完整名称  xxx.txt
                InputStream inputStream = ipt;
                uploadVO = fileUploadService.uploadStream(inputStream,originalFilename,fastdfs_file_url);
                /*InputStream inputStream = ipt;*/
                uploadVO = fileUploadService.uploadStream(ipt,originalFilename,fastdfs_file_url);
            }
            fileUrl = uploadVO.getFullUri();
        }
@ -782,7 +788,7 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
        rehabilitationOperateRecordsDO.setUpdateTime(new Date());
        rehabilitationOperateRecordsDO.setStatus(rehabilitationOperateRecordsDO.getStatus());
        if (StringUtils.isEmpty(rehabilitationOperateRecordsDO.getPatientName())){
            String sql ="select name from base_patient where code='"+rehabilitationOperateRecordsDO.getPatientCode()+"'";
            String sql ="select name from base_patient where id='"+rehabilitationOperateRecordsDO.getPatientCode()+"'";
            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
            if (list!=null && list.size()>0){
                rehabilitationOperateRecordsDO.setPatientName(String.valueOf(list.get(0).get("name")));
@ -884,4 +890,32 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
        }
        return ObjEnvelop.getSuccess("操作成功",listPackage);
    }
    public  List<Map<String, Object>>  findServiceItemInBase(String code,String name,String teamCode){
        String sql = "select t.id as \"id\"," +
                " t.code as \"code\"," +
                " t.name as \"name\"," +
                " t.service_package_id as \"servicePackageId\"," +
                " t.price as \"price\"," +
                " t.fee_type as \"feeType\"," +
                " t.org_code as \"orgCode\"," +
                " t.org_name as \"orgName\"," +
                " t.introduce as \"introduce\"," +
                " t.del as \"del\"," +
                " t.team_code as \"teamCode\"," +
                " t.team_name as \"teamName\"," +
                " t.create_time as \"createTime\"," +
                " t.dict_id as \"dictId\"" +
                " from base_service_package_item t where 1=1 and t.service_package_id ='system' and t.del ='1'";
        if (StringUtils.isNoneBlank(teamCode)) {
            sql += " and t.team_code ='" + teamCode + "'";
        }
        if (StringUtils.isNoneBlank(code)) {
            sql += " and t.code ='" + code + "'";
        }
        if (StringUtils.isNoneBlank(name)) {
            sql += " and t.name ='" + name + "'";
        }
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql);
        return list;
    }
}

Різницю між файлами не показано, бо вона завелика
+ 0 - 221
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/util/HttpUtil.java


+ 0 - 639
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/util/ImUtill.java

@ -1,639 +0,0 @@
package com.yihu.rehabilitation.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
 * Created by 卓 on 2017/1/13.
 */
@Component
public class ImUtill {
    @Autowired
    private com.yihu.jw.util.http.HttpClientUtil HttpClientUtil;
    @Value("${im.im_list_get}")
    private String im_host;
    public enum ContentType {
        plainText("信息", "1"),
        image("图片信息", "2"),
        audio("创建处方", "3"),
        article("文章信息", "4"),
        goTo("跳转信息,求组其他医生或者邀请其他医生发送的推送消息", "5"),
        topicBegin("议题开始", "6"),
        topicEnd("议题结束", "7"),
        personalCard("个人名片", "18"),
        messageForward("消息转发", "19"),
        topicInto("进入议题", "14"),
        video("视频", "12"),
        system("系统消息", "13"),
        prescriptionCheck("续方审核消息消息", "15"),
        prescriptionBloodStatus("续方咨询血糖血压咨询消息", "16"),
        prescriptionFollowupContent("续方咨询随访问卷消息", "17"),
        Rehabilitation("康复计划发送","20"),
        Reservation("转诊预约发送","21"),
        Know("已知悉","22");
        private String name;
        private String value;
        ContentType(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
    }
    /**
     * 发送消息
     * @param senderId 发送者的code
     * @param receiverId 接受者code
     * @param contentType 消息类型 1二维码内容
     * @param content 消息内容
     * @return
     */
    public String sendMessage(String senderId,String receiverId,String contentType,String content){
        String imAddr = im_host + "api/v2/message/send";
        JSONObject params = new JSONObject();
        params.put("sender_id", senderId);
        params.put("sender_name", receiverId);
        params.put("content_type", contentType);
        params.put("content", content);
        String response = HttpClientUtil.postBody(imAddr, params);
        return response;
    }
    /**
     * 获取医生统计数据
     * status reply 为空值是是该医生总咨询量
     *
     * @param user          团队就把团队的医生合并起来用,隔开(医生编码)
     * @param adminTeamCode
     * @param status
     * @param reply
     * @return
     */
    public String getConsultData(String user, Integer adminTeamCode, Integer status, Integer reply) {
        String imAddr = im_host + "api/v2/sessions/topics/count/reply";
        imAddr = imAddr + "?user=" + user;
        if (status != null) {
            imAddr += ("&status=" + status);
        }
        if (adminTeamCode != null) {
            imAddr += ("&adminTeamCode=" + adminTeamCode);
        }
        if (reply != null) {
            imAddr += ("&reply=" + reply);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
    public void updateTopics(String topicId, String jsonValue) {
        String imAddr = im_host + "api/v2/sessions/" + topicId + "/topics";
        JSONObject params = new JSONObject();
        params.put("topic_id", topicId);
        params.put("data", jsonValue);
        HttpClientUtil.putBody(imAddr, params);
    }
    /**
     * 当前医生下当前团队列表接口
     * 获取团队内医生的健康咨询状况
     * status = 10 已结束的咨询,status=0,reply = 1 已回复 ,status=0,reply=0未回复
     *
     * @param user          团队就把团队的医生合并起来用,隔开(医生编码)
     * @param adminTeamCode 行政团队code
     * @param page
     * @param pagesize
     * @param status
     * @param reply
     * @return
     */
    public String getTeamConsultByStatus(String user, Integer adminTeamCode, Integer status, Integer reply, int page, int pagesize) {
        String imAddr = im_host + "api/v2/sessions/healthTeamTopics";
        imAddr = imAddr + "?user=" + user + "&page=" + page + "&pagesize=" + pagesize;
        if (adminTeamCode != null) {
            imAddr += ("&adminTeamCode=" + adminTeamCode);
        }
        if (status != null) {
            imAddr += ("&status=" + status);
        }
        if (reply != null) {
            imAddr += ("&reply=" + reply);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
    /**
     * 列表接口
     * 获取团队内医生的健康咨询状况
     * status = 10 已结束的咨询,status=0,reply = 1 已回复 ,status=0,reply=0未回复
     *
     * @param user     团队就把团队的医生合并起来用,隔开(医生编码)
     * @param page
     * @param pagesize
     * @param status
     * @param reply
     * @return
     */
    public String getConsultByStatus(String user, Integer status, Integer reply, int page, int pagesize) {
        String imAddr = im_host + "api/v2/sessions/healthTopics";
        imAddr = imAddr + "?user=" + user + "&page=" + page + "&pagesize=" + pagesize;
        if (status != null) {
            imAddr += ("&status=" + status);
        }
        if (reply != null) {
            imAddr += ("&reply=" + reply);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
    /**
     * 咨询列表
     * @param user
     * @param status status = 10 已结束的咨询,status=0,reply = 1 已回复 ,status=0,reply=0未回复
     * @param reply
     * @param type 1、三师咨询,2、家庭医生咨询,6、患者名医咨询 7医生名医咨询 8续方咨询 10医生发起的求助
     * @param page
     * @param pagesize
     * @return
     */
    public String getConsultByStatusAndType(String user,Integer status,Integer reply,Integer type,String patientName,String startTime,String endTime,int page,int pagesize){
        String imAddr = im_host + "api/v2/sessions/topicListByType";
        imAddr = imAddr + "?user="+user + "&page=" + page + "&pagesize=" + pagesize;
        if (status != null) {
            imAddr += ("&status=" + status);
        }
        if (reply != null) {
            imAddr += ("&reply=" + reply);
        }
        if (type != null) {
            imAddr += ("&type=" + type);
        }
        if (patientName != null) {
            imAddr += ("&patientName=" + patientName);
        }
        if (startTime != null) {
            imAddr += ("&startTime=" + startTime);
        }
        if (endTime != null) {
            imAddr += ("&endTime=" + endTime);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
    /**
     * 咨询列表总数
     * @param user
     * @param status status = 10 已结束的咨询,status=0,reply = 1 已回复 ,status=0,reply=0未回复
     * @param reply
     * @param type 1、三师咨询,2、家庭医生咨询,6、患者名医咨询 7医生名医咨询 8续方咨询 10医生发起的求助
     * @return
     */
    public String getConsultCountByStatusAndType(String user,Integer status,Integer reply,Integer type,String patientName,String startTime,String endTime){
        String imAddr = im_host + "api/v2/sessions/topicListCountByType";
        imAddr = imAddr + "?user="+user;
        if (status != null) {
            imAddr += ("&status=" + status);
        }
        if (reply != null) {
            imAddr += ("&reply=" + reply);
        }
        if (type != null) {
            imAddr += ("&type=" + type);
        }
        if (patientName != null) {
            imAddr += ("&patientName=" + patientName);
        }
        if (startTime != null) {
            imAddr += ("&startTime=" + startTime);
        }
        if (endTime != null) {
            imAddr += ("&endTime=" + endTime);
        }
        String response = HttpClientUtil.get(imAddr, "UTF-8");
        return response;
    }
    /**
     * 发送消息给IM
     *
     * @param from        来自
     * @param contentType 1文字 2图片消息
     * @param content     内容
     */
    public String sendImMsg(String from, String fromName, String sessionId, String contentType, String content, String businessType) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/messages";
        JSONObject params = new JSONObject();
        params.put("sender_id", from);
        params.put("sender_name", fromName);
        params.put("content_type", contentType);
        params.put("content", content);
        params.put("session_id", sessionId);
        params.put("business_type", businessType);
        String response = HttpClientUtil.postBody(imAddr, params);
        return response;
    }
    /**
     * 更新会话状态
     *
     * @param sessionId 会话ID
     * @param status    状态
     */
    public String updateSessionStatus(String sessionId, String status) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/status?status=" + status + "&sessionId=" + sessionId;
        JSONObject params = new JSONObject();
        String response = HttpClientUtil.postBody(imAddr, params);
        return response;
    }
    /**
     * 更新会话状态
     *
     * @param sessionId 会话ID
     * @param status    状态
     */
    public String updateTopicEvaluate(String sessionId, String status) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/status?status=" + status + "&sessionId=" + sessionId;
        JSONObject params = new JSONObject();
        String response = HttpClientUtil.postBody(imAddr, params);
        return response;
    }
    /**
     * 发送消息给IM
     *
     * @param from        来自
     * @param contentType 1文字 2图片消息
     * @param content     内容
     */
    public String sendTopicIM(String from, String fromName, String topicId, String contentType, String content, String agent) {
        String url = im_host + "api/v2/sessions/topic/" + topicId + "/messages";
        JSONObject params = new JSONObject();
        params.put("sender_id", from);
        params.put("sender_name", fromName);
        params.put("content_type", contentType);
        params.put("content", content);
        params.put("topic_id", topicId);
        params.put("agent", agent);
        String response = HttpClientUtil.postBody(url, params);
        return response;
    }
    /**
     * 发送进入im消息
     * IM: ParticipantUpdate:'/:session_id/participant/update'
     *
     * @param from
     * @param sessionId
     * @param topicId
     * @return
     */
    public String sendIntoTopicIM(String from, String sessionId, String topicId, String content, String intoUser, String intoUserName) {
        String url = im_host + "api/v2/sessions/" + sessionId + "/topics/" + topicId + "/into";
        JSONObject params = new JSONObject();
        params.put("sender_id", from);
        params.put("topic_id", topicId);
        params.put("into_user", intoUser);
        params.put("into_user_name", intoUserName);
        params.put("content", content);
        String response = HttpClientUtil.postBody(url, params);
        return response;
    }
    /**
     * 更新会话成员(新增或删除)
     * @param sessionId 会话id
     * @param user 新增的成员id
     * @param oldUserId  删除的成员id
     */
    public String updateParticipant(String sessionId, String user,String oldUserId) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/participant/update";
        JSONObject params = new JSONObject();
        params.put("session_id", sessionId );
        params.put("user_id", user );
        if(!StringUtils.isEmpty(oldUserId)){
            params.put("old_user_id", oldUserId);
        }
       return HttpClientUtil.postBody(imAddr, params);
    }
    /**
     * 更新消息内容
     * @param sessionId 会话id
     * @param sessionType 会话类型
     * @param msgId  消息id
     * @param content  消息内容
     */
    public String updateMessage(String sessionId, String sessionType,String msgId,String content) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/messages/"+ msgId +"/update";
        JSONObject params = new JSONObject();
        params.put("session_id", sessionId );
        params.put("session_type", sessionType );
        params.put("message_id", msgId );
        params.put("content", content );
       return HttpClientUtil.postBody(imAddr, params);
    }
    /**
     * 结束议题
     *
     * @param topicId     议题ID
     * @param endUser     结束人
     * @param endUserName 结束人名字
     * @param sessionId   会话ID
     */
    public JSONObject endTopics(String sessionId, String endUser, String endUserName, String topicId) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/topics/" + topicId + "/ended";
        JSONObject params = new JSONObject();
        params.put("session_id", sessionId);
        params.put("end_user", endUser);
        params.put("end_user_name", endUserName);
        params.put("topic_id", topicId);
        String ret = HttpClientUtil.postBody(imAddr, params);
        JSONObject obj = null;
        try {
            obj = JSONObject.parseObject(ret);
        } catch (Exception e) {
            return null;
        }
        return obj;
    }
    /**
     * 议题邀请人员
     *
     * @param user      结束人名字
     * @param sessionId 会话ID
     */
    public void updateTopicUser(String sessionId, String user) {
        String imAddr = im_host + "api/v2/sessions/" + sessionId + "/participants/" + user;
        JSONObject params = new JSONObject();
        params.put("user", user + ":" + 0);
        HttpClientUtil.putBody(imAddr, params);
    }
    /**
     * 创建议题
     *
     * @param topicId      议题ID
     * @param topicName    议题名称
     * @param participants 成员
     */
    public JSONObject createTopics(String sessionId, String topicId, String topicName, JSONObject participants, JSONObject messages, String sessionType) {
        String imAddr = im_host + "api/v2/sessions/" + topicId + "/topics";
        JSONObject params = new JSONObject();
        params.put("topic_id", topicId);
        params.put("topic_name", topicName);
        params.put("participants", participants.toString());
        params.put("messages", messages.toString());
        params.put("session_id", sessionId);
        params.put("session_type", sessionType);
        String ret = HttpClientUtil.postBody(imAddr, params);
        JSONObject obj = null;
        try {
            obj =  JSONObject.parseObject(ret);
        } catch (Exception e) {
            return null;
        }
        return obj;
    }
    /**
     * 判断会话是否存在
     */
    public Boolean sessionIsExist(String sessionId) {
        Boolean re = false;
        String url = im_host + "api/v2/sessions/isExist?session_id="+sessionId;
        JSONObject params = new JSONObject();
        String ret = HttpClientUtil.get(url, "UTF-8");
        JSONObject obj = null;
        try {
            obj = JSONObject.parseObject(ret);
            if(obj.getInteger("status")==200&&sessionId.equals(obj.getString("sessionId"))){
                re = true;
            }
        } catch (Exception e) {
            return null;
        }
        return re;
    }
    /**
     * 创建会话(system)
     */
    public JSONObject createSession(JSONObject participants, String sessionType, String sessionName, String sessionId) {
        String imAddr = im_host + "api/v2/sessions";
        JSONObject params = new JSONObject();
        params.put("participants", participants.toString());
        params.put("session_name", sessionName);
        params.put("session_type", sessionType);
        params.put("session_id", sessionId);
        String ret = HttpClientUtil.postBody(imAddr, params);
        JSONObject obj = null;
        try {
            obj = JSONObject.parseObject(ret);
        } catch (Exception e) {
            return null;
        }
        return obj;
    }
    /**
     * 获取会话实例的消息对象
     *
     * @param senderId
     * @param senderName
     * @param title
     * @param description
     * @param images
     * @param agent
     * @return
     */
    public JSONObject getCreateTopicMessage(String senderId, String senderName, String title, String description, String images, String agent) {
        JSONObject messages = new JSONObject();
        messages.put("description", description);
        messages.put("title", title);
        messages.put("img", images);
        messages.put("sender_id", senderId);
        messages.put("sender_name", senderName);
        messages.put("agent", agent);
        return messages;
    }
    public JSONObject getTopicMessage(String topicId, String startMsgId, String endMsgId, int page, int pagesize, String uid) {
        String url = im_host
                + "api/v2/sessions/topic/" + topicId + "/messages?topic_id=" + topicId + "&end=" + startMsgId
                + "&start=" + (endMsgId == null ? "" : endMsgId) + "&page=" + page + "&pagesize=" + pagesize + "&user=" + uid;
        try {
            String ret = HttpClientUtil.get(url, "UTF-8");
            JSONObject obj = JSONObject.parseObject(ret);
            if (obj.getInteger("status") == -1) {
                throw new RuntimeException(obj.getString("message"));
            } else {
                return obj.getJSONObject("data");
            }
        } catch (Exception e) {
            return null;
        }
    }
    public JSONArray getSessionMessage(String sessionId, String startMsgId, String endMsgId, int page, int pagesize, String uid) {
        String url = im_host + "api/v2/sessions/" + sessionId + "/messages?session_id=" + sessionId + "&user=" + uid + "&start_message_id=" + startMsgId + "&end_message_id=" + endMsgId + "&page=" + page + "&pagesize=" + pagesize;
        try {
            String ret = HttpClientUtil.get(url, "UTF-8");
            JSONArray obj = JSONArray.parseArray(ret);
            return obj;
        } catch (Exception e) {
            return null;
        }
    }
    /**
     * 删除对应的成员信息在MUC模式中
     *
     * @param userId
     * @param oldUserId
     * @param sessionId
     * @return
     */
    public JSONObject deleteMucUser(String userId, String oldUserId, String sessionId) throws Exception {
        String url = im_host + "api/v2/sessions/" + sessionId + "/participant/update";
        try {
            JSONObject params = new JSONObject();
            params.put("user_id", userId);
            params.put("old_user_id", oldUserId);
            params.put("session_id", sessionId);
            String ret = HttpClientUtil.postBody(url, params);
            JSONObject obj = JSONObject.parseObject(ret);
            if (obj.getInteger("status") == -1) {
                throw new RuntimeException("人员更换失败!");
            } else {
                return obj;
            }
        } catch (Exception e) {
            throw new RuntimeException("人员更换失败!");
        }
    }
    /**
     * 获取议题
     *
     * @param topicId
     * @return
     */
    public JSONObject getTopic(String topicId) throws Exception {
        String url = im_host + "api/v2/sessions/topics/" + topicId + "?topic_id=" + topicId;
        try {
            String ret = HttpClientUtil.get(url, "utf-8");
            JSONObject obj = JSONObject.parseObject(ret);
            if (obj.getInteger("status") == -1) {
                throw new RuntimeException("获取议题失败!");
            } else {
                return obj;
            }
        } catch (Exception e) {
            throw new RuntimeException("获取议题失败!");
        }
    }
    /**
     * 获取会话成员
     *
     * @param sessionId
     * @return
     * @throws Exception
     */
    public JSONArray getParticipants(String sessionId) {
        String url = im_host + "api/v2/sessions/" + sessionId + "/participants?session_id=" + sessionId;
        try {
            String ret = HttpClientUtil.get(url, "utf-8");
            return JSONArray.parseArray(ret);
        } catch (Exception e) {
            throw new RuntimeException("获取会话成员!sessionId =" + sessionId);
        }
    }
    /**
     * 获取会话成员
     *
     * @param sessionId
     * @return
     * @throws Exception
     */
    public JSONArray getSessions(String sessionId) {
        String url = im_host + "api/v2/sessions/" + sessionId + "/participants?session_id=" + sessionId;
        try {
            String ret = HttpClientUtil.get(url, "utf-8");
            return JSONArray.parseArray(ret);
        } catch (Exception e) {
            throw new RuntimeException("获取议题失败!");
        }
    }
    public JSONObject cleanMessageToRedis(String sessionId){
        String url = im_host + "api/v2/message/dataMessage?sessionId="+sessionId;
        try {
            String ret = HttpClientUtil.get(url,"utf-8");
            return JSONObject.parseObject(ret);
        } catch (Exception e) {
            throw new RuntimeException("操作失败!");
        }
    }
    public JSONObject cleanMessageLastFetchTime(String sessionId, String userId){
        String url = im_host + "api/v2/message/cleanMessageLastFetchTimeToRedis?sessionId="+sessionId+"&userId="+userId;
        try {
            String ret = HttpClientUtil.get(url,"utf-8");
            return JSONObject.parseObject(ret);
        } catch (Exception e) {
            throw new RuntimeException("操作失败!");
        }
    }
    public static final String SESSION_TYPE_MUC = "1";
    public static final String SESSION_TYPE_P2P = "2";
    public static final String SESSION_TYPE_GROUP = "3";
    public static final String SESSION_TYPE_SYSTEM = "0";
    public static final String SESSION_TYPE_PRESCRIPTION = "8";//续方
    public static final String SESSION_TYPE_EXAMINATION = "9";//在线复诊
    public static final String SESSION_TYPE_ONDOOR_NURSING = "11";//上门护理
    public static final String SESSION_STATUS_PROCEEDINGS = "0";
    public static final String SESSION_STATUS_END = "1";
    public static final String CONTENT_TYPE_TEXT = "1";
}