chenweida il y a 7 ans
Parent
commit
2986436dd9
18 fichiers modifiés avec 1637 ajouts et 88 suppressions
  1. 74 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyCommonDict.java
  2. 90 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDeptDict.java
  3. 67 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDeptStaffAllotDict.java
  4. 111 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDiagnoseClassDict.java
  5. 113 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDiagnoseDict.java
  6. 56 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvOrgPhysicAllotDict.java
  7. 226 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvPhysicDict.java
  8. 148 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvStaffDict.java
  9. 90 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvStaffRegTypeAllotDict.java
  10. 90 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvSubjectClassDict.java
  11. 215 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/ZyDictJob.java
  12. 150 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  13. 105 88
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/hospital/HospitalService.java
  14. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java
  15. 26 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java
  16. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/hospital/HospitalCommonController.java
  17. 22 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionExpressageController.java
  18. 39 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ZyDictController.java

+ 74 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyCommonDict.java

@ -0,0 +1,74 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyCommonDict entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "zy_common_dict")
public class ZyCommonDict extends IdEntity implements java.io.Serializable {
    /**
     * '计量单位字典、药品剂型字典、科室类别字典、注射地点字典、皮试类型字典、费别字典、频次字典、药品毒理分类字典、用药方法字典、性别字典的字典结构';
     */
    // Fields
    private String dictName;//字典名称
    private String code;//编码
    private String name;//名称
    // Constructors
    /**
     * default constructor
     */
    public ZyCommonDict() {
    }
    /**
     * full constructor
     */
    public ZyCommonDict(String dictName, String code, String name) {
        this.dictName = dictName;
        this.code = code;
        this.name = name;
    }
    @Column(name = "dict_name", length = 200)
    public String getDictName() {
        return this.dictName;
    }
    public void setDictName(String dictName) {
        this.dictName = dictName;
    }
    @Column(name = "code", length = 50)
    public String getCode() {
        return this.code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "name", length = 200)
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
}

+ 90 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDeptDict.java

@ -0,0 +1,90 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyIvDeptDict entity. @author MyEclipse Persistence Tools
 * 科室字典
 */
@Entity
@Table(name = "zy_iv_dept_dict")
public class ZyIvDeptDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String deptCode;//科室代码
	private String deptName;//科室名称
	private String deptType;//科室类型  详见科室类型字典中定义
	private String upperDept;//上级科室
	// Constructors
	/** default constructor */
	public ZyIvDeptDict() {
	}
	/** full constructor */
	public ZyIvDeptDict(String orgCode, String deptCode, String deptName,
			String deptType, String upperDept) {
		this.orgCode = orgCode;
		this.deptCode = deptCode;
		this.deptName = deptName;
		this.deptType = deptType;
		this.upperDept = upperDept;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "dept_code", length = 50)
	public String getDeptCode() {
		return this.deptCode;
	}
	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}
	@Column(name = "dept_name", length = 200)
	public String getDeptName() {
		return this.deptName;
	}
	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	@Column(name = "dept_type", length = 50)
	public String getDeptType() {
		return this.deptType;
	}
	public void setDeptType(String deptType) {
		this.deptType = deptType;
	}
	@Column(name = "upper_dept", length = 50)
	public String getUpperDept() {
		return this.upperDept;
	}
	public void setUpperDept(String upperDept) {
		this.upperDept = upperDept;
	}
}

+ 67 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDeptStaffAllotDict.java

@ -0,0 +1,67 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyIvDeptStaffAllotDict entity. @author MyEclipse Persistence Tools
 * 科室员工配置字典
 */
@Entity
@Table(name = "zy_iv_dept_staff_allot_dict")
public class ZyIvDeptStaffAllotDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String deptCode;//科室编码
	private String staffCode;//员工编码
	// Constructors
	/** default constructor */
	public ZyIvDeptStaffAllotDict() {
	}
	/** full constructor */
	public ZyIvDeptStaffAllotDict(String orgCode, String deptCode,
			String staffCode) {
		this.orgCode = orgCode;
		this.deptCode = deptCode;
		this.staffCode = staffCode;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "dept_code", length = 50)
	public String getDeptCode() {
		return this.deptCode;
	}
	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}
	@Column(name = "staff_code", length = 50)
	public String getStaffCode() {
		return this.staffCode;
	}
	public void setStaffCode(String staffCode) {
		this.staffCode = staffCode;
	}
}

+ 111 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDiagnoseClassDict.java

@ -0,0 +1,111 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyIvDiagnoseClassDict entity. @author MyEclipse Persistence Tools
 * 诊断类别字典
 */
@Entity
@Table(name = "zy_iv_diagnose_class_dict")
public class ZyIvDiagnoseClassDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String classSubNo;//类别子序号
	private String classCode;//类别代码
	private String className;//类别名称
	private String upperClass;//上级类别
	private String validFlag;//有效标志  0 :无效;1:有效
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	// Constructors
	/** default constructor */
	public ZyIvDiagnoseClassDict() {
	}
	/** full constructor */
	public ZyIvDiagnoseClassDict(String classSubNo, String classCode,
			String className, String upperClass, String validFlag,
			String spellCode, String wbzxCode) {
		this.classSubNo = classSubNo;
		this.classCode = classCode;
		this.className = className;
		this.upperClass = upperClass;
		this.validFlag = validFlag;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "class_sub_no", length = 200)
	public String getClassSubNo() {
		return this.classSubNo;
	}
	public void setClassSubNo(String classSubNo) {
		this.classSubNo = classSubNo;
	}
	@Column(name = "class_code", length = 200)
	public String getClassCode() {
		return this.classCode;
	}
	public void setClassCode(String classCode) {
		this.classCode = classCode;
	}
	@Column(name = "class_name", length = 2000)
	public String getClassName() {
		return this.className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	@Column(name = "upper_class", length = 200)
	public String getUpperClass() {
		return this.upperClass;
	}
	public void setUpperClass(String upperClass) {
		this.upperClass = upperClass;
	}
	@Column(name = "valid_flag", length = 50)
	public String getValidFlag() {
		return this.validFlag;
	}
	public void setValidFlag(String validFlag) {
		this.validFlag = validFlag;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
}

+ 113 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDiagnoseDict.java

@ -0,0 +1,113 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyIvDiagnoseDict entity. @author MyEclipse Persistence Tools
 * 诊断字典表
 */
@Entity
@Table(name = "zy_iv_diagnose_dict")
public class ZyIvDiagnoseDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String diagnoseCode;//诊断代码
	private String diagnoseName;//诊断名称
	private String diagnoseAlias;//诊断别名
	private String diagnoseClass;//诊断类别  详见诊断类别字典定义
	private String validFlag;//有效标志   0 :无效;1:有效
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	// Constructors
	/** default constructor */
	public ZyIvDiagnoseDict() {
	}
	/** full constructor */
	public ZyIvDiagnoseDict(String diagnoseCode, String diagnoseName,
			String diagnoseAlias, String diagnoseClass, String validFlag,
			String spellCode, String wbzxCode) {
		this.diagnoseCode = diagnoseCode;
		this.diagnoseName = diagnoseName;
		this.diagnoseAlias = diagnoseAlias;
		this.diagnoseClass = diagnoseClass;
		this.validFlag = validFlag;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "diagnose_code", length = 200)
	public String getDiagnoseCode() {
		return this.diagnoseCode;
	}
	public void setDiagnoseCode(String diagnoseCode) {
		this.diagnoseCode = diagnoseCode;
	}
	@Column(name = "diagnose_name", length = 2000)
	public String getDiagnoseName() {
		return this.diagnoseName;
	}
	public void setDiagnoseName(String diagnoseName) {
		this.diagnoseName = diagnoseName;
	}
	@Column(name = "diagnose_alias", length = 2000)
	public String getDiagnoseAlias() {
		return this.diagnoseAlias;
	}
	public void setDiagnoseAlias(String diagnoseAlias) {
		this.diagnoseAlias = diagnoseAlias;
	}
	@Column(name = "diagnose_class", length = 50)
	public String getDiagnoseClass() {
		return this.diagnoseClass;
	}
	public void setDiagnoseClass(String diagnoseClass) {
		this.diagnoseClass = diagnoseClass;
	}
	@Column(name = "valid_flag", length = 50)
	public String getValidFlag() {
		return this.validFlag;
	}
	public void setValidFlag(String validFlag) {
		this.validFlag = validFlag;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
}

+ 56 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvOrgPhysicAllotDict.java

@ -0,0 +1,56 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyIvOrgPhysicAllotDict entity. @author MyEclipse Persistence Tools
 * 机构药品分发字典
 */
@Entity
@Table(name = "zy_iv_org_physic_allot_dict")
public class ZyIvOrgPhysicAllotDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String physicCode;//药品代码
	// Constructors
	/** default constructor */
	public ZyIvOrgPhysicAllotDict() {
	}
	/** full constructor */
	public ZyIvOrgPhysicAllotDict(String orgCode, String physicCode) {
		this.orgCode = orgCode;
		this.physicCode = physicCode;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "physic_code", length = 50)
	public String getPhysicCode() {
		return this.physicCode;
	}
	public void setPhysicCode(String physicCode) {
		this.physicCode = physicCode;
	}
}

+ 226 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvPhysicDict.java

@ -0,0 +1,226 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyIvPhysicDict entity. @author MyEclipse Persistence Tools
 * 药品字典
 */
