Przeglądaj źródła

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

wujunjie 8 lat temu
rodzic
commit
4c39da1178

+ 1 - 1
patient-co-wlyy/pom.xml

@ -75,7 +75,7 @@
        <dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <groupId>com.yihu</groupId>
            <artifactId>java-ffmpegjave</artifactId>
            <artifactId>jave-ffmpegjave</artifactId>
            <version>1.0.4</version>
            <version>1.0.4</version>
        </dependency>
        </dependency>

+ 2 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -91,16 +91,13 @@ public class PatientInfoService extends BaseService {
     * @param patient 患者code
     * @param patient 患者code
     * @param mobile  新手机号
     * @param mobile  新手机号
     * @param captcha 验证码
     * @param captcha 验证码
     * @param  relation 是否成为家庭关系
     * @return
     * @return
     */
     */
    public int changeMobile(String patient, String mobile, String captcha, int type,int relation) throws Exception {
    public int changeMobile(String patient, String mobile, String captcha, int type) throws Exception {
        Patient p = patientDao.findByCode(patient);
        Patient p = patientDao.findByCode(patient);
        if (p == null) {
        if (p == null) {
            return -1;
            return -1;
        }
        }
        //List<Patient> patients = patientDao.findByMobile(mobile);
        //List<Patient> patients = patientDao.findByMobile(mobile);
        //更新的时候不校验手机是否存在
        //更新的时候不校验手机是否存在
        //if (pMobile != null && !pMobile.getCode().equals(patient)) {
        //if (pMobile != null && !pMobile.getCode().equals(patient)) {
@ -115,6 +112,7 @@ public class PatientInfoService extends BaseService {
        //}
        //}
        p.setMobile(mobile);
        p.setMobile(mobile);
        patientDao.save(p);
        signFamilyDao.updatePatientMobile(p.getCode(), mobile);
        signFamilyDao.updatePatientMobile(p.getCode(), mobile);
        return 1;
        return 1;

+ 9 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -1571,6 +1571,15 @@ public class ConsultTeamService extends ConsultService {
                    for (String url : imgs)
                    for (String url : imgs)
                        ImUtill.sendTopicIM(doctorTemp.getCode(), doctorTemp.getName(), consult.getCode(), "2", url);
                        ImUtill.sendTopicIM(doctorTemp.getCode(), doctorTemp.getName(), consult.getCode(), "2", url);
                }
                }
            }else if(oldConsult != null && isSend == 0){
                JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(), doctorTemp.getName(), consult.getTitle(), content, oldConsult.getImages());
                JSONObject jsonObject = new JSONObject();
                jsonObject.put(ct.getPatient(), 0);
                jsonObject.put(ct.getDoctor(), 0);
                JSONObject obj = ImUtill.createTopics(null, consult.getCode(), doctorTemp.getName(), jsonObject, messages, "2");
                if (obj == null || obj.getInt("status") == -1) {
                    throw new RuntimeException("im消息创建异常!" + obj == null ? "" : obj.getString("message"));
                }
            }
            }
            JSONObject qiuzuObj = new JSONObject();
            JSONObject qiuzuObj = new JSONObject();
            qiuzuObj.put("session_id", oldConsult.getPatient() + "_consult_" + consult.getType());
            qiuzuObj.put("session_id", oldConsult.getPatient() + "_consult_" + consult.getType());

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

@ -228,7 +228,11 @@ public class PatientDeviceService extends BaseService {
		// 设置查询条件
		// 设置查询条件
		Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
		Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
		filters.put("patient", new SearchFilter("user", Operator.EQ, patientCode));
		filters.put("patient", new SearchFilter("user", Operator.EQ, patientCode));
		filters.put("del", new SearchFilter("del", Operator.EQ, 0));
		if(id > 0){
		if(id > 0){
			filters.put("id", new SearchFilter("id", Operator.LT, id));
			filters.put("id", new SearchFilter("id", Operator.LT, id));
		}
		}

+ 17 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java

@ -219,5 +219,22 @@ public class ImUtill {
        }
        }
    }
    }
    /**
     * 获取会话成员
     * @param sessionId
     * @return
     * @throws Exception
     */
    public static JSONArray getParticipants(String sessionId){
        String url = SystemConf.getInstance().getSystemProperties().getProperty("im_list_get")
                + "api/v2/sessions/"+sessionId+"/participants?session_id="+sessionId;
        try{
            String ret = HttpClientUtil.get(url,"utf-8");
            return new JSONArray(ret);
        }catch (Exception e){
            throw new RuntimeException("获取议题失败!");
        }
    }
}
}

+ 12 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SendPatientUtil.java

