瀏覽代碼

基卫接口:返回支付信息

huangwenjie 7 年之前
父節點
當前提交
c45c30317d
共有 33 個文件被更改,包括 1850 次插入228 次删除
  1. 9 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionDiagnosis.java
  2. 67 3
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressage.java
  3. 74 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyCommonDict.java
  4. 90 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDeptDict.java
  5. 67 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDeptStaffAllotDict.java
  6. 111 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDiagnoseClassDict.java
  7. 113 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvDiagnoseDict.java
  8. 56 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvOrgPhysicAllotDict.java
  9. 226 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvPhysicDict.java
  10. 148 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvStaffDict.java
  11. 90 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvStaffRegTypeAllotDict.java
  12. 90 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvSubjectClassDict.java
  13. 5 15
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java
  14. 2 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/DoctorMapping.java
  15. 1 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftBaseService.java
  16. 71 72
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionCAService.java
  17. 18 12
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java
  18. 215 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/ZyDictJob.java
  19. 150 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  20. 1 1
      patient-co/patient-co-wlyy/pom.xml
  21. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  22. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDispensaryCodeDao.java
  23. 105 88
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/hospital/HospitalService.java
  24. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  25. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java
  26. 11 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java
  27. 4 16
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  28. 26 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java
  29. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/hospital/HospitalCommonController.java
  30. 4 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java
  31. 22 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionExpressageController.java
  32. 39 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ZyDictController.java
  33. 10 10
      patient-co/patient-co-wlyy/src/main/resources/logback.xml

+ 9 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionDiagnosis.java