@Entity
@Table(name = "zy_iv_physic_dict")
public class ZyIvPhysicDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String physicCode;//药品代码
	private String physicName;//药品名称
	private String physicSpec;//药品规格
	private String subjectClass;//药品科目  科目类别字典中定义
	private String doseUnit;//剂量单位 计量单位字典中定义
	private String quantityUnit;//数量单位  计量单位字典中定义
	private String packUnit;//包装单位   计量单位字典中定义
	private Double minDose;//最小剂量
	private Double packSpec;
	private Double retailPrice;//零售价
	private String physicFrom;//药品剂型  药品剂型字典中定义
	private String toxicologyType;//毒理分类  药品毒理分类字典中定义
	private String basicFlag;//基本药物标志  0:否;1:是
	private String validFlag;//有效标志 0:无效;1:有效
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	private Integer sequence;//排序号
	// Constructors
	/** default constructor */
	public ZyIvPhysicDict() {
	}
	/** full constructor */
	public ZyIvPhysicDict(String physicCode, String physicName,
			String physicSpec, String subjectClass, String doseUnit,
			String quantityUnit, String packUnit, Double minDose,
			Double packSpec, Double retailPrice, String physicFrom,
			String toxicologyType, String basicFlag, String validFlag,
			String spellCode, String wbzxCode, Integer sequence) {
		this.physicCode = physicCode;
		this.physicName = physicName;
		this.physicSpec = physicSpec;
		this.subjectClass = subjectClass;
		this.doseUnit = doseUnit;
		this.quantityUnit = quantityUnit;
		this.packUnit = packUnit;
		this.minDose = minDose;
		this.packSpec = packSpec;
		this.retailPrice = retailPrice;
		this.physicFrom = physicFrom;
		this.toxicologyType = toxicologyType;
		this.basicFlag = basicFlag;
		this.validFlag = validFlag;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
		this.sequence = sequence;
	}
	@Column(name = "physic_code", length = 50)
	public String getPhysicCode() {
		return this.physicCode;
	}
	public void setPhysicCode(String physicCode) {
		this.physicCode = physicCode;
	}
	@Column(name = "physic_name", length = 2000)
	public String getPhysicName() {
		return this.physicName;
	}
	public void setPhysicName(String physicName) {
		this.physicName = physicName;
	}
	@Column(name = "physic_spec", length = 2000)
	public String getPhysicSpec() {
		return this.physicSpec;
	}
	public void setPhysicSpec(String physicSpec) {
		this.physicSpec = physicSpec;
	}
	@Column(name = "subject_class", length = 200)
	public String getSubjectClass() {
		return this.subjectClass;
	}
	public void setSubjectClass(String subjectClass) {
		this.subjectClass = subjectClass;
	}
	@Column(name = "dose_unit", length = 50)
	public String getDoseUnit() {
		return this.doseUnit;
	}
	public void setDoseUnit(String doseUnit) {
		this.doseUnit = doseUnit;
	}
	@Column(name = "quantity_unit", length = 50)
	public String getQuantityUnit() {
		return this.quantityUnit;
	}
	public void setQuantityUnit(String quantityUnit) {
		this.quantityUnit = quantityUnit;
	}
	@Column(name = "pack_unit", length = 250)
	public String getPackUnit() {
		return this.packUnit;
	}
	public void setPackUnit(String packUnit) {
		this.packUnit = packUnit;
	}
	@Column(name = "min_dose", precision = 20, scale = 6)
	public Double getMinDose() {
		return this.minDose;
	}
	public void setMinDose(Double minDose) {
		this.minDose = minDose;
	}
	@Column(name = "pack_spec", precision = 20, scale = 6)
	public Double getPackSpec() {
		return this.packSpec;
	}
	public void setPackSpec(Double packSpec) {
		this.packSpec = packSpec;
	}
	@Column(name = "retail_price", precision = 20, scale = 6)
	public Double getRetailPrice() {
		return this.retailPrice;
	}
	public void setRetailPrice(Double retailPrice) {
		this.retailPrice = retailPrice;
	}
	@Column(name = "physic_from", length = 50)
	public String getPhysicFrom() {
		return this.physicFrom;
	}
	public void setPhysicFrom(String physicFrom) {
		this.physicFrom = physicFrom;
	}
	@Column(name = "toxicology_type", length = 250)
	public String getToxicologyType() {
		return this.toxicologyType;
	}
	public void setToxicologyType(String toxicologyType) {
		this.toxicologyType = toxicologyType;
	}
	@Column(name = "basic_flag", length = 50)
	public String getBasicFlag() {
		return this.basicFlag;
	}
	public void setBasicFlag(String basicFlag) {
		this.basicFlag = basicFlag;
	}
	@Column(name = "valid_flag", length = 50)
	public String getValidFlag() {
		return this.validFlag;
	}
	public void setValidFlag(String validFlag) {
		this.validFlag = validFlag;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "sequence")
	public Integer getSequence() {
		return this.sequence;
	}
	public void setSequence(Integer sequence) {
		this.sequence = sequence;
	}
}

+ 148 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvStaffDict.java

@ -0,0 +1,148 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import java.sql.Timestamp;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyIvStaffDict entity. @author MyEclipse Persistence Tools
 * 员工字典
 */
@Entity
@Table(name = "zy_iv_staff_dict")
public class ZyIvStaffDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String staffCode;//员工编码
	private String staffName;//员工姓名
	private String workCode;//工作牌号
	private Date birthday;//出生日期
	private String sex;//性别  详见基础字典中定义
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	private String identityNo;//证件号
	private String certificateNo;//从业资格证编号
	// Constructors
	/** default constructor */
	public ZyIvStaffDict() {
	}
	/** full constructor */
	public ZyIvStaffDict(String orgCode, String staffCode, String staffName,
			String workCode, Timestamp birthday, String sex, String spellCode,
			String wbzxCode, String identityNo, String certificateNo) {
		this.orgCode = orgCode;
		this.staffCode = staffCode;
		this.staffName = staffName;
		this.workCode = workCode;
		this.birthday = birthday;
		this.sex = sex;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
		this.identityNo = identityNo;
		this.certificateNo = certificateNo;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "staff_code", length = 50)
	public String getStaffCode() {
		return this.staffCode;
	}
	public void setStaffCode(String staffCode) {
		this.staffCode = staffCode;
	}
	@Column(name = "staff_name", length = 50)
	public String getStaffName() {
		return this.staffName;
	}
	public void setStaffName(String staffName) {
		this.staffName = staffName;
	}
	@Column(name = "work_code", length = 50)
	public String getWorkCode() {
		return this.workCode;
	}
	public void setWorkCode(String workCode) {
		this.workCode = workCode;
	}
	@Column(name = "birthday", length = 0)
	public Date getBirthday() {
		return this.birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	@Column(name = "sex", length = 50)
	public String getSex() {
		return this.sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "identity_no", length = 200)
	public String getIdentityNo() {
		return this.identityNo;
	}
	public void setIdentityNo(String identityNo) {
		this.identityNo = identityNo;
	}
	@Column(name = "certificate_no", length = 200)
	public String getCertificateNo() {
		return this.certificateNo;
	}
	public void setCertificateNo(String certificateNo) {
		this.certificateNo = certificateNo;
	}
}

