diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/RouteNodeNameEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/RouteNodeNameEnum.java new file mode 100644 index 00000000..a98c9291 --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/RouteNodeNameEnum.java @@ -0,0 +1,49 @@ +package com.xinelu.common.enums; + +import lombok.Getter; + +/** + * @Description 管理路径节点名称 + * @Author zh + * @Date 2024-04-18 + */ +@Getter +public enum RouteNodeNameEnum { + + /** + * 出院后 + */ + AFTER_DISCHARGE("AFTER_DISCHARGE"), + + /** + * 入院后 + */ + AFTER_ADMISSION("AFTER_ADMISSION"), + + /** + * 就诊后 + */ + AFTER_CONSULTATION("AFTER_CONSULTATION"), + + /** + * 就诊/出院后 + */ + AFTER_VISIT_DISCHARGE("AFTER_VISIT_DISCHARGE"), + + /** + * 术前 + */ + PREOPERATIVE("PREOPERATIVE"), + + /** + * 术后 + */ + POSTOPERATIVE("POSTOPERATIVE"), + ; + + final private String info; + + RouteNodeNameEnum(String info) { + this.info = info; + } +} \ No newline at end of file diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/homepage/HomePageController.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/homepage/HomePageController.java new file mode 100644 index 00000000..ec8d8b66 --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/homepage/HomePageController.java @@ -0,0 +1,28 @@ +package com.xinelu.mobile.controller.homepage; + +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.mobile.service.homepage.HomePageService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * 机构信息Controller + * + * @author xinelu + * @date 2024-04-18 + */ +@RestController +@RequestMapping("/postDischarge/homePage") +public class HomePageController { + + @Resource + private HomePageService homePageService; + + @GetMapping("/myFollowUp") + public AjaxResult myFollowUp(Long residentId) { + return homePageService.myFollowUp(residentId); + } +} diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/mapper/homepage/HomePageMapper.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/mapper/homepage/HomePageMapper.java new file mode 100644 index 00000000..5b44fb86 --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/mapper/homepage/HomePageMapper.java @@ -0,0 +1,17 @@ +package com.xinelu.mobile.mapper.homepage; + +import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Description 院后小程序首页Mapper层 + * @Author zh + * @Date 2024-04-18 + * @Version 1.0 + */ +public interface HomePageMapper { + + List selectManageRouteNode(@Param("residentId") Long residentId, @Param("routeNodeName") String routeNodeName); +} \ No newline at end of file diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/HomePageService.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/HomePageService.java new file mode 100644 index 00000000..6e1de6ac --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/HomePageService.java @@ -0,0 +1,8 @@ +package com.xinelu.mobile.service.homepage; + +import com.xinelu.common.core.domain.AjaxResult; + +public interface HomePageService { + + AjaxResult myFollowUp(Long residentId); +} \ No newline at end of file diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/Impl/HomePageServiceImpl.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/Impl/HomePageServiceImpl.java new file mode 100644 index 00000000..1dc33fed --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/Impl/HomePageServiceImpl.java @@ -0,0 +1,33 @@ +package com.xinelu.mobile.service.homepage.Impl; + +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.enums.RouteNodeNameEnum; +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.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Objects; + +@Service +@Slf4j +public class HomePageServiceImpl implements HomePageService { + + @Resource + private HomePageMapper homePageMapper; + + @Override + public AjaxResult myFollowUp(Long residentId) { + List myFollowUpList = homePageMapper.selectManageRouteNode(residentId, RouteNodeNameEnum.AFTER_ADMISSION.getInfo()); + 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()); + } + return AjaxResult.success(myFollowUpList); + } +} \ No newline at end of file diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/myfollowup/MyFollowUpVO.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/myfollowup/MyFollowUpVO.java new file mode 100644 index 00000000..2bb39a4d --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/myfollowup/MyFollowUpVO.java @@ -0,0 +1,47 @@ +package com.xinelu.mobile.vo.myfollowup; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.time.LocalDate; + +/** + * 我的随访对象vo + * + * @author xinelu + * @date 2024-04-18 + */ +@Data +public class MyFollowUpVO { + + /** + * 随访时间 + */ + private LocalDate followDate; + + /** + * 管理路径节点名称 + */ + private String routeNodeName; + + /** + * 随访方式 + */ + private String taskType; + + /** + * 管理路径节点时间 + */ + private Integer routeNodeDay; + + /** + * 出院时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate dischargeTime; + + /** + * 是否随访标记 0:否 1:是 + */ + private Integer sign; +} \ No newline at end of file diff --git a/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml b/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml new file mode 100644 index 00000000..706c3f82 --- /dev/null +++ b/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml @@ -0,0 +1,26 @@ + + + + + + \ No newline at end of file