healthbody

This commit is contained in:
sxu 2025-03-13 09:22:42 +08:00
parent c58ecd61b8
commit 3a2a90fe24
9 changed files with 336 additions and 0 deletions

View File

@ -0,0 +1,40 @@
package com.bonus.canteen.core.nutrition.common.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import com.bonus.canteen.core.common.page.PageDTO;
import java.time.LocalDate;
@ApiModel("分页查询人员体检报告")
public class HealthCustMedicalReportPageDTO extends PageDTO {
@ApiModelProperty("人员id")
private @NotBlank(
message = "人员id不能为空!"
) Long custId;
@ApiModelProperty("体检日期")
private LocalDate medicalDate;
public Long getCustId() {
return this.custId;
}
public LocalDate getMedicalDate() {
return this.medicalDate;
}
public void setCustId(final Long custId) {
this.custId = custId;
}
public void setMedicalDate(final LocalDate medicalDate) {
this.medicalDate = medicalDate;
}
public String toString() {
Long var10000 = this.getCustId();
return "HealthCustMedicalReportPageDTO(custId=" + var10000 + ", medicalDate=" + String.valueOf(this.getMedicalDate()) + ")";
}
}

View File

@ -0,0 +1,14 @@
package com.bonus.canteen.core.nutrition.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.nutrition.common.model.HealthCustMedicalReportDetail;
import com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface HealthCustMedicalReportDetailMapper extends BaseMapper<HealthCustMedicalReportDetail> {
List<HealthCustMedicalReportDetailVO> listCustReportDetail(@Param("medicalProjectId") Long medicalProjectId, @Param("medicalId") Long medicalId);
}

View File

@ -1,8 +1,11 @@
package com.bonus.canteen.core.nutrition.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.nutrition.common.dto.HealthCustMedicalReportPageDTO;
import com.bonus.canteen.core.nutrition.common.model.HealthCustMedicalReport;
import com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportProjectVO;
import com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportVO;
import com.bonus.canteen.core.nutrition.common.vo.HealthHistoryReportInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -10,5 +13,14 @@ import java.util.List;
@Mapper
public interface HealthCustMedicalReportMapper extends BaseMapper<HealthCustMedicalReport> {
List<HealthCustMedicalReportVO> pageMedicalReportInfo(@Param("param") HealthCustMedicalReportPageDTO param);
List<HealthCustMedicalReportProjectVO> listCustReport(@Param("medicalId") Long medicalId);
void deleteCustReport(@Param("medicalId") Long medicalId);
List<HealthHistoryReportInfoVO> listCustHistoryReport(@Param("custId") Long custId);
List<HealthCustMedicalReportVO> listMedicalReport(@Param("custId") Long custId);
}

View File

