Compare commits
2 Commits
8e70d7f965
...
75949d17ff
| Author | SHA1 | Date |
|---|---|---|
|
|
75949d17ff | |
|
|
4b9fcb2022 |
|
|
@ -70,6 +70,16 @@ public class HealthPersonInfoController extends BaseController {
|
||||||
return success(healthPersonInfoService.selectHealthPersonInfoById(vo.getUserId()));
|
return success(healthPersonInfoService.selectHealthPersonInfoById(vo.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取人员健康情况详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取人员健康情况详细信息")
|
||||||
|
//@RequiresPermissions("health:info:query")
|
||||||
|
@PostMapping({"/detail-health-appinfo"})
|
||||||
|
public AjaxResult getAppInfo(@RequestBody HealthPersonInfo vo) {
|
||||||
|
return success(healthPersonInfoService.selectHealthPersonAppInfoById(vo.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增人员健康情况
|
* 新增人员健康情况
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ public interface HealthPersonInfoMapper {
|
||||||
*/
|
*/
|
||||||
public HealthPersonInfo selectHealthPersonInfoById(Long id);
|
public HealthPersonInfo selectHealthPersonInfoById(Long id);
|
||||||
|
|
||||||
|
public HealthPersonInfo selectHealthPersonAppInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询人员健康情况列表
|
* 查询人员健康情况列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ public interface IHealthPersonInfoService {
|
||||||
*/
|
*/
|
||||||
public HealthPersonInfo selectHealthPersonInfoById(Long id);
|
public HealthPersonInfo selectHealthPersonInfoById(Long id);
|
||||||
|
|
||||||
|
public HealthPersonInfo selectHealthPersonAppInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询人员健康情况列表
|
* 查询人员健康情况列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
import com.bonus.common.houqin.utils.SM4EncryptUtils;
|
import com.bonus.common.houqin.utils.SM4EncryptUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -44,6 +45,16 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HealthPersonInfo selectHealthPersonAppInfoById(Long id) {
|
||||||
|
HealthPersonInfo vo=healthPersonInfoMapper.selectHealthPersonAppInfoById(id);
|
||||||
|
if(vo!=null){
|
||||||
|
vo.setMobile(SM4EncryptUtils.sm4Decrypt(vo.getMobile()==null?"":vo.getMobile()));
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 查询人员健康情况列表
|
* 查询人员健康情况列表
|
||||||
*
|
*
|
||||||
|
|
@ -100,7 +111,12 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
||||||
Long userId = content.getUserId();
|
Long userId = content.getUserId();
|
||||||
HealthPersonInfo chronicVo=new HealthPersonInfo();
|
HealthPersonInfo chronicVo=new HealthPersonInfo();
|
||||||
chronicVo.setChronicIds(content.getChronicIds());
|
chronicVo.setChronicIds(content.getChronicIds());
|
||||||
List<HealthPersonInfo> chronicVos=healthPersonInfoMapper.selectHealthChronicList(chronicVo);
|
List<HealthPersonInfo> chronicVos=null;
|
||||||
|
if(StringUtils.isNull(content.getChronicIds())){
|
||||||
|
chronicVos=healthPersonInfoMapper.selectHealthChronicList(chronicVo);
|
||||||
|
}else{
|
||||||
|
healthPersonInfoMapper.deleteHealthInfoChronic(content);
|
||||||
|
}
|
||||||
if(chronicVos!=null&&chronicVos.size()>0){
|
if(chronicVos!=null&&chronicVos.size()>0){
|
||||||
/**
|
/**
|
||||||
* 清空疾病信息
|
* 清空疾病信息
|
||||||
|
|
@ -125,7 +141,11 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
||||||
*/
|
*/
|
||||||
healthPersonInfoMapper.delHealthInfo(content);
|
healthPersonInfoMapper.delHealthInfo(content);
|
||||||
healthPersonInfoMapper.insertHealthInfo(content);
|
healthPersonInfoMapper.insertHealthInfo(content);
|
||||||
|
try{
|
||||||
healthPersonInfoMapper.updateHealthInfo(content);
|
healthPersonInfoMapper.updateHealthInfo(content);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 重新录入身体信息
|
* 重新录入身体信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -134,7 +154,11 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
||||||
healthPersonInfoMapper.insertHealthBodyRecord(content);
|
healthPersonInfoMapper.insertHealthBodyRecord(content);
|
||||||
}
|
}
|
||||||
content.setBmi(getBMI(content.getWeight(),content.getHeight()));
|
content.setBmi(getBMI(content.getWeight(),content.getHeight()));
|
||||||
|
try{
|
||||||
healthPersonInfoMapper.updateHealthBodyRecord(content);
|
healthPersonInfoMapper.updateHealthBodyRecord(content);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException(e.getMessage());
|
throw new ServiceException(e.getMessage());
|
||||||
|
|
|
||||||
|
|
@ -182,6 +182,86 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
c.blood_pressure,sd.dept_id
|
c.blood_pressure,sd.dept_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectHealthPersonAppInfoById" parameterType="Long" resultMap="HealthPersonInfoResult">
|
||||||
|
select a.user_id,
|
||||||
|
a.nick_name,
|
||||||
|
a.phonenumber as mobile,
|
||||||
|
a.sex,
|
||||||
|
a.dept_id as orgId,
|
||||||
|
a.user_type,
|
||||||
|
b.marital_status,
|
||||||
|
b.pregnant_status,
|
||||||
|
b.pregnancy_date,
|
||||||
|
b.doctor_advice,
|
||||||
|
b.if_hospitalized,
|
||||||
|
b.doctor_num,
|
||||||
|
b.hospital_num,
|
||||||
|
b.inpatient_date,
|
||||||
|
b.inpatient_result,
|
||||||
|
b.weight_control,
|
||||||
|
b.allergen,
|
||||||
|
b.labour_intensity,
|
||||||
|
b.health_state,
|
||||||
|
b.blood_type,
|
||||||
|
c.height,
|
||||||
|
c.weight,
|
||||||
|
c.bmi,
|
||||||
|
c.shape,
|
||||||
|
c.bust,
|
||||||
|
c.waistline,
|
||||||
|
c.blood_sugar,
|
||||||
|
c.blood_fat,
|
||||||
|
c.blood_pressure_high,
|
||||||
|
c.blood_pressure_low,
|
||||||
|
c.heart_rate,
|
||||||
|
c.blood_oxygen,
|
||||||
|
c.uric_acid,
|
||||||
|
c.blood_pressure,sd.dept_name,
|
||||||
|
GROUP_CONCAT(d.chronic_name ORDER BY d.chronic_id desc) AS chronic_names,
|
||||||
|
GROUP_CONCAT(d.chronic_id ORDER BY d.chronic_id desc) AS chronic_ids
|
||||||
|
from sys_user a
|
||||||
|
left join health_person_info b on a.user_id = b.user_id
|
||||||
|
left join health_person_body_record c on a.user_id = c.user_id and c.if_latest = 1
|
||||||
|
left join health_person_info_chronic d on a.user_id = d.user_id
|
||||||
|
left join health_chronic hc on d.chronic_id=hc.chronic_id
|
||||||
|
left join sys_dept sd on a.dept_id = sd.dept_id
|
||||||
|
where a.user_id = #{userId}
|
||||||
|
group by a.user_id,
|
||||||
|
a.user_name,
|
||||||
|
a.phonenumber,
|
||||||
|
a.sex,
|
||||||
|
a.dept_id,
|
||||||
|
a.user_type,
|
||||||
|
b.marital_status,
|
||||||
|
b.pregnant_status,
|
||||||
|
b.pregnancy_date,
|
||||||
|
b.doctor_advice,
|
||||||
|
b.if_hospitalized,
|
||||||
|
b.doctor_num,
|
||||||
|
b.hospital_num,
|
||||||
|
b.inpatient_date,
|
||||||
|
b.inpatient_result,
|
||||||
|
b.weight_control,
|
||||||
|
b.allergen,
|
||||||
|
b.labour_intensity,
|
||||||
|
b.health_state,
|
||||||
|
b.blood_type,
|
||||||
|
c.height,
|
||||||
|
c.weight,
|
||||||
|
c.bmi,
|
||||||
|
c.shape,
|
||||||
|
c.bust,
|
||||||
|
c.waistline,
|
||||||
|
c.blood_sugar,
|
||||||
|
c.blood_fat,
|
||||||
|
c.blood_pressure_high,
|
||||||
|
c.blood_pressure_low,
|
||||||
|
c.heart_rate,
|
||||||
|
c.blood_oxygen,
|
||||||
|
c.uric_acid,
|
||||||
|
c.blood_pressure,sd.dept_id
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertHealthPersonInfo" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
<insert id="insertHealthPersonInfo" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||||
insert into health_person_info
|
insert into health_person_info
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue