diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPersonInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPersonInfoController.java index 50b03e7..b872677 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPersonInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPersonInfoController.java @@ -70,6 +70,16 @@ public class HealthPersonInfoController extends BaseController { 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())); + } + /** * 新增人员健康情况 */ diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/mapper/HealthPersonInfoMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/mapper/HealthPersonInfoMapper.java index 8146d53..cbe2ee1 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/mapper/HealthPersonInfoMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/mapper/HealthPersonInfoMapper.java @@ -19,6 +19,8 @@ public interface HealthPersonInfoMapper { */ public HealthPersonInfo selectHealthPersonInfoById(Long id); + public HealthPersonInfo selectHealthPersonAppInfoById(Long id); + /** * 查询人员健康情况列表 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/IHealthPersonInfoService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/IHealthPersonInfoService.java index a5fa4e3..bf4e1a7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/IHealthPersonInfoService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/IHealthPersonInfoService.java @@ -18,6 +18,8 @@ public interface IHealthPersonInfoService { */ public HealthPersonInfo selectHealthPersonInfoById(Long id); + public HealthPersonInfo selectHealthPersonAppInfoById(Long id); + /** * 查询人员健康情况列表 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPersonInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPersonInfoServiceImpl.java index e4e4538..8889570 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPersonInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPersonInfoServiceImpl.java @@ -10,6 +10,7 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.core.utils.StringUtils; import com.bonus.common.houqin.utils.SM4EncryptUtils; import org.springframework.beans.factory.annotation.Autowired; 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(); HealthPersonInfo chronicVo=new HealthPersonInfo(); chronicVo.setChronicIds(content.getChronicIds()); - List chronicVos=healthPersonInfoMapper.selectHealthChronicList(chronicVo); + List chronicVos=null; + if(StringUtils.isNull(content.getChronicIds())){ + chronicVos=healthPersonInfoMapper.selectHealthChronicList(chronicVo); + }else{ + healthPersonInfoMapper.deleteHealthInfoChronic(content); + } if(chronicVos!=null&&chronicVos.size()>0){ /** * 清空疾病信息 @@ -125,7 +141,11 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService { */ healthPersonInfoMapper.delHealthInfo(content); healthPersonInfoMapper.insertHealthInfo(content); - healthPersonInfoMapper.updateHealthInfo(content); + try{ + healthPersonInfoMapper.updateHealthInfo(content); + }catch (Exception e){ + e.printStackTrace(); + } /** * 重新录入身体信息 */ @@ -134,7 +154,11 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService { healthPersonInfoMapper.insertHealthBodyRecord(content); } content.setBmi(getBMI(content.getWeight(),content.getHeight())); - healthPersonInfoMapper.updateHealthBodyRecord(content); + try{ + healthPersonInfoMapper.updateHealthBodyRecord(content); + }catch (Exception e){ + e.printStackTrace(); + } return 1; } catch (Exception e) { throw new ServiceException(e.getMessage()); diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPersonInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPersonInfoMapper.xml index e7fd05b..96d87c7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPersonInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPersonInfoMapper.xml @@ -182,6 +182,86 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" c.blood_pressure,sd.dept_id + + insert into health_person_info