+ 90 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvStaffRegTypeAllotDict.java

@ -0,0 +1,90 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyIvStaffRegTypeAllotDict entity. @author MyEclipse Persistence Tools
 * 员工挂号类型配置字典
 */
@Entity
@Table(name = "zy_iv_staff_reg_type_allot_dict")
public class ZyIvStaffRegTypeAllotDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String orgCode;//机构编码
	private String staffCode;//员工编码
	private Integer registerType;//挂号类型编码
	private String registerTypeName;//挂号类型名称
	private Double registerFee;//挂号费用  挂号费+诊察费
	// Constructors
	/** default constructor */
	public ZyIvStaffRegTypeAllotDict() {
	}
	/** full constructor */
	public ZyIvStaffRegTypeAllotDict(String orgCode, String staffCode,
			Integer registerType, String registerTypeName, Double registerFee) {
		this.orgCode = orgCode;
		this.staffCode = staffCode;
		this.registerType = registerType;
		this.registerTypeName = registerTypeName;
		this.registerFee = registerFee;
	}
	@Column(name = "org_code", length = 50)
	public String getOrgCode() {
		return this.orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	@Column(name = "staff_code", length = 50)
	public String getStaffCode() {
		return this.staffCode;
	}
	public void setStaffCode(String staffCode) {
		this.staffCode = staffCode;
	}
	@Column(name = "register_type")
	public Integer getRegisterType() {
		return this.registerType;
	}
	public void setRegisterType(Integer registerType) {
		this.registerType = registerType;
	}
	@Column(name = "register_type_name", length = 2000)
	public String getRegisterTypeName() {
		return this.registerTypeName;
	}
	public void setRegisterTypeName(String registerTypeName) {
		this.registerTypeName = registerTypeName;
	}
	@Column(name = "register_fee", precision = 20, scale = 6)
	public Double getRegisterFee() {
		return this.registerFee;
	}
	public void setRegisterFee(Double registerFee) {
		this.registerFee = registerFee;
	}
}

+ 90 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvSubjectClassDict.java

@ -0,0 +1,90 @@
package com.yihu.wlyy.entity.zydict;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * ZyIvSubjectClassDict entity. @author MyEclipse Persistence Tools
 * 科目类别字典
 */
