LAPTOP-KB9HII50\70708 hace 3 años
padre
commit
6a128adebf

+ 25 - 1
common/common-entity/sql记录

@ -1502,4 +1502,28 @@ ALTER table wlyy_devices add column iccid VARCHAR(20) default null COMMENT '物
ALTER table wlyy_devices add column imsi VARCHAR(20) default null COMMENT '物联网卡IMSI';
ALTER table wlyy_devices add column  category_code varchar(50) DEFAULT NULL COMMENT '设备类型 dm_device表定义';
ALTER table dm_device add column device_type tinyint(2) DEFAULT NULL COMMENT '设备种类 0健康设备 1安防设备';
ALTER table dm_device add column device_type tinyint(2) DEFAULT NULL COMMENT '设备种类 0健康设备 1安防设备';
-- 2021-09-26
CREATE TABLE `base_capacity_label` (
  `id` varchar(50) NOT NULL,
  `patient` varchar(255) DEFAULT NULL,
  `family` varchar(1) DEFAULT NULL COMMENT '是否有家属 1是0否',
  `hypertension` varchar(1) DEFAULT NULL COMMENT '高血压 1是 0否',
  `hyperglycemia` varchar(1) DEFAULT NULL COMMENT '高血糖 1是 0否',
  `heart_disease` varchar(1) DEFAULT NULL COMMENT '心脏疾病 1是 0否',
  `work_status` varchar(1) DEFAULT NULL COMMENT '行走状态 1迟缓 2一般 3健步如飞',
  `disability` varchar(1) DEFAULT NULL COMMENT '残疾 1是 0否',
  `disabled_part` varchar(100) DEFAULT NULL COMMENT '残疾部位',
  `visual_condition` varchar(1) DEFAULT NULL COMMENT '视觉状况 1看不见 2近距离 3正常',
  `auditory_condition` varchar(1) DEFAULT NULL COMMENT '听觉状况 1听不见 2大声量 3正常',
  `communication` varchar(1) DEFAULT NULL COMMENT '交流情况 1不善于 2一般 3善于',
  `mental_illness` varchar(1) DEFAULT NULL COMMENT '精神类疾病 1是 0否',
  `often_go_out` varchar(1) DEFAULT NULL COMMENT '经常外出 1是 0否',
  `use_phone` varchar(1) DEFAULT NULL COMMENT '会使用智能手机 1是 0否',
  `take_exercise` varchar(1) DEFAULT NULL COMMENT '参加锻炼 1是 0否',
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='能力状况记录表';

+ 166 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/label/BaseCapacityLabelDO.java

@ -0,0 +1,166 @@
package com.yihu.jw.entity.care.label;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 能力状况记录表
 */
@Entity
@Table(name = "base_capacity_label")
public class BaseCapacityLabelDO extends UuidIdentityEntityWithCreateTime {
    private String patient;
    private String family;//是否有家属 1是0否
    private String hypertension;//高血压 1是 0否
    private String hyperglycemia;//高血糖 1是 0否
    private String heartDisease;//心脏疾病 1是 0否
    private String workStatus;//行走状态 1迟缓 2一般 3健步如飞
    private String disability;//残疾 1是 0否
    private String disabledPart;//残疾部位
    private String visualCondition;//视觉状况 1看不见 2近距离 3正常
    private String auditoryCondition;//听觉状况 1听不见 2大声量 3正常
    private String communication;//交流情况 1不善于 2一般 3善于
    private String mentalIllness;//精神类疾病 1是 0否
    private String oftenGoOut;//经常外出 1是 0否
    private String usePhone;//会使用智能手机 1是 0否
    private String takeExercise;//参加锻炼 1是 0否
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "family")
    public String getFamily() {
        return family;
    }
    public void setFamily(String family) {
        this.family = family;
    }
    @Column(name = "hypertension")
    public String getHypertension() {
        return hypertension;
    }
    public void setHypertension(String hypertension) {
        this.hypertension = hypertension;
    }
    @Column(name = "hyperglycemia")
    public String getHyperglycemia() {
        return hyperglycemia;
    }
    public void setHyperglycemia(String hyperglycemia) {
        this.hyperglycemia = hyperglycemia;
    }
    @Column(name = "heart_disease")
    public String getHeartDisease() {
        return heartDisease;
    }
    public void setHeartDisease(String heartDisease) {
        this.heartDisease = heartDisease;
    }
    @Column(name = "work_status")
    public String getWorkStatus() {
        return workStatus;
    }
    public void setWorkStatus(String workStatus) {
        this.workStatus = workStatus;
    }
    @Column(name = "disability")
    public String getDisability() {
        return disability;
    }
    public void setDisability(String disability) {
        this.disability = disability;
    }
    @Column(name = "disabled_part")
    public String getDisabledPart() {
        return disabledPart;
    }
    public void setDisabledPart(String disabledPart) {
        this.disabledPart = disabledPart;
    }
    @Column(name = "visual_condition")
    public String getVisualCondition() {
        return visualCondition;
    }
    public void setVisualCondition(String visualCondition) {
        this.visualCondition = visualCondition;
    }
    @Column(name = "auditory_condition")
    public String getAuditoryCondition() {
        return auditoryCondition;
    }
    public void setAuditoryCondition(String auditoryCondition) {
        this.auditoryCondition = auditoryCondition;
    }
    @Column(name = "communication")
    public String getCommunication() {
        return communication;
    }
    public void setCommunication(String communication) {
        this.communication = communication;
    }
    @Column(name = "mental_illness")
    public String getMentalIllness() {
        return mentalIllness;
    }
    public void setMentalIllness(String mentalIllness) {
        this.mentalIllness = mentalIllness;
    }
    @Column(name = "often_go_out")
    public String getOftenGoOut() {
        return oftenGoOut;
    }
    public void setOftenGoOut(String oftenGoOut) {
        this.oftenGoOut = oftenGoOut;
    }
    @Column(name = "use_phone")
    public String getUsePhone() {
        return usePhone;
    }
    public void setUsePhone(String usePhone) {
        this.usePhone = usePhone;
    }
    @Column(name = "take_exercise")
    public String getTakeExercise() {
        return takeExercise;
    }
    public void setTakeExercise(String takeExercise) {
        this.takeExercise = takeExercise;
    }
}

