|
@ -68,7 +68,7 @@ public class ZyDictJob implements Job {
|
|
|
//同步 zy_iv_physic_dict
|
|
|
synchronizeZy_iv_physic_dict();
|
|
|
//同步 zy_iv_staff_dict
|
|
|
synchronizeZ_iv_staff_dict();
|
|
|
synchronizeZ_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
|
|
@ -83,8 +83,8 @@ public class ZyDictJob implements Job {
|
|
|
String dictName = this.IV_DIAGNOSE_DICT;
|
|
|
List<ZyIvDiagnoseDict> zyIvDiagnoseDicts = new ArrayList<>();
|
|
|
//得到list
|
|
|
commonGetOneDict(zyIvDiagnoseDicts, ZyIvDiagnoseDict.class, dictName);
|
|
|
if (zyIvDiagnoseDicts.size() > 0) {
|
|
|
zyIvDiagnoseDicts = commonGetOneDict(ZyIvDiagnoseDict.class, dictName);
|
|
|
if (zyIvDiagnoseDicts != null && zyIvDiagnoseDicts.size() > 0) {
|
|
|
//清空表
|
|
|
zyIvDiagnoseDictDao.deleteAll();
|
|
|
//新增数据
|
|
@ -101,7 +101,7 @@ public class ZyDictJob implements Job {
|
|
|
String dictName = this.IV_SUBJECT_CLASS_DICT;
|
|
|
List<ZyIvSubjectClassDict> zyIvSubjectClassDicts = new ArrayList<>();
|
|
|
//得到list
|
|
|
commonGetOneDict(zyIvSubjectClassDicts, ZyIvSubjectClassDict.class, dictName);
|
|
|
zyIvSubjectClassDicts = commonGetOneDict(ZyIvSubjectClassDict.class, dictName);
|
|
|
if (zyIvSubjectClassDicts.size() > 0) {
|
|
|
//清空表
|
|
|
zyIvSubjectClassDictDao.deleteAll();
|
|
@ -118,13 +118,15 @@ public class ZyDictJob implements Job {
|
|
|
String dictName = this.IV_STAFF_REG_TYPE_ALLOT_DICT;
|
|
|
List<ZyIvStaffRegTypeAllotDict> zyIvStaffRegTypeAllotDicts = new ArrayList<>();
|
|
|
//得到list
|
|
|
commonGetOneDict(zyIvStaffRegTypeAllotDicts, ZyIvStaffRegTypeAllotDict.class, dictName);
|
|
|
//清空表
|
|
|
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");
|
|
|
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
|
|
@ -133,13 +135,15 @@ public class ZyDictJob implements Job {
|
|
|
String dictName = this.IV_STAFF_DICT;
|
|
|
List<ZyIvStaffDict> zyIvStaffDicts = new ArrayList<>();
|
|
|
//得到list
|
|
|
commonGetOneDict(zyIvStaffDicts, ZyIvDeptDict.class, dictName);
|
|
|
zyIvStaffDicts = commonGetOneDict(ZyIvStaffDict.class, dictName);
|
|
|
//清空表
|
|
|
zyIvStaffDictDao.deleteAll();
|
|
|
//新增数据
|
|
|
logger.info("save table zy_iv_staff_dict ,size:" + zyIvStaffDicts.size());
|
|
|
zyIvStaffDictDao.save(zyIvStaffDicts);
|
|
|
logger.info("synchronized zy_iv_staff_dict end");
|
|
|
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
|
|
@ -148,13 +152,15 @@ public class ZyDictJob implements Job {
|
|
|
String dictName = this.IV_PHYSIC_DICT;
|
|
|
List<ZyIvPhysicDict> zyIvPhysicDicts = new ArrayList<>();
|
|
|
//得到list
|
|
|
commonGetOneDict(zyIvPhysicDicts, ZyIvPhysicDict.class, dictName);
|
|
|
//清空表
|
|
|
zyIvPhysicDictDao.deleteAll();
|
|
|
//新增数据
|
|
|
logger.info("save table zy_iv_physic_dict ,size:" + zyIvPhysicDicts.size());
|
|
|
zyIvPhysicDictDao.save(zyIvPhysicDicts);
|
|
|
logger.info("synchronized zy_iv_physic_dict end");
|
|
|
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
|
|
@ -163,8 +169,8 @@ public class ZyDictJob implements Job {
|
|
|
String dictName = this.IV_ORG_PHYSIC_ALLOT_DICT;
|
|
|
List<ZyIvOrgPhysicAllotDict> zyIvOrgPhysicAllotDicts = new ArrayList<>();
|
|
|
//得到list
|
|
|
commonGetOneDict(zyIvOrgPhysicAllotDicts, ZyIvOrgPhysicAllotDict.class, dictName);
|
|
|
if (zyIvOrgPhysicAllotDicts.size() > 0) {
|
|
|
zyIvOrgPhysicAllotDicts = commonGetOneDict(ZyIvOrgPhysicAllotDict.class, dictName);
|
|
|
if (zyIvOrgPhysicAllotDicts != null && zyIvOrgPhysicAllotDicts.size() > 0) {
|
|
|
//清空表
|
|
|
zyIvOrgPhysicAllotDictDao.deleteAll();
|
|
|
//新增数据
|
|
@ -180,8 +186,8 @@ public class ZyDictJob implements Job {
|
|
|
String dictName = this.IV_DIAGNOSE_CLASS_DICT;
|
|
|
List<ZyIvDiagnoseClassDict> zIvDiagnoseClassDicts = new ArrayList<>();
|
|
|
//得到list
|
|
|
commonGetOneDict(zIvDiagnoseClassDicts, ZyIvDiagnoseClassDict.class, dictName);
|
|
|
if (zIvDiagnoseClassDicts.size() > 0) {
|
|
|
zIvDiagnoseClassDicts = commonGetOneDict(ZyIvDiagnoseClassDict.class, dictName);
|
|
|
if (zIvDiagnoseClassDicts != null && zIvDiagnoseClassDicts.size() > 0) {
|
|
|
//清空表
|
|
|
zyIvDiagnoseClassDictDao.deleteAll();
|
|
|
//新增数据
|
|
@ -198,9 +204,9 @@ public class ZyDictJob implements Job {
|
|
|
String dictName = this.IV_DEPT_STAFF_ALLOT_DICT;
|
|
|
List<ZyIvDeptStaffAllotDict> syIvDeptStaffAllotDictz = new ArrayList<>();
|
|
|
//得到list
|
|
|
commonGetOneDict(syIvDeptStaffAllotDictz, ZyIvDeptStaffAllotDict.class, dictName);
|
|
|
syIvDeptStaffAllotDictz = commonGetOneDict(ZyIvDeptStaffAllotDict.class, dictName);
|
|
|
|
|
|
if (syIvDeptStaffAllotDictz.size() > 0) {
|
|
|
if (syIvDeptStaffAllotDictz != null && syIvDeptStaffAllotDictz.size() > 0) {
|
|
|
//清空表
|
|
|
zyIvDeptStaffAllotDictDao.deleteAll();
|
|
|
//新增数据
|
|
@ -232,14 +238,14 @@ public class ZyDictJob implements Job {
|
|
|
if (returnJson.containsKey("data")) {
|
|
|
String dataString = returnJson.getString("data");
|
|
|
JSONArray dataJSONArray = JSONObject.fromObject(dataString).getJSONArray("returnData");
|
|
|
logger.info("zy dict data size " + dataJSONArray.size() + ",dictname:" + dictName);
|
|
|
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();
|
|
@ -285,8 +291,8 @@ public class ZyDictJob implements Job {
|
|
|
String dictName = this.IV_DEPT_DICT;
|
|
|
List<ZyIvDeptDict> zyIvDeptDicts = new ArrayList<>();
|
|
|
//得到list
|
|
|
commonGetOneDict(zyIvDeptDicts, ZyIvDeptDict.class, dictName);
|
|
|
if (zyIvDeptDicts.size() > 0) {
|
|
|
zyIvDeptDicts = commonGetOneDict(ZyIvDeptDict.class, dictName);
|
|
|
if (zyIvDeptDicts != null && zyIvDeptDicts.size() > 0) {
|
|
|
//清空表
|
|
|
zyIvDeptDictDao.deleteAll();
|
|
|
//新增数据
|
|
@ -299,11 +305,10 @@ public class ZyDictJob implements Job {
|
|
|
/**
|
|
|
* 得到单个字典
|
|
|
*
|
|
|
* @param tList
|
|
|
* @param clazz class
|
|
|
* @param dictName 字典名称
|
|
|
*/
|
|
|
private void commonGetOneDict(List tList, Class clazz, String dictName) {
|
|
|
private List commonGetOneDict(Class clazz, String dictName) {
|
|
|
String json = null;
|
|
|
try {
|
|
|
//调用智业的接口得到字典
|
|
@ -313,15 +318,22 @@ public class ZyDictJob implements Job {
|
|
|
throw new Exception("zy dict error status not 200");
|
|
|
}
|
|
|
if (returnJson.containsKey("data")) {
|
|
|
JSONArray dataJSONArray = JSONObject.fromObject(returnJson.getString("data")).getJSONArray("returnData");
|
|
|
|
|
|
String dataJSONStr = returnJson.getString("data");
|
|
|
JSONObject joTemp = JSONObject.fromObject(dataJSONStr);
|
|
|
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.getJSONArray(0).size(); i++) {
|
|
|
JSONObject jo = dataJSONArray.getJSONArray(0).getJSONObject(i);
|
|
|
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);
|
|
@ -330,7 +342,7 @@ public class ZyDictJob implements Job {
|
|
|
});
|
|
|
newJA.add(newJO);
|
|
|
}
|
|
|
tList.addAll(Arrays.asList(JSONArray.toArray(newJA, clazz)));
|
|
|
return (List) JSONArray.toCollection(newJA, clazz);
|
|
|
} else {
|
|
|
throw new Exception("zy dict error no contain data");
|
|
|
}
|
|
@ -339,30 +351,31 @@ public class ZyDictJob implements Job {
|
|
|
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 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");
|
|
|
|
|
|
/**
|
|
|
* 字典表的枚举类
|