|
@ -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 "";
|
|
|
}
|
|
|
}
|