Forráskód Böngészése

Merge branch 'dev' of yeshijie/patient-co-management into dev

yeshijie 7 éve
szülő
commit
e48f16a4ce
24 módosított fájl, 1793 hozzáadás és 17 törlés
  1. 59 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/ZyDictController.java
  2. 13 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyCommonDictDao.java
  3. 13 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvDeptDictDao.java
  4. 11 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvDeptStaffAllotDictDao.java
  5. 11 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvDiagnoseClassDictDao.java
  6. 12 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvDiagnoseDictDao.java
  7. 11 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvOrgPhysicAllotDictDao.java
  8. 11 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvPhysicDictDao.java
  9. 11 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvStaffDictDao.java
  10. 12 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvStaffRegTypeAllotDictDao.java
  11. 12 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvSubjectClassDictDao.java
  12. 70 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyCommonDict.java
  13. 85 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDeptDict.java
  14. 65 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDeptStaffAllotDict.java
  15. 109 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDiagnoseClassDict.java
  16. 111 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDiagnoseDict.java
  17. 54 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvOrgPhysicAllotDict.java
  18. 232 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvPhysicDict.java
  19. 146 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvStaffDict.java
  20. 88 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvStaffRegTypeAllotDict.java
  21. 88 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvSubjectClassDict.java
  22. 553 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZyDictDataService.java
  23. 0 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/common/InitiSysProService.java
  24. 16 16
      patient-co-service/wlyy_service/src/main/resources/system.properties

+ 59 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/ZyDictController.java

@ -0,0 +1,59 @@
package com.yihu.wlyy.service.controller;
import com.yihu.wlyy.service.service.ZyDictDataService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by chenweida on 2017/8/10.
 * 智业字典同步接口
 */