@ -0,0 +1,120 @@
package com.bonus.canteen.core.nutrition.common.model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime;
@TableName("health_cust_medical_report_detail")
@ApiModel("人员体检报告项目明细表")
public class HealthCustMedicalReportDetail implements Serializable {
@TableId
@ApiModelProperty("主键自增")
private Long id;
@ApiModelProperty("体检id")
private Long medicalId;
@ApiModelProperty("体检项目id")
private Long medicalProjectId;
@ApiModelProperty("体检项目明细id")
private Long medicalProjectDetailId;
@ApiModelProperty("体检项目明细名称")
private String medicalProjectDetailName;
@ApiModelProperty("检查结果")
private String result;
@ApiModelProperty("创建人")
private String crby;
@ApiModelProperty("创建时间")
private LocalDateTime crtime;
@ApiModelProperty("更新人")
private String upby;
@ApiModelProperty("更新时间")
private LocalDateTime uptime;
public Long getId() {
return this.id;
}
public Long getMedicalId() {
return this.medicalId;
}
public Long getMedicalProjectId() {
return this.medicalProjectId;
}
public Long getMedicalProjectDetailId() {
return this.medicalProjectDetailId;
}
public String getMedicalProjectDetailName() {
return this.medicalProjectDetailName;
}
public String getResult() {
return this.result;
}
public String getCrby() {
return this.crby;
}
public LocalDateTime getCrtime() {
return this.crtime;
}
public String getUpby() {
return this.upby;
}
public LocalDateTime getUptime() {
return this.uptime;
}
public void setId(final Long id) {
this.id = id;
}
public void setMedicalId(final Long medicalId) {
this.medicalId = medicalId;
}
public void setMedicalProjectId(final Long medicalProjectId) {
this.medicalProjectId = medicalProjectId;
}
public void setMedicalProjectDetailId(final Long medicalProjectDetailId) {
this.medicalProjectDetailId = medicalProjectDetailId;
}
public void setMedicalProjectDetailName(final String medicalProjectDetailName) {
this.medicalProjectDetailName = medicalProjectDetailName;
}
public void setResult(final String result) {
this.result = result;
}
public void setCrby(final String crby) {
this.crby = crby;
}
public void setCrtime(final LocalDateTime crtime) {
this.crtime = crtime;
}
public void setUpby(final String upby) {
this.upby = upby;
}
public void setUptime(final LocalDateTime uptime) {
this.uptime = uptime;
}
public String toString() {
Long var10000 = this.getId();
return "HealthCustMedicalReportDetail(id=" + var10000 + ", medicalId=" + this.getMedicalId() + ", medicalProjectId=" + this.getMedicalProjectId() + ", medicalProjectDetailId=" + this.getMedicalProjectDetailId() + ", medicalProjectDetailName=" + this.getMedicalProjectDetailName() + ", result=" + this.getResult() + ", crby=" + this.getCrby() + ", crtime=" + String.valueOf(this.getCrtime()) + ", upby=" + this.getUpby() + ", uptime=" + String.valueOf(this.getUptime()) + ")";
}
}

View File

@ -5,6 +5,9 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.bonus.canteen.core.nutrition.common.mapper.HealthCustMedicalReportDetailMapper;
import com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportDetailVO;
import com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportProjectVO;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.canteen.core.customer.api.CustCasualApi;
import com.bonus.canteen.core.nutrition.common.mapper.HealthCustMedicalReportMapper;
@ -25,6 +28,10 @@ public class HealthCustMedicalReportService {
private CustCasualApi custCasualApi;
@Resource
private HealthCustMedicalReportMapper healthCustMedicalReportMapper;
// @Resource
// private HealthCustMedicalReportProMapper healthCustMedicalReportProMapper;
@Resource
private HealthCustMedicalReportDetailMapper healthCustMedicalReportDetailMapper;
public List<HealthCustMedicalReportVO> listMedicalReport(String openid, Integer sourceType) {
Long custId = this.custCasualApi.getCustIdByOpenidAndSourceType(openid, sourceType);
@ -35,4 +42,21 @@ public class HealthCustMedicalReportService {
return reportVOList;
}
}
public List<HealthCustMedicalReportProjectVO> getMedicalReportInfo(Long medicalId) {
List<HealthCustMedicalReportProjectVO> reportProjectVOS = this.healthCustMedicalReportMapper.listCustReport(medicalId);
if (CollectionUtil.isEmpty(reportProjectVOS)) {
return reportProjectVOS;
} else {
Iterator var3 = reportProjectVOS.iterator();
while(var3.hasNext()) {
HealthCustMedicalReportProjectVO project = (HealthCustMedicalReportProjectVO)var3.next();
List<HealthCustMedicalReportDetailVO> reportDetailVOS = this.healthCustMedicalReportDetailMapper.listCustReportDetail(project.getMedicalProjectId(), medicalId);
project.setMedicalReportDetailVOList(reportDetailVOS);
}
return reportProjectVOS;
}
}
}

View File

