|
@ -1,9 +1,11 @@
|
|
|
package com.yihu.jw.care.service.visit;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fasterxml.jackson.databind.JavaType;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.jw.care.dao.visit.BaseVisitDao;
|
|
|
import com.yihu.jw.care.dao.visit.BaseVisitSignDao;
|
|
|
import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
@ -34,6 +36,8 @@ public class BaseVisitService {
|
|
|
private BasePatientDao patientDao;
|
|
|
@Autowired
|
|
|
private BaseDoctorDao doctorDao;
|
|
|
@Autowired
|
|
|
private BaseVisitSignDao baseVisitSignDao;
|
|
|
|
|
|
/**
|
|
|
* 获取走访列表-日历
|
|
@ -196,6 +200,9 @@ public class BaseVisitService {
|
|
|
public Map<String, String> findVisitDetail(String id){
|
|
|
Map<String, String> re = new HashMap<>();
|
|
|
BaseVisitDO visitDO = baseVisitDao.findOne(id);
|
|
|
if (null==visitDO){
|
|
|
return null;
|
|
|
}
|
|
|
re.put("id", visitDO.getId());
|
|
|
re.put("visitDate", DateUtil.dateToStrLong(visitDO.getVisitDate()));
|
|
|
re.put("visitPlanDate", DateUtil.dateToStrLong(visitDO.getVisitPlanDate()));
|
|
@ -211,6 +218,13 @@ public class BaseVisitService {
|
|
|
re.put("health",visitDO.getHealth());
|
|
|
re.put("lifeConsult",visitDO.getLifeConsult());
|
|
|
|
|
|
BaseVisitSignDO visitSignDO = baseVisitSignDao.findByVisitId(visitDO.getId());
|
|
|
if (null!=visitSignDO){
|
|
|
re.put("signInfo", JSON.toJSONStringWithDateFormat(visitSignDO,"yyyy-MM-dd HH:mm:ss"));
|
|
|
}else {
|
|
|
re.put("signInfo",null);
|
|
|
}
|
|
|
|
|
|
BasePatientDO patient = patientDao.findById(visitDO.getPatient());
|
|
|
if (patient != null) {
|
|
|
re.put("idcard", patient.getIdcard());
|
|
@ -221,7 +235,6 @@ public class BaseVisitService {
|
|
|
re.put("photo", patient.getPhoto());
|
|
|
re.put("age", IdCardUtil.getAgeByIdcardOrBirthday(patient.getIdcard(),patient.getBirthday())+"");
|
|
|
}
|
|
|
|
|
|
return re;
|
|
|
}
|
|
|
|
|
@ -291,16 +304,18 @@ public class BaseVisitService {
|
|
|
signDO.setDoctorName(doctorDO.getName());
|
|
|
signDO.setDel(1);
|
|
|
signDO.setType(signWay);
|
|
|
if (1==signWay){//拍照
|
|
|
if (2==signWay){//拍照
|
|
|
signDO.setImg(signImg);
|
|
|
} else if (2==signWay) {//定位
|
|
|
} else if (1==signWay) {//定位
|
|
|
signDO.setAddress(address);
|
|
|
signDO.setLat(signLat);
|
|
|
signDO.setLon(signLon);
|
|
|
}else {
|
|
|
result.put(ResponseContant.resultFlag,ResponseContant.fail);
|
|
|
result.put(ResponseContant.resultMsg,"签到方式错误");
|
|
|
return result;
|
|
|
}
|
|
|
baseVisitSignDao.save(signDO);
|
|
|
result.put(ResponseContant.resultFlag,ResponseContant.success);
|
|
|
result.put(ResponseContant.resultMsg,"success");
|
|
|
return result;
|