@RestController
@RequestMapping("/third/dict/")
public class ZyDictController extends BaseController {
    @Autowired
    private ZyDictDataService zyDictDataService;
    @ApiOperation("下载智业所有字典")
    @RequestMapping(value = "/downLoadAllDict", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    public String downLoadAllDict(){
        try {
            zyDictDataService.allDict();
            return write(200, "下载智业所有字典!");
        } catch (Exception e) {
            return invalidUserException(e, -1, "下载智业所有字典");
        }
    }
    /**
     * IV_SUBJECT_CLASS_DICT
     * IV_STAFF_REG_TYPE_ALLOT_DICT
     * IV_STAFF_DICT
     * IV_PHYSIC_DICT
     * IV_ORG_PHYSIC_ALLOT_DICT
     * IV_DIAGNOSE_CLASS_DICT
     * IV_DEPT_STAFF_ALLOT_DICT
     * "commonDict"
     * IV_DEPT_DICT
     * @param dictName
     * @return
     */
    @ApiOperation("下载智业字典")
    @RequestMapping(value = "/downLoadDict", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    public String downLoadDict(@ApiParam(name = "dictName", value = "字典名称", defaultValue = "commonDict")
                               @RequestParam(value = "dictName", required = true) String dictName){
        try {
            zyDictDataService.dictByDictName(dictName);
            return write(200, "下载智业所有字典!");
        } catch (Exception e) {
            return invalidUserException(e, -1, "下载智业所有字典");
        }
    }
}

+ 13 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyCommonDictDao.java

@ -0,0 +1,13 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyCommonDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyCommonDictDao extends PagingAndSortingRepository<ZyCommonDict, Long>, JpaSpecificationExecutor<ZyCommonDict> {
}

+ 13 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvDeptDictDao.java

@ -0,0 +1,13 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyIvDeptDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyIvDeptDictDao extends PagingAndSortingRepository<ZyIvDeptDict, Long>, JpaSpecificationExecutor<ZyIvDeptDict> {
}

+ 11 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvDeptStaffAllotDictDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyIvDeptStaffAllotDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyIvDeptStaffAllotDictDao extends PagingAndSortingRepository<ZyIvDeptStaffAllotDict, Long>, JpaSpecificationExecutor<ZyIvDeptStaffAllotDict> {
}

+ 11 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvDiagnoseClassDictDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyIvDiagnoseClassDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyIvDiagnoseClassDictDao extends PagingAndSortingRepository<ZyIvDiagnoseClassDict, Long>, JpaSpecificationExecutor<ZyIvDiagnoseClassDict> {
}

+ 12 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvDiagnoseDictDao.java

@ -0,0 +1,12 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyIvDiagnoseDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyIvDiagnoseDictDao extends PagingAndSortingRepository<ZyIvDiagnoseDict, Long>, JpaSpecificationExecutor<ZyIvDiagnoseDict> {
}

+ 11 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvOrgPhysicAllotDictDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyIvOrgPhysicAllotDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyIvOrgPhysicAllotDictDao extends PagingAndSortingRepository<ZyIvOrgPhysicAllotDict, Long>, JpaSpecificationExecutor<ZyIvOrgPhysicAllotDict> {
}

+ 11 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvPhysicDictDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyIvPhysicDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyIvPhysicDictDao extends PagingAndSortingRepository<ZyIvPhysicDict, Long>, JpaSpecificationExecutor<ZyIvPhysicDict> {
}

+ 11 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvStaffDictDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyIvStaffDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyIvStaffDictDao extends PagingAndSortingRepository<ZyIvStaffDict, Long>, JpaSpecificationExecutor<ZyIvStaffDict> {
}

+ 12 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvStaffRegTypeAllotDictDao.java

@ -0,0 +1,12 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyIvStaffRegTypeAllotDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyIvStaffRegTypeAllotDictDao extends PagingAndSortingRepository<ZyIvStaffRegTypeAllotDict, Long>, JpaSpecificationExecutor<ZyIvStaffRegTypeAllotDict> {
}

+ 12 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/zydict/ZyIvSubjectClassDictDao.java

@ -0,0 +1,12 @@
package com.yihu.wlyy.service.dao.zydict;
import com.yihu.wlyy.service.entity.zydict.ZyIvSubjectClassDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/8/11.
 */
public interface ZyIvSubjectClassDictDao extends PagingAndSortingRepository<ZyIvSubjectClassDict, Long>, JpaSpecificationExecutor<ZyIvSubjectClassDict> {
}

+ 70 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyCommonDict.java

@ -0,0 +1,70 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
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;
    }
}

+ 85 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDeptDict.java

@ -0,0 +1,85 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
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 deptClass;//科室类型  详见科室类型字典中定义
	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.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_class", length = 50)
	public String getDeptClass() {
		return deptClass;
	}
	public void setDeptClass(String deptClass) {
		this.deptClass = deptClass;
	}
	@Column(name = "upper_dept", length = 50)
	public String getUpperDept() {
		return this.upperDept;
	}
	public void setUpperDept(String upperDept) {
		this.upperDept = upperDept;
	}
}

+ 65 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDeptStaffAllotDict.java

@ -0,0 +1,65 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
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;
	}
}

+ 109 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDiagnoseClassDict.java

@ -0,0 +1,109 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
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;
	}
}

+ 111 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvDiagnoseDict.java

@ -0,0 +1,111 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
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;
	}
}

+ 54 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvOrgPhysicAllotDict.java

@ -0,0 +1,54 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
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;
	}
}

+ 232 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvPhysicDict.java

@ -0,0 +1,232 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
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 physicForm;//药品剂型  药品剂型字典中定义
	private String toxicologyType;//毒理分类  药品毒理分类字典中定义
	private String basicFlag;//基本药物标志  0:否;1:是
	private String validFlag;//有效标志 0:无效;1:有效
	private String spellCode;//拼音首码
	private String wbzxCode;//五笔首码
	private String storageConditions;//2表示需要冷藏,其他表示不需要冷藏
	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.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_form", length = 50)
	public String getPhysicForm() {
		return physicForm;
	}
	public void setPhysicForm(String physicForm) {
		this.physicForm = physicForm;
	}
	@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;
	}
	@Column(name = "storage_conditions")
	public String getStorageConditions() {
		return storageConditions;
	}
	public void setStorageConditions(String storageConditions) {
		this.storageConditions = storageConditions;
	}
}

