Parcourir la source

康复随访bug修复

wangzhinan il y a 11 mois
Parent
commit
cec63daefd

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/rehabilitation/ServiceItemPlanDao.java

@ -18,6 +18,10 @@ public interface ServiceItemPlanDao extends PagingAndSortingRepository<ServiceIt
    @Query("from ServiceItemPlanDO w where w.planId =?1 ")
    List<ServiceItemPlanDO> findByPlanId(String planId);
    ServiceItemPlanDO findByRelationCode(String relationCode);
    ServiceItemPlanDO findByPlanIdAndPlanDetailIdAndPlanTime(String planId,String planDetailId,Date planTime);
    ServiceItemPlanDO findByRelationCodeAndRelationType(String relationCode,String relationType);
    @Query("from ServiceItemPlanDO w where w.planDetailId =?1 and w.status=?2")

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

@ -25,6 +25,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.task.PushMsgTask;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.rehabilitation.ServiceItemPlanDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.idcard.IdCardUtil;
@ -83,24 +84,16 @@ public class FollowUpService {
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
//    @Autowired
//    private DrHealthTeamService drHealthTeamService;
    @Autowired
    private SystemMessageDao messageDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private BasePatientService patientService;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
    @Autowired
    private FollowupDrugsDao followupDrugsDao;
    private ServiceItemPlanDao serviceItemPlanDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
@ -658,40 +651,18 @@ public class FollowUpService {
            if (followup.getStatus().compareTo("2") == 0) {
                followup.setFollowupNo(followupNo);
                followup.setFollowupDate(DateUtil.strToDate(date));
                //计划下次随访时间--huangwenjie.2017.10.19
                if (StringUtils.isNoneBlank(plandate)) {
                    ServiceItemPlanDO itemPlanDO = serviceItemPlanDao.findByRelationCode(id);
                    ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findByPlanIdAndPlanDetailIdAndPlanTime(itemPlanDO.getPlanId(), itemPlanDO.getPlanDetailId(), followup.getFollowupNextDate());
                    followup.setFollowupNextDate(DateUtil.strToDate(plandate));
                    Followup nextFollowup = new Followup();
                    nextFollowup.setDataFrom(followup.getDataFrom());
                    nextFollowup.setStatus("2");
                    nextFollowup.setFollowupType(followupType);
                    nextFollowup.setFollowupNo(followup.getFollowupNo());
                    Followup nextFollowup = followupDao.findById(Long.valueOf(serviceItemPlanDO.getRelationCode())).orElse(null);
                    nextFollowup.setFollowupDate(DateUtil.strToDate(plandate));
                    nextFollowup.setFollowupPlanDate(DateUtil.strToDate(plandate));
                    nextFollowup.setJwdoctorCode(followup.getJwdoctorCode());
                    nextFollowup.setJworgCode(followup.getJworgCode());
                    nextFollowup.setOrgCode(followup.getOrgCode());
                    nextFollowup.setOrgName(followup.getOrgName());
                    nextFollowup.setCreater(followup.getCreater());
                    nextFollowup.setSignCode(followup.getSignCode());
                    nextFollowup.setAdminTeamCode(followup.getAdminTeamCode());
                    nextFollowup.setFollowupClass(followupClass);
                    nextFollowup.setFollowupManagerStatus(followupManagerStatus);
                    nextFollowup.setPatientName(followup.getPatientName());
                    nextFollowup.setPatientCode(followup.getPatientCode());
                    nextFollowup.setCreateTime(new Date());
                    nextFollowup.setUpdateTime(new Date());
                    nextFollowup.setDoctorCode(followup.getDoctorCode());
                    nextFollowup.setDoctorName(followup.getDoctorName());
                    nextFollowup.setIdcard(followup.getIdcard());
                    nextFollowup.setSignType(followup.getSignType());
                    nextFollowup.setType(1);
                    //获取随访医生角色类型
//                    List<DoctorMapping> doctorMapping = doctorMappingDao.findListByDoctorCode(followup.getDoctorCode());
//                    if (doctorMapping.size() == 1 && StringUtils.isNotBlank(doctorMapping.get(0).getJwDoctorWorkType())) {
//                        nextFollowup.setJwDoctorWorkType(doctorMapping.get(0).getJwDoctorWorkType());
//                    }
                    serviceItemPlanDO.setPlanTime(plandate);
                    followupDao.save(nextFollowup);
                    serviceItemPlanDao.save(serviceItemPlanDO);
                }
                followup.setFollowupType(followupType);
@ -699,17 +670,6 @@ public class FollowUpService {
                followup.setFollowupManagerStatus(followupManagerStatus);
                followup.setStatus("3");  //状态 0取消 1已完成 2未开始 3进行中
                followup.setPrescriptionCode(prescriptioncode);
//                if (StringUtils.isNoneBlank(prescriptioncode)) {
//                    try {
//                        Prescription prescription = prescriptionDao.findByCode(prescriptioncode);
////                        prescription.setViewSuifang(1);
//                        prescriptionDao.save(prescription);
//                    } catch (Exception e) {
//                        logger.info(e.getMessage());
//                    }
//                }
                Followup f = followupDao.save(followup);
                System.out.println("随访状态status" + f.getStatus());
                return f;