|
@ -1,7 +1,5 @@
|
|
|
package com.yihu.wlyy.service.app.followup;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
|
|
|
|
import com.fasterxml.jackson.databind.JavaType;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.wlyy.entity.dict.SystemDict;
|
|
@ -12,16 +10,17 @@ import com.yihu.wlyy.entity.message.Message;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.followup.FollowUpDao;
|
|
|
import com.yihu.wlyy.repository.followup.FollowupContentDao;
|
|
|
import com.yihu.wlyy.repository.message.MessageDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.service.app.team.DrHealthTeamService;
|
|
|
import com.yihu.wlyy.service.system.SystemDictService;
|
|
|
import com.yihu.wlyy.task.FollowupUploadTask;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
@ -33,9 +32,7 @@ import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import com.yihu.wlyy.repository.followup.FollowUpDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@ -140,19 +137,39 @@ public class FollowUpService extends BaseService {
|
|
|
/**
|
|
|
* 获取医生随访列表
|
|
|
*/
|
|
|
public List<Map<String, String>> getListByDoctor(String doctorCode, String startTime, String endTime, String page, String pageSize) throws Exception {
|
|
|
List<Map<String, String>> re = new ArrayList<>();
|
|
|
// 排序
|
|
|
Sort sort = new Sort(Sort.Direction.ASC, "followupDate");
|
|
|
// 分页信息
|
|
|
int pageInt = Integer.valueOf(page) - 1;
|
|
|
int pageSizeInt = Integer.valueOf(pageSize);
|
|
|
Pageable pageRequest = new PageRequest(pageInt, pageSizeInt, sort);
|
|
|
List<Followup> list = followupDao.findByDoctor(doctorCode, DateUtil.strToDate(startTime), DateUtil.strToDate(endTime), pageRequest);
|
|
|
public List<Map<String, Object>> getListByDoctor(String doctorCode, String startTime, String endTime) throws Exception {
|
|
|
List<Map<String, Object>> re = new ArrayList<>();
|
|
|
Map<String, Map<String, Object>> temp = new HashMap<>();
|
|
|
|
|
|
List<Followup> list = followupDao.findByDoctor(doctorCode, DateUtil.strToDate(startTime), DateUtil.strToDate(endTime));
|
|
|
if (list != null && list.size() > 0) {
|
|
|
for (Followup followup : list) {
|
|
|
String status = followup.getStatus();
|
|
|
String date = DateUtil.dateToStrShort(followup.getFollowupDate());
|
|
|
Map<String, String> map = getFollowupDetail(followup);
|
|
|
if(temp.containsKey(date)){
|
|
|
Map<String, Object> vo = temp.get(date);
|
|
|
if(!"1".equals(status)){
|
|
|
vo.put("num",Integer.parseInt(vo.get("num").toString())+1);
|
|
|
}
|
|
|
((List<Map<String, String>>)vo.get("list")).add(map);
|
|
|
temp.put(date,vo);
|
|
|
}else{
|
|
|
Map<String, Object> vo = new HashMap<>();
|
|
|
List<Map<String, String>> list1 = new ArrayList<>();
|
|
|
vo.put("date",date);
|
|
|
if(!"1".equals(status)){
|
|
|
vo.put("num",1);//未完成数量
|
|
|
}else{
|
|
|
vo.put("num",0);
|
|
|
}
|
|
|
list1.add(map);
|
|
|
vo.put("list",list1);
|
|
|
temp.put(date,vo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
for (Map<String, Object> map:temp.values()){
|
|
|
re.add(map);
|
|
|
}
|
|
|
}
|