+ 146 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvStaffDict.java

@ -0,0 +1,146 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.Date;
/**
 * 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;
	}
}

+ 88 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvStaffRegTypeAllotDict.java

@ -0,0 +1,88 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
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;
	}
}

+ 88 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvSubjectClassDict.java

@ -0,0 +1,88 @@
package com.yihu.wlyy.service.entity.zydict;
import com.yihu.wlyy.service.common.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
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;
	}
}

+ 553 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZyDictDataService.java

@ -0,0 +1,553 @@
package com.yihu.wlyy.service.service;
import com.yihu.wlyy.service.dao.zydict.*;
import com.yihu.wlyy.service.entity.zydict.*;
import com.yihu.wlyy.service.service.prescription.PrescriptionService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * Created by chenweida on 2017/8/10.
 * 智业的字典数据
 */
@Service
public class ZyDictDataService extends ZysoftBaseService {
    private Logger logger = LoggerFactory.getLogger(ZyDictDataService.class);
    @Autowired
    private ZyCommonDictDao zyCommonDictDao;
    @Autowired
    private ZyIvDeptDictDao zyIvDeptDictDao;
    @Autowired
    private ZyIvDeptStaffAllotDictDao zyIvDeptStaffAllotDictDao;
    @Autowired
    private ZyIvDiagnoseClassDictDao zyIvDiagnoseClassDictDao;
    @Autowired
    private ZyIvDiagnoseDictDao zyIvDiagnoseDictDao;
    @Autowired
    private ZyIvOrgPhysicAllotDictDao zyIvOrgPhysicAllotDictDao;
    @Autowired
    private ZyIvPhysicDictDao zyIvPhysicDictDao;
    @Autowired
    private ZyIvStaffDictDao zyIvStaffDictDao;
    @Autowired
    private ZyIvStaffRegTypeAllotDictDao zyIvStaffRegTypeAllotDictDao;
    @Autowired
    private ZyIvSubjectClassDictDao zyIvSubjectClassDictDao;
    @Autowired
    private PrescriptionService prescriptionService;
    /**
     * 根据字典名称下载字典
     * @param dictName
     */
    public void dictByDictName(String dictName){
        switch (dictName){
            case IV_SUBJECT_CLASS_DICT:
                synchronizeZy_iv_subject_class_dict();
                break;
            case IV_STAFF_REG_TYPE_ALLOT_DICT:
                synchronizeZy_iv_staff_reg_type_allot_dict();
                break;
            case IV_STAFF_DICT:
                synchronizeZy_iv_staff_dict();
                break;
            case IV_PHYSIC_DICT:
                synchronizeZy_iv_physic_dict();
                break;
            case IV_ORG_PHYSIC_ALLOT_DICT:
                synchronizeZy_iv_org_physic_allot_dict();
                break;
            case IV_DIAGNOSE_CLASS_DICT:
                synchronizeZy_iv_diagnose_class_dict();
                break;
            case IV_DEPT_STAFF_ALLOT_DICT:
                synchronizeZy_iv_dept_staff_allot_dict();
                break;
            case "commonDict":
                synchronizeZyCommonDict();
                break;
            case IV_DEPT_DICT:
                synchronizeZy_iv_dept_dict();
                break;
            default:break;
        }
    }
    public void allDict() {
        try {
            //同步 zy_common_dict
            synchronizeZyCommonDict();
            //同步 zy_iv_dept_dict
            synchronizeZy_iv_dept_dict();
            //同步 zy_iv_dept_staff_allot_dict
            synchronizeZy_iv_dept_staff_allot_dict();
            //同步 zy_iv_diagnose_dict
            synchronizeZy_iv_diagnose_dict();
            //同步 zy_iv_diagnose_class_dict
            synchronizeZy_iv_diagnose_class_dict();
            //同步 zy_iv_org_physic_allot_dict
            synchronizeZy_iv_org_physic_allot_dict();
            //同步 zy_iv_physic_dict
            synchronizeZy_iv_physic_dict();
            //同步 zy_iv_staff_dict
            synchronizeZy_iv_staff_dict();  //birthday    Date(529084800000+0800) 无法解析
            //同步 zy_iv_staff_reg_type_allot_dict
            synchronizeZy_iv_staff_reg_type_allot_dict();
            //同步 zy_iv_subject_class_dict
            synchronizeZy_iv_subject_class_dict();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    private void synchronizeZy_iv_diagnose_dict() {
        logger.info("synchronized zy_iv_diagnose_dict start");
        String dictName = this.IV_DIAGNOSE_DICT;
        List<ZyIvDiagnoseDict> zyIvDiagnoseDicts = new ArrayList<>();
        //得到list
        zyIvDiagnoseDicts = commonGetOneDict(ZyIvDiagnoseDict.class, dictName);
        if (zyIvDiagnoseDicts != null && zyIvDiagnoseDicts.size() > 0) {
            //清空表
            zyIvDiagnoseDictDao.deleteAll();
            //新增数据
            logger.info("save table zy_iv_diagnose_dict  ,size:" + zyIvDiagnoseDicts.size());
            zyIvDiagnoseDictDao.save(zyIvDiagnoseDicts);
        }
        logger.info("synchronized zy_iv_diagnose_dict end");
    }
    @Transactional
    private void synchronizeZy_iv_subject_class_dict() {
        logger.info("synchronized zy_iv_subject_class_dict start");
        String dictName = this.IV_SUBJECT_CLASS_DICT;
        List<ZyIvSubjectClassDict> zyIvSubjectClassDicts = new ArrayList<>();
        //得到list
        zyIvSubjectClassDicts = commonGetOneDict(ZyIvSubjectClassDict.class, dictName);
        if (zyIvSubjectClassDicts.size() > 0) {
            //清空表
            zyIvSubjectClassDictDao.deleteAll();
            //新增数据
            logger.info("save table zy_iv_subject_class_dict  ,size:" + zyIvSubjectClassDicts.size());
            zyIvSubjectClassDictDao.save(zyIvSubjectClassDicts);
            logger.info("synchronized zy_iv_subject_class_dict end");
        }
    }
    @Transactional
    private void synchronizeZy_iv_staff_reg_type_allot_dict() {
        logger.info("synchronized zy_iv_staff_reg_type_allot_dict start");
        String dictName = this.IV_STAFF_REG_TYPE_ALLOT_DICT;
        List<ZyIvStaffRegTypeAllotDict> zyIvStaffRegTypeAllotDicts = new ArrayList<>();
        //得到list
        zyIvStaffRegTypeAllotDicts = commonGetOneDict(ZyIvStaffRegTypeAllotDict.class, dictName);
        if (zyIvStaffRegTypeAllotDicts != null && zyIvStaffRegTypeAllotDicts.size() > 0) {
            //清空表
            zyIvStaffRegTypeAllotDictDao.deleteAll();
            //新增数据
            logger.info("save table zy_iv_staff_reg_type_allot_dict  ,size:" + zyIvStaffRegTypeAllotDicts.size());
            zyIvStaffRegTypeAllotDictDao.save(zyIvStaffRegTypeAllotDicts);
            logger.info("synchronized zy_iv_staff_reg_type_allot_dict end");
        }
    }
    @Transactional
    private void synchronizeZy_iv_staff_dict() {
        logger.info("synchronized zy_iv_staff_dict start");
        String dictName = this.IV_STAFF_DICT;
        List<ZyIvStaffDict> zyIvStaffDicts = new ArrayList<>();
        //得到list
        zyIvStaffDicts = commonGetOneDict(ZyIvStaffDict.class, dictName);
        //清空表
        if (zyIvStaffDicts != null && zyIvStaffDicts.size() > 0) {
            zyIvStaffDictDao.deleteAll();
            //新增数据
            logger.info("save table zy_iv_staff_dict  ,size:" + zyIvStaffDicts.size());
            zyIvStaffDictDao.save(zyIvStaffDicts);
            logger.info("synchronized zy_iv_staff_dict end");
        }
    }
    @Transactional
    private void synchronizeZy_iv_physic_dict() {
        logger.info("synchronized zy_iv_physic_dict start");
        String dictName = this.IV_PHYSIC_DICT;
        List<ZyIvPhysicDict> zyIvPhysicDicts = new ArrayList<>();
        //得到list
        zyIvPhysicDicts = commonGetOneDict(ZyIvPhysicDict.class, dictName);
        if (zyIvPhysicDicts != null && zyIvPhysicDicts.size() > 0) {
            //清空表
            zyIvPhysicDictDao.deleteAll();
            //新增数据
            logger.info("save table zy_iv_physic_dict  ,size:" + zyIvPhysicDicts.size());
            zyIvPhysicDictDao.save(zyIvPhysicDicts);
            logger.info("synchronized zy_iv_physic_dict end");
        }
    }
    @Transactional
    private void synchronizeZy_iv_org_physic_allot_dict() {
        logger.info("synchronized zy_iv_org_physic_allot_dict start");
        String dictName = this.IV_ORG_PHYSIC_ALLOT_DICT;
        List<ZyIvOrgPhysicAllotDict> zyIvOrgPhysicAllotDicts = new ArrayList<>();
        //得到list
        zyIvOrgPhysicAllotDicts = commonGetOneDict(ZyIvOrgPhysicAllotDict.class, dictName);
        if (zyIvOrgPhysicAllotDicts != null && zyIvOrgPhysicAllotDicts.size() > 0) {
            //清空表
            zyIvOrgPhysicAllotDictDao.deleteAll();
            //新增数据
            logger.info("save table zy_iv_org_physic_allot_dict  ,size:" + zyIvOrgPhysicAllotDicts.size());
            zyIvOrgPhysicAllotDictDao.save(zyIvOrgPhysicAllotDicts);
        }
        logger.info("synchronized zy_iv_org_physic_allot_dict end");
    }
    @Transactional
    private void synchronizeZy_iv_diagnose_class_dict() {
        logger.info("synchronized zy_iv_diagnose_class_dict start");
        String dictName = this.IV_DIAGNOSE_CLASS_DICT;
        List<ZyIvDiagnoseClassDict> zIvDiagnoseClassDicts = new ArrayList<>();
        //得到list
        zIvDiagnoseClassDicts = commonGetOneDict(ZyIvDiagnoseClassDict.class, dictName);
        if (zIvDiagnoseClassDicts != null && zIvDiagnoseClassDicts.size() > 0) {
            //清空表
            zyIvDiagnoseClassDictDao.deleteAll();
            //新增数据
            logger.info("save table zy_iv_diagnose_class_dict  ,size:" + zIvDiagnoseClassDicts.size());
            zyIvDiagnoseClassDictDao.save(zIvDiagnoseClassDicts);
        }
        logger.info("synchronized zy_iv_diagnose_class_dict end");
    }
    @Transactional
    private void synchronizeZy_iv_dept_staff_allot_dict() {
        logger.info("synchronized zy_iv_dept_staff_allot_dict start");
        String dictName = this.IV_DEPT_STAFF_ALLOT_DICT;
        List<ZyIvDeptStaffAllotDict> syIvDeptStaffAllotDictz = new ArrayList<>();
        //得到list
        syIvDeptStaffAllotDictz = commonGetOneDict(ZyIvDeptStaffAllotDict.class, dictName);
        if (syIvDeptStaffAllotDictz != null && syIvDeptStaffAllotDictz.size() > 0) {
            //清空表
            zyIvDeptStaffAllotDictDao.deleteAll();
            //新增数据
            logger.info("save table zy_iv_dept_staff_allot_dict  ,size:" + syIvDeptStaffAllotDictz.size());
            zyIvDeptStaffAllotDictDao.save(syIvDeptStaffAllotDictz);
        }
        logger.info("synchronized zy_iv_dept_staff_allot_dict end");
    }
    @Transactional
    private void synchronizeZyCommonDict() {
        logger.info("synchronized zy_common_dict start");
        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};
        List<ZyCommonDict> zyCommonDictz = new ArrayList<>();
        Boolean isFlush = true;
        for (String dictName : dictNames) {
            String json = null;
            try {
                //调用智业的接口得到字典
                json = prescriptionService.getDictForI(dictName);
                JSONObject dataString = JSONObject.fromObject(json);
                JSONArray dataJSONArray = JSONObject.fromObject(dataString).getJSONArray("returnData");
                if (dataJSONArray.size() == 0) {
                    logger.info("zy dict data size " + dataJSONArray.size() + ",dictname:" + dictName);
                    continue;
                }
                //下划线转驼峰
                JSONArray newJA = new JSONArray();
                JSONArray jsonArrayTemp = dataJSONArray.getJSONArray(0);
                logger.info("zy dict data size " + jsonArrayTemp.size() + ",dictname:" + dictName);
                for (int i = 0; i < jsonArrayTemp.size(); i++) {
                    JSONObject jo = jsonArrayTemp.getJSONObject(i);
                    JSONObject newJO = new JSONObject();
                    jo.keySet().stream().forEach(key -> {
                        Object value = jo.get(key);
                        String newKey = Tool.lineToHump(key.toString());
                        newJO.put(newKey, value);
                    });
                    newJA.add(newJO);
                }
                ZyCommonDict[] zyCommonDictArrays = (ZyCommonDict[]) JSONArray.toArray(newJA, ZyCommonDict.class);
                zyCommonDictz.addAll(Arrays.asList(zyCommonDictArrays));
            } catch (Exception e) {
                e.printStackTrace();
                isFlush = false; //设置状态不能更新
                logger.error("dictName:" + dictName);
                logger.error("returnJson:" + json);
                logger.error(e.getMessage());
            }
        }
        //判断是否可以更新
        if (isFlush) {
            // 判断返回的数据是否大于0
            if (zyCommonDictz.size() > 0) {
                //清空表
                zyCommonDictDao.deleteAll();
                //新增数据
                logger.info("save table zy_common_dict  ,size:" + zyCommonDictz.size());
                zyCommonDictDao.save(zyCommonDictz);
            }
        }
        logger.info("synchronized zy_common_dict end");
    }
    @Transactional
    private void synchronizeZy_iv_dept_dict() {
        logger.info("synchronized zy_iv_dept_dict start");
        String dictName = this.IV_DEPT_DICT;
        List<ZyIvDeptDict> zyIvDeptDicts = new ArrayList<>();
        //得到list
        zyIvDeptDicts = commonGetOneDict(ZyIvDeptDict.class, dictName);
        if (zyIvDeptDicts != null && zyIvDeptDicts.size() > 0) {
            //清空表
            zyIvDeptDictDao.deleteAll();
            //新增数据
            logger.info("save table zy_iv_dept_dict  ,size:" + zyIvDeptDicts.size());
            zyIvDeptDictDao.save(zyIvDeptDicts);
        }
        logger.info("synchronized zy_iv_dept_dict end");
    }
    /**
     * 得到单个字典
     *
     * @param clazz    class
     * @param dictName 字典名称
     */
    private List commonGetOneDict(Class clazz, String dictName) {
        String json = null;
        try {
            //调用智业的接口得到字典
            json = prescriptionService.getDictForI(dictName);
            JSONObject joTemp = JSONObject.fromObject(json);
            JSONArray dataJSONArray = joTemp.getJSONArray("returnData");
            if (dataJSONArray.size() == 0) {
                logger.info("zy dict data size " + dataJSONArray.size() + ",dictname:" + dictName);
                return null;
            } else {
                dataJSONArray = dataJSONArray.getJSONArray(0);
            }
            logger.info("zy dict data size " + dataJSONArray.size() + ",dictname:" + dictName);
            //下划线转驼峰
            JSONArray newJA = new JSONArray();
            for (int i = 0; i < dataJSONArray.size(); i++) {
                JSONObject jo = dataJSONArray.getJSONObject(i);
                JSONObject newJO = new JSONObject();
                jo.keySet().stream().forEach(key -> {
                    Object value = jo.get(key);
                    String newKey = Tool.lineToHump(key.toString());
                    newJO.put(newKey, value);
                });
                newJA.add(newJO);
            }
            return (List) JSONArray.toCollection(newJA, clazz);
        } catch (Exception e) {
            logger.error("dictName:" + dictName);
            logger.error("returnJson:" + json);
            logger.error(e.getMessage());
        }
        return null;
    }
    /**
     * 智业的字典
     */
    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 "";
    }
    public static class Tool {
        private static Pattern linePattern = Pattern.compile("_(\\w)");
        /**
         * 下划线转驼峰
         */
        public static String lineToHump(String str) {
            str = str.toLowerCase();
            Matcher matcher = linePattern.matcher(str);
            StringBuffer sb = new StringBuffer();
            while (matcher.find()) {
                matcher.appendReplacement(sb, matcher.group(1).toUpperCase());
            }
            matcher.appendTail(sb);
            return sb.toString();
        }
        /**
         * 驼峰转下划线(简单写法,效率低于{@link #humpToLine2(String)})
         */
        public static String humpToLine(String str) {
            return str.replaceAll("[A-Z]", "_$0").toLowerCase();
        }
        private static Pattern humpPattern = Pattern.compile("[A-Z]");
        /**
         * 驼峰转下划线,效率比上面高
         */
        public static String humpToLine2(String str) {
            Matcher matcher = humpPattern.matcher(str);
            StringBuffer sb = new StringBuffer();
            while (matcher.find()) {
                matcher.appendReplacement(sb, "_" + matcher.group(0).toLowerCase());
            }
            matcher.appendTail(sb);
            return sb.toString();
        }
    }
}

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