+ 19 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/label/BaseCapacityLabelDao.java

@ -0,0 +1,19 @@
package com.yihu.jw.care.dao.label;
import com.yihu.jw.entity.care.label.BaseCapacityLabelDO;
import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2021/9/26.
 */
public interface BaseCapacityLabelDao  extends PagingAndSortingRepository<BaseCapacityLabelDO, String>,
        JpaSpecificationExecutor<BaseCapacityLabelDO> {
    @Query("select a from BaseCapacityLabelDO a where a.patient=?1")
    BaseCapacityLabelDO findByPatient(String patient);
}

+ 26 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -144,6 +144,32 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "findCapLabel")
    @ApiOperation(value = "获取居民能力状况信息")
    public Envelop findCapLabel(
            @ApiParam(name = "patientId", value = "居民id")
            @RequestParam(value = "patientId", required = true) String patientId) {
        try{
            return success("获取成功", patientService.findCapLabel(patientId));
        }catch (Exception e){
            return failedException2(e);
        }
    }
    @PostMapping(value = "updCapLabel")
    @ApiOperation(value = "修改居民能力状况信息")
    @ObserverRequired
    public Envelop updCapLabel(
            @ApiParam(name = "jsonData", value = "能力状况")
            @RequestParam(value = "jsonData", required = true) String jsonData) {
        try{
            return success("获取成功", patientService.updCapLabel(jsonData));
        }catch (Exception e){
            return failedException2(e);
        }
    }
    @PostMapping(value = "updLatLon")
    @ApiOperation(value = "修改居民经纬度信息")
    public Envelop updLatLon(@ApiParam(name = "latLon", value = "经纬度24.48923061,118.10388605")

+ 32 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -3,6 +3,8 @@ package com.yihu.jw.care.service.patient;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.dao.label.BaseCapacityLabelDao;
import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
import com.yihu.jw.care.service.common.DictService;
import com.yihu.jw.care.service.device.DeviceService;
@ -14,6 +16,7 @@ import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.entity.care.label.BaseCapacityLabelDO;
import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.im.util.ImUtil;
@ -75,6 +78,31 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
    private DeviceService deviceService;
    @Autowired
    private HospitalSysDictDao hospitalSysDictDao;
    @Autowired
    private BaseCapacityLabelDao capacityLabelDao;
    @Autowired
    private ObjectMapper objectMapper;
    /**
     * 获取能力状况
     * @param patient
     * @return
     */
    public BaseCapacityLabelDO findCapLabel(String patient){
        return capacityLabelDao.findByPatient(patient);
    }
    /**
     * 更新能力状况
     * @param jsonData
     * @return
     * @throws Exception
     */
    public BaseCapacityLabelDO updCapLabel(String jsonData) throws Exception{
        BaseCapacityLabelDO capacityLabelDO = objectMapper.readValue(jsonData, BaseCapacityLabelDO.class);
        capacityLabelDao.save(capacityLabelDO);
        return capacityLabelDO;
    }
    /**
     * 签约记录
@ -209,6 +237,10 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
                res.put("capAssRecordDO",recordDO);
            }
        }
        //能力状况
        BaseCapacityLabelDO capacityLabelDO = capacityLabelDao.findByPatient(patientId);
        res.put("capacityLabelDO",capacityLabelDO);
        JSONObject tmp = res.getJSONObject("patient");
        tmp.put("deviceType",deviceService.getPatientDeviceCategoryCode(patientId));
        res.put("patient",tmp);

+ 7 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -1,6 +1,7 @@
package com.yihu.jw.care.service.third;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.label.BaseCapacityLabelDao;
import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
import com.yihu.jw.care.service.course.CourseService;
import com.yihu.jw.care.service.device.PatientDeviceService;
@ -11,6 +12,7 @@ import com.yihu.jw.care.service.security.SecurityMonitoringOrderService;
import com.yihu.jw.care.service.sign.CapacityAssessmentRecordService;
import com.yihu.jw.care.service.sign.ServicePackageService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.label.BaseCapacityLabelDO;
import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.patient.dao.BasePatientDao;
@ -55,6 +57,8 @@ public class PatientInfoPlatFormService {
    private PatientHealthIndexService healthIndexService;
    @Autowired
    private CapacityAssessmentRecordService capacityAssessmentRecordService;
    @Autowired
    private BaseCapacityLabelDao capacityLabelDao;
    /**
@ -107,6 +111,9 @@ public class PatientInfoPlatFormService {
            }catch (Exception e){
                e.printStackTrace();
            }
            //能力状况
            BaseCapacityLabelDO capacityLabelDO = capacityLabelDao.findByPatient(patient);
            result.put("capacityLabelDO",capacityLabelDO);
            return result;
        }
        return null;