瀏覽代碼

Merge branch 'dev' of http://192.168.1.220:10080/jiwei/wlyy2.0 into dev

LiTaohong 6 年之前
父節點
當前提交
e5f6c57cab
共有 50 個文件被更改,包括 1518 次插入292 次删除
  1. 7 26
      common/common-entity/src/main/java/com/yihu/jw/entity/base/sms/SmsDO.java
  2. 54 20
      common/common-entity/src/main/java/com/yihu/jw/entity/base/sms/SmsGatewayDO.java
  3. 6 6
      common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserDO.java
  4. 13 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/HospitalServiceItemDO.java
  5. 13 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistEvaluateDO.java
  6. 3 3
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistEvaluateScoreDO.java
  7. 13 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistServiceItemDO.java
  8. 9 8
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java
  9. 12 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java
  10. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java
  11. 6 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationPlanTemplateDO.java
  12. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationTemplateDetailDO.java
  13. 3 9
      common/common-exception/src/main/java/com/yihu/jw/exception/ApiException.java
  14. 1 0
      common/common-fegin/pom.xml
  15. 11 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java
  16. 46 16
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/sms/SmsGatewayVO.java
  17. 56 51
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/sms/SmsVO.java
  18. 5 5
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/user/UserVO.java
  19. 95 0
      server/svr-authentication/pom.xml
  20. 7 0
      server/svr-authentication/src/main/java/com/yihu/AuthServer.java
  21. 14 0
      server/svr-authentication/src/main/java/com/yihu/jw/oauth2/config/WlyyAuthorizationServerConfigurerAdapter.java
  22. 49 0
      server/svr-authentication/src/main/java/com/yihu/jw/oauth2/config/WlyyWebSecurityConfigurerAdapter.java
  23. 60 0
      server/svr-authentication/src/main/java/com/yihu/jw/oauth2/core/WlyyUserDetailsService.java
  24. 10 0
      server/svr-authentication/src/main/java/com/yihu/jw/oauth2/model/WlyyUserDetails.java
  25. 10 0
      server/svr-authentication/src/main/java/com/yihu/jw/oauth2/model/WlyyUserSimple.java
  26. 3 3
      server/svr-configuration/src/main/java/com/yihu/SvrConfiguration.java
  27. 3 3
      server/svr-discovery/src/main/java/com/yihu/SvrDiscovery.java
  28. 2 2
      server/svr-zipkin/src/main/java/com/yihu/SvrZipkin.java
  29. 5 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/SmsGatewayDao.java
  30. 4 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/SmsTemplateDao.java
  31. 10 7
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/sms/SmsGatewayEndpoint.java
  32. 111 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/SmsGatewayService.java
  33. 1 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/label/FigureLabelSerachService.java
  34. 34 28
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/config/jpa/HibernateProperties.java
  35. 56 56
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/config/jpa/WlyySpecialistJpa.java
  36. 112 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistEvaluateController.java
  37. 107 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistHospitalServiceItemController.java
  38. 23 3
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistServiceItemController.java
  39. 34 6
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java
  40. 18 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistHospitalServiceItemDao.java
  41. 3 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/PatientRehabilitationPlanDao.java
  42. 25 3
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailDao.java
  43. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationPlanTemplateDao.java
  44. 4 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationTemplateDetailDao.java
  45. 82 7
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistEvaluateService.java
  46. 103 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistHospitalServiceItemService.java
  47. 25 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistServiceItemService.java
  48. 221 24
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java
  49. 12 4
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationPlanService.java
  50. 2 1
      svr/svr-wlyy-specialist/src/main/resources/application.yml

+ 7 - 26
common/common-entity/src/main/java/com/yihu/jw/entity/base/sms/SmsDO.java

