LiTaohong 6 years ago
parent
commit
f12a26dea3
97 changed files with 5855 additions and 189 deletions
  1. 64 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/im/ImGetuiConfigDO.java
  2. 230 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java
  3. 49 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDetailTimeDO.java
  4. 97 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDetailsDO.java
  5. 125 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageNormcatDO.java
  6. 153 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackagePropDO.java
  7. 124 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackagePropvalueDO.java
  8. 220 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java
  9. 124 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSkuDO.java
  10. 84 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/statistics/DimensionDO.java
  11. 86 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/statistics/DimensionQuotaDO.java
  12. 185 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/statistics/JobConfigDO.java
  13. 65 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/statistics/QuotaDO.java
  14. 12 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/HospitalServiceItemDO.java
  15. 12 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistEvaluateDO.java
  16. 12 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistEvaluateLabelDO.java
  17. 1 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistServiceItemDO.java
  18. 13 3
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java
  19. 0 11
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java
  20. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java
  21. 127 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationOperateRecordsDO.java
  22. 3 3
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationPlanTemplateDO.java
  23. 43 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  24. 12 5
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java
  25. 64 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/im/ImGetuiConfigVO.java
  26. 34 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/RehabilitationVO.java
  27. 46 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageDetailTimeVO.java
  28. 96 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageDetailsVO.java
  29. 211 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageLogVO.java
  30. 106 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageNormcatVO.java
  31. 156 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackagePropVO.java
  32. 124 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackagePropvalueDO.java
  33. 196 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageSignRecordVO.java
  34. 133 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageSkuVO.java
  35. 151 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageVO.java
  36. 84 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/statistics/DimensionQuotaVO.java
  37. 86 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/statistics/DimensionVO.java
  38. 184 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/statistics/JobConfigVO.java
  39. 64 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/statistics/QuotaVO.java
  40. 96 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/specialist/PatientDisseaseInfoVO.java
  41. 10 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/Envelop.java
  42. 14 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/ObjEnvelop.java
  43. 8 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java
  44. 71 0
      svr/svr-base/doc/es/服务包执行日志记录索引.txt
  45. 5 0
      svr/svr-base/pom.xml
  46. 11 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/ImGetuiConfigDao.java
  47. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageDao.java
  48. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageDetailTimeDao.java
  49. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageDetailsDao.java
  50. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageNormcatDao.java
  51. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackagePropDao.java
  52. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackagePropvalueDao.java
  53. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageSignRecordDao.java
  54. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageSkuDao.java
  55. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/statistics/DimensionDao.java
  56. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/statistics/DimensionQuotaDao.java
  57. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/statistics/JobConfigDao.java
  58. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/statistics/QuotaDao.java
  59. 94 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/im/ImGetuiConfigEndpiont.java
  60. 70 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/RehabilitationEndpoint.java
  61. 94 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java
  62. 95 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/statistics/DimensionEndpoint.java
  63. 95 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/statistics/JobConfigEndpoint.java
  64. 95 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/statistics/QuotaEndpoint.java
  65. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/ImGetuiConfigService.java
  66. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageDetailTimeService.java
  67. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageDetailsService.java
  68. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageNormcatService.java
  69. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackagePropService.java
  70. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackagePropvalueService.java
  71. 158 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java
  72. 15 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageSignRecordService.java
  73. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageSkuService.java
  74. 15 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/statistics/DimensionQuotaService.java
  75. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/statistics/DimensionService.java
  76. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/statistics/JobConfigService.java
  77. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/statistics/QuotaService.java
  78. 31 1
      svr/svr-base/src/main/resources/application.yml
  79. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/config/jpa/IotJpa.java
  80. 7 0
      svr/svr-wlyy-specialist/pom.xml
  81. 13 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java
  82. 2 7
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistEvaluateController.java
  83. 19 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistServiceItemController.java
  84. 173 19
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java
  85. 42 17
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationPlanController.java
  86. 3 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java
  87. 6 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistServiceItemDao.java
  88. 12 4
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailDao.java
  89. 21 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationOperateRecordsDao.java
  90. 6 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationPlanTemplateDao.java
  91. 24 2
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistEvaluateService.java
  92. 17 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java
  93. 192 4
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistServiceItemService.java
  94. 287 82
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java
  95. 106 28
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationPlanService.java
  96. 9 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/util/ExcelData.java
  97. 30 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/util/ReadExcelUtil.java

+ 64 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/im/ImGetuiConfigDO.java

@ -0,0 +1,64 @@
package com.yihu.jw.entity.base.im;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * im个推配置表
 * @author yeshijie on 2018/8/29.
 */
@Entity
@Table(name = "base_im_getui_config")
public class ImGetuiConfigDO extends UuidIdentityEntity {
    private String saasId;//个推url
    private String host;
    private String appId;//个推appid
    private String appkey;//个推appkey
    private String mastersecret;//个推的秘钥
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getHost() {
        return host;
    }
    public void setHost(String host) {
        this.host = host;
    }
    @Column(name = "app_id")
    public String getAppId() {
        return appId;
    }
    public void setAppId(String appId) {
        this.appId = appId;
    }
    public String getAppkey() {
        return appkey;
    }
    public void setAppkey(String appkey) {
        this.appkey = appkey;
    }
    public String getMastersecret() {
        return mastersecret;
    }
    public void setMastersecret(String mastersecret) {
        this.mastersecret = mastersecret;
    }
}

+ 230 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java

@ -0,0 +1,230 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * 服务包表
 * @author yeshijie on 2018/8/17.
 */
