小程序修改
This commit is contained in:
parent
8d5e74e497
commit
9817ecf55e
@ -0,0 +1,40 @@
|
|||||||
|
package com.xinelu.manage.controller.homepage;
|
||||||
|
|
||||||
|
import com.xinelu.common.core.controller.BaseController;
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.manage.service.homepage.SystemHomePageService;
|
||||||
|
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 zh
|
||||||
|
* @date 2024-08-13
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/homePage")
|
||||||
|
public class SystemHomePageController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SystemHomePageService systemHomePageService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("topStatistics")
|
||||||
|
public AjaxResult topStatistics() {
|
||||||
|
return AjaxResult.success(systemHomePageService.topStatistics());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("signPatientCount")
|
||||||
|
public AjaxResult signPatientCount() {
|
||||||
|
return AjaxResult.success(systemHomePageService.signPatientCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("serviceModeStatistics")
|
||||||
|
public AjaxResult serviceModeStatistics() {
|
||||||
|
return AjaxResult.success(systemHomePageService.serviceModeStatistics());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,9 @@ import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
|
|||||||
import com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo;
|
import com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo;
|
||||||
import com.xinelu.manage.vo.patientinfo.PatientInfoVo;
|
import com.xinelu.manage.vo.patientinfo.PatientInfoVo;
|
||||||
import com.xinelu.manage.vo.patientinfo.PatientNextTaskVo;
|
import com.xinelu.manage.vo.patientinfo.PatientNextTaskVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -104,4 +107,19 @@ public interface PatientInfoMapper {
|
|||||||
* @return 被护理人基本信息
|
* @return 被护理人基本信息
|
||||||
*/
|
*/
|
||||||
ResidentInfo getPatientInfoByOpenId(String openId);
|
ResidentInfo getPatientInfoByOpenId(String openId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据创建时间查询患者数量
|
||||||
|
*
|
||||||
|
* @param firstDay 本月第一天
|
||||||
|
* @param now 当前时间
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int getPatientInfoCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
|
||||||
|
|
||||||
|
int selectPatientInfoCountBySignTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
|
||||||
|
|
||||||
|
int selectPatientSignTotalCount();
|
||||||
|
|
||||||
|
int selectPatientSignServiceCount();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package com.xinelu.manage.mapper.patientprehospitalization;
|
|||||||
|
|
||||||
import com.xinelu.manage.domain.patientprehospitalization.PatientPreHospitalization;
|
import com.xinelu.manage.domain.patientprehospitalization.PatientPreHospitalization;
|
||||||
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
|
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@ -39,4 +41,12 @@ public interface PatientPreHospitalizationMapper {
|
|||||||
*/
|
*/
|
||||||
public int deleteByIds(Long[] ids);
|
public int deleteByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据创建时间查询预住院患者数量
|
||||||
|
*
|
||||||
|
* @param firstDay 本月第一天
|
||||||
|
* @param now 当前时间
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int getPatientPreHospitalizationCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,15 +3,14 @@ package com.xinelu.manage.mapper.signpatientmanageroutenode;
|
|||||||
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
||||||
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
|
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
|
||||||
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
|
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
|
||||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo;
|
import com.xinelu.manage.vo.signpatientmanageroutenode.*;
|
||||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
|
|
||||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
|
|
||||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientTaskVo;
|
|
||||||
import com.xinelu.manage.vo.signpatientmanageroutenode.TextMessage;
|
|
||||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||||
import java.util.List;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 签约患者管理任务路径节点Mapper接口
|
* 签约患者管理任务路径节点Mapper接口
|
||||||
*
|
*
|
||||||
@ -152,4 +151,8 @@ public interface SignPatientManageRouteNodeMapper {
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
int updateNodeExecuteStatusByIds(@Param("manageRouteNodeIds") List<Long> manageRouteNodeIds, @Param("nodeExecuteStatus") String nodeExecuteStatus, @Param("appletStatus") String appletStatus, @Param("messageStatus") String messageStatus, @Param("officialStatus") String officialStatus);
|
int updateNodeExecuteStatusByIds(@Param("manageRouteNodeIds") List<Long> manageRouteNodeIds, @Param("nodeExecuteStatus") String nodeExecuteStatus, @Param("appletStatus") String appletStatus, @Param("messageStatus") String messageStatus, @Param("officialStatus") String officialStatus);
|
||||||
|
|
||||||
|
int selectNodeCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
|
||||||
|
|
||||||
|
BigDecimal selectNodeCount(@Param("phoneDialMethod") String phoneDialMethod, @Param("messagePushSign") Long messagePushSign, @Param("appletPushSign") Long appletPushSign);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.xinelu.manage.service.homepage;
|
||||||
|
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.manage.vo.homepage.ServiceModeStatistics;
|
||||||
|
import com.xinelu.manage.vo.homepage.SignPatientCount;
|
||||||
|
import com.xinelu.manage.vo.homepage.TopStatisticsVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页信息Service接口
|
||||||
|
*
|
||||||
|
* @author ZH
|
||||||
|
* @date 2024-08-13
|
||||||
|
*/
|
||||||
|
public interface SystemHomePageService {
|
||||||
|
|
||||||
|
TopStatisticsVO topStatistics();
|
||||||
|
|
||||||
|
List<SignPatientCount> signPatientCount();
|
||||||
|
|
||||||
|
ServiceModeStatistics serviceModeStatistics();
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package com.xinelu.manage.service.homepage.impl;
|
||||||
|
|
||||||
|
import com.xinelu.common.enums.PhoneDialMethodEnum;
|
||||||
|
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
||||||
|
import com.xinelu.manage.mapper.patientprehospitalization.PatientPreHospitalizationMapper;
|
||||||
|
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||||
|
import com.xinelu.manage.service.homepage.SystemHomePageService;
|
||||||
|
import com.xinelu.manage.vo.homepage.ServiceModeStatistics;
|
||||||
|
import com.xinelu.manage.vo.homepage.SignPatientCount;
|
||||||
|
import com.xinelu.manage.vo.homepage.TopStatisticsVO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.temporal.TemporalAdjusters;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ZH
|
||||||
|
* @date 2024-08-13
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SystemHomePageServiceImpl implements SystemHomePageService {
|
||||||
|
@Resource
|
||||||
|
private PatientInfoMapper patientInfoMapper;
|
||||||
|
@Resource
|
||||||
|
private PatientPreHospitalizationMapper patientPreHospitalizationMapper;
|
||||||
|
@Resource
|
||||||
|
private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TopStatisticsVO topStatistics() {
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
TopStatisticsVO topStatisticsVO = new TopStatisticsVO();
|
||||||
|
LocalDate firstDay = now.with(TemporalAdjusters.firstDayOfMonth());
|
||||||
|
int createPatientCount = patientInfoMapper.getPatientInfoCountByCreateTime(firstDay, now);
|
||||||
|
int patientPreHospitalizationCount = patientPreHospitalizationMapper.getPatientPreHospitalizationCountByCreateTime(firstDay, now);
|
||||||
|
topStatisticsVO.setThisMonthPatient(createPatientCount + patientPreHospitalizationCount);
|
||||||
|
topStatisticsVO.setSignPatientCount(patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, now));
|
||||||
|
topStatisticsVO.setNodeCount(signPatientManageRouteNodeMapper.selectNodeCountByCreateTime(firstDay, now));
|
||||||
|
topStatisticsVO.setPatientSignCount(patientInfoMapper.selectPatientSignTotalCount());
|
||||||
|
topStatisticsVO.setPatientSignServiceCount(patientInfoMapper.selectPatientSignServiceCount());
|
||||||
|
return topStatisticsVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SignPatientCount> signPatientCount() {
|
||||||
|
List<LocalDate> localDates = new ArrayList<>();
|
||||||
|
List<SignPatientCount> signPatientCounts = new ArrayList<>();
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
for (int i = 5; i >= 0; i--) {
|
||||||
|
LocalDate localDate = now.minusMonths(i);
|
||||||
|
localDates.add(localDate);
|
||||||
|
}
|
||||||
|
for (LocalDate localDate : localDates) {
|
||||||
|
SignPatientCount signPatientCount = new SignPatientCount();
|
||||||
|
LocalDate firstDay = localDate.with(TemporalAdjusters.firstDayOfMonth());
|
||||||
|
LocalDate lastDay = localDate.with(TemporalAdjusters.lastDayOfMonth());
|
||||||
|
int createPatientCount = patientInfoMapper.getPatientInfoCountByCreateTime(firstDay, lastDay);
|
||||||
|
int i = patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, lastDay);
|
||||||
|
signPatientCount.setTime(localDate);
|
||||||
|
signPatientCount.setSignPatientCount(createPatientCount);
|
||||||
|
signPatientCount.setProportion(new BigDecimal(i).divide(new BigDecimal(createPatientCount), 2, RoundingMode.HALF_UP));
|
||||||
|
signPatientCounts.add(signPatientCount);
|
||||||
|
}
|
||||||
|
return signPatientCounts;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServiceModeStatistics serviceModeStatistics() {
|
||||||
|
ServiceModeStatistics serviceModeStatistics = new ServiceModeStatistics();
|
||||||
|
BigDecimal all = signPatientManageRouteNodeMapper.selectNodeCount(null, null, null);
|
||||||
|
BigDecimal common = signPatientManageRouteNodeMapper.selectNodeCount(PhoneDialMethodEnum.COMMON.getInfo(), null, null);
|
||||||
|
BigDecimal AI = signPatientManageRouteNodeMapper.selectNodeCount(PhoneDialMethodEnum.AI.getInfo(), null, null);
|
||||||
|
BigDecimal messagePushSign = signPatientManageRouteNodeMapper.selectNodeCount(null, 0L, null);
|
||||||
|
BigDecimal appletPushSign = signPatientManageRouteNodeMapper.selectNodeCount(null, null, 0L);
|
||||||
|
serviceModeStatistics.setAI(AI.divide(all, 2, RoundingMode.HALF_UP));
|
||||||
|
serviceModeStatistics.setMessage(messagePushSign.divide(all, 2, RoundingMode.HALF_UP));
|
||||||
|
serviceModeStatistics.setCommon(common.divide(all, 2, RoundingMode.HALF_UP));
|
||||||
|
serviceModeStatistics.setWeChat(appletPushSign.divide(all, 2, RoundingMode.HALF_UP));
|
||||||
|
return serviceModeStatistics;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package com.xinelu.manage.vo.homepage;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ServiceModeStatistics {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信
|
||||||
|
*/
|
||||||
|
private BigDecimal message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ai
|
||||||
|
*/
|
||||||
|
private BigDecimal AI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人工随访
|
||||||
|
*/
|
||||||
|
private BigDecimal common;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信
|
||||||
|
*/
|
||||||
|
private BigDecimal weChat;
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package com.xinelu.manage.vo.homepage;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SignPatientCount {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*/
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Integer SignPatientCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百分比
|
||||||
|
*/
|
||||||
|
private BigDecimal proportion;
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.xinelu.manage.vo.homepage;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TopStatisticsVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月新增患者数
|
||||||
|
*/
|
||||||
|
private Integer thisMonthPatient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月签约患者数
|
||||||
|
*/
|
||||||
|
private Integer signPatientCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月随访人次
|
||||||
|
*/
|
||||||
|
private Integer nodeCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务总人数
|
||||||
|
*/
|
||||||
|
private Integer patientSignCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务中患者数
|
||||||
|
*/
|
||||||
|
private Integer patientSignServiceCount;
|
||||||
|
}
|
||||||
@ -714,4 +714,38 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getPatientInfoCountByCreateTime" resultType="java.lang.Integer">
|
||||||
|
select
|
||||||
|
count(1)
|
||||||
|
from patient_info
|
||||||
|
where
|
||||||
|
del_flag = 0
|
||||||
|
and create_time >= #{firstDay}
|
||||||
|
and create_time <= #{now}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPatientInfoCountBySignTime" resultType="java.lang.Integer">
|
||||||
|
select
|
||||||
|
count(1)
|
||||||
|
from patient_info
|
||||||
|
where
|
||||||
|
del_flag = 0
|
||||||
|
and sign_time >= #{firstDay}
|
||||||
|
and sign_time <= #{now}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPatientSignTotalCount" resultType="java.lang.Integer">
|
||||||
|
select count(1)
|
||||||
|
from patient_info
|
||||||
|
where del_flag = 0
|
||||||
|
and (service_status = 'SERVICE_CENTER' or service_status = 'SERVICE_END')
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPatientSignServiceCount" resultType="java.lang.Integer">
|
||||||
|
select count(1)
|
||||||
|
from patient_info
|
||||||
|
where del_flag = 0
|
||||||
|
and service_status = 'SERVICE_CENTER'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -391,4 +391,14 @@
|
|||||||
#{item.updateTime,jdbcType=TIMESTAMP})
|
#{item.updateTime,jdbcType=TIMESTAMP})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="getPatientPreHospitalizationCountByCreateTime" resultType="java.lang.Integer">
|
||||||
|
select
|
||||||
|
count(1)
|
||||||
|
from patient_pre_hospitalization
|
||||||
|
where
|
||||||
|
del_flag = 0
|
||||||
|
and create_time >= #{firstDay}
|
||||||
|
and create_time <= #{now}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -938,4 +938,29 @@
|
|||||||
#{manageRouteNodeIds}
|
#{manageRouteNodeIds}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectNodeCountByCreateTime" resultType="java.lang.Integer">
|
||||||
|
select count(1)
|
||||||
|
from sign_patient_manage_route_node
|
||||||
|
where del_flag = 0
|
||||||
|
and phone_push_sign = 0
|
||||||
|
and create_time >= #{firstDay}
|
||||||
|
and create_time <= #{now}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectNodeCount" resultType="java.math.BigDecimal">
|
||||||
|
select count(1)
|
||||||
|
from sign_patient_manage_route_node
|
||||||
|
where del_flag = 0
|
||||||
|
<if test="phoneDialMethod != null and phoneDialMethod != ''">
|
||||||
|
and phone_dial_method =#{phoneDialMethod}
|
||||||
|
</if>
|
||||||
|
<if test="messagePushSign != null and messagePushSign != ''">
|
||||||
|
and message_push_sign =#{messagePushSign}
|
||||||
|
</if>
|
||||||
|
<if test="appletPushSign != null and appletPushSign != ''">
|
||||||
|
and (applet_push_sign =#{appletPushSign}
|
||||||
|
OR official_push_sign =#{appletPushSign})
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -3,10 +3,10 @@ package com.xinelu.mobile.controller.homepage;
|
|||||||
import com.xinelu.common.core.controller.BaseController;
|
import com.xinelu.common.core.controller.BaseController;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.core.page.TableDataInfo;
|
import com.xinelu.common.core.page.TableDataInfo;
|
||||||
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
|
||||||
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
||||||
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
|
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
|
||||||
import com.xinelu.mobile.service.homepage.HomePageService;
|
import com.xinelu.mobile.service.homepage.HomePageService;
|
||||||
|
import com.xinelu.mobile.vo.homepage.HealthLog;
|
||||||
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ public class HomePageController extends BaseController {
|
|||||||
@GetMapping("/selectTaskExecuteRecord")
|
@GetMapping("/selectTaskExecuteRecord")
|
||||||
public TableDataInfo selectPatientTaskExecuteRecord(Long residentId) {
|
public TableDataInfo selectPatientTaskExecuteRecord(Long residentId) {
|
||||||
startPage();
|
startPage();
|
||||||
List<PatientTaskExecuteRecord> list = homePageService.selectPatientTaskExecuteRecord(residentId);
|
List<HealthLog> list = homePageService.selectPatientTaskExecuteRecord(residentId);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/mobile/info")
|
@RequestMapping("/postDischarge")
|
||||||
public class MobileInfoController extends BaseController {
|
public class MobileInfoController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.xinelu.mobile.mapper.homepage;
|
|||||||
|
|
||||||
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
||||||
import com.xinelu.manage.vo.signpatientmanageroute.PhonePush;
|
import com.xinelu.manage.vo.signpatientmanageroute.PhonePush;
|
||||||
|
import com.xinelu.mobile.vo.homepage.HealthLog;
|
||||||
import com.xinelu.mobile.vo.homepage.MessageTabulationVO;
|
import com.xinelu.mobile.vo.homepage.MessageTabulationVO;
|
||||||
import com.xinelu.mobile.vo.homepage.NodeExecuteStatus;
|
import com.xinelu.mobile.vo.homepage.NodeExecuteStatus;
|
||||||
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
||||||
@ -33,7 +34,7 @@ public interface HomePageMapper {
|
|||||||
* @param nodeExecuteStatus 节点状态
|
* @param nodeExecuteStatus 节点状态
|
||||||
* @return PatientTaskExecuteRecord
|
* @return PatientTaskExecuteRecord
|
||||||
*/
|
*/
|
||||||
List<PatientTaskExecuteRecord> selectTaskExecuteRecordByResidentId(@Param("residentId") Long residentId, @Param("nodeExecuteStatus") String nodeExecuteStatus);
|
List<HealthLog> selectTaskExecuteRecordByResidentId(@Param("residentId") Long residentId, @Param("nodeExecuteStatus") String nodeExecuteStatus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据居民查询满意度问卷
|
* 根据居民查询满意度问卷
|
||||||
|
|||||||
@ -2,10 +2,10 @@ package com.xinelu.mobile.service.homepage;
|
|||||||
|
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.core.page.TableDataInfo;
|
import com.xinelu.common.core.page.TableDataInfo;
|
||||||
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
|
||||||
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
||||||
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
|
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
|
||||||
import com.xinelu.manage.vo.signpatientmanageroute.PhonePush;
|
import com.xinelu.manage.vo.signpatientmanageroute.PhonePush;
|
||||||
|
import com.xinelu.mobile.vo.homepage.HealthLog;
|
||||||
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -64,7 +64,7 @@ public interface HomePageService {
|
|||||||
* @param residentId 用户id
|
* @param residentId 用户id
|
||||||
* @return AjaxResult
|
* @return AjaxResult
|
||||||
*/
|
*/
|
||||||
List<PatientTaskExecuteRecord> selectPatientTaskExecuteRecord(Long residentId);
|
List<HealthLog> selectPatientTaskExecuteRecord(Long residentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 满意度问卷
|
* 满意度问卷
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO;
|
|||||||
import com.xinelu.manage.vo.signpatientmanageroute.PhonePush;
|
import com.xinelu.manage.vo.signpatientmanageroute.PhonePush;
|
||||||
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.homepage.HealthLog;
|
||||||
import com.xinelu.mobile.vo.homepage.MessageContentVO;
|
import com.xinelu.mobile.vo.homepage.MessageContentVO;
|
||||||
import com.xinelu.mobile.vo.homepage.MessageTabulationVO;
|
import com.xinelu.mobile.vo.homepage.MessageTabulationVO;
|
||||||
import com.xinelu.mobile.vo.homepage.NodeExecuteStatus;
|
import com.xinelu.mobile.vo.homepage.NodeExecuteStatus;
|
||||||
@ -45,6 +46,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@ -272,8 +274,24 @@ public class HomePageServiceImpl implements HomePageService {
|
|||||||
* @return AjaxResult
|
* @return AjaxResult
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PatientTaskExecuteRecord> selectPatientTaskExecuteRecord(Long residentId) {
|
public List<HealthLog> selectPatientTaskExecuteRecord(Long residentId) {
|
||||||
return homePageMapper.selectTaskExecuteRecordByResidentId(residentId, null);
|
List<HealthLog> patientTaskExecuteRecords = homePageMapper.selectTaskExecuteRecordByResidentId(residentId, null);
|
||||||
|
if (CollectionUtils.isNotEmpty(patientTaskExecuteRecords)) {
|
||||||
|
for (HealthLog patientTaskExecuteRecord : patientTaskExecuteRecords) {
|
||||||
|
LocalDate localDate = null;
|
||||||
|
if (Objects.nonNull(patientTaskExecuteRecord.getDischargeTime())) {
|
||||||
|
localDate = patientTaskExecuteRecord.getDischargeTime().plusDays(patientTaskExecuteRecord.getRouteNodeDay());
|
||||||
|
}
|
||||||
|
if (Objects.isNull(patientTaskExecuteRecord.getDischargeTime()) && Objects.nonNull(patientTaskExecuteRecord.getVisitDate())) {
|
||||||
|
localDate = patientTaskExecuteRecord.getVisitDate().plusDays(patientTaskExecuteRecord.getRouteNodeDay());
|
||||||
|
}
|
||||||
|
if (Objects.isNull(localDate)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
patientTaskExecuteRecord.setExecuteTime(localDate.atTime(0, 0, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return patientTaskExecuteRecords;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
package com.xinelu.mobile.vo.homepage;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class HealthLog extends PatientTaskExecuteRecord {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "出院时间")
|
||||||
|
private LocalDate dischargeTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "就诊时间")
|
||||||
|
private LocalDate visitDate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "管理路径节点时间,时间单位为:天")
|
||||||
|
private Integer routeNodeDay;
|
||||||
|
}
|
||||||
@ -42,15 +42,18 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTaskExecuteRecordByResidentId"
|
<select id="selectTaskExecuteRecordByResidentId"
|
||||||
resultType="com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord">
|
resultType="com.xinelu.mobile.vo.homepage.HealthLog">
|
||||||
select
|
select
|
||||||
CASE
|
CASE
|
||||||
WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name
|
WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name
|
||||||
WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
|
WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
|
||||||
WHEN spmrn.task_node_type = 'PROPAGANDA_ARTICLE' THEN spmrn.propaganda_title
|
WHEN spmrn.task_node_type = 'PROPAGANDA_ARTICLE' THEN spmrn.propaganda_title
|
||||||
WHEN spmrn.task_node_type = 'TEXT_REMIND' THEN '文字提醒'
|
WHEN spmrn.task_node_type = 'TEXT_REMIND' THEN '消息通知'
|
||||||
END AS manageRouteNodeName,
|
END AS manageRouteNodeName,
|
||||||
pter.execute_time
|
pter.execute_time,
|
||||||
|
pi.discharge_time,
|
||||||
|
pi.visit_date,
|
||||||
|
spmrn.route_node_day
|
||||||
from sign_patient_manage_route_node spmrn
|
from sign_patient_manage_route_node spmrn
|
||||||
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
|
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
|
||||||
LEFT JOIN patient_info pi ON pi.id = spmr.patient_id
|
LEFT JOIN patient_info pi ON pi.id = spmr.patient_id
|
||||||
@ -163,7 +166,7 @@
|
|||||||
CASE
|
CASE
|
||||||
WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
|
WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
|
||||||
WHEN spmrn.task_node_type = 'PROPAGANDA_ARTICLE' THEN spmrn.propaganda_title
|
WHEN spmrn.task_node_type = 'PROPAGANDA_ARTICLE' THEN spmrn.propaganda_title
|
||||||
WHEN spmrn.task_node_type = 'TEXT_REMIND' THEN '文字提醒'
|
WHEN spmrn.task_node_type = 'TEXT_REMIND' THEN '消息通知'
|
||||||
END AS manageRouteNodeName
|
END AS manageRouteNodeName
|
||||||
from sign_patient_manage_route_node spmrn
|
from sign_patient_manage_route_node spmrn
|
||||||
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
|
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user