fix: 健康管理档案,功能优化完善。

This commit is contained in:
tianyongbao
2024-12-16 15:08:47 +08:00
parent 79ca96501e
commit 498d061cb0
8 changed files with 61 additions and 10 deletions

View File

@@ -158,7 +158,21 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
long min = diff % nd % nh / nm; long min = diff % nd % nh / nm;
// 计算差多少秒//输出结果 // 计算差多少秒//输出结果
// long sec = diff % nd % nh % nm / ns; // long sec = diff % nd % nh % nm / ns;
if(day>0){
return day + "" + hour + "小时" + min + "分钟"; return day + "" + hour + "小时" + min + "分钟";
}else {
if(hour>0){
if(min>0){
return hour + "小时" + min + "分钟";
}else {
return hour + "小时";
}
}
else {
return min + "分钟";
}
}
} }
/** /**

View File

@@ -57,12 +57,18 @@ public class HealthDoctorRecord extends BaseEntity
@Excel(name = "康复时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "康复时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date visitingTime; private Date visitingTime;
/** 诊断及用药 */ /** 处理及医嘱 */
@ApiModelProperty(value="诊断及用药)") @ApiModelProperty(value="处理及医嘱)")
@NotNull(message="诊断及用药不能为空") @NotNull(message="处理及医嘱不能为空")
@Excel(name = "诊断及用药") @Excel(name = "处理及医嘱")
private String prescribe; private String prescribe;
/** 诊断结果 */
@ApiModelProperty(value="诊断结果)")
@NotNull(message="诊断结果不能为空")
@Excel(name = "诊断结果")
private String diagnosis;
/** 人员id */ /** 人员id */
@ApiModelProperty(value="人员id") @ApiModelProperty(value="人员id")
@Excel(name = "人员id") @Excel(name = "人员id")
@@ -108,6 +114,7 @@ public class HealthDoctorRecord extends BaseEntity
.append("partner", getPartner()) .append("partner", getPartner())
.append("costDetail", getCostDetail()) .append("costDetail", getCostDetail())
.append("type", getType()) .append("type", getType())
.append("diagnosis", getDiagnosis())
.toString(); .toString();
} }
} }

View File

