AccountingItems.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package com.simuwang.base.common.conts;
  2. import java.util.Arrays;
  3. import java.util.HashSet;
  4. import java.util.List;
  5. /**
  6. * @author mozuwen
  7. * @date 2024/03/19
  8. * @describe 会计科目
  9. */
  10. public class AccountingItems {
  11. /**
  12. * 现金类
  13. */
  14. public final static HashSet<String> CASH = toHashSet("1002,1051,1204,1021,1031,1114,310211,1121,1132,1203,1207,"
  15. + "1221,1304,1501,1522,1531,1532,3003,3999,2203,2204,2205,2206,2207,2210,2221,2231,2241,2261,2211,2331,2214");
  16. /**
  17. * 债券类
  18. */
  19. public final static HashSet<String> BOND = toHashSet("1107,1113,1321,1303,1401,1461,1104");
  20. /**
  21. * 其他
  22. */
  23. public final static HashSet<String> OTHER = toHashSet("1115,1503,1511");
  24. /**
  25. * 权证
  26. */
  27. public final static String WARRANT = "1106";
  28. /**
  29. * 股票类
  30. */
  31. public final static HashSet<String> EQUITY_LIST = toHashSet("1102,2101");
  32. /**
  33. * 债券类: 1202-正回购,2202-逆回购
  34. */
  35. public final static HashSet<String> BOND_LIST = toHashSet("1103,1202,2202");
  36. /**
  37. * 基金类
  38. */
  39. public final static List<String> FUND_LIST = toList("1105,1108,1109,1101");
  40. /**
  41. * 期货及衍生品类
  42. */
  43. public final static List<String> DERIVATIVES = toList("3102,3201,3103,3101");
  44. /**
  45. * 股指期货
  46. */
  47. public final static HashSet<String> INDEX_FUTRUE = toHashSet("IZ,IH,IF,IC,IM");
  48. /**
  49. * 国债期货
  50. */
  51. public final static HashSet<String> BOND_FUTRUE = toHashSet("TS,TL,TF,T");
  52. /**
  53. * 商品期货
  54. */
  55. public final static HashSet<String> CMDT_FUTRUE = toHashSet("SI,LC,ZC,WT,WH,UR,TA,SR,SM,SH,SF,SA,RS,RM,RI,PX,PM,PK,PF,OI,MA,LR,JR,GN,FG," +
  56. "CY,CJ,CF,AP,Y,V,S,RR,PP,PG,P,M,LH,L,JM,JD,J,I,FB,EG,EB,CS,C,BB,B,A,SCTAS,SC,NR,LU,EC,BC,ZN,WR,SS,SP,SN,RU,RB,PB,NI,HC,FU,CU,BU,BR,AU,AO,AL,AG");
  57. private static List<String> toList(String code) {
  58. if (null == code || "".equals(code.trim())) {
  59. return null;
  60. }
  61. return Arrays.asList(code.replaceAll("\\s+", "").split(","));
  62. }
  63. private static HashSet<String> toHashSet(String string) {
  64. String[] arr = string.replaceAll("\\s+", "").split(",");
  65. HashSet<String> set = new HashSet<>(arr.length);
  66. set.addAll(Arrays.asList(arr));
  67. return set;
  68. }
  69. }