wei.zhou

修改:国家取三字码

......@@ -33,44 +33,10 @@ public class DictionaryEntries implements Serializable {
@Column(name = "DICT_CODE")
private String dictCode;
@Column(name = "EXT3")
private String ext3;
@Column(name = "EXT6")
private String ext6;
// @Column(name = "DICT_CODE")
// private String dictCode;
//
// @Column(name = "ENGLISH_NAME")
// private String englishName;
//
// @Column(name = "DESCRIPTION")
// private String description;
//
// @Column(name = "STATUS")
// private Integer status;
//
// @Column(name="DICT_ID")
// private String dictId;
//
// @Column(name = "EXT1")
// private Integer ext1;
//
// @Column(name = "EXT2")
// private String ext2;
//
// @Column(name = "EXT3")
// private String ext3;
//
// @Column(name = "EXT4")
// private BigDecimal ext4;
//
// @Column(name = "EXT5")
// private Integer ext5;
//
// @Column(name = "ORDINAL")
// private Integer ordinal;
//
// @Column(name = "EXT6")
// private String ext6;
}
......
......@@ -30,7 +30,7 @@ public interface DictionaryEntriesRepository extends JpaRepository<DictionaryEn
* 查找全部DictionaryEntries
* @return
*/
@Query(nativeQuery = true, value = "select ID,CODE,CHINESE_NAME,DICT_CODE,EXT6 from T_BI_DICTIONARY_ENTRIES where STATUS=1")
@Query(nativeQuery = true, value = "select ID,CODE,CHINESE_NAME,DICT_CODE,EXT3,EXT6 from T_BI_DICTIONARY_ENTRIES where STATUS=1")
public List<DictionaryEntries> findAllDictionaryEntries();
}
......
......@@ -35,21 +35,27 @@ public class DictionaryEntriesService {
/**
* 初始化AppInfo
* 初始化字典表
*/
public void initDictionaryEntries() {
try {
Constant.dictionaryEntriesCache.clear();
List<DictionaryEntries> dictionaryEntriesList = this.getAllDictionaryEntries();
for (DictionaryEntries dictionaryEntries : dictionaryEntriesList) {
//成交方式
if(Objects.equals(dictionaryEntries.getDictCode(),"ClinchType")){
Constant.dictionaryEntriesCache.put(dictionaryEntries.getDictCode()+"_"+dictionaryEntries.getExt6(),dictionaryEntries);
}else{
Constant.dictionaryEntriesCache.put(Constant.CLINCH_TYPE+dictionaryEntries.getExt6(),dictionaryEntries);
}
//国家
else if(Objects.equals(dictionaryEntries.getDictCode(),"Country")){
Constant.dictionaryEntriesCache.put(Constant.COUNTRY+dictionaryEntries.getExt3(),dictionaryEntries);
}
else{
Constant.dictionaryEntriesCache.put(dictionaryEntries.getCode(),dictionaryEntries);
}
}
} catch (Exception e) {
log.error("initAppInfo() error" + e.getMessage());
log.error("initDictionaryEntries() error" + e.getMessage());
}
}
......