jsk 健康

This commit is contained in:
skjia 2025-06-05 08:59:42 +08:00
parent a77562526b
commit 24003bd931
7 changed files with 57 additions and 3 deletions

View File

@ -29,6 +29,7 @@ public class HealthInfoSimpleVo {
order = 2
)
private String placeFullName;
private String articleTitle;
@ApiModelProperty("手机号")
@ExcelProperty(
value = {"用户手机号"},
@ -262,4 +263,12 @@ public class HealthInfoSimpleVo {
public void setPregnantStatus(final Integer pregnantStatus) {
this.pregnantStatus = pregnantStatus;
}
public String getArticleTitle() {
return articleTitle;
}
public void setArticleTitle(String articleTitle) {
this.articleTitle = articleTitle;
}
}

View File

@ -61,4 +61,14 @@ public class HealthInfoController extends BaseController {
return success(healthInfoService.editHealthInfo(healthInfoFullDto));
}
}
@ApiOperation("删除人员健康档案")
@PostMapping({"/del-health-info"})
public AjaxResult delHealthInfo(@RequestBody HealthInfoFullDto healthInfoFullDto) {
if (ObjectUtil.isNull(healthInfoFullDto.getUserId())) {
throw new ServiceException("用户id不能为空");
} else {
return success(healthInfoService.delHealthInfo(healthInfoFullDto));
}
}
}

View File

@ -42,7 +42,7 @@ public class HealthMedicalReportController {
}
@PostMapping({"/list-template"})
@ApiOperation("查询体检报告模板")
@ApiOperation("查询体检报告模板")
public List<HealthMedicalReportTmplVO> listTemplate() {
return this.healthMedicalReportTmplService.listTemplate();
}

View File

@ -32,6 +32,10 @@ public interface HealthInfoMapper extends BaseMapper<HealthInfo> {
int deleteHealthInfoChronic(HealthInfoFullDto entitie);
int delHealthInfo(HealthInfoFullDto entitie);
int insertHealthInfoChronic(@Param("entities") List<HealthInfoFullDto> entities);
int insertHealthInfo(HealthInfoFullDto entities);
}

View File

@ -22,4 +22,6 @@ public interface HealthInfoService {
HealthInfoFullVo detailHealthInfo(Long userId);
Integer editHealthInfo(HealthInfoFullDto content);
Integer delHealthInfo(HealthInfoFullDto content);
}

View File

@ -101,9 +101,12 @@ public class HealthInfoServiceImpl extends ServiceImpl<HealthInfoMapper, HealthI
*/
baseMapper.insertHealthInfoChronic(chronicfVos);
}
baseMapper.delHealthInfo(content);
/**
* 重新录入健康信息
*/
baseMapper.delHealthInfo(content);
baseMapper.insertHealthInfo(content);
baseMapper.updateHealthInfo(content);
/**
* 重新录入身体信息
@ -112,4 +115,15 @@ public class HealthInfoServiceImpl extends ServiceImpl<HealthInfoMapper, HealthI
return 1;
}
@Override
public Integer delHealthInfo(HealthInfoFullDto content) {
Long userId = content.getUserId();
try{
baseMapper.deleteHealthInfoChronic(content);
baseMapper.delHealthInfo(content);
}catch (Exception e){
}
return 1;
}
}

View File

@ -16,6 +16,9 @@
b.allergen,
b.labour_intensity,
b.pregnant_status,
b.doctor_num,
b.hospital_num,
b.inpatient_date,
GROUP_CONCAT(c.chronic_name ORDER BY c.chronic_id desc) AS chronic_names,
GROUP_CONCAT(c.chronic_id ORDER BY c.chronic_id desc) AS chronic_ids
from sys_user a
@ -23,6 +26,9 @@
left join health_info_chronic c on a.user_id = c.user_id
left join health_body_record d on a.user_id = d.user_id and d.if_latest = 1
where 1 = 1
<if test="articleTitle != null and articleTitle != ''">
and(a.nick_name like concat('%', #{articleTitle}, '%') or a.phonenumber like concat('%', #{articleTitle}, '%') or b.doctor_num like concat('%', #{articleTitle}, '%'))
</if>
group by a.user_id,
a.nick_name,
a.dept_id,
@ -167,7 +173,7 @@
<if test="pregnantStatus != null and pregnantStatus != ''">
pregnant_status = #{pregnantStatus},
</if>
<if test="pregnancyDate != null and pregnancyDate != ''">
<if test="pregnancyDate != null ">
pregnancy_date = #{pregnancyDate},
</if>
<if test="doctorAdvice != null and doctorAdvice != ''">
@ -182,7 +188,7 @@
<if test="hospitalNum != null and hospitalNum != ''">
hospital_num = #{hospitalNum},
</if>
<if test="inpatientDate != null and inpatientDate != ''">
<if test="inpatientDate != null ">
inpatient_date = #{inpatientDate},
</if>
<if test="weightControl != null and weightControl != ''">
@ -216,6 +222,10 @@
delete from health_info_chronic
where user_id = #{userId}
</update>
<update id="delHealthInfo" parameterType="com.bonus.canteen.core.nutrition.common.vo.HealthInfoFullVo">
delete from health_info
where user_id = #{userId}
</update>
<insert id="insertHealthInfoChronic" parameterType="com.bonus.canteen.core.nutrition.common.vo.HealthInfoFullVo">
insert into health_info_chronic(user_id, chronic_id, chronic_name)
values
@ -223,4 +233,9 @@
(#{entity.userId}, #{entity.chronicIds}, #{entity.chronicNames})
</foreach>
</insert>
<insert id="insertHealthInfo" parameterType="com.bonus.canteen.core.nutrition.common.vo.HealthInfoFullVo">
insert into health_info(user_id)
values
(#{userId})
</insert>
</mapper>