|
@ -183,21 +183,11 @@ public class CustomerService extends BaseService{
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
public Map<String,Object> addCallRecord(String user,Integer type,String callerNumber,String recipientNumber,Integer status,Integer serviceType,String serviceContent){
|
|
|
public Map<String,Object> addCallRecord(String user,Integer type,String callerNumber,String recipientNumber,Integer status){
|
|
|
|
|
|
|
|
|
List<Patient> list = patientDao.findByMobile(callerNumber);
|
|
|
Map<String,Object> rs = new HashedMap();
|
|
|
Patient p ;
|
|
|
if(list==null||list.size()==0){
|
|
|
rs.put("state",-1);
|
|
|
rs.put("mes","未找到患者信息");
|
|
|
rs.put("callRecord",null);
|
|
|
return rs;
|
|
|
}else{
|
|
|
p = list.get(0);
|
|
|
}
|
|
|
|
|
|
SignFamily sf = familyService.findByPatientCode(p.getCode());
|
|
|
User u = userDao.findByCode(user);
|
|
|
|
|
|
CallRecord callRecord = new CallRecord();
|
|
@ -206,18 +196,10 @@ public class CustomerService extends BaseService{
|
|
|
callRecord.setCallerNumber(callerNumber);
|
|
|
callRecord.setRecipientNumber(recipientNumber);
|
|
|
callRecord.setAnswerStatus(status);
|
|
|
callRecord.setServiceType(serviceType);
|
|
|
callRecord.setServiceContent(serviceContent);
|
|
|
callRecord.setCreateTime(new Date());
|
|
|
callRecord.setCallTime(new Date());
|
|
|
callRecord.setUserCode(user);
|
|
|
callRecord.setUserName(u.getName());
|
|
|
callRecord.setPatient(p.getCode());
|
|
|
callRecord.setPatientName(p.getName());
|
|
|
callRecord.setIdcard(p.getIdcard());
|
|
|
callRecord.setSsc(p.getSsc());
|
|
|
callRecord.setDoctor(sf.getDoctor());
|
|
|
callRecord.setDoctorName(sf.getDoctorName());
|
|
|
CallRecord temp = callRecordDao.save(callRecord);
|
|
|
|
|
|
rs.put("state",1);
|
|
@ -227,6 +209,8 @@ public class CustomerService extends BaseService{
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String updateCallRecord(String jsonString){
|
|
|
net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonString);
|
|
|
CallRecord callRecord =(CallRecord)net.sf.json.JSONObject.toBean(json,CallRecord.class);
|
|
@ -234,9 +218,47 @@ public class CustomerService extends BaseService{
|
|
|
return "1";
|
|
|
}
|
|
|
|
|
|
public String updateCallRecordEndTime(String jsonString){
|
|
|
net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonString);
|
|
|
CallRecord callRecord =(CallRecord)net.sf.json.JSONObject.toBean(json,CallRecord.class);
|
|
|
public Map<String,Object> updateCallRecordService(String code,String idCard,Integer serviceType,String serviceContent){
|
|
|
CallRecord callRecord = callRecordDao.findByCode(code);
|
|
|
|
|
|
Patient p = patientDao.findByIdcard(idCard);
|
|
|
Map<String,Object> rs = new HashedMap();
|
|
|
if(p==null){
|
|
|
rs.put("state",-1);
|
|
|
rs.put("mes","未找到患者信息");
|
|
|
rs.put("callRecord",null);
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
SignFamily sf = familyService.findByPatientCode(p.getCode());
|
|
|
if(p==null){
|
|
|
rs.put("state",-2);
|
|
|
rs.put("mes","未找到患者签约信息");
|
|
|
rs.put("callRecord",null);
|
|
|
return rs;
|
|
|
}
|
|
|
//存储患者信息信息
|
|
|
callRecord.setPatient(p.getCode());
|
|
|
callRecord.setPatientName(p.getName());
|
|
|
callRecord.setIdcard(p.getIdcard());
|
|
|
callRecord.setSsc(p.getSsc());
|
|
|
//存储医生信息
|
|
|
callRecord.setDoctor(sf.getDoctor());
|
|
|
callRecord.setDoctorName(sf.getDoctorName());
|
|
|
callRecord.setServiceType(serviceType);
|
|
|
callRecord.setServiceContent(serviceContent);
|
|
|
callRecord.setAdminTeamCode(sf.getAdminTeamId());
|
|
|
|
|
|
CallRecord call = callRecordDao.save(callRecord);
|
|
|
|
|
|
rs.put("state",1);
|
|
|
rs.put("mes","保存成功");
|
|
|
rs.put("callRecord",call);
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public String updateCallRecordEndTime(String code){
|
|
|
CallRecord callRecord = callRecordDao.findByCode(code);
|
|
|
callRecord.setEndTime(new Date());
|
|
|
callRecord.setTalkTime(DateUtil.getTimeDifference(callRecord.getCreateTime(),callRecord.getEndTime()));
|
|
|
callRecordDao.save(callRecord);
|