Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan 5 years ago
parent
commit
26ae8797dd

+ 27 - 5
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java

@ -42,7 +42,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    /**
     * 查询医生信息分页列表
     * 查询医生信息分页列表.
     * @param city
     * @param hospital
     * @param status
@ -57,7 +57,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
                " LEFT JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
                " LEFT JOIN (SELECT * FROM wlyy_charge_dict t WHERE t.dept_type_code ='6') e ON a.charge_type = e.charge_type " +
                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " WHERE " +
                " 1 = 1";
@ -110,7 +110,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
                " LEFT JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
                " LEFT JOIN (SELECT * FROM wlyy_charge_dict t WHERE t.dept_type_code ='6') e ON a.charge_type = e.charge_type " +
                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " WHERE 1=1";
        if (StringUtils.isNotBlank(city)){
@ -210,7 +210,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            for(int i=0;i<jsonArray.size();i++){
                JSONObject doctor = jsonArray.getJSONObject(i);
                try {
                    update(doctor);
                    updateInfo(doctor);
                }catch (Exception e){
                    logger.info("update doctor error:"+e.toString());
                }
@ -265,6 +265,17 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        return true;
    }
    public Boolean updateInfo(JSONObject jsonObject)throws Exception{
        //取出数据
        String doctorId = jsonObject.get("doctorId").toString();
        String introduce = jsonObject.get("introduce").toString();
        String expertise = jsonObject.get("expertise").toString();
        String photo = jsonObject.get("photo").toString();
        String outpatientType = jsonObject.get("outpatientType").toString();
        baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
        return true;
    }
    /**
     * 修改医生状态
@ -300,7 +311,18 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    }
//    public static void main(String ag[]){
//        String str = "[{\"doctor\",\"1\"},{\"doctor\",\"2\"}]";
//        String str = "[ " +
//                "{ " +
//                "\"title\":\"Java 开发\", " +
//                "\"edition\":3, " +
//                "\"author\":[\"smith\",\"张三\",\"李四\"] " +
//                "}, " +
//                "{ " +
//                "\"title\":\"Web 开发\", " +
//                "\"edition\":3, " +
//                "\"author\":[\"Allen\",\"王五\",\"赵六\"] " +
//                "} " +
//                "]";
//        JSONArray json = JSONArray.fromObject(str);
//        for(int i=0;i<json.size();i++){
//            JSONObject doctor = json.getJSONObject(i);

+ 19 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -673,6 +673,7 @@ public class ImService {
		}
		InputStream is = null;
		String url = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=" + accessToken + "&media_id=" + mediaId;
		logger.info("media/get"+url);
		try {
			URL urlGet = new URL(url);
			HttpURLConnection http = (HttpURLConnection) urlGet.openConnection();
@ -686,6 +687,7 @@ public class ImService {
			// 获取文件转化为byte流
			is = http.getInputStream();
		} catch (Exception e) {
			logger.info(e.getMessage());
			e.printStackTrace();
		}
		return is;
@ -2378,4 +2380,21 @@ public class ImService {
			redisTemplate.opsForValue().set("video_invite_"+session_id,"0");
		}
	}
	
	/**
	 * 查询会话视频邀请状态
	 * @param doctorids
	 * @return
	 * @throws Exception
	 */
	public List<Map<String,Object>>  getDoctorConsultCount(String doctorids) throws Exception{
		//医生角色
		String sql = "SELECT " +
				"count(id) AS total," +
				"doctor " +
				"FROM wlyy_consult_team " +
				"WHERE doctor IN ("+doctorids+") AND (type=1 OR type=15) and status = 0 GROUP BY doctor";
		List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
		return list;
	}
}

+ 3 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -410,6 +410,9 @@ public class BaseHospitalRequestMapping {
        
        // 居民导诊会话发送消息
        public static final String patientGuaidenceAppend = "patientGuaidenceAppend";
    
        //居民端:查询正医生当前咨询人数
        public static final String getDoctorConsultCount="getDoctorConsultCount";
    }
    

+ 1 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -742,4 +742,5 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		return success("查询成功",status);
		
	}
}

+ 10 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -24,6 +24,7 @@ import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.util.common.FileUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.jw.wechat.service.WechatInfoService;
@ -579,5 +580,13 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		return success(result);
	}
	
	
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.getDoctorConsultCount)
	@ApiOperation(value = "医生端:查询会话视频邀请状态", notes = "医生端:查询会话视频邀请状态")
	public Envelop getDoctorConsultCount(@ApiParam(name = "doctorids", value = "会话ID")
	                                     @RequestParam(value = "doctorids",required = true) String doctorids)throws Exception  {
		return success("查询成功",imService.getDoctorConsultCount(doctorids));
		
	}
}