|
@ -1,5 +1,6 @@
|
|
|
package com.yihu.wlyy.service.app.sign;
|
|
|
|
|
|
import com.yihu.wlyy.entity.consult.Consult;
|
|
|
import com.yihu.wlyy.entity.consult.ConsultTeam;
|
|
|
import com.yihu.wlyy.entity.doctor.OperatorLog;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
@ -13,6 +14,7 @@ import com.yihu.wlyy.entity.message.Message;
|
|
|
import com.yihu.wlyy.entity.organization.Hospital;
|
|
|
import com.yihu.wlyy.entity.patient.*;
|
|
|
import com.yihu.wlyy.logs.BusinessLogs;
|
|
|
import com.yihu.wlyy.repository.consult.ConsultDao;
|
|
|
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
|
|
|
import com.yihu.wlyy.repository.dict.SystemDictDao;
|
|
|
import com.yihu.wlyy.repository.doctor.*;
|
|
@ -117,7 +119,8 @@ public class FamilyContractService extends BaseService {
|
|
|
private OperatorLogDao operatorLogDao;
|
|
|
@Autowired
|
|
|
private WeiXinOpenIdUtils weiXinOpenIdUtils;
|
|
|
|
|
|
@Autowired
|
|
|
private ConsultDao consultDao;
|
|
|
@Autowired
|
|
|
private SignFamilyRenewDao signFamilyRenewDao;
|
|
|
|
|
@ -2615,7 +2618,8 @@ public class FamilyContractService extends BaseService {
|
|
|
JSONObject result = new JSONObject();
|
|
|
Map<String, JSONObject> docMap = new HashMap<>();
|
|
|
SignFamily ssSign = signFamilyDao.findSignByPatient(patient, 1);
|
|
|
SignFamily jtSign = signFamilyDao.findByTeamCode(infos[1]);
|
|
|
// SignFamily jtSign = signFamilyDao.findByTeamCode(infos[1]);
|
|
|
SignFamily jtSign = getSignFamilyBySessionId(sessionId,infos[0]);
|
|
|
if (ssSign != null) {
|
|
|
DoctorTeamMember member = doctorTeamDoctor.findSanshiByTeamAndType(ssSign.getTeamCode(), 1);
|
|
|
if (member != null) {
|
|
@ -2682,7 +2686,8 @@ public class FamilyContractService extends BaseService {
|
|
|
JSONObject result = new JSONObject();
|
|
|
Map<String, JSONObject> docMap = new HashMap<>();
|
|
|
SignFamily ssSign = signFamilyDao.findSignByPatient(infos[0], 1);
|
|
|
SignFamily jtSign = signFamilyDao.findByTeamCode(infos[1]);
|
|
|
// SignFamily jtSign = signFamilyDao.findByTeamCode(infos[1]);
|
|
|
SignFamily jtSign = getSignFamilyBySessionId(sessionId,infos[0]);
|
|
|
JSONObject ssArray = new JSONObject();
|
|
|
JSONObject jtArray = new JSONObject();
|
|
|
if (ssSign != null) {
|
|
@ -2710,6 +2715,27 @@ public class FamilyContractService extends BaseService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据会话id查询 家庭签约信息
|
|
|
* @param sessionId
|
|
|
* @param patient
|
|
|
* @return
|
|
|
*/
|
|
|
public SignFamily getSignFamilyBySessionId(String sessionId,String patient){
|
|
|
SignFamily signFamily = null;
|
|
|
String sql = "select id from " + SystemConf.getInstance().getImDataBaseName() + ".topics where session_id = '"+sessionId+"' order by create_time desc limit 0, 1";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
if(list!=null&&list.size()>0){
|
|
|
String consultCode = list.get(0).get("id").toString();
|
|
|
signFamily = signFamilyDao.findByPatient(patient);
|
|
|
Consult consult = consultDao.findByCode(consultCode);
|
|
|
if(signFamily==null||signFamily.getApplyDate().getTime()-consult.getCzrq().getTime()>0){
|
|
|
signFamily = signFamilyDao.findOutTimeSigningByPatient(patient);
|
|
|
}
|
|
|
}
|
|
|
return signFamily;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询患者对应医生
|