@ -1,6 +1,5 @@
package com.yihu.wlyy.service.service.common;
import com.yihu.wlyy.service.common.CommonContent;
import com.yihu.wlyy.service.common.SystemConfig;
import com.yihu.wlyy.service.dao.common.SystemPropertiesDao;
import com.yihu.wlyy.service.entity.common.SystemProperties;

+ 16 - 16
patient-co-service/wlyy_service/src/main/resources/system.properties

@ -1,20 +1,20 @@
###基卫测试环境服务
gateway_url = http://117.25.173.18:18280/
gateway_licence = 5YGl5bq45LmL7Lev
gateway_public_key = PublicKeyTest.key
jw_hospital = 350211B1013
jw_licence = 5YGl5bq45LmL7Lev
ca_url = http://117.29.183.114:8081/XMCAService?wsdl
ca_namespace = http://platfomservice.xmca.com/
##基卫服务
#guahao_url =  http://10.95.18.10/urp.service/urp.open.service/ReservationPulic.asmx
#guahao_namespace = http://www.zysoft.com.cn/
#gateway_url = http://10.95.21.21:18280/
#gateway_url = http://117.25.173.18:18280/
#gateway_licence = 5YGl5bq45LmL7Lev
#gateway_public_key = PublicGov.key
#jw_hospital = 350211B1004
#jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
#gateway_public_key = PublicKeyTest.key
#jw_hospital = 350211B1013
#jw_licence = 5YGl5bq45LmL7Lev
#ca_url = http://117.29.183.114:8081/XMCAService?wsdl
#ca_namespace = http://platfomservice.xmca.com/
#ca_namespace = http://platfomservice.xmca.com/
##基卫服务
guahao_url =  http://10.95.18.10/urp.service/urp.open.service/ReservationPulic.asmx
guahao_namespace = http://www.zysoft.com.cn/
gateway_url = http://10.95.21.21:18280/
gateway_licence = 5YGl5bq45LmL7Lev
gateway_public_key = PublicGov.key
jw_hospital = 350211B1004
jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
ca_url = http://117.29.183.114:8081/XMCAService?wsdl
ca_namespace = http://platfomservice.xmca.com/