Prechádzať zdrojové kódy

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

wangzhinan 7 rokov pred
rodič
commit
eeb54b6301

+ 12 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/DeviceDetailService.java

@ -66,6 +66,8 @@ public class DeviceDetailService extends BaseService {
		String hospital = "";
		String isFirstBind = "";
		String hospitalName = "";
		String doctorCode ="";
		String doctorName="";
		String keyType = "1";
		if ("2".equals(patientDevice.getUserType())){
			keyType="2";
@ -74,10 +76,12 @@ public class DeviceDetailService extends BaseService {
			adminTeam = signFamily.getAdminTeamId();
			hospital = signFamily.getHospital();
			hospitalName = signFamily.getHospitalName();
			doctorCode = signFamily.getDoctor();
			doctorName = signFamily.getDoctorName();
		}
		//设备表没有数据则插入一条数据
		if (deviceDetail==null){
			insertDevice(patientDevice,String.valueOf(adminTeam),hospitalName,hospital,"",1);
			insertDevice(patientDevice,String.valueOf(adminTeam),hospitalName,hospital,"",doctorCode,doctorName,1);
			deviceDetail = deviceDetailDao.findBySn(patientDevice.getDeviceSn());
		}
@ -90,16 +94,16 @@ public class DeviceDetailService extends BaseService {
		}
		if (isFirst){
			String updateFirstSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.grant_time = ?,dd.org_name=?,dd.is_binding=1 where dd.device_code=?";
			jdbcTemplate.update(updateFirstSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,grantTime,hospitalName,patientDevice.getDeviceSn()});
			String updateFirstSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.grant_time = ?,dd.org_name=?,dd.grant_doctor=?,dd.grant_doctor_name=?,dd.is_binding=1 where dd.device_code=?";
			jdbcTemplate.update(updateFirstSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,grantTime,hospitalName,doctorCode,doctorName,patientDevice.getDeviceSn()});
			//deviceDetailDao.updateAfterBindingFirst(String.valueOf(adminTeam),hospital,isFirstBind,grantTime,patientDevice.getDeviceSn());
		}else {
			List<PatientDevice> patientDeviceList = patientDeviceDao.findByDeviceSn(patientDevice.getDeviceSn());
			int patientDeviceSize = patientDeviceList.size();
			String updateSql = "";
			if (bind == 0){
				updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.is_binding=?,dd.org_name=?  where dd.device_code=?";
				jdbcTemplate.update(updateSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,patientDeviceSize,hospitalName,patientDevice.getDeviceSn()});
				updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.is_binding=?,dd.org_name=?,dd.grant_doctor=?,dd.grant_doctor_name=?  where dd.device_code=?";
				jdbcTemplate.update(updateSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,patientDeviceSize,hospitalName,doctorCode,doctorName,patientDevice.getDeviceSn()});
			}else if (bind>0){
				updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.binding_count=?,dd.is_binding=? where dd.device_code=?";
				jdbcTemplate.update(updateSql,new Object[]{isFirstBind,patientDeviceSize,patientDevice.getDeviceSn()});
@ -118,7 +122,7 @@ public class DeviceDetailService extends BaseService {
	 * @param isBind 0未绑定  1已绑定
	 * @throws Exception
	 */
	public void insertDevice(PatientDevice patientDevice, String adminTeam, String orgName, String orgCode,String bindCount,int isBind)throws Exception{
	public void insertDevice(PatientDevice patientDevice, String adminTeam, String orgName, String orgCode,String bindCount,String doctorCode,String doctorName,int isBind)throws Exception{
		//获取原始数据
		DeviceDetail deviceDetail = new DeviceDetail();
		Patient patient = patientDao.findByCode(patientDevice.getUser());
@ -133,6 +137,8 @@ public class DeviceDetailService extends BaseService {
		deviceDetail.setGrantTime(patientDevice.getCzrq());
		deviceDetail.setApplyDate(DateUtil.getStringDate("yyyy-MM-dd HH:mm:ss"));
		deviceDetail.setOrgName(orgName);
		deviceDetail.setGrantDoctor(doctorCode);
		deviceDetail.setGrantDoctorName(doctorName);
		if (isBind>0){
			deviceDetail.setIsGrant(1);
			deviceDetail.setIsBinding(1);

+ 5 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -1214,6 +1214,8 @@ public class PatientDeviceService extends BaseService {
            String orgCode ="";
            String orgName="";
            String bingCount="";
            String doctorCode = "";
            String doctorName = "";
            if (Integer.valueOf(userType)>0){
                bingCount="{\"1\":\"0\",\"2\":\"0\"}";
            }else {
@ -1223,8 +1225,10 @@ public class PatientDeviceService extends BaseService {
                adminTeam = signFamily.getAdminTeamId();
                orgCode = signFamily.getHospital();
                orgName=signFamily.getHospitalName();
                doctorCode = signFamily.getDoctor();
                doctorName = signFamily.getDoctorName();
            }
            deviceDetailService.insertDevice(patientDevice,String.valueOf(adminTeam),orgName,orgCode,bingCount,0);
            deviceDetailService.insertDevice(patientDevice,String.valueOf(adminTeam),orgName,orgCode,bingCount,doctorCode,doctorName,0);
        }
        if (deviceDetail!=null && StringUtils.isNotEmpty(deviceDetail.getBindingCount())){
            JSONObject jsonObject =new JSONObject(String.valueOf(deviceDetail.getBindingCount()));

+ 18 - 18
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -147,7 +147,7 @@ public class SpecialistService extends BaseService {
        param.put("assistant", assistant);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/getAssistantPatientCount", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return rs.getLong("obj");
        }
        return 0L;
@ -160,7 +160,7 @@ public class SpecialistService extends BaseService {
        param.put("size", size);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientNoAssistant", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return rs;
        }
        return rs;
@ -218,7 +218,7 @@ public class SpecialistService extends BaseService {
        param.put("labelCode", labelCode);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/getLabelpatientCount", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return rs.getLong("obj");
        }
        return 0L;
@ -230,7 +230,7 @@ public class SpecialistService extends BaseService {
        param.put("doctor", doctor);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findSpecialistPatientRelationCout", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return rs.getLong("obj");
        }
        return 0L;
@ -241,7 +241,7 @@ public class SpecialistService extends BaseService {
        param.put("doctor", doctor);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findNoLabelPatientRelation", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return rs.getJSONArray("obj");
        }
        return null;
@ -255,7 +255,7 @@ public class SpecialistService extends BaseService {
        param.put("size", size);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientRelatioByAssistant", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return rs.getJSONArray("obj");
        }
        return null;
@ -267,7 +267,7 @@ public class SpecialistService extends BaseService {
        param.put("json", json);
        HttpResponse response = HttpUtils.doPost(specialistUrl + "svr-specialist/saveHealthAssistant", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return rs.getBoolean("obj");
        }
        return false;
@ -364,7 +364,7 @@ public class SpecialistService extends BaseService {
        param.put("size", size);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/getDoctorPatientByName", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return rs.getJSONArray("obj");
        }
        return null;
@ -466,7 +466,7 @@ public class SpecialistService extends BaseService {
            param.put("teamCode", teamCode);
            HttpResponse response = HttpUtils.doPost(specialistUrl + "svr-specialist/signSpecialistTeam", param);
            JSONObject rs = new JSONObject(response.getContent());
            if ("succes".equals(rs.getString("message"))) {
            if ("success".equals(rs.getString("message"))) {
                String[] str = disease.split(",");
                for (String ds : str) {
@ -562,7 +562,7 @@ public class SpecialistService extends BaseService {
        HttpResponse response = HttpUtils.doPost(specialistUrl + "svr-specialist/agreeSpecialistTeam", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            //置空消息
            if (mesId != null) {
@ -653,7 +653,7 @@ public class SpecialistService extends BaseService {
        param.put("code", code);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientSigninfo", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            if (StringUtils.isNoneBlank(messageCode)){
                Message message = messageDao.findByCode(messageCode);
                message.setRead(0);
@ -681,7 +681,7 @@ public class SpecialistService extends BaseService {
        param.put("patient", patient);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientTeamList", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            JSONArray jr = rs.getJSONArray("obj");
            for(int i=0;i<rs.getJSONArray("obj").length();i++){
                JSONObject j = jr.getJSONObject(i);
@ -699,7 +699,7 @@ public class SpecialistService extends BaseService {
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientSignSpecialist", param);
        if(StringUtils.isNotBlank(response.getContent())) {
            JSONObject rs = new JSONObject(response.getContent());
            if ("succes".equals(rs.getString("message"))) {
            if ("success".equals(rs.getString("message"))) {
                return rs.getJSONArray("obj");
            }
        }
@ -712,7 +712,7 @@ public class SpecialistService extends BaseService {
        param.put("doctor", doctor);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientSignSpecialistInfo", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            JSONObject j =rs.getJSONObject("obj");
            String relationCode =  j.getString("relationCode");
            j.put("server",patientDiseaseServerDao.findBySpecialistRelationCodeAndDel(relationCode,"1"));
@ -787,7 +787,7 @@ public class SpecialistService extends BaseService {
            param.put("patient", patient);
            HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findPatientTeamList", param);
            JSONObject rs = new JSONObject(response.getContent());
            if ("succes".equals(rs.getString("message"))) {
            if ("success".equals(rs.getString("message"))) {
                JSONArray jr = rs.getJSONArray("obj");
                if(jr!=null&&jr.length()>0){
                    return true;
@ -806,7 +806,7 @@ public class SpecialistService extends BaseService {
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findDoctorAndDoctorHealthBySpecialDoctor", param);
        if(StringUtils.isNotBlank(response.getContent())) {
            JSONObject rs = new JSONObject(response.getContent());
            if ("succes".equals(rs.getString("message"))) {
            if ("success".equals(rs.getString("message"))) {
                return rs.getJSONArray("obj");
            }
        }
@ -820,7 +820,7 @@ public class SpecialistService extends BaseService {
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findSpecialistSignFamilyPatientCout", param);
        if(StringUtils.isNotBlank(response.getContent())) {
            JSONObject rs = new JSONObject(response.getContent());
            if ("succes".equals(rs.getString("message"))) {
            if ("success".equals(rs.getString("message"))) {
                return rs.getLong("obj");
            }
        }
@ -837,7 +837,7 @@ public class SpecialistService extends BaseService {
        param.put("size", size);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/getSpecialistSignFamilyPatientByName", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return rs.getJSONArray("obj");
        }
        return null;

+ 13 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java

@ -75,7 +75,7 @@ public class RehabilitationManageService extends BaseService {
    private String serviceDoctorList = "/svr-specialist/serviceDoctorList";//康复管理-医生端居民详情服务医生列表
    private String appCalendarPlanDetailList = "/svr-specialist/appCalendarPlanDetailList";//康复管理-app端、微信端计划的服务项目列表
    private String dailyJob = "/svr-specialist/dailyJob";//每日康复服务通知
    private String saveRehabilitationOperateRecodr ="/svr-specialist/saveRehabilitationOperateRecodr";//新增operateRecodr
    private String saveRehabilitationOperateRecord ="/svr-specialist/saveRehabilitationOperateRecord";//新增operateRecodr
    private String updateNoteAndImageRehabilitationOperate ="/svr-specialist/updateNoteAndImageRehabilitationOperate";//康复计划完成时更新服务完成笔记和图片接口;
    private String updatePlanDetailStatusById = "/svr-specialist/updatePlanDetailStatusById";//康复管理-更新康复计划服务项目状态
    /************************************************************* end ************************************************************************/
@ -121,6 +121,10 @@ public class RehabilitationManageService extends BaseService {
                patientCode = json.getJSONObject(i).get("patientCode")+"";
                patient = patientDao.findByCode(patientCode);
                json.getJSONObject(i).put("photo",patient!=null?patient.getPhoto():"");
                Integer age = IdCardUtil.getAgeForIdcard(patient.getIdcard());
                String sex = IdCardUtil.getSexForIdcard_new(patient.getIdcard());
                json.getJSONObject(i).put("age",age);
                json.getJSONObject(i).put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
            }
            return result;
        }
@ -265,7 +269,7 @@ public class RehabilitationManageService extends BaseService {
     * @return
     * @throws Exception
     */
    public void saveGuidanceMessage(String messageId,String doctorCode,String content,String planDetailId) throws Exception{
    public void saveGuidanceMessage(String messageId,String doctorCode,String content,String planDetailId,Integer contentType) throws Exception{
        Doctor doctor = doctorDao.findByCode(doctorCode);
        Integer doctorType = doctor.getLevel();
        Map<String, Object> param = new HashedMap();
@ -275,6 +279,7 @@ public class RehabilitationManageService extends BaseService {
        param.put("doctorType", doctorType);
        param.put("content", content);
        param.put("planDetailId", planDetailId);
        param.put("contentType", contentType);
        HttpResponse response = HttpUtils.doPost(specialistUrl + saveGuidanceMessage, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")!=200){
@ -379,10 +384,10 @@ public class RehabilitationManageService extends BaseService {
        throw new Exception("请求微服务失败!");
    }
    public String createServiceQrCode(String planDetailId,String sessionId) throws Exception{
    public String createServiceQrCode(String planDetailId,String doctorCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planDetailId", planDetailId);
        param.put("sessionId", sessionId);
        param.put("doctorCode", doctorCode);
        //specialistUrl= "http://localhost:10051";
        HttpResponse response = HttpUtils.doPost(specialistUrl + createServiceQrCode, param);
        JSONObject result = new JSONObject(response.getContent());
@ -474,7 +479,7 @@ public class RehabilitationManageService extends BaseService {
    }
    public JSONObject saveRehabilitationOperateRecodr(String dataJson) throws Exception{
    public JSONObject saveRehabilitationOperateRecord(String dataJson) throws Exception{
        Map<String, Object> param = new HashedMap();
        JSONObject json = new JSONObject(dataJson);
        if(json.has("patientCode")){
@ -485,9 +490,10 @@ public class RehabilitationManageService extends BaseService {
            Doctor doctor = doctorDao.findByCode(json.get("doctorCode")+"");
            json.put("doctorName",doctor!=null?doctor.getName():"");
        }
        param.put("dataJson", json.toString());
        String resultJsonStr = json.toString();
        param.put("dataJson", resultJsonStr);
        //specialistUrl= "http://localhost:10051";
        HttpResponse response = HttpUtils.doPost(specialistUrl + saveRehabilitationOperateRecodr, param);
        HttpResponse response = HttpUtils.doPost(specialistUrl + saveRehabilitationOperateRecord, param);
        JSONObject result = new JSONObject(response.getContent());
        return  result;
    }

+ 5 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -470,7 +470,7 @@ public class DoctorTeamGuidanceService extends BaseService {
     * @param images
     * @throws Exception
     */
    public void sendTeamGuidance(String accessToken, String dc, String patient, String content, String guidanceCode, String images, int teamId,String tzCode) throws Exception {
    public PatientHealthGuidance sendTeamGuidance(String accessToken, String dc, String patient, String content, String guidanceCode, String images, int teamId,String tzCode) throws Exception {
        String image = "";
        if (StringUtils.isNotEmpty(images)) {
            image = validateImages(images);
@ -484,7 +484,8 @@ public class DoctorTeamGuidanceService extends BaseService {
        guidance.setImages(image);
        // 保存
        if (patientHealthGuidanceService.add(guidance, accessToken,tzCode) != null) {
        PatientHealthGuidance guidance1 = patientHealthGuidanceService.add(guidance, accessToken, tzCode);
        if (guidance1 != null) {
            String sendImgs = "";
            if (StringUtils.isNotBlank(image)) {
                sendImgs = image;
@ -495,8 +496,9 @@ public class DoctorTeamGuidanceService extends BaseService {
            BusinessLogs.info(BusinessLogs.BusinessType.guidance, dc, patient, new JSONObject(guidance));
            //发送成功记录模板发送次数
            doctorTeamGuidanceTemplateDao.countSend(teamId, guidanceCode);
            return guidance1;
        }
        return null;
    }
    /**

+ 5 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java

@ -475,10 +475,14 @@ public class DataHandingService {
                String adminTeam="";
                String orgName ="";
                String orCode ="";
                String doctorCode ="";
                String doctorName="";
                if (signFamily!=null){
                    adminTeam=String.valueOf(signFamily.getAdminTeamId());
                    orgName = signFamily.getHospitalName();
                    orCode = signFamily.getHospital();
                    doctorCode = signFamily.getDoctor();
                    doctorName = signFamily.getDoctorName();
                }
                if (Integer.valueOf(patientDevice.getUserType())>0 && Integer.valueOf(patientDevice.getUserType())==1){
                    bindCount = "{\"1\":\"1\",\"2\":\"0\"}";
@ -487,7 +491,7 @@ public class DataHandingService {
                }else if (Integer.valueOf(patientDevice.getUserType())<0){
                    bindCount = "{\"1\":\"1\"}";
                }
                deviceDetailService.insertDevice(patientDevice,adminTeam,orgName,orCode,bindCount,1);
                deviceDetailService.insertDevice(patientDevice,adminTeam,orgName,orCode,bindCount,doctorCode,doctorName,1);
            }
        }
        String[] sqlStr = new String[sqlList.size()];

+ 13 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthGuidanceController.java

@ -29,6 +29,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;
/**
 * 医生端:健康指导控制类
 *
@ -187,13 +190,15 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
                guidance.setImages(images);
                // 保存到居民端健康指导
                if (patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) != null) {
                PatientHealthGuidance pp = patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) ;
                if (pp != null) {
                    Patient p = patientService.findByCode(patient);
                    String imcotent = "{\"title\":\"健康指导\",\"type\":2,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\"" + CommonUtil.getSubString(guidance.getContent(), 0, 30) + "\"}";
                    consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, imcotent, "4", p.getName());
                    BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
                    return success("保存成功!");
                    JSONObject resultMap = new JSONObject();
                    resultMap.put("id",pp.getId());
                    return write(200,"保存成功!","data",resultMap);
                } else {
                    return error(-1, "居民签约已到期,请使用文字回复。");
                }
@ -235,7 +240,8 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
                guidance.setImages(images);
                // 保存
                if (patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) != null) {
                PatientHealthGuidance pp = patientHealthGuidanceService.add(guidance, getAccessToken(),tzCode) ;
                if (pp != null) {
                    String sendImgs = "";
                    if (StringUtils.isNotBlank(images)) {
                        sendImgs = images;
@ -246,7 +252,9 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
                    BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
                    //发送成功记录模板发送次数
                    doctorGuidanceTempService.countSend(modelCode);
                    return success("保存成功!");
                    JSONObject resultMap = new JSONObject();
                    resultMap.put("id",pp.getId());
                    return write(200,"保存成功!","data",resultMap);
                } else {
                    return error(-1, "居民签约已到期,请使用文字回复。");
                }

+ 17 - 13
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/rehabilitation/DoctorRehabilitationManageController.java

@ -174,18 +174,23 @@ public class DoctorRehabilitationManageController extends BaseController {
    public String saveGuidanceMessage(@ApiParam(name = "messageId", value = "消息id", required = true)
                                      @RequestParam(value = "messageId", required = true)String messageId,
//                                      @ApiParam(name = "patientCode", value = "居民code", required = true)
//                                      @RequestParam(value = "patientCode", required = true)String patientCode,
//                                      @ApiParam(name = "doctorCode", value = "医生code", required = true)
//                                      @RequestParam(value = "doctorCode", required = true)String doctorCode,
//                                      @RequestParam(value = "patientCode", required = false)String patientCode,
                                      @ApiParam(name = "doctorCode", value = "医生code", required = false)
                                      @RequestParam(value = "doctorCode", required = false)String doctorCode,
//                                      @ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)", required = true)
//                                      @RequestParam(value = "doctorType", required = true)Integer doctorType,
                                      @ApiParam(name = "content", value = "聊天内容", required = true)
                                      @RequestParam(value = "content", required = true)String content,
                                      @ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                      @RequestParam(value = "planDetailId", required = true)String planDetailId){
                                      @RequestParam(value = "planDetailId", required = true)String planDetailId,
                                      @ApiParam(name = "contentType", value = "内容类型(1,6,8 - 文本, 2,9- 图片, 3 - 语音, 4-文章, 5,7系统消息。12-语音 18-居民名片, 19-聊天记录)", required = true)
                                      @RequestParam(value = "contentType", required = true)Integer contentType){
        try {
            rehabilitationManageService.saveGuidanceMessage(messageId,getRepUID(),content,planDetailId);
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            rehabilitationManageService.saveGuidanceMessage(messageId,doctorCode,content,planDetailId,contentType);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
@ -249,13 +254,13 @@ public class DoctorRehabilitationManageController extends BaseController {
    }
    @RequestMapping(value = "createServiceQrCode", method = RequestMethod.POST)
    @ApiOperation("康复管理-根据康复计划明细id和对话sessionId生成服务码")
    @ApiOperation("康复管理-根据康复计划明细id和医生code生成服务码")
    @ObserverRequired
    public String createServiceQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                      @ApiParam(name = "sessionId", value = "IM对话sessionId")@RequestParam(value = "sessionId", required = true)String sessionId){
                                      @ApiParam(name = "doctorCode", value = "医生code")@RequestParam(value = "doctorCode", required = true)String doctorCode){
        try {
            return write(200, "获取二维码成功!", "data", rehabilitationManageService.createServiceQrCode(planDetailId,sessionId));
            return write(200, "获取二维码成功!", "data", rehabilitationManageService.createServiceQrCode(planDetailId,doctorCode));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求二维码失败");
@ -314,13 +319,12 @@ public class DoctorRehabilitationManageController extends BaseController {
        }
    }
    @RequestMapping(value = "saveRehabilitationOperateRecodr", method = RequestMethod.POST)
    @ApiOperation("康复管理-新增operateRecodr")
    @RequestMapping(value = "saveRehabilitationOperateRecord", method = RequestMethod.POST)
    @ApiOperation("康复管理-新增operateRecord")
    @ObserverRequired
    public String saveRehabilitationOperateRecodr(@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){
    public String 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 {
            JSONObject result = rehabilitationManageService.saveRehabilitationOperateRecodr(dataJson);
            JSONObject result = rehabilitationManageService.saveRehabilitationOperateRecord(dataJson);
            if(result.getInt("status")==200){
                return write(200, "新增康复计划日志成功!", "data", result.getJSONObject("obj"));
            }else {

+ 21 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/rehabilitation/PatientRehabilitationManageController.java

@ -21,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
 * Created by 刘文彬 on 2018/8/30.
 */
@ -128,13 +130,31 @@ public class PatientRehabilitationManageController extends BaseController {
        try {
            JSONObject result = rehabilitationManageService.checkAfterQrCode(planDetailId,patientCode);
            return write(200, String.valueOf(result.get("message")), "data", result.get("obj"));
            return write(200, String.valueOf(result.get("message")), "data", result.getJSONObject("obj"));
        } catch (Exception e) {
            error(e);
            return error(-1, "验证失败");
        }
    }
    @RequestMapping(value = "saveRehabilitationOperateRecord", method = RequestMethod.POST)
    @ApiOperation("康复管理-新增operateRecord")
    @ObserverRequired
    public String 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 {
            JSONObject result = rehabilitationManageService.saveRehabilitationOperateRecord(dataJson);
            if(result.getInt("status")==200){
                return write(200, "新增康复计划日志成功!", "data", result.getJSONObject("obj"));
            }else {
                return error(-1, result.getString("message"));
            }
        } catch (Exception e) {
            error(e);
            return error(-1, "新增康复计划日志失败!");
        }
    }
    @RequestMapping(value = "recentPlanDetailRecord", method = RequestMethod.GET)
    @ApiOperation("康复管理-近期康复相关记录")
    @ObserverRequired

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -521,7 +521,7 @@ public class EsStatisticsController extends BaseController {
                    String thisYear = Constant.getNowYearByDate(endDate);
                    JSONObject json = new JSONObject();
                    if ("20".equals(idx) && Integer.valueOf(thisYear)>=2018){
                        //@TODO idx="86";1.5.0版本返回前端改为index_86
                        idx="86";//1.5.0版本返回前端改为index_86
                        json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, "86", lowCode, year,SaveModel.timeLevel_DDL);
                    }else {
                        json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode, year,SaveModel.timeLevel_DDL);
@ -600,8 +600,8 @@ public class EsStatisticsController extends BaseController {
                    } else if (idx.equals("72")) {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotalOnlineTeamLeader(date, area, level, idx, sort, lowLevel, year, ""));
                    }else if (idx.equals("20") && Integer.valueOf(year)>=2018){
                        //20指标是一个键绑定一条数据 所以2018年开始使用86指标 2018-08-27 zd
                        //@TODO idx="86";
                        //20指标是一个键绑定一条数据。 所以2018年开始使用86指标 2018-08-27 zd
                        idx="86";
                        result.put("index_" + idx, statisticsESService.getDeviceLowLevelTotal(date, area, level,"86", sort, lowLevel, year));
                    }else {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotal(date, area, level, idx, sort, lowLevel, year));

+ 1 - 0
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -33,6 +33,7 @@ doctorAssistant:
im:
  im_list_get: http://172.19.103.88:3000/
  #im_list_get: http://192.168.131.24:3000/
  data_base_name: ichat
#专病配置

+ 3 - 3
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -37,8 +37,8 @@ im:
#专病配置
specialist:
  url: http://172.19.103.33:9797/svr-wlyy-specialist/
#  url: http://localhost:10051/
#  url: http://172.19.103.33:9797/svr-wlyy-specialist/
  url: http://localhost:10051/
#物联网配置
iot:
#  url: http://192.168.131.24:8088/svr-iot/
@ -49,7 +49,7 @@ healthBank:
#康复计划配置
rehabilitation:
  url: http://localhost:10055/svr-rehabilitation/
  url: http://localhost:10055/svr-wlyy-rehabilitation/
#小程序
applets:

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/banner.txt

@ -19,5 +19,5 @@ ${AnsiColor.BRIGHT_GREEN}
                                    //      ========`-.____`-.___\_____/___.-`____.-'========         //
                                    //                           `=---='                              //
                                    //      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
                                    //            佛祖保佑       永不宕机     永无BUG                 //
                                    //            佛祖保佑       永不宕机     永无BUG1                //
                                    ////////////////////////////////////////////////////////////////////