@@ -1,8 +1,9 @@
package com.ruoyi.health.domain.vo; package com.ruoyi.health.domain.vo;
import com.ruoyi.health.domain.HealthActivity; import com.ruoyi.health.domain.HealthActivity;
import lombok.Data;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/** /**
* 活动记录Vo对象 health_activity * 活动记录Vo对象 health_activity
* *
@@ -13,5 +14,6 @@ import io.swagger.annotations.ApiModel;
@Data @Data
public class HealthActivityVo extends HealthActivity public class HealthActivityVo extends HealthActivity
{ {
@ApiModelProperty(value="活动时长")
private String exerciseTimeStr;
} }

View File

@@ -21,4 +21,7 @@ public class HealthRecordVo extends HealthRecord
@Excel(name = "人员姓名") @Excel(name = "人员姓名")
private String personName; private String personName;
@ApiModelProperty(value="持续时间")
private String duration;
} }

View File

@@ -46,7 +46,12 @@ public class HealthActivityServiceImpl implements IHealthActivityService
@Override @Override
public List<HealthActivityVo> selectHealthActivityList(HealthActivityDto healthActivityDto) public List<HealthActivityVo> selectHealthActivityList(HealthActivityDto healthActivityDto)
{ {
return healthActivityMapper.selectHealthActivityList(healthActivityDto); List<HealthActivityVo> healthActivityList = healthActivityMapper.selectHealthActivityList(healthActivityDto);
for (HealthActivityVo activityVo : healthActivityList) {
String daysBetween = DateUtils.timeDistance(activityVo.getEndTime(),activityVo.getStartTime());
activityVo.setExerciseTimeStr(daysBetween);
}
return healthActivityList;
} }
/** /**
@@ -60,6 +65,7 @@ public class HealthActivityServiceImpl implements IHealthActivityService
{ {
healthActivity.setCreateBy(SecurityUtils.getUsername()); healthActivity.setCreateBy(SecurityUtils.getUsername());
healthActivity.setCreateTime(DateUtils.getNowDate()); healthActivity.setCreateTime(DateUtils.getNowDate());
healthActivity.setExerciseTime((healthActivity.getEndTime().getTime()-healthActivity.getStartTime().getTime())/1000+"");
healthActivity.setId(IdWorker.getId()); healthActivity.setId(IdWorker.getId());
return healthActivityMapper.insertHealthActivity(healthActivity); return healthActivityMapper.insertHealthActivity(healthActivity);
} }
@@ -75,6 +81,7 @@ public class HealthActivityServiceImpl implements IHealthActivityService
{ {
healthActivity.setUpdateBy(SecurityUtils.getUsername()); healthActivity.setUpdateBy(SecurityUtils.getUsername());
healthActivity.setUpdateTime(DateUtils.getNowDate()); healthActivity.setUpdateTime(DateUtils.getNowDate());
healthActivity.setExerciseTime((healthActivity.getEndTime().getTime()-healthActivity.getStartTime().getTime())/1000+"");
return healthActivityMapper.updateHealthActivity(healthActivity); return healthActivityMapper.updateHealthActivity(healthActivity);
} }

View File

@@ -11,6 +11,7 @@ import com.ruoyi.health.service.IHealthRecordService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -46,7 +47,18 @@ public class HealthRecordServiceImpl implements IHealthRecordService
@Override @Override
public List<HealthRecordVo> selectHealthRecordList(HealthRecordDto healthRecordDto) public List<HealthRecordVo> selectHealthRecordList(HealthRecordDto healthRecordDto)
{ {
return healthRecordMapper.selectHealthRecordList(healthRecordDto); List<HealthRecordVo> list=healthRecordMapper.selectHealthRecordList(healthRecordDto);
for (HealthRecordVo recordVo : list) {
String daysBetween="";
if(recordVo.getRehabilitationTime()!=null){
daysBetween = DateUtils.timeDistance(recordVo.getRehabilitationTime(),recordVo.getOccurTime());
}else {
daysBetween = DateUtils.timeDistance(new Date(),recordVo.getOccurTime());
}
recordVo.setDuration(daysBetween);
}
return list;
} }
/** /**

View File

@@ -158,7 +158,8 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService {
staticsTimeList.add(dayString); staticsTimeList.add(dayString);
} }
} }
//用药天数
map.put("marDays",staticsTimeList.size());
for (String staticsTime :staticsTimeList for (String staticsTime :staticsTimeList
) { ) {
double count=0; double count=0;

View File

@@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="partner" column="partner" /> <result property="partner" column="partner" />
<result property="costDetail" column="cost_detail" /> <result property="costDetail" column="cost_detail" />
<result property="type" column="type" /> <result property="type" column="type" />
<result property="diagnosis" column="diagnosis" />
</resultMap> </resultMap>
<sql id="selectHealthDoctorRecordVo"> <sql id="selectHealthDoctorRecordVo">
@@ -47,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.total_cost, a.total_cost,
a.partner, a.partner,
a.cost_detail, a.cost_detail,
a.diagnosis,
hp."name" as person_name , hp."name" as person_name ,
hr."name" as health_record_name hr."name" as health_record_name
from from
@@ -106,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="partner != null">partner,</if> <if test="partner != null">partner,</if>
<if test="costDetail != null">cost_detail,</if> <if test="costDetail != null">cost_detail,</if>
<if test="type != null and type != ''">type,</if> <if test="type != null and type != ''">type,</if>
<if test="diagnosis != null and diagnosis != ''">diagnosis,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@@ -126,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="partner != null">#{partner},</if> <if test="partner != null">#{partner},</if>
<if test="costDetail != null">#{costDetail},</if> <if test="costDetail != null">#{costDetail},</if>
<if test="type != null and type != ''">#{type},</if> <if test="type != null and type != ''">#{type},</if>
<if test="diagnosis != null and diagnosis != ''">#{diagnosis},</if>
</trim> </trim>
</insert> </insert>
@@ -149,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="partner != null">partner = #{partner},</if> <if test="partner != null">partner = #{partner},</if>
<if test="costDetail != null">cost_detail = #{costDetail},</if> <if test="costDetail != null">cost_detail = #{costDetail},</if>
<if test="type != null and type != ''">type = #{type},</if> <if test="type != null and type != ''">type = #{type},</if>
<if test="diagnosis != null and diagnosis != ''">diagnosis = #{diagnosis},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>