@Entity
@Table(name = "base_service_package")
public class ServicePackageDO extends UuidIdentityEntity implements Serializable {
    public enum Level {
        system("系统", "0"),
        doctor("医生", "1"),
        team("团队", "2"),
        hospital("社区", "3"),
        town("区", "4");
        private String name;
        private String value;
        Level(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
    }
    public enum Status {
        waiting("待审核", "0"),
        pass("审核通过", "1"),
        unpass("审核不通过", "2");
        private String name;
        private String value;
        Status(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
    }
    public enum Type {
        rehabilitation("康复计划", "1");
        private String name;
        private String value;
        Type(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
    }
    private String saasId;
    private String name;//服务包名称
    private String type;//服务包类型
    private Integer num;//服务项数量
    private Long price;//预售价//单位分
    private String level;//服务包级别(0系统,1.医生,2团队,3社区,4区)
    private String levelCode;//关联code
    private String creater;//创建者
    private Date createTime;//创建时间
    private String introduce;//服务介绍
    private String status;//审核状态(预留字段0待审核,1审核通过,2审核不通过)
    private Integer del;//是否有效(1有效,0失效)
    private List<ServicePackageDetailsDO> detailsDOList;//服务项
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public Integer getNum() {
        return num;
    }
    public void setNum(Integer num) {
        this.num = num;
    }
    public Long getPrice() {
        return price;
    }
    public void setPrice(Long price) {
        this.price = price;
    }
    public String getLevel() {
        return level;
    }
    public void setLevel(String level) {
        this.level = level;
    }
    @Column(name = "level_code")
    public String getLevelCode() {
        return levelCode;
    }
    public void setLevelCode(String levelCode) {
        this.levelCode = levelCode;
    }
    public String getCreater() {
        return creater;
    }
    public void setCreater(String creater) {
        this.creater = creater;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    @Transient
    public List<ServicePackageDetailsDO> getDetailsDOList() {
        return detailsDOList;
    }
    public void setDetailsDOList(List<ServicePackageDetailsDO> detailsDOList) {
        this.detailsDOList = detailsDOList;
    }
}

+ 49 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDetailTimeDO.java

@ -0,0 +1,49 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 服务包明细执行时间表
 * @author yeshijie on 2018/8/17.
 */
@Entity
@Table(name = "base_service_package_detail_time")
public class ServicePackageDetailTimeDO extends UuidIdentityEntity implements Serializable {
    private String saasId;
    private String detailId;//服务包明细id
    private Date excutionTime;//执行时间
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "detail_id")
    public String getDetailId() {
        return detailId;
    }
    public void setDetailId(String detailId) {
        this.detailId = detailId;
    }
    @Column(name = "excution_time")
    public Date getExcutionTime() {
        return excutionTime;
    }
    public void setExcutionTime(Date excutionTime) {
        this.excutionTime = excutionTime;
    }
}

+ 97 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDetailsDO.java

@ -0,0 +1,97 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 服务包明细表
 * @author yeshijie on 2018/8/17.
 */
@Entity
@Table(name = "base_service_package_details")
public class ServicePackageDetailsDO extends UuidIdentityEntity implements Serializable {
    private String saasId;
    private String servicePackageId;//服务包id',
    private String code;//服务项目编码',
    private String name;//服务项目名称',
    private Date createTime;//创建时间',
    private Date executionTime;//执行时间',
    private String executionType;//执行类型(1固定时间,2固定次数(不固定时间),3长期)',
    private Integer executionNum;//最少执行次数',
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "service_package_id")
    public String getServicePackageId() {
        return servicePackageId;
    }
    public void setServicePackageId(String servicePackageId) {
        this.servicePackageId = servicePackageId;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "execution_type")
    public String getExecutionType() {
        return executionType;
    }
    public void setExecutionType(String executionType) {
        this.executionType = executionType;
    }
    @Column(name = "execution_num")
    public Integer getExecutionNum() {
        return executionNum;
    }
    public void setExecutionNum(Integer executionNum) {
        this.executionNum = executionNum;
    }
    @Column(name = "execution_time")
    public Date getExecutionTime() {
        return executionTime;
    }
    public void setExecutionTime(Date executionTime) {
        this.executionTime = executionTime;
    }
}

+ 125 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageNormcatDO.java

@ -0,0 +1,125 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 服务包类目表
 * @author yeshijie on 2018/8/29.
 */
@Entity
@Table(name = "base_service_package_normcat")
public class ServicePackageNormcatDO extends UuidIdentityEntity implements Serializable {
    private String saasId;
    private Long cid;//商品所属类目ID
    private Long parentCid;//父类目ID=0时,代表的是一级的类目
    private String name;//类目名称
    private Integer isParent;//该类目是否为父类目(即:该类目是否还有子类目),1为true,0为false
    private Long sortOrder;//排列序号,表示同级类目的展现次序,如数值相等则按名称次序排列。取值范围:大于零的整数
    private String alias;//alias
    private String picUrl;//类型图片
    private String simpleName;//分类简称
    private Date createTime;//创建时间
    private Integer del;//状态。可选值:1(正常),0(删除)
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public Long getCid() {
        return cid;
    }
    public void setCid(Long cid) {
        this.cid = cid;
    }
    @Column(name = "parent_cid")
    public Long getParentCid() {
        return parentCid;
    }
    public void setParentCid(Long parentCid) {
        this.parentCid = parentCid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "is_parent")
    public Integer getIsParent() {
        return isParent;
    }
    public void setIsParent(Integer isParent) {
        this.isParent = isParent;
    }
    @Column(name = "sort_order")
    public Long getSortOrder() {
        return sortOrder;
    }
    public void setSortOrder(Long sortOrder) {
        this.sortOrder = sortOrder;
    }
    public String getAlias() {
        return alias;
    }
    public void setAlias(String alias) {
        this.alias = alias;
    }
    @Column(name = "pic_url")
    public String getPicUrl() {
        return picUrl;
    }
    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }
    @Column(name = "simple_name")
    public String getSimpleName() {
        return simpleName;
    }
    public void setSimpleName(String simpleName) {
        this.simpleName = simpleName;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 153 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackagePropDO.java

@ -0,0 +1,153 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 服务包属性表
 * @author yeshijie on 2018/8/29.
 */
@Entity
@Table(name = "base_service_package_prop")
public class ServicePackagePropDO extends UuidIdentityEntity implements Serializable {
    private String saasId;
    private Long pid;//属性 ID
    private Long parentPid;//上级属性ID
    private Long parentVid;//上级属性值ID
    private String name;//属性名
    private Integer isKeyProp;//是否关键属性。可选值:true(是),false(否)
    private Integer isSaleProp;//是否销售属性。可选值:true(是),false(否)
    private Integer isItemProp;//是否商品属性。可选值:true(是),false(否)
    private Integer must;//是否为必选属性。可选值:true(是),false(否)
    private Integer multi;//是否可以多选。可选值:true(是),false(否)
    private Long sortOrder;
    private Long cid;//类目ID
    private Date createTime;
    private Integer del;//状态。可选值:1(正常),0(删除)
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public Long getPid() {
        return pid;
    }
    public void setPid(Long pid) {
        this.pid = pid;
    }
    @Column(name = "parent_pid")
    public Long getParentPid() {
        return parentPid;
    }
    public void setParentPid(Long parentPid) {
        this.parentPid = parentPid;
    }
    @Column(name = "parent_vid")
    public Long getParentVid() {
        return parentVid;
    }
    public void setParentVid(Long parentVid) {
        this.parentVid = parentVid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "is_key_prop")
    public Integer getIsKeyProp() {
        return isKeyProp;
    }
    public void setIsKeyProp(Integer isKeyProp) {
        this.isKeyProp = isKeyProp;
    }
    @Column(name = "is_sale_prop")
    public Integer getIsSaleProp() {
        return isSaleProp;
    }
    public void setIsSaleProp(Integer isSaleProp) {
        this.isSaleProp = isSaleProp;
    }
    @Column(name = "is_item_prop")
    public Integer getIsItemProp() {
        return isItemProp;
    }
    public void setIsItemProp(Integer isItemProp) {
        this.isItemProp = isItemProp;
    }
    public Integer getMust() {
        return must;
    }
    public void setMust(Integer must) {
        this.must = must;
    }
    public Integer getMulti() {
        return multi;
    }
    public void setMulti(Integer multi) {
        this.multi = multi;
    }
    @Column(name = "sort_order")
    public Long getSortOrder() {
        return sortOrder;
    }
    public void setSortOrder(Long sortOrder) {
        this.sortOrder = sortOrder;
    }
    public Long getCid() {
        return cid;
    }
    public void setCid(Long cid) {
        this.cid = cid;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 124 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackagePropvalueDO.java

@ -0,0 +1,124 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 服务包属性值表
 * @author yeshijie on 2018/8/29.
 */
@Entity
@Table(name = "base_service_package_propvalue")
public class ServicePackagePropvalueDO extends UuidIdentityEntity implements Serializable {
    private String saasId;
    private Long cid;//类目ID',
    private Long pid;//属性 ID',
    private String propName;//属性名',
    private Long vid;//属性值ID',
    private String name;//属性值',
    private String nameAlias;//属性值别名',
    private Integer isParent;//是否为父类目属性',
    private Long sortOrder;//排列序号。取值范围:大于零的整数',
    private Date createTime;
    private Integer del;//状态。可选值:1(正常),0(删除)',
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public Long getCid() {
        return cid;
    }
    public void setCid(Long cid) {
        this.cid = cid;
    }
    public Long getPid() {
        return pid;
    }
    public void setPid(Long pid) {
        this.pid = pid;
    }
    @Column(name = "prop_name")
    public String getPropName() {
        return propName;
    }
    public void setPropName(String propName) {
        this.propName = propName;
    }
    public Long getVid() {
        return vid;
    }
    public void setVid(Long vid) {
        this.vid = vid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "name_alias")
    public String getNameAlias() {
        return nameAlias;
    }
    public void setNameAlias(String nameAlias) {
        this.nameAlias = nameAlias;
    }
    @Column(name = "is_parent")
    public Integer getIsParent() {
        return isParent;
    }
    public void setIsParent(Integer isParent) {
        this.isParent = isParent;
    }
    @Column(name = "sort_order")
    public Long getSortOrder() {
        return sortOrder;
    }
    public void setSortOrder(Long sortOrder) {
        this.sortOrder = sortOrder;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 220 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java

@ -0,0 +1,220 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 服务包签约记录表
 * @author yeshijie on 2018/8/17.
 */
@Entity
@Table(name = "base_service_package_sign_record")
public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Serializable {
    public enum Status {
        create("新建", "1"),
        complete("已完成", "2");
        private String name;
        private String value;
        Status(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
    }
    private String saasId;
    private String servicePackageId;//服务包id
    private String servicePackageName;//服务包名称
    private String patient;//居民code
    private String name;//居民姓名
    private String idcard;//居民身份证
    private String ssc;//社保卡号
    private String signDoctor;//签约医生code
    private String signDoctorName;//签约医生名称
    private String hospital;//医院code
    private String hospitalName;//医院名称
    private Long adminTeamCode;//行政团队id
    private Long price;//服务总价
    private Date startTime;//服务开始时间
    private Date endTime;//服务结束时间
    private String status;//状态(1新建,2已完成)
    private String doctorTeamCode;//医生服务团队code
    private Date createTime;//创建时间
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "service_package_id")
    public String getServicePackageId() {
        return servicePackageId;
    }
    public void setServicePackageId(String servicePackageId) {
        this.servicePackageId = servicePackageId;
    }
    @Column(name = "service_package_name")
    public String getServicePackageName() {
        return servicePackageName;
    }
    public void setServicePackageName(String servicePackageName) {
        this.servicePackageName = servicePackageName;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
    @Column(name = "sign_doctor")
    public String getSignDoctor() {
        return signDoctor;
    }
    public void setSignDoctor(String signDoctor) {
        this.signDoctor = signDoctor;
    }
    @Column(name = "sign_doctor_name")
    public String getSignDoctorName() {
        return signDoctorName;
    }
    public void setSignDoctorName(String signDoctorName) {
        this.signDoctorName = signDoctorName;
    }
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    @Column(name = "hospital_name")
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    @Column(name = "admin_team_code")
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    public Long getPrice() {
        return price;
    }
    public void setPrice(Long price) {
        this.price = price;
    }
    @Column(name = "start_time")
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    @Column(name = "end_time")
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    @Column(name = "doctor_team_code")
    public String getDoctorTeamCode() {
        return doctorTeamCode;
    }
    public void setDoctorTeamCode(String doctorTeamCode) {
        this.doctorTeamCode = doctorTeamCode;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 124 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSkuDO.java

@ -0,0 +1,124 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 服务包sku表
 * @author yeshijie on 2018/8/29.
 */
@Entity
@Table(name = "base_service_package_sku")
public class ServicePackageSkuDO extends UuidIdentityEntity implements Serializable {
    private String saasId;//
    private String servicePackageId;//服务包id',
    private String properties;//sku的销售属性组合字符串(颜色,大小,等等,可通过类目API获取某类目下的销售属性),格式是p1:v1;p2:v2',
    private Long quantity;//属于这个sku的商品的数量,',
    private Long price;//属于这个sku的商品的价格 取值范围:0-100000000;单位:分。如:200,表示:2元。',
    private String propertiesName;//sku所对应的销售属性的中文名字串,格式如:pid1:vid1:pid_name1:vid_name1;pid2:vid2:pid_name2:vid_name2……',
    private String barcode;//商品级别的条形码',
    private Long minPrice;//促销价',
    private Date createTime;//sku创建日期 时间格式:yyyy-MM-dd HH:mm:ss',
    private Date updateTime;//sku最后修改日期 时间格式:yyyy-MM-dd HH:mm:ss',
    private Integer del;//sku状态。 1:正常 ;0:删除',
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "service_package_id")
    public String getServicePackageId() {
        return servicePackageId;
    }
    public void setServicePackageId(String servicePackageId) {
        this.servicePackageId = servicePackageId;
    }
    public String getProperties() {
        return properties;
    }
    public void setProperties(String properties) {
        this.properties = properties;
    }
    public Long getQuantity() {
        return quantity;
    }
    public void setQuantity(Long quantity) {
        this.quantity = quantity;
    }
    public Long getPrice() {
        return price;
    }
    public void setPrice(Long price) {
        this.price = price;
    }
    @Column(name = "properties_name")
    public String getPropertiesName() {
        return propertiesName;
    }
    public void setPropertiesName(String propertiesName) {
        this.propertiesName = propertiesName;
    }
    public String getBarcode() {
        return barcode;
    }
    public void setBarcode(String barcode) {
        this.barcode = barcode;
    }
    @Column(name = "min_price")
    public Long getMinPrice() {
        return minPrice;
    }
    public void setMinPrice(Long minPrice) {
        this.minPrice = minPrice;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 84 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/statistics/DimensionDO.java

@ -0,0 +1,84 @@
package com.yihu.jw.entity.base.statistics;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 统计维度表
 * @author yeshijie on 2018/8/31.
 */
@Entity
@Table(name = "base_dimension")
public class DimensionDO extends UuidIdentityEntity implements Serializable {
    private String saasId;
    private String code;//业务代码
    private String type;//类型
    private String name;//指标名称
    private Integer status;//状态(1: 正常 0:不可以用 -1 已删除)
    private Date createTime;
    private String remark;//备注
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}

+ 86 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/statistics/DimensionQuotaDO.java

@ -0,0 +1,86 @@
package com.yihu.jw.entity.base.statistics;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 统计维度指标表
 * @author yeshijie on 2018/8/31.
 */
@Entity
@Table(name = "base_dimension_quota")
public class DimensionQuotaDO extends UuidIdentityEntity implements Serializable {
    private String saasId;
    private String quotaCode;//关联base_quota的code
    private String dimensionCode;//关联base_dimension的code
    private String dictSql;//查询字典的sql语句
    private String convertClazz;//数据转换的类
    private Integer sort;//维度顺序
    private String key;//查询出来的key
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "quota_code")
    public String getQuotaCode() {
        return quotaCode;
    }
    public void setQuotaCode(String quotaCode) {
        this.quotaCode = quotaCode;
    }
    @Column(name = "dimension_code")
    public String getDimensionCode() {
        return dimensionCode;
    }
    public void setDimensionCode(String dimensionCode) {
        this.dimensionCode = dimensionCode;
    }
    @Column(name = "dict_sql")
    public String getDictSql() {
        return dictSql;
    }
    public void setDictSql(String dictSql) {
        this.dictSql = dictSql;
    }
    @Column(name = "convert_clazz")
    public String getConvertClazz() {
        return convertClazz;
    }
    public void setConvertClazz(String convertClazz) {
        this.convertClazz = convertClazz;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
}

+ 185 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/statistics/JobConfigDO.java

@ -0,0 +1,185 @@
package com.yihu.jw.entity.base.statistics;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 统计job配置表
 * @author yeshijie on 2018/8/31.
 */
@Entity
@Table(name = "base_job_config")
public class JobConfigDO extends UuidIdentityEntity implements Serializable {
    private String saasId;
    private String jobName;//任务名称
    private String jobInfo;//任务描述
    private String jobType;//任务类型(0--单次执行  1--周期执行 2--监听任务)
    private String jobClass;//任务执行的class
    private String sql;//统计sql语句
    private String sqlCount;//统计总数语句
    private String sqlDay;//天数条件
    private String sqlYear;//年份条件
    private String cacheKey;//缓存的key
    private String quartzCron;//quartz表达式
    private String status;//1 启动 0停止
    private String quotaCode;//指标code
    private Integer del;//1: 正常 0: 删除
    private String extractType;//抽取类型   1或者为空:数据库 2ES
    private String timeLevel;//1增量 2到达量 3生成到达量也生成增量
    private Integer incrementInterval;//增量时间间隔1天,2周,3月
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "job_name")
    public String getJobName() {
        return jobName;
    }
    public void setJobName(String jobName) {
        this.jobName = jobName;
    }
    @Column(name = "job_info")
    public String getJobInfo() {
        return jobInfo;
    }
    public void setJobInfo(String jobInfo) {
        this.jobInfo = jobInfo;
    }
    @Column(name = "job_type")
    public String getJobType() {
        return jobType;
    }
    public void setJobType(String jobType) {
        this.jobType = jobType;
    }
    @Column(name = "job_class")
    public String getJobClass() {
        return jobClass;
    }
    public void setJobClass(String jobClass) {
        this.jobClass = jobClass;
    }
    public String getSql() {
        return sql;
    }
    public void setSql(String sql) {
        this.sql = sql;
    }
    @Column(name = "sql_count")
    public String getSqlCount() {
        return sqlCount;
    }
    public void setSqlCount(String sqlCount) {
        this.sqlCount = sqlCount;
    }
    @Column(name = "sql_day")
    public String getSqlDay() {
        return sqlDay;
    }
    public void setSqlDay(String sqlDay) {
        this.sqlDay = sqlDay;
    }
    @Column(name = "sql_year")
    public String getSqlYear() {
        return sqlYear;
    }
    public void setSqlYear(String sqlYear) {
        this.sqlYear = sqlYear;
    }
    @Column(name = "cache_key")
    public String getCacheKey() {
        return cacheKey;
    }
    public void setCacheKey(String cacheKey) {
        this.cacheKey = cacheKey;
    }
    @Column(name = "quartz_cron")
    public String getQuartzCron() {
        return quartzCron;
    }
    public void setQuartzCron(String quartzCron) {
        this.quartzCron = quartzCron;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    @Column(name = "quota_code")
    public String getQuotaCode() {
        return quotaCode;
    }
    public void setQuotaCode(String quotaCode) {
        this.quotaCode = quotaCode;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    @Column(name = "extract_type")
    public String getExtractType() {
        return extractType;
    }
    public void setExtractType(String extractType) {
        this.extractType = extractType;
    }
    @Column(name = "time_level")
    public String getTimeLevel() {
        return timeLevel;
    }
    public void setTimeLevel(String timeLevel) {
        this.timeLevel = timeLevel;
    }
    @Column(name = "increment_interval")
    public Integer getIncrementInterval() {
        return incrementInterval;
    }
    public void setIncrementInterval(Integer incrementInterval) {
        this.incrementInterval = incrementInterval;
    }
}

+ 65 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/statistics/QuotaDO.java

@ -0,0 +1,65 @@
package com.yihu.jw.entity.base.statistics;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 统计指标表
 * @author yeshijie on 2018/8/31.
 */
@Entity
@Table(name = "base_quota")
public class QuotaDO extends UuidIdentityEntity implements Serializable {
    private String code;//指标code',
    private String name;//指标名称',
    private String createTime;
    private String updateTime;
    private Integer del;//1: 正常 0: 删除
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "create_time")
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    @Column(name = "update_time")
    public String getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/HospitalServiceItemDO.java

@ -35,6 +35,9 @@ public class HospitalServiceItemDO extends UuidIdentityEntityWithOperator implem
    @Column(name = "status")
    private Integer status;//状态
    @Column(name = "expense")
    private Integer expense;//价格
    @Transient
    private SpecialistServiceItemDO specialistServiceItemDO;
@ -91,4 +94,13 @@ public class HospitalServiceItemDO extends UuidIdentityEntityWithOperator implem
    public void setSpecialistServiceItemDO(SpecialistServiceItemDO specialistServiceItemDO) {
        this.specialistServiceItemDO = specialistServiceItemDO;
    }
    @Column(name = "expense")
    public Integer getExpense() {
        return expense;
    }
    public void setExpense(Integer expense) {
        this.expense = expense;
    }
}

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistEvaluateDO.java

@ -48,6 +48,9 @@ public class SpecialistEvaluateDO extends UuidIdentityEntityWithOperator impleme
    @Transient
    private String labelId;//标签Id
    @Transient
    private Integer flag;//标识标签
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
@ -137,4 +140,13 @@ public class SpecialistEvaluateDO extends UuidIdentityEntityWithOperator impleme
    public void setLabelId(String labelId) {
        this.labelId = labelId;
    }
    @Transient
    public Integer getFlag() {
        return flag;
    }
    public void setFlag(Integer flag) {
        this.flag = flag;
    }
}

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistEvaluateLabelDO.java

@ -36,6 +36,9 @@ public class SpecialistEvaluateLabelDO extends UuidIdentityEntityWithOperator im
    @Column(name = "patient")
    private String patient;//患者code
    @Column(name = "flag")
    private Integer flag;//标识标签
    @Column(name = "saas_id")
    public String getSaasId() {
@ -90,4 +93,13 @@ public class SpecialistEvaluateLabelDO extends UuidIdentityEntityWithOperator im
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "flag")
    public Integer getFlag() {
        return flag;
    }
    public void setFlag(Integer flag) {
        this.flag = flag;
    }
}

+ 1 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistServiceItemDO.java

@ -73,6 +73,7 @@ public class SpecialistServiceItemDO extends UuidIdentityEntityWithOperator impl
    @Column(name = "status")
    private Integer status; //删除状态
    @Transient
    public Integer flag;

+ 13 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java

@ -15,12 +15,13 @@ import java.io.Serializable;
public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator implements Serializable {
    private String saasId;
    private String messageId;
    private String planDetailId;
    private String content;
    private String doctor;
    private String doctorName;
    private Integer doctorType;
    private String adminTeamCode;
    private Integer adminTeamCode;
    private String adminTeamName;
    @Column(name = "doctor")
@ -51,11 +52,11 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
    }
    @Column(name = "admin_team_code")
    public String getAdminTeamCode() {
    public Integer getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(String adminTeamCode) {
    public void setAdminTeamCode(Integer adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
@ -94,4 +95,13 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
    public void setContent(String content) {
        this.content = content;
    }
    @Column(name = "message_id")
    public String getMessageId() {
        return messageId;
    }
    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }
}

+ 0 - 11
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java

@ -34,8 +34,6 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
    private Integer planType;//安排类型(1康复计划,2转社区医院,3转家庭病床)
    @Column(name = "service_package_id")
    private String servicePackageId;//服务包id
    @Column(name = "service_qr_code")
    private String serviceQrCode;//服务码
    @Column(name = "status")
    private Integer status;//状态(0已中止,1进行中,2已完成)
@ -137,13 +135,4 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
    public void setDiseaseName(String diseaseName) {
        this.diseaseName = diseaseName;
    }
    @Column(name = "service_qr_code")
    public String getServiceQrCode() {
        return serviceQrCode;
    }
    public void setServiceQrCode(String serviceQrCode) {
        this.serviceQrCode = serviceQrCode;
    }
}

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java

@ -38,6 +38,8 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
    private Integer status;//状态(0未完成,1已完成,2已预约)
    @Column(name = "expense")
    private Integer expense;
    @Column(name = "service_qr_code")
    private String serviceQrCode;//服务码
    @Column(name = "saas_id")
    public String getSaasId() {
@ -137,4 +139,13 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
    public void setExpense(Integer expense) {
        this.expense = expense;
    }
    @Column(name = "service_qr_code")
    public String getServiceQrCode() {
        return serviceQrCode;
    }
    public void setServiceQrCode(String serviceQrCode) {
        this.serviceQrCode = serviceQrCode;
    }
}

+ 127 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationOperateRecordsDO.java

@ -0,0 +1,127 @@
package com.yihu.jw.entity.specialist.rehabilitation;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * Created by 刘文彬 on 2018/8/29.
 */
@Entity
@Table(name = "wlyy_rehabilitation_operate_records")
public class RehabilitationOperateRecordsDO extends UuidIdentityEntityWithOperator implements Serializable {
    private String saasId;
    private String rehabilitationDetailId;//康复计划明细表id
    private String patientCode;//居民code
    private String patientName;//居民名称
    private String doctorCode;//执行医生code
    private String doctorName;//执行医生名称
    private Integer relationRecordType;//关联记录类型(1、随访记录,2、健康指导,3、健康教育)
    private String relationRecordCode;//关联记录code
    private Date reserveTime;//服务预定完成时间
    private Date completeTime;//服务完成时间
    private Integer status;//是否确认完成(0、未确认,1、已确认)
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "rehabilitation_detail_id")
    public String getRehabilitationDetailId() {
        return rehabilitationDetailId;
    }
    public void setRehabilitationDetailId(String rehabilitationDetailId) {
        this.rehabilitationDetailId = rehabilitationDetailId;
    }
    @Column(name = "patient_code")
    public String getPatientCode() {
        return patientCode;
    }
    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
    }
    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    @Column(name = "doctor_code")
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @Column(name = "relation_record_type")
    public Integer getRelationRecordType() {
        return relationRecordType;
    }
    public void setRelationRecordType(Integer relationRecordType) {
        this.relationRecordType = relationRecordType;
    }
    @Column(name = "relation_record_code")
    public String getRelationRecordCode() {
        return relationRecordCode;
    }
    public void setRelationRecordCode(String relationRecordCode) {
        this.relationRecordCode = relationRecordCode;
    }
    @Column(name = "reserve_time")
    public Date getReserveTime() {
        return reserveTime;
    }
    public void setReserveTime(Date reserveTime) {
        this.reserveTime = reserveTime;
    }
    @Column(name = "complete_time")
    public Date getCompleteTime() {
        return completeTime;
    }
    public void setCompleteTime(Date completeTime) {
        this.completeTime = completeTime;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationPlanTemplateDO.java

@ -23,7 +23,7 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
    @Column(name = "hospital_name")
    private String hospitalName;//医院名称
    @Column(name = "admin_team_code")
    private Integer adminTeamCode;//行政团队id
    private Long adminTeamCode;//行政团队id
    @Column(name = "del")
    private Integer del;//是否删除(0是,1否)
@ -64,11 +64,11 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
    }
    @Column(name = "admin_team_code")
    public Integer getAdminTeamCode() {
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Integer adminTeamCode) {
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }

+ 43 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -137,6 +137,49 @@ public class BaseRequestMapping {
        public static final String PREFIX  = "/sms_template";
    }
    /**
     * 服务包
     */
    public static class ServicePackage extends Basic{
        public static final String PREFIX  = "/service_package";
    }
    /**
     * 康复计划
     */
    public static class BaseRehabilitation extends Basic{
        public static final String PREFIX  = "/base_rehabilitation";
        public static final String CREATELOG  = "/createlog";
        public static final String FINDBYID  = "/findFinishById";
    }
    /**
     * 统计指标
     */
    public static class Quota extends Basic{
        public static final String PREFIX  = "/quota";
    }
    /**
     * 统计维度
     */
    public static class Dimension extends Basic{
        public static final String PREFIX  = "/dimension";
    }
    /**
     * job
     */
    public static class JobConfig extends Basic{
        public static final String PREFIX  = "/job_config";
    }
    /**
     * im
     */
    public static class ImGetuiConfig extends Basic{
        public static final String PREFIX  = "/im_getui";
    }
    /**
     * 城市字典

+ 12 - 5
common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java

@ -36,8 +36,7 @@ public class SpecialistMapping {
        public static final String findDoctorAndDoctorHealthBySpecialDoctor ="/findDoctorAndDoctorHealthBySpecialDoctor";
        public static final String findSpecialistSignFamilyPatientCout ="/findSpecialistSignFamilyPatientCout";
        public static final String getSpecialistSignFamilyPatientByName ="/getSpecialistSignFamilyPatientByName";
        public static final String getPatientAndDiseaseByDoctor ="/getPatientAndDiseaseByDoctor";
@ -56,6 +55,7 @@ public class SpecialistMapping {
    public static class rehabilitation{
        public static final String findRehabilitationPlan = "/findRehabilitationPlan";
        public static final String createRehabilitationPlanTemplate = "/createRehabilitationPlanTemplate";
        public static final String deleteRehabilitationPlanTemplate = "/deleteRehabilitationPlanTemplate";
        public static final String createRehabilitationTemplateDetail = "/createRehabilitationTemplateDetail";
        public static final String findRehabilitationPlanTemplate = "/findRehabilitationPlanTemplate";
        public static final String findTemplateDetailByTemplateId = "/findTemplateDetailByTemplateId";
@ -64,9 +64,16 @@ public class SpecialistMapping {
        public static final String createServiceQrCode ="/createServiceQrCode";
        public static final String checkAfterQrCode = "checkAfterQrCode";
        public static final String findRehabilitationPlanList = "/findRehabilitationPlanList";
        public static final String findRehabilitationPlanDetailList = "/findRehabilitationPlan";
        public static final String findRehabilitationPlanDetailList = "/findRehabilitationPlanDetailList";
        public static final String calendarPlanDetail = "/calendarPlanDetail";
        public static final String calendarPlanDetailList = "/calendarPlanDetailList";
        public static final String saveGuidanceMessage = "/saveGuidanceMessage";
        public static final String serviceItemList = "/serviceItemList";
        public static final String serviceItem = "/serviceItem";
        public static final String updateStatusRehabilitationOperate = "/updateStatusRehabilitationOperate";
        public static final String patientRehabilitationDetail = "/patientRehabilitationDetail";
        public static final String recentPlanDetailRecord = "/recentPlanDetailRecord";
        public static final String findServiceItemsByHospital = "/findServiceItemsByHospital";
    }

+ 64 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/im/ImGetuiConfigVO.java

@ -0,0 +1,64 @@
package com.yihu.jw.restmodel.base.im;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
@ApiModel(value = "ImGetuiConfigVO", description = "im个推配置表")
public class ImGetuiConfigVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saas id", example = "EwC0iRSrcS")
    private String saasId;
    @ApiModelProperty(value = "个推url", example = "EwC0iRSrcS")
    private String host;
    @ApiModelProperty(value = "个推appid", example = "EwC0iRSrcS")
    private String appId;//个推appid
    @ApiModelProperty(value = "个推appkey", example = "EwC0iRSrcS")
    private String appkey;//个推appkey
    @ApiModelProperty(value = "个推的秘钥", example = "EwC0iRSrcS")
    private String mastersecret;//
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getHost() {
        return host;
    }
    public void setHost(String host) {
        this.host = host;
    }
    public String getAppId() {
        return appId;
    }
    public void setAppId(String appId) {
        this.appId = appId;
    }
    public String getAppkey() {
        return appkey;
    }
    public void setAppkey(String appkey) {
        this.appkey = appkey;
    }
    public String getMastersecret() {
        return mastersecret;
    }
    public void setMastersecret(String mastersecret) {
        this.mastersecret = mastersecret;
    }
}

+ 34 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/RehabilitationVO.java

@ -0,0 +1,34 @@
package com.yihu.jw.restmodel.base.servicePackage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
 * @author yeshijie on 2018/8/30.
 */
@ApiModel(value = "RehabilitationVO", description = "康复计划服务包")
public class RehabilitationVO implements Serializable {
    @ApiModelProperty(value = "服务包")
    private ServicePackageVO servicePackageVO;
    @ApiModelProperty(value = "服务包签约信息")
    private ServicePackageSignRecordVO signRecordVO;
    public ServicePackageVO getServicePackageVO() {
        return servicePackageVO;
    }
    public void setServicePackageVO(ServicePackageVO servicePackageVO) {
        this.servicePackageVO = servicePackageVO;
    }
    public ServicePackageSignRecordVO getSignRecordVO() {
        return signRecordVO;
    }
    public void setSignRecordVO(ServicePackageSignRecordVO signRecordVO) {
        this.signRecordVO = signRecordVO;
    }
}

+ 46 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageDetailTimeVO.java

@ -0,0 +1,46 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * 服务包明细执行时间表
 * @author yeshijie on 2018/8/17.
 */
@ApiModel(value = "ServicePackageDetailTimeVO", description = "服务包明细执行时间表")
public class ServicePackageDetailTimeVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saas id", example = "EwC0iRSrcS")
    private String saasId;
    @ApiModelProperty(value = "服务包明细id", example = "EwC0iRSrcS")
    private String detailId;//服务包明细id
    @ApiModelProperty(value = "执行时间")
    private Date excutionTime;//执行时间
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getDetailId() {
        return detailId;
    }
    public void setDetailId(String detailId) {
        this.detailId = detailId;
    }
    public Date getExcutionTime() {
        return excutionTime;
    }
    public void setExcutionTime(Date excutionTime) {
        this.excutionTime = excutionTime;
    }
}

+ 96 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageDetailsVO.java

@ -0,0 +1,96 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
@ApiModel(value = "ServicePackageDetailsVO", description = "服务包明细表")
public class ServicePackageDetailsVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saas id", example = "EwC0iRSrcS")
    private String saasId;
    @ApiModelProperty(value = "服务包id", example = "EwC0iRSrcS")
    private String servicePackageId;//服务包id',
    @ApiModelProperty(value = "服务项目编码", example = "EwC0iRSrcS")
    private String code;//服务项目编码',
    @ApiModelProperty(value = "服务项目名称", example = "康复计划")
    private String name;//服务项目名称',
    @ApiModelProperty(value = "创建时间")
    private Date createTime;//创建时间',
    @ApiModelProperty(value = "执行时间")
    private Date executionTime;//执行时间',
    @ApiModelProperty(value = "执行类型", example = "1")
    private String executionType;//执行类型(1固定时间,2固定次数(不固定时间),3长期)',
    @ApiModelProperty(value = "最少执行次数", example = "1")
    private Integer exceutionNum;//最少执行次数',
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getServicePackageId() {
        return servicePackageId;
    }
    public void setServicePackageId(String servicePackageId) {
        this.servicePackageId = servicePackageId;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getExecutionType() {
        return executionType;
    }
    public void setExecutionType(String executionType) {
        this.executionType = executionType;
    }
    public Integer getExceutionNum() {
        return exceutionNum;
    }
    public void setExceutionNum(Integer exceutionNum) {
        this.exceutionNum = exceutionNum;
    }
    public Date getExecutionTime() {
        return executionTime;
    }
    public void setExecutionTime(Date executionTime) {
        this.executionTime = executionTime;
    }
}

+ 211 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageLogVO.java

@ -0,0 +1,211 @@
package com.yihu.jw.restmodel.base.servicePackage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
/**
 * @author yeshijie on 2018/8/30.
 */
@ApiModel(value = "ServicePackageLogVO", description = "服务包日志")
public class ServicePackageLogVO implements Serializable {
    public enum Flag {
        success("成功", 0),
        failure("失败", 1);
        private String name;
        private int value;
        Flag(String name, int value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public int getValue() {
            return value;
        }
        public void setValue(int value) {
            this.value = value;
        }
    }
    public enum UserType {
        patient("居民", "1"),
        doctor("医生", "2");
        private String name;
        private String value;
        UserType(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
    }
    @ApiModelProperty(value = "uuid")
    private String id;//uuid
    @ApiModelProperty(value = "时间")
    private Date createTime;//时间
    @ApiModelProperty(value = "saasid")
    private String saasId;//saasid
    @ApiModelProperty(value = "服务包id")
    private String sevicePackageId;//服务包id
    @ApiModelProperty(value = "服务包明细id")
    private String sevicePackageDetailId;//服务包明细id
    @ApiModelProperty(value = "医生或者患者code")
    private String userCode;//医生或者患者code
    @ApiModelProperty(value = "医生或者患者name")
    private String userName;//医生或者患者name
    @ApiModelProperty(value = "1 患者 2医生")
    private String userType;// 1 患者 2医生
    @ApiModelProperty(value = "关联类型(1健康指导,2健康文章,3代预约)")
    private String relationType;//关联类型(1健康指导,2健康文章,3代预约)
    @ApiModelProperty(value = "关联id")
    private String relationId;//关联id
    @ApiModelProperty(value = "操作说明")
    private String message;//操作说明
    @ApiModelProperty(value = "操作是否成功 1成功 0失败")
    private Integer flag;//操作是否成功 1成功 0失败
    @ApiModelProperty(value = "完成项目数")
    private Integer finish;//完成项目数
    @ApiModelProperty(value = "扩展字段存json")
    private String ext;//扩展字段存json
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getSevicePackageId() {
        return sevicePackageId;
    }
    public void setSevicePackageId(String sevicePackageId) {
        this.sevicePackageId = sevicePackageId;
    }
    public String getSevicePackageDetailId() {
        return sevicePackageDetailId;
    }
    public void setSevicePackageDetailId(String sevicePackageDetailId) {
        this.sevicePackageDetailId = sevicePackageDetailId;
    }
    public String getUserCode() {
        return userCode;
    }
    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getUserType() {
        return userType;
    }
    public void setUserType(String userType) {
        this.userType = userType;
    }
    public String getRelationType() {
        return relationType;
    }
    public void setRelationType(String relationType) {
        this.relationType = relationType;
    }
    public String getRelationId() {
        return relationId;
    }
    public void setRelationId(String relationId) {
        this.relationId = relationId;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public Integer getFlag() {
        return flag;
    }
    public void setFlag(Integer flag) {
        this.flag = flag;
    }
    public Integer getFinish() {
        return finish;
    }
    public void setFinish(Integer finish) {
        this.finish = finish;
    }
    public String getExt() {
        return ext;
    }
    public void setExt(String ext) {
        this.ext = ext;
    }
}

+ 106 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageNormcatVO.java

@ -0,0 +1,106 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * 服务包类目表
 * @author yeshijie on 2018/8/29.
 */
@ApiModel(value = "ServicePackageNormcatVO", description = "服务包类目表")
public class ServicePackageNormcatVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saas id", example = "EwC0iRSrcS")
    private String saasId;
    @ApiModelProperty(value = "商品所属类目ID", example = "465")
    private Long cid;//商品所属类目ID
    @ApiModelProperty(value = "父类目ID", example = "0")
    private Long parentCid;//父类目ID=0时,代表的是一级的类目
    @ApiModelProperty(value = "类目名称", example = "服务")
    private String name;//类目名称
    @ApiModelProperty(value = "别名", example = "福")
    private String alias;//alias
    @ApiModelProperty(value = "类型图片")
    private String picUrl;//类型图片
    @ApiModelProperty(value = "分类简称")
    private String simpleName;//分类简称
    @ApiModelProperty(value = "创建时间")
    private Date createTime;//创建时间
    @ApiModelProperty(value = "状态。可选值:1(正常),0(删除)", example = "1")
    private Integer del;//状态。可选值:1(正常),0(删除)
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public Long getCid() {
        return cid;
    }
    public void setCid(Long cid) {
        this.cid = cid;
    }
    public Long getParentCid() {
        return parentCid;
    }
    public void setParentCid(Long parentCid) {
        this.parentCid = parentCid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getAlias() {
        return alias;
    }
    public void setAlias(String alias) {
        this.alias = alias;
    }
    public String getPicUrl() {
        return picUrl;
    }
    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }
    public String getSimpleName() {
        return simpleName;
    }
    public void setSimpleName(String simpleName) {
        this.simpleName = simpleName;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 156 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackagePropVO.java

@ -0,0 +1,156 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
@ApiModel(value = "ServicePackagePropVO", description = "服务包属性表")
public class ServicePackagePropVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saasId", example = "xsaasdaqq")
    private String saasId;
    @ApiModelProperty(value = "属性 id", example = "123412")
    private Long pid;//属性 ID
    @ApiModelProperty(value = "上级属性ID", example = "134")
    private Long parentPid;//上级属性ID
    @ApiModelProperty(value = "上级属性值ID", example = "1324")
    private Long parentVid;//上级属性值ID
    @ApiModelProperty(value = "属性名", example = "爱迪生")
    private String name;//属性名
    @ApiModelProperty(value = "是否关键属性", example = "1")
    private Integer isKeyProp;//是否关键属性。可选值:true(是),false(否)
    @ApiModelProperty(value = "是否销售属性", example = "1")
    private Integer isSaleProp;//是否销售属性。可选值:true(是),false(否)
    @ApiModelProperty(value = "是否商品属性", example = "1")
    private Integer isItemProp;//是否商品属性。可选值:true(是),false(否)
    @ApiModelProperty(value = "是否为必选属性", example = "1")
    private Integer must;//是否为必选属性。可选值:true(是),false(否)
    @ApiModelProperty(value = "是否可以多选", example = "1")
    private Integer multi;//是否可以多选。可选值:true(是),false(否)
    @ApiModelProperty(value = "排序", example = "1")
    private Long sortOrder;
    @ApiModelProperty(value = "类目ID", example = "123")
    private Long cid;//类目ID
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "状态。可选值:1(正常),0(删除)", example = "1")
    private Integer del;//状态。可选值:1(正常),0(删除)
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public Long getPid() {
        return pid;
    }
    public void setPid(Long pid) {
        this.pid = pid;
    }
    public Long getParentPid() {
        return parentPid;
    }
    public void setParentPid(Long parentPid) {
        this.parentPid = parentPid;
    }
    public Long getParentVid() {
        return parentVid;
    }
    public void setParentVid(Long parentVid) {
        this.parentVid = parentVid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getIsKeyProp() {
        return isKeyProp;
    }
    public void setIsKeyProp(Integer isKeyProp) {
        this.isKeyProp = isKeyProp;
    }
    public Integer getIsSaleProp() {
        return isSaleProp;
    }
    public void setIsSaleProp(Integer isSaleProp) {
        this.isSaleProp = isSaleProp;
    }
    public Integer getIsItemProp() {
        return isItemProp;
    }
    public void setIsItemProp(Integer isItemProp) {
        this.isItemProp = isItemProp;
    }
    public Integer getMust() {
        return must;
    }
    public void setMust(Integer must) {
        this.must = must;
    }
    public Integer getMulti() {
        return multi;
    }
    public void setMulti(Integer multi) {
        this.multi = multi;
    }
    public Long getSortOrder() {
        return sortOrder;
    }
    public void setSortOrder(Long sortOrder) {
        this.sortOrder = sortOrder;
    }
    public Long getCid() {
        return cid;
    }
    public void setCid(Long cid) {
        this.cid = cid;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 124 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackagePropvalueDO.java

@ -0,0 +1,124 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 服务包属性值表
 * @author yeshijie on 2018/8/29.
 */
@Entity
@Table(name = "base_service_package_propvalue")
public class ServicePackagePropvalueDO extends UuidIdentityEntity implements Serializable {
    private String saasId;
    private Long cid;//类目ID',
    private Long pid;//属性 ID',
    private String propName;//属性名',
    private Long vid;//属性值ID',
    private String name;//属性值',
    private String nameAlias;//属性值别名',
    private Integer isParent;//是否为父类目属性',
    private Long sortOrder;//排列序号。取值范围:大于零的整数',
    private Date createTime;
    private Integer del;//状态。可选值:1(正常),0(删除)',
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public Long getCid() {
        return cid;
    }
    public void setCid(Long cid) {
        this.cid = cid;
    }
    public Long getPid() {
        return pid;
    }
    public void setPid(Long pid) {
        this.pid = pid;
    }
    @Column(name = "prop_name")
    public String getPropName() {
        return propName;
    }
    public void setPropName(String propName) {
        this.propName = propName;
    }
    public Long getVid() {
        return vid;
    }
    public void setVid(Long vid) {
        this.vid = vid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "name_alias")
    public String getNameAlias() {
        return nameAlias;
    }
    public void setNameAlias(String nameAlias) {
        this.nameAlias = nameAlias;
    }
    @Column(name = "is_parent")
    public Integer getIsParent() {
        return isParent;
    }
    public void setIsParent(Integer isParent) {
        this.isParent = isParent;
    }
    @Column(name = "sort_order")
    public Long getSortOrder() {
        return sortOrder;
    }
    public void setSortOrder(Long sortOrder) {
        this.sortOrder = sortOrder;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 196 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageSignRecordVO.java

@ -0,0 +1,196 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
@ApiModel(value = "ServicePackageSignRecordVO", description = "服务包签约记录表")
public class ServicePackageSignRecordVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saasId", example = "EwC0iRSrcS")
    private String saasId;
    @ApiModelProperty(value = "服务包id", example = "EwC0iRSrcS")
    private String servicePackageId;//服务包id
    @ApiModelProperty(value = "服务包名称", example = "康复计划")
    private String servicePackageName;//服务包名称
    @ApiModelProperty(value = "居民code", example = "EwC0iRSrcS")
    private String patient;//居民code
    @ApiModelProperty(value = "居民姓名", example = "李四")
    private String name;//居民姓名
    @ApiModelProperty(value = "居民身份证", example = "350124199584724")
    private String idcard;//居民身份证
    @ApiModelProperty(value = "社保卡号", example = "568241")
    private String ssc;//社保卡号
    @ApiModelProperty(value = "签约医生code", example = "EwC0iRSrcS")
    private String signDoctor;//签约医生code
    @ApiModelProperty(value = "签约医生名称", example = "张飒")
    private String signDoctorName;//签约医生名称
    @ApiModelProperty(value = "医院code", example = "EwC0iRSrcS")
    private String hospital;//医院code
    @ApiModelProperty(value = "医院名称", example = "第一医院")
    private String hospitalName;//医院名称
    @ApiModelProperty(value = "行政团队id", example = "EwC0iRSrcS")
    private Long adminTeamCode;//行政团队id
    @ApiModelProperty(value = "服务总价", example = "445554")
    private Long price;//服务总价
    @ApiModelProperty(value = "服务开始时间")
    private Date startTime;//服务开始时间
    @ApiModelProperty(value = "服务结束时间")
    private Date endTime;//服务结束时间
    @ApiModelProperty(value = "状态(1新建,2已完成)")
    private String status;//状态(1新建,2已完成)
    @ApiModelProperty(value = "医生服务团队code", example = "EwC0iRSrcS")
    private String doctorTeamCode;//医生服务团队code
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getServicePackageId() {
        return servicePackageId;
    }
    public void setServicePackageId(String servicePackageId) {
        this.servicePackageId = servicePackageId;
    }
    public String getServicePackageName() {
        return servicePackageName;
    }
    public void setServicePackageName(String servicePackageName) {
        this.servicePackageName = servicePackageName;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
    public String getSignDoctor() {
        return signDoctor;
    }
    public void setSignDoctor(String signDoctor) {
        this.signDoctor = signDoctor;
    }
    public String getSignDoctorName() {
        return signDoctorName;
    }
    public void setSignDoctorName(String signDoctorName) {
        this.signDoctorName = signDoctorName;
    }
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    public Long getPrice() {
        return price;
    }
    public void setPrice(Long price) {
        this.price = price;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getDoctorTeamCode() {
        return doctorTeamCode;
    }
    public void setDoctorTeamCode(String doctorTeamCode) {
        this.doctorTeamCode = doctorTeamCode;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 133 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageSkuVO.java

@ -0,0 +1,133 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import java.util.Date;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
@ApiModel(value = "ServicePackageSkuVO", description = "服务包sku表")
public class ServicePackageSkuVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saasId", example = "xsaasdaqq")
    private String saasId;//
    @ApiModelProperty(value = "服务包id", example = "xsaasdaqq")
    private String servicePackageId;//服务包id',
    @ApiModelProperty(value = "sku的销售属性组合字符串", example = "p1:v1;p2:v2")
    private String properties;//sku的销售属性组合字符串(颜色,大小,等等,可通过类目API获取某类目下的销售属性),格式是p1:v1;p2:v2',
    @ApiModelProperty(value = "属于这个sku的商品的数量", example = "1234")
    private Long quantity;//属于这个sku的商品的数量,',
    @ApiModelProperty(value = "属于这个sku的商品的价格", example = "5600")
    private Long price;//属于这个sku的商品的价格 取值范围:0-100000000;单位:分。如:200,表示:2元。',
    @ApiModelProperty(value = "sku所对应的销售属性的中文名字串", example = "pid1:vid1:pid_name1:vid_name1;")
    private String propertiesName;//sku所对应的销售属性的中文名字串,格式如:pid1:vid1:pid_name1:vid_name1;pid2:vid2:pid_name2:vid_name2……',
    @ApiModelProperty(value = "商品级别的条形码", example = "xsaasdaqq")
    private String barcode;//商品级别的条形码',
    @ApiModelProperty(value = "促销价", example = "123")
    private Long minPrice;//促销价',
    @ApiModelProperty(value = "sku创建日期")
    private Date createTime;//sku创建日期 时间格式:yyyy-MM-dd HH:mm:ss',
    @ApiModelProperty(value = "sku最后修改日期")
    private Date updateTime;//sku最后修改日期 时间格式:yyyy-MM-dd HH:mm:ss',
    @ApiModelProperty(value = "sku状态。 1:正常 ;0:删除", example = "1")
    private Integer del;//sku状态。 1:正常 ;0:删除',
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "service_package_id")
    public String getServicePackageId() {
        return servicePackageId;
    }
    public void setServicePackageId(String servicePackageId) {
        this.servicePackageId = servicePackageId;
    }
    public String getProperties() {
        return properties;
    }
    public void setProperties(String properties) {
        this.properties = properties;
    }
    public Long getQuantity() {
        return quantity;
    }
    public void setQuantity(Long quantity) {
        this.quantity = quantity;
    }
    public Long getPrice() {
        return price;
    }
    public void setPrice(Long price) {
        this.price = price;
    }
    @Column(name = "properties_name")
    public String getPropertiesName() {
        return propertiesName;
    }
    public void setPropertiesName(String propertiesName) {
        this.propertiesName = propertiesName;
    }
    public String getBarcode() {
        return barcode;
    }
    public void setBarcode(String barcode) {
        this.barcode = barcode;
    }
    @Column(name = "min_price")
    public Long getMinPrice() {
        return minPrice;
    }
    public void setMinPrice(Long minPrice) {
        this.minPrice = minPrice;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 151 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageVO.java

@ -0,0 +1,151 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import java.util.Date;
import java.util.List;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
@ApiModel(value = "ServicePackageVO", description = "服务包表")
public class ServicePackageVO extends UuidIdentityVO  {
    @ApiModelProperty(value = "saasId", example = "xsaasdaqq")
    private String saasId;
    @ApiModelProperty(value = "服务包名称", example = "服务")
    private String name;//服务包名称
    @ApiModelProperty(value = "服务包类型", example = "1")
    private String type;//服务包类型
    @ApiModelProperty(value = "服务项数量", example = "20")
    private Integer num;//服务项数量
    @ApiModelProperty(value = "预售价", example = "50000")
    private Long price;//预售价//单位分
    @ApiModelProperty(value = "服务包级别(0系统,1.医生,2团队,3社区,4区)", example = "1")
    private String level;//服务包级别(0系统,1.医生,2团队,3社区,4区)
    @ApiModelProperty(value = "关联code", example = "xsaasdaqq")
    private String levelCode;//关联code
    @ApiModelProperty(value = "创建者", example = "张武1")
    private String creater;//创建者
    @ApiModelProperty(value = "创建时间")
    private Date createTime;//创建时间
    @ApiModelProperty(value = "服务介绍", example = "xsaasdaqq")
    private String introduce;//服务介绍
    @ApiModelProperty(value = "审核状态", example = "1")
    private String status;//审核状态(预留字段0待审核,1审核通过,2审核不通过)
    @ApiModelProperty(value = "是否有效(1有效,0失效)", example = "1")
    private Integer del;//是否有效(1有效,0失效)
    @ApiModelProperty(value = "服务项")
    private List<ServicePackageDetailsVO> detailsVOList;
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public Integer getNum() {
        return num;
    }
    public void setNum(Integer num) {
        this.num = num;
    }
    public Long getPrice() {
        return price;
    }
    public void setPrice(Long price) {
        this.price = price;
    }
    public String getLevel() {
        return level;
    }
    public void setLevel(String level) {
        this.level = level;
    }
    @Column(name = "level_code")
    public String getLevelCode() {
        return levelCode;
    }
    public void setLevelCode(String levelCode) {
        this.levelCode = levelCode;
    }
    public String getCreater() {
        return creater;
    }
    public void setCreater(String creater) {
        this.creater = creater;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    public List<ServicePackageDetailsVO> getDetailsVOList() {
        return detailsVOList;
    }
    public void setDetailsVOList(List<ServicePackageDetailsVO> detailsVOList) {
        this.detailsVOList = detailsVOList;
    }
}

+ 84 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/statistics/DimensionQuotaVO.java

@ -0,0 +1,84 @@
package com.yihu.jw.restmodel.base.statistics;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
@ApiModel(value = "DimensionQuotaVO", description = "统计维度指标")
public class DimensionQuotaVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saasId")
    private String saasId;
    @ApiModelProperty(value = "关联base_quota的code")
    private String quotaCode;//
    @ApiModelProperty(value = "关联base_dimension的code")
    private String dimensionCode;//
    @ApiModelProperty(value = "查询字典的sql语句")
    private String dictSql;//
    @ApiModelProperty(value = "数据转换的类")
    private String convertClazz;//
    @ApiModelProperty(value = "维度顺序")
    private Integer sort;//
    @ApiModelProperty(value = "查询出来的key")
    private String key;//
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getQuotaCode() {
        return quotaCode;
    }
    public void setQuotaCode(String quotaCode) {
        this.quotaCode = quotaCode;
    }
    public String getDimensionCode() {
        return dimensionCode;
    }
    public void setDimensionCode(String dimensionCode) {
        this.dimensionCode = dimensionCode;
    }
    public String getDictSql() {
        return dictSql;
    }
    public void setDictSql(String dictSql) {
        this.dictSql = dictSql;
    }
    public String getConvertClazz() {
        return convertClazz;
    }
    public void setConvertClazz(String convertClazz) {
        this.convertClazz = convertClazz;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
}

+ 86 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/statistics/DimensionVO.java

@ -0,0 +1,86 @@
package com.yihu.jw.restmodel.base.statistics;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * 统计维度表
 * @author yeshijie on 2018/8/31.
 */
@ApiModel(value = "DimensionVO", description = "统计维度")
public class DimensionVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saasId")
    private String saasId;
    @ApiModelProperty(value = "业务代码")
    private String code;//
    @ApiModelProperty(value = "类型")
    private String type;//
    @ApiModelProperty(value = "指标名称")
    private String name;//
    @ApiModelProperty(value = "状态(1: 正常 0:不可以用 -1 已删除)")
    private Integer status;//
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "备注")
    private String remark;//
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}

+ 184 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/statistics/JobConfigVO.java

@ -0,0 +1,184 @@
package com.yihu.jw.restmodel.base.statistics;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
@ApiModel(value = "JobConfigVO", description = "统计job配置")
public class JobConfigVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saasId")
    private String saasId;
    @ApiModelProperty(value = "任务名称")
    private String jobName;//
    @ApiModelProperty(value = "任务描述")
    private String jobInfo;//
    @ApiModelProperty(value = "任务类型(0--单次执行  1--周期执行 2--监听任务)")
    private String jobType;//
    @ApiModelProperty(value = "任务执行的class")
    private String jobClass;//
    @ApiModelProperty(value = "统计sql语句")
    private String sql;//
    @ApiModelProperty(value = "统计总数语句")
    private String sqlCount;//
    @ApiModelProperty(value = "天数条件")
    private String sqlDay;//
    @ApiModelProperty(value = "年份条件")
    private String sqlYear;//
    @ApiModelProperty(value = "缓存的key")
    private String cacheKey;//
    @ApiModelProperty(value = "quartz表达式")
    private String quartzCron;//
    @ApiModelProperty(value = "1 启动 0停止")
    private String status;//
    @ApiModelProperty(value = "指标code")
    private String quotaCode;//
    @ApiModelProperty(value = "1: 正常 0: 删除")
    private Integer del;//
    @ApiModelProperty(value = "抽取类型   1或者为空:数据库 2ES")
    private String extractType;//
    @ApiModelProperty(value = "1增量 2到达量 3生成到达量也生成增量")
    private String timeLevel;//
    @ApiModelProperty(value = "增量时间间隔1天,2周,3月")
    private Integer incrementInterval;//
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getJobName() {
        return jobName;
    }
    public void setJobName(String jobName) {
        this.jobName = jobName;
    }
    public String getJobInfo() {
        return jobInfo;
    }
    public void setJobInfo(String jobInfo) {
        this.jobInfo = jobInfo;
    }
    public String getJobType() {
        return jobType;
    }
    public void setJobType(String jobType) {
        this.jobType = jobType;
    }
    public String getJobClass() {
        return jobClass;
    }
    public void setJobClass(String jobClass) {
        this.jobClass = jobClass;
    }
    public String getSql() {
        return sql;
    }
    public void setSql(String sql) {
        this.sql = sql;
    }
    public String getSqlCount() {
        return sqlCount;
    }
    public void setSqlCount(String sqlCount) {
        this.sqlCount = sqlCount;
    }
    public String getSqlDay() {
        return sqlDay;
    }
    public void setSqlDay(String sqlDay) {
        this.sqlDay = sqlDay;
    }
    public String getSqlYear() {
        return sqlYear;
    }
    public void setSqlYear(String sqlYear) {
        this.sqlYear = sqlYear;
    }
    public String getCacheKey() {
        return cacheKey;
    }
    public void setCacheKey(String cacheKey) {
        this.cacheKey = cacheKey;
    }
    public String getQuartzCron() {
        return quartzCron;
    }
    public void setQuartzCron(String quartzCron) {
        this.quartzCron = quartzCron;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getQuotaCode() {
        return quotaCode;
    }
    public void setQuotaCode(String quotaCode) {
        this.quotaCode = quotaCode;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    public String getExtractType() {
        return extractType;
    }
    public void setExtractType(String extractType) {
        this.extractType = extractType;
    }
    public String getTimeLevel() {
        return timeLevel;
    }
    public void setTimeLevel(String timeLevel) {
        this.timeLevel = timeLevel;
    }
    public Integer getIncrementInterval() {
        return incrementInterval;
    }
    public void setIncrementInterval(Integer incrementInterval) {
        this.incrementInterval = incrementInterval;
    }
}

+ 64 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/statistics/QuotaVO.java

@ -0,0 +1,64 @@
package com.yihu.jw.restmodel.base.statistics;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
@ApiModel(value = "QuotaVO", description = "统计指标")
public class QuotaVO extends UuidIdentityVO {
    @ApiModelProperty(value = "指标code")
    private String code;//指标code
    @ApiModelProperty(value = "指标名称")
    private String name;//指标名称
    @ApiModelProperty(value = "创建时间")
    private String createTime;
    @ApiModelProperty(value = "更新时间")
    private String updateTime;
    @ApiModelProperty(value = "删除标志:1: 正常 0: 删除")
    private Integer del;//
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    public String getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 96 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/specialist/PatientDisseaseInfoVO.java

@ -0,0 +1,96 @@
package com.yihu.jw.restmodel.specialist;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * Created by humingfen on 2018/8/30.
 */
@JsonInclude(JsonInclude.Include.ALWAYS)
@ApiModel(value = "居民签约疾病信息", description = "居民签约疾病信息")
public class PatientDisseaseInfoVO {
    @ApiModelProperty("疾病")
    private String disease;
    @ApiModelProperty("疾病名称")
    private String diseaseName;
    @ApiModelProperty("居民code")
    private String patient;
    @ApiModelProperty("居民姓名")
    private String patientName;
    @ApiModelProperty("年龄")
    private String age;
    @ApiModelProperty("性别")
    private String sex;
    @ApiModelProperty("身份证")
    private String idcard;
    @ApiModelProperty("生日")
    private String  birthday;
    public String getDisease() {
        return disease;
    }
    public void setDisease(String disease) {
        this.disease = disease;
    }
    public String getDiseaseName() {
        return diseaseName;
    }
    public void setDiseaseName(String diseaseName) {
        this.diseaseName = diseaseName;
    }
    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 getAge() {
        return age;
    }
    public void setAge(String age) {
        this.age = age;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getBirthday() {
        return birthday;
    }
    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }
}

+ 10 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/Envelop.java

@ -20,6 +20,8 @@ public class Envelop implements Serializable {
    protected String message;
    @ApiModelProperty(value = "状态(200 - 成功)", example = "200")
    protected Integer status = EnvelopStatus.success.code;
    @ApiModelProperty(value = "错误码", example = "200")
    protected String errorCode;
    public Integer getStatus() {
        return status;
@ -37,6 +39,14 @@ public class Envelop implements Serializable {
        this.message = message;
    }
    public String getErrorCode() {
        return errorCode;
    }
    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
    public static Envelop getSuccess(String message) {
        Envelop envelop = new Envelop();
        envelop.setMessage(message);

+ 14 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/ObjEnvelop.java

@ -34,4 +34,18 @@ public class ObjEnvelop<J> extends Envelop {
    public void setObj(J obj) {
        this.obj = obj;
    }
    public static ObjEnvelop getSuccess(String message, Object obj) {
        ObjEnvelop envelop = new ObjEnvelop();
        envelop.setMessage(message);
        envelop.setObj(obj);
        envelop.setStatus(200);
        return envelop;
    }
    public static ObjEnvelop getError(String message) {
        ObjEnvelop envelop = new ObjEnvelop();
        envelop.setMessage(message);
        envelop.setStatus(-1);
        return envelop;
    }
}

+ 8 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java

@ -44,6 +44,14 @@ public abstract class EnvelopRestEndpoint {
        return envelop;
    }
    protected Envelop error(String message,String errorCode){
        Envelop envelop = new Envelop();
        envelop.setMessage(message);
        envelop.setErrorCode(errorCode);
        envelop.setStatus(-1);
        return envelop;
    }
    protected <J> ObjEnvelop<J> success(J obj){
        return success("success", obj);
    }

+ 71 - 0
svr/svr-base/doc/es/服务包执行日志记录索引.txt

@ -0,0 +1,71 @@
创建索引
POST  http://172.19.103.68:9200/base_service_package_log
查询索引
GET http://172.19.103.68:9200/base_service_package_log/
给索引加mapping
POST http://172.19.103.68:9200/base_service_package_log/base_service_package_log/_mapping
{
	"base_service_package_log": {
		"properties": {
			"createTime": {
			    "format": "yyyy-MM-dd HH:mm:ss",
				"type": "date"
			},
            "id": {
                "type": "string",
                "index": "not_analyzed"
            },
			"saasId": {
				"type": "string",
				"index": "not_analyzed"
			},"sevicePackageId": {
				"type": "string",
				"index": "not_analyzed"
            },"sevicePackageDetailId": {
                "type": "string",
                "index": "not_analyzed"
			},"userCode": {
                "type": "string",
                "index": "not_analyzed"
            },"userName": {
                "type": "string",
                "index": "not_analyzed"
            },"userType": {
                "type": "string",
                "index": "not_analyzed"
            },"relationType": {
                "type": "string",
                "index": "not_analyzed"
            },"relationId": {
                "type": "string",
                "index": "not_analyzed"
            },"message": {
                "type": "string",
                "index": "not_analyzed"
            },"flag": {
                "type": "integer"
            },"finish": {
				"type": "integer"
			},"ext": {
                 "type": "string",
                 "index": "not_analyzed"
            }
		}
	}
}
字段说明:
"id": uuid
"createTime": 时间
"saasId": saasid
"sevicePackageId": 服务包id
"sevicePackageDetailId": 服务包明细id
"userCode": 医生或者患者code
"userName": 医生或者患者name
"userType": 1 患者 2医生
"relationType": 关联类型(1健康指导,2健康文章,3代预约)
"relationId": 关联id
"message": 操作说明
"flag": 操作是否成功 1成功 0失败
"finish": 完成项目数
"ext": 扩展字段存json

+ 5 - 0
svr/svr-base/pom.xml

@ -100,6 +100,11 @@
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>elasticsearch-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
    </dependencies>

+ 11 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/ImGetuiConfigDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.base.dao;
import com.yihu.jw.entity.base.im.ImGetuiConfigDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/8/29.
 */
public interface ImGetuiConfigDao extends PagingAndSortingRepository<ImGetuiConfigDO, String>, JpaSpecificationExecutor<ImGetuiConfigDO> {
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
public interface ServicePackageDao extends PagingAndSortingRepository<ServicePackageDO, String>, JpaSpecificationExecutor<ServicePackageDO> {
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageDetailTimeDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDetailTimeDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
public interface ServicePackageDetailTimeDao extends PagingAndSortingRepository<ServicePackageDetailTimeDO, String>, JpaSpecificationExecutor<ServicePackageDetailTimeDO> {
}

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageDetailsDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDetailsDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
public interface ServicePackageDetailsDao extends PagingAndSortingRepository<ServicePackageDetailsDO, String>, JpaSpecificationExecutor<ServicePackageDetailsDO> {
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageNormcatDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageNormcatDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
public interface ServicePackageNormcatDao extends PagingAndSortingRepository<ServicePackageNormcatDO, String>, JpaSpecificationExecutor<ServicePackageNormcatDO> {
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackagePropDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackagePropDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
public interface ServicePackagePropDao extends PagingAndSortingRepository<ServicePackagePropDO, String>, JpaSpecificationExecutor<ServicePackagePropDO> {
}

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackagePropvalueDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackagePropvalueDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
public interface ServicePackagePropvalueDao extends PagingAndSortingRepository<ServicePackagePropvalueDO, String>, JpaSpecificationExecutor<ServicePackagePropvalueDO> {
}

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageSignRecordDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
public interface ServicePackageSignRecordDao extends PagingAndSortingRepository<ServicePackageSignRecordDO, String>, JpaSpecificationExecutor<ServicePackageSignRecordDO> {
}

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageSkuDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSkuDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
public interface ServicePackageSkuDao extends PagingAndSortingRepository<ServicePackageSkuDO, String>, JpaSpecificationExecutor<ServicePackageSkuDO> {
}

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/statistics/DimensionDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.statistics;
import com.yihu.jw.entity.base.statistics.DimensionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
public interface DimensionDao extends PagingAndSortingRepository<DimensionDO, String>, JpaSpecificationExecutor<DimensionDO> {
}

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/statistics/DimensionQuotaDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.statistics;
import com.yihu.jw.entity.base.statistics.DimensionQuotaDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
public interface DimensionQuotaDao extends PagingAndSortingRepository<DimensionQuotaDO, String>, JpaSpecificationExecutor<DimensionQuotaDO> {
}

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/statistics/JobConfigDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.statistics;
import com.yihu.jw.entity.base.statistics.JobConfigDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
public interface JobConfigDao extends PagingAndSortingRepository<JobConfigDO, String>, JpaSpecificationExecutor<JobConfigDO> {
}

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/statistics/QuotaDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.statistics;
import com.yihu.jw.entity.base.statistics.QuotaDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
public interface QuotaDao extends PagingAndSortingRepository<QuotaDO, String>, JpaSpecificationExecutor<QuotaDO> {
}

+ 94 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/im/ImGetuiConfigEndpiont.java

@ -0,0 +1,94 @@
package com.yihu.jw.base.endpoint.im;
import com.yihu.jw.base.service.ImGetuiConfigService;
import com.yihu.jw.entity.base.im.ImGetuiConfigDO;
import com.yihu.jw.restmodel.base.im.ImGetuiConfigVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * @author yeshijie on 2018/8/29.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.ImGetuiConfig.PREFIX, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "im管理", description = "im管理服务接口", tags = {"wlyy基础服务 - im管理服务接口"})
public class ImGetuiConfigEndpiont extends EnvelopRestEndpoint {
    @Autowired
    private ImGetuiConfigService imGetuiConfigService;
    @PostMapping(value = BaseRequestMapping.ImGetuiConfig.CREATE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<ImGetuiConfigVO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        ImGetuiConfigDO imGetuiConfigDO = toEntity(jsonData, ImGetuiConfigDO.class);
        imGetuiConfigDO = imGetuiConfigService.save(imGetuiConfigDO);
        return success(convertToModel(imGetuiConfigDO, ImGetuiConfigVO.class));
    }
    @PostMapping(value = BaseRequestMapping.ImGetuiConfig.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        imGetuiConfigService.delete(ids);
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.ImGetuiConfig.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<ImGetuiConfigVO> update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        ImGetuiConfigDO imGetuiConfigDO = toEntity(jsonData, ImGetuiConfigDO.class);
        if (null == imGetuiConfigDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        imGetuiConfigDO = imGetuiConfigService.save(imGetuiConfigDO);
        return success(convertToModel(imGetuiConfigDO, ImGetuiConfigVO.class));
    }
    @GetMapping(value = BaseRequestMapping.ImGetuiConfig.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<ImGetuiConfigVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<ImGetuiConfigDO> list = imGetuiConfigService.search(fields, filters, sorts, page, size);
        int count = (int)imGetuiConfigService.getCount(filters);
        return success(list, count, page, size, ImGetuiConfigVO.class);
    }
    @GetMapping(value = BaseRequestMapping.ImGetuiConfig.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<ImGetuiConfigVO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<ImGetuiConfigDO> list = imGetuiConfigService.search(fields, filters, sorts);
        return success(list, ImGetuiConfigVO.class);
    }
}

+ 70 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/RehabilitationEndpoint.java

@ -0,0 +1,70 @@
package com.yihu.jw.base.endpoint.servicePackage;
import com.yihu.jw.base.service.servicePackage.ServicePackageService;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.restmodel.base.servicePackage.RehabilitationVO;
import com.yihu.jw.restmodel.base.servicePackage.ServicePackageLogVO;
import com.yihu.jw.restmodel.base.servicePackage.ServicePackageVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
/**
 * @author yeshijie on 2018/8/30.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.BaseRehabilitation.PREFIX, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "康复计划管理", description = "康复计划管理服务接口", tags = {"wlyy基础服务 - 康复计划管理服务接口"})
public class RehabilitationEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ServicePackageService servicePackageService;
    @PostMapping(value = BaseRequestMapping.BaseRehabilitation.CREATE)
    @ApiOperation(value = "创建")
    public Envelop create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestBody String jsonData) {
        try {
            RehabilitationVO rehabilitationVO = toEntity(jsonData, RehabilitationVO.class);
            ServicePackageSignRecordDO signRecordDO = convertToModel(rehabilitationVO.getSignRecordVO(), ServicePackageSignRecordDO.class);
            ServicePackageDO servicePackageDO = servicePackageService.addRehabilitation(rehabilitationVO,signRecordDO);
            return success(convertToModel(servicePackageDO, ServicePackageVO.class));
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("创建失败");
        }
    }
    @PostMapping(value = BaseRequestMapping.BaseRehabilitation.CREATELOG)
    @ApiOperation(value = "新增服务包日志")
    public Envelop addRehabilitationLog(@ApiParam(name = "jsonData", value = "Json数据", required = true)
                          @RequestBody String jsonData){
        try{
            ServicePackageLogVO logVO = toEntity(jsonData,ServicePackageLogVO.class);
            return success(servicePackageService.addRehabilitationLog(logVO));
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("新增失败");
        }
    }
    @GetMapping(value = BaseRequestMapping.BaseRehabilitation.FINDBYID)
    @ApiOperation(value = "查找完成度")
    public Envelop getFinish(@ApiParam(name = "servicePackId", value = "服务包id", required = true)
                             @RequestParam(value = "servicePackId") String servicePackId){
        try {
            return success(servicePackageService.getFinish(servicePackId));
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("获取失败");
        }
    }
}

+ 94 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java

@ -0,0 +1,94 @@
package com.yihu.jw.base.endpoint.servicePackage;
import com.yihu.jw.base.service.servicePackage.ServicePackageService;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.restmodel.base.servicePackage.ServicePackageVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * @author yeshijie on 2018/8/29.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.ServicePackage.PREFIX, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "服务包管理", description = "服务包管理服务接口", tags = {"wlyy基础服务 - 服务包管理服务接口"})
public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ServicePackageService servicePackageService;
    @PostMapping(value = BaseRequestMapping.ServicePackage.CREATE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<ServicePackageVO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        ServicePackageDO servicePackageDO = toEntity(jsonData, ServicePackageDO.class);
        servicePackageDO = servicePackageService.save(servicePackageDO);
        return success(convertToModel(servicePackageDO, ServicePackageVO.class));
    }
    @PostMapping(value = BaseRequestMapping.ServicePackage.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        servicePackageService.delete(ids);
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.ServicePackage.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<ServicePackageVO> update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        ServicePackageDO servicePackageDO = toEntity(jsonData, ServicePackageDO.class);
        if (null == servicePackageDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        servicePackageDO = servicePackageService.save(servicePackageDO);
        return success(convertToModel(servicePackageDO, ServicePackageVO.class));
    }
    @GetMapping(value = BaseRequestMapping.ServicePackage.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<ServicePackageVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<ServicePackageDO> servicePackageDOS = servicePackageService.search(fields, filters, sorts, page, size);
        int count = (int)servicePackageService.getCount(filters);
        return success(servicePackageDOS, count, page, size, ServicePackageVO.class);
    }
    @GetMapping(value = BaseRequestMapping.ServicePackage.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<ServicePackageVO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<ServicePackageDO> servicePackageDOS = servicePackageService.search(fields, filters, sorts);
        return success(servicePackageDOS, ServicePackageVO.class);
    }
}

+ 95 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/statistics/DimensionEndpoint.java

@ -0,0 +1,95 @@
package com.yihu.jw.base.endpoint.statistics;
import com.yihu.jw.base.service.statistics.DimensionService;
import com.yihu.jw.entity.base.statistics.DimensionDO;
import com.yihu.jw.restmodel.base.statistics.DimensionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.Dimension.PREFIX, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "统计维度管理", description = "统计维度管理服务接口", tags = {"wlyy基础服务 - 统计维度管理服务接口"})
public class DimensionEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private DimensionService dimensionService;
    @PostMapping(value = BaseRequestMapping.Dimension.CREATE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<DimensionVO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        DimensionDO dimensionDO = toEntity(jsonData, DimensionDO.class);
        dimensionDO = dimensionService.save(dimensionDO);
        return success(convertToModel(dimensionDO, DimensionVO.class));
    }
    @PostMapping(value = BaseRequestMapping.Dimension.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        dimensionService.delete(ids);
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.Dimension.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<DimensionVO> update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        DimensionDO dimensionDO = toEntity(jsonData, DimensionDO.class);
        if (null == dimensionDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        dimensionDO = dimensionService.save(dimensionDO);
        return success(convertToModel(dimensionDO, DimensionVO.class));
    }
    @GetMapping(value = BaseRequestMapping.Dimension.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<DimensionVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<DimensionDO> dimensionDOList = dimensionService.search(fields, filters, sorts, page, size);
        int count = (int)dimensionService.getCount(filters);
        return success(dimensionDOList, count, page, size, DimensionVO.class);
    }
    @GetMapping(value = BaseRequestMapping.Dimension.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<DimensionVO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<DimensionDO> dimensionDOList = dimensionService.search(fields, filters, sorts);
        return success(dimensionDOList, DimensionVO.class);
    }
}

+ 95 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/statistics/JobConfigEndpoint.java

@ -0,0 +1,95 @@
package com.yihu.jw.base.endpoint.statistics;
import com.yihu.jw.base.service.statistics.JobConfigService;
import com.yihu.jw.entity.base.statistics.JobConfigDO;
import com.yihu.jw.restmodel.base.statistics.JobConfigVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.JobConfig.PREFIX, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "统计job配置管理", description = "统计job配置管理服务接口", tags = {"wlyy基础服务 - 统计job配置管理服务接口"})
public class JobConfigEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private JobConfigService jobConfigService;
    @PostMapping(value = BaseRequestMapping.ServicePackage.CREATE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<JobConfigVO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        JobConfigDO jobConfigDO = toEntity(jsonData, JobConfigDO.class);
        jobConfigDO = jobConfigService.save(jobConfigDO);
        return success(convertToModel(jobConfigDO, JobConfigVO.class));
    }
    @PostMapping(value = BaseRequestMapping.ServicePackage.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        jobConfigService.delete(ids);
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.ServicePackage.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<JobConfigVO> update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        JobConfigDO jobConfigDO = toEntity(jsonData, JobConfigDO.class);
        if (null == jobConfigDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        jobConfigDO = jobConfigService.save(jobConfigDO);
        return success(convertToModel(jobConfigDO, JobConfigVO.class));
    }
    @GetMapping(value = BaseRequestMapping.ServicePackage.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<JobConfigVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<JobConfigDO> jobConfigDOList = jobConfigService.search(fields, filters, sorts, page, size);
        int count = (int)jobConfigService.getCount(filters);
        return success(jobConfigDOList, count, page, size, JobConfigVO.class);
    }
    @GetMapping(value = BaseRequestMapping.ServicePackage.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<JobConfigVO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<JobConfigDO> jobConfigDOList = jobConfigService.search(fields, filters, sorts);
        return success(jobConfigDOList, JobConfigVO.class);
    }
}

+ 95 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/statistics/QuotaEndpoint.java

@ -0,0 +1,95 @@
package com.yihu.jw.base.endpoint.statistics;
import com.yihu.jw.base.service.statistics.QuotaService;
import com.yihu.jw.entity.base.statistics.QuotaDO;
import com.yihu.jw.restmodel.base.statistics.QuotaVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 *
 * @author yeshijie on 2018/8/31.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.Quota.PREFIX, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "统计指标管理", description = "统计指标管理服务接口", tags = {"wlyy基础服务 - 统计指标管理服务接口"})
public class QuotaEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private QuotaService quotaService;
    @PostMapping(value = BaseRequestMapping.Quota.CREATE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<QuotaVO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        QuotaDO quotaDO = toEntity(jsonData, QuotaDO.class);
        quotaDO = quotaService.save(quotaDO);
        return success(convertToModel(quotaDO, QuotaVO.class));
    }
    @PostMapping(value = BaseRequestMapping.Quota.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        quotaService.delete(ids);
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.Quota.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<QuotaVO> update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        QuotaDO quotaDO = toEntity(jsonData, QuotaDO.class);
        if (null == quotaDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        quotaDO = quotaService.save(quotaDO);
        return success(convertToModel(quotaDO, QuotaVO.class));
    }
    @GetMapping(value = BaseRequestMapping.Quota.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<QuotaVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<QuotaDO> quotaDOList = quotaService.search(fields, filters, sorts, page, size);
        int count = (int)quotaService.getCount(filters);
        return success(quotaDOList, count, page, size, QuotaVO.class);
    }
    @GetMapping(value = BaseRequestMapping.Quota.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<QuotaVO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<QuotaDO> quotaDOList = quotaService.search(fields, filters, sorts);
        return success(quotaDOList, QuotaVO.class);
    }
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/ImGetuiConfigService.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.service;
import com.yihu.jw.base.dao.ImGetuiConfigDao;
import com.yihu.jw.entity.base.im.ImGetuiConfigDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/8/29.
 */
@Service
public class ImGetuiConfigService extends BaseJpaService<ImGetuiConfigDO, ImGetuiConfigDao> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageDetailTimeService.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.service.servicePackage;
import com.yihu.jw.base.dao.servicePackage.ServicePackageDetailTimeDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDetailTimeDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
@Service
public class ServicePackageDetailTimeService extends BaseJpaService<ServicePackageDetailTimeDO, ServicePackageDetailTimeDao> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageDetailsService.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.service.servicePackage;
import com.yihu.jw.base.dao.servicePackage.ServicePackageDetailsDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDetailsDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
@Service
public class ServicePackageDetailsService extends BaseJpaService<ServicePackageDetailsDO, ServicePackageDetailsDao> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageNormcatService.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.service.servicePackage;
import com.yihu.jw.base.dao.servicePackage.ServicePackageNormcatDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackageNormcatDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
@Service
public class ServicePackageNormcatService extends BaseJpaService<ServicePackageNormcatDO, ServicePackageNormcatDao> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackagePropService.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.service.servicePackage;
import com.yihu.jw.base.dao.servicePackage.ServicePackagePropDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackagePropDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
@Service
public class ServicePackagePropService extends BaseJpaService<ServicePackagePropDO, ServicePackagePropDao> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackagePropvalueService.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.service.servicePackage;
import com.yihu.jw.base.dao.servicePackage.ServicePackagePropvalueDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackagePropvalueDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
@Service
public class ServicePackagePropvalueService extends BaseJpaService<ServicePackagePropvalueDO, ServicePackagePropvalueDao> {
}

+ 158 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java

@ -0,0 +1,158 @@
package com.yihu.jw.base.service.servicePackage;
import com.yihu.elasticsearch.ElasticSearchHelper;
import com.yihu.elasticsearch.ElasticSearchUtil;
import com.yihu.jw.base.dao.servicePackage.ServicePackageDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageDetailsDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageSignRecordDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDetailsDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.restmodel.base.servicePackage.RehabilitationVO;
import com.yihu.jw.restmodel.base.servicePackage.ServicePackageLogVO;
import com.yihu.jw.restmodel.base.servicePackage.ServicePackageVO;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ServicePackageService extends BaseJpaService<ServicePackageDO, ServicePackageDao> {
    private Logger logger = LoggerFactory.getLogger(ServicePackageService.class);
    @Autowired
    private ServicePackageDao servicePackageDao;
    @Autowired
    private ServicePackageDetailsDao servicePackageDetailsDao;
    @Autowired
    private ServicePackageSignRecordDao servicePackageSignRecordDao;
    @Autowired
    private ElasticSearchUtil elasticSearchUtil;
    @Autowired
    private ElasticSearchHelper elastricSearchHelper;
    @Value("${es.index.servicePackLog}")
    private String servicePackLongIndex;
    @Value("${es.type.servicePackLog}")
    private String servicePackLongType;
    /**
     * 新增康复计划
     */
    public ServicePackageDO addRehabilitation(RehabilitationVO rehabilitationVO,ServicePackageSignRecordDO signRecordDO) throws Exception{
        ServicePackageVO servicePackageVO = rehabilitationVO.getServicePackageVO();
        ServicePackageDO servicePackageDO = convertToModelDO(servicePackageVO);
        List<ServicePackageDetailsDO> detailsDOList = servicePackageDO.getDetailsDOList();
        //新增服务包主表
        servicePackageDO.setCreateTime(new Date());
        servicePackageDO.setDel(1);
        servicePackageDO.setLevel(ServicePackageDO.Level.doctor.getValue());
        servicePackageDO.setLevelCode(servicePackageDO.getCreater());
        servicePackageDO.setStatus(ServicePackageDO.Status.pass.getValue());
        servicePackageDO.setNum(detailsDOList.size());
        servicePackageDO.setType(ServicePackageDO.Type.rehabilitation.getValue());
        servicePackageDao.save(servicePackageDO);
        //新增服务项明细表
        detailsDOList.forEach(one->{
            one.setCreateTime(new Date());
            one.setSaasId(servicePackageDO.getSaasId());
            one.setServicePackageId(servicePackageDO.getId());
        });
        servicePackageDetailsDao.save(detailsDOList);
        //新增签约服务包记录表
        signRecordDO.setCreateTime(new Date());
        signRecordDO.setServicePackageId(servicePackageDO.getId());
        signRecordDO.setStatus(ServicePackageSignRecordDO.Status.create.getValue());
        servicePackageSignRecordDao.save(signRecordDO);
        //新增服务包日志
        ServicePackageLogVO logVO = new ServicePackageLogVO();
        logVO.setCreateTime(new Date());
        logVO.setFlag(ServicePackageLogVO.Flag.success.getValue());
        logVO.setFinish(0);
        logVO.setId(getCode());
        logVO.setMessage(signRecordDO.getSignDoctorName()+"新增了一条康复计划");
        logVO.setSaasId(servicePackageVO.getSaasId());
        logVO.setSevicePackageId(servicePackageDO.getId());
        logVO.setUserType(ServicePackageLogVO.UserType.doctor.getValue());
        logVO.setUserCode(signRecordDO.getSignDoctor());
        logVO.setUserName(signRecordDO.getSignDoctorName());
        List<ServicePackageLogVO> logVOList = new ArrayList<>(1);
        logVOList.add(logVO);
        elastricSearchHelper.save(servicePackLongIndex,servicePackLongType,logVOList);
        return servicePackageDO;
    }
    /**
     * 获取完成度
     * @param servicePackageId
     * @return
     */
    public Integer getFinish(String servicePackageId) throws Exception{
        Integer finish = 0;
        String sql = "select finish from " + servicePackLongIndex + " where servicePackageId='" + servicePackageId + "' and sevicePackageDetailId is not null order by createTime desc limit 1";
        List<Map<String, Object>> returnList = elastricSearchHelper.executeSQL(sql);
        if(returnList!=null&&returnList.size()>0){
            finish = Integer.valueOf(returnList.get(0).get("finish").toString());
        }
        return finish;
    }
    /**
     * 保存康复计划日志
     * @param logVO
     * @return
     */
    public ServicePackageLogVO addRehabilitationLog(ServicePackageLogVO logVO) throws Exception{
        logVO.setId(getCode());
        int finish = 0;
        String sql = "select finish from " + servicePackLongIndex + " where servicePackageId='" + logVO.getSevicePackageId() + "' and sevicePackageDetailId is not null order by createTime desc limit 1";
        List<Map<String, Object>> returnList = elastricSearchHelper.executeSQL(sql);
        if(returnList!=null&&returnList.size()>0){
            finish = Integer.valueOf(returnList.get(0).get("finish").toString());
            if(StringUtils.isNotBlank(logVO.getSevicePackageDetailId())){
                finish++;
            }
        }
        logVO.setCreateTime(new Date());
        logVO.setFinish(finish);
        if(logVO.getFlag()==null){
            logVO.setFlag(ServicePackageLogVO.Flag.success.getValue());
        }
        List<ServicePackageLogVO> logVOList = new ArrayList<>(1);
        logVOList.add(logVO);
        elastricSearchHelper.save(servicePackLongIndex,servicePackLongType,logVOList);
        return logVO;
    }
    /**
     * 单个转换
     * @return
     */
    public ServicePackageDO convertToModelDO(ServicePackageVO servicePackageVO){
        ServicePackageDO target = new ServicePackageDO();
        BeanUtils.copyProperties(servicePackageVO, target);
        List<ServicePackageDetailsDO> voList = convertToModels(servicePackageVO.getDetailsVOList(),new ArrayList<>(servicePackageVO.getDetailsVOList().size()),ServicePackageDetailsDO.class);
        target.setDetailsDOList(voList);
        return target;
    }
}

+ 15 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageSignRecordService.java

@ -0,0 +1,15 @@
package com.yihu.jw.base.service.servicePackage;
import com.yihu.jw.base.dao.servicePackage.ServicePackageSignRecordDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
@Service
public class ServicePackageSignRecordService extends BaseJpaService<ServicePackageSignRecordDO, ServicePackageSignRecordDao> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageSkuService.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.service.servicePackage;
import com.yihu.jw.base.dao.servicePackage.ServicePackageSkuDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSkuDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 *
 * @author yeshijie on 2018/8/29.
 */
@Service
public class ServicePackageSkuService extends BaseJpaService<ServicePackageSkuDO, ServicePackageSkuDao> {
}

+ 15 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/statistics/DimensionQuotaService.java

@ -0,0 +1,15 @@
package com.yihu.jw.base.service.statistics;
import com.yihu.jw.base.dao.statistics.DimensionQuotaDao;
import com.yihu.jw.entity.base.statistics.DimensionQuotaDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 统计维度指标表
 * @author yeshijie on 2018/8/31.
 */
@Service
public class DimensionQuotaService extends BaseJpaService<DimensionQuotaDO, DimensionQuotaDao> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/statistics/DimensionService.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.service.statistics;
import com.yihu.jw.base.dao.statistics.DimensionDao;
import com.yihu.jw.entity.base.statistics.DimensionDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 统计维度表
 * @author yeshijie on 2018/8/31.
 */
@Service
public class DimensionService extends BaseJpaService<DimensionDO, DimensionDao> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/statistics/JobConfigService.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.service.statistics;
import com.yihu.jw.base.dao.statistics.JobConfigDao;
import com.yihu.jw.entity.base.statistics.JobConfigDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 统计job配置表
 * @author yeshijie on 2018/8/31.
 */
@Service
public class JobConfigService extends BaseJpaService<JobConfigDO, JobConfigDao> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/statistics/QuotaService.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.service.statistics;
import com.yihu.jw.base.dao.statistics.QuotaDao;
import com.yihu.jw.entity.base.statistics.QuotaDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 统计指标表
 * @author yeshijie on 2018/8/31.
 */
@Service
public class QuotaService extends BaseJpaService<QuotaDO, QuotaDao> {
}

+ 31 - 1
svr/svr-base/src/main/resources/application.yml

@ -22,6 +22,19 @@ spring:
    min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
  elasticsearch: #ElasticsearchProperties
    cluster-name: jkzl #默认即为elasticsearch  集群名
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    cluster-nodes-jest: http://172.19.103.45:9200,http://172.19.103.68:9200  #多个逗号分割
    local: false #是否本地连接
    properties: # Additional properties used to configure the client.
      enable: true
  # JEST (Elasticsearch HTTP client) (JestProperties)
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
#      uris: http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
hibernate:
  dialect: org.hibernate.dialect.MySQL5Dialect
  show_sql: true
@ -30,6 +43,7 @@ hibernate:
  implicit_naming_strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl
---
spring:
  profiles: jwdev
@ -43,6 +57,12 @@ spring:
    sampler:
      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
es:
  index:
    servicePackLog: base_service_package_log
  type:
    servicePackLog: base_service_package_log
---
spring:
  profiles: jwtest
@ -56,6 +76,11 @@ spring:
    sampler:
      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
es:
  index:
    servicePackLog: base_service_package_log
  type:
    servicePackLog: base_service_package_log
---
spring:
  profiles: jwprod
@ -67,4 +92,9 @@ spring:
    base-url: http://192.168.131.173:${server.svr-logServer-port} #日志追踪的地址
  sleuth:
    sampler:
      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
es:
  index:
    servicePackLog: base_service_package_log
  type:
    servicePackLog: base_service_package_log

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/config/jpa/IotJpa.java

@ -38,7 +38,7 @@ public class IotJpa {
        LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
        emfb.setDataSource(dataSource);
        emfb.setPackagesToScan("com.yihu.jw.iot");
        emfb.setPackagesToScan("com.yihu.jw.entity.iot");
        emfb.setPersistenceUnitName("iot");
        JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        emfb.setJpaVendorAdapter(vendorAdapter);

+ 7 - 0
svr/svr-wlyy-specialist/pom.xml

@ -114,6 +114,13 @@
            <artifactId>fastdfs-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jexcelapi</groupId>
            <artifactId>jxl</artifactId>
            <version>2.6</version>
        </dependency>
    </dependencies>
    <build>

+ 13 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -311,7 +311,19 @@ public class SpecialistController extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = SpecialistMapping.specialist.getPatientAndDiseaseByDoctor)
    @ApiOperation(value = "根据医生code获取签约居民信息及签约疾病类型")
    public MixEnvelop<PatientDisseaseInfoVO, PatientDisseaseInfoVO> getPatientAndDiseaseByDoctor(
            @ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor,
            @ApiParam(name = "patientInfo", value = "居民信息") @RequestParam(required = false)String patientInfo){
        try {
            return specialistService.getPatientAndDiseaseByDoctor(doctor, patientInfo);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
//    @PostMapping(value = SpecialistMapping.specialist.createArticle)

+ 2 - 7
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistEvaluateController.java

@ -49,13 +49,8 @@ public class SpecialistEvaluateController extends EnvelopRestEndpoint {
    public MixEnvelop<SpecialistEvaluateDO,SpecialistEvaluateDO> create(@ApiParam(name = "evaluate", value = "评价")
                                                                           @RequestParam(value = "evaluate")String evaluate){
        try {
            JSONArray array = JSONArray.parseArray(evaluate);
            List<SpecialistEvaluateDO> specialistEvaluateDOS = new ArrayList<>();
            for (int i = 0;i<array.size();i++){
                SpecialistEvaluateDO specialistEvaluateDO = toEntity(array.getString(i),SpecialistEvaluateDO.class);
                specialistEvaluateDOS.add(specialistEvaluateDO);
            }
            return specialistEvaluateService.createEvaluate(specialistEvaluateDOS);
            JSONObject object = JSONObject.parseObject(evaluate);
            return specialistEvaluateService.createEvaluate(object);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

+ 19 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistServiceItemController.java

@ -12,6 +12,7 @@ import com.yihu.jw.service.SpecialistServiceItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jxl.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
@ -148,4 +149,22 @@ public class SpecialistServiceItemController extends EnvelopRestEndpoint {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 导数据
     *
     * @return
     */
    @RequestMapping(value = "importData")
    @ResponseBody
    public MixEnvelop<Boolean,Boolean> importData(@RequestBody Workbook workbook) {
        try {
            return specialistServiceItemService.importData(workbook);
        } catch (Exception e) {
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 173 - 19
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java

@ -1,6 +1,9 @@
package com.yihu.jw.controller.rehabilitation;
import com.yihu.jw.dao.rehabilitation.RehabilitationOperateRecordsDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.service.rehabilitation.RehabilitationManageService;
import io.swagger.annotations.Api;
@ -8,10 +11,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
 * Created by 刘文彬 on 2018/8/16.
@ -25,24 +25,26 @@ public class RehabilitationManageController {
    private RehabilitationManageService rehabilitationManageService;
    @Autowired
    private Tracer tracer;
    @Autowired
    private RehabilitationOperateRecordsDao rehabilitationOperateRecordsDao;
    @GetMapping(value = SpecialistMapping.rehabilitation.findRehabilitationPlanList)
    @ApiOperation(value = "康复管理-康复计划列表")
    public MixEnvelop findRehabilitationPlan(@ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)")
    public MixEnvelop findRehabilitationPlan(@ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)", required = true)
                                             @RequestParam(value = "doctorType", required = true)Integer doctorType,
                                             @ApiParam(name = "doctorCode", value = "医生code")
                                             @ApiParam(name = "doctorCode", value = "医生code", required = true)
                                             @RequestParam(value = "doctorCode", required = true)String doctorCode,
                                             @ApiParam(name = "patientCondition", value = "居民条件,可以按身份证或者居民名称模糊匹配")
                                             @ApiParam(name = "patientCondition", value = "居民条件,可以按身份证或者居民名称模糊匹配", required = false)
                                             @RequestParam(value = "patientCondition", required = false)String patientCondition,
                                             @ApiParam(name = "diseaseCode", value = "疾病类型")
                                             @ApiParam(name = "diseaseCode", value = "疾病类型code", required = false)
                                             @RequestParam(value = "diseaseCode", required = false)String diseaseCode,
                                             @ApiParam(name = "planType", value = "安排类型(1康复计划,2转社区医院,3转家庭病床)")
                                             @ApiParam(name = "planType", value = "安排类型(1康复计划,2转社区医院,3转家庭病床)", required = false)
                                             @RequestParam(value = "planType", required = false)Integer planType,
                                             @ApiParam(name = "todaybacklog", value = "今日待办(1、今日待办,2、全部)")
                                             @ApiParam(name = "todaybacklog", value = "今日待办(1、今日待办,2、全部)", required = false)
                                             @RequestParam(value = "todaybacklog", required = false,defaultValue = "1")Integer todaybacklog,
                                             @ApiParam(name = "page", value = "第几页,从1开始")
                                             @ApiParam(name = "page", value = "第几页,从1开始", required = false)
                                             @RequestParam(value = "page", required = false,defaultValue = "1")Integer page,
                                             @ApiParam(name = "pageSize", value = ",每页分页大小")
                                             @ApiParam(name = "pageSize", value = "每页分页大小", required = false)
                                             @RequestParam(value = "pageSize", required = false,defaultValue = "10")Integer pageSize){
        try {
            return rehabilitationManageService.findRehabilitationPlan(doctorType,doctorCode,diseaseCode,planType,todaybacklog,patientCondition,page,pageSize);
@ -55,17 +57,169 @@ public class RehabilitationManageController {
    @GetMapping(value = SpecialistMapping.rehabilitation.findRehabilitationPlanDetailList)
    @ApiOperation(value = "康复管理-康复计划详情列表")
    public MixEnvelop findRehabilitationPlanDetailList(@ApiParam(name = "page", value = "第几页,从1开始")
                                                       @RequestParam(value = "page", required = false,defaultValue = "1")Integer page,
                                                       @ApiParam(name = "pageSize", value = ",每页分页大小")
                                                       @RequestParam(value = "pageSize", required = false,defaultValue = "10")Integer pageSize){
    public ObjEnvelop findRehabilitationPlanDetailList(@ApiParam(name = "doctorCode", value = "医生code", required = true)
                                                       @RequestParam(value = "doctorCode", required = true)String doctorCode,
                                                       @ApiParam(name = "patientCode", value = "居民code", required = true)
                                                       @RequestParam(value = "patientCode", required = true)String patientCode){
        try {
//            return rehabilitationManageService.findRehabilitationPlanDetailList(doctorCode,diseaseCode,planType,todaybacklog,patientCondition,page,pageSize);
            return null;
            return rehabilitationManageService.findRehabilitationPlanDetailList(doctorCode,patientCode);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.calendarPlanDetail)
    @ApiOperation(value = "康复管理-康复计划按日历展示")
    public ObjEnvelop calendarPlanDetail(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                          @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                          @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                          @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                          @ApiParam(name = "planId", value = "计划id", required = true)
                                          @RequestParam(value = "planId", required = true)String planId,
                                          @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                          @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                          @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                          @RequestParam(value = "status", required = false)Integer status,
                                          @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = true)
                                          @RequestParam(value = "doctorCode", required = true)String doctorCode){
        try {
            return rehabilitationManageService.calendarPlanDetail(executeStartTime,executeEndTime,planId,searchTask,status,doctorCode);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.calendarPlanDetailList)
    @ApiOperation(value = "康复管理-康复计划按列表展示")
    public ObjEnvelop calendarPlanDetailList(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                         @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                         @ApiParam(name = "planId", value = "计划id", required = true)
                                         @RequestParam(value = "planId", required = true)String planId,
                                         @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                         @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                         @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                         @RequestParam(value = "status", required = false)Integer status,
                                         @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = true)
                                         @RequestParam(value = "doctorCode", required = true)String doctorCode){
        try {
            return rehabilitationManageService.calendarPlanDetailList(planId,searchTask,status,doctorCode,executeStartTime,executeEndTime);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.serviceItemList)
    @ApiOperation(value = "康复管理-服务项目内容列表")
    public ObjEnvelop serviceItemList(@ApiParam(name = "planDetailIds", value = "多个服务项目id用‘,’分隔", required = true)
                                             @RequestParam(value = "planDetailIds", required = true)String planDetailIds){
        try {
            return rehabilitationManageService.serviceItemList(planDetailIds);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.serviceItem)
    @ApiOperation(value = "康复管理-服务项目-完成项目内容信息")
    public ObjEnvelop serviceItem(@ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                   @RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            return rehabilitationManageService.serviceItem(planDetailId);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = SpecialistMapping.rehabilitation.saveGuidanceMessage)
    @ApiOperation(value = "康复管理-保存指导留言")
    public Envelop saveGuidanceMessage(@ApiParam(name = "messageId", value = "消息id", required = true)
                                       @RequestParam(value = "messageId", required = true)String messageId,
                                       @ApiParam(name = "patientCode", value = "居民code", required = true)
                                       @RequestParam(value = "patientCode", required = true)String patientCode,
                                       @ApiParam(name = "doctorCode", value = "医生code", required = true)
                                       @RequestParam(value = "doctorCode", required = true)String doctorCode,
                                       @ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)", required = true)
                                       @RequestParam(value = "doctorType", required = true)Integer doctorType,
                                       @ApiParam(name = "content", value = "聊天内容", required = true)
                                       @RequestParam(value = "content", required = true)String content,
                                       @ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                       @RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            return rehabilitationManageService.saveGuidanceMessage(messageId,patientCode,doctorCode,doctorType,content,planDetailId);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.updateStatusRehabilitationOperate)
    @ApiOperation(value = "康复管理-服务项目-完成项目内容信息")
    public Envelop updateStatusRehabilitationOperate(@ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                                        @RequestParam(value = "planDetailId", required = true)String planDetailId,
                                                        @ApiParam(name = "status", value = "服务项目id", required = true)
                                                        @RequestParam(value = "status", required = true)Integer status){
        try {
            if(rehabilitationOperateRecordsDao.updateStatus(status,planDetailId)>0){
                return Envelop.getSuccess(SpecialistMapping.api_success);
            }
            return Envelop.getError("update error!");
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.patientRehabilitationDetail)
    @ApiOperation(value = "康复管理-居民详情页")
    public Envelop patientRehabilitationDetail(
                                       @ApiParam(name = "patientCode", value = "居民code", required = true)
                                       @RequestParam(value = "patientCode", required = true)String patientCode,
                                       @ApiParam(name = "healthDoctor", value = "健管师医生code", required = true)
                                       @RequestParam(value = "healthDoctor", required = true)String healthDoctor,
                                       @ApiParam(name = "healthDoctorName", value = "健管师医生名称", required = true)
                                       @RequestParam(value = "healthDoctorName", required = true)String healthDoctorName,
                                       @ApiParam(name = "generalDoctor", value = "全科医生code", required = true)
                                       @RequestParam(value = "generalDoctor", required = true)String generalDoctor,
                                       @ApiParam(name = "generalDoctorName", value = "全科医生名称", required = true)
                                       @RequestParam(value = "generalDoctorName", required = true)String generalDoctorName){
        try {
            return rehabilitationManageService.patientRehabilitationDetail(patientCode,healthDoctor, healthDoctorName,generalDoctor,generalDoctorName);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.recentPlanDetailRecord)
    @ApiOperation(value = "居民康复计划详情页-近期康复相关记录")
    public Envelop recentPlanDetailRecord(
            @ApiParam(name = "patientCode", value = "居民code", required = true)
            @RequestParam(value = "patientCode", required = true)String patientCode,
            @ApiParam(name = "startTime", value = "开始时间", required = true)
            @RequestParam(value = "startTime", required = true)String startTime,
            @ApiParam(name = "endTime", value = "结束时间", required = true)
            @RequestParam(value = "endTime", required = true)String endTime){
        try {
            return rehabilitationManageService.recentPlanDetailRecord(patientCode,startTime,endTime);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return Envelop.getError(e.getMessage());
        }
    }
}

+ 42 - 17
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationPlanController.java

@ -2,16 +2,15 @@ package com.yihu.jw.controller.rehabilitation;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationDetailDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationPlanTemplateDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationTemplateDetailDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.service.rehabilitation.RehabilitationPlanService;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -22,7 +21,6 @@ import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
/**
@ -69,13 +67,13 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
    @GetMapping(value = SpecialistMapping.rehabilitation.findRehabilitationPlanTemplate)
    @ApiOperation(value = "获取康复服务套餐模板列表")
    public MixEnvelop<RehabilitationPlanTemplateDO, RehabilitationPlanTemplateDO> findRehabilitationPlanTemplate(@ApiParam(name = "adminTeamCode", value = "行政团队id")
                                                                                   @RequestParam(value = "adminTeamCode", required = true)Integer adminTeamCode,
                                                                               @ApiParam(name = "page", value = "第几页,从1开始")
                                                                              @RequestParam(value = "page", required = false)Integer page,
                                                                              @ApiParam(name = "size", value = ",每页分页大小")
                                                                              @RequestParam(value = "size", required = false)Integer size){
                                                                                   @RequestParam(value = "adminTeamCode", required = false)Long adminTeamCode,
                                                                               @ApiParam(name = "doctor", value = "专科医生")
                                                                              @RequestParam(value = "doctor", required = false)String doctor,
                                                                              @ApiParam(name = "patient", value = "患者")
                                                                              @RequestParam(value = "patient", required = false)String patient){
        try {
            return rehabilitationPlanService.findRehabilitationPlanTemplate(adminTeamCode, page, size);
            return rehabilitationPlanService.findRehabilitationPlanTemplate(adminTeamCode, doctor, patient);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -85,7 +83,7 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
    @GetMapping(value = SpecialistMapping.rehabilitation.findTemplateDetailByTemplateId)
    @ApiOperation(value = "获取康复服务套餐模板明细")
    public MixEnvelop<RehabilitationTemplateDetailDO, RehabilitationTemplateDetailDO> findTemplateDetailByTemplateId(@ApiParam(name = "templateId", value = "模板id")
    public MixEnvelop<HospitalServiceItemDO, HospitalServiceItemDO> findTemplateDetailByTemplateId(@ApiParam(name = "templateId", value = "模板id")
                                                                                      @RequestParam(value = "templateId", required = true)String templateId){
        try {
            return rehabilitationPlanService.findTemplateDetailByTemplateId(templateId);
@ -110,6 +108,19 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
        }
    }
    @PostMapping(value = SpecialistMapping.rehabilitation.deleteRehabilitationPlanTemplate)
    @ApiOperation(value = "删除康复模板")
    public MixEnvelop<Boolean, Boolean> deleteRehabilitationPlanTemplate(@ApiParam(name = "id", value = "康复模板id")
                                                                           @RequestParam(value = "id", required = true)String id){
        try {
            return rehabilitationPlanService.deleteRehabilitationPlanTemplate(id);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    /******************************** 居民康复计划 ***************************************/
    @PostMapping(value = SpecialistMapping.rehabilitation.createPatientRehabilitationPlan)
@ -154,12 +165,26 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.findServiceItemsByHospital)
    @ApiOperation(value = "获取机构服务项目列表")
    public MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> findServiceItemsByHospital(@ApiParam(name = "doctorHospital", value = "医生所在机构")
                                             @RequestParam(required = true)String doctorHospital,
                                             @ApiParam(name = "signHospital", value = "居民签约机构")
                                             @RequestParam(required = false)String signHospital){
        try {
            return rehabilitationPlanService.findServiceItemsByHospital(doctorHospital, signHospital);
        } catch (Exception e) {
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = SpecialistMapping.rehabilitation.createServiceQrCode)
    @ApiOperation(value = "根据康复计划id和居民code生成服务码")
    public MixEnvelop<String,String> createServiceQrCode(@ApiParam(name = "planId", value = "计划居民关系唯一标识")@RequestParam(value = "planId", required = true)String planId,
                                                         @ApiParam(name = "patientCode", value = "居民code")@RequestParam(value = "patientCode", required = true)String patientCode){
    public MixEnvelop<String,String> createServiceQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            return rehabilitationPlanService.createServiceQrCode(planId,patientCode);
            return rehabilitationPlanService.createServiceQrCode(planDetailId);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -169,19 +194,19 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
    @PostMapping(value = SpecialistMapping.rehabilitation.checkAfterQrCode)
    @ApiOperation(value = "居民扫码后验证是否是关联的居民扫码")
    public MixEnvelop<Boolean,Boolean> checkAfterQrCode(@ApiParam(name = "planId", value = "计划居民关系唯一标识")@RequestParam(value = "planId", required = true)String planId,
    public MixEnvelop<Boolean,Boolean> checkAfterQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                                         @ApiParam(name = "patientCode", value = "居民端登录的居民code")@RequestParam(value = "patientCode", required = true)String patientCode){
        try {
            String message="";
            Boolean flag = true;
            if (rehabilitationPlanService.checkAfterQrCode(planId,patientCode)==1){
            if (rehabilitationPlanService.checkAfterQrCode(planDetailId,patientCode)==200){
                message = "验证成功!";
            }
            if (rehabilitationPlanService.checkAfterQrCode(planId,patientCode)==-1){
            if (rehabilitationPlanService.checkAfterQrCode(planDetailId,patientCode)==-1){
                message = "请相关居民扫描二维码";
                flag=false;
            }
            if (rehabilitationPlanService.checkAfterQrCode(planId,patientCode)==-10000){
            if (rehabilitationPlanService.checkAfterQrCode(planDetailId,patientCode)==-10000){
                message = "相关康复管理数据错误,请联系工作人员!";
                flag=false;
            }

+ 3 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java

@ -16,4 +16,7 @@ public interface SpecialistPatientRelationDao extends PagingAndSortingRepository
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient =?2 and p.status>=0")
    public SpecialistPatientRelationDO findByDoctorAndPatient(String doctor,String patient);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient=?2 and p.signStatus='1' and p.status=1 ")
    SpecialistPatientRelationDO findByPatientAndDoctor(String doctor,String patient);
}

+ 6 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistServiceItemDao.java

@ -4,8 +4,11 @@ package com.yihu.jw.dao;/**
import com.yihu.jw.entity.specialist.SpecialistServiceItemDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @author wangzhinan
 * @create 2018-08-16 10:58
@ -13,4 +16,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 **/
public interface SpecialistServiceItemDao extends PagingAndSortingRepository<SpecialistServiceItemDO, String>,
        JpaSpecificationExecutor<SpecialistServiceItemDO> {
    @Query("select p from SpecialistServiceItemDO p where p.title =?1")
    public List<SpecialistServiceItemDO> findByTitle(String title);
}

+ 12 - 4
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailDao.java

@ -13,11 +13,17 @@ import java.util.List;
 */
public interface RehabilitationDetailDao extends PagingAndSortingRepository<RehabilitationDetailDO, Long>,JpaSpecificationExecutor<RehabilitationDetailDO> {
    @Query("select count(1) from RehabilitationDetailDO where status !=?1 and planId=?2 and executeTime>=?3 and executeTime<=?4 ")
    Integer todayBacklogCount(Integer status,String programId,Date executeStartTime,Date executeEndTime);
    @Query("select count(1) from RehabilitationDetailDO where status=?1 and planId=?2 ")
    Integer findByStatusAndPlanId(Integer status,String planId);
    @Query("select count(1) from RehabilitationDetailDO where status =?1 and planId=?2 ")
    Integer completenessCount(Integer status,String programId);
    @Query("select count(1) from RehabilitationDetailDO where planId=?1 ")
    Integer findAllByPlanId(String planId);
    @Query("select count(1) from RehabilitationDetailDO where planId=?1 and executeTime>=?2 and executeTime<=?3 ")
    Integer todayBacklogCount(String programId,Date executeStartTime,Date executeEndTime);
    @Query("select count(1) from RehabilitationDetailDO where status =?1 and planId=?2 and executeTime>=?3 and executeTime<=?4 ")
    Integer completenessCount(Integer status,String planId,Date executeStartTime,Date executeEndTime);
    @Query("select d from RehabilitationDetailDO d where d.planId=?1 order by d.executeTime desc")
    List<RehabilitationDetailDO> getAllRehabilitationDetail(String programId);
@ -45,4 +51,6 @@ public interface RehabilitationDetailDao extends PagingAndSortingRepository<Reha
    @Query(value ="select count(1) from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where doctor in (?1,?2) and p.patient=?3  and d.status=?4",nativeQuery = true)
    Integer completeServiceByDoctor(String generalDoctor,String healthDoctor,String patient,Integer status);
    RehabilitationDetailDO findById(String planDetailId);
}

+ 21 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationOperateRecordsDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.dao.rehabilitation;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationOperateRecordsDO;
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;
import java.util.List;
/**
 * Created by 刘文彬 on 2018/8/29.
 */
public interface RehabilitationOperateRecordsDao extends PagingAndSortingRepository<RehabilitationOperateRecordsDO, Long>,JpaSpecificationExecutor<RehabilitationOperateRecordsDO> {
    List<RehabilitationOperateRecordsDO> findByRehabilitationDetailId(String rehabilitationDetailId);
    @Modifying
    @Query("update RehabilitationOperateRecordsDO a set a.status=?1 where a.rehabilitationDetailId =?2 ")
    int updateStatus(Integer status,String rehabilitationDetailId);
}

+ 6 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationPlanTemplateDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.dao.rehabilitation;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationPlanTemplateDO;
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;
@ -10,5 +11,9 @@ import java.util.List;
public interface RehabilitationPlanTemplateDao extends PagingAndSortingRepository<RehabilitationPlanTemplateDO, Long>,JpaSpecificationExecutor<RehabilitationPlanTemplateDO> {
    @Query("select t from RehabilitationPlanTemplateDO t where t.adminTeamCode = ?1 and t.del = 1 ORDER BY t.createTime DESC ")
    List<RehabilitationPlanTemplateDO> findByAdminTeamCode(Integer adminTeamCode);
    List<RehabilitationPlanTemplateDO> findByAdminTeamCode(Long adminTeamCode);
    @Modifying
    @Query("update RehabilitationPlanTemplateDO t set t.del = 0 where t.id = ?1")
    void updateDelById(String id);
}

+ 24 - 2
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistEvaluateService.java

@ -2,6 +2,7 @@ package com.yihu.jw.service;/**
 * Created by nature of king on 2018/8/22.
 */
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dao.SpecialistEvaluateDao;
import com.yihu.jw.dao.SpecialistEvaluateLabelDao;
@ -18,6 +19,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
@ -44,11 +46,23 @@ public class SpecialistEvaluateService extends EnvelopRestEndpoint {
    /**
     * 添加评论
     *
     * @param specialistEvaluateDOList
     * @param jsonObject
     * @return
     */
    public MixEnvelop<SpecialistEvaluateDO,SpecialistEvaluateDO> createEvaluate(List<SpecialistEvaluateDO> specialistEvaluateDOList){
    public MixEnvelop<SpecialistEvaluateDO,SpecialistEvaluateDO> createEvaluate(JSONObject jsonObject) throws IOException {
        MixEnvelop<SpecialistEvaluateDO,SpecialistEvaluateDO> envelop = new MixEnvelop<>();
        JSONArray evaluate = jsonObject.getJSONArray("evaluate");
        JSONArray evaluateLabel = jsonObject.getJSONArray("evaluateLabel");
        List<SpecialistEvaluateDO> specialistEvaluateDOList = new ArrayList<>();
        List<SpecialistEvaluateLabelDO> specialistEvaluateLabelDOS = new ArrayList<>();
        for (int i = 0;i<evaluate.size();i++){
            SpecialistEvaluateDO specialistEvaluateDO = toEntity(evaluate.getJSONObject(i).toJSONString(),SpecialistEvaluateDO.class);
            specialistEvaluateDOList.add(specialistEvaluateDO);
        }
        for (int i =0;i<evaluateLabel.size();i++){
            SpecialistEvaluateLabelDO specialistEvaluateLabelDO = toEntity(evaluateLabel.getJSONObject(i).toJSONString(),SpecialistEvaluateLabelDO.class);
            specialistEvaluateLabelDOS.add(specialistEvaluateLabelDO);
        }
        String doctor = null;
        String relationCode = null;
        String patient = null;
@ -69,12 +83,20 @@ public class SpecialistEvaluateService extends EnvelopRestEndpoint {
                specialistEvaluateLabelDO.setPatient(specialistEvaluateDO1.getPatient());
                specialistEvaluateLabelDO.setEvaluateType(1);
                specialistEvaluateLabelDO.setRelationCode(specialistEvaluateDO.getRelationCode());
                specialistEvaluateLabelDO.setFlag(specialistEvaluateDO.getFlag());
                specialistEvaluateLabelDO.setCreateTime(new Date());
                specialistEvaluateLabelDO.setUpdateTime(new Date());
                specialistEvaluateLabelDao.save(specialistEvaluateLabelDO);
                total = total + specialistEvaluateDO.getScore();
            }
        }
        if (specialistEvaluateLabelDOS.size()!=0&&specialistEvaluateLabelDOS != null){
            for (SpecialistEvaluateLabelDO specialistEvaluateLabelDO:specialistEvaluateLabelDOS){
                specialistEvaluateLabelDO.setSaasId("dev");
                specialistEvaluateLabelDO.setEvaluateType(1);
                specialistEvaluateLabelDao.save(specialistEvaluateLabelDO);
            }
        }
        double score = total/3;
        BigDecimal   b   =   new   BigDecimal(score);
        double   f1   =   b.setScale(2,   BigDecimal.ROUND_HALF_UP).doubleValue();

+ 17 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -695,6 +695,23 @@ public class SpecialistService{
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRelationVOs);
    }
    public MixEnvelop<PatientDisseaseInfoVO, PatientDisseaseInfoVO> getPatientAndDiseaseByDoctor(String doctor, String patientInfo) {
        String sql = "SELECT s.*, " +
                "p.idcard, " +
                "case p.sex WHEN 1 then '男' ELSE '女' END as sex, " +
                "IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
                "p.birthday " +
                "FROM (SELECT s.disease,s.disease_name,s.patient,s.patient_name from " +
                "(SELECT id FROM wlyy_specialist_patient_relation WHERE doctor='" + doctor + "' and sign_status > 0 and `status` >= 0) r " +
                "JOIN "+basedb+".wlyy_patient_disease_server s on r.id = s.specialist_relation_code WHERE s.del = 1) s " +
                "JOIN "+basedb+".wlyy_patient p on s.patient = p.`code` where p.`status` >0 ";
        if(StringUtils.isNotBlank(patientInfo)){
            sql += " and p.idcard like '%"+ patientInfo +"%' or patient_name like '%" + patientInfo + "%'";
        }
        List<PatientDisseaseInfoVO> PatientDisseaseInfoVO = jdbcTemplate.query(sql, new BeanPropertyRowMapper(PatientDisseaseInfoVO.class));
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,PatientDisseaseInfoVO);
    }
//    public Envelop<Boolean> createSpecialists(List<SpecialistDO> info){
//        specialistDao.save(info);

+ 192 - 4
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistServiceItemService.java

@ -12,7 +12,11 @@ import com.yihu.jw.entity.specialist.SpecialistServiceItemDO;
import com.yihu.jw.entity.specialist.SpecialistServiceItemOperateLogDO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.health.bank.HealthBankMapping;
import com.yihu.jw.util.ExcelData;
import com.yihu.jw.util.ISqlUtils;
import com.yihu.jw.util.ReadExcelUtil;
import jxl.Sheet;
import jxl.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
@ -23,9 +27,7 @@ import javax.persistence.Column;
import javax.persistence.Table;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * @author wangzhinan
@ -169,7 +171,7 @@ public class SpecialistServiceItemService {
        String sql = "select * from wlyy_service_item where status = 1";
        List<SpecialistServiceItemDO> specialistServiceItemDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistServiceItemDO.class));
        for (SpecialistServiceItemDO specialistServiceItemDO:specialistServiceItemDOS){
            String sql1 = "select * from wlyy_hospital_service_item where hospital = '"+hospital+"' and serviceItemId = '"+specialistServiceItemDO.getId()+"'";
            String sql1 = "select * from wlyy_hospital_service_item where hospital = '"+hospital+"' and service_item_id = '"+specialistServiceItemDO.getId()+"'";
            List<HospitalServiceItemDO> hospitalServiceItemDOS = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(HospitalServiceItemDO.class));
            if (hospitalServiceItemDOS.size() == 0 || hospitalServiceItemDOS == null){
                specialistServiceItemDO.setFlag(1);
@ -180,4 +182,190 @@ public class SpecialistServiceItemService {
        envelop.setDetailModelList(specialistServiceItemDOS);
        return envelop;
    }
    /**
     * 导数据
     *
     * @param workbook
     * @return
     */
    public MixEnvelop<Boolean,Boolean> importData(Workbook workbook) {
        MixEnvelop<Boolean,Boolean> envelop = new MixEnvelop<>();
        Sheet[] sheets = workbook.getSheets();
        Sheet sheet = sheets[0];
        int rows = ReadExcelUtil.getRightRows(sheet);
        for (int row = 1; row < rows; row++) {  //索引从0开始,第一行为标题
            SpecialistServiceItemDO itemDO = new SpecialistServiceItemDO();
            Map<Integer, ExcelData> mapping = mapping(itemDO);
            int finalRow = row;
            mapping.forEach((index, excelData) -> {
                String value = sheet.getCell(index, finalRow).getContents().trim();
                excelData.transform(value);
            });
            //Additional Handel
            List<SpecialistServiceItemDO> specialistServiceItemDOS = specialistServiceItemDao.findByTitle(itemDO.getTitle());
           if (specialistServiceItemDOS == null && specialistServiceItemDOS.size() ==0){
               continue;
           }else {
                itemDO.setStatus(1);
                specialistServiceItemDao.save(itemDO);
           }
        }
        envelop.setObj(true);
        return envelop;
    }
    /**
     * 表格数据转为对象
     *
     * @param specialistServiceItemDO
     * @return
     */
    private Map<Integer, ExcelData> mapping(SpecialistServiceItemDO specialistServiceItemDO) {
        Map<Integer, ExcelData> dataMap = new HashMap<>();
        //项目名称
        dataMap.put(1, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setTitle(data);
            }
        });
        //项目内涵
        dataMap.put(2, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setContent(data);
            }
        });
        //除去内容
        dataMap.put(3, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setExcludeContent(data);
            }
        });
        //项目类型
        dataMap.put(4, new ExcelData() {
            @Override
            public void transform(String data) {
                Map<String, String> centerSite = new HashMap<>();
                centerSite.put("康复服务", "1");
                centerSite.put("健康服务", "2");
                specialistServiceItemDO.setItemType(Integer.parseInt(centerSite.get(data)));
            }
        });
        //医院等级
        dataMap.put(5, new ExcelData() {
            @Override
            public void transform(String data) {
                Map<String,Integer> grade = new HashMap<>();
                grade.put("所有",0);
                grade.put("一级及一级以下医疗机构",1);
                grade.put("二级医院",2);
                grade.put("三级医院",3);
                specialistServiceItemDO.setHospitalGrade(grade.get(data));
            }
        });
        //三级医院收费
        dataMap.put(6, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setThreeHospitals(Integer.parseInt(data));
            }
        });
        //二级医院收费
        dataMap.put(7, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setTwoHospitals(Integer.parseInt(data));
            }
        });
        //一级及下收费
        dataMap.put(8, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setOneHospitals(Integer.parseInt(data));
            }
        });
        //计价单位
        dataMap.put(9, new ExcelData() {
            @Override
            public void transform(String data) {
                    specialistServiceItemDO.setUnit(Integer.parseInt(data));
            }
        });
        //加收项目
        dataMap.put(10, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setAddItem(data);
            }
        });
        //病案项目
        dataMap.put(11, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setDiseaseItem(data);
            }
        });
        //是否预约
        dataMap.put(12, new ExcelData() {
            @Override
            public void transform(String data) {
                Map<String,Integer> reserve = new HashMap<>();
                reserve.put("是",1);
                reserve.put("否",0);
                specialistServiceItemDO.setReserve(reserve.get(data));
            }
        });
        //完成方式
        dataMap.put(13, new ExcelData() {
            @Override
            public void transform(String data) {
                Map<String,Integer> type = new HashMap<>();
                type.put("扫码",1);
                type.put("上传附件",0);
                type.put("健康教育",2);
                type.put("健康指导",3);
                type.put("随访",4);
                specialistServiceItemDO.setType(type.get(data));
            }
        });
        //是否评价
        dataMap.put(14, new ExcelData() {
            @Override
            public void transform(String data) {
                Map<String,Integer> evaluate = new HashMap<>();
                evaluate.put("是",1);
                evaluate.put("否",0);
                specialistServiceItemDO.setEvaluation(evaluate.get(data));
            }
        });
        //是否生效
        dataMap.put(15, new ExcelData() {
            @Override
            public void transform(String data) {
                Map<String,Integer> imediate = new HashMap<>();
                imediate.put("是",1);
                imediate.put("否",0);
                specialistServiceItemDO.setEvaluation(imediate.get(data));
            }
        });
        specialistServiceItemDO.setId(UUID.randomUUID().toString());
        return dataMap;
    }
}

+ 287 - 82
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -1,11 +1,16 @@
package com.yihu.jw.service.rehabilitation;
import com.yihu.jw.dao.SpecialistPatientRelationDao;
import com.yihu.jw.dao.rehabilitation.GuidanceMessageLogDao;
import com.yihu.jw.dao.rehabilitation.PatientRehabilitationPlanDao;
import com.yihu.jw.dao.rehabilitation.RehabilitationDetailDao;
import com.yihu.jw.dao.rehabilitation.RehabilitationOperateRecordsDao;
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
import com.yihu.jw.entity.specialist.rehabilitation.GuidanceMessageLogDO;
import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationDetailDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationOperateRecordsDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -40,6 +45,10 @@ public class RehabilitationManageService {
    private PatientRehabilitationPlanDao patientRehabilitationPlanDao;
    @Autowired
    private GuidanceMessageLogDao guidanceMessageLogDao;
    @Autowired
    private SpecialistPatientRelationDao specialistPatientRelationDao;
    @Autowired
    private RehabilitationOperateRecordsDao rehabilitationOperateRecordsDao;
    /**
     * 康复管理(专科)-- 计划列表
@ -122,22 +131,24 @@ public class RehabilitationManageService {
                case 3:planTypeName="(转)转家庭病床" ;break;
            }
            resultMap.put("planTypeName",planTypeName);
            //今日待办
            //今日待办(即今日全部的项目)
            Date beginTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"00:00:00");
            Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"23:59:59");
            Integer todayBacklogCount = rehabilitationDetailDao.todayBacklogCount(1,one.get("id").toString(),beginTime,endTime);
            Integer todayBacklogCount = rehabilitationDetailDao.todayBacklogCount(one.get("id").toString(),beginTime,endTime);
            resultMap.put("todayBacklogCount",todayBacklogCount);//今日待办总数
            //已完成
            Integer finishedCount = rehabilitationDetailDao.completenessCount(1,one.get("id").toString());
            Integer finishedCount = rehabilitationDetailDao.completenessCount(1,one.get("id").toString(),beginTime,endTime);
            resultMap.put("finishedCount",finishedCount);//已完成
            //未完成
            Integer notstartedCount = rehabilitationDetailDao.completenessCount(0,one.get("id").toString());//未开始
            Integer underwayCount = rehabilitationDetailDao.completenessCount(2,one.get("id").toString());//已预约
            Integer notstartedCount = rehabilitationDetailDao.completenessCount(0,one.get("id").toString(),beginTime,endTime);//未开始
            Integer underwayCount = rehabilitationDetailDao.completenessCount(2,one.get("id").toString(),beginTime,endTime);//已预约
            Integer unfinishedCount = notstartedCount+underwayCount;
            resultMap.put("unfinishedCount",unfinishedCount);//未完成
            //完成度(已完成/(已完成+未完成))
            resultMap.put("allCount",finishedCount+unfinishedCount);//全部
            Integer allFinishCount = rehabilitationDetailDao.findByStatusAndPlanId(1,one.get("id").toString());
            Integer allCount = rehabilitationDetailDao.findAllByPlanId(one.get("id").toString());
            resultMap.put("allCount",allCount);//总数
            resultMap.put("allFinishCount",allFinishCount);//全部已完成数
            resultList.add(resultMap);
        }
@ -244,23 +255,23 @@ public class RehabilitationManageService {
     * @return
     * @throws Exception
     */
    public MixEnvelop findRehabilitationPlanDetailList(String doctorCode,String patientCode) throws Exception{
    public ObjEnvelop findRehabilitationPlanDetailList(String doctorCode,String patientCode) throws Exception{
        Map<String,Object> resultMap = new HashMap<>();
        resultMap.put("patientCode",patientCode);//居民code
        //专科医生
        String specialistRelationSql = "select r.*,t.name as teamName from wlyy_specialist_patient_relation r left join wlyy_admin_team t on r.team_code=t.id where r.sign_status ='1' and r.status in('0','1') and r.patient='"+patientCode+"' and r.doctor='"+doctorCode+"'";
        String specialistRelationSql = "select r.*,t.name as teamName from wlyy_specialist.wlyy_specialist_patient_relation r left join "+basedb+".wlyy_admin_team t on r.team_code=t.id where r.sign_status ='1' and r.status in('0','1') and r.patient='"+patientCode+"' and r.doctor='"+doctorCode+"'";
        List<Map<String,Object>> specialistRelationList = jdbcTemplate.queryForList(specialistRelationSql);
        Map<String,Object> specialistMap = specialistRelationList.get(0);
        resultMap.put("specialistAdminTeamName",specialistMap.get("teamName"));
        String specialistFinishItemSql = "";
//        Integer familyUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(signFamilyMap.get("doctor").toString(),signFamilyMap.get("doctor_health").toString(),patientCode,1);
//        Integer familyFinishCount = rehabilitationDetailDao.findItemByDoctor(signFamilyMap.get("doctor").toString(),signFamilyMap.get("doctor_health").toString(),patientCode);
//        Integer familyServiceCount = rehabilitationDetailDao.completeServiceByDoctor(signFamilyMap.get("doctor").toString(),signFamilyMap.get("doctor_health").toString(),patientCode,1);
        resultMap.put("specialistFinishItemCount",specialistMap.get("teamName"));//完成项目
        resultMap.put("specialistServiceRecordCount",specialistMap.get("teamName"));//服务记录
        Integer specialistUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(doctorCode,patientCode,1);
        Integer specialistFinishCount = rehabilitationDetailDao.findItemByDoctor(doctorCode,patientCode);
        Integer specialistServiceCount = rehabilitationDetailDao.completeServiceByDoctor(doctorCode,patientCode,1);
        resultMap.put("specialistFinishItemCount",specialistFinishCount-specialistUnfinishCount);//完成项目
        resultMap.put("specialistServiceRecordCount",specialistServiceCount);//服务次数
        //家庭医生(包括全科医生、健管师)
        String signFamilySql = "SELECT f.*,t.name as teamName FROM wlyy.wlyy_sign_family f LEFT JOIN wlyy.wlyy_admin_team t on f.admin_team_code=t.id where f.status =1 and f.expenses_status='1' and f.patient='"+patientCode+"'";
        String signFamilySql = "SELECT f.*,t.name as teamName FROM "+basedb+".wlyy_sign_family f LEFT JOIN "+basedb+".wlyy_admin_team t on f.admin_team_code=t.id where f.status =1 and f.expenses_status='1' and f.patient='"+patientCode+"'";
        List<Map<String,Object>> signFamilyList = jdbcTemplate.queryForList(signFamilySql);
        Map<String,Object> signFamilyMap = signFamilyList.get(0);
        resultMap.put("signFamilyAdminTeamName",signFamilyMap.get("teamName"));
@ -291,6 +302,7 @@ public class RehabilitationManageService {
        List<Map<String,Object>> rehabilitationPlanList = new ArrayList<>();
        for(PatientRehabilitationPlanDO one:list){
            Map<String,Object> planMap = new HashMap<>();
            planMap.put("planId",one.getId());
            //安排类型
            String planTypeName = null;
            Integer planTypeTemp = one.getPlanType();
@ -302,25 +314,29 @@ public class RehabilitationManageService {
            planMap.put("planTypeName",planTypeName);
            planMap.put("status",one.getStatus());//0已中止,1进行中,2已完成
            //状态(0未完成,1已完成,2已预约)
            //今日待办
            Date beginTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"00:00:00");
            Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"23:59:59");
            Integer todayBacklogCount = rehabilitationDetailDao.todayBacklogCount(1,one.getId(),beginTime,endTime);
            resultMap.put("todayBacklogCount",todayBacklogCount);
            Integer todayBacklogCount = rehabilitationDetailDao.todayBacklogCount(one.getId(),beginTime,endTime);
            planMap.put("todayBacklogCount",todayBacklogCount);
            //已完成
            Integer finishedCount = rehabilitationDetailDao.completenessCount(2,one.getId());
            resultMap.put("finishedCount",finishedCount);//已完成
            Integer finishedCount = rehabilitationDetailDao.completenessCount(1,one.getId(),beginTime,endTime);
            planMap.put("finishedCount",finishedCount);//已完成
            //未完成
            Integer notstartedCount = rehabilitationDetailDao.completenessCount(1,one.getId());//未开始
            Integer underwayCount = rehabilitationDetailDao.completenessCount(1,one.getId());//进行中
            Integer notstartedCount = rehabilitationDetailDao.completenessCount(0,one.getId(),beginTime,endTime);//未完成
            Integer underwayCount = rehabilitationDetailDao.completenessCount(2,one.getId(),beginTime,endTime);//已预约
            Integer unfinishedCount = notstartedCount+underwayCount;
            resultMap.put("unfinishedCount",unfinishedCount);//未完成
            planMap.put("unfinishedCount",unfinishedCount);//未完成
            //完成度(已完成/(已完成+未完成))
            resultMap.put("allCount",finishedCount+unfinishedCount);//总数
            rehabilitationPlanList.add(resultMap);
            Integer allFinishCount = rehabilitationDetailDao.findByStatusAndPlanId(1,one.getId());
            Integer allCount = rehabilitationDetailDao.findAllByPlanId(one.getId());
            planMap.put("allCount",allCount);//总数
            planMap.put("allFinishCount",allFinishCount);//全部已完成数
            rehabilitationPlanList.add(planMap);
        }
        resultMap.put("rehabilitationPlanList",rehabilitationPlanList);
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
    }
@ -329,21 +345,21 @@ public class RehabilitationManageService {
     * @param planId 计划id
     * @param searchTask 快速查找任务(1、我的任务,2、随访,3、复诊,4、健康教育)
     * @param status 任务状态(0未完成,1已完成,2已预约)
     * @param role 1、家庭医生,2、专科医生
     * @param doctorCode 登陆医生
     */
    public MixEnvelop calendarPlan(String planId,Integer searchTask,Integer status,Integer role,String doctorCode){
        String executeStartTime = DateUtil.getFristDayOfMonth()+" "+"00:00:00";
        String executeEndTime = DateUtil.getLastDayOfMonth()+" "+"23:59:59";
        String sql = " select d.* wlyy_rehabilitation_plan_detail d " +
                "LEFT JOIN wlyy_service_item i on d.service_item_id=i.id " +
                "where d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' and d.plan_id='"+planId+"' " ;
    public ObjEnvelop calendarPlanDetail(String executeStartTime,String executeEndTime,String planId,Integer searchTask,Integer status,String doctorCode) throws Exception{
//        String executeStartTime = DateUtil.getFristDayOfMonth()+" "+"00:00:00";
//        String executeEndTime = DateUtil.getLastDayOfMonth()+" "+"23:59:59";
        String sql = " select d.* from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_service_item i on i.id = h.service_item_id " +
                " where d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' and d.plan_id='"+planId+"' " ;
        if(searchTask!=null){
            if(searchTask==1){
//                if(role==1){
//                    sql+="and d.type='"+role+"' " ;
//                }
                sql+="and d.doctor='"+doctorCode+"' " ;
                sql+=" and d.doctor='"+doctorCode+"' " ;
            }else{
                sql+=" and i.type='"+searchTask+"' " ;
            }
@ -375,7 +391,7 @@ public class RehabilitationManageService {
                    }
                    family.put("all",family.get("all")+1);
                    m.put("family",family);
                }else if((Integer)one.get("type")==2){
                }else if((Integer)one.get("type")==2){//专科医生
                    if(m.containsKey("specialist")){
@ -386,9 +402,9 @@ public class RehabilitationManageService {
                        specialist.put("finish",0);
                    }
                    if((Integer)one.get("status")!=1){
                        specialist.put("finish",((Integer)family.get("finish"))+1);
                        specialist.put("finish",(specialist.get("finish"))+1);
                    }
                    specialist.put("all",((Integer)family.get("all"))+1);
                    specialist.put("all",(specialist.get("all"))+1);
                    m.put("specialist",specialist);
                }
            }else{
@ -414,6 +430,7 @@ public class RehabilitationManageService {
                    m.put("specialist",specialist);
                }
            }
            //myTaskFlag,1:有自己任务,0:没有自己任务
            if(m.containsKey("myTaskFlag")){
                if((Integer)m.get("myTaskFlag")==0){
                    if(doctorCode.equals(one.get("doctor").toString())){
@ -425,9 +442,14 @@ public class RehabilitationManageService {
            }else{
                m.put("myTaskFlag",0);
            }
            if(m.containsKey("planDetailIds")){
                m.put("planDetailIds",m.get("planDetailIds")+","+one.get("id"));
            }else{
                m.put("planDetailIds",one.get("id")+"");
            }
            map.put(executeTime,m);
        }
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,map);
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,map);
    }
    /**
@ -437,11 +459,12 @@ public class RehabilitationManageService {
     * @param status 任务状态(0未完成,1已完成,2已预约)
     * @param doctorCode 登陆医生
     */
    public MixEnvelop calendarPlanList(String planId,Integer searchTask,Integer status,String doctorCode,String executeStartTime,String executeEndTime,Integer page,Integer pageSize){
    public ObjEnvelop calendarPlanDetailList(String planId,Integer searchTask,Integer status,String doctorCode,String executeStartTime,String executeEndTime){
        String sql = " select d.* wlyy_rehabilitation_plan_detail d " +
                "LEFT JOIN wlyy_service_item i on d.service_item_id=i.id " +
                "where d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' and d.plan_id='"+planId+"' " ;
        String sql = " select d.*,i.content,i.title from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_service_item i on i.id = h.service_item_id " +
                " where d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' and d.plan_id='"+planId+"' " ;
        if(searchTask!=null){
            if(searchTask==1){
                sql+="and d.doctor='"+doctorCode+"' ";
@ -453,32 +476,41 @@ public class RehabilitationManageService {
            sql+= "and d.status="+status;
        }
        List<Map<String,Object>> rehabilitationDetailList = jdbcTemplate.queryForList(sql);
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,rehabilitationDetailList);
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,rehabilitationDetailList);
    }
    /**
     *
     * @param planDetailId
     * 服务项目内容列表
     * @param planDetailIds
     * @return
     * @throws Exception
     */
    public MixEnvelop serviceItemList(String planDetailId) throws Exception{
        String sql = "select i.title,i.content,d.execute_time,d.hospital_name,d.status,d.type,d.expense,p.doctor " +
                " from wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_service_item i on d.service_item_id=i.id " +
                " LEFT JOIN wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " where d.id='"+planDetailId+"'";
    public ObjEnvelop serviceItemList(String planDetailIds) throws Exception{
        String[] s = planDetailIds.split(",");
        String planDetailList = "";
        for(String one:s){
            planDetailList +=",'"+one+"'";
        }
        String planDetailResult = StringUtils.isNotEmpty(planDetailList)?planDetailList.substring(1):"";
        String sql = "select i.title,i.content,i.type,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,p.doctor,p.patient " +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_specialist.wlyy_service_item i on i.id = h.service_item_id " +
                " LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " where d.id in ("+planDetailResult+")";
        List<Map<String,Object>> serviceItemList = jdbcTemplate.queryForList(sql);
        Map<String,Object> resultMap = new HashMap<>();
        if(serviceItemList.size()>0){
            Map<String,Object> serviceItem = serviceItemList.get(0);
            resultMap.put("title",serviceItem.get("title"));//项目标题
            resultMap.put("shortExecuteTime",DateUtil.dateToStr((Date) serviceItem.get("execute_time"),DateUtil.HH_MM));//项目标题
            resultMap.put("content",serviceItem.get("content"));//项目内容
            resultMap.put("hospitalName",serviceItem.get("hospital_name"));//地点
            resultMap.put("executeTime",serviceItem.get("execute_time"));//执行时间
            resultMap.put("expense",serviceItem.get("expense"));//收费
            Integer status = Integer.valueOf(serviceItem.get("status").toString());//状态(0未完成,1已完成,2已预约)
//        if(serviceItemList.size()>0){
//            Map<String,Object> serviceItem = serviceItemList.get(0);
        List<Map<String,Object>> resultList = new ArrayList<>();
        for(Map<String,Object> one:serviceItemList){
            Map<String,Object> resultMap = new HashMap<>();
            resultMap.put("title",one.get("title"));//项目标题
            resultMap.put("shortExecuteTime",DateUtil.dateToStr((Date) one.get("execute_time"),DateUtil.HH_MM));//项目标题
            resultMap.put("content",one.get("content"));//项目内容
            resultMap.put("hospitalName",one.get("hospital_name"));//地点
            resultMap.put("executeTime",one.get("execute_time"));//执行时间
            resultMap.put("expense",one.get("expense"));//收费
            Integer status = Integer.valueOf(one.get("status").toString());//状态(0未完成,1已完成,2已预约)
            String statusName = "";
            switch (status){
                case 0:{statusName="未完成";break;}
@ -487,24 +519,102 @@ public class RehabilitationManageService {
            }
            resultMap.put("statusName",statusName);//状态
            //指导与汇报
            List<GuidanceMessageLogDO> messageList = guidanceMessageLogDao.findByPlanDetailId(planDetailId);
            List<GuidanceMessageLogDO> messageList = guidanceMessageLogDao.findByPlanDetailId(one.get("id").toString());
            List<Map<String,Object>> messageMapList = new ArrayList<>();
            for(GuidanceMessageLogDO one:messageList){
            for(GuidanceMessageLogDO one2:messageList){
                Map<String,Object> map = new HashMap<>();
                map.put("doctorName",one.getDoctorName());
                map.put("adminTeamName",one.getAdminTeamName());
                map.put("content",one.getContent());
                map.put("createTime",DateUtil.dateToStr(one.getCreateTime(),"MM-dd HH:mm"));
                map.put("doctorName",one2.getDoctorName());
                map.put("adminTeamName",one2.getAdminTeamName());
                map.put("content",one2.getContent());
                map.put("createTime",DateUtil.dateToStr(one2.getCreateTime(),"MM-dd HH:mm"));
                messageMapList.add(map);
            }
            resultMap.put("messageList",messageMapList);//指导与汇报记录
            return MixEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
            resultMap.put("patient",one.get("patient"));
            resultMap.put("type",one.get("type"));
            //是否完成任务
            List<RehabilitationOperateRecordsDO> operateList = rehabilitationOperateRecordsDao.findByRehabilitationDetailId(one.get("id").toString());
            Integer operate = 0;
            if(operateList.size()>0){
                operate =1;
            }
            resultMap.put("operate",operate);//是否完成任务(默认0:未完成,1:已完成)
            resultList.add(resultMap);
         }
            return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultList);
//        }
//        return MixEnvelop.getError("没有该服务项详情信息!");
    }
    /**
     * 单个服务项目内容
     * @param planDetailId
     * @return
     * @throws Exception
     */
    public ObjEnvelop serviceItem(String planDetailId) throws Exception{
        String sql = "select i.title,i.content,i.type,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,p.doctor,p.patient " +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_specialist.wlyy_service_item i on i.id = h.service_item_id " +
                " LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " where d.id = '"+planDetailId+"'";
        List<Map<String,Object>> serviceItemList = jdbcTemplate.queryForList(sql);
        Map<String,Object> one = serviceItemList.get(0);
        Map<String,Object> resultMap = new HashMap<>();
        resultMap.put("title",one.get("title"));//项目标题
        resultMap.put("shortExecuteTime",DateUtil.dateToStr((Date) one.get("execute_time"),DateUtil.HH_MM));//项目标题
        resultMap.put("content",one.get("content"));//项目内容
        resultMap.put("hospitalName",one.get("hospital_name"));//地点
        resultMap.put("executeTime",one.get("execute_time"));//执行时间
        resultMap.put("expense",one.get("expense"));//收费
        Integer status = Integer.valueOf(one.get("status").toString());//状态(0未完成,1已完成,2已预约)
        String statusName = "";
        switch (status){
            case 0:{statusName="未完成";break;}
            case 1:{statusName="已完成";break;}
            case 2:{statusName="已预约";break;}
        }
        resultMap.put("statusName",statusName);//状态
        //指导与汇报
        List<GuidanceMessageLogDO> messageList = guidanceMessageLogDao.findByPlanDetailId(one.get("id").toString());
        List<Map<String,Object>> messageMapList = new ArrayList<>();
        for(GuidanceMessageLogDO one2:messageList){
            Map<String,Object> map = new HashMap<>();
            map.put("doctorName",one2.getDoctorName());
            map.put("adminTeamName",one2.getAdminTeamName());
            map.put("content",one2.getContent());
            map.put("createTime",DateUtil.dateToStr(one2.getCreateTime(),"MM-dd HH:mm"));
            messageMapList.add(map);
        }
        Integer type = (Integer) one.get("type");
        resultMap.put("messageList",messageMapList);//指导与汇报记录
        resultMap.put("patient",one.get("patient"));
        resultMap.put("type",type);//1扫码、0上传附件、2、健康教育,3、健康指导,4、随访
        //是否完成任务
        List<RehabilitationOperateRecordsDO> operateList = rehabilitationOperateRecordsDao.findByRehabilitationDetailId(one.get("id").toString());
        Integer operate = 0;
        if(operateList.size()>0){
            RehabilitationOperateRecordsDO temp = operateList.get(0);
            operate =1;
            Date completeTime = temp.getCompleteTime();
            String completeTimeStr = DateUtil.dateToStr(completeTime,DateUtil.YYYY_MM_DD_HH_MM);
            resultMap.put("completeTime",completeTimeStr);//完成时间
            resultMap.put("operatorDoctorName",temp.getDoctorName());//执行医生名称
            if(type!=1||type!=0){
                resultMap.put("relationRecordCode",temp.getRelationRecordCode());
                resultMap.put("completeTimeShort",DateUtil.dateToStr(completeTime,DateUtil.YYYY_MM_DD));
            }
        }
        return MixEnvelop.getError("没有该服务项详情信息!");
        resultMap.put("operate",operate);//是否完成任务(默认0:未完成,1:已完成)
        //完成信息
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
    }
    /**
     * 居民详情新增康复管理
     * 康复管理居民详情页
     * @param patientCode
     * @param healthDoctor
     * @param healthDoctorName
@ -512,7 +622,7 @@ public class RehabilitationManageService {
     * @param generalDoctorName
     * @return
     */
    public MixEnvelop patientRehabilitationDetail(String patientCode,String healthDoctor,String healthDoctorName,String generalDoctor,String generalDoctorName){
    public ObjEnvelop patientRehabilitationDetail(String patientCode,String healthDoctor,String healthDoctorName,String generalDoctor,String generalDoctorName){
        Map<String,Object> resultMap = new HashMap<>();
@ -599,15 +709,16 @@ public class RehabilitationManageService {
            map.put("planTypeName",planTypeName);//安排类型名称
            map.put("statusName",statusName);//状态名称
            //已完成
            Integer finishedCount = rehabilitationDetailDao.completenessCount(2,one.getId());
            map.put("finishedCount",finishedCount);//已完成
            //未完成
            Integer notstartedCount = rehabilitationDetailDao.completenessCount(1,one.getId());//未开始
            Integer underwayCount = rehabilitationDetailDao.completenessCount(1,one.getId());//进行中
            Integer unfinishedCount = notstartedCount+underwayCount;
            map.put("unfinishedCount",unfinishedCount);//未完成
            Integer allFinishCount = rehabilitationDetailDao.findByStatusAndPlanId(2,one.getId());
            map.put("allFinishCount",allFinishCount);//已完成
//            //未完成
//            Integer notstartedCount = rehabilitationDetailDao.completenessCount(1,one.getId());//未开始
//            Integer underwayCount = rehabilitationDetailDao.completenessCount(1,one.getId());//进行中
//            Integer unfinishedCount = notstartedCount+underwayCount;
//            map.put("unfinishedCount",unfinishedCount);//未完成
            //完成度(已完成/(已完成+未完成))
            map.put("allCount",finishedCount+unfinishedCount);//总数
            Integer allCount = rehabilitationDetailDao.findAllByPlanId(one.getId());
            map.put("allCount",allCount);//总数
            List<RehabilitationDetailDO> detailList = rehabilitationDetailDao.getAllRehabilitationDetail(one.getId());
            Date executeTimeStart = detailList.get(0).getExecuteTime();
            Date executeTimeEnd = detailList.get(detailList.size()-1).getExecuteTime();
@ -621,10 +732,65 @@ public class RehabilitationManageService {
        resultMap.put("planUnderway",planUnderway);//进行中
        resultMap.put("planFinish",planFinish);//已完成
//        //近期康复相关记录
////        String currentTime = DateUtil.getStringDate();
//        String planDetailSql = " select d.*,i.content,i.title from wlyy_specialist.wlyy_rehabilitation_plan_detail d LEFT JOIN wlyy_hospital_service_item h on d.hospital_service_item_id=h.id" +
//                " LEFT JOIN wlyy_service_item i on i.id=h.service_item_id LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where p.patient='"+patientCode+"' and d.executeTime<='"+currentTime+"' order by executeTime desc";
//        List<Map<String,Object>> planDetails = jdbcTemplate.queryForList(planDetailSql);
//        List<Map<String,Object>> planDetailList = new ArrayList<>();
//        for(Map<String,Object> one:planDetails){
//            Date executeTimeDate = (Date)one.get("execute_time");
//            String executeTime = DateUtil.dateToStr(executeTimeDate,"yyyy/MM/dd HH:mm");
//            String content = one.get("content").toString();
//            String title = one.get("title").toString();
//            Integer status = (Integer)one.get("status");
//            String statusName = "";
//            switch (status){
//                case 0:{statusName="未完成";break;}
//                case 1:{statusName="已完成";break;}
//                case 2:{statusName="已预约";break;}
//            }
//            String id = one.get("id").toString();
//            Map<String,Object> map = new HashMap<>();
//            map.put("id",id);//id
//            map.put("executeTime",executeTime);//执行时间
//            map.put("title",title);//项目标题
//            map.put("content",content);//项目内容
//            map.put("statusName",statusName);//状态名称
//            planDetailList.add(map);
//        }
//        resultMap.put("planDetailList",planDetailList);//康复相关记录列表
//        String planDetailCountSql = " select d.status as num from wlyy_specialist.wlyy_rehabilitation_plan_detail d LEFT JOIN wlyy_hospital_service_item h on d.hospital_service_item_id=h.id" +
//                " LEFT JOIN wlyy_service_item i on i.id=h.service_item_id LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where p.patient='"+patientCode+"'";
//        List<Map<String,Object>> planDetailList2 = jdbcTemplate.queryForList(planDetailCountSql);
//        Integer planDetailFinish = 0;
//        Integer planDetailUnfinish = 0;
//        for(Map<String,Object> one:planDetailList2){
//
//            Integer status = (Integer)one.get("status");
//            if(status==1){
//                planDetailFinish+=1;
//            }else{
//                planDetailUnfinish+=1;
//            }
//        }
//        resultMap.put("planDetailFinish",planDetailFinish);//已完成
//        resultMap.put("planDetailUnfinish",planDetailUnfinish);//未完成
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
    }
    /**
     * 居民康复计划详情页-近期康复相关记录
     * @param patientCode
     * @param startTime
     * @param endTime
     */
    public ObjEnvelop recentPlanDetailRecord(String patientCode,String startTime,String endTime){
        Map<String,Object> resultMap = new HashMap<>();
        //近期康复相关记录
        String currentTime = DateUtil.getStringDate();
//        String currentTime = DateUtil.getStringDate();
        String planDetailSql = " select d.*,i.content,i.title from wlyy_specialist.wlyy_rehabilitation_plan_detail d LEFT JOIN wlyy_hospital_service_item h on d.hospital_service_item_id=h.id" +
                " LEFT JOIN wlyy_service_item i on i.id=h.service_item_id LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where p.patient='"+patientCode+"' and d.executeTime<='"+currentTime+"' order by executeTime desc";
                " LEFT JOIN wlyy_service_item i on i.id=h.service_item_id LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where p.patient='"+patientCode+"' and d.executeTime>='"+startTime+"' and d.executeTime<='"+endTime+"' order by executeTime desc";
        List<Map<String,Object>> planDetails = jdbcTemplate.queryForList(planDetailSql);
        List<Map<String,Object>> planDetailList = new ArrayList<>();
        for(Map<String,Object> one:planDetails){
@ -665,6 +831,45 @@ public class RehabilitationManageService {
        }
        resultMap.put("planDetailFinish",planDetailFinish);//已完成
        resultMap.put("planDetailUnfinish",planDetailUnfinish);//未完成
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
    }
    /**
     * 保存康复管理指导留言信息
     * @param messageId
     * @param patient
     * @param doctor
     * @param doctorType 1、专科医生,2、家庭医生
     */
    @Transactional
    public Envelop saveGuidanceMessage(String messageId,String patient,String doctor,Integer doctorType,String content,String planDetailId){
        GuidanceMessageLogDO guidanceMessageLogDO = new GuidanceMessageLogDO();
        guidanceMessageLogDO.setMessageId(messageId);
        guidanceMessageLogDO.setPlanDetailId(planDetailId);
        guidanceMessageLogDO.setContent(content);
        guidanceMessageLogDO.setDoctor(doctor);
        guidanceMessageLogDO.setDoctorType(doctorType);
        Integer adminTeamCode = null;
        String doctorName = null;
        if(doctorType==1){
            SpecialistPatientRelationDO specialistPatientRelationDO = specialistPatientRelationDao.findByPatientAndDoctor(doctor,patient);
            adminTeamCode = specialistPatientRelationDO.getTeamCode();
            doctorName = specialistPatientRelationDO.getDoctorName();
        }else if(doctorType==2){
            String signFamilySql = " select f.* from "+basedb+".wlyy_sign_family f where f.status=1 and f.expenses_status='1' and f.patient='"+patient;
            List<Map<String,Object>> signFamily = jdbcTemplate.queryForList(signFamilySql);
            adminTeamCode = (Integer)signFamily.get(0).get("admin_team_code");
            doctorName = signFamily.get(0).get("doctor_name").toString();
        }
        String adminTeamSql = " select t.* from "+basedb+".wlyy_admin_team t where t.available=1 and t.id="+adminTeamCode;
        List<Map<String,Object>> adminTeam = jdbcTemplate.queryForList(adminTeamSql);
        String adminTeamName = adminTeam.get(0).get("name").toString();
        guidanceMessageLogDO.setAdminTeamCode(adminTeamCode);
        guidanceMessageLogDO.setAdminTeamName(adminTeamName);
        guidanceMessageLogDO.setDoctorName(doctorName);
        guidanceMessageLogDao.save(guidanceMessageLogDO);
        return Envelop.getSuccess(SpecialistMapping.api_success);
    }
}

+ 106 - 28
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationPlanService.java

@ -1,36 +1,40 @@
package com.yihu.jw.service.rehabilitation;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dao.rehabilitation.PatientRehabilitationPlanDao;
import com.yihu.jw.dao.rehabilitation.RehabilitationDetailDao;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.jw.dao.rehabilitation.PatientRehabilitationPlanDao;
import com.yihu.jw.dao.rehabilitation.RehabilitationPlanTemplateDao;
import com.yihu.jw.dao.rehabilitation.RehabilitationTemplateDetailDao;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationDetailDO;
import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationPlanTemplateDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationTemplateDetailDO;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.specialist.PatientSignInfoVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.service.FileUploadService;
import com.yihu.jw.service.SpecialistHospitalServiceItemService;
import com.yihu.jw.service.SpecialistService;
import com.yihu.jw.util.common.QrcodeUtil;
import com.yihu.fastdfs.FastDFSUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by humingfen on 2018/8/17.
@ -59,6 +63,10 @@ public class RehabilitationPlanService {
    private FileUploadService fileUploadService;
    @Autowired
    protected HttpServletRequest request;
    @Autowired
    private SpecialistHospitalServiceItemService hospitalServiceItemService;
    @Autowired
    private SpecialistService specialistService;
    public MixEnvelop<String, String> createRehabilitationTemplate(RehabilitationPlanTemplateDO templateDO) {
        templateDO.setCreateTime(new Date());
@ -87,18 +95,24 @@ public class RehabilitationPlanService {
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,true);
    }
    public MixEnvelop<RehabilitationPlanTemplateDO, RehabilitationPlanTemplateDO> findRehabilitationPlanTemplate(Integer adminTeamCode, Integer page, Integer size) {
    public MixEnvelop<RehabilitationPlanTemplateDO, RehabilitationPlanTemplateDO> findRehabilitationPlanTemplate(Long adminTeamCode, String doctor, String patient) {
        if(page != null && size != null){
            String sql = "select * from wlyy_rehabilitation_plan_template t where t.admin_team_code = '" + adminTeamCode + "' and t.del = 1 ORDER BY t.create_time DESC LIMIT "+(page-1)*size+","+size;
            List<RehabilitationPlanTemplateDO> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(RehabilitationPlanTemplateDO.class));
            String countSql = "select count(1) from wlyy_rehabilitation_plan_template t where t.admin_team_code = '" + adminTeamCode + "' and t.del = 1";
            Long count = jdbcTemplate.queryForObject(countSql, Long.class);
            return MixEnvelop.getSuccessListWithPage(SpecialistMapping.api_success,list,page,size,count);
        }else {
            List<RehabilitationPlanTemplateDO> list = templateDao.findByAdminTeamCode(adminTeamCode);
            return MixEnvelop.getSuccessList(SpecialistMapping.api_success,list, list.size());
        if(adminTeamCode == null && StringUtils.isNotBlank(doctor) && StringUtils.isNotBlank(patient)){
            PatientSignInfoVO patientSignSpecialistInfo = (PatientSignInfoVO) specialistService.findPatientSignSpecialistInfo(patient,doctor).getObj();
            adminTeamCode = patientSignSpecialistInfo.getTeamCode();
        }
        List<RehabilitationPlanTemplateDO> list = templateDao.findByAdminTeamCode(adminTeamCode);
        return MixEnvelop.getSuccessList(SpecialistMapping.api_success,list, list.size());
    }
    /**
     * 根据模板id修改康复模板删除状态
     * @param id
     * @return
     */
    public MixEnvelop<Boolean,Boolean> deleteRehabilitationPlanTemplate(String id) {
        templateDao.updateDelById(id);
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,true);
    }
    /**
@ -106,9 +120,9 @@ public class RehabilitationPlanService {
     * @param templateId
     * @return
     */
    public MixEnvelop<RehabilitationTemplateDetailDO, RehabilitationTemplateDetailDO> findTemplateDetailByTemplateId(String templateId) {
    public MixEnvelop<HospitalServiceItemDO, HospitalServiceItemDO> findTemplateDetailByTemplateId(String templateId) {
        List<String> hospitalServiceItemIds = templateDetailDao.findHospitalServiceItemIdByTemplateId(templateId);
        return MixEnvelop.getSuccess(SpecialistMapping.api_success);
        return hospitalServiceItemService.selectById(hospitalServiceItemIds);
    }
    public PatientRehabilitationPlanDO createPatientRehabilitationPlan(PatientRehabilitationPlanDO planDO) {
@ -119,21 +133,84 @@ public class RehabilitationPlanService {
    public List<RehabilitationDetailDO> createRehabilitationDetail(List<RehabilitationDetailDO> details, String planId) {
        for(RehabilitationDetailDO detail : details) {
//            HospitalServiceItemDO hospitalServiceItemDO = hospitalServiceItemService.findById(detail.getHospitalServiceItemId());
            List<String> list = new ArrayList<>();
            list.add(detail.getHospitalServiceItemId());
            HospitalServiceItemDO hospitalServiceItemDO = hospitalServiceItemService.selectById(list).getDetailModelList().get(0);
            detail.setHospital(hospitalServiceItemDO.getHospital());
            detail.setHospitalName(hospitalServiceItemDO.getHospitalName());
            detail.setExpense(hospitalServiceItemDO.getExpense());
            detail.setPlanId(planId);
            detail.setCreateTime(new Date());
            detail.setStatus(0);
        }
        return (List<RehabilitationDetailDO>)rehabilitationDetailDao.save(details);
    }
    public MixEnvelop<String,String> createServiceQrCode(String planId,String patientCode){
        PatientRehabilitationPlanDO patientRehabilitationPlanDO = patientRehabilitationPlanDao.findById(planId);
    public MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> findServiceItemsByHospital(String doctorHospital, String signHospital) {
        JSONArray jsonArray = new JSONArray();
        List<String> list = new ArrayList<>();
        list.add(doctorHospital);
        List<HospitalServiceItemDO> docHospitalServiceItemDO = hospitalServiceItemService.selectByHospital(list).getDetailModelList();
        if(StringUtils.isNotBlank(signHospital)){
            if(signHospital.equals(doctorHospital)) {
                for (Object object : docHospitalServiceItemDO) {
                    JSONObject json = (JSONObject) JSONObject.toJSON(object);
                    json.put("type", "社区");
                    jsonArray.add(json);
                }
            }else if(!signHospital.equals(doctorHospital)){
                JSONArray array = new JSONArray();
                List<String> itemIds = new ArrayList<>();
                list.remove(0);
                list.add(signHospital);
                List<HospitalServiceItemDO> signHospitalServiceItemDO = hospitalServiceItemService.selectByHospital(list).getDetailModelList();
                HashSet signSet = new HashSet();
                for(HospitalServiceItemDO h : signHospitalServiceItemDO){
                    signSet.add(h.getServiceItemId());
                }
                //将服务项目重复的都放入itemIds集合里,并在列表中删除该条数据
                List<HospitalServiceItemDO> temp = new ArrayList<>();
                temp.addAll(docHospitalServiceItemDO);
                for(HospitalServiceItemDO h : docHospitalServiceItemDO){
                    int size = signSet.size();
                    String itemId = h.getServiceItemId();
                    signSet.add(itemId);
                    if(signSet.size() == size){
                        itemIds.add(itemId);
                        temp.remove(h);
                    }
                }
                array.addAll(signHospitalServiceItemDO);
                array.addAll(temp);
                for(Object obj : array){
                    //往实体类插入数据
                    JSONObject json = (JSONObject) JSONObject.toJSON(obj);
                    if(json.get("hospital").equals(signHospital)){
                        json.put("type", "社区");
                    }else if(json.get("hospital").equals(doctorHospital)){
                        json.put("type", "医院");
                    }
                    if(itemIds.contains(json.get("serviceItemId"))){
                        json.put("type", "社区,医院");
                    }
                    jsonArray.add(json);
                }
            }
        }else {
            jsonArray.addAll(docHospitalServiceItemDO);
        }
        return MixEnvelop.getSuccess(SpecialistMapping.api_success, jsonArray);
    }
    public MixEnvelop<String,String> createServiceQrCode(String planDetailId){
        RehabilitationDetailDO rehabilitationDetailDO = rehabilitationDetailDao.findById(planDetailId);
        String fileUrl = "";
        if (patientRehabilitationPlanDO!=null) {
            if (org.apache.commons.lang3.StringUtils.isNotBlank(patientRehabilitationPlanDO.getServiceQrCode())) {
                fileUrl = patientRehabilitationPlanDO.getServiceQrCode();
        if (rehabilitationDetailDO!=null) {
            if (org.apache.commons.lang3.StringUtils.isNotBlank(rehabilitationDetailDO.getServiceQrCode())) {
                fileUrl = rehabilitationDetailDO.getServiceQrCode();
            } else {
                InputStream ipt = QrcodeUtil.createQrcode(planId+"|"+patientCode, 300, "png");
                String contentJsonStr="{\"planDetailId\":\""+planDetailId+"\"}";
                InputStream ipt = QrcodeUtil.createQrcode(contentJsonStr, 300, "png");
                isneiwang = false;
                if (isneiwang) {
                    // 圖片列表
@ -165,18 +242,19 @@ public class RehabilitationPlanService {
                    }
                }
                //更新到康复计划居民关系表中
                String sql = "update wlyy_patient_rehabilitation_plan set service_qr_code='" + fileUrl + "' where id='" + planId + "'";
                String sql = "update wlyy_rehabilitation_plan_detail set service_qr_code='" + fileUrl + "' where id='" + planDetailId + "'";
                jdbcTemplate.update(sql);
            }
        }
        return MixEnvelop.getSuccess("获取二维码成功!",fileUrl);
    }
    public Integer checkAfterQrCode(String planId,String patietCode){
    public Integer checkAfterQrCode(String planDetailId,String patietCode){
        int result = 0;
        PatientRehabilitationPlanDO patientRehabilitationPlanDO =  patientRehabilitationPlanDao.findById(planId);
        if (patientRehabilitationPlanDO!=null){
            if (StringUtils.pathEquals(patientRehabilitationPlanDO.getPatient(),patietCode)){
        String sql ="SELECT rp.patient FROM `wlyy_rehabilitation_plan_detail` pd LEFT JOIN wlyy_patient_rehabilitation_plan rp ON pd.plan_id = rp.id WHERE pd.id='"+planDetailId+"'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if (list!=null && list.size()>0){
            if (String.valueOf(list.get(0).get("patient")).equals(patietCode)){
                result =200;
            }else {
                result = -1;

+ 9 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/util/ExcelData.java

@ -0,0 +1,9 @@
package com.yihu.jw.util;
/**
 * @author Airhead
 * @since 2017/3/27.
 */
public interface ExcelData {
    void transform(String data);
}

+ 30 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/util/ReadExcelUtil.java

@ -0,0 +1,30 @@
package com.yihu.jw.util;
import jxl.Sheet;
import org.apache.commons.lang3.StringUtils;
/**
 * Created by Administrator on 2017/4/13 0013.
 */
public class ReadExcelUtil {
    // 返回去掉空行的记录数
    public static int getRightRows(Sheet sheet) {
        int rsCols = sheet.getColumns(); // 列数
        int rsRows = sheet.getRows(); // 行数
        int nullCellNum;
        int afterRows = rsRows;
        for (int i = 0; i < rsRows; i++) { // 统计行中为空的单元格数
            nullCellNum = 0;
            for (int j = 0; j < rsCols; j++) {
                String val = sheet.getCell(j, i).getContents();
                val = StringUtils.trimToEmpty(val);
                if (StringUtils.isBlank(val))
                    nullCellNum++;
            }
            if (nullCellNum >= rsCols) { // 如果nullCellNum大于或等于总的列数
                afterRows--;// 行数减一
            }
        }
        return afterRows;
    }
}