Merge branch '0418_小程序开发' of http://182.92.166.109:3000/jihan/PostDischargePatientManage into 0418_小程序开发
This commit is contained in:
commit
16b146d885
@ -1,6 +1,6 @@
|
||||
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 org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -22,7 +22,7 @@ public class HomePageController {
|
||||
private HomePageService homePageService;
|
||||
|
||||
@GetMapping("/myFollowUp")
|
||||
public AjaxResult myFollowUp(Long residentId) {
|
||||
public TableDataInfo myFollowUp(Long residentId) {
|
||||
return homePageService.myFollowUp(residentId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package com.xinelu.mobile.service.homepage;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
|
||||
public interface HomePageService {
|
||||
|
||||
AjaxResult myFollowUp(Long residentId);
|
||||
TableDataInfo myFollowUp(Long residentId);
|
||||
}
|
||||
@ -1,14 +1,18 @@
|
||||
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.utils.PageServiceUtil;
|
||||
import com.xinelu.mobile.mapper.homepage.HomePageMapper;
|
||||
import com.xinelu.mobile.service.homepage.HomePageService;
|
||||
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -18,16 +22,23 @@ public class HomePageServiceImpl implements HomePageService {
|
||||
|
||||
@Resource
|
||||
private HomePageMapper homePageMapper;
|
||||
@Resource
|
||||
private PageServiceUtil pageServiceUtil;
|
||||
|
||||
@Override
|
||||
public AjaxResult myFollowUp(Long residentId) {
|
||||
public TableDataInfo myFollowUp(Long residentId) {
|
||||
pageServiceUtil.startPage();
|
||||
List<MyFollowUpVO> myFollowUpList = homePageMapper.selectManageRouteNode(residentId, RouteNodeNameEnum.AFTER_ADMISSION.getInfo());
|
||||
if (CollectionUtils.isEmpty(myFollowUpList)) {
|
||||
return pageServiceUtil.getDataTable(new ArrayList<>());
|
||||
}
|
||||
for (MyFollowUpVO myFollowUpVO : myFollowUpList) {
|
||||
if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@
|
||||
spmrn.route_node_name,
|
||||
IFNULL( spmrn.route_node_day,0) routeNodeDay,
|
||||
pi.discharge_time,
|
||||
IF(pter.id==NULL,0,1) sign
|
||||
IF(pter.id=NULL,0,1) sign
|
||||
FROM patient_info pi
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user