@ -13,15 +13,6 @@ import java.util.Date;
@Table(name = "base_sms")
public class SmsDO extends UuidIdentityEntity {
	/**
	 * 0 - 未发送
	 * 1 - 已发送
	 */
	public enum Status {
		unsent,
		sent
	}
	//应用ID
	private String clientId;
	//使用的网关
@ -29,17 +20,15 @@ public class SmsDO extends UuidIdentityEntity {
	//请求的ip地址
	private String requestIp;
	//短信接收号码
	private String mobile;
	private String to;
	//短信内容
	private String content;
	//过期时间
	private Date deadline;
	//验证码
	private String captcha;
	//短信类别
	//短信标签
	private SmsTemplateDO.Type type;
	//状态
	private Status status;
	@Column(name = "client_id", nullable = false)
	public String getClientId() {
@ -68,13 +57,13 @@ public class SmsDO extends UuidIdentityEntity {
		this.requestIp = requestIp;
	}
	@Column(name = "mobile", nullable = false)
	public String getMobile() {
		return mobile;
	@Column(name = "to", nullable = false)
	public String getTo() {
		return to;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	public void setTo(String to) {
		this.to = to;
	}
	@Column(name = "content", nullable = false)
@ -113,12 +102,4 @@ public class SmsDO extends UuidIdentityEntity {
		this.captcha = captcha;
	}
	@Column(name = "status", nullable = false)
	public Status getStatus() {
		return status;
	}
	public void setStatus(Status status) {
		this.status = status;
	}
}

+ 54 - 20
common/common-entity/src/main/java/com/yihu/jw/entity/base/sms/SmsGatewayDO.java

@ -24,8 +24,8 @@ public class SmsGatewayDO extends UuidIdentityEntity {
		delete
	}
	//关联 base_saas id
	private String saasId;
	//关联 client id
	private String clientId;
	//名称
	private String name;
	//短信接口的账号
@ -34,21 +34,26 @@ public class SmsGatewayDO extends UuidIdentityEntity {
	private String password;
	//官网地址
	private String website;
	//超时时间(分钟)
	private Integer expireMin;
	//短信接口调用的地址
	private String url;
	private String requestUrl;
	//调用凭证(json串)
	private String certificate;
	private String requestCertificate;
	//短信接口调用状态标识
	private String responseCode;
	//调用成功的状态码
	private String successValue;
	//状态
	private Status status;
	@Column(name = "saas_id", nullable = false)
	public String getSaasId() {
		return saasId;
	@Column(name = "client_id", nullable = false)
	public String getClientId() {
		return clientId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	public void setClientId(String clientId) {
		this.clientId = clientId;
	}
	@Column(name = "name")
@ -87,22 +92,49 @@ public class SmsGatewayDO extends UuidIdentityEntity {
		this.website = website;
	}
	@Column(name = "url")
	public String getUrl() {
		return this.url;
	@Column(name = "expire_min")
	public Integer getExpireMin() {
		return expireMin;
	}
	public void setExpireMin(Integer expireMin) {
		this.expireMin = expireMin;
	}
	@Column(name = "request_url", nullable = false)
	public String getRequestUrl() {
		return requestUrl;
	}
	public void setRequestUrl(String requestUrl) {
		this.requestUrl = requestUrl;
	}
	public void setUrl(String url) {
		this.url = url;
	@Column(name = "request_certificate", nullable = false)
	public String getRequestCertificate() {
		return requestCertificate;
	}
	@Column(name = "certificate", nullable = false)
	public String getCertificate() {
		return certificate;
	public void setRequestCertificate(String requestCertificate) {
		this.requestCertificate = requestCertificate;
	}
	public void setCertificate(String certificate) {
		this.certificate = certificate;
	@Column(name = "response_code", nullable = false)
	public String getResponseCode() {
		return responseCode;
	}
	public void setResponseCode(String responseCode) {
		this.responseCode = responseCode;
	}
	@Column(name = "success_value", nullable = false)
	public String getSuccessValue() {
		return successValue;
	}
	public void setSuccessValue(String successValue) {
		this.successValue = successValue;
	}
	@Column(name = "status", nullable = false)
@ -113,4 +145,6 @@ public class SmsGatewayDO extends UuidIdentityEntity {
	public void setStatus(Status status) {
		this.status = status;
	}
}

+ 6 - 6
common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserDO.java

@ -38,7 +38,7 @@ public class UserDO extends UuidIdentityEntityWithOperator {
    //身份证号码
    private String idcard;
    //手机号码
    private String phone;
    private String mobile;
    //邮箱
    private String email;
    //是否可用
@ -106,13 +106,13 @@ public class UserDO extends UuidIdentityEntityWithOperator {
        this.idcard = idcard;
    }
    @Column(name = "phone", length = 200)
    public String getPhone() {
        return phone;
    @Column(name = "mobile", length = 200)
    public String getMobile() {
        return mobile;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    @Column(name = "email", length = 200)

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

@ -7,6 +7,7 @@ import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
/**
@ -34,6 +35,9 @@ public class HospitalServiceItemDO extends UuidIdentityEntityWithOperator implem
    @Column(name = "status")
    private Integer status;//状态
    @Transient
    private SpecialistServiceItemDO specialistServiceItemDO;
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
@ -78,4 +82,13 @@ public class HospitalServiceItemDO extends UuidIdentityEntityWithOperator implem
    public void setStatus(Integer status) {
        this.status = status;
    }
    @Transient
    public SpecialistServiceItemDO getSpecialistServiceItemDO() {
        return specialistServiceItemDO;
    }
    public void setSpecialistServiceItemDO(SpecialistServiceItemDO specialistServiceItemDO) {
        this.specialistServiceItemDO = specialistServiceItemDO;
    }
}

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

@ -45,6 +45,9 @@ public class SpecialistEvaluateDO extends UuidIdentityEntityWithOperator impleme
    @Transient
    private String content;//标签内容
    @Transient
    private String labelId;//标签Id
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
@ -117,6 +120,7 @@ public class SpecialistEvaluateDO extends UuidIdentityEntityWithOperator impleme
        this.type = type;
    }
    @Transient
    public String getContent() {
        return content;
    }
@ -124,4 +128,13 @@ public class SpecialistEvaluateDO extends UuidIdentityEntityWithOperator impleme
    public void setContent(String content) {
        this.content = content;
    }
    @Transient
    public String getLabelId() {
        return labelId;
    }
    public void setLabelId(String labelId) {
        this.labelId = labelId;
    }
}

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

@ -31,7 +31,7 @@ public class SpecialistEvaluateScoreDO extends UuidIdentityEntityWithOperator im
    private String relationCode;//关联code
    @Column(name = "score")
    private Integer score;//评论得分
    private Double score;//评论得分
    @Column(name = "saas_id")
@ -71,11 +71,11 @@ public class SpecialistEvaluateScoreDO extends UuidIdentityEntityWithOperator im
    }
    @Column(name = "score")
    public Integer getScore() {
    public Double getScore() {
        return score;
    }
    public void setScore(Integer score) {
    public void setScore(Double score) {
        this.score = score;
    }
}

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

@ -7,6 +7,7 @@ import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
/**
@ -72,6 +73,9 @@ public class SpecialistServiceItemDO extends UuidIdentityEntityWithOperator impl
    @Column(name = "status")
    private Integer status; //删除状态
    public Integer flag;
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
@ -233,4 +237,13 @@ public class SpecialistServiceItemDO extends UuidIdentityEntityWithOperator impl
    public void setStatus(Integer status) {
        this.status = status;
    }
    @Transient
    public Integer getFlag() {
        return flag;
    }
    public void setFlag(Integer flag) {
        this.flag = flag;
    }
}

+ 9 - 8
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java

@ -13,23 +13,17 @@ import java.io.Serializable;
@Entity
@Table(name = "wlyy_guidance_message_log")
public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator implements Serializable {
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "plan_detail_id")
    private String planDetailId;
    @Column(name = "content")
    private String content;
    @Column(name = "doctor")
    private String doctor;
    @Column(name = "doctor_name")
    private String doctorName;
    @Column(name = "doctor_type")
    private Integer doctorType;
    @Column(name = "admin_team_code")
    private String adminTeamCode;
    @Column(name = "admin_team_name")
    private String adminTeamName;
    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
@ -38,6 +32,7 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
@ -46,6 +41,7 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
        this.doctorName = doctorName;
    }
    @Column(name = "doctor_type")
    public Integer getDoctorType() {
        return doctorType;
    }
@ -54,6 +50,7 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
        this.doctorType = doctorType;
    }
    @Column(name = "admin_team_code")
    public String getAdminTeamCode() {
        return adminTeamCode;
    }
@ -66,10 +63,12 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
        return adminTeamName;
    }
    @Column(name = "admin_team_name")
    public void setAdminTeamName(String adminTeamName) {
        this.adminTeamName = adminTeamName;
    }
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
@ -78,6 +77,7 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
        this.saasId = saasId;
    }
    @Column(name = "plan_detail_id")
    public String getPlanDetailId() {
        return planDetailId;
    }
@ -86,6 +86,7 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
        this.planDetailId = planDetailId;
    }
    @Column(name = "content")
    public String getContent() {
        return content;
    }

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

@ -39,6 +39,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
    @Column(name = "status")
    private Integer status;//状态(0已中止,1进行中,2已完成)
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
@ -47,6 +48,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.saasId = saasId;
    }
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -55,6 +57,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.patient = patient;
    }
    @Column(name = "title")
    public String getTitle() {
        return title;
    }
@ -63,6 +66,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.title = title;
    }
    @Column(name = "payment")
    public Integer getPayment() {
        return payment;
    }
@ -71,6 +75,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.payment = payment;
    }
    @Column(name = "total_expense")
    public Integer getTotalExpense() {
        return totalExpense;
    }
@ -79,6 +84,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.totalExpense = totalExpense;
    }
    @Column(name = "plan_type")
    public Integer getPlanType() {
        return planType;
    }
@ -87,6 +93,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.planType = planType;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
@ -95,6 +102,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.name = name;
    }
    @Column(name = "service_package_id")
    public String getServicePackageId() {
        return servicePackageId;
    }
@ -103,6 +111,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.servicePackageId = servicePackageId;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
@ -111,6 +120,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.status = status;
    }
    @Column(name = "disease")
    public String getDisease() {
        return disease;
    }
@ -119,6 +129,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.disease = disease;
    }
    @Column(name = "disease_name")
    public String getDiseaseName() {
        return diseaseName;
    }
@ -127,6 +138,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
        this.diseaseName = diseaseName;
    }
    @Column(name = "service_qr_code")
    public String getServiceQrCode() {
        return serviceQrCode;
    }

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

@ -39,6 +39,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
    @Column(name = "expense")
    private Integer expense;
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
@ -47,6 +48,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.saasId = saasId;
    }
    @Column(name = "plan_id")
    public String getPlanId() {
        return planId;
    }
@ -55,6 +57,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.planId = planId;
    }
    @Column(name = "hospital_service_item_id")
    public String getHospitalServiceItemId() {
        return hospitalServiceItemId;
    }
@ -63,6 +66,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.hospitalServiceItemId = hospitalServiceItemId;
    }
    @Column(name = "hospital")
    public String getHospital() {
        return hospital;
    }
@ -71,6 +75,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.hospital = hospital;
    }
    @Column(name = "execute_time")
    public Date getExecuteTime() {
        return executeTime;
    }
@ -79,6 +84,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.executeTime = executeTime;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
@ -87,6 +93,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.status = status;
    }
    @Column(name = "hospital_name")
    public String getHospitalName() {
        return hospitalName;
    }
@ -95,6 +102,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.hospitalName = hospitalName;
    }
    @Column(name = "type")
    public Integer getType() {
        return type;
    }
@ -103,6 +111,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.type = type;
    }
    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
@ -111,6 +120,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
@ -119,6 +129,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.doctorName = doctorName;
    }
    @Column(name = "expense")
    public Integer getExpense() {
        return expense;
    }

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

@ -27,6 +27,7 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
    @Column(name = "del")
    private Integer del;//是否删除(0是,1否)
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
@ -35,6 +36,7 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
        this.saasId = saasId;
    }
    @Column(name = "title")
    public String getTitle() {
        return title;
    }
@ -43,6 +45,7 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
        this.title = title;
    }
    @Column(name = "hospital")
    public String getHospital() {
        return hospital;
    }
@ -51,6 +54,7 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
        this.hospital = hospital;
    }
    @Column(name = "hospital_name")
    public String getHospitalName() {
        return hospitalName;
    }
@ -59,6 +63,7 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
        this.hospitalName = hospitalName;
    }
    @Column(name = "admin_team_code")
    public Integer getAdminTeamCode() {
        return adminTeamCode;
    }
@ -67,6 +72,7 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
        this.adminTeamCode = adminTeamCode;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }

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

@ -21,6 +21,7 @@ public class RehabilitationTemplateDetailDO extends UuidIdentityEntityWithOperat
    @Column(name = "hospital_service_item_id")
    private String hospitalServiceItemId;//机构服务项目id
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
@ -29,6 +30,7 @@ public class RehabilitationTemplateDetailDO extends UuidIdentityEntityWithOperat
        this.saasId = saasId;
    }
    @Column(name = "template_id")
    public String getTemplateId() {
        return templateId;
    }
@ -37,6 +39,7 @@ public class RehabilitationTemplateDetailDO extends UuidIdentityEntityWithOperat
        this.templateId = templateId;
    }
    @Column(name = "hospital_service_item_id")
    public String getHospitalServiceItemId() {
        return hospitalServiceItemId;
    }

+ 3 - 9
common/common-exception/src/main/java/com/yihu/jw/exception/ApiException.java

@ -26,6 +26,7 @@ public class ApiException extends RuntimeException {
    private Integer errorCode = -10000;
    public ApiException() {
        super();
    }
    public ApiException(String message) {
@ -37,16 +38,9 @@ public class ApiException extends RuntimeException {
        this.errorCode = errorCode;
    }
    public ApiException(String message, Throwable cause) {
    public ApiException(String message, Integer errorCode, Throwable cause) {
        super(message, cause);
    }
    public ApiException(Throwable cause) {
        super(cause);
    }
    public ApiException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.errorCode = errorCode;
    }
    public Integer getErrorCode() {

+ 1 - 0
common/common-fegin/pom.xml

@ -33,6 +33,7 @@
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model-es</artifactId>
            <version>${parent.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>

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

@ -63,6 +63,10 @@ public class SpecialistMapping {
        public static final String createPatientRehabilitationPlan = "/createPatientRehabilitationPlan";
        public static final String createServiceQrCode ="/createServiceQrCode";
        public static final String checkAfterQrCode = "checkAfterQrCode";
        public static final String findRehabilitationPlanList = "/findRehabilitationPlanList";
        public static final String findRehabilitationPlanDetailList = "/findRehabilitationPlan";
    }
@ -71,5 +75,12 @@ public class SpecialistMapping {
        public static final String getServiceItem = "/getServiceItem";
        public static final String batchDelete = "/batchDelete";
        public static final String updateServiceItem = "/updateServiceItem";
        public static final String createEvaluate = "/createEvaluate";
        public static final String getEvaluate = "/getEvaluate";
        public static final String updateEvaluate = "/updateEvaluate";
        public static final String createHospitalServiceItem = "/createHospitalServiceItem";
        public static final String selectByHospital = "/selectByHospital";
        public static final String selectById="/selectById";
        public static final String selectItemByHospital= "/selectItemByHospital";
    }
}

+ 46 - 16
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/sms/SmsGatewayVO.java

@ -12,8 +12,8 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "SmsGatewayVO", description = "短信网关")
public class SmsGatewayVO extends UuidIdentityVO {
    @ApiModelProperty(value = "saas id", example = "402803ee656498890165649ad2da0000")
    private String saasId;
    @ApiModelProperty(value = "client id", example = "EwC0iRSrcS")
    private String clientId;
    @ApiModelProperty(value = "网关名称", example = "基础短信网关")
    private String name;
    @ApiModelProperty(value = "短信接口的账号", example = "user123")
@ -22,19 +22,25 @@ public class SmsGatewayVO extends UuidIdentityVO {
    private String password;
    @ApiModelProperty(value = "官网地址", example = "http://www.smsgateway.com")
    private String website;
    @ApiModelProperty(value = "超时时间(分钟)", example = "10")
    private Integer expireMin;
    @ApiModelProperty(value = "短信接口调用的地址", example = "http://www.smsgateway.com/api/v1.0")
    private String url;
    private String requestUrl;
    @ApiModelProperty(value = "调用凭证(json串)", example = "{\"app_id\":\"EwC0iRSrcS\",\"signature\":\"iREOlyuyKfRBIGOHbBGJ\"}")
    private String certificate;
    private String requestCertificate;
    @ApiModelProperty(value = "短信接口调用状态标识", example = "result")
    private String responseCode;
    @ApiModelProperty(value = "调用成功的状态码", example = "0")
    private String successValue;
    @ApiModelProperty(value = "状态", example = "available")
    private SmsGatewayDO.Status status;
    public String getSaasId() {
        return saasId;
    public String getClientId() {
        return clientId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    public void setClientId(String clientId) {
        this.clientId = clientId;
    }
    public String getName() {
@ -69,20 +75,44 @@ public class SmsGatewayVO extends UuidIdentityVO {
        this.website = website;
    }
    public String getUrl() {
        return url;
    public Integer getExpireMin() {
        return expireMin;
    }
    public void setUrl(String url) {
        this.url = url;
    public void setExpireMin(Integer expireMin) {
        this.expireMin = expireMin;
    }
    public String getCertificate() {
        return certificate;
    public String getRequestUrl() {
        return requestUrl;
    }
    public void setCertificate(String certificate) {
        this.certificate = certificate;
    public void setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
    }
    public String getRequestCertificate() {
        return requestCertificate;
    }
    public void setRequestCertificate(String requestCertificate) {
        this.requestCertificate = requestCertificate;
    }
    public String getResponseCode() {
        return responseCode;
    }
    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }
    public String getSuccessValue() {
        return successValue;
    }
    public void setSuccessValue(String successValue) {
        this.successValue = successValue;
    }
    public SmsGatewayDO.Status getStatus() {

+ 56 - 51
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/sms/SmsVO.java

@ -1,68 +1,73 @@
package com.yihu.jw.restmodel.base.sms;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * Created by chenweida on 2017/5/22.
 * VO - 短信记录
 * Created by progr1mmer on 2018/8/28.
 */
public class SmsVO {
    private String id;
    private String saasId;	//saasid 关联base_saas code
    private String mobile;	//电话号码
    private String ip;	//发送短信的ip地址
    private Integer type;	//发送短信的类别
    private String captcha;	//验证码 1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录
    private String content;	// 短信内容
    private Date deadline;	//过期时间
    private Integer status;	//短信状态 状态,0未发送,1已发送
    private Date czrq; //操作时间
    public String getId() {
        return id;
    }
@ApiModel(value = "SmsVO", description = "短信记录")
public class SmsVO extends UuidIdentityVO {
    public void setId(String id) {
        this.id = id;
    }
    //应用ID
    @ApiModelProperty(value = "应用ID", example = "EwC0iRSrcS")
    private String clientId;
    //使用的网关
    @ApiModelProperty(value = "使用的网关", example = "402803f9657fa37b01657fb58b9b0000")
    private String smsGatewayId;
    //请求的ip地址
    @ApiModelProperty(value = "请求的ip地址", example = "192.168.0.121")
    private String requestIp;
    //短信接收号码
    @ApiModelProperty(value = "短信接收号码", example = "18888888888")
    private String to;
    //短信内容
    @ApiModelProperty(value = "短信内容", example = "【i健康综合管理平台】您使用的是i健康综合管理平台短信模板,您的验证码是826612,请于10分钟内正确输入!")
    private String content;
    //过期时间
    @ApiModelProperty(value = "应用ID", example = "EwC0iRSrcS")
    private Date deadline;
    //验证码
    private String captcha;
    @ApiModelProperty(value = "标签", example = "login")
    private SmsTemplateDO.Type type;
    public String getSaasId() {
        return saasId;
    public String getClientId() {
        return clientId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    public void setClientId(String clientId) {
        this.clientId = clientId;
    }
    public String getMobile() {
        return mobile;
    public String getSmsGatewayId() {
        return smsGatewayId;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    public void setSmsGatewayId(String smsGatewayId) {
        this.smsGatewayId = smsGatewayId;
    }
    public String getIp() {
        return ip;
    public String getRequestIp() {
        return requestIp;
    }
    public void setIp(String ip) {
        this.ip = ip;
    public void setRequestIp(String requestIp) {
        this.requestIp = requestIp;
    }
    public Integer getType() {
        return type;
    public String getTo() {
        return to;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getCaptcha() {
        return captcha;
    }
    public void setCaptcha(String captcha) {
        this.captcha = captcha;
    public void setTo(String to) {
        this.to = to;
    }
    public String getContent() {
@ -81,19 +86,19 @@ public class SmsVO {
        this.deadline = deadline;
    }
    public Integer getStatus() {
        return status;
    public String getCaptcha() {
        return captcha;
    }
    public void setStatus(Integer status) {
        this.status = status;
    public void setCaptcha(String captcha) {
        this.captcha = captcha;
    }
    public Date getCzrq() {
        return czrq;
    public SmsTemplateDO.Type getType() {
        return type;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    public void setType(SmsTemplateDO.Type type) {
        this.type = type;
    }
}

+ 5 - 5
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/user/UserVO.java

@ -34,7 +34,7 @@ public class UserVO extends UuidIdentityVOWithOperator {
    private String idcard;
    //手机号码
    @ApiModelProperty(value = "手机号码", example = "18888888888")
    private String phone;
    private String mobile;
    //邮箱
    @ApiModelProperty(value = "邮箱", example = "wxm@jkzl.com")
    private String email;
@ -102,12 +102,12 @@ public class UserVO extends UuidIdentityVOWithOperator {
        this.idcard = idcard;
    }
    public String getPhone() {
        return phone;
    public String getMobile() {
        return mobile;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getEmail() {

+ 95 - 0
server/svr-authentication/pom.xml

@ -12,5 +12,100 @@
    <artifactId>svr-authentication</artifactId>
    <dependencies>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security.oauth</groupId>
            <artifactId>spring-security-oauth2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-feign</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-ribbon</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <!-- Redis  -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <!-- Redis  -->
        <!-- JdbcTemplate-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
        </dependency>
        <!-- JdbcTemplate-->
    </dependencies>
</project>

+ 7 - 0
server/svr-authentication/src/main/java/com/yihu/AuthServer.java

@ -0,0 +1,7 @@
package com.yihu;
/**
 * Created by progr1mmer on 2018/8/29.
 */
public class AuthServer {
}

+ 14 - 0
server/svr-authentication/src/main/java/com/yihu/jw/oauth2/config/WlyyAuthorizationServerConfigurerAdapter.java

@ -0,0 +1,14 @@
package com.yihu.jw.oauth2.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
/**
 *
 * Created by progr1mmer on 2018/8/29.
 */
@Configuration
@EnableAuthorizationServer
public class WlyyAuthorizationServerConfigurerAdapter extends AuthorizationServerConfigurerAdapter {
}

+ 49 - 0
server/svr-authentication/src/main/java/com/yihu/jw/oauth2/config/WlyyWebSecurityConfigurerAdapter.java

@ -0,0 +1,49 @@
package com.yihu.jw.oauth2.config;
import com.yihu.jw.oauth2.core.WlyyUserDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
/**
 * Config - Spring Security
 * Created by progr1mmer on 2018/8/29.
 */
@Configuration
public class WlyyWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
    @Autowired
    private AuthenticationProvider authenticationProvider;
    @Override
    public void configure(WebSecurity web) throws Exception {
        web.ignoring().antMatchers("/oauth/**");
    }
    @Override
    protected void configure(AuthenticationManagerBuilder authBuilder) throws Exception {
        authBuilder.authenticationProvider(authenticationProvider);
    }
    @Bean
    WlyyUserDetailsService wlyyUserDetailsService(){
        return new WlyyUserDetailsService();
    }
    @Bean
    public AuthenticationProvider authenticationProvider(UserDetailsService userDetailsService) {
        DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
        authenticationProvider.setUserDetailsService(userDetailsService);
        authenticationProvider.setPasswordEncoder(new Md5PasswordEncoder());
        return authenticationProvider;
    }
}

+ 60 - 0
server/svr-authentication/src/main/java/com/yihu/jw/oauth2/core/WlyyUserDetailsService.java

@ -0,0 +1,60 @@
package com.yihu.jw.oauth2.core;
import com.yihu.jw.oauth2.model.WlyyUserSimple;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
 * Service - 用户加载
 * Created by progr1mmer on 2018/8/29.
 */
public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetailsService {
    private static final String DEFAULT_USER_DETAILS_STATEMENT = "SELECT * FROM user u WHERE u.username = ? OR u.mobile = ? OR u.idcard = ?";
    /**
     * 用户登录判读接口
     *
     * @param username
     * @return
     * @throws UsernameNotFoundException
     */
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        List<UserDetails> users = this.getJdbcTemplate().query(DEFAULT_USER_DETAILS_STATEMENT, new BeanPropertyRowMapper(UserDetails.class), username, username, username);
        if (users == null || users.size() == 0) {
            throw new UsernameNotFoundException(username);
        }
        return new User(username, users.get(0).getPassword(), getGrantedAuthorities(username));
        /*if (username.equals("admin")){
            return new User("admin", "e10adc3949ba59abbe56e057f20f883e", getGrantedAuthorities(username));
        }
        return null;*/
    }
    private Collection<? extends GrantedAuthority> getGrantedAuthorities(String username) {
        Collection<GrantedAuthority> authorities = new ArrayList<>(1);
        authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
        return authorities;
    }
    public WlyyUserSimple loadUserSimpleByUsername(String username) throws UsernameNotFoundException {
        List<WlyyUserSimple> users = this.getJdbcTemplate().query(DEFAULT_USER_DETAILS_STATEMENT, new BeanPropertyRowMapper(WlyyUserSimple.class), username, username, username);
        if (users == null || users.size() == 0) {
            throw new UsernameNotFoundException(username);
        }
        return users.get(0);
    }
}

+ 10 - 0
server/svr-authentication/src/main/java/com/yihu/jw/oauth2/model/WlyyUserDetails.java

@ -0,0 +1,10 @@
package com.yihu.jw.oauth2.model;
import java.io.Serializable;
/**
 * Model - 认证用户详细信息
 * Created by progr1mmer on 2018/8/29.
 */
public class WlyyUserDetails implements Serializable {
}

+ 10 - 0
server/svr-authentication/src/main/java/com/yihu/jw/oauth2/model/WlyyUserSimple.java

@ -0,0 +1,10 @@
package com.yihu.jw.oauth2.model;
import java.io.Serializable;
/**
 * Model - 认证用户简略信息
 * Created by progr1mmer on 2018/8/29.
 */
public class WlyyUserSimple implements Serializable {
}

+ 3 - 3
server/svr-configuration/src/main/java/com/yihu/SvrConfiguration.java

@ -11,14 +11,14 @@ import org.springframework.cloud.config.server.EnableConfigServer;
 */
@SpringBootApplication
@EnableConfigServer
public class SvrConfiguration extends SpringBootServletInitializer {
public class ConfigServer extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(SvrConfiguration.class, args);
        SpringApplication.run(ConfigServer.class, args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(SvrConfiguration.class);
        return application.sources(ConfigServer.class);
    }
}

+ 3 - 3
server/svr-discovery/src/main/java/com/yihu/SvrDiscovery.java

@ -11,14 +11,14 @@ import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
 */
@SpringBootApplication
@EnableEurekaServer
public class SvrDiscovery extends SpringBootServletInitializer {
public class DiscoveryServer extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(SvrDiscovery.class, args);
        SpringApplication.run(DiscoveryServer.class, args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(SvrDiscovery.class);
        return application.sources(DiscoveryServer.class);
    }
}

+ 2 - 2
server/svr-zipkin/src/main/java/com/yihu/SvrZipkin.java

@ -9,9 +9,9 @@ import zipkin.server.EnableZipkinServer;
 */
@SpringBootApplication
@EnableZipkinServer
public class SvrZipkin {
public class ZipkinTrackServer {
    public static void main(String[] args) {
        SpringApplication.run(SvrZipkin.class, args);
        SpringApplication.run(ZipkinTrackServer.class, args);
    }
}

+ 5 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/SmsGatewayDao.java

@ -4,9 +4,14 @@ import com.yihu.jw.entity.base.sms.SmsGatewayDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Dao - 短信网关
 * Created by progr1mmer on 2018/8/23.
 */
public interface SmsGatewayDao extends PagingAndSortingRepository<SmsGatewayDO, String>, JpaSpecificationExecutor<SmsGatewayDO> {
    List<SmsGatewayDO> findByClientIdAndStatus(String clientId, SmsGatewayDO.Status status);
}

+ 4 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/SmsTemplateDao.java

@ -4,10 +4,14 @@ import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Dao - 短信模板
 * Created by progr1mmer on 2018/8/23.
 */
public interface SmsTemplateDao extends PagingAndSortingRepository<SmsTemplateDO, String>, JpaSpecificationExecutor<SmsTemplateDO> {
    List<SmsTemplateDO> findByClientIdAndType(String clientId, SmsTemplateDO.Type type);
}

+ 10 - 7
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/sms/SmsGatewayEndpoint.java

@ -1,8 +1,11 @@
package com.yihu.jw.base.endpoint.sms;
import com.yihu.jw.base.service.SmsGatewayService;
import com.yihu.jw.entity.base.sms.SmsDO;
import com.yihu.jw.entity.base.sms.SmsGatewayDO;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import com.yihu.jw.restmodel.base.sms.SmsGatewayVO;
import com.yihu.jw.restmodel.base.sms.SmsVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -93,16 +96,16 @@ public class SmsGatewayEndpoint extends EnvelopRestEndpoint {
        return success(smsGatewayDOS, SmsGatewayVO.class);
    }
    @GetMapping(value = BaseRequestMapping.SmsGateway.SEND)
    @PostMapping(value = BaseRequestMapping.SmsGateway.SEND)
    @ApiOperation(value = "发送短信")
    public Envelop send (
    public ObjEnvelop<SmsVO> send (
            @ApiParam(name = "clientId", value = "应用ID", required = true)
            @RequestParam(value = "clientId") String clientId,
            @ApiParam(name = "type", value = "短信标签类型", required = true)
            @RequestParam(value = "type") Integer type,
            @ApiParam(name = "mobile", value = "手机号码", required = true)
            @RequestParam(value = "mobile") String mobile) {
        return success("");
            @RequestParam(value = "type") SmsTemplateDO.Type type,
            @ApiParam(name = "to", value = "手机号码", required = true)
            @RequestParam(value = "to") String to) throws Exception {
        SmsDO smsDO = smsGatewayService.send(clientId, type, to);
        return success(smsDO, SmsVO.class);
    }
}

+ 111 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/SmsGatewayService.java

@ -1,9 +1,28 @@
package com.yihu.jw.base.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.SmsDao;
import com.yihu.jw.base.dao.SmsGatewayDao;
import com.yihu.jw.base.dao.SmsTemplateDao;
import com.yihu.jw.entity.base.sms.SmsDO;
import com.yihu.jw.entity.base.sms.SmsGatewayDO;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import com.yihu.jw.exception.ApiException;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.network.IPInfoUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.MalformedParameterizedTypeException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * Service - 短信网关
@ -12,4 +31,96 @@ import org.springframework.stereotype.Service;
@Service
public class SmsGatewayService extends BaseJpaService<SmsGatewayDO, SmsGatewayDao> {
    private static final Pattern PATTERN  = Pattern.compile("\\$\\{[A-Za-z0-9]+\\}");
    @Autowired
    private SmsTemplateDao smsTemplateDao;
    @Autowired
    private SmsGatewayDao smsGatewayDao;
    @Autowired
    private SmsDao smsDao;
    @Autowired
    private ObjectMapper objectMapper;
    public SmsDO send(String clientId, SmsTemplateDO.Type type, String to) throws Exception {
        List<SmsGatewayDO> smsGatewayDOS = smsGatewayDao.findByClientIdAndStatus(clientId, SmsGatewayDO.Status.available);
        if (smsGatewayDOS.size() == 0) {
            throw new ApiException("no gateway available");
        }
        List<SmsTemplateDO> smsTemplateDOS = smsTemplateDao.findByClientIdAndType(clientId, type);
        if (smsTemplateDOS.size() == 0) {
            throw new ApiException("no template available");
        }
        Random random = new Random();
        SmsGatewayDO smsGatewayDO = smsGatewayDOS.get(random.nextInt(smsGatewayDOS.size()));
        SmsTemplateDO smsTemplateDO = smsTemplateDOS.get(random.nextInt(smsTemplateDOS.size()));
        //生成内容
        String rawContent = smsTemplateDO.getContent();
        /*
         * 0 - 验证码
         * 1 - 过期时间(分钟)
         */
        String [] contentDatas = new String[] {
                randomInt(6),
                smsGatewayDO.getExpireMin().toString()
        };
        Matcher contentMatcher = PATTERN.matcher(rawContent);
        int index = 0;
        while (contentMatcher.find()) {
            String matchWord = contentMatcher.group(0);
            rawContent = rawContent.replace(matchWord, contentDatas[index]);
            index ++;
        }
        String sendContent = smsTemplateDO.getHeader() + rawContent;
        //第三方API服务请求参数
        String rawCertificate = smsGatewayDO.getRequestCertificate();
        /*
         * 0 - 接收手机号码
         * 1 - 短信内容
         */
        String [] certificateDatas = new String[] {
                to,
                sendContent
        };
        Matcher certificateMatcher = PATTERN.matcher(rawCertificate);
        index = 0;
        while (certificateMatcher.find()) {
            String matchWord = certificateMatcher.group(0);
            rawCertificate = rawCertificate.replace(matchWord, certificateDatas[index]);
            index ++;
        }
        HttpResponse httpResponse = HttpUtils.doPost(smsGatewayDO.getRequestUrl(), objectMapper.readValue(rawCertificate, Map.class));
        if (httpResponse.isSuccessFlg()) {
            Map<String, Object> response = objectMapper.readValue(httpResponse.getContent(), Map.class);
            if (response.get(smsGatewayDO.getResponseCode()).equals(smsGatewayDO.getSuccessValue())) {
                HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
                SmsDO smsDO = new SmsDO();
                smsDO.setClientId(clientId);
                smsDO.setSmsGatewayId(smsGatewayDO.getId());
                smsDO.setRequestIp(IPInfoUtils.getIPAddress(request));
                smsDO.setTo(to);
                smsDO.setContent(sendContent);
                smsDO.setDeadline(DateUtils.addMinutes(new Date(), smsGatewayDO.getExpireMin()));
                smsDO.setCaptcha(contentDatas[0]);
                smsDO.setType(type);
                return smsDao.save(smsDO);
            } else {
                throw new ApiException(httpResponse.getContent());
            }
        } else {
            throw new ApiException(httpResponse.getContent());
        }
    }
    private String randomInt(int length) {
        String str = "0123456789";
        StringBuffer buffer = new StringBuffer();
        Random random = new Random();
        for(int i = 0; i < length; ++i) {
            int pos = random.nextInt(str.length());
            buffer.append(str.charAt(pos));
        }
        return buffer.toString();
    }
}

+ 1 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/label/FigureLabelSerachService.java

@ -49,6 +49,7 @@ public class FigureLabelSerachService implements Serializable {
                JSONObject json = new JSONObject();
                field("and","idcard","=",one.getIdCard(),jsonArray);
                field("and","labelType","=","3",jsonArray);
                field("and","dictCode","=","people_category_dict",jsonArray);
                json.put("filter",jsonArray);
                boolean isTNB = false;//是否糖尿病

+ 34 - 28
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/config/jpa/HibernateProperties.java

@ -1,29 +1,35 @@
//package com.yihu.jw.config.jpa;
//
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.cloud.context.config.annotation.RefreshScope;
//import org.springframework.stereotype.Component;
//
//import java.util.Properties;
//
///**
// * Created by chenweida on 2017/4/6.
// */
//@Component
//@RefreshScope
//public class HibernateProperties {
//    @Value("${hibernate.dialect}")
//    private String dialect;
//    @Value("${hibernate.show_sql}")
//    private String show_sql;
//    @Value("${hibernate.ejb.naming_strategy}")
//    private String naming_strategy;
//
//    public  Properties hibProperties() {
//        Properties properties = new Properties();
//        properties.put("hibernate.dialect",dialect);
//        properties.put("hibernate.show_sql", show_sql);
package com.yihu.jw.config.jpa;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
import java.util.Properties;
/**
 * Created by chenweida on 2017/4/6.
 */
@Component
@RefreshScope
public class HibernateProperties {
    @Value("${hibernate.dialect}")
    private String dialect;
    @Value("${hibernate.show_sql}")
    private String show_sql;
    @Value("${hibernate.ejb.naming_strategy}")
    private String naming_strategy;
    @Value("${hibernate.physical_naming_strategy}")
    private String physical_naming_strategy;
    @Value("${hibernate.implicit_naming_strategy}")
    private String implicit_naming_strategy;
    public  Properties hibProperties() {
        Properties properties = new Properties();
        properties.put("hibernate.dialect",dialect);
        properties.put("hibernate.show_sql", show_sql);
//        properties.put("hibernate.ejb.naming_strategy", naming_strategy);
//        return properties;
//    }
//}
        properties.put("hibernate.physical_naming_strategy",physical_naming_strategy);
        properties.put("hibernate.implicit_naming_strategy",implicit_naming_strategy);
        return properties;
    }
}

+ 56 - 56
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/config/jpa/WlyySpecialistJpa.java

@ -1,58 +1,58 @@
//package com.yihu.jw.config.jpa;
//
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
//import org.springframework.orm.jpa.JpaTransactionManager;
//import org.springframework.orm.jpa.JpaVendorAdapter;
//import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
//import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
//import org.springframework.transaction.annotation.EnableTransactionManagement;
//
//import javax.persistence.EntityManagerFactory;
//import javax.sql.DataSource;
//import java.util.Properties;
//
///**
// * Created by chenweida on 2017/4/6.
// */
//@Configuration
//@EnableTransactionManagement
//@EnableJpaRepositories(
//        entityManagerFactoryRef = "wlyySpecialistEntityManagerFactory",
//        transactionManagerRef = "wlyySpecialistTransactionManager",
//        basePackages = {"com.yihu.jw.dao"})   //设置Repository所在位置
//public class WlyySpecialistJpa {
//
//    @Autowired
//    private HibernateProperties hibernateProperties;
//
//    @Bean(name = "wlyySpecialistEntityManagerFactory")
//    @Primary
//    public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary(DataSource dataSource) {
//
//        LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
//        emfb.setDataSource(dataSource);
//        emfb.setPackagesToScan("com.yihu.jw.entity");
//        emfb.setPersistenceUnitName("specialist");
//        JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
//        emfb.setJpaVendorAdapter(vendorAdapter);
package com.yihu.jw.config.jpa;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import java.util.Properties;
/**
 * Created by chenweida on 2017/4/6.
 */
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
        entityManagerFactoryRef = "wlyySpecialistEntityManagerFactory",
        transactionManagerRef = "wlyySpecialistTransactionManager",
        basePackages = {"com.yihu.jw.dao"})   //设置Repository所在位置
public class WlyySpecialistJpa {
    @Autowired
    private HibernateProperties hibernateProperties;
    @Bean(name = "wlyySpecialistEntityManagerFactory")
    @Primary
    public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary(DataSource dataSource) {
        LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
        emfb.setDataSource(dataSource);
        emfb.setPackagesToScan("com.yihu.jw.entity");
        emfb.setPersistenceUnitName("specialist");
        JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        emfb.setJpaVendorAdapter(vendorAdapter);
//        Properties properties = hibernateProperties.hibProperties();
//        properties.put("hibernate.ejb.naming_strategy","org.hibernate.cfg.ImprovedNamingStrategy");
//        emfb.setJpaProperties(hibernateProperties.hibProperties());
//
//        return emfb;
//    }
//
//
//    @Bean(name = "wlyySpecialistTransactionManager")
//    @Primary
//    JpaTransactionManager transactionManagerSecondary(
//            @Qualifier("wlyySpecialistEntityManagerFactory") EntityManagerFactory builder) {
//        return new JpaTransactionManager(builder);
//    }
//}
        emfb.setJpaProperties(hibernateProperties.hibProperties());
        return emfb;
    }
    @Bean(name = "wlyySpecialistTransactionManager")
    @Primary
    JpaTransactionManager transactionManagerSecondary(
            @Qualifier("wlyySpecialistEntityManagerFactory") EntityManagerFactory builder) {
        return new JpaTransactionManager(builder);
    }
}

+ 112 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistEvaluateController.java

@ -0,0 +1,112 @@
package com.yihu.jw.controller;/**
 * Created by nature of king on 2018/8/27.
 */
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.specialist.SpecialistEvaluateDO;
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.SpecialistEvaluateService;
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.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
 * @author wangzhinan
 * @create 2018-08-27 14:17
 * @desc 评论
 **/
@RestController
@RequestMapping(SpecialistMapping.api_specialist_common)
@Api(tags = "评价相关操作", description = "评价相关操作")
public class SpecialistEvaluateController extends EnvelopRestEndpoint {
    @Autowired
    private Tracer tracer;
    @Autowired
    private SpecialistEvaluateService specialistEvaluateService;
    /**
     * 添加评价
     *
     * @param evaluate
     * @return
     */
    @PostMapping(value = SpecialistMapping.serviceItem.createEvaluate)
    @ApiOperation(value = "添加评论")
    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);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 获取评论
     *
     * @param evaluate
     * @return
     */
    @PostMapping(value = SpecialistMapping.serviceItem.getEvaluate)
    @ApiOperation(value = "获取评论")
    public MixEnvelop<JSONObject,JSONObject> select(@ApiParam(name = "evaluate", value = "评价")
                                                                        @RequestParam(value = "evaluate")String evaluate){
        try {
            SpecialistEvaluateDO specialistEvaluateDO = toEntity(evaluate, SpecialistEvaluateDO.class);
            return specialistEvaluateService.selectByCondition(specialistEvaluateDO);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 更新评价
     *
     * @param evaluate
     * @return
     */
    @PostMapping(value = SpecialistMapping.serviceItem.updateEvaluate)
    @ApiOperation(value = "更新评价")
    public MixEnvelop<Boolean,Boolean> update(@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.update(specialistEvaluateDOS);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 107 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistHospitalServiceItemController.java

@ -0,0 +1,107 @@
package com.yihu.jw.controller;/**
 * Created by nature of king on 2018/8/29.
 */
import com.alibaba.fastjson.JSONArray;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
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.SpecialistHospitalServiceItemService;
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.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
 * @author wangzhinan
 * @create 2018-08-29 0:56
 * @desc
 **/
@RestController
@RequestMapping(SpecialistMapping.api_specialist_common)
@Api(tags = "机构服务项目相关操作", description = "机构服务项目相关操作")
public class SpecialistHospitalServiceItemController extends EnvelopRestEndpoint {
    @Autowired
    private Tracer tracer;
    @Autowired
    private SpecialistHospitalServiceItemService specialistHospitalServiceItemService;
    /**
     * 添加机构服务项目
     * @param hospitalServiceItem
     * @return
     */
    @PostMapping(value = SpecialistMapping.serviceItem.createHospitalServiceItem)
    @ApiOperation(value = "添加机构服务项目")
    public MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> create(@ApiParam(name = "hospitalServiceItem", value = "机构服务项目")
                                                                        @RequestParam(value = "hospitalServiceItem")String hospitalServiceItem){
        try {
            HospitalServiceItemDO hospitalServiceItemDO = toEntity(hospitalServiceItem,HospitalServiceItemDO.class);
            return specialistHospitalServiceItemService.insert(hospitalServiceItemDO);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 根据医院Code查找机构服务项目
     *
     * @param hospitals
     * @return
     */
    @PostMapping(value = SpecialistMapping.serviceItem.selectByHospital)
    @ApiOperation(value = "根据医院Code查找机构服务项目")
    public MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> selectByHospital(@ApiParam(name = "hospitals", value = "医院code集合")
                                                                          @RequestParam(value = "hospitals")String hospitals){
        try {
            JSONArray array = JSONArray.parseArray(hospitals);
            List<String> hospitalList = new ArrayList<>();
            for (int i =0 ;i<array.size();i++){
                hospitalList.add(array.getString(i));
            }
            return specialistHospitalServiceItemService.selectByHospital(hospitalList);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 根据id查找机构服务项目
     *
     * @param ids
     * @return
     */
    @PostMapping(value = SpecialistMapping.serviceItem.selectById)
    @ApiOperation(value = "根据id查找机构服务项目")
    public MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> selectById(@ApiParam(name = "ids", value = "机构服务项目集合")
                                                                                    @RequestParam(value = "ids")String ids){
        try {
            JSONArray array = JSONArray.parseArray(ids);
            List<String> idList = new ArrayList<>();
            for (int i =0 ;i<array.size();i++){
                idList.add(array.getString(i));
            }
            return specialistHospitalServiceItemService.selectById(idList);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 23 - 3
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistServiceItemController.java

@ -42,7 +42,7 @@ public class SpecialistServiceItemController extends EnvelopRestEndpoint {
     * @param pageSize
     * @return
     */
    @GetMapping(value = SpecialistMapping.serviceItem.getServiceItem)
    @PostMapping(value = SpecialistMapping.serviceItem.getServiceItem)
    @ApiOperation(value = "服务项目列表查询")
    public MixEnvelop<SpecialistServiceItemDO,SpecialistEvaluateDO> select(@ApiParam(name = "serviceItem", value = "服务项目JSON")
                                                       @RequestParam(value = "serviceItem")String serviceItem,
@ -115,10 +115,10 @@ public class SpecialistServiceItemController extends EnvelopRestEndpoint {
     * @param serviceItem
     * @return
     */
    @GetMapping(value = SpecialistMapping.serviceItem.updateServiceItem)
    @PostMapping(value = SpecialistMapping.serviceItem.updateServiceItem)
    @ApiOperation(value = "服务项目更新")
    public MixEnvelop<Boolean,Boolean> udpate(@ApiParam(name = "serviceItem", value = "服务项目JSON")
                                   @RequestParam(value = "serviceItem")String serviceItem){
                                              @RequestParam(value = "serviceItem")String serviceItem){
        try {
            SpecialistServiceItemDO serviceItemDO = toEntity(serviceItem,SpecialistServiceItemDO.class);
            return specialistServiceItemService.update(serviceItemDO);
@ -128,4 +128,24 @@ public class SpecialistServiceItemController extends EnvelopRestEndpoint {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 根据医院code获取服务项目
     *
     * @param hospital
     * @return
     */
    @PostMapping(value = SpecialistMapping.serviceItem.selectItemByHospital)
    @ApiOperation(value = "根据医院code获取服务项目")
    public MixEnvelop<SpecialistServiceItemDO,SpecialistServiceItemDO> selectByHospital(@ApiParam(name = "hospital", value = "医院code")
                                              @RequestParam(value = "hospital")String hospital){
        try {
            return specialistServiceItemService.selectByHospital(hospital);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

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

@ -26,13 +26,41 @@ public class RehabilitationManageController {
    @Autowired
    private Tracer tracer;
    @GetMapping(value = SpecialistMapping.rehabilitation.findRehabilitationPlan)
    @ApiOperation(value = "康复管理列表")
    public MixEnvelop findRehabilitationPlan(@ApiParam(name = "page", value = "第几页,从1开始")
                                             @RequestParam(value = "page", required = false)Integer page,
                                             @ApiParam(name = "size", value = ",每页分页大小")
                                             @RequestParam(value = "size", required = false)Integer size){
    @GetMapping(value = SpecialistMapping.rehabilitation.findRehabilitationPlanList)
    @ApiOperation(value = "康复管理-康复计划列表")
    public MixEnvelop findRehabilitationPlan(@ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)")
                                             @RequestParam(value = "doctorType", required = true)Integer doctorType,
                                             @ApiParam(name = "doctorCode", value = "医生code")
                                             @RequestParam(value = "doctorCode", required = true)String doctorCode,
                                             @ApiParam(name = "patientCondition", value = "居民条件,可以按身份证或者居民名称模糊匹配")
                                             @RequestParam(value = "patientCondition", required = false)String patientCondition,
                                             @ApiParam(name = "diseaseCode", value = "疾病类型")
                                             @RequestParam(value = "diseaseCode", required = false)String diseaseCode,
                                             @ApiParam(name = "planType", value = "安排类型(1康复计划,2转社区医院,3转家庭病床)")
                                             @RequestParam(value = "planType", required = false)Integer planType,
                                             @ApiParam(name = "todaybacklog", value = "今日待办(1、今日待办,2、全部)")
                                             @RequestParam(value = "todaybacklog", required = false,defaultValue = "1")Integer todaybacklog,
                                             @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){
        try {
            return rehabilitationManageService.findRehabilitationPlan(doctorType,doctorCode,diseaseCode,planType,todaybacklog,patientCondition,page,pageSize);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @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){
        try {
//            return rehabilitationManageService.findRehabilitationPlanDetailList(doctorCode,diseaseCode,planType,todaybacklog,patientCondition,page,pageSize);
            return null;
        }catch (Exception e){
            e.printStackTrace();

+ 18 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistHospitalServiceItemDao.java

@ -0,0 +1,18 @@
package com.yihu.jw.dao;/**
 * Created by nature of king on 2018/8/28.
 */
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author wangzhinan
 * @create 2018-08-28 19:54
 * @desc 机构服务项目
 **/
public interface SpecialistHospitalServiceItemDao extends PagingAndSortingRepository<HospitalServiceItemDO, String>,
        JpaSpecificationExecutor<HospitalServiceItemDO> {
}

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

@ -16,4 +16,7 @@ public interface PatientRehabilitationPlanDao extends PagingAndSortingRepository
    PatientRehabilitationPlanDO findById(String id);
    List<PatientRehabilitationPlanDO> findByPatientAndCreateUser(String patient, String doctor);
    @Query(" select p from PatientRehabilitationPlanDO p where p.patient=?1 order by p.createTime desc ")
    List<PatientRehabilitationPlanDO> findbyPatient(String patientCode);
}

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

@ -13,14 +13,36 @@ import java.util.List;
 */
public interface RehabilitationDetailDao extends PagingAndSortingRepository<RehabilitationDetailDO, Long>,JpaSpecificationExecutor<RehabilitationDetailDO> {
    @Query("select count(1) from RehabilitationDetailDO where status =?1 and programId=?2 and executeTime>=?3 and executeTime<=?4 ")
    @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 programId=?2 ")
    @Query("select count(1) from RehabilitationDetailDO where status =?1 and planId=?2 ")
    Integer completenessCount(Integer status,String programId);
    @Query("select * from RehabilitationDetailDO where executeTime<=?1 and executeTime>=?2 and planId=?3")
    @Query("select d from RehabilitationDetailDO d where d.planId=?1 order by d.executeTime desc")
    List<RehabilitationDetailDO> getAllRehabilitationDetail(String programId);
    @Query("select d from RehabilitationDetailDO d where d.executeTime<=?1 and d.executeTime>=?2 and d.planId=?3")
    List<RehabilitationDetailDO> findByPlanId(Date executeStartTime,Date executeEndTime,String planId);
    @Query(value ="select count(distinct d.hospital_service_item_id) from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where d.doctor=?1 and p.patient=?2  and d.status!=?3",nativeQuery = true)
    Integer unfinishItemByDoctor(String doctor,String patient,Integer status);
    @Query(value ="select count(distinct d.hospital_service_item_id) from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where d.doctor in (?1,?2) and p.patient=?3  and d.status!=?4",nativeQuery = true)
    Integer unfinishItemByDoctor(String generalDoctor,String healthDoctor,String patient,Integer status);
    @Query(value ="select count(distinct d.hospital_service_item_id) from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where d.doctor=?1 and p.patient=?2",nativeQuery = true)
    Integer findItemByDoctor(String doctor,String patient);
    @Query(value ="select count(distinct d.hospital_service_item_id) from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where d.doctor in (?1,?2) and p.patient=?3",nativeQuery = true)
    Integer findItemByDoctor(String generalDoctor,String healthDoctor,String patient);
//    @Query("select count(distinct serviceItemId) from RehabilitationDetailDO d left join PatientRehabilitationPlanDO p on d.planId=p.id where doctor=?1 and p.patient=?2 ")
//    Integer finishItemByDoctor(String doctor,String patient);
//
    @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=?1 and p.patient=?2  and d.status=?3",nativeQuery = true)
    Integer completeServiceByDoctor(String doctor,String patient,Integer status);
    @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);
}

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

@ -9,6 +9,6 @@ import java.util.List;
public interface RehabilitationPlanTemplateDao extends PagingAndSortingRepository<RehabilitationPlanTemplateDO, Long>,JpaSpecificationExecutor<RehabilitationPlanTemplateDO> {
    @Query("select t from RehabilitationPlanTemplateDO t where t.adminTeamCode = ?1 ORDER BY t.createTime DESC ")
    @Query("select t from RehabilitationPlanTemplateDO t where t.adminTeamCode = ?1 and t.del = 1 ORDER BY t.createTime DESC ")
    List<RehabilitationPlanTemplateDO> findByAdminTeamCode(Integer adminTeamCode);
}

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

@ -2,6 +2,7 @@ package com.yihu.jw.dao.rehabilitation;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationTemplateDetailDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -11,4 +12,7 @@ public interface RehabilitationTemplateDetailDao extends PagingAndSortingReposit
    List<RehabilitationTemplateDetailDO> findTemplateDetailByTemplateId(String templateId);
    void deleteByTemplateId(String templateId);
    @Query("SELECT r.hospitalServiceItemId FROM RehabilitationTemplateDetailDO r where r.templateId = ?1")
    List<String> findHospitalServiceItemIdByTemplateId(String templateId);
}

+ 82 - 7
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.JSONObject;
import com.yihu.jw.dao.SpecialistEvaluateDao;
import com.yihu.jw.dao.SpecialistEvaluateLabelDao;
import com.yihu.jw.dao.SpecialistEvaluateScoreDao;
@ -17,7 +18,8 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.text.NumberFormat;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -50,7 +52,7 @@ public class SpecialistEvaluateService extends EnvelopRestEndpoint {
        String doctor = null;
        String relationCode = null;
        String patient = null;
        Double total = 0.0;
        Double total = 0d;
        if (specialistEvaluateDOList != null && specialistEvaluateDOList.size() != 0){
            for (SpecialistEvaluateDO specialistEvaluateDO:specialistEvaluateDOList){
                specialistEvaluateDO.setRelationType(1);
@ -74,27 +76,100 @@ public class SpecialistEvaluateService extends EnvelopRestEndpoint {
            }
        }
        double score = total/3;
        NumberFormat nbf= NumberFormat.getInstance();
        nbf.setMinimumFractionDigits(2);
        BigDecimal   b   =   new   BigDecimal(score);
        double   f1   =   b.setScale(2,   BigDecimal.ROUND_HALF_UP).doubleValue();
        SpecialistEvaluateScoreDO specialistEvaluateScoreDO = new SpecialistEvaluateScoreDO();
        specialistEvaluateScoreDO.setRelationCode(relationCode);
        specialistEvaluateScoreDO.setEvaluateType(1);
        specialistEvaluateScoreDO.setDoctor(doctor);
        specialistEvaluateScoreDO.setSaasId("dev");
        specialistEvaluateScoreDO.setScore(Integer.parseInt(nbf.format(score)));
        specialistEvaluateScoreDO.setScore(f1);
        specialistEvaluateScoreDO.setCreateTime(new Date());
        specialistEvaluateScoreDO.setUpdateTime(new Date());
        specialistEvaluateScoreDao.save(specialistEvaluateScoreDO);
        return envelop;
    }
    public MixEnvelop<SpecialistEvaluateDO,SpecialistEvaluateDO> selectByCondition(SpecialistEvaluateDO specialistEvaluateDO){
        MixEnvelop<SpecialistEvaluateDO,SpecialistEvaluateDO> envelop = new MixEnvelop<>();
    /**
     * 查询评论
     *
     * @param specialistEvaluateDO
     * @return
     */
    public MixEnvelop<JSONObject,JSONObject> selectByCondition(SpecialistEvaluateDO specialistEvaluateDO){
        MixEnvelop<JSONObject,JSONObject> envelop = new MixEnvelop<>();
        String sql = ISqlUtils.getSql(specialistEvaluateDO,1,1,"*");
        List<SpecialistEvaluateDO> specialistEvaluateDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SpecialistEvaluateDO.class));
        String sql1 = "select * from wlyy_specialist_evaluate_label where doctor = '"+specialistEvaluateDO.getDoctor()+"' " +
                "and relation_code = '"+specialistEvaluateDO.getRelationCode()+"' and patient = '"+specialistEvaluateDO.getPatient()+"'";
        List<SpecialistEvaluateLabelDO> specialistEvaluateLabelDOS = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(SpecialistEvaluateLabelDO.class));
        String sql2 = "select * from wlyy_specialist_evaluate_score where doctor = '"+specialistEvaluateDO.getDoctor()+"' " +
                "and relation_code = '"+specialistEvaluateDO.getRelationCode()+"'";
        List<SpecialistEvaluateScoreDO> specialistEvaluateScoreDOS = jdbcTemplate.query(sql2,new BeanPropertyRowMapper(SpecialistEvaluateScoreDO.class));
        JSONObject object = new JSONObject();
        object.put("score",specialistEvaluateScoreDOS);
        object.put("evaluate",specialistEvaluateDOS);
        object.put("evaluateLabel",specialistEvaluateLabelDOS);
        List<JSONObject> array = new ArrayList<>();
        array.add(object);
        envelop.setDetailModelList(array);
        return envelop;
    }
    /**
     * 更新评价
     *
     * @param specialistEvaluateDOList
     * @return
     */
    public MixEnvelop<Boolean,Boolean> update(List<SpecialistEvaluateDO> specialistEvaluateDOList){
        MixEnvelop<Boolean,Boolean> envelop = new MixEnvelop<>();
        String doctor = null;
        String relationCode = null;
        String patient = null;
        Double total = 0d;
        if (specialistEvaluateDOList != null && specialistEvaluateDOList.size() != 0){
            for (SpecialistEvaluateDO specialistEvaluateDO:specialistEvaluateDOList){
                specialistEvaluateDO.setSaasId("dev");
                specialistEvaluateDO.setRelationType(1);
                specialistEvaluateDO.setCreateTime(new Date());
                specialistEvaluateDO.setUpdateTime(new Date());
                doctor = specialistEvaluateDO.getDoctor();
                relationCode = specialistEvaluateDO.getRelationCode();
                patient = specialistEvaluateDO.getPatient();
                SpecialistEvaluateDO specialistEvaluateDO1 = specialistEvaluateDao.save(specialistEvaluateDO);
                SpecialistEvaluateLabelDO specialistEvaluateLabelDO = specialistEvaluateLabelDao.findOne(specialistEvaluateDO.getLabelId());
                specialistEvaluateLabelDO.setSaasId("dev");
                specialistEvaluateLabelDO.setContent(specialistEvaluateDO.getContent());
                specialistEvaluateLabelDO.setDoctor(specialistEvaluateDO1.getDoctor());
                specialistEvaluateLabelDO.setPatient(specialistEvaluateDO1.getPatient());
                specialistEvaluateLabelDO.setEvaluateType(1);
                specialistEvaluateLabelDO.setRelationCode(specialistEvaluateDO.getRelationCode());
                specialistEvaluateLabelDO.setCreateTime(new Date());
                specialistEvaluateLabelDO.setUpdateTime(new Date());
                specialistEvaluateLabelDao.save(specialistEvaluateLabelDO);
                total = total + specialistEvaluateDO.getScore();
            }
        }
        double score = total/3;
        BigDecimal   b   =   new   BigDecimal(score);
        double   f1   =   b.setScale(2,   BigDecimal.ROUND_HALF_UP).doubleValue();
        String sql2 = "select * from wlyy_specialist_evaluate_score where doctor = '"+doctor+"' " +
                "and relation_code = '"+relationCode+"'";
        List<SpecialistEvaluateScoreDO> specialistEvaluateScoreDOS = jdbcTemplate.query(sql2,new BeanPropertyRowMapper(SpecialistEvaluateScoreDO.class));
        SpecialistEvaluateScoreDO specialistEvaluateScoreDO = specialistEvaluateScoreDOS.get(0);
        specialistEvaluateScoreDO.setRelationCode(relationCode);
        specialistEvaluateScoreDO.setEvaluateType(1);
        specialistEvaluateScoreDO.setDoctor(doctor);
        specialistEvaluateScoreDO.setSaasId("dev");
        specialistEvaluateScoreDO.setScore(f1);
        specialistEvaluateScoreDO.setCreateTime(new Date());
        specialistEvaluateScoreDO.setUpdateTime(new Date());
        specialistEvaluateScoreDao.save(specialistEvaluateScoreDO);
        return envelop;
    }
}

+ 103 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistHospitalServiceItemService.java

@ -0,0 +1,103 @@
package com.yihu.jw.service;/**
 * Created by nature of king on 2018/8/28.
 */
import com.yihu.jw.dao.SpecialistHospitalServiceItemDao;
import com.yihu.jw.dao.SpecialistServiceItemDao;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.SpecialistServiceItemDO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
 * @author wangzhinan
 * @create 2018-08-28 19:57
 * @desc 机构服务项目
 **/
@Service
@Transactional
public class SpecialistHospitalServiceItemService extends EnvelopRestEndpoint {
    @Autowired
    private SpecialistHospitalServiceItemDao specialistHospitalServiceItemDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private SpecialistServiceItemDao specialistServiceItemDao;
    /**
     * 添加机构服务项目
     *
     * @param hospitalServiceItemDO
     * @return
     */
    public MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> insert(HospitalServiceItemDO hospitalServiceItemDO){
        MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> envelop = new MixEnvelop<>();
        hospitalServiceItemDO = specialistHospitalServiceItemDao.save(hospitalServiceItemDO);
        List<HospitalServiceItemDO> hospitalServiceItemDOS = new ArrayList<>();
        hospitalServiceItemDOS.add(hospitalServiceItemDO);
        envelop.setDetailModelList(hospitalServiceItemDOS);
        return envelop;
    }
    /**
     * 根据医院code查找数据
     *
     * @param hospitals
     * @return
     */
    public MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> selectByHospital(List<String> hospitals){
        MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> envelop = new MixEnvelop<>();
        StringBuffer buffer = new StringBuffer();
        buffer.append("hospital in (");
        for (int i =0 ;i<hospitals.size();i++){
            buffer.append("'"+hospitals.get(i)+"',");
        }
        buffer.deleteCharAt(buffer.length()-1);
        buffer.append(")");
        String sql = "select * from wlyy_hospital_service_item where "+buffer;
        List<HospitalServiceItemDO> hospitalServiceItemDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(HospitalServiceItemDO.class));
        for (HospitalServiceItemDO hospitalServiceItemDO:hospitalServiceItemDOS){
            SpecialistServiceItemDO specialistServiceItemDO = specialistServiceItemDao.findOne(hospitalServiceItemDO.getServiceItemId());
            hospitalServiceItemDO.setSpecialistServiceItemDO(specialistServiceItemDO);
        }
        envelop.setDetailModelList(hospitalServiceItemDOS);
        return envelop;
    }
    /**
     * 根据id获取服务项目
     *
     * @param hospitalServiceItems
     * @return
     */
    public MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> selectById(List<String> hospitalServiceItems){
        MixEnvelop<HospitalServiceItemDO,HospitalServiceItemDO> envelop = new MixEnvelop<>();
        StringBuffer buffer = new StringBuffer();
        buffer.append("id in (");
        for (int i =0 ;i<hospitalServiceItems.size();i++){
            buffer.append("'"+hospitalServiceItems.get(i)+"',");
        }
        buffer.deleteCharAt(buffer.length()-1);
        buffer.append(")");
        String sql = "select * from wlyy_hospital_service_item where "+buffer;
        List<HospitalServiceItemDO> hospitalServiceItemDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(HospitalServiceItemDO.class));
        for (HospitalServiceItemDO hospitalServiceItemDO:hospitalServiceItemDOS){
            SpecialistServiceItemDO specialistServiceItemDO = specialistServiceItemDao.findOne(hospitalServiceItemDO.getServiceItemId());
            hospitalServiceItemDO.setSpecialistServiceItemDO(specialistServiceItemDO);
        }
        envelop.setDetailModelList(hospitalServiceItemDOS);
        return envelop;
    }
}

+ 25 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistServiceItemService.java

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dao.SpecialistServiceItemDao;
import com.yihu.jw.dao.SpecialistServiceItemOperateLogDao;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.SpecialistEvaluateDO;
import com.yihu.jw.entity.specialist.SpecialistServiceItemDO;
import com.yihu.jw.entity.specialist.SpecialistServiceItemOperateLogDO;
@ -155,4 +156,28 @@ public class SpecialistServiceItemService {
        envelop.setObj(true);
        return envelop;
    }
    /**
     * 根据医院code获取服务项目
     *
     * @param hospital
     * @return
     */
    public MixEnvelop<SpecialistServiceItemDO,SpecialistServiceItemDO> selectByHospital(String hospital){
        MixEnvelop<SpecialistServiceItemDO,SpecialistServiceItemDO> envelop = new MixEnvelop<>();
        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()+"'";
            List<HospitalServiceItemDO> hospitalServiceItemDOS = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(HospitalServiceItemDO.class));
            if (hospitalServiceItemDOS.size() == 0 || hospitalServiceItemDOS == null){
                specialistServiceItemDO.setFlag(1);
            }else {
                specialistServiceItemDO.setFlag(0);
            }
        }
        envelop.setDetailModelList(specialistServiceItemDOS);
        return envelop;
    }
}

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

@ -42,7 +42,8 @@ public class RehabilitationManageService {
    private GuidanceMessageLogDao guidanceMessageLogDao;
    /**
     * 康复管理-- 计划列表
     * 康复管理(专科)-- 计划列表
     * @param doctorType 1.专科,2.家医
     * @param doctorCode
     * @param diseaseCode
     * @param planType
@ -52,29 +53,47 @@ public class RehabilitationManageService {
     * @return
     * @throws Exception
     */
    public MixEnvelop<Map<String,Object>, Map<String,Object>> findRehabilitationPlan(String doctorCode, String diseaseCode, Integer planType,Integer todaybacklog, String patientCondition,Integer page, Integer pageSize) throws Exception{
    public MixEnvelop<Map<String,Object>, Map<String,Object>> findRehabilitationPlan(Integer doctorType,String doctorCode, String diseaseCode, Integer planType,Integer todaybacklog, String patientCondition,Integer page, Integer pageSize) throws Exception{
        String leftSql =" left join "+basedb+".wlyy_sign_family f on f.patient=p.patient ";
        if(StringUtils.isNotEmpty(diseaseCode)){
            leftSql += " left join "+basedb+".wlyy_patient_disease_server s on p.patient=s.patient and s.del=1 and s.disease ='"+diseaseCode+"'" ;
        }
        String leftSql =" left join "+basedb+".wlyy_sign_family f on f.patient=p.patient and f.expenses_status='1' and f.status=1 ";
//        if(StringUtils.isNotEmpty(diseaseCode)){
//            leftSql += " left join "+basedb+".wlyy_patient_disease_server s on p.patient=s.patient and s.del=1 and s.disease ='"+diseaseCode+"'" ;
//        }
        String sql = " select p.*,f.idcard,f.hospital_name from wlyy_specialist.wlyy_patient_rehabilitation_plan p  " +leftSql+
                " where (p.create_user in (select r.health_assistant assistant from " +
                " wlyy_specialist.wlyy_specialist_patient_relation r where r.health_assistant is not null) " +
                " or p.create_user='"+doctorCode+"') " ;
                " where 1=1 " ;
        if(doctorType==1){//专科医生是根据计划的创建者字段过滤
            sql+=" and (p.create_user in (select r.doctor assistant from " +
                    " wlyy_specialist.wlyy_specialist_patient_relation r where r.health_assistant ='"+doctorCode+"') " +
                    " or p.create_user='"+doctorCode+"') ";
        }
        if(planType!=null){
            sql += " and p.plan_type="+planType;
        }
        if(StringUtils.isNotEmpty(diseaseCode)){
            sql+=" and p.disease='"+diseaseCode+"'";
        }
        if(StringUtils.isNotEmpty(patientCondition)){
            sql += " and (f.idcard like '%"+patientCondition+"%' or p.name like '%"+patientCondition+"%') ";
        }
        String finalSql = "";
        String todayStart = DateUtil.getStringDateShort()+" "+"00:00:00";
        String todayEnd = DateUtil.getStringDateShort()+" "+"23:59:59";
        String condition ="";
        if(doctorType==2){//家医是根据计划详情表的执行者字段过滤
            condition+=" and doctor='"+doctorCode+"' ";
        }
        if(todaybacklog!=null&&todaybacklog==1){
            finalSql = " select b.* from (select DISTINCT program_id wlyy_rehabilitation_plan_detail where execute_time>='' and execute_time<='') a "+
                    "LEFT JOIN ("+sql+") b on a.program_id=b.id";
        }else{
            finalSql = " select b.* from ("+sql+") b ";
            condition += " and execute_time>='"+todayStart+"' and execute_time<='"+todayEnd+"'";
        }
        finalSql =" select DISTINCT b.* from (select DISTINCT plan_id from wlyy_specialist.wlyy_rehabilitation_plan_detail where  1=1 "+condition+") a " +
                " LEFT JOIN ("+sql+") b on a.plan_id=b.id ";
//        if(todaybacklog!=null&&todaybacklog==1){
//            finalSql = " select DISTINCT b.* from (select DISTINCT plan_id from wlyy_specialist.wlyy_rehabilitation_plan_detail where execute_time>='"+todayStart+"' and execute_time<='"+todayEnd+"') a "+
//                    "LEFT JOIN ("+sql+") b on a.plan_id=b.id";
//        }else{
//            finalSql = " select b.* from ("+sql+") b ";
//        }
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(finalSql);
        int count = 0;
        if(rstotal!=null&&rstotal.size()>0){
@ -91,7 +110,7 @@ public class RehabilitationManageService {
            resultMap.put("hospitalName",one.get("hospital_name"));
            resultMap.put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
            resultMap.put("patientName",one.get("name"));
            resultMap.put("id",one.get("id"));
            //健康情况
            resultMap.put("healthyCondition","康复期");
            //安排类型
@ -109,15 +128,15 @@ public class RehabilitationManageService {
            Integer todayBacklogCount = rehabilitationDetailDao.todayBacklogCount(1,one.get("id").toString(),beginTime,endTime);
            resultMap.put("todayBacklogCount",todayBacklogCount);//今日待办总数
            //已完成
            Integer finishedCount = rehabilitationDetailDao.completenessCount(2,one.get("id").toString());
            Integer finishedCount = rehabilitationDetailDao.completenessCount(1,one.get("id").toString());
            resultMap.put("finishedCount",finishedCount);//已完成
            //未完成
            Integer notstartedCount = rehabilitationDetailDao.completenessCount(1,one.get("id").toString());//未开始
            Integer underwayCount = rehabilitationDetailDao.completenessCount(1,one.get("id").toString());//进行中
            Integer notstartedCount = rehabilitationDetailDao.completenessCount(0,one.get("id").toString());//未开始
            Integer underwayCount = rehabilitationDetailDao.completenessCount(2,one.get("id").toString());//已预约
            Integer unfinishedCount = notstartedCount+underwayCount;
            resultMap.put("unfinishedCount",unfinishedCount);//未完成
            //完成度(已完成/(已完成+未完成))
            resultMap.put("allCount",finishedCount+unfinishedCount);//未完成
            resultMap.put("allCount",finishedCount+unfinishedCount);//全部
            resultList.add(resultMap);
@ -218,6 +237,13 @@ public class RehabilitationManageService {
//    }
    /**
     * 康复管理更多计划
     * @param doctorCode
     * @param patientCode
     * @return
     * @throws Exception
     */
    public MixEnvelop findRehabilitationPlanDetailList(String doctorCode,String patientCode) throws Exception{
        Map<String,Object> resultMap = new HashMap<>();
        //专科医生
@ -226,20 +252,27 @@ public class RehabilitationManageService {
        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"));//服务记录
        //家庭医生
        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 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+"'";
        List<Map<String,Object>> signFamilyList = jdbcTemplate.queryForList(signFamilySql);
        Map<String,Object> signFamilyMap = signFamilyList.get(0);
        resultMap.put("signFamilyAdminTeamName",signFamilyMap.get("teamName"));
        resultMap.put("signFamilyFinishItemCount",specialistMap.get("teamName"));//完成项目
        resultMap.put("signFamilyServiceRecordCount",specialistMap.get("teamName"));//服务记录
        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("signFamilyFinishItemCount",familyFinishCount-familyUnfinishCount);//完成项目
        resultMap.put("signFamilyServiceRecordCount",familyServiceCount);//服务次数
        //基础信息
        resultMap.put("hospitalName",signFamilyMap.get("hospital_name"));
        Integer age = IdCardUtil.getAgeForIdcard(specialistMap.get("idcard")+"");
        Integer age = IdCardUtil.getAgeForIdcard(signFamilyMap.get("idcard")+"");
        String sex = IdCardUtil.getSexForIdcard_new(signFamilyMap.get("idcard")+"");
        resultMap.put("age",age);
        resultMap.put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
@ -283,7 +316,7 @@ public class RehabilitationManageService {
            Integer unfinishedCount = notstartedCount+underwayCount;
            resultMap.put("unfinishedCount",unfinishedCount);//未完成
            //完成度(已完成/(已完成+未完成))
            resultMap.put("allCount",finishedCount+unfinishedCount);//未完成
            resultMap.put("allCount",finishedCount+unfinishedCount);//总数
            rehabilitationPlanList.add(resultMap);
        }
        resultMap.put("rehabilitationPlanList",rehabilitationPlanList);
@ -470,4 +503,168 @@ public class RehabilitationManageService {
        return MixEnvelop.getError("没有该服务项详情信息!");
    }
    /**
     * 居民详情新增康复管理
     * @param patientCode
     * @param healthDoctor
     * @param healthDoctorName
     * @param generalDoctor
     * @param generalDoctorName
     * @return
     */
    public MixEnvelop patientRehabilitationDetail(String patientCode,String healthDoctor,String healthDoctorName,String generalDoctor,String generalDoctorName){
        Map<String,Object> resultMap = new HashMap<>();
        //个人基础信息(康复机构)
        String patientInfoSql = " SELECT DISTINCT hospital_name from wlyy_specialist.wlyy_rehabilitation_plan_detail d LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " where p.patient='"+patientCode+"' and p.status=1 ";
        List<Map<String,Object>> patientInfoList = jdbcTemplate.queryForList(patientInfoSql);
        Map<String,Object> patientInfo = new HashMap<>();
        String rehabilitationOrg = "";
        for(Map<String,Object> one:patientInfoList){
            rehabilitationOrg+=","+one.get("hospital_name");
        }
        patientInfo.put("rehabilitationOrg",StringUtils.isNotEmpty(rehabilitationOrg)?rehabilitationOrg.substring(1):"");
        resultMap.put("patientInfo",patientInfo);
        //服务医生
        //完成项目=全部的服务项目-未完成的服务项目
        List<Map<String,Object>> serviceDoctorList = new ArrayList<>();
        Map<String,Object> generalDoctorMap =  new HashMap<>();
        generalDoctorMap.put("type","全科医生");
        generalDoctorMap.put("doctorName",generalDoctorName);
        Integer generalUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(generalDoctor,patientCode,1);
        Integer generalFinishCount = rehabilitationDetailDao.findItemByDoctor(generalDoctor,patientCode);
        Integer generalServiceCount = rehabilitationDetailDao.completeServiceByDoctor(generalDoctor,patientCode,1);
        generalDoctorMap.put("finishedItem",generalFinishCount-generalUnfinishCount);
        generalDoctorMap.put("serviceCount",generalServiceCount);
        serviceDoctorList.add(generalDoctorMap);
        Map<String,Object> healthDoctorMap =  new HashMap<>();
        healthDoctorMap.put("type","健管师");
        healthDoctorMap.put("doctorName",healthDoctorName);
        Integer healthUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(healthDoctor,patientCode,1);
        Integer healthFinishCount = rehabilitationDetailDao.findItemByDoctor(healthDoctor,patientCode);
        Integer healthServiceCount = rehabilitationDetailDao.completeServiceByDoctor(healthDoctor,patientCode,1);
        healthDoctorMap.put("finishedItem",healthFinishCount-healthUnfinishCount);
        healthDoctorMap.put("serviceCount",healthServiceCount);
        serviceDoctorList.add(healthDoctorMap);
        String specialistRelationSql = "select * from wlyy_specialist.wlyy_specialist_patient_relation where patient='' and sign_status='1' and status='1'";
        List<Map<String,Object>> specialistRelationList = jdbcTemplate.queryForList(specialistRelationSql);
        for(Map<String,Object> one:specialistRelationList){
            String doctor = one.get("doctor").toString();
            String doctorName = one.get("doctorName").toString();
            Integer unfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(doctor,patientCode,1);
            Integer finishCount = rehabilitationDetailDao.findItemByDoctor(doctor,patientCode);
            Integer serviceCount = rehabilitationDetailDao.completeServiceByDoctor(doctor,patientCode,1);
            Map<String,Object> map =  new HashMap<>();
            map.put("finishedItem",finishCount-unfinishCount);
            map.put("serviceCount",serviceCount);
            map.put("doctorName",doctorName);
            healthDoctorMap.put("type","专科医生");
            serviceDoctorList.add(map);
        }
        resultMap.put("serviceDoctorList",serviceDoctorList);
        //康复计划
        List<Map<String,Object>> planList = new ArrayList<>();
        List<PatientRehabilitationPlanDO> list = patientRehabilitationPlanDao.findbyPatient(patientCode);
        Integer planUnderway = 0;//进行中
        Integer planFinish = 0;//已完成
        for(PatientRehabilitationPlanDO one:list){
            if(one.getStatus()==1){
                planUnderway+=1;
            }else if(one.getStatus()==2){
                planFinish+=1;
            }
            Map<String,Object> map =  new HashMap<>();
            //安排类型
            String planTypeName = null;
            Integer planTypeTemp = one.getPlanType();
            switch (planTypeTemp){
                case 1:planTypeName="康复计划" ;break;
                case 2:planTypeName="(转)社区医院" ;break;
                case 3:planTypeName="(转)转家庭病床" ;break;
            }
            map.put("planTypeName",planTypeName);
            String statusName = "";
            Integer status = one.getStatus();
            switch (status){
                case 0:{statusName="已中止";break;}
                case 1:{statusName="进行中";break;}
                case 2:{statusName="已完成";break;}
            }
            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);//未完成
            //完成度(已完成/(已完成+未完成))
            map.put("allCount",finishedCount+unfinishedCount);//总数
            List<RehabilitationDetailDO> detailList = rehabilitationDetailDao.getAllRehabilitationDetail(one.getId());
            Date executeTimeStart = detailList.get(0).getExecuteTime();
            Date executeTimeEnd = detailList.get(detailList.size()-1).getExecuteTime();
            String executeStart = DateUtil.dateToStr(executeTimeStart,"yyyy/MM/dd");
            String executeEnd = DateUtil.dateToStr(executeTimeEnd,"yyyy/MM/dd");
            map.put("time",executeStart+"-"+executeEnd);
            planList.add(map);
        }
        resultMap.put("planList",planList);
        //康复计划-已完成、进行中
        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 MixEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
    }
}

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

@ -6,6 +6,7 @@ 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;
@ -89,9 +90,9 @@ public class RehabilitationPlanService {
    public MixEnvelop<RehabilitationPlanTemplateDO, RehabilitationPlanTemplateDO> findRehabilitationPlanTemplate(Integer adminTeamCode, Integer page, Integer size) {
        if(page != null && size != null){
            String sql = "select * from wlyy_rehabilitation_plan_template t where t.admin_team_code = '" + adminTeamCode + "' ORDER BY t.create_time DESC LIMIT "+(page-1)*size+","+size;
            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 + "'";
            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 {
@ -100,9 +101,14 @@ public class RehabilitationPlanService {
        }
    }
    /**
     * 根据模板id获取机构服务项目id,然后找出具体服务项目内容
     * @param templateId
     * @return
     */
    public MixEnvelop<RehabilitationTemplateDetailDO, RehabilitationTemplateDetailDO> findTemplateDetailByTemplateId(String templateId) {
        List<RehabilitationTemplateDetailDO> list = templateDetailDao.findTemplateDetailByTemplateId(templateId);
        return MixEnvelop.getSuccessList(SpecialistMapping.api_success,list, list.size());
        List<String> hospitalServiceItemIds = templateDetailDao.findHospitalServiceItemIdByTemplateId(templateId);
        return MixEnvelop.getSuccess(SpecialistMapping.api_success);
    }
    public PatientRehabilitationPlanDO createPatientRehabilitationPlan(PatientRehabilitationPlanDO planDO) {
@ -113,7 +119,9 @@ public class RehabilitationPlanService {
    public List<RehabilitationDetailDO> createRehabilitationDetail(List<RehabilitationDetailDO> details, String planId) {
        for(RehabilitationDetailDO detail : details) {
//            HospitalServiceItemDO hospitalServiceItemDO = hospitalServiceItemService.findById(detail.getHospitalServiceItemId());
            detail.setPlanId(planId);
            detail.setCreateTime(new Date());
            detail.setStatus(0);
        }
        return (List<RehabilitationDetailDO>)rehabilitationDetailDao.save(details);

+ 2 - 1
svr/svr-wlyy-specialist/src/main/resources/application.yml

@ -49,7 +49,8 @@ hibernate:
  show_sql: true
  ejb:
    naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy
  physical_naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
  implicit_naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
fast-dfs:
  tracker-server: 172.19.103.54:22122 #服务器地址
  connect-timeout: 2 #链接超时时间