LAPTOP-KB9HII50\70708 1 anno fa
parent
commit
d52db7e811

+ 4 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/followup/Followup.java

@ -1,7 +1,7 @@
package com.yihu.jw.entity.followup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.LongIdentityEntity;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import javax.persistence.*;
@ -17,7 +17,7 @@ import java.util.Map;
@Entity
@Table(name = "wlyy_followup")
@SequenceGenerator(name="id_generated", sequenceName="wlyy_followup")
public class Followup extends IntegerIdentityEntity {
public class Followup extends LongIdentityEntity {
	//随访编号【基卫】
	private String followupNo;
@ -86,8 +86,8 @@ public class Followup extends IntegerIdentityEntity {
	private List<Map<String,Object>> followupLabelPatient;
	//居民头像
	private String photo;
	private String followupTypeName;
	private String followupClassName;
	private String followupTypeName;//随访方式名称
	private String followupClassName;//随访类型名称
	//随访类型1、新增随访、2临时随访、3入户访视
	private Integer type;
	//随访角色【FAMILY_WORK_TYPE_DICT】【1. 专科医生 2. 全科医生 3. 健康管理师】

+ 2 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java

@ -363,10 +363,11 @@ public class RehabilitationDetailDO extends UuidIdentityEntity implements Serial
        this.planTime = planTime;
    }
    @Transient
    public String getName() {
        return name;
    }
    @Transient
    public void setName(String name) {
        this.name = name;
    }

+ 48 - 90
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/service/FollowUpService.java

@ -7,23 +7,21 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;
import com.yihu.jw.entity.base.system.SystemDictDO;
import com.yihu.jw.entity.door.SignFamily;
import com.yihu.jw.entity.followup.Followup;
import com.yihu.jw.entity.followup.FollowupContent;
import com.yihu.jw.entity.followup.FollowupMapping;
import com.yihu.jw.entity.followup.FollowupSign;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.message.MessageNoticeSetting;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.module.followup.dao.*;
import com.yihu.jw.hospital.module.rehabilitation.service.RehabilitationManageService;
import com.yihu.jw.hospital.module.system.service.SystemDictService;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.task.PushMsgTask;
import com.yihu.jw.hospital.team.dao.WlyySignFamilyDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.util.date.DateUtil;
@ -83,10 +81,7 @@ public class FollowUpService {
    private FollowupContentDao followupContentDao;
    @Autowired
    private SystemDictService systemDictService;
    @Autowired
    private WlyySignFamilyDao signFamilyDao;
    private WlyyHospitalSysDictDao hospitalSysDictDao;
//    @Autowired
//    private DrHealthTeamService drHealthTeamService;
@ -97,9 +92,6 @@ public class FollowUpService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    SystemDictService dictService;
    @Autowired
    private BasePatientService patientService;
    @Autowired
@ -139,18 +131,15 @@ public class FollowUpService {
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
//    @Autowired
//    private VisitDetailService visitDetailService;
//    @Autowired
//    private ElasticFactory elasticFactory;
//    @Autowired
//    private ElastricSearchSave elastricSearchSave;
//    @Autowired
//    private ElasticsearchUtil elasticsearchUtil;
//    @Autowired
//    private BusinessMappingDao businessMappingDao;
    //字典
    public String getDictValue(String dictName,String code){
        WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findOneByDictNameAndDictCode(dictName,code);
        if(dictDO!=null){
            return dictDO.getDictValue();
        }
        return null;
    }
    /**
     * 转译随访信息
@ -183,7 +172,7 @@ public class FollowUpService {
        //随访方式转译
        re.put("followupType", followup.getFollowupType());
        String followupTypeName = systemDictService.getDictValue("FOLLOWUP_WAY_DICT", followup.getFollowupType());
        String followupTypeName = getDictValue("FOLLOWUP_WAY_DICT", followup.getFollowupType());
        re.put("followupTypeName", followupTypeName);
        //随访类别转译
@ -191,12 +180,12 @@ public class FollowUpService {
        String followupClass = followup.getFollowupClass();
        re.put("followupClass", followupClass);
        String followupClassName = systemDictService.getDictValue("FOLLOWUP_CLASS_DICT", followup.getFollowupClass());
        String followupClassName = getDictValue("FOLLOWUP_CLASS_DICT", followup.getFollowupClass());
        if (StringUtils.isNoneBlank(followupClass) && followupClass.contains(",")) {
            String[] followupClassArray = followupClass.split(",");
            followupClassName = "";
            for (int i = 0; i < followupClassArray.length; i++) {
                followupClassName += systemDictService.getDictValue("FOLLOWUP_CLASS_DICT", followupClassArray[i]);
                followupClassName += getDictValue("FOLLOWUP_CLASS_DICT", followupClassArray[i]);
                if (i != followupClassArray.length - 1) {
                    followupClassName += ",";
                }
@ -207,7 +196,7 @@ public class FollowUpService {
        //随访管理状态转译
        re.put("followupManagerStatus", followup.getFollowupManagerStatus());
        String followupManagerStatusName = systemDictService.getDictValue("FOLLOWUP_MANAGER_STATUS", followup.getFollowupManagerStatus());
        String followupManagerStatusName = getDictValue("FOLLOWUP_MANAGER_STATUS", followup.getFollowupManagerStatus());
        re.put("followupManagerStatusName", followupManagerStatusName);
        re.put("doctorCode", followup.getDoctorCode());
@ -293,18 +282,16 @@ public class FollowUpService {
            Map<String, String> dictMap = new HashMap<>();
            Map<String, String> statusMap = new HashMap<>();
            Map<String, String> mngStatusMap = new HashMap<>();
            List<SystemDictDO> dicts = dictService.getDictByDictName("FOLLOWUP_WAY_DICT");
            List<SystemDictDO> mngDicts = dictService.getDictByDictName("FOLLOWUP_MANAGER_STATUS");
            List<WlyyHospitalSysDictDO> dicts = hospitalSysDictDao.findByDictName("FOLLOWUP_WAY_DICT");
            List<WlyyHospitalSysDictDO> mngDicts = hospitalSysDictDao.findByDictName("FOLLOWUP_MANAGER_STATUS");
            if (dicts != null) {
                for (SystemDictDO dict : dicts) {
//                    dictMap.put(dict.getCode(), dict.getValue());
                    dictMap.put(dict.getCode(), dict.getName());
                for (WlyyHospitalSysDictDO dict : dicts) {
                    dictMap.put(dict.getDictCode(), dict.getDictValue());
                }
            }
            if (mngDicts != null) {
                for (SystemDictDO dict : mngDicts) {
//                    mngStatusMap.put(dict.getCode(), dict.getValue());
                    mngStatusMap.put(dict.getCode(), dict.getName());
                for (WlyyHospitalSysDictDO dict : mngDicts) {
                    mngStatusMap.put(dict.getDictCode(), dict.getDictValue());
                }
            }
@ -404,18 +391,16 @@ public class FollowUpService {
            Map<String, String> dictMap = new HashMap<>();
            Map<String, String> statusMap = new HashMap<>();
            Map<String, String> mngStatusMap = new HashMap<>();
            List<SystemDictDO> dicts = dictService.getDictByDictName("FOLLOWUP_WAY_DICT");
            List<SystemDictDO> mngDicts = dictService.getDictByDictName("FOLLOWUP_MANAGER_STATUS");
            List<WlyyHospitalSysDictDO> dicts = hospitalSysDictDao.findByDictName("FOLLOWUP_WAY_DICT");
            List<WlyyHospitalSysDictDO> mngDicts = hospitalSysDictDao.findByDictName("FOLLOWUP_MANAGER_STATUS");
            if (dicts != null) {
                for (SystemDictDO dict : dicts) {
//                    dictMap.put(dict.getCode(), dict.getValue());
                    dictMap.put(dict.getCode(), dict.getName());
                for (WlyyHospitalSysDictDO dict : dicts) {
                    dictMap.put(dict.getDictCode(), dict.getDictCode());
                }
            }
            if (mngDicts != null) {
                for (SystemDictDO dict : mngDicts) {
//                    mngStatusMap.put(dict.getCode(), dict.getValue());
                    mngStatusMap.put(dict.getCode(), dict.getName());
                for (WlyyHospitalSysDictDO dict : mngDicts) {
                    mngStatusMap.put(dict.getDictCode(), dict.getDictCode());
                }
            }
@ -518,9 +503,6 @@ public class FollowUpService {
            if (patient == null) {
                throw new RuntimeException("获取不到用户信息!");
            }
            SignFamily signFamily = signFamilyDao.findByjiatingPatient(patientCode);
            Long adminCodeId = 0L;
            List<Followup> followupPlan = new ArrayList<>();
            for (Map<String, String> map : list) {
                //获取医生信息
@ -545,17 +527,10 @@ public class FollowUpService {
                followup.setStatus("2");     //状态 0取消 1已完成 2未开始 3进行中
                followup.setCreateTime(new Date());
                followup.setCreater(doctorCode);
                if (!map.get("followupClass").toString().equalsIgnoreCase("10")) {
                    if (signFamily == null) {
                        throw new RuntimeException("非家签居民仅支持创建体温异常随访");
                    } else {
                        adminCodeId = signFamily.getAdminTeamId();
                    }
                }
                followup.setFollowupClass(map.get("followupClass"));
                followup.setType(Integer.parseInt(map.get("type1").toString()));
                followup.setAdminTeamCode(adminCodeId);
//                followup.setAdminTeamCode(adminCodeId);
                followup.setSignType(2);
                //获取随访医生角色类型
@ -774,16 +749,6 @@ public class FollowUpService {
        if (patient == null) {
            throw new RuntimeException("查找不到居民信息!");
        }
        SignFamily signFamily = signFamilyDao.findByjiatingPatient(patientCode);
        Long adminId = 0L;
        if (!followupClass.equalsIgnoreCase("10")) {
            if (signFamily == null) {
                throw new RuntimeException("非家签居民仅支持创建体温异常随访");
            } else {
                adminId = signFamily.getAdminTeamId();
            }
        }
        Followup followup = new Followup();
        Date followDate = DateUtil.strToDate(date);
@ -803,7 +768,7 @@ public class FollowUpService {
        followup.setStatus("2");     //状态 0取消 1已完成 2未开始 3进行中
        followup.setCreateTime(new Date());
        followup.setCreater(doctorCode);
        followup.setAdminTeamCode(signFamily.getAdminTeamId());
//        followup.setAdminTeamCode(signFamily.getAdminTeamId());
        followup.setSignType(2);
        if (type != null && type != 0) {
            followup.setType(type);
@ -923,18 +888,17 @@ public class FollowUpService {
    public List<Map<String, String>> getFollowupProject(String id) throws Exception {
        List<Map<String, String>> re = new ArrayList<>();
        //获取已填写的面访项目
//        List<String> project = followupContentDao.findProjectByFollowupId(Long.valueOf(id));
        List<String> project = followupContentDao.findProjectByFollowupId(Long.valueOf(id));
        //修改为通过ES查询---2017.11.01--huangwenjie
//        List<String> project = esfindProjectByFollowupId(id);
        List<String> project = null;
        //获取所有面访项目
        List<SystemDictDO> dictList = systemDictService.getDictByDictName("FOLLOWUP_PROJECT");
        List<WlyyHospitalSysDictDO> dictList = hospitalSysDictDao.findByDictName("FOLLOWUP_PROJECT");
        if (dictList != null && dictList.size() > 0) {
            for (SystemDictDO dict : dictList) {
            for (WlyyHospitalSysDictDO dict : dictList) {
                Map<String, String> map = new HashMap<>();
                String code = dict.getCode();
                String code = dict.getDictCode();
                map.put("projectCode", code);
                map.put("projectName", dict.getName());
                map.put("projectName", dict.getDictValue());
                if (project != null && project.contains(code)) {
                    map.put("status", "1"); //已填写
                } else {
@ -986,21 +950,21 @@ public class FollowUpService {
        }
        Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
//        Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
        //如果该随访是已完成的,则添加随访信息上传映射,上传到基卫
        if ("1".equals(followup.getStatus())) {
            FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(id));
            if (followupMapping == null) {
                followupMapping = new FollowupMapping();
                followupMapping.setCode(UUID.randomUUID().toString());
                followupMapping.setFollowupId(Integer.parseInt(id));
                followupMapping.setUpdateTime(DateUtil.getNowTimestamp());
                followupMapping.setCreateTime(DateUtil.getNowTimestamp());
            }
            followupMapping.setNeedUpload(1);
            followUpMappingDao.save(followupMapping);
        }
//        if ("1".equals(followup.getStatus())) {
//            FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(id));
//            if (followupMapping == null) {
//                followupMapping = new FollowupMapping();
//                followupMapping.setCode(UUID.randomUUID().toString());
//                followupMapping.setFollowupId(Integer.parseInt(id));
//                followupMapping.setUpdateTime(DateUtil.getNowTimestamp());
//                followupMapping.setCreateTime(DateUtil.getNowTimestamp());
//            }
//            followupMapping.setNeedUpload(1);
//            followUpMappingDao.save(followupMapping);
//        }
    }
@ -1041,7 +1005,7 @@ public class FollowUpService {
    private List<BaseDoctorDO> getTeamDoctors(String doctor, String patient) throws Exception {
        List<BaseDoctorDO> doctors = new ArrayList<>();
        //获取医生团队成员
        SignFamily signFamily = signFamilyDao.findByFamilyDoctorAndPatient(doctor, patient);
//        SignFamily signFamily = signFamilyDao.findByFamilyDoctorAndPatient(doctor, patient);
        // 查询家庭医生团队
//        if (signFamily != null) {
//            doctors = drHealthTeamService.findTeamDoctors(signFamily.getTeamCode());
@ -2045,12 +2009,6 @@ public class FollowUpService {
            BasePatientDO p = patientDao.findById(followup.getPatientCode()).orElse(null);
            followup.setPatientName(p.getName());
            followup.setIdcard(p.getIdcard());
            //新增保存签约id v1.6.8.3
            SignFamily signFamily = signFamilyDao.findByjiatingPatient(followup.getPatientCode());
            if (signFamily != null) {
                followup.setAdminTeamCode(signFamily.getAdminTeamId());
            }
        }
        List<Date> dateList = followupDao.findFollowupDateList(followup.getDoctorCode(), followup.getPatientCode());
        Date prior = null;

+ 4 - 4
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/RehabilitationManageController.java

@ -156,8 +156,8 @@ public class RehabilitationManageController extends EnvelopRestEndpoint {
    @GetMapping(value = SpecialistMapping.rehabilitation.calendarPlanDetail)
    @ApiOperation(value = "康复管理-康复计划按日历展示")
    public ObjEnvelop calendarPlanDetail(
            @ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)") @RequestParam(value = "executeStartTime", required = false) String executeStartTime,
            @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)") @RequestParam(value = "executeEndTime", required = false) String executeEndTime,
            @ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd)") @RequestParam(value = "executeStartTime", required = false) String executeStartTime,
            @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd)") @RequestParam(value = "executeEndTime", required = false) String executeEndTime,
            @ApiParam(name = "planId", value = "计划id,多个计划逗号隔开", required = true) @RequestParam(value = "planId", required = true) String planId,
            @ApiParam(name = "searchTask", value = "快速查找任务:(1电话/短信关怀,2康复咨询,3健康监测,4上门服务,5康复指导,6康复随访,7康复复诊)", required = false) @RequestParam(value = "searchTask", required = false) Integer searchTask,
            @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false) @RequestParam(value = "status", required = false) Integer status,
@ -176,8 +176,8 @@ public class RehabilitationManageController extends EnvelopRestEndpoint {
    @GetMapping(value = SpecialistMapping.rehabilitation.calendarPlanDetailList)
    @ApiOperation(value = "康复管理-康复计划按列表展示")
    public ObjEnvelop calendarPlanDetailList(
            @ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)") @RequestParam(value = "executeStartTime", required = false) String executeStartTime,
            @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)") @RequestParam(value = "executeEndTime", required = false) String executeEndTime,
            @ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd)") @RequestParam(value = "executeStartTime", required = false) String executeStartTime,
            @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd)") @RequestParam(value = "executeEndTime", required = false) String executeEndTime,
            @ApiParam(name = "planId", value = "计划id,多个计划逗号隔开", required = true) @RequestParam(value = "planId", required = true) String planId,
            @ApiParam(name = "searchTask", value = "快速查找任务:(1电话/短信关怀,2康复咨询,3健康监测,4上门服务,5康复指导,6康复随访,7康复复诊 8所有)") @RequestParam(value = "searchTask", required = false) Integer searchTask,
            @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)") @RequestParam(value = "status", required = false) Integer status,

+ 46 - 80
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationManageService.java

@ -14,6 +14,7 @@ import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
import com.yihu.jw.entity.specialist.rehabilitation.*;
import com.yihu.jw.entity.util.TransforSqlUtl;
import com.yihu.jw.hospital.module.door.dao.ServiceItemPlanDao;
import com.yihu.jw.hospital.module.followup.dao.FollowUpDao;
import com.yihu.jw.hospital.module.followup.service.FollowUpService;
import com.yihu.jw.hospital.module.rehabilitation.dao.*;
import com.yihu.jw.hospital.module.specialist.dao.PatientDiseaseServerDao;
@ -92,6 +93,8 @@ public class RehabilitationManageService {
    private ServiceItemPlanDao serviceItemPlanDao;
    @Autowired
    private FollowUpService followUpService;
    @Autowired
    private FollowUpDao followupDao;
    //添加康复计划日志
    public void addPlanLog(String planId,String doctorCode,String doctorName){
@ -573,27 +576,26 @@ public class RehabilitationManageService {
     * @param doctorCode   登陆医生
     * @param taskExecutor 任务执行者 0全部;1我的任务 2他人任务
     */
    public ObjEnvelop calendarPlanDetail(String executeStartTime, String executeEndTime, String planId, Integer searchTask, Integer status, String doctorCode, String taskExecutor) throws Exception {
    public ObjEnvelop calendarPlanDetail(String executeStartTime, String executeEndTime, String planId, Integer searchTask,
                                         Integer status, String doctorCode, String taskExecutor) throws Exception {
        String[] planIdlist = planId.split(",");
        StringBuilder planCondition = new StringBuilder();
        planCondition.append("'" + planIdlist[0] + "'");
        for (int i = 1; i < planIdlist.length; i++) {
            planCondition.append(",'" + planIdlist[i] + "'");
        }
        String sql = " select d.* from wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id " +
                " where  d.plan_id in (" + planCondition + ") ";
        String sql = " select d.* from base_service_item_plan d  where d.plan_id in (" + planCondition + " ) ";
        if (StringUtils.isNotBlank(executeStartTime)) {
            sql += " and d.execute_time>='" + executeStartTime + "' ";
            sql += " and d.plan_time>='" + executeStartTime + "' ";
        }
        if (StringUtils.isNotBlank(executeEndTime)) {
            sql += " and d.execute_time<='" + executeEndTime + "' ";
            sql += " and d.plan_time<='" + executeEndTime + " 23:59:59' ";
        }
        if (searchTask != null) {
            if (searchTask == 8) {
                sql += " and d.doctor='" + doctorCode + "' ";
            } else {
                sql += " and i.code=" + searchTask + " ";
                sql += " and d.relation_type=" + searchTask + " ";
            }
        }
        if (taskExecutor.equals("1")) { //我的任务
@ -603,80 +605,42 @@ public class RehabilitationManageService {
            sql += "and d.doctor <>'" + doctorCode + "' ";
        }
        if (status != null) {
            sql += " and d.status=" + status;
            sql += " and d.status='" + status+"' ";
        }
        sql += " ORDER BY d.execute_time ";
        sql = TransforSqlUtl.wlyy_rehabilitation_plan_detailAll2(sql);
        sql += " ORDER BY d.plan_time ";
        List<Map<String, Object>> rehabilitationDetailList = jdbcTemplate.queryForList(sql);
        Map<String, Map<String, Object>> map = new LinkedHashMap<>();
        for (Map<String, Object> one : rehabilitationDetailList) {
            String executeTime = DateUtil.dateToStr((Date) one.get("execute_time"), DateUtil.YYYY_MM_DD);
            Map<String, Object> m = null;
            String executeTime = (one.get("plan_time")+"").substring(0,10);
            Map<String, Object> m = new HashMap<>();
            if (map.containsKey(executeTime)) {
                m = map.get(executeTime);
                Map<String, Integer> family = null;
                Map<String, Integer> specialist = null;
                if (one.get("type") != null) {
                    if ((Integer) one.get("type") == 1) {//家庭医生
                        if (m.containsKey("family")) {
                            family = (Map<String, Integer>) m.get("family");
                        } else {
                            family = new HashMap<>();
                            family.put("all", 0);
                            family.put("finish", 0);
                        }
                        if ((Integer) one.get("status") == 1) {
                            family.put("finish", family.get("finish") + 1);
                        }
                        family.put("all", family.get("all") + 1);
                        m.put("family", family);
                    } else if ((Integer) one.get("type") == 2) {//专科医生
                        if (m.containsKey("specialist")) {
                            specialist = (Map<String, Integer>) m.get("specialist");
                        } else {
                            specialist = new HashMap<>();
                            specialist.put("all", 0);
                            specialist.put("finish", 0);
                        }
                        if ((Integer) one.get("status") == 1) {
                            specialist.put("finish", (specialist.get("finish")) + 1);
                        }
                        specialist.put("all", (specialist.get("all")) + 1);
                        m.put("specialist", specialist);
                    }
                if (m.containsKey("doctor")) {
                    specialist = (Map<String, Integer>) m.get("doctor");
                } else {
                    specialist = new HashMap<>();
                    specialist.put("all", 0);
                    specialist.put("finish", 0);
                }
            } else {
                m = new HashMap<>();
//                m.put("specialist",new HashMap<String,Object>());
                if (one.get("type") != null) {
                    if ((Integer) one.get("type") == 1) {//家庭医生
                        Map<String, Integer> family = new HashMap<>();
                        family.put("all", 0);
                        family.put("finish", 0);
                        if ((Integer) one.get("status") == 1) {
                            family.put("finish", family.get("finish") + 1);
                        }
                        family.put("all", family.get("all") + 1);
                        m.put("family", family);
                    } else if ((Integer) one.get("type") == 2) {//专科医生
                        Map<String, Integer> specialist = new HashMap<>();
                        specialist.put("all", 0);
                        specialist.put("finish", 0);
                        if ((Integer) one.get("status") == 1) {
                            specialist.put("finish", specialist.get("finish") + 1);
                        }
                        specialist.put("all", specialist.get("all") + 1);
                        m.put("specialist", specialist);
                    }
                if ("1".equals(one.get("status")+"")) {
                    specialist.put("finish", (specialist.get("finish")) + 1);
                }
                specialist.put("all", (specialist.get("all")) + 1);
                m.put("doctor", specialist);
            }else{
                Map<String, Integer> specialist = new HashMap<>();
                specialist.put("all", 0);
                specialist.put("finish", 0);
                if ("1".equals(one.get("status")+"")) {
                    specialist.put("finish", specialist.get("finish") + 1);
                }
                specialist.put("all", specialist.get("all") + 1);
                m.put("doctor", specialist);
            }
            //myTaskFlag,1:有自己任务,0:没有自己任务
            if (StringUtils.isNotEmpty(doctorCode)) {
                if (m.containsKey("myTaskFlag")) {
                    if ((Integer) m.get("myTaskFlag") == 0) {
                        if (doctorCode.equals(one.get("doctor").toString())) {
@ -694,9 +658,9 @@ public class RehabilitationManageService {
                }
            }
            if (m.containsKey("planDetailIds")) {
                m.put("planDetailIds", m.get("planDetailIds") + "," + one.get("id"));
                m.put("serviceItemIds", m.get("serviceItemIds") + "," + one.get("id"));
            } else {
                m.put("planDetailIds", one.get("id") + "");
                m.put("serviceItemIds", one.get("id") + "");
            }
            map.put(executeTime, m);
        }
@ -1390,15 +1354,17 @@ public class RehabilitationManageService {
        if(planDO!=null){
            String sql = "SELECT content from wlyy_guidance_message_log WHERE plan_detail_id ='"+id+"' LIMIT 1";
            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
            planDO.setGuidanceMessage(list.get(0).get("content")+"");
        }
        if("1".equals(planDO.getStatus())){
            String relationCode = planDO.getRelationCode();
            if("6".equals(planDO.getRelationType())&&StringUtils.isNotBlank(relationCode)){
                Followup followup = followUpService.findFollowupInfo(Long.parseLong(relationCode));
                planDO.setFollowup(followup);
            if(list.size()>0){
                planDO.setGuidanceMessage(list.get(0).get("content")+"");
            }
        }
//        if("1".equals(planDO.getStatus())){
//            String relationCode = planDO.getRelationCode();
//            if("6".equals(planDO.getRelationType())&&StringUtils.isNotBlank(relationCode)){
//                Followup followup = followupDao.findById(Long.parseLong(relationCode)).orElse(null);
//                planDO.setFollowup(followup);
//            }
//        }
        return planDO;
    }
@ -1407,7 +1373,7 @@ public class RehabilitationManageService {
        String sql = "SELECT * from wlyy_guidance_message_log WHERE plan_detail_id ='"+itemPlanId+"' LIMIT 1";
        List<GuidanceMessageLogDO> logDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(GuidanceMessageLogDO.class));
        if(logDOS.size()>0){
            logDOS.get(0);
            return logDOS.get(0);
        }
        return null;
    }
@ -1436,8 +1402,8 @@ public class RehabilitationManageService {
        guidanceMessageLogDO.setDoctorName(doctorDO.getName());
        guidanceMessageLogDO.setCreateTime(new Date());
        guidanceMessageLogDO.setUpdateTime(new Date());
        guidanceMessageLogDao.save(guidanceMessageLogDO);
        return Envelop.getSuccess(SpecialistMapping.api_success);
        guidanceMessageLogDO = guidanceMessageLogDao.save(guidanceMessageLogDO);
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,guidanceMessageLogDO);
    }
    /**