@Entity
@Table(name = "zy_iv_subject_class_dict")
public class ZyIvSubjectClassDict extends IdEntity implements java.io.Serializable {
	// Fields
	private String classCode;//类别代码
	private String className;//类别名称
	private String upperClass;//上级类别
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	// Constructors
	/** default constructor */
	public ZyIvSubjectClassDict() {
	}
	/** full constructor */
	public ZyIvSubjectClassDict(String classCode, String className,
			String upperClass, String spellCode, String wbzxCode) {
		this.classCode = classCode;
		this.className = className;
		this.upperClass = upperClass;
		this.spellCode = spellCode;
		this.wbzxCode = wbzxCode;
	}
	@Column(name = "class_code", length = 200)
	public String getClassCode() {
		return this.classCode;
	}
	public void setClassCode(String classCode) {
		this.classCode = classCode;
	}
	@Column(name = "class_name", length = 2000)
	public String getClassName() {
		return this.className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	@Column(name = "upper_class", length = 200)
	public String getUpperClass() {
		return this.upperClass;
	}
	public void setUpperClass(String upperClass) {
		this.upperClass = upperClass;
	}
	@Column(name = "spell_code", length = 200)
	public String getSpellCode() {
		return this.spellCode;
	}
	public void setSpellCode(String spellCode) {
		this.spellCode = spellCode;
	}
	@Column(name = "wbzx_code", length = 200)
	public String getWbzxCode() {
		return this.wbzxCode;
	}
	public void setWbzxCode(String wbzxCode) {
		this.wbzxCode = wbzxCode;
	}
}

+ 215 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/ZyDictJob.java

@ -0,0 +1,215 @@
package com.yihu.wlyy.job;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
 * Created by chenweida on 2017/8/10.
 * 每天1点同步 智业的字典数据
 */
public class ZyDictJob implements Job {
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private HospitalDao hospitalDao;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        List<Hospital> hospitals = hospitalDao.findAllHospital();
        //同步 zy_common_dict
        synchronizeZyCommonDict(hospitals);
        //同步 zy_iv_dept_dict
        synchronizeZy_iv_dept_dict(hospitals);
        //同步 zy_iv_dept_staff_allot_dict
        synchronizeZy_iv_dept_staff_allot_dict(hospitals);
        //同步 zy_iv_diagnose_class_dict
        synchronizeZy_iv_diagnose_class_dict(hospitals);
        //同步 zy_iv_org_physic_allot_dict
        synchronizeZy_iv_org_physic_allot_dict(hospitals);
        //同步 zy_iv_physic_dict
        synchronizeZy_iv_physic_dict(hospitals);
        //同步 zy_iv_staff_dict
        synchronizeZ_iv_staff_dict(hospitals);
        //同步 zy_iv_staff_reg_type_allot_dict
        synchronizeZy_iv_staff_reg_type_allot_dict(hospitals);
        //同步 zy_iv_subject_class_dict
        synchronizeZy_iv_subject_class_dict(hospitals);
    }
    private void synchronizeZy_iv_subject_class_dict(List<Hospital> hospitals) {
    }
    private void synchronizeZy_iv_staff_reg_type_allot_dict(List<Hospital> hospitals) {
    }
    private void synchronizeZ_iv_staff_dict(List<Hospital> hospitals) {
    }
    private void synchronizeZy_iv_physic_dict(List<Hospital> hospitals) {
    }
    private void synchronizeZy_iv_org_physic_allot_dict(List<Hospital> hospitals) {
    }
    private void synchronizeZy_iv_diagnose_class_dict(List<Hospital> hospitals) {
    }
    private void synchronizeZy_iv_dept_staff_allot_dict(List<Hospital> hospitals) {
    }
    private void synchronizeZyCommonDict(List<Hospital> hospitals) {
        String[] dictNames = new String[]{
                this.IV_PHYSIC_FORM_DICT, this.IV_PHYSIC_INJECT_PLACE_DICT, this.IV_PHYSIC_SKIN_TEST_DICT,
                this.IV_RATE_TYPE_DICT, this.IV_RECIPE_FREQUENCY_DICT, this.IV_RECIPE_USAGE_DICT,
                this.IV_SEX_DICT, this.IV_PHYSIC_TOXICOLOGY_TYPE_DICT, this.IV_MEASURE_UNIT_DICT,
                this.IV_DEPT_TYPE_DICT};
        for (String dictName : dictNames) {
        }
    }
    private void synchronizeZy_iv_dept_dict(List<Hospital> hospitals) {
    }
    /**
     * 智业的字典
     */
    public static final String IV_MEASURE_UNIT_DICT = "IV_MEASURE_UNIT_DICT";//("计量单位字典", "IV_MEASURE_UNIT_DICT"),
    public static final String IV_PHYSIC_FORM_DICT = " IV_PHYSIC_FORM_DICT";//("药品剂型字典", "IV_PHYSIC_FORM_DICT"),
    public static final String IV_PHYSIC_INJECT_PLACE_DICT = " IV_PHYSIC_INJECT_PLACE_DICT(";//"计量单位字典", "IV_PHYSIC_INJECT_PLACE_DICT"),
    public static final String IV_PHYSIC_SKIN_TEST_DICT = " IV_PHYSIC_SKIN_TEST_DICT";//("皮试类型字典", "IV_PHYSIC_SKIN_TEST_DICT"),
    public static final String IV_RATE_TYPE_DICT = " IV_RATE_TYPE_DICT";//("费别字典", "IV_RATE_TYPE_DICT"),
    public static final String IV_RECIPE_FREQUENCY_DICT = " IV_RECIPE_FREQUENCY_DICT";//("频次字典", "IV_RECIPE_FREQUENCY_DICT"),
    public static final String IV_RECIPE_USAGE_DICT = " IV_RECIPE_USAGE_DICT";//("用药方法字典", "IV_RECIPE_USAGE_DICT"),
    public static final String IV_SEX_DICT = " IV_SEX_DICT";//("性别字典", "IV_SEX_DICT"),
    public static final String IV_PHYSIC_DICT = " IV_PHYSIC_DICT";//("药品字典", "IV_PHYSIC_DICT"),
    public static final String IV_ORG_PHYSIC_ALLOT_DICT = " IV_ORG_PHYSIC_ALLOT_DICT";//("机构药品分发字典", "IV_ORG_PHYSIC_ALLOT_DICT "),
    public static final String IV_SUBJECT_CLASS_DICT = " IV_SUBJECT_CLASS_DICT";//("科目类别字典", "IV_SUBJECT_CLASS_DICT"),
    public static final String IV_PHYSIC_TOXICOLOGY_TYPE_DICT = " IV_PHYSIC_TOXICOLOGY_TYPE_DICT";//("药品毒理分类字典", "IV_PHYSIC_TOXICOLOGY_TYPE_DICT"),
    public static final String IV_DEPT_DICT = " IV_DEPT_DICT";//("科室字典", "IV_DEPT_DICT"),
    public static final String IV_DEPT_TYPE_DICT = " IV_DEPT_TYPE_DICT";//("科室类型字典", "IV_DEPT_TYPE_DICT"),
    public static final String IV_DIAGNOSE_DICT = " IV_DIAGNOSE_DICT";//("诊断字典", "IV_DIAGNOSE_DICT"),
    public static final String IV_DIAGNOSE_CLASS_DICT = " IV_DIAGNOSE_CLASS_DICT";//("诊断类别字典", "IV_DIAGNOSE_CLASS_DICT"),
    public static final String IV_STAFF_DICT = " IV_STAFF_DICT";//("员工字典", "IV_STAFF_DICT"),
    public static final String IV_STAFF_REG_TYPE_ALLOT_DICT = " IV_STAFF_REG_TYPE_ALLOT_DICT";//("员工挂号类型配置字典", "IV_STAFF_REG_TYPE_ALLOT_DICT"),
    public static final String IV_DEPT_STAFF_ALLOT_DICT = " IV_DEPT_STAFF_ALLOT_DICT";//("科室员工配置字典", "IV_DEPT_STAFF_ALLOT_DICT");
    public enum TableName {
        zy_common_dict("通用字典", "zy_common_dict"),
        zy_iv_dept_dict("科室字典", "zy_iv_dept_dict"),
        zy_iv_dept_staff_allot_dict("科室员工配置字典", "zy_iv_dept_staff_allot_dict"),
        zy_iv_diagnose_class_dict("诊断类别字典", "zy_iv_diagnose_class_dict"),
        zy_iv_diagnose_dict("诊断字典表", "zy_iv_diagnose_dict"),
        zy_iv_org_physic_allot_dict("机构药品分发字典", "zy_iv_org_physic_allot_dict"),
        zy_iv_physic_dict("药品字典", "zy_iv_physic_dict"),
        zy_iv_staff_dict("员工字典", "zy_iv_staff_dict"),
        zy_iv_staff_reg_type_allot_dict("员工挂号类型配置字典", "zy_iv_staff_reg_type_allot_dict"),
        zy_iv_subject_class_dict("科目类别字典", "zy_iv_subject_class_dict");
        TableName(String name, String dict) {
            this.name = name;
            this.dict = dict;
        }
        private String name;
        private String dict;
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getDict() {
            return dict;
        }
        public void setDict(String dict) {
            this.dict = dict;
        }
    }
    /**
     * 根据字典获取表名
     *
     * @param dictName
     * @return
     */
    public String getTableName(String dictName) {
        switch (dictName) {
            case IV_PHYSIC_FORM_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_PHYSIC_INJECT_PLACE_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_PHYSIC_SKIN_TEST_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_RATE_TYPE_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_RECIPE_FREQUENCY_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_RECIPE_USAGE_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_SEX_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_PHYSIC_TOXICOLOGY_TYPE_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_MEASURE_UNIT_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_DEPT_TYPE_DICT: {
                return TableName.zy_common_dict.getDict();
            }
            case IV_PHYSIC_DICT: {
                return TableName.zy_iv_physic_dict.getDict();
            }
            case IV_ORG_PHYSIC_ALLOT_DICT: {
                return TableName.zy_iv_org_physic_allot_dict.getDict();
            }
            case IV_SUBJECT_CLASS_DICT: {
                return TableName.zy_iv_subject_class_dict.getDict();
            }
            case IV_DIAGNOSE_DICT: {
                return TableName.zy_iv_diagnose_dict.getDict();
            }
            case IV_DIAGNOSE_CLASS_DICT: {
                return TableName.zy_iv_diagnose_class_dict.getDict();
            }
            case IV_STAFF_DICT: {
                return TableName.zy_iv_staff_dict.getDict();
            }
            case IV_STAFF_REG_TYPE_ALLOT_DICT: {
                return TableName.zy_iv_staff_reg_type_allot_dict.getDict();
            }
            case IV_DEPT_STAFF_ALLOT_DICT: {
                return TableName.zy_iv_dept_staff_allot_dict.getDict();
            }
            case IV_DEPT_DICT: {
                return TableName.zy_iv_dept_dict.getDict();
            }
        }
        return "";
    }
}

