|
@ -3,10 +3,14 @@ package com.yihu.wlyy.service.manager.account;
|
|
import com.yihu.wlyy.entity.*;
|
|
import com.yihu.wlyy.entity.*;
|
|
import com.yihu.wlyy.entity.call.CallRecord;
|
|
import com.yihu.wlyy.entity.call.CallRecord;
|
|
import com.yihu.wlyy.entity.call.CallService;
|
|
import com.yihu.wlyy.entity.call.CallService;
|
|
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderCustomerLogDO;
|
|
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderReserveConsultDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerDO;
|
|
import com.yihu.wlyy.repository.*;
|
|
import com.yihu.wlyy.repository.*;
|
|
import com.yihu.wlyy.repository.call.CallRecordDao;
|
|
import com.yihu.wlyy.repository.call.CallRecordDao;
|
|
import com.yihu.wlyy.repository.call.CallServiceDao;
|
|
import com.yihu.wlyy.repository.call.CallServiceDao;
|
|
|
|
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderCustomerLogDao;
|
|
|
|
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderReserveConsultDao;
|
|
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerDao;
|
|
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerDao;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.manager.family.FamilyMemberService;
|
|
import com.yihu.wlyy.service.manager.family.FamilyMemberService;
|
|
@ -60,6 +64,8 @@ public class CustomerService extends BaseService{
|
|
private DoctorDao doctorDao;
|
|
private DoctorDao doctorDao;
|
|
@Autowired
|
|
@Autowired
|
|
private PatientReservationDao patientReservationDao;
|
|
private PatientReservationDao patientReservationDao;
|
|
|
|
@Autowired
|
|
|
|
private SignFamilyDao signFamilyDao;
|
|
|
|
|
|
@Value(("${doctorAssistant.api}")+"/wlyygc/doctor/message")
|
|
@Value(("${doctorAssistant.api}")+"/wlyygc/doctor/message")
|
|
private String messageApi;
|
|
private String messageApi;
|
|
@ -94,7 +100,23 @@ public class CustomerService extends BaseService{
|
|
doctors.add(doctor);
|
|
doctors.add(doctor);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
String labelSql="SELECT DISTINCT CASE call_label WHEN '1' THEN '有待跟踪' WHEN '2' THEN '电话骚扰' WHEN '3' THEN '态度恶劣' END FROM manage_call_record mcr WHERE (caller_number='"+patient.getPhone()+"' OR caller_number='"+patient.getMobile()+"') AND type=1 AND call_label IS NOT NULL";
|
|
|
|
|
|
String labelSql="SELECT DISTINCT" +
|
|
|
|
" CASE call_label" +
|
|
|
|
" WHEN '1' THEN" +
|
|
|
|
" '有待跟踪'" +
|
|
|
|
" WHEN '2' THEN" +
|
|
|
|
" '电话骚扰'" +
|
|
|
|
" WHEN '3' THEN" +
|
|
|
|
" '态度恶劣'" +
|
|
|
|
" END call_label" +
|
|
|
|
" FROM" +
|
|
|
|
" manage_call_record" +
|
|
|
|
" WHERE" +
|
|
|
|
" caller_number = '"+patient.getMobile()+"'" +
|
|
|
|
" AND type = 1" +
|
|
|
|
" AND call_label IS NOT NULL" +
|
|
|
|
" AND call_label != ''" +
|
|
|
|
" AND call_label != 'null'";
|
|
List<Map<String,Object>> labelInfo = jdbcTemplate.queryForList(labelSql);
|
|
List<Map<String,Object>> labelInfo = jdbcTemplate.queryForList(labelSql);
|
|
resp.put("signInfo",signInfo);
|
|
resp.put("signInfo",signInfo);
|
|
resp.put("doctors",doctors);
|
|
resp.put("doctors",doctors);
|
|
@ -391,84 +413,97 @@ public class CustomerService extends BaseService{
|
|
|
|
|
|
public Map<String,Object> getCallRecordInfo(String code){
|
|
public Map<String,Object> getCallRecordInfo(String code){
|
|
CallRecord callRecord = callRecordDao.findByCode(code);
|
|
CallRecord callRecord = callRecordDao.findByCode(code);
|
|
/*List<CallService> consultService = callServiceDao.findByCallCodeAndType(code,0);
|
|
|
|
List<CallService> orderService = callServiceDao.findByCallCodeAndType(code,1);*/
|
|
|
|
|
|
|
|
String type="";
|
|
|
|
String relationCode="";
|
|
|
|
String sql="";
|
|
|
|
List<Map<String,Object>> resultList = new ArrayList<>();
|
|
|
|
//咨询
|
|
|
|
if ("0".equals(type)){
|
|
|
|
sql="SELECT " +
|
|
|
|
" a.code as workCode," +
|
|
|
|
" a.content, " +
|
|
|
|
" a.`status`, " +
|
|
|
|
" a.service_patient_name, " +
|
|
|
|
" c.deal_type, " +
|
|
|
|
" c.deal_content, " +
|
|
|
|
" a.remark " +
|
|
|
|
|
|
String sql ="SELECT " +
|
|
|
|
" w.`code`, " +
|
|
|
|
" w.`status` AS wordStatus, " +
|
|
|
|
" s.service_patient_code, " +
|
|
|
|
" s.service_patient_name, " +
|
|
|
|
" w.content, " +
|
|
|
|
" l.remark, " +
|
|
|
|
" s.relation_code, " +
|
|
|
|
" s.relation_code_name, " +
|
|
|
|
" w.type, " +
|
|
|
|
" s.`status` AS serviceStatus " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" manage_synergy_workorder_reserve_consult c " +
|
|
|
|
" INNER JOIN ( " +
|
|
|
|
" SELECT " +
|
|
|
|
" w.*, s.service_patient_name " +
|
|
|
|
" FROM " +
|
|
|
|
" manage_synergy_workorder w " +
|
|
|
|
" LEFT JOIN manage_synergy_workorder_servicer s ON w.`code` = s.workorder_code " +
|
|
|
|
" ) a " +
|
|
|
|
|
|
" manage_synergy_workorder_servicer_log l " +
|
|
|
|
" LEFT JOIN manage_synergy_workorder w ON l.workorder_code = w.`code` " +
|
|
|
|
" LEFT JOIN manage_synergy_workorder_servicer s ON l.workorder_service_code = s.`code` " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" call_code = '"+code+"'";
|
|
|
|
resultList = jdbcTemplate.queryForList(sql);
|
|
|
|
}
|
|
|
|
//健康教育
|
|
|
|
if ("1".equals(type)){
|
|
|
|
|
|
|
|
}
|
|
|
|
//预约
|
|
|
|
if ("2".equals(type)){
|
|
|
|
sql="SELECT" +
|
|
|
|
" a. CODE AS workCode," +
|
|
|
|
" a.`status`," +
|
|
|
|
" a.service_patient_name," +
|
|
|
|
" c.order_hospital_name," +
|
|
|
|
" c.order_dept_name," +
|
|
|
|
" c.order_time" +
|
|
|
|
"FROM" +
|
|
|
|
" manage_synergy_workorder_reserve_consult c" +
|
|
|
|
"INNER JOIN (" +
|
|
|
|
" SELECT" +
|
|
|
|
" w.*, s.service_patient_name" +
|
|
|
|
" FROM" +
|
|
|
|
" manage_synergy_workorder w" +
|
|
|
|
" LEFT JOIN manage_synergy_workorder_servicer s ON w.`code` = s.workorder_code" +
|
|
|
|
") a" +
|
|
|
|
"WHERE" +
|
|
|
|
" call_code = '"+code+"'";
|
|
|
|
resultList = jdbcTemplate.queryForList(sql);
|
|
|
|
}
|
|
|
|
//随访
|
|
|
|
if ("3".equals(type)){
|
|
|
|
|
|
" l.call_code = '"+code+"'";
|
|
|
|
|
|
}
|
|
|
|
//问卷调查
|
|
|
|
if ("4".equals(type)){
|
|
|
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
List<Map<String,Object>> consultList = new ArrayList<>();
|
|
|
|
List<Map<String,Object>> followList = new ArrayList<>();
|
|
|
|
List<PatientReservation> patientReservation = new ArrayList<>();
|
|
|
|
List<Map<String,Object>> surveyList = new ArrayList<>();
|
|
|
|
List<Map<String,Object>> screenList = new ArrayList<>();
|
|
|
|
|
|
|
|
for (Map<String,Object> map : list){
|
|
|
|
String type = String.valueOf(map.get("type"));
|
|
|
|
String relationCode = String.valueOf(map.get("relation_code"));
|
|
|
|
//获取家庭医生姓名
|
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(String.valueOf(map.get("service_patient_code")));
|
|
|
|
if (signFamily!=null){
|
|
|
|
map.put("familyDoctorName",signFamily.getDoctorName());
|
|
|
|
}
|
|
|
|
map.put("mobile",callRecord.getCallerNumber());
|
|
|
|
//咨询
|
|
|
|
if ("0".equals(type)){
|
|
|
|
String consultSql ="SELECT deal_type,deal_content FROM `manage_synergy_workorder_reserve_consult` WHERE call_code='"+code+"'";
|
|
|
|
List<Map<String,Object>> clist = jdbcTemplate.queryForList(consultSql);
|
|
|
|
for (Map<String,Object> cmap : clist){
|
|
|
|
map.putAll(cmap);
|
|
|
|
}
|
|
|
|
consultList.add(map);
|
|
|
|
}
|
|
|
|
//健康教育
|
|
|
|
if ("1".equals(type)){
|
|
|
|
|
|
}
|
|
|
|
//疾病筛查
|
|
|
|
if ("5".equals(type)){
|
|
|
|
sql="SELECT * FROM `wlyy_survey_screen_result` WHERE `code`='"+relationCode+"'";
|
|
|
|
resultList = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
}
|
|
|
|
//预约
|
|
|
|
if ("2".equals(type)){
|
|
|
|
patientReservation = patientReservationDao.findByCallCode(code);
|
|
|
|
}
|
|
|
|
//随访
|
|
|
|
if ("3".equals(type)){
|
|
|
|
String followSql ="SELECT followup_class FROM wlyy_followup where id="+relationCode;
|
|
|
|
List<Map<String,Object>> flist = jdbcTemplate.queryForList(followSql);
|
|
|
|
for (Map<String,Object> fmap : flist){
|
|
|
|
map.putAll(fmap);
|
|
|
|
}
|
|
|
|
followList.add(map);
|
|
|
|
}
|
|
|
|
//问卷调查
|
|
|
|
if ("4".equals(type)){
|
|
|
|
String qsql="SELECT template_title FROM `wlyy_survey_question_result` WHERE `code`='"+relationCode+"'";
|
|
|
|
List<Map<String,Object>> flist = jdbcTemplate.queryForList(qsql);
|
|
|
|
for (Map<String,Object> fmap : flist){
|
|
|
|
map.putAll(fmap);
|
|
|
|
}
|
|
|
|
surveyList.add(map);
|
|
|
|
}
|
|
|
|
//疾病筛查
|
|
|
|
if ("5".equals(type)){
|
|
|
|
String ssql="SELECT template_title,screen_result_score FROM `wlyy_survey_screen_result` WHERE `code`='"+relationCode+"'";
|
|
|
|
List<Map<String,Object>> flist = jdbcTemplate.queryForList(ssql);
|
|
|
|
for (Map<String,Object> fmap : flist){
|
|
|
|
map.putAll(fmap);
|
|
|
|
}
|
|
|
|
screenList.add(map);
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<PatientReservation> patientReservation = patientReservationDao.findByCallCode(code);
|
|
|
|
|
|
;
|
|
Map<String,Object> rs = new HashedMap();
|
|
Map<String,Object> rs = new HashedMap();
|
|
rs.put("callRecord",callRecord);
|
|
rs.put("callRecord",callRecord);
|
|
/*rs.put("consultService",consultService);
|
|
|
|
rs.put("orderService",orderService);*/
|
|
|
|
rs.put("patientReservation",patientReservation);
|
|
rs.put("patientReservation",patientReservation);
|
|
|
|
rs.put("consult",consultList);
|
|
|
|
rs.put("follow",followList);
|
|
|
|
rs.put("survey",surveyList);
|
|
|
|
rs.put("screen",screenList);
|
|
|
|
|
|
return rs;
|
|
return rs;
|
|
}
|
|
}
|
|
|
|
|