|
@ -648,23 +648,25 @@ public class FollowUpService {
|
|
|
public Followup startFollowup(String id, String followupNo, String date, String followupType, String followupClass, String followupManagerStatus, String plandate, String prescriptioncode) throws Exception {
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
if (followup != null) {
|
|
|
ServiceItemPlanDO itemPlanDO = serviceItemPlanDao.findByRelationCode(id);
|
|
|
System.out.println("22222222222222222"+JSON.toJSONString(itemPlanDO));
|
|
|
ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findByPlanIdAndPlanDetailIdAndPlanTime(itemPlanDO.getPlanId(), itemPlanDO.getPlanDetailId(), DateUtil.dateToStrLong(followup.getFollowupNextDate()));
|
|
|
System.out.println("111111111111111111"+JSON.toJSONString(serviceItemPlanDO));
|
|
|
if (StringUtils.isNoneBlank(plandate)) {
|
|
|
followup.setFollowupNextDate(DateUtil.strToDate(plandate));
|
|
|
Followup nextFollowup = followupDao.findById(Long.valueOf(serviceItemPlanDO.getRelationCode())).orElse(null);
|
|
|
System.out.println("333333333333333333"+JSON.toJSONString(nextFollowup));
|
|
|
nextFollowup.setFollowupDate(DateUtil.strToDateLong(plandate));
|
|
|
nextFollowup.setFollowupPlanDate(DateUtil.strToDateLong(plandate));
|
|
|
serviceItemPlanDO.setPlanTime(plandate);
|
|
|
followupDao.save(nextFollowup);
|
|
|
serviceItemPlanDao.save(serviceItemPlanDO);
|
|
|
}
|
|
|
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 = followupDao.findById(Long.valueOf(serviceItemPlanDO.getRelationCode())).orElse(null);
|
|
|
nextFollowup.setFollowupDate(DateUtil.strToDate(plandate));
|
|
|
nextFollowup.setFollowupPlanDate(DateUtil.strToDate(plandate));
|
|
|
serviceItemPlanDO.setPlanTime(plandate);
|
|
|
followupDao.save(nextFollowup);
|
|
|
serviceItemPlanDao.save(serviceItemPlanDO);
|
|
|
|
|
|
}
|
|
|
followup.setFollowupType(followupType);
|
|
|
followup.setFollowupClass(followupClass);
|
|
|
followup.setFollowupManagerStatus(followupManagerStatus);
|