Browse Source

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

trick9191 8 years ago
parent
commit
d222bd8730

+ 4 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultDao.java

@ -13,19 +13,19 @@ public interface ConsultDao extends PagingAndSortingRepository<Consult, Long>, J
	Consult findByCode(String code);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
	Page<Object> findByPatient(String patient,String title, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
	Page<Object> findByPatient(String patient,String title, long id, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
	Page<Object> findByPatient(String patient, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
	Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
	@Query("select count(a) from Consult a,ConsultTeamDoctor b  where a.code = b.consult and a.patient=?1 and b.to=?2 and b.from is null")

+ 11 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultService.java

@ -4,6 +4,7 @@ package com.yihu.wlyy.service.app.consult;
import java.util.Date;
import java.util.List;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.util.SendPatientUtil;
@ -114,15 +115,18 @@ public class ConsultService extends BaseService {
	public void sendMucMessageBySingnType(String doctor,String doctorName,String patient,String  content,String contentType,String title){
		//add by linz 增加签约关系查询,
		SignFamily signFamily = signFamilyDao.findByDoctorPatient(doctor, patient);
		Doctor d = doctorDao.findByCode(doctor);
		SignFamily signFamily = signFamilyDao.findByPatient(patient);//当前签约团队
		if(signFamily==null){
			signFamily = signFamilyDao.findSsSignByDoctorPatient(doctor, patient);
			List<SignFamily> signFamilys = signFamilyDao.findLastJySignByPatient(patient,2);//获取旧的家庭签约关系
			if(signFamilys!=null&&signFamilys.size()>0){
				signFamily = signFamilys.get(0);
			}
		}
		if(signFamily==null){
			throw new RuntimeException("无有效签约关系!");
		if(signFamily!=null){
			new SendPatientUtil(doctor,doctorName,patient, contentType, content,title,signFamily.getType()+"",signFamily.getTeamCode()).start();
		}else {
			throw new RuntimeException("无法找到签约关系!");
		}
		new SendPatientUtil(doctor,doctorName,patient, contentType, content,title,signFamily.getType()+"",signFamily.getTeamCode()).start();
	}
}

+ 12 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -104,6 +104,8 @@ public class ConsultController extends WeixinBaseController {
                    json.put("czrq", DateUtil.dateToStrLong((Date) result[5]));
                    // 咨询状态
                    json.put("doctorCode", result[7]);
                    json.put("teamCode", result[8]);
                    array.put(json);
                }
            }
@ -843,4 +845,14 @@ public class ConsultController extends WeixinBaseController {
            return error(-1,e.getMessage());
        }
    }
    @RequestMapping(value = "getConsult")
    @ResponseBody
    public String getConsult(String consult){
        try{
            ConsultTeam consultTeam = consultTeamService.findByConsultCode(consult);
            return write(200, "查询成功", "data", consultTeam);
        }catch (Exception e){
            return error(-1,e.getMessage());
        }
    }
}

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinOpenIdUtils.java

@ -98,7 +98,8 @@ public class WeiXinOpenIdUtils {
                }
            }
        }
        return null;
        result.put("member",new Patient());
        return result;
    }
    public String getTitleMes(Patient p, int ralation, String dealerName) throws Exception {

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

@ -6,7 +6,7 @@
		  {
			"type":"view",
			"name":"签约管理",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fqygl%2fhtml%2fsigning-doctors.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fqygl%2fhtml%2fsigning_management.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
			"type":"view",