@ -4,6 +4,7 @@ package com.yihu.wlyy.util;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.ArrayList;
@ -30,8 +31,18 @@ public class SendPatientUtil extends  Thread {
	public String sendToPatient(String from,String fromName,String to,String contentType,String content,String title,String type){
	public String sendToPatient(String from,String fromName,String to,String contentType,String content,String title,String type){
		JSONArray jsonArray = ImUtill.getParticipants(to+"_consult_"+type);
		JSONObject participants = new JSONObject();
		JSONObject participants = new JSONObject();
		participants.put(from,2);
		for(Object object:jsonArray){
			JSONObject jsonObject = (JSONObject)object;
			participants.put(jsonObject.getString("id"),jsonObject.get("role"));
		}
		if(participants.isNull(from)){
			participants.put(from,0);
		}
		if(participants.isNull(to)){
			participants.put(from,0);
		}
		participants.put(to,0);
		participants.put(to,0);
		if(!"4".equals(contentType)){
		if(!"4".equals(contentType)){
			contentType = "0";
			contentType = "0";

+ 9 - 21
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -282,7 +282,7 @@ public class LoginController extends BaseController {
    @ResponseBody
    @ResponseBody
    public String forgetpwd(int type,
    public String forgetpwd(int type,
                            @RequestParam(required = false) String idcard,
                            @RequestParam(required = false) String idcard,
                            String mobile,
                            @RequestParam(required = false) String mobile,
                            @RequestParam(required = false) String captchaToken,
                            @RequestParam(required = false) String captchaToken,
                            @RequestParam(required = false)String captcha,
                            @RequestParam(required = false)String captcha,
                            @RequestParam(required = false)String patient,
                            @RequestParam(required = false)String patient,
@ -302,40 +302,28 @@ public class LoginController extends BaseController {
//            newpwd = URLDecoder.decode(newpwd, "UTF-8");
//            newpwd = URLDecoder.decode(newpwd, "UTF-8");
//            newpwd = StringUtils.reverse(newpwd);
//            newpwd = StringUtils.reverse(newpwd);
            // 对验证码进行校验
            // 对验证码进行校验
//            int res = smsService.check(mobile, type, captcha);
//            switch (res) {
//                case -2:
//                    return error(-1, "验证码已过期!");
//                case -1:
//                    return error(-1, "验证码错误!");
//                case 0:
//                    return error(-1, "验证码无效!");
//            }
            if (type == 2) {
            if (type == 2) {
                // 医生端
                // 医生端
                Doctor doctor = doctorService.findDoctorByMobile(mobile);
                if (doctor == null) {
                    return error(-1, "操作失败:此用户未注册");
                } else {
                    Doctor doctor = doctorService.findDoctorByMobile(mobile);
                    String password = RSAUtils.getInstance(doctorService).decryptString(newpwd);
                    String password = RSAUtils.getInstance(doctorService).decryptString(newpwd);
                    password=StringUtils.reverse(password);
                    password=StringUtils.reverse(password);
                    password=MD5.GetMD5Code(password+doctor.getSalt());
                    password=MD5.GetMD5Code(password+doctor.getSalt());
                    doctor.setPassword(password);
                    doctor.setPassword(password);
                    doctorService.updateDoctorPwd(doctor);
                    doctorService.updateDoctorPwd(doctor);
                    return success("操作成功!");
                    return success("操作成功!");
                }
            } else {
            } else {
                // 患者端
                // 患者端
                List<Patient> patients = patientService.findByMobile(mobile);
                if (patients == null||patients.size()==0||StringUtils.isBlank(patient)) {
                Patient patientTemp = patientService.findByIdcard(idcard);
                if (patientTemp == null) {
                    return error(-1, "操作失败:此用户未注册");
                    return error(-1, "操作失败:此用户未注册");
                } else {
                } else {
                    Patient p  = patientService.findByCode(patient);
                    String password = RSAUtils.getInstance(doctorService).decryptString(newpwd);
                    String password = RSAUtils.getInstance(doctorService).decryptString(newpwd);
                    password=StringUtils.reverse(password);
                    password=StringUtils.reverse(password);
                    password=MD5.GetMD5Code(password+p.getSalt());
                    p.setPassword(password);
                    patientService.updatePatientPwd(p);
                    password=MD5.GetMD5Code(password+patientTemp.getSalt());
                    patientTemp.setPassword(password);
                    patientService.updatePatientPwd(patientTemp);
                    return success("操作成功!");
                    return success("操作成功!");
                }
                }
            }
            }

+ 24 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -84,6 +84,30 @@ public class WechatController extends WeixinBaseController {
        }
        }
    }
    }
    /**
     * 获取验证码发送的手机号码
     * @param idCard
     * @return
     */
    @RequestMapping(value = "getMobile")
    @ResponseBody
    public String getPatientInfoByIdCard(@RequestParam(value = "idCard",required = true) String idCard){
        Patient temp = patientService.findByIdcard(idCard);
        if(temp==null){
            return error(-1, "用户未注册");
        }else{
            if(StringUtils.isBlank(temp.getMobile())){
                return error(-2, "用户未绑定手机号");
            }else{
                JSONObject object = new JSONObject();
                object.put("mobile",temp.getMobile());
                return write(200,"获取成功","data",object);
            }
        }
    }
    /**
    /**
     * 患者注册-验证身份证
     * 患者注册-验证身份证
     *
     *

+ 2 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java

@ -718,14 +718,11 @@ public class PatientController extends WeixinBaseController {
     * @param mobile  新手机号
     * @param mobile  新手机号
     * @param captcha 验证码
     * @param captcha 验证码
     * @param type    1:变更手机号  2:绑定手机号
     * @param type    1:变更手机号  2:绑定手机号
     * @param  relation 0:第一次请求(如果新号码成员有多个会返回集合从新请求为是否绑定成为家人)
     *                  1、第二次请求不成为家人,
     *                  2.第二次请求传入成为家人
     * @return
     * @return
     */
     */
    @RequestMapping(value = "/mobile_update", method = RequestMethod.POST)
    @RequestMapping(value = "/mobile_update", method = RequestMethod.POST)
    @ResponseBody
    @ResponseBody
    public String changePatientMobile(String mobile, String captcha, int type,int relation) {
    public String changePatientMobile(String mobile, String captcha, int type) {
        try {
        try {
            if (StringUtils.isEmpty(mobile)) {
            if (StringUtils.isEmpty(mobile)) {
                return error(-1, "请填写新手机号码");
                return error(-1, "请填写新手机号码");
@ -740,7 +737,7 @@ public class PatientController extends WeixinBaseController {
            if (smsCheck != 1) {
            if (smsCheck != 1) {
                return error(-1, "验证码错误");
                return error(-1, "验证码错误");
            }
            }
            int result = patientInfoService.changeMobile(getUID(), mobile, captcha, type,relation);
            int result = patientInfoService.changeMobile(getUID(), mobile, captcha, type);
            if (result == -1) {
            if (result == -1) {
                return error(-1, "居民信息查找失败");
                return error(-1, "居民信息查找失败");
            } else if (result == 1) {
            } else if (result == 1) {

+ 10 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.patient.health;
package com.yihu.wlyy.web.patient.health;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.service.app.health.HealthEduArticleOpHistoryService;
import com.yihu.wlyy.service.app.health.HealthEduArticleOpHistoryService;
import com.yihu.wlyy.service.app.health.HealthEduArticlePatientService;
import com.yihu.wlyy.service.app.health.HealthEduArticlePatientService;
@ -45,6 +46,9 @@ public class HealthEduArticleController extends BaseController {
	@Autowired
	@Autowired
	private HealthEduArticleOpHistoryService healthEduArticleOpHistoryService;
	private HealthEduArticleOpHistoryService healthEduArticleOpHistoryService;
	@Autowired
	private HealthEduArticleService healthEduArticleService;
	@Autowired
	@Autowired
	private DoctorService doctorService;
	private DoctorService doctorService;
@ -127,18 +131,20 @@ public class HealthEduArticleController extends BaseController {
				//将文章更新为已读
				//将文章更新为已读
				healthEduArticlePatientService.updateRead(getUID(), healthEduArticlePatient.getArticle());
				healthEduArticlePatientService.updateRead(getUID(), healthEduArticlePatient.getArticle());
			}
			}
			HealthEduArticle healthEduArticle = healthEduArticleService.findArticleByCode(healthEduArticlePatient.getArticle());
			JSONObject json = new JSONObject();
			JSONObject json = new JSONObject();
			json.put("id", healthEduArticlePatient.getId());
			json.put("id", healthEduArticle.getId());
			// 文章标识
			// 文章标识
			json.put("article", healthEduArticlePatient.getArticle());
			json.put("article", healthEduArticlePatient.getArticle());
			// 医生姓名
			// 医生姓名
			json.put("doctorName", healthEduArticlePatient.getDoctorName());
			json.put("doctorName", healthEduArticlePatient.getDoctorName());
			// 文章标题
			// 文章标题
			json.put("title", healthEduArticlePatient.getTitle());
			json.put("title", healthEduArticle.getTitle());
			// 文章内容
			// 文章内容
			json.put("content", healthEduArticlePatient.getContent());
			json.put("content", healthEduArticle.getContent());
			json.put("url", healthEduArticlePatient.getUrl());
			json.put("url", healthEduArticle.getUrl());
			// 添加日期
			// 添加日期
			json.put("czrq", DateUtil.dateToStrLong(healthEduArticlePatient.getCzrq()));
			json.put("czrq", DateUtil.dateToStrLong(healthEduArticlePatient.getCzrq()));
			int readAmount = healthEduArticleOpHistoryService.countReadAmount(healthEduArticlePatient.getArticle());
			int readAmount = healthEduArticleOpHistoryService.countReadAmount(healthEduArticlePatient.getArticle());

+ 21 - 22
patient-co-wlyy/src/main/resources/application.properties

@ -53,28 +53,27 @@
##------------------------------------开发环境数据库配置------------------------------------#
##------------------------------------开发环境数据库配置------------------------------------#
#### mysql database setting
#### mysql database setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
jdbc.username=root
jdbc.password=123456
#### health index
health.jdbc.driver=com.mysql.jdbc.Driver
health.jdbc.url=jdbc:mysql://172.19.103.77/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
health.jdbc.username=root
health.jdbc.password=123456
#### suifang
fv.jdbc.driver=com.mysql.jdbc.Driver
fv.jdbc.url=jdbc:mysql://172.19.103.77/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
fv.jdbc.username=root
fv.jdbc.password=123456
#### redis
redis.host=172.19.103.47
redis.port=6379
redis.password=
#jdbc.driver=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#jdbc.username=root
#jdbc.password=123456
#
##### health index
#health.jdbc.driver=com.mysql.jdbc.Driver
#health.jdbc.url=jdbc:mysql://172.19.103.77/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#health.jdbc.username=root
#health.jdbc.password=123456
#
##### suifang
#fv.jdbc.driver=com.mysql.jdbc.Driver
#fv.jdbc.url=jdbc:mysql://172.19.103.77/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#fv.jdbc.username=root
#fv.jdbc.password=123456
#
##### redis
#redis.host=172.19.103.47
#redis.port=6379
#redis.password=
#---------------------------------测试环境数据库配置---------------------------------------#
#---------------------------------测试环境数据库配置---------------------------------------#
###### mysql database setting
###### mysql database setting
#jdbc.driver=com.mysql.jdbc.Driver
#jdbc.driver=com.mysql.jdbc.Driver

+ 1 - 0
patient-co-wlyy/src/main/resources/applicationContext.xml

@ -123,6 +123,7 @@
		<property name="hostName" value="${redis.host}"></property>
		<property name="hostName" value="${redis.host}"></property>
		<property name="port" value="${redis.port}"></property>
		<property name="port" value="${redis.port}"></property>
		<property name="password" value="${redis.password}"></property>
		<property name="password" value="${redis.password}"></property>
		<property name="database" value="0"></property>
		<property name="poolConfig" ref="poolConfig"></property>
		<property name="poolConfig" ref="poolConfig"></property>
	</bean>
	</bean>

+ 4 - 3
patient-co-wlyy/src/main/resources/system.properties

@ -53,7 +53,7 @@ admin_token=0a5c5258-8863-4b07-a3f9-88c768528ab4
sign_end_job_trigger=0 0 0 * * ?
sign_end_job_trigger=0 0 0 * * ?
#-------------------------开发环境配置-------------------------#
#-------------------------开发环境配置-------------------------#
# 服务器基本配置
 服务器基本配置
server_ip=weixin.xmtyw.cn
server_ip=weixin.xmtyw.cn
server_port=
server_port=
server_domain=wlyy-dev
server_domain=wlyy-dev
@ -119,7 +119,7 @@ fastdfs_file_url=http://172.19.103.54:80/
#server_ip=ehr.yihu.com
#server_ip=ehr.yihu.com
#server_port=
#server_port=
#server_domain=wlyy
#server_domain=wlyy
#server_url=http://ehr.yihu.com/wlyy/
#server_url=http://ehr.yihu.com/fzwlyy/
#
#
## 上传文件配置
## 上传文件配置
#image_server=http://ehr.yihu.com/res/images/
#image_server=http://ehr.yihu.com/res/images/
@ -232,4 +232,5 @@ fastdfs_file_url=http://172.19.103.54:80/
##健康之路开放平台
##健康之路开放平台
#yihu_OpenPlatform_url=http://api.yihu.com.cn/OpenPlatform/cgiBin/1.0/
#yihu_OpenPlatform_url=http://api.yihu.com.cn/OpenPlatform/cgiBin/1.0/
#yihu_OpenPlatform_appId=9000276
#yihu_OpenPlatform_appId=9000276
#yihu_OpenPlatform_secret=2JGL19AH3JS55MQY6ZOFJE1JZJ1OF23GWV67MCDQV74
#yihu_OpenPlatform_secret=2JGL19AH3JS55MQY6ZOFJE1JZJ1OF23GWV67MCDQV74