@ -18,6 +18,7 @@ public class PrescriptionDiagnosis  extends IdEntity {
    private String code;
    private String prescriptionCode;
    private String name;
    private Integer type;//1主诊断 2次诊断
    private Date createTime;
    private Date updateTime;
@ -60,4 +61,12 @@ public class PrescriptionDiagnosis  extends IdEntity {
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
}

+ 67 - 3
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressage.java

@ -34,10 +34,22 @@ public class PrescriptionExpressage extends IdEntity{
    private String streetName;              //收货人街道名称
    private Integer price;                    //快递的配送费用 单位是分
    private Integer weight;                  //快递重量  单位是g
    //患者填写的需要送达的机构信息
    private String  patientHospitalAddress;         // 患者填写的需要送达的机构地址
    private String  patientHospitalName;            // 患者填写的需要送达的机构名称
    private String  patientHospitalCode;            // 患者填写的需要送达的机构code
    //配药机构信息
    private String hospitalAddress;         // 配药机构地址
    private String hospitalName;            // 配药机构名称
    private String hospitalCode;            // 配药机构code
    //配送人信息
    private String hospitalName;            // 如果配送方式是健管师那么这个字段存服务站名称,如果是快递配送那么是快递公司名称
    private String hospitalAddress;         // 配送机构地址
    private String hospitalCode;            //配送机构code
    private String expressageHospitalName;            // 如果配送方式是健管师那么这个字段存服务站名称,如果是快递配送那么是快递公司名称
    private String expressageHospitalAddress;         // 配送机构地址
    private String expressageHospitalCode;            //配送机构code
    private String expressageName;          //配送人名称
    private String expressageCode;          //配送人code
    private String expressageMobile;        //配送人电话
@ -51,6 +63,7 @@ public class PrescriptionExpressage extends IdEntity{
    private String acceptHospitalName;        //医院药品接收人名称
    private Date acceptTime;                //接收的时间
    private Integer oneselfPickupFlg;//是否自取 1是 0否
    private Date createTime;                //创建的时间
    private Integer del;    //1可用 0删除
@ -310,6 +323,7 @@ public class PrescriptionExpressage extends IdEntity{
        this.expressageTime = expressageTime;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getAcceptTime() {
        return acceptTime;
    }
@ -317,4 +331,54 @@ public class PrescriptionExpressage extends IdEntity{
    public void setAcceptTime(Date acceptTime) {
        this.acceptTime = acceptTime;
    }
    public String getExpressageHospitalName() {
        return expressageHospitalName;
    }
    public void setExpressageHospitalName(String expressageHospitalName) {
        this.expressageHospitalName = expressageHospitalName;
    }
    public String getExpressageHospitalAddress() {
        return expressageHospitalAddress;
    }
    public void setExpressageHospitalAddress(String expressageHospitalAddress) {
        this.expressageHospitalAddress = expressageHospitalAddress;
    }
    public String getExpressageHospitalCode() {
        return expressageHospitalCode;
    }
    public void setExpressageHospitalCode(String expressageHospitalCode) {
        this.expressageHospitalCode = expressageHospitalCode;
    }
    public String getPatientHospitalAddress() {
        return patientHospitalAddress;
    }
    public void setPatientHospitalAddress(String patientHospitalAddress) {
        this.patientHospitalAddress = patientHospitalAddress;
    }
    public String getPatientHospitalName() {
        return patientHospitalName;
    }
    public void setPatientHospitalName(String patientHospitalName) {
        this.patientHospitalName = patientHospitalName;
    }
    public String getPatientHospitalCode() {
        return patientHospitalCode;
    }
    public void setPatientHospitalCode(String patientHospitalCode) {
        this.patientHospitalCode = patientHospitalCode;
    }
}

+ 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;
	}
}

+ 5 - 15
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java

@ -1,15 +1,12 @@
package com.yihu.wlyy.service.controller;
import com.yihu.wlyy.service.common.model.Result;
import com.yihu.wlyy.service.entity.prescription.Prescription;
import com.yihu.wlyy.service.entity.prescription.PrescriptionPay;
import com.yihu.wlyy.service.service.prescription.PrescriptionCAService;
import com.yihu.wlyy.service.service.prescription.PrescriptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -105,13 +102,11 @@ public class PrescriptionController extends BaseController{
	@RequestMapping(value = "getDictForI",method = RequestMethod.POST)
	@ApiOperation("字典获取接口")
	public Result getDictForI(@ApiParam(name="dictName",value="字典名称",defaultValue = "IV_PHYSIC_DICT")
							  @RequestParam(value = "dictName",required = true) String dictName,
							  @ApiParam(name="hospital",value="医院code",defaultValue = "3502050200")
							  @RequestParam(value = "hospital",required = true) String hospital)
							  @RequestParam(value = "dictName",required = true) String dictName)
	{
		try {
			String re = prescriptionService.getDictForI(dictName,hospital);
			String re = prescriptionService.getDictForI(dictName);
			return Result.success("字典获取接口成功!",re);
		} catch (Exception ex) {
@ -122,16 +117,11 @@ public class PrescriptionController extends BaseController{
	@RequestMapping(value = "getRecipeTemplate",method = RequestMethod.POST)
	@ApiOperation("处方模板获取接口")
	public Result getRecipeTemplate(@ApiParam(name="deptCode",value="科室编码",defaultValue = "5")
									@RequestParam(value = "deptCode",required = true) String deptCode,
									@ApiParam(name="staffCode",value="人员code",defaultValue = "7")
									@RequestParam(value = "staffCode",required = true) String staffCode,
									@ApiParam(name="hospital",value="医院code",defaultValue = "")
									@RequestParam(value = "hospital",required = false) String hospital)
	public Result getRecipeTemplate(@ApiParam(name="doctor",value="医生code",defaultValue = "5")
									@RequestParam(value = "doctor",required = true) String doctor)
	{
		try {
			String re = prescriptionService.getRecipeTemplate(staffCode,deptCode,hospital);
			String re = prescriptionService.getRecipeTemplate(doctor);
			return Result.success("处方模板获取接口!",re);
		} catch (Exception ex) {

+ 2 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/DoctorMapping.java

@ -23,6 +23,8 @@ public class DoctorMapping extends IdEntity {
	private String jwDocotrSex;
	// 基卫医生身份证
	private String jwDocotrIdcard;
	//基位医生科室代码
//	private String jwDept;
	// 基卫医生医院
	private String jwDoctorHospital;
	// 基卫医生医院名称

+ 1 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftBaseService.java

@ -227,6 +227,7 @@ public class ZysoftBaseService {
                throw new HttpApiException(Integer.valueOf(code),map.get("MESSAGE"));
            }
//            com.alibaba.fastjson.JSONObject j = com.alibaba.fastjson.JSONObject.parseObject(re);
            //保存http日志
            logService.saveHttpLog(isSuccess,api,content,method,msgHeader,msgBody,re,error);
        }

+ 71 - 72
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionCAService.java

@ -2,7 +2,6 @@ package com.yihu.wlyy.service.service.prescription;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.common.SystemConfig;
import com.yihu.wlyy.service.common.util.MD5Util;
import com.yihu.wlyy.service.common.util.StringUtil;
import com.yihu.wlyy.service.common.util.WebserviceUtil;
import com.yihu.wlyy.service.service.LogService;
@ -321,75 +320,75 @@ public class PrescriptionCAService {
        return re;
    }
    public static void main(String args[]) {
        try {
            String caUrl = SystemConfig.getInstance().getCAUrl();
            String caNamespace = SystemConfig.getInstance().getCANamespace();
            /*//获取实名软证书的过期时间
            String api = "XMCAF_SOFT_getRealNameSoftCertExpiredDatetime";
            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n"+
                    "    <strUserIdcardNum>123456</strUserIdcardNum>\n" +
                    "</root>";*/
            /*//判断实名软证书是否已申请
            String api = "XMCAF_SOFT_judgeRealNameSoftCertIsApplied";
            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n"+
                    "    <strUserIdcardNum>123456</strUserIdcardNum>\n" +
                    "</root>";*/
            //修改实名软证书调用保护口令
            String api = "XMCAF_SOFT_ModifyRealNameSoftCertCalledPasswd";
            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n"+
                    "    <strUserIdcardNum>123456</strUserIdcardNum>\n" +
                    "   <strOldCalledPasswd>12345678</strOldCalledPasswd>\n" +
                    "   <strNewCalledPasswd>11111111</strNewCalledPasswd>\n" +
                    "</root>";
            //请求实名软证书并进行数字签名
            /*String orgData = "测试数据";
            String api = "XMCAF_SOFT_requestRealNameSoftCertAndSign";
            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n"+
                    "   <strUserIdcardNum>123456</strUserIdcardNum>\n" +
                    "   <strRealNameSoftCertCalledPasswd>11111111</strRealNameSoftCertCalledPasswd>\n" +
                    "   <strOriginalData>"+ MD5Util.GetMD5Code(orgData)+"</strOriginalData>\n" +
                    "</root>";*/
            String msgHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n" +
                    "   <serverName>"+api+"</serverName>\n" +
                    "   <format>xml</format>\n" +
                    "   <callOperator></callOperator>\n" +
                    "   <certificate></certificate>\n" +
                    "   <srcIP>10.95.22.10</srcIP >\n" +
                    "   <srcUserMac>60-D8-19-57-66-E3</srcUserMac>\n" +
                    "   <srcSystemCode>1</srcSystemCode>\n" +
                    "   <srcSystemName>厦门i健康</srcSystemName>\n" +
                    "   <srcBusinessNodeCode>node01</srcBusinessNodeCode>\n" +
                    "   <srcBusinessNodeName>审核</srcBusinessNodeName>\n" +
                    "   <srcOperatorAccount>Zhuangsd</srcOperatorAccount>\n" +
                    "   <srcBusinessStreamNO>11111</srcBusinessStreamNO>\n" +
                    "   <srcDataExtProperty></srcDataExtProperty>\n" +
                    "</root>";
            Map<String, String> params = new HashMap<>();
            params.put("msgBody", msgBody);
            params.put("msgHeader", msgHeader);
            System.out.print(WebserviceUtil.post(caUrl, caNamespace, "XMCA6_UnifiedCallInterface", params) + "\r\n");
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
    }
//    public static void main(String args[]) {
//        try {
//            String caUrl = SystemConfig.getInstance().getCAUrl();
//            String caNamespace = SystemConfig.getInstance().getCANamespace();
//            /*//获取实名软证书的过期时间
//            String api = "XMCAF_SOFT_getRealNameSoftCertExpiredDatetime";
//            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
//                    "<root>\n"+
//                    "    <strUserIdcardNum>123456</strUserIdcardNum>\n" +
//                    "</root>";*/
//
//            /*//判断实名软证书是否已申请
//            String api = "XMCAF_SOFT_judgeRealNameSoftCertIsApplied";
//            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
//                    "<root>\n"+
//                    "    <strUserIdcardNum>123456</strUserIdcardNum>\n" +
//                    "</root>";*/
//
//            //修改实名软证书调用保护口令
//            String api = "XMCAF_SOFT_ModifyRealNameSoftCertCalledPasswd";
//            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
//                    "<root>\n"+
//                    "    <strUserIdcardNum>123456</strUserIdcardNum>\n" +
//                    "   <strOldCalledPasswd>12345678</strOldCalledPasswd>\n" +
//                    "   <strNewCalledPasswd>11111111</strNewCalledPasswd>\n" +
//                    "</root>";
//
//
//            //请求实名软证书并进行数字签名
//            /*String orgData = "测试数据";
//            String api = "XMCAF_SOFT_requestRealNameSoftCertAndSign";
//            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
//                    "<root>\n"+
//                    "   <strUserIdcardNum>123456</strUserIdcardNum>\n" +
//                    "   <strRealNameSoftCertCalledPasswd>11111111</strRealNameSoftCertCalledPasswd>\n" +
//                    "   <strOriginalData>"+ MD5Util.GetMD5Code(orgData)+"</strOriginalData>\n" +
//                    "</root>";*/
//
//            String msgHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
//                    "<root>\n" +
//                    "   <serverName>"+api+"</serverName>\n" +
//                    "   <format>xml</format>\n" +
//                    "   <callOperator></callOperator>\n" +
//                    "   <certificate></certificate>\n" +
//
//                    "   <srcIP>10.95.22.10</srcIP >\n" +
//                    "   <srcUserMac>60-D8-19-57-66-E3</srcUserMac>\n" +
//                    "   <srcSystemCode>1</srcSystemCode>\n" +
//                    "   <srcSystemName>厦门i健康</srcSystemName>\n" +
//                    "   <srcBusinessNodeCode>node01</srcBusinessNodeCode>\n" +
//                    "   <srcBusinessNodeName>审核</srcBusinessNodeName>\n" +
//                    "   <srcOperatorAccount>Zhuangsd</srcOperatorAccount>\n" +
//                    "   <srcBusinessStreamNO>11111</srcBusinessStreamNO>\n" +
//                    "   <srcDataExtProperty></srcDataExtProperty>\n" +
//                    "</root>";
//
//
//
//            Map<String, String> params = new HashMap<>();
//            params.put("msgBody", msgBody);
//            params.put("msgHeader", msgHeader);
//            System.out.print(WebserviceUtil.post(caUrl, caNamespace, "XMCA6_UnifiedCallInterface", params) + "\r\n");
//
//
//
//        }
//        catch (Exception ex)
//        {
//            ex.printStackTrace();
//        }
//    }
}

+ 18 - 12
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -6,7 +6,9 @@ import com.yihu.wlyy.service.dao.DoctorMappingDao;
import com.yihu.wlyy.service.dao.HospitalDao;
import com.yihu.wlyy.service.dao.PatientDao;
import com.yihu.wlyy.service.dao.SignFamilyDao;
import com.yihu.wlyy.service.dao.*;
import com.yihu.wlyy.service.dao.prescription.*;
import com.yihu.wlyy.service.entity.Doctor;
import com.yihu.wlyy.service.entity.Hospital;
import com.yihu.wlyy.service.entity.Patient;
import com.yihu.wlyy.service.entity.SignFamily;
@ -62,6 +64,8 @@ public class PrescriptionService extends ZysoftBaseService{
    private HospitalDao hospitalDao;
    @Autowired
    private PrescriptionPayDao prescriptionPayDao;
    @Autowired
    private DoctorDao doctorDao;
    @Value("${redisChannel.prescription}")
    private String channelTopic;
@ -309,15 +313,14 @@ public class PrescriptionService extends ZysoftBaseService{
    /**
     * 7.1字典获取接口
     * @param dictName 字典名称
     * @param hospital
     * @return
     * @throws Exception
     */
    public String getDictForI(String dictName,String hospital)  throws Exception
    public String getDictForI(String dictName)  throws Exception
    {
        String[] hospitalMapping = getHospitalMapping(hospital); //获取机构映射
        hospital = hospitalMapping[0];
        String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
@ -337,22 +340,25 @@ public class PrescriptionService extends ZysoftBaseService{
    /**
     * 7.2 处方模板获取接口
     * @param staffCode 员工编码
     * @param deptCode 部门编码
     * @param hospital
     * @param code 医生code
     * @return
     * @throws Exception
     */
    public String getRecipeTemplate(String staffCode,String deptCode,String hospital)  throws Exception
    public String getRecipeTemplate(String code)  throws Exception
    {
        String[] hospitalMapping = getHospitalMapping(hospital); //获取机构映射
        hospital = hospitalMapping[0];
        Doctor doctor = doctorDao.findByCode(code);
        String[] hospitalMapping = getHospitalMapping(doctor.getHospital()); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
        String staffCode = null;
        String deptCode = null;
        Map<String,String> params = new HashMap<>();
        params.put("staffCode",staffCode);
        params.put("deptCode",deptCode);
@ -388,8 +394,8 @@ public class PrescriptionService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("cardNo",cardNo);
        params.put("recipeNo",recipeNo);
        params.put("applyTimeFrom",applyTimeFrom);
        params.put("applyTimeEnd",applyTimeEnd);
//        params.put("applyTimeFrom",applyTimeFrom);
//        params.put("applyTimeEnd",applyTimeEnd);
        String response = postSecond("getLastRecipe","调阅历史处方接口",params,null,header,false,2);

+ 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;
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/pom.xml

@ -427,7 +427,7 @@
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                        <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -55,14 +55,14 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type=?3 order by a.createTime desc")
    List<Message> getSysTemMessageByType(String doctor, String prescriptionStatus, Integer type);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
    List<Message> getSysTemMessageByPrescription(String doctor, String prescriptionStatus);
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6)")
    List<Message> getSystemMessage(String doctor,Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=6 and a.prescriptionStatus='0' ")
    List<Message> getPrescriptionMessage(String doctor,Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=?2 and a.prescriptionStatus='0' ")
    List<Message> getPrescriptionMessage(String doctor,Integer type,Pageable pageRequest);
    @Query("select count(a) from Message a where a.read = 0 and a.over ='0'  and a.receiver=?1 and a.type=?2 ")
    int findMessageNum(String doctor, Integer type);

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDispensaryCodeDao.java

@ -24,6 +24,9 @@ public interface PrescriptionDispensaryCodeDao extends PagingAndSortingRepositor
    @Query("select count(1) from PrescriptionDispensaryCode a where a.code= ?1 and a.isUse =0")
    Integer getResidentQRCodeCount(String code);
    @Query("select a.code from PrescriptionDispensaryCode a where a.prescriptionCode= ?1 and a.type =?2 ")
    String getCodeByPrescriptionCodeAndType(String prescriptionCode,Integer type);
//    @Query("select p1 from PrescriptionInfo p1 left join Prescription p2 on p1.prescriptionCode=p2.code where p1.prescriptionCode = ?1")
//    List<PrescriptionInfo> getPrescriptionInfo(String prescriptionCode);
}

+ 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;
    }
}

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -152,7 +152,7 @@ public class MessageService extends BaseService {
        }
        //获取续方消息
        List<Message> prescriptionMessage = messageDao.getSysTemMessageByType(doctor,"0",6);
        List<Message> prescriptionMessage = messageDao.getSysTemMessageByPrescription(doctor,"0");
        JSONObject prescriptionJson = new JSONObject();
        if (prescriptionMessage != null && prescriptionMessage.size() > 0) {
            prescriptionJson.put("amount", prescriptionMessage.size());
@ -449,12 +449,12 @@ public class MessageService extends BaseService {
    /**
     * 获取续方消息
     */
    public List<Message> getPrescriptionMessage(String doctor, Integer page, Integer pagesize) throws Exception {
    public List<Message> getPrescriptionMessage(String doctor,Integer type, Integer page, Integer pagesize) throws Exception {
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "czrq");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
        return messageDao.getPrescriptionMessage(doctor, pageRequest);
        return messageDao.getPrescriptionMessage(doctor,type, pageRequest);
    }
    /**

+ 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) {
    }
}

+ 11 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -24,6 +24,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Date;
@ -78,7 +79,15 @@ public class PrescriptionService extends BaseService {
                //自取
                Patient patient = patientDao.findByCode(prescription.getPatient());
                try {
                    prescriptionNoticesService.sendMessages(patient.getCode(), patient.getName(), null, null, 2, 0, "");
                    String dispensaryCode = prescriptionDispensaryCodeDao.getCodeByPrescriptionCodeAndType(code,1);
                    StringBuffer url = new StringBuffer();
                    url.append(wechat_base_url);
                    url.append("wx/prescription/html/code-detail.html?dispensaryCode=").append(dispensaryCode);
                    url.append("&openid=").append(patient.getOpenid());
                    url.append("&toUser=").append(patient.getCode());
                    url.append("&toName=").append(patient.getName());
                    url.append("&represented=").append(patient.getCode());
                    prescriptionNoticesService.sendMessages(patient.getCode(), patient.getName(), null, null, 2, 0, url.toString());
                }catch (Exception e){
                    logger.info("微信模板发送失败,续方code"+code);
                }
@ -198,7 +207,7 @@ public class PrescriptionService extends BaseService {
                    j2.put("qyzldw",zyCfinfoObj.getString("PHYSIC_AMOUNT_UNIT"));//取药单位
                    j2.put("gytj00",zyCfinfoObj.getString("PHYSIC_USAGE"));//给药途径
                    j2.put("ypts00",zyCfinfoObj.getString("DAY_COUNT"));//药品天数
                     cfInfo.add(j2);
                    cfInfo.add(j2);
                }
                json.put("mxlist",cfInfo);
            }else{

+ 4 - 16
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -1,12 +1,6 @@
package com.yihu.wlyy.service.third.jw;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionPay;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionPayDao;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
@ -32,15 +26,13 @@ public class JwPrescriptionService {
    /**
     * 获取字典列表
     * @param dictName 字典名称
     * @param hospital 药品code
     * @return
     * @throws Exception
     */
    public String getDictForI(String dictName,String hospital) throws Exception{
    public String getDictForI(String dictName) 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");
@ -49,18 +41,14 @@ public class JwPrescriptionService {
    /**
     * 获取处方模板
     * @param deptCode 科室编码
     * @param staffCode 人员code
     * @param hospital 医院code
     * @param doctor 医生code
     * @return
     * @throws Exception
     */
    public String getRecipeTemplate(String deptCode,String staffCode, String hospital) throws Exception{
    public String getRecipeTemplate(String doctor) 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));
        params.add(new BasicNameValuePair("doctor", doctor));
        String response = httpClientUtil.post(url, params, "UTF-8");

+ 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, "查询失败");
        }
    }
}

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -192,9 +192,11 @@ public class DoctorMessageController extends BaseController {
    public String getPrescriptionMessage(@ApiParam(value = "第几页", defaultValue = "1")
                                   @RequestParam Integer page,
                                   @ApiParam(value = "每页几行", defaultValue = "10")
                                   @RequestParam Integer pagesize) {
                                   @RequestParam Integer pagesize,
                                   @ApiParam(value = "类型(6团队长待审核,7健管师待取药)", defaultValue = "6")
                                   @RequestParam Integer type) {
        try {
            List<Message> list = messageService.getPrescriptionMessage(getUID(), page, pagesize);
            List<Message> list = messageService.getPrescriptionMessage(getUID(),type, page, pagesize);
            return write(200, "获取消息成功!", "list", list);
        } catch (Exception e) {
            error(e);

+ 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, "获取门/急诊数据失败!");
        }
    }
}

+ 10 - 10
patient-co/patient-co-wlyy/src/main/resources/logback.xml

@ -10,9 +10,9 @@
    </appender>
    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/tmp/logs/wlyy.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/tmp/logs/wlyy.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/tmp/logs/wlyy.%d{yyyy-MM-dd}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/tmp/logs/wlyy.%d{yyyy-MM-dd}.log</fileNamePattern>
        </rollingPolicy>
        <encoder>
            <pattern>%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
@ -21,9 +21,9 @@
    </appender>
    <appender name="business_m" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/datadisk/wlyy_logs/business_m.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/business_m.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/datadisk/wlyy_logs/rolling/business_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/rolling/business_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
        </rollingPolicy>
        <encoder>
            <pattern>%msg%n</pattern>
@ -31,9 +31,9 @@
        </encoder>
    </appender>
    <appender name="business_d" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/datadisk/wlyy_logs/business.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/business.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/datadisk/wlyy_logs/dayLogs/business.%d{yyyy-MM-dd}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/dayLogs/business.%d{yyyy-MM-dd}.log</fileNamePattern>
        </rollingPolicy>
        <encoder>
            <pattern>%msg%n</pattern>
@ -41,9 +41,9 @@
        </encoder>
    </appender>
    <appender name="interface_call_m" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/datadisk/wlyy_logs/interface_call_m.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/interface_call_m.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/datadisk/wlyy_logs/rolling/interface_call_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/rolling/interface_call_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
        </rollingPolicy>
        <encoder>
            <pattern>%msg%n</pattern>
@ -51,9 +51,9 @@
        </encoder>
    </appender>
    <appender name="interface_call_d" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/datadisk/wlyy_logs/interface_call.log</file>
        <file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/interface_call.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/datadisk/wlyy_logs/dayLogs/interface_call.%d{yyyy-MM-dd}.log</fileNamePattern>
            <fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/dayLogs/interface_call.%d{yyyy-MM-dd}.log</fileNamePattern>
        </rollingPolicy>
        <encoder>
            <pattern>%msg%n</pattern>