+ 150 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -0,0 +1,150 @@
package com.yihu.wlyy.service.third.jw;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * 基位长处方接口
 * Created by yeshijie on 2017/8/3.
 */
@Service
public class JwPrescriptionService {
    //基卫服务地址
    @Value("${sign.check_upload}")
    private String jwUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    /**
     * 获取字典列表
     * @param dictName 字典名称
     * @param hospital 药品code
     * @return
     * @throws Exception
     */
    public String getDictForI(String dictName,String hospital) throws Exception{
        String url = jwUrl + "/third/prescription/getDictForI";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取处方模板
     * @param deptCode 科室编码
     * @param staffCode 人员code
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getRecipeTemplate(String deptCode,String staffCode, String hospital) throws Exception{
        String url = jwUrl + "/third/prescription/getRecipeTemplate";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("deptCode", deptCode));
        params.add(new BasicNameValuePair("staffCode", staffCode));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取历史处方记录
     * @param cardNo 社保卡号
     * @param recipeNo 医嘱号
     * @param applyTimeFrom 开始时间
     * @param applyTimeEnd 结束时间
     * @return
     * @throws Exception
     */
    public String getLastRecipe(String cardNo,String recipeNo,String applyTimeFrom,String applyTimeEnd) throws Exception{
        String url = jwUrl + "/third/prescription/getLastRecipe";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("cardNo", cardNo));
        params.add(new BasicNameValuePair("recipeNo", recipeNo));
        params.add(new BasicNameValuePair("applyTimeFrom", applyTimeFrom));
        params.add(new BasicNameValuePair("applyTimeEnd", applyTimeEnd));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 处方开方接口
     * @param prescriptionCode 续方code
     * @return
     * @throws Exception
     */
    public String saveRecipe(String prescriptionCode) throws Exception{
        String url = jwUrl + "/third/prescription/saveRecipe";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 待结算费用列表接口
     * @param cardNo
     * @param visitNo
     * @return
     * @throws Exception
     */
    public String getDispUnSettleFeeInfoList(String cardNo,String visitNo) throws Exception{
        String url = jwUrl + "/third/prescription/getDispUnSettleFeeInfoList";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("cardNo", cardNo));
        params.add(new BasicNameValuePair("visitNo", visitNo));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    public String executeSickSettle(String dictName) throws Exception{
        String url = jwUrl + "/third/prescription/executeSickSettle";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 挂号作废处方接口
     * @param visitNo 挂号号
     * @param fadeDept 作废科室编码
     * @param fadeOperator 作废人员编码
     * @return
     * @throws Exception
     */
    public String fadeRecipe(String visitNo,String fadeDept,String fadeOperator)throws Exception{
        String url = jwUrl + "/third/prescription/fadeRecipe";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("visitNo", visitNo));//挂号号
        params.add(new BasicNameValuePair("fadeDept", fadeDept));//作废科室编码
        params.add(new BasicNameValuePair("fadeOperator", fadeOperator));//作废人员编码
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
}

+ 105 - 88
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/hospital/HospitalService.java

@ -30,93 +30,110 @@ import com.yihu.wlyy.service.BaseService;
@Transactional(rollbackFor = Exception.class)
public class HospitalService extends BaseService {
	@Autowired
	private HospitalDao hospitalDao;
	@Autowired
	private TownDao townDao;
	@Autowired
	JdbcTemplate jdbcTemplate;
	/**
	 * 获取医院列表
	 * @param query 查询条件 :医院名称
	 * @param id 
	 * @return
	 */
	public Page<Hospital> getHospitalList(String query, int type, long id, int pageSize) {
		if (pageSize <= 0) {
			pageSize = 10;
		}
		// 排序
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pageSize, sort);
		// 查询全部
		Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
		if (StringUtils.isNotEmpty(query)) {
			filters.put("name", new SearchFilter("name", Operator.LIKE, query));
		}
		//只能找社区签约
		filters.put("level", new SearchFilter("level", Operator.EQ,2));
		//排除站点
		filters.put("centerSite", new SearchFilter("centerSite", Operator.EQ,"00"));
		if (id > 0) {
			filters.put("id", new SearchFilter("id", Operator.LT, id));
		}
		// 未作废
		filters.put("del", new SearchFilter("del", Operator.EQ, "1"));
		Specification<Hospital> spec = DynamicSpecifications.bySearchFilter(filters.values(), Hospital.class);
		return hospitalDao.findAll(spec, pageRequest);
	}
	public List<Town> getTownByCityCode(String city) {
		return townDao.findByCityCode(city);
	}
	public List<Hospital> getHositalByTownCode(String town) {
		return hospitalDao.findByTownCode(town);
	}
	/**
	 * 查询医院列表
	 *
	 * @param type
	 * @param province
	 * @param city
	 * @param town
	 * @param key
	 * @param page
	 * @param pagesize
	 * @return
	 */
	public List<Hospital> getHospitals(int type,String province,String city,String town,String key,int page,int pagesize){
		String sql = "select * from dm_hospital where exists (select * from wlyy_doctor where wlyy_doctor.hospital = dm_hospital.code) and level = ? ";
		List<Object> args = new ArrayList<>();
		args.add(type);
		if(StringUtils.isNotEmpty(province)){
			sql += " and province = ? ";
			args.add(province);
		}
		if(StringUtils.isNotEmpty(city)){
			sql += " and city = ? ";
			args.add(city);
		}
		if(StringUtils.isNotEmpty(town)){
			sql += " and town = ? ";
			args.add(town);
		}
		if(StringUtils.isNotEmpty(key)){
			sql += " and name like ? ";
			args.add("%" + key + "%");
		}
		sql += " limit "+ (page*pagesize) + "," + pagesize;
		List<Hospital> hosList = jdbcTemplate.query(sql,args.toArray(),new BeanPropertyRowMapper(Hospital.class));
		return hosList;
	}
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private TownDao townDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
    /**
     * 获取医院列表
     *
     * @param query 查询条件 :医院名称
     * @param id
     * @return
     */
    public Page<Hospital> getHospitalList(String query, int type, long id, int pageSize) {
        if (pageSize <= 0) {
            pageSize = 10;
        }
        // 排序
        Sort sort = new Sort(Direction.DESC, "id");
        // 分页信息
        PageRequest pageRequest = new PageRequest(0, pageSize, sort);
        // 查询全部
        Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
        if (StringUtils.isNotEmpty(query)) {
            filters.put("name", new SearchFilter("name", Operator.LIKE, query));
        }
        //只能找社区签约
        filters.put("level", new SearchFilter("level", Operator.EQ, 2));
        //排除站点
        filters.put("centerSite", new SearchFilter("centerSite", Operator.EQ, "00"));
        if (id > 0) {
            filters.put("id", new SearchFilter("id", Operator.LT, id));
        }
        // 未作废
        filters.put("del", new SearchFilter("del", Operator.EQ, "1"));
        Specification<Hospital> spec = DynamicSpecifications.bySearchFilter(filters.values(), Hospital.class);
        return hospitalDao.findAll(spec, pageRequest);
    }
    public List<Town> getTownByCityCode(String city) {
        return townDao.findByCityCode(city);
    }
    public List<Hospital> getHositalByTownCode(String town) {
        return hospitalDao.findByTownCode(town);
    }
    /**
     * 查询医院列表
     *
     * @param type
     * @param province
     * @param city
     * @param town
     * @param key
     * @param page
     * @param pagesize
     * @return
     */
    public List<Hospital> getHospitals(int type, String province, String city, String town, String key, int page, int pagesize) {
        String sql = "select * from dm_hospital where exists (select * from wlyy_doctor where wlyy_doctor.hospital = dm_hospital.code) and level = ? ";
        List<Object> args = new ArrayList<>();
        args.add(type);
        if (StringUtils.isNotEmpty(province)) {
            sql += " and province = ? ";
            args.add(province);
        }
        if (StringUtils.isNotEmpty(city)) {
            sql += " and city = ? ";
            args.add(city);
        }
        if (StringUtils.isNotEmpty(town)) {
            sql += " and town = ? ";
            args.add(town);
        }
        if (StringUtils.isNotEmpty(key)) {
            sql += " and name like ? ";
            args.add("%" + key + "%");
        }
        sql += " limit " + (page * pagesize) + "," + pagesize;
        List<Hospital> hosList = jdbcTemplate.query(sql, args.toArray(), new BeanPropertyRowMapper(Hospital.class));
        return hosList;
    }
    public List<Hospital> getHospitalsNot00(String doctorCode) {
        String sql = "SELECT " +
                "  h.* " +
                " FROM " +
                "  dm_hospital h, " +
                "  wlyy_doctor d " +
                " WHERE " +
                "  LEFT (d.hospital, 8) = LEFT (h. CODE, 8) " +
                " AND d. CODE = '" + doctorCode +
                "'AND d.hospital != h.`code`";
        List<Hospital> hosList = jdbcTemplate.query(sql, new BeanPropertyRowMapper(Hospital.class));
        return hosList;
    }
}

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -313,4 +313,8 @@ public class PrescriptionExpressageService {
        prescriptionLog.setRemark("团队长分配健管师配送");
        prescriptionLogDao.save(prescriptionLog);
    }
    @Transactional
    public void expressage2Hospital(String hospital, String hospitalName, String hospitalAddress, String userCode, String userName, String mobile, String prescriptionCode) {
    }
}

+ 26 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java

@ -0,0 +1,26 @@
package com.yihu.wlyy.service.third.jw;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.repository.organization.HospitalDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * Created by chenweida on 2017/8/10.
 */
@Service
public class ZyDictService {
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private HospitalDao hospitalDao;
    @Transactional
    public void synchronousDict(String dictName) {
        //得到全部的机构医院
        List<Hospital> hospitals = hospitalDao.findAllHospital();
    }
}

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/hospital/HospitalCommonController.java

@ -32,4 +32,15 @@ public class HospitalCommonController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    @RequestMapping(value = "/getHospitalsNot00",method = RequestMethod.GET)
    @ApiOperation(value = "查询健管师所属的社区下的服务站")
    public String getHospitalsNot00() {
        try {
            List<Hospital> hospitals = hospitalService.getHospitalsNot00(getUID());
            return write(200, "查询成功", "data", hospitals == null ? new ArrayList<Hospital>() : hospitals);
        } catch (Exception e) {
            return error(-1, "查询失败");
        }
    }
}

