liubing 4 years ago
parent
commit
1959afe468

+ 186 - 0
common/common-entity/sql记录

@ -200,3 +200,189 @@ alter table base_patient add `archive_type` tinyint(1) DEFAULT NULL COMMENT '档
-- 2021-04-07 ysj
alter table base_doctor add `level` tinyint(4) DEFAULT NULL COMMENT '类型 1社区医生,2助老员';
-- 2021-04-08 lb
CREATE TABLE `base_patient_bed_apply` (
  `id` varchar(50) NOT NULL,
  `patient` varchar(50) NOT NULL,
  `patient_name` varchar(50) DEFAULT NULL,
  `idcard` varchar(50) DEFAULT NULL COMMENT '身份证',
   org_code varchar(50) DEFAULT NULL COMMENT '申请机构code',
   org_name varchar(50) DEFAULT NULL COMMENT '申请机构名称',
   status tinyint(4) DEFAULT '1' COMMENT '状态 -1取消 0已完成 1未处理 2未评估',
  `create_time` timestamp NULL DEFAULT NULL ,
  `create_user` varchar(50) DEFAULT NULL COMMENT '创建者id',
  `create_user_name` varchar(50) DEFAULT NULL COMMENT '创建者称名',
  `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `update_user` varchar(50) DEFAULT NULL,
  `update_user_name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='居民床位申请';
CREATE TABLE `base_capacity_assessment_baseinfo` (
  `id` varchar(50) NOT NULL,
  `assessment_year` varchar(4) DEFAULT NULL COMMENT '评估年份',
  `status` tinyint(5) DEFAULT '1' COMMENT '状态 0失效 1有效 ',
  `patient` varchar(50) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `sex` tinyint(2) DEFAULT NULL,
  `age` varchar(5) DEFAULT NULL,
  `nation` varchar(20) DEFAULT NULL COMMENT '名族',
  `nation_name` varchar(50) DEFAULT NULL COMMENT '名族名称',
  `religion` varchar(20) DEFAULT NULL COMMENT '宗教信仰 0无;1有',
  `idcard` varchar(20) DEFAULT NULL,
  `domicile` varchar(20) DEFAULT NULL COMMENT '户籍 0本地户口;1外地户口',
  `marriage` varchar(20) DEFAULT NULL COMMENT '婚姻状况 10.未婚 20.已婚 30.丧偶 40.离婚 90.未说明的婚姻状况',
  `marriage_remark` varchar(255) DEFAULT NULL COMMENT '婚姻状况 备注',
  `education` varchar(20) DEFAULT NULL COMMENT '文化程度 0文盲及半文盲;1小学;2初中;3高中/技校/中专;4大学专科及以上;5不详',
  `income_type` varchar(20) DEFAULT NULL COMMENT '主要经济来源 0退休金/养老金;1子女补贴;2亲友资助;3其他补贴',
  `pension_flag` varchar(20) DEFAULT NULL COMMENT '是否有养老金收入 0无 1有',
  `pension_count` varchar(20) DEFAULT NULL COMMENT '养老金收入 元/月',
  `family_type` varchar(20) DEFAULT NULL COMMENT '是否为经济困难家庭 0否 1特困 2低保 3低保边缘 ',
  `disability_certificate` varchar(20) DEFAULT NULL COMMENT '是否为持证残疾人 0否 1是 ',
  `medical_insurance` varchar(20) DEFAULT NULL COMMENT '是否购买了商业健康(医疗)保险 0否 1是 ',
  `living_type` varchar(20) DEFAULT NULL COMMENT '现住场所:1自有产权房、私房等;2各类租赁房等;3养老院或类似机构;4护理院或类似机构;5医院或类似机构',
  `living_together` varchar(20) DEFAULT NULL COMMENT '同居者类型 0独居;1与配偶/伴侣居住;2与子女居住;3与孙辈居住;4与父母居住;5与兄弟姐妹居住;6与其他亲友居住;7其他',
  `living_together_remark` varchar(255) DEFAULT NULL COMMENT '同居者备注',
  `dementia_flag` varchar(20) DEFAULT NULL COMMENT '痴呆症 0无 1有',
  `mental_illness` varchar(20) DEFAULT NULL COMMENT '精神疾病(可多选)0无;1精神分裂症;2双相情感障碍;3偏执性精神障碍;4分裂情感性障碍;5癫痫所致精神障碍;6精神发育迟滞伴发精神障碍',
  `disease_type` varchar(20) DEFAULT NULL COMMENT '患病类型可多选;0无 1肿瘤(晚期)2严重心律失常3压疮4慢性心力衰竭(心功能III-IV级)5慢性肾功能衰竭(尿毒症期)6多器官功能衰竭7蛋白质能量营养不足(重度)8慢性阻塞性肺疾病(肺心病心功能III-IV级)9呼吸衰竭10脑血管意外合并吞咽障碍11其他',
  `disease_remark` varchar(255) DEFAULT NULL COMMENT '其他疾病',
  `fall_lately` varchar(20) DEFAULT NULL COMMENT '近30天跌倒 0无;1一次;2两次;3三次及以上',
  `lost_lately` varchar(20) DEFAULT NULL COMMENT '近30天走失 0无;1一次;2两次;3三次及以上',
  `choking_lately` varchar(20) DEFAULT NULL COMMENT '近30天噎食 0无;1一次;2两次;3三次及以上',
  `suicide_lately` varchar(20) DEFAULT NULL COMMENT '近30天自杀 0无;1一次;2两次;3三次及以上',
  `remark_lately` varchar(255) DEFAULT NULL COMMENT '近30天意外 其他 0无;1一次;2两次;3三次及以上',
  `medical_services` varchar(255) DEFAULT NULL COMMENT '近7天是否接受过医疗护理服务 0无1有',
  `domicile_county` varchar(255) DEFAULT NULL COMMENT '户籍  区(县、市)',
  `domicile_county_name` varchar(255) DEFAULT NULL COMMENT '户籍  区(县、市)',
  `domicile_street` varchar(255) DEFAULT NULL COMMENT '户籍  街(镇)',
  `domicile_street_name` varchar(255) DEFAULT NULL COMMENT '户籍  街(镇)',
  `domicile_org` varchar(255) DEFAULT NULL COMMENT '户籍 社(村)',
  `domicile_org_name` varchar(255) DEFAULT NULL COMMENT '户籍 社(村)',
  `domicile_building` varchar(255) DEFAULT NULL COMMENT '户籍 xx幢',
  `domicile_room` varchar(255) DEFAULT NULL COMMENT '户籍 xx室',
  `live_county` varchar(255) DEFAULT NULL COMMENT '居住地  区(县、市)',
  `live_county_name` varchar(255) DEFAULT NULL COMMENT '居住地名称  区(县、市)',
  `live_street` varchar(255) DEFAULT NULL COMMENT '居住地  街(镇)',
  `live_street_name` varchar(255) DEFAULT NULL COMMENT '居住地名称  街(镇)',
  `live_org` varchar(255) DEFAULT NULL COMMENT '居住地 社(村)',
  `live_org_name` varchar(255) DEFAULT NULL COMMENT '居住地名称 社(村)',
  `live_building` varchar(255) DEFAULT NULL COMMENT '居住地 xx幢',
  `live_room` varchar(255) DEFAULT NULL COMMENT '居住地 xx室',
  `postcode` varchar(50) DEFAULT NULL COMMENT '邮编',
  `residence_phone` varchar(50) DEFAULT NULL COMMENT '住宅电话',
  `patient_phone` varchar(50) DEFAULT NULL COMMENT '手机',
  `proxy_name` varchar(50) DEFAULT NULL COMMENT '代理人姓名',
  `applicant_relation` varchar(50) DEFAULT NULL COMMENT '与申请人关系',
  `proxy_address` varchar(255) DEFAULT NULL COMMENT '代理人地址',
  `proxy_telephone` varchar(50) DEFAULT NULL COMMENT '代理人电话',
  `proxy_phone` varchar(50) DEFAULT NULL COMMENT '代理人手机',
  `applicant_sign` varchar(255) DEFAULT NULL COMMENT '申请人(代理人) 签字结果图片url',
  `applicant_date` varchar(50) DEFAULT NULL COMMENT '申请日期',
  `service_type` varchar(50) DEFAULT NULL COMMENT '养老服务形式 0居家养老 1机构养老',
  `acceptable_services_life1` varchar(50) DEFAULT NULL COMMENT '直接生活照顾  1穿衣;2修饰;3口腔清洁;4皮肤清洁;5喂食服务;6排泄照料 ',
  `acceptable_services_life2` varchar(50) DEFAULT NULL COMMENT '间接生活照顾  1居室清洁;2更换洗涤;3上门维修;4定期探访;5膳食服务;6文化教育;7娱乐休闲;8室外休闲(户外);9紧急呼援;10法律援助;11转介服务;12咨询服务',
  `acceptable_services_mental` varchar(50) DEFAULT NULL COMMENT '精神心理照顾 1危机干预;2沟通;3精神支持;4心理疏导;5心理咨询',
  `acceptable_services_rehabilitation` varchar(255) DEFAULT NULL COMMENT '康复护理照顾 1定期翻身;2压疮预;3防活动肢体;4肢体保健;5康复活动;6预防保健;7健康咨询;8健康管理;9健康教育;10临终关怀 ',
  `acceptable_services_other` varchar(255) DEFAULT NULL COMMENT '其他',
  `create_time` datetime DEFAULT NULL,
  `medical_insurance_type` varchar(20) DEFAULT NULL COMMENT '医保类别 1职工基本医疗保险 2城乡居民基本医疗保险 3其他医疗保障 4无任何保障',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='能力评估-基本信息表';
CREATE TABLE `base_capacity_assessment_living_ability` (
  `id` varchar(50) NOT NULL,
  `assessment_year` varchar(4) DEFAULT NULL COMMENT '评估年份',
  `status` tinyint(5) DEFAULT '1' COMMENT '状态 0失效 1有效 ',
  `patient` varchar(50) DEFAULT NULL,
  `eating_ability_score` varchar(50) DEFAULT NULL COMMENT '进食能力得分 10可独立进食;5需部分帮助;0需要极大帮助或完全依赖他人',
  `shower_ability_score` varchar(50) DEFAULT NULL COMMENT '洗澡能力得分 5可独立完成;0需要帮助',
  `washing_ability_score` varchar(50) DEFAULT NULL COMMENT '洗漱能力得分 5可独立完成;0需要帮助',
  `dressing_ability_score` varchar(50) DEFAULT NULL COMMENT '穿衣能力得分 10可独立完成;5需要部分帮助;0需要极大帮助或完全依赖他人',
  `excretion_ability_score` varchar(50) DEFAULT NULL COMMENT '排便控制能力得分 10可自主控制;5偶尔失控(每周小于一次,或需要他人提示);0完全失控',
  `urination_ability_score` varchar(50) DEFAULT NULL COMMENT '排尿控制能力得分 10可自主控制;5偶尔失控(每周小于一次,或需要他人提示);0完全失控或留置导尿管',
  `toilet_ability_score` varchar(50) DEFAULT NULL COMMENT '如厕能力得分 10可独立完成;5需部分帮助;0需要极大帮助或完全依赖他人',
  `transfer_bed_ability_score` varchar(50) DEFAULT NULL COMMENT '床椅转移能力得分 15可独立完成10需要部分帮忙5需要极大帮忙0完全依赖他人',
  `walking_ability_score` varchar(50) DEFAULT NULL COMMENT '平地行走能力得分 15可独立行走45m;10需要部分帮助;5需要极大帮助;0完全依赖他人',
  `down_stairs_ability_score` varchar(50) DEFAULT NULL COMMENT '上下楼梯能力得分10可独立上下楼梯(连续10~15个台阶);5需要部分帮忙0需要极大帮助或完全依赖他人',
  `total_score` varchar(50) DEFAULT NULL COMMENT '日常生活能力总分 上述得分和 总分100 ',
  `ability_grade` varchar(50) DEFAULT NULL COMMENT '能力等级:0能力完好(100);1轻度受损(65-95);2中度受损(45-60);3重度受损(≤40)',
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='能力评估-日常生活能力评估表';
CREATE TABLE `base_capacity_assessment_cognitive_ability` (
  `id` varchar(50) NOT NULL,
  `assessment_year` varchar(4) DEFAULT NULL COMMENT '评估年份',
  `status` tinyint(5) DEFAULT '1' COMMENT '状态 0失效 1有效 ',
  `patient` varchar(50) DEFAULT NULL,
  `question1` varchar(4) DEFAULT NULL COMMENT '问题一得分 总分3分',
  `question2` varchar(4) DEFAULT NULL COMMENT '问题二得分 总分5分',
  `question3` varchar(4) DEFAULT NULL COMMENT '问题三得分 总分5分',
  `question4` varchar(4) DEFAULT NULL COMMENT '问题四得分 总分3分',
  `total_score` varchar(50) DEFAULT NULL COMMENT '认知能力 上述得分和  ',
  `ability_grade` varchar(50) DEFAULT NULL COMMENT '能力等级:0能力完好(16);1轻度受损(13-15);2中度受损(9-12);3重度受损(≤8)',
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='能力评估-认知能力表';
CREATE TABLE `base_capacity_assessment_social_ability` (
  `id` varchar(50) NOT NULL,
  `assessment_year` varchar(4) DEFAULT NULL COMMENT '评估年份',
  `status` tinyint(5) DEFAULT '1' COMMENT '状态 0失效 1有效 ',
  `patient` varchar(50) DEFAULT NULL,
  `aggress_score` varchar(4) DEFAULT NULL COMMENT '攻击行为得分 总分3分',
  `depressed_score` varchar(4) DEFAULT NULL COMMENT '抑郁状态得分 总分5分',
  `consciousness_score` varchar(4) DEFAULT NULL COMMENT '意识水平得分 总分5分',
  `communicate_score` varchar(4) DEFAULT NULL COMMENT '沟通交流得分 总分3分',
  `social_skills_score` varchar(50) DEFAULT NULL COMMENT '社交能力得分   ',
  `vision_score` varchar(50) DEFAULT NULL COMMENT '视力功能得分   ',
  `hearing_score` varchar(50) DEFAULT NULL COMMENT '听力能力得分   ',
  `total_score` varchar(50) DEFAULT NULL COMMENT ' 精神状态与社会交流能力总分 上述得分和 总分22',
  `ability_grade` varchar(50) DEFAULT NULL COMMENT '能力等级:0能力完好(22);1轻度受损(15-21);2中度受损(7-14);3重度受损(≤6)',
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='能力评估-精神状态与社会交流能力表';
CREATE TABLE `base_security_monitoring_order_cancel_log` (
  `id` varchar(50) NOT NULL,
  `order_id` varchar(50) NOT NULL COMMENT '工单id',
  `patient` varchar(50) NOT NULL COMMENT '居民code',
  `cancel_type` int(1) NOT NULL COMMENT '取消类型:1-调度员取消,2-居民取消 3 医生取消',
  `cancel_reason` varchar(50) DEFAULT NULL COMMENT '取消理由',
  `time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '取消时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='安防工单取消记录';
CREATE TABLE `base_semoni_patient_confirm_log` (
  `id` varchar(50) NOT NULL,
  `order_id` varchar(50) NOT NULL COMMENT '工单id',
  `patient` varchar(50) NOT NULL COMMENT '居民',
  `patient_name` varchar(50) NOT NULL COMMENT '居民姓名',
  `type` int(1) NOT NULL COMMENT '确认操作类型:1-确认基础信息无误或变更,2-确认医生变更服务信息,3-同意工单转接  4同意取消工单',
  `description` varchar(200) DEFAULT NULL COMMENT '操作描述',
  `create_user` varchar(50) DEFAULT NULL COMMENT '创建者id',
  `create_user_name` varchar(50) DEFAULT NULL COMMENT '创建者称名',
  `create_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '转接时间',
  `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `update_user` varchar(50) DEFAULT NULL,
  `update_user_name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='安防服务工单居民确认操作日志记录';
CREATE TABLE `base_semoni_doctor_status` (
  `id` varchar(50) NOT NULL,
  `doctor` varchar(50) NOT NULL COMMENT '医生code',
  `status` int(1) NOT NULL DEFAULT '1' COMMENT '医生状态:1-待派单,2-待接单,3-待服务,4-服务中,5-停止接单',
  `create_user` varchar(50) DEFAULT NULL COMMENT '创建者id',
  `create_user_name` varchar(50) DEFAULT NULL COMMENT '创建者称名',
  `create_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '转接时间',
  `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `update_user` varchar(50) DEFAULT NULL,
  `update_user_name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='医生安防服务工单状态情况';
alter TABLE base.base_security_monitoring_order add COLUMN doctor_confirm_finish_img VARCHAR(3000) DEFAULT NULL COMMENT '医生确认完成照片';
alter TABLE base.base_security_monitoring_order add COLUMN doctor_confirm_finish_time timestamp NULL DEFAULT NULL COMMENT '医生确认完成时间';

+ 69 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/apply/PatientBedApplyDo.java

@ -0,0 +1,69 @@
package com.yihu.jw.entity.care.apply;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Bing on 2021/4/8.
 */
@Entity
@Table(name="base_patient_bed_apply")
public class PatientBedApplyDo extends UuidIdentityEntityWithOperator {
    private String patient;
    private String patientName;
    private String idcard;
    private String orgCode;
    private String orgName;
    private Integer status; //状态 -1取消 0已完成 1未处理 2未评估
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 5 - 5
common/common-entity/src/main/java/com/yihu/jw/entity/care/securitymonitoring/SecurityMonitoringOrderDO.java

@ -323,7 +323,7 @@ public class SecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator {
     * 医生确认医生结束服务时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date doctorConfirmFinishFinishTime;
    private Date doctorConfirmFinishTime;
@ -684,11 +684,11 @@ public class SecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator {
        this.doctorConfirmFinishImg = doctorConfirmFinishImg;
    }
    public Date getDoctorConfirmFinishFinishTime() {
        return doctorConfirmFinishFinishTime;
    public Date getDoctorConfirmFinishTime() {
        return doctorConfirmFinishTime;
    }
    public void setDoctorConfirmFinishFinishTime(Date doctorConfirmFinishFinishTime) {
        this.doctorConfirmFinishFinishTime = doctorConfirmFinishFinishTime;
    public void setDoctorConfirmFinishTime(Date doctorConfirmFinishTime) {
        this.doctorConfirmFinishTime = doctorConfirmFinishTime;
    }
}

+ 2 - 1
svr/svr-cloud-care/sql/sql

@ -19,12 +19,13 @@ CREATE TABLE base.base_capacity_assessment_baseinfo (
  `pension_count` varchar(20) DEFAULT NULL COMMENT '养老金收入 元/月',
  `family_type` varchar(20) DEFAULT NULL COMMENT '是否为经济困难家庭 0否 1特困 2低保 3低保边缘 ',
  `disability_certificate` varchar(20) DEFAULT NULL COMMENT '是否为持证残疾人 0否 1是 ',
  `medical_insurance_type` varchar(20) DEFAULT NULL COMMENT '医保类别 1职工基本医疗保险 2城乡居民基本医疗保险 3其他医疗保障 4无任何保障',
  `medical_insurance` varchar(20) DEFAULT NULL COMMENT '是否购买了商业健康(医疗)保险 0否 1是 ',
  `living_type` varchar(20) DEFAULT NULL COMMENT '现住场所:1自有产权房、私房等;2各类租赁房等;3养老院或类似机构;4护理院或类似机构;5医院或类似机构',
  `living_together` varchar(20) DEFAULT NULL COMMENT '同居者类型 0独居;1与配偶/伴侣居住;2与子女居住;3与孙辈居住;4与父母居住;5与兄弟姐妹居住;6与其他亲友居住;7其他',
  `living_together_remark` varchar(255) DEFAULT NULL COMMENT '同居者备注',
  `dementia_flag` varchar(20) DEFAULT NULL COMMENT '痴呆症 0无 1有',
  `Mental_illness` varchar(20) DEFAULT NULL COMMENT '精神疾病(可多选)0无;1精神分裂症;2双相情感障碍;3偏执性精神障碍;4分裂情感性障碍;5癫痫所致精神障碍;6精神发育迟滞伴发精神障碍',
  `mental_illness` varchar(20) DEFAULT NULL COMMENT '精神疾病(可多选)0无;1精神分裂症;2双相情感障碍;3偏执性精神障碍;4分裂情感性障碍;5癫痫所致精神障碍;6精神发育迟滞伴发精神障碍',
  `disease_type` varchar(20) DEFAULT NULL COMMENT '患病类型可多选;0无 1肿瘤(晚期)2严重心律失常3压疮4慢性心力衰竭(心功能III-IV级)5慢性肾功能衰竭(尿毒症期)6多器官功能衰竭7蛋白质能量营养不足(重度)8慢性阻塞性肺疾病(肺心病心功能III-IV级)9呼吸衰竭10脑血管意外合并吞咽障碍11其他',
  `disease_remark` varchar(255) DEFAULT NULL COMMENT '其他疾病',
  `fall_lately` varchar(20) DEFAULT NULL COMMENT '近30天跌倒 0无;1一次;2两次;3三次及以上',

+ 20 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/apply/PatientBedApplyDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.care.dao.apply;
import com.yihu.jw.entity.care.apply.PatientBedApplyDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Bing on 2021/4/8.
 */
public interface PatientBedApplyDao extends PagingAndSortingRepository<PatientBedApplyDo,String>,
        JpaSpecificationExecutor<PatientBedApplyDo> {
    PatientBedApplyDo findByPatientAndOrgCodeAndStatus(String patient,String orgCode,Integer status);
    List<PatientBedApplyDo> findByOrgCodeAndStatusIn(String orgCode,Integer[] status);
    List<PatientBedApplyDo> queryByIdcardAndOrgCodeAndStatusIn(String idcard,String orgCode,Integer[] status);
}

+ 9 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/sign/ArchiveDao.java

@ -1,9 +1,13 @@
package com.yihu.jw.care.dao.sign;
import com.yihu.jw.entity.care.archive.ArchiveDO;
import javafx.scene.shape.Arc;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2021/2/24.
 */
@ -12,4 +16,9 @@ public interface ArchiveDao extends PagingAndSortingRepository<ArchiveDO, String
    ArchiveDO findByIdcardAndDoctorCode(String idcard, String doctorCode);
    ArchiveDO findByPatientAndDoctorCode(String patient, String doctorCode);
    List<ArchiveDO> findByPatient(String patient);
    @Query(value = "SELECT a.* FROM wlyy_archive a WHERE a.idcard=?1 order by a.create_time desc limit 1",nativeQuery = true)
    ArchiveDO findByIdcard(String idcard);
}

+ 56 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/apply/PatientBedApplyEndPoint.java

@ -0,0 +1,56 @@
package com.yihu.jw.care.endpoint.apply;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.service.apply.PatientBedApplyService;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * Created by Bing on 2021/4/8.
 */
@RestController
@Api(description = "居民床位申请")
@RequestMapping(value = "bed_apply")
public class PatientBedApplyEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private PatientBedApplyService patientBedApplyService;
    @PostMapping("/apply")
    @ApiOperation("居民申请机构床位")
    public ObjEnvelop apply(@ApiParam(name = "idcard", value = "居民idcard", required = true)
                            @RequestParam(value = "idcard") String idcard,
                            @ApiParam(name = "orgCode", value = "机构code", required = true)
                            @RequestParam(value = "orgCode") String orgCode) {
        try {
            JSONObject result = patientBedApplyService.apply(idcard, orgCode);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
            return ObjEnvelop.getSuccess("操作成功", result);
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError("申请失败" + e.getMessage());
        }
    }
    @GetMapping("/getApplyList")
    @ApiOperation("居民申请机构床位")
    public ListEnvelop getApplyList(@ApiParam(name = "doctor", value = "doctor", required = true)
                                    @RequestParam(value = "doctor") String doctor) {
        try {
            return ListEnvelop.getSuccess("查询成功", patientBedApplyService.getApplyList(doctor));
        } catch (Exception e) {
            e.printStackTrace();
            return ListEnvelop.getError("查询失败");
        }
    }
}

+ 6 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/security/SecurityMonitoringOrderEndpoint.java

@ -46,8 +46,8 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = "getSecurityOrderList")
    @ApiOperation(value = "获取安防工单列表")
    public ListEnvelop getSecurityOrderList(@ApiParam(name="doctor",value = "医生ID",required = true)
    @ApiOperation(value = "获取安防工单列表")//TODO 查询需要修改
    public ListEnvelop getSecurityOrderList(@ApiParam(name="doctor",value = "医生ID",required = false)
                                            @RequestParam(value = "doctor")String doctor,
                                            @ApiParam(name="patient",value = "patient")
                                            @RequestParam(value = "patient",required = false)String patient,
@ -74,7 +74,10 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
            @ApiParam(value = "工单id", name = "orderId", required = true) @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "医生code", name = "doctor", required = true) @RequestParam(value = "doctor", required = true) String doctor) {
        try {
            securityMonitoringOrderService.acceptOrder(orderId,doctor);
            JSONObject result =  securityMonitoringOrderService.acceptOrder(orderId,doctor);
            if (result.getIntValue("resultFlag") == 0) {
                return ObjEnvelop.getError(result.getString("resultMsg"));
            }
            return ObjEnvelop.getSuccess("操作成功",200);
        } catch (Exception e) {
            e.printStackTrace();

+ 16 - 9
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/sign/SignEndpoint.java

@ -12,6 +12,7 @@ import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.entity.care.archive.ArchiveDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -127,7 +128,7 @@ public class SignEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping(value = "servicePackageSign" )
    @PostMapping(value = "servicePackageSign")
    @ApiOperation(value = "分配服务包-签约")
    @ObserverRequired
    public Envelop servicePackageSign(
@ -235,17 +236,21 @@ public class SignEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = "capacityAssessment" )
    @ApiOperation(value = "生成能力评估报告")
    @ObserverRequired
    public Envelop capacityAssessment(
    public ObjEnvelop capacityAssessment(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData,
            @ApiParam(name = "doctorId", value = "医生id", required = true)
            @RequestParam String doctorId) {
        try{
            capacityAssessmentRecordService.capacityAssessment(jsonData,doctorId);
            return success("生成成功");
            JSONObject result = capacityAssessmentRecordService.capacityAssessment(jsonData,doctorId);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
            return ObjEnvelop.getSuccess("生成成功", result);
        }catch (Exception e){
            e.printStackTrace();
            return failed("生成失败",-1);
            return ObjEnvelop.getError("生成失败");
        }
    }
@ -303,9 +308,10 @@ public class SignEndpoint extends EnvelopRestEndpoint {
            if(patientDao.existsByIdcardAndDel(idcard,"1")){
                ArchiveDO archiveDO = archiveDao.findByIdcardAndDoctorCode(idcard,doctorId);
                if(archiveDO!=null){
                    return success(archiveDO);
                }else {
                    return failed("您所提交的居民信息已存在,请勿重复建档",-1);
                }else {
                    archiveDO  = archiveDao.findByIdcard(idcard);
                    return success(archiveDO);
                }
            }
            return success("不存在档案");
@ -331,9 +337,10 @@ public class SignEndpoint extends EnvelopRestEndpoint {
            if(patientDao.existsByIdcardAndDel(idcard,"1")){
                ArchiveDO archiveDO = archiveDao.findByIdcardAndDoctorCode(idcard,doctorId);
                if(archiveDO!=null){
                    return success(archiveDO);
                }else {
                    return failed("您所提交的居民信息已存在,请勿重复建档",-1);
                }else {//查询最近的一条建档记录
                    archiveDO  = archiveDao.findByIdcard(idcard);
                    return success(archiveDO);
                }
            }
            archiveService.createArchive(patientDO,doctorId);

+ 94 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/apply/PatientBedApplyService.java

@ -0,0 +1,94 @@
package com.yihu.jw.care.service.apply;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.apply.PatientBedApplyDao;
import com.yihu.jw.care.dao.sign.ArchiveDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.apply.PatientBedApplyDo;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import sun.security.ssl.HandshakeOutStream;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by Bing on 2021/4/8.
 */
@Service
public class PatientBedApplyService extends BaseJpaService<PatientBedApplyDo, PatientBedApplyDao> {
    @Autowired
    private PatientBedApplyDao patientBedApplyDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private ArchiveDao archiveDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    public JSONObject apply(String idcard,String orgCode){
        JSONObject result = new JSONObject();
        BasePatientDO basePatientDo = basePatientDao.findByIdcardAndDel(idcard,"1");
        //展示只能申请一个机构
        List<PatientBedApplyDo> applyList = patientBedApplyDao.queryByIdcardAndOrgCodeAndStatusIn(idcard,orgCode,new Integer[]{0,1,2});
        if (applyList.size()>0){
            String failMsg = "当前用户已申请过该机构,无法重复申请";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg,failMsg);
            return result;
        }
        else {
            BaseOrgDO baseOrgDO = baseOrgDao.findByCode(orgCode);
            if (baseOrgDO==null){
                String failMsg = "申请机构不存在";
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                result.put(ResponseContant.resultMsg,failMsg);
                return result;
            }
            PatientBedApplyDo patientBedApplyDo = new PatientBedApplyDo();
            if (basePatientDo!=null){
                patientBedApplyDo.setPatient(basePatientDo.getId());
                patientBedApplyDo.setPatientName(basePatientDo.getName());
            }
            patientBedApplyDo.setOrgCode(orgCode);
            patientBedApplyDo.setIdcard(idcard);
            patientBedApplyDo.setOrgName(baseOrgDO.getName());
            patientBedApplyDo.setStatus(1);//申请床位是未选择医生 设为未建档(医生未创建建档记录)。
            patientBedApplyDao.save(patientBedApplyDo);
            result.put(ResponseContant.resultFlag, ResponseContant.success);
            result.put(ResponseContant.resultMsg,patientBedApplyDo);
        }
        return result;
    }
    public List<PatientBedApplyDo> getApplyList(String doctor){
        List<PatientBedApplyDo> result = new ArrayList<>();
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
        if (doctorDO.getLevel()==2){//助老员
            List<BaseDoctorHospitalDO> hospitalDOS = baseDoctorHospitalDao.findByDoctorCode(doctor);
            for (BaseDoctorHospitalDO obj:hospitalDOS){
                List<PatientBedApplyDo> list = patientBedApplyDao.findByOrgCodeAndStatusIn(obj.getOrgCode(),new Integer[]{1,2});
                result.addAll(list);
            }
        }
        return result;
    }
}

+ 35 - 8
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -161,16 +161,19 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
    public JSONArray getSecurityOrderList(String doctor, String patient, String status, Integer page, Integer pageSize){
        String sql = " select p.id patientCode,p.name,p.sex,p.idcard,ord.id orderId,ord.number,ord.serve_desc,ord.create_time,ord.`status`,ord.doctor," +
                "ord.doctor_name,ord.patient_phone from base_security_monitoring_order ord INNER JOIN base_patient p on p.id = ord.patient " +
                "ord.doctor_name,ord.patient_phone,ord.conclusion_status from base_security_monitoring_order ord INNER JOIN base_patient p on p.id = ord.patient " +
                "where 1=1 ";
        if (StringUtils.isNotBlank(doctor)){
            sql +=" and ord.doctor = '"+doctor+"' ";
        }
        if (StringUtils.isNotBlank(patient)){
            sql+=" and ord.patient='"+patient+"' ";
            sql+=" and ord.patient_name= like '%"+patient+"%' ";
        }
        if (StringUtils.isNotBlank(status)){
            sql+=" and ord.status='"+Integer.parseInt(status)+"' ";
        }
        if (StringUtils.isBlank(status)&&status.equals("1")){//状态为空或待处置时 查询该医生签约团队居民的预警
        }
        sql+=" order by ord.create_time desc limit " + (page*pageSize) + "," + pageSize;
        List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql);
@ -191,6 +194,14 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            tmp.put("doctor",one.get("doctor"));
            tmp.put("doctorName",one.get("doctor_ame"));
            tmp.put("patientPhone",one.get("patient_phone"));
            tmp.put("conclusionStatus",one.get("conclusion_status"));
            Integer conclusionStatus = Integer.valueOf(one.get("conclusion_status")+"");
            String conclusionStatusName = "";
            switch (conclusionStatus){
                case 1:conclusionStatusName="待补录";break;
                case 2:conclusionStatusName="已登记";break;
            }
            tmp.put("conclusionStatusName",conclusionStatusName);
            Integer statustemp = Integer.valueOf(one.get("status")+"");
            String statusName = "";
            switch (statustemp){
@ -309,6 +320,25 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            logger.error(failMsg);
            return result;
        }
        if (doorServiceOrderDO.getStatus()!=1){//待处置工单才可进行接单操作
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            String failMsg = "当前工单已被取消或接收:" + orderId;
            result.put(ResponseContant.resultMsg, failMsg);
            logger.error(failMsg);
            return result;
        }
        SecurityMonitoringDoctorStatusDo doctorStatusDo = doctorStatusDao.findByDoctor(doctor);
        BaseDoctorDO doctorVO = baseDoctorDao.findById(doctor);
        if (null == doctorStatusDo) {
            doctorStatusDo =new SecurityMonitoringDoctorStatusDo();
            doctorStatusDo.setDoctor(doctor);
            doctorStatusDo.setStatus(2);
            doctorStatusDo.setCreateTime(new Date());
            doctorStatusDo.setCreateUser(doctor);
            doctorStatusDo.setCreateUserName(null != doctorVO ? doctorVO.getName() : null);
            doctorStatusDao.save(doctorStatusDo);
        }
        SecurityMonitoringDoctorStatusDo doorDoctorStatusDO = doctorStatusDao.queryByDoctorAndStatusIn(doctor,new Integer[]{SecurityMonitoringDoctorStatusDo.Status.waitForSend.getType(),
                SecurityMonitoringDoctorStatusDo.Status.waitForAccept.getType(),
                SecurityMonitoringDoctorStatusDo.Status.waitForServe.getType(),
@ -381,7 +411,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
//        }
        //  待接单消息设为已操作, 434 医生接单-- 王五接受了服务工单12345678
        messageUtil.createMessage("医生接单","634",doorServiceOrder.getPatient(),doorServiceOrder.getPatientName(),
                doorServiceOrder.getId(), doorServiceOrder.getDoctor(),doorServiceOrder.getDoctorName() ,null, doorServiceOrder.getDoctor() + "接受了服务工单"+ doorServiceOrder.getNumber());
                doorServiceOrder.getId(), doorServiceOrder.getDoctor(),doorServiceOrder.getDoctorName() ,null, doorServiceOrder.getDoctorName() + "接受了服务工单"+ doorServiceOrder.getNumber());
        return result;
    }
@ -594,7 +624,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
     */
    public Integer countPatientDoorTimes(String patient){
        Integer count = 0;
        String sql = "SELECT count(d.id) as count FROM base_security_monitoring_order o  where  o.patient = '" + patient + "' and status>3 ";
        String sql = "SELECT count(o.id) as count FROM base_security_monitoring_order o  where  o.patient = '" + patient + "' and status>3 ";
        count = jdbcTemplate.queryForObject(sql,Integer.class);
        return count;
    }
@ -622,12 +652,9 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        SecurityMonitoringOrderDO one = securityMonitoringOrderDao.findOne(orderId);
        one.setDoctorConfirmFinishImg(finishImg);
        one.setStatus(SecurityMonitoringOrderDO.Status.complete.getType());
        one.setDoctorConfirmFinishFinishTime(new Date());
        one.setDoctorConfirmFinishTime(new Date());
        // 更新记录
        this.setUpdateColumnInfo(one);
        // 计算保存服务总的支付费用
        securityMonitoringOrderDao.save(one);
        SecurityMonitoringOrderDO doorServiceOrderDO = this.getDoorServiceOrderById(orderId);

+ 27 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ArchiveService.java

@ -1,9 +1,13 @@
package com.yihu.jw.care.service.sign;
import com.yihu.jw.care.dao.apply.PatientBedApplyDao;
import com.yihu.jw.care.dao.sign.ArchiveDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.apply.PatientBedApplyDo;
import com.yihu.jw.entity.care.archive.ArchiveDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
@ -38,6 +42,10 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private PatientBedApplyDao patientBedApplyDao;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    /**
@ -110,6 +118,16 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
        archiveDO.setIdcard(patientDO.getIdcard());
        archiveDO.setCreateTime(new Date());
        archiveDao.save(archiveDO);
        //床位申请修改状态
        List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorId);
        if (hospitalDOs.size()>0){
            PatientBedApplyDo bedApplyDo = patientBedApplyDao.findByPatientAndOrgCodeAndStatus(patientDO.getIdcard(),hospitalDOs.get(0).getOrgCode(),1);
            if (bedApplyDo!=null){
                bedApplyDo.setStatus(2);
                patientBedApplyDao.save(bedApplyDo);
            }
        }
        return 0;
    }
@ -128,6 +146,15 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
        archiveDO.setIdcard(patientDO.getIdcard());
        archiveDO.setCreateTime(new Date());
        archiveDao.save(archiveDO);
        List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorId);
        if (hospitalDOs.size()>0){
            PatientBedApplyDo bedApplyDo = patientBedApplyDao.findByPatientAndOrgCodeAndStatus(patientDO.getIdcard(),hospitalDOs.get(0).getOrgCode(),1);
            if (bedApplyDo!=null){
                bedApplyDo.setStatus(2);
                patientBedApplyDao.save(bedApplyDo);
            }
        }
    }
}

+ 50 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/CapacityAssessmentRecordService.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.dao.apply.PatientBedApplyDao;
import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
import com.yihu.jw.care.dao.sign.*;
import com.yihu.jw.care.service.common.DictService;
@ -14,10 +15,12 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.apply.PatientBedApplyDo;
import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
import com.yihu.jw.entity.care.sign.*;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
@ -68,6 +71,10 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
    private DictService dictService;
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private PatientBedApplyDao patientBedApplyDao;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    /**
@ -163,11 +170,32 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    public void capacityAssessment(String jsonData,String doctorId) throws Exception{
    public JSONObject capacityAssessment(String jsonData,String doctorId) throws Exception{
        JSONObject result = new JSONObject();
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        CapacityAssessmentRecordDO recordDO = objectMapper.readValue(jsonObject.getJSONObject("assessment").toJSONString(), CapacityAssessmentRecordDO.class);
        if(isCapacityAssessment(recordDO.getPatient())==0){
            String year = DateUtil.getNowYear()+"";
            JSONObject obj = getAssessmentItemDetail(recordDO.getPatient(),0,year);
            net.sf.json.JSONObject objTmp = net.sf.json.JSONObject.fromObject(JSON.parseObject(obj.toJSONString()));
            Iterator<String> keys = objTmp.keys();
            boolean finishFlag=true;
            while (keys.hasNext()){
                String key = keys.next();
                net.sf.json.JSONObject tmp = objTmp.getJSONObject(key+"");
                String id = tmp.containsKey("id")?tmp.getString("id"):"";
                if (StringUtils.isBlank(id)){
                    result.put(ResponseContant.resultFlag, ResponseContant.fail);
                    result.put(ResponseContant.resultMsg,"患者存在未完成的评估表"+key);
                    finishFlag=false;
                    break;
                }
            }
            if (!finishFlag){
                return result;
            }
            BaseDoctorDO doctorDO = doctorDao.findById(doctorId);
            List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByDoctorCode(doctorId);
            recordDO.setOrgCode(doctorHospitalDOs.get(0).getOrgCode());
@ -187,7 +215,12 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
            patientLabelDO.setLabelCode(String.valueOf(recordDO.getLevelConclusion()));
            patientLabelDO.setLabelName(dictService.fingByNameAndCode(ConstantUtil.DICT_SERVICE_TYPE,patientLabelDO.getLabelCode()));
            patientLabelDao.save(patientLabelDO);
            result.put(ResponseContant.resultFlag, ResponseContant.success);
            result.put(ResponseContant.resultMsg,recordDO);
            return result;
        }
        return null;
    }
    /**
@ -270,6 +303,15 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
                    recordDO.setServicePackageStatus(0);
                    recordDO.setStatus(0);
                    capacityAssessmentRecordDao.save(recordDO);
                    //生成居民标签
                    patientLabelDao.deleteByPatient(recordDO.getPatient());
                    WlyyPatientLabelDO patientLabelDO = new WlyyPatientLabelDO();
                    patientLabelDO.setCzrq(new Date());
                    patientLabelDO.setLabelType("1");
                    patientLabelDO.setPatient(recordDO.getPatient());
                    patientLabelDO.setLabelCode(String.valueOf(recordDO.getLevelConclusion()));
                    patientLabelDO.setLabelName(dictService.fingByNameAndCode(ConstantUtil.DICT_SERVICE_TYPE,patientLabelDO.getLabelCode()));
                    patientLabelDao.save(patientLabelDO);
                    result.put("status",1);
                    result.put("message","保存成功");
                    result.put("data",recordDO);
@ -303,6 +345,13 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
        recordDO.setSignUrl(signUrl);
        recordDO.setSignTime(new Date());
        capacityAssessmentRecordDao.save(recordDO);
        //完成评估 修改床位生请状态为已完成
        PatientBedApplyDo bedApplyDo = patientBedApplyDao.findByPatientAndOrgCodeAndStatus(recordDO.getIdcard(),recordDO.getOrgCode(),2);
        if (bedApplyDo!=null) {
            bedApplyDo.setStatus(0);
            patientBedApplyDao.save(bedApplyDo);
        }
    }
    /**