Merge branch '0418_小程序开发' of http://182.92.166.109:3000/jihan/PostDischargePatientManage into 0418_小程序开发

This commit is contained in:
haown 2024-04-19 14:32:44 +08:00
commit 16b146d885
4 changed files with 20 additions and 9 deletions

View File

@ -1,6 +1,6 @@
package com.xinelu.mobile.controller.homepage; package com.xinelu.mobile.controller.homepage;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.mobile.service.homepage.HomePageService; import com.xinelu.mobile.service.homepage.HomePageService;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -22,7 +22,7 @@ public class HomePageController {
private HomePageService homePageService; private HomePageService homePageService;
@GetMapping("/myFollowUp") @GetMapping("/myFollowUp")
public AjaxResult myFollowUp(Long residentId) { public TableDataInfo myFollowUp(Long residentId) {
return homePageService.myFollowUp(residentId); return homePageService.myFollowUp(residentId);
} }
} }

View File

@ -1,8 +1,8 @@
package com.xinelu.mobile.service.homepage; package com.xinelu.mobile.service.homepage;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.page.TableDataInfo;
public interface HomePageService { public interface HomePageService {
AjaxResult myFollowUp(Long residentId); TableDataInfo myFollowUp(Long residentId);
} }

View File

@ -1,14 +1,18 @@
package com.xinelu.mobile.service.homepage.Impl; package com.xinelu.mobile.service.homepage.Impl;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.RouteNodeNameEnum; import com.xinelu.common.enums.RouteNodeNameEnum;
import com.xinelu.common.utils.PageServiceUtil;
import com.xinelu.mobile.mapper.homepage.HomePageMapper; import com.xinelu.mobile.mapper.homepage.HomePageMapper;
import com.xinelu.mobile.service.homepage.HomePageService; import com.xinelu.mobile.service.homepage.HomePageService;
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO; import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -18,16 +22,23 @@ public class HomePageServiceImpl implements HomePageService {
@Resource @Resource
private HomePageMapper homePageMapper; private HomePageMapper homePageMapper;
@Resource
private PageServiceUtil pageServiceUtil;
@Override @Override
public AjaxResult myFollowUp(Long residentId) { public TableDataInfo myFollowUp(Long residentId) {
pageServiceUtil.startPage();
List<MyFollowUpVO> myFollowUpList = homePageMapper.selectManageRouteNode(residentId, RouteNodeNameEnum.AFTER_ADMISSION.getInfo()); List<MyFollowUpVO> myFollowUpList = homePageMapper.selectManageRouteNode(residentId, RouteNodeNameEnum.AFTER_ADMISSION.getInfo());
if (CollectionUtils.isEmpty(myFollowUpList)) {
return pageServiceUtil.getDataTable(new ArrayList<>());
}
for (MyFollowUpVO myFollowUpVO : myFollowUpList) { for (MyFollowUpVO myFollowUpVO : myFollowUpList) {
if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) { if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) {
myFollowUpVO.setFollowDate(myFollowUpVO.getDischargeTime().plusDays(myFollowUpVO.getRouteNodeDay())); myFollowUpVO.setFollowDate(myFollowUpVO.getDischargeTime().plusDays(myFollowUpVO.getRouteNodeDay()));
} }
myFollowUpVO.setRouteNodeName((myFollowUpVO.getRouteNodeName() == null ? "出院后" : myFollowUpVO.getRouteNodeName()) + myFollowUpVO.getRouteNodeDay()); myFollowUpVO.setRouteNodeName("出院后第" + myFollowUpVO.getRouteNodeDay() + "");
} }
return AjaxResult.success(myFollowUpList); myFollowUpList.sort(Comparator.comparing(MyFollowUpVO::getFollowDate).reversed());
return pageServiceUtil.getDataTable(myFollowUpList);
} }
} }

View File

@ -9,7 +9,7 @@
spmrn.route_node_name, spmrn.route_node_name,
IFNULL( spmrn.route_node_day,0) routeNodeDay, IFNULL( spmrn.route_node_day,0) routeNodeDay,
pi.discharge_time, pi.discharge_time,
IF(pter.id==NULL,0,1) sign IF(pter.id=NULL,0,1) sign
FROM patient_info pi FROM patient_info pi
LEFT JOIN sign_patient_manage_route spmr ON spmr.patient_id = pi.id LEFT JOIN sign_patient_manage_route spmr ON spmr.patient_id = pi.id
LEFT JOIN sign_patient_manage_route_node spmrn ON spmrn.manage_route_id = spmr.id LEFT JOIN sign_patient_manage_route_node spmrn ON spmrn.manage_route_id = spmr.id