+ 22 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionExpressageController.java

@ -49,4 +49,26 @@ public class PrescriptionExpressageController extends WeixinBaseController {
        }
    }
    /**
     * 确认接收 药品
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/expressage2Hospital", method = RequestMethod.POST)
    @ApiOperation(value = "健管师配送的时候分配健管师")
    public String expressage2Hospital(
            @ApiParam(required = true, name = "hospital", value = "机构code") @RequestParam(value = "hospital", required = true) String hospital,
            @ApiParam(required = true, name = "hospitalName", value = "机构名称") @RequestParam(value = "hospitalName", required = true) String hospitalName,
            @ApiParam(required = true, name = "hospitalAddress", value = "机构地址") @RequestParam(value = "hospitalAddress", required = true) String hospitalAddress,
            @ApiParam(required = true, name = "userCode", value = "接收人code") @RequestParam(value = "userCode", required = true) String userCode,
            @ApiParam(required = true, name = "userName", value = "接收人Name") @RequestParam(value = "userName", required = true) String userName,
            @ApiParam(required = true, name = "mobile", value = "电话号码") @RequestParam(value = "mobile", required = true) String mobile,
            @ApiParam(required = true, name = "prescriptionCode", value = "处方code") @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode) throws Exception {
        try {
            expressageService.expressage2Hospital(hospital,hospitalName,hospitalAddress,userCode,userName,mobile,prescriptionCode);
            return success("修改成功");
        } catch (Exception e) {
            return error(-1, "获取失败");
        }
    }
}

+ 39 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ZyDictController.java

@ -0,0 +1,39 @@
package com.yihu.wlyy.web.third;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.service.third.jw.ZyDictService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/8/10.
 * 智业字典同步接口
 */
@RestController
@RequestMapping("/third/dict/")
public class ZyDictController extends BaseController {
    @Autowired
    private ZyDictService zyDictService;
    @ApiOperation("同步智业字典")
    @RequestMapping(value = "/synchronousDict", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public String synchronousDict(
            @ApiParam(name = "dictName", value = "字典名称", defaultValue = "")
            @RequestParam(value = "dictName", required = true) String dictName) {
        try {
            zyDictService.synchronousDict(dictName);
            return write(200, "同步智业字典!");
        } catch (Exception e) {
            return invalidUserException(e, -1, "获取门/急诊数据失败!");
        }
    }
}