@ -0,0 +1,45 @@
package com.bonus.canteen.core.nutrition.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDate;
import java.util.List;
@ApiModel("人员体检历史项目")
public class HealthHistoryReportInfoVO {
@ApiModelProperty("体检id")
private Long medicalId;
@ApiModelProperty("体检日期")
private LocalDate medicalDate;
@ApiModelProperty("体检项目结果")
private List<HealthCustMedicalReportDetailVO> reportDetailVOS;
public Long getMedicalId() {
return this.medicalId;
}
public LocalDate getMedicalDate() {
return this.medicalDate;
}
public List<HealthCustMedicalReportDetailVO> getReportDetailVOS() {
return this.reportDetailVOS;
}
public void setMedicalId(final Long medicalId) {
this.medicalId = medicalId;
}
public void setMedicalDate(final LocalDate medicalDate) {
this.medicalDate = medicalDate;
}
public void setReportDetailVOS(final List<HealthCustMedicalReportDetailVO> reportDetailVOS) {
this.reportDetailVOS = reportDetailVOS;
}
public String toString() {
Long var10000 = this.getMedicalId();
return "HealthHistoryReportInfoVO(medicalId=" + var10000 + ", medicalDate=" + String.valueOf(this.getMedicalDate()) + ", reportDetailVOS=" + String.valueOf(this.getReportDetailVOS()) + ")";
}
}

View File

@ -1,6 +1,7 @@
package com.bonus.canteen.core.nutrition.mobile.controller;
import cn.hutool.core.text.CharSequenceUtil;
import com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportProjectVO;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.canteen.core.common.utils.HeaderFetchUtil;
import com.bonus.canteen.core.nutrition.common.service.HealthCustMedicalReportService;
@ -36,6 +37,13 @@ public class HealthMobileMedicalReportController {
return this.healthCustMedicalReportService.listMedicalReport(this.getOpenidByHeaders(headers), this.getSourceTypeByHeaders(headers));
}
@PostMapping({"/get-medicalreport-info"})
// @RequiresGuest
@ApiOperation("根据体检id查询报告详情")
public List<HealthCustMedicalReportProjectVO> getMedicalReportInfo(Long medicalId) {
return this.healthCustMedicalReportService.getMedicalReportInfo(medicalId);
}
@PostMapping({"/list-template"})
// @RequiresGuest
@ApiOperation("查询体检报告模板")

View File

@ -2,6 +2,54 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.canteen.core.nutrition.common.mapper.HealthCustMedicalReportMapper">
<delete id="deleteCustReport">
DELETE
t1.*,
t2.*
FROM
health_cust_medical_report_project t1,
health_cust_medical_report_detail t2
WHERE
t1.medical_id = t2.medical_id
AND t1.medical_id = #{medicalId}
</delete>
<select id="pageMedicalReportInfo" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportVO">
SELECT medical_id,
cust_id,
medical_date,
medical_mechanism,
medical_template_id
FROM health_cust_medical_report
WHERE cust_id = #{param.custId}
<if test="param.medicalDate != null">
AND medical_date = #{param.medicalDate}
</if>
ORDER BY medical_date DESC
</select>
<select id="listCustReport" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportProjectVO">
SELECT medical_project_id,
medical_project_name
FROM health_cust_medical_report_project
WHERE medical_id = #{medicalId}
ORDER BY
medical_project_id
</select>
<select id="listCustHistoryReport" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthHistoryReportInfoVO">
SELECT
medical_id,
medical_date
FROM
health_cust_medical_report
WHERE
cust_id = #{custId}
ORDER BY
medical_date DESC
</select>
<select id="listMedicalReport" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportVO">
SELECT medical_id,
cust_id,
@ -12,4 +60,5 @@
WHERE cust_id = #{custId}
ORDER BY medical_date DESC
</select>
</mapper>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.canteen.core.nutrition.common.mapper.HealthCustMedicalReportDetailMapper">
<select id="listCustReportDetail" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthCustMedicalReportDetailVO">
SELECT DISTINCT
t1.medical_project_detail_id,
t1.medical_project_detail_name,
t1.result,
t2.medical_project_detail_unit,
t2.medical_project_detail_reference,
t1.crtime
FROM
health_cust_medical_report_detail t1
LEFT JOIN health_medical_report_detail t2 ON t1.medical_project_detail_id = t2.medical_project_detail_id
LEFT JOIN health_cust_medical_report_project t3 ON t1.medical_id = t3.medical_id
WHERE
t3.medical_id = #{medicalId}
AND t1.medical_project_id = #{medicalProjectId}
ORDER BY
t1.medical_project_detail_id
</select>
</mapper>