Prechádzať zdrojové kódy

init: init project step1

shc 1 rok pred
rodič
commit
127ba98979
100 zmenil súbory, kde vykonal 0 pridanie a 6928 odobranie
  1. 0 0
      LICENSE
  2. 0 1
      README.md
  3. 0 23
      db/Dockerfile
  4. 0 148
      docker-compose.yml
  5. 0 18
      hnqz-auth/Dockerfile
  6. 0 49
      hnqz-common/hnqz-common-bom/pom.xml
  7. 0 49
      hnqz-common/hnqz-common-ding/pom.xml
  8. 0 48
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/DingAutoConfiguration.java
  9. 0 25
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/config/DingConfig.java
  10. 0 34
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/CommonNotify.java
  11. 0 49
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/CommonRequest.java
  12. 0 38
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/CommonResponse.java
  13. 0 37
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployAccountQueryRequest.java
  14. 0 10
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployAccountQueryResponse.java
  15. 0 14
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployAccountQueryResult.java
  16. 0 14
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployAccountQueryResultItem.java
  17. 0 21
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckNotify.java
  18. 0 13
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckNotifyData.java
  19. 0 13
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckNotifyDataItem.java
  20. 0 41
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckRequest.java
  21. 0 10
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckResponse.java
  22. 0 14
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckResult.java
  23. 0 18
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckResultItem.java
  24. 0 41
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployFreelancesQueryRequest.java
  25. 0 10
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployFreelancesQueryResponse.java
  26. 0 13
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployFreelancesQueryResult.java
  27. 0 16
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployFreelancesQueryResultItem.java
  28. 0 19
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayNotify.java
  29. 0 19
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayNotifyData.java
  30. 0 21
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayNotifyDataItem.java
  31. 0 69
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayRequest.java
  32. 0 80
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayRequestV2.java
  33. 0 82
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayRequestV3.java
  34. 0 10
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayResponse.java
  35. 0 14
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayResult.java
  36. 0 14
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayResultSuccessItem.java
  37. 0 15
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayResultfailItem.java
  38. 0 19
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployRemitNotify.java
  39. 0 20
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployRemitNotifyData.java
  40. 0 20
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployRemitNotifyDataInfo.java
  41. 0 39
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/NotifyResponse.java
  42. 0 24
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/NotifyType.java
  43. 0 226
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/Test.java
  44. 0 56
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/TestNotify.java
  45. 0 50
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/enums/DingEnum.java
  46. 0 24
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/enums/DingSubjectChannelEnum.java
  47. 0 211
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/service/DingService.java
  48. 0 31
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/sign/AccessSign.java
  49. 0 26
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/DingConvertUtil.java
  50. 0 165
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/HttpClientUtils.java
  51. 0 43
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/JsonUtils.java
  52. 0 173
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/RsaCoreUtil.java
  53. 0 217
      hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/SignUtils.java
  54. 0 2
      hnqz-common/hnqz-common-ding/src/main/resources/META-INF/spring.factories
  55. 0 46
      hnqz-common/hnqz-common-qcc/pom.xml
  56. 0 31
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/QccAutoConfiguration.java
  57. 0 14
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/config/QccConfig.java
  58. 0 49
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/CommonRequest.java
  59. 0 35
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/CommonResponse.java
  60. 0 11
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/EmployeeGetListDataItem.java
  61. 0 26
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/EmployeeGetListRequest.java
  62. 0 15
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/EmployeeGetListResponse.java
  63. 0 11
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/PageInfo.java
  64. 0 67
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/service/QccService.java
  65. 0 113
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/utils/HttpClientUtils.java
  66. 0 46
      hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/utils/JsonUtils.java
  67. 0 2
      hnqz-common/hnqz-common-qcc/src/main/resources/META-INF/spring.factories
  68. 0 50
      hnqz-common/hnqz-common-swagger/pom.xml
  69. 0 36
      hnqz-common/hnqz-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/annotation/EnableHnqzSwagger2.java
  70. 0 143
      hnqz-common/hnqz-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/config/SwaggerAutoConfiguration.java
  71. 0 161
      hnqz-common/hnqz-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/config/SwaggerProperties.java
  72. 0 73
      hnqz-common/hnqz-common-taxhelper/pom.xml
  73. 0 204
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/Common.java
  74. 0 899
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/SM2.java
  75. 0 242
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/SM3.java
  76. 0 437
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/SM4.java
  77. 0 522
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/NumberTool.java
  78. 0 23
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/Params.java
  79. 0 30
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/SM2KeyPair.java
  80. 0 284
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/SM4Base.java
  81. 0 15
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/SM4_Context.java
  82. 0 164
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/SignUtils.java
  83. 0 43
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/StreamTool.java
  84. 0 24
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/TaxHelperAutoConfiguration.java
  85. 0 20
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/annotation/TaxHelper.java
  86. 0 62
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/common/CommonConstants.java
  87. 0 32
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/config/TaxHelperConfig.java
  88. 0 30
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/EncryptLoginInfo.java
  89. 0 65
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperAddMemberModel.java
  90. 0 37
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperAppletBizTokenModel.java
  91. 0 26
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperAppletCheckFaceModel.java
  92. 0 36
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperBindingCardConfirmModel.java
  93. 0 33
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperBindingCardVerificationModel.java
  94. 0 31
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperECheckModel.java
  95. 0 42
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperEidTokenModel.java
  96. 0 31
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperGetUserAgreementModel.java
  97. 0 42
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperH5BizTokenModel.java
  98. 0 41
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperLoginModel.java
  99. 0 35
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperModel.java
  100. 0 93
      hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperSettlementModel.java

+ 0 - 0
LICENSE


+ 0 - 1
README.md

@@ -1 +0,0 @@
-## 协议和授权

+ 0 - 23
db/Dockerfile

@@ -1,23 +0,0 @@
-FROM mysql:8.0.20
-
-MAINTAINER hnqz()
-
-ENV TZ=Asia/Shanghai
-
-RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
-COPY ./1schema.sql /docker-entrypoint-initdb.d
-
-COPY ./2hnqzx.sql /docker-entrypoint-initdb.d
-
-COPY ./3hnqzx_ac.sql /docker-entrypoint-initdb.d
-
-COPY ./4hnqzx_job.sql /docker-entrypoint-initdb.d
-
-COPY ./5hnqzx_mp.sql /docker-entrypoint-initdb.d
-
-COPY ./6hnqzx_config.sql /docker-entrypoint-initdb.d
-
-COPY ./7hnqzx_pay.sql /docker-entrypoint-initdb.d
-
-COPY ./8hnqzx_codegen.sql /docker-entrypoint-initdb.d

+ 0 - 148
docker-compose.yml

@@ -1,148 +0,0 @@
-# 使用说明 V3.8.0
-# 1. 使用docker-compose  宿主机不需要配置host来发现
-# 2. 无需修改源码,根目录  docker-compose up 即可
-# 3. 静静等待服务启动
-
-version: '2'
-services:
-  hnqz-register:
-    build:
-      context: ./hnqz-register
-    restart: always
-    container_name: hnqz-register
-    image: hnqz-register
-    ports:
-      - 8848:8848
-    extra_hosts:
-      - "hnqz-register:172.21.0.7"
-      - "hnqz-gateway:172.21.0.7"
-      - "hnqz-redis:172.21.0.7"
-      - "hnqz-zookeeper:172.21.0.7"
-      - "hnqz-xxl:172.21.0.7"
-      - "hnqz-mysql:172.21.0.7"
-      - "hnqz-sentinel:172.21.0.71"
-
-  hnqz-gateway:
-    build:
-      context: ./hnqz-gateway
-    restart: always
-    container_name: hnqz-gateway
-    image: hnqz-gateway
-    ports:
-      - 9999:9999
-    extra_hosts:
-      - "hnqz-register:172.21.0.7"
-      - "hnqz-gateway:172.21.0.7"
-      - "hnqz-redis:172.21.0.7"
-      - "hnqz-zookeeper:172.21.0.7"
-      - "hnqz-xxl:172.21.0.7"
-      - "hnqz-mysql:172.21.0.7"
-      - "hnqz-sentinel:172.21.0.71"
-
-  hnqz-auth:
-    build:
-      context: ./hnqz-auth
-    restart: always
-    container_name: hnqz-auth
-    image: hnqz-auth
-    extra_hosts:
-      - "hnqz-register:172.21.0.7"
-      - "hnqz-gateway:172.21.0.7"
-      - "hnqz-redis:172.21.0.7"
-      - "hnqz-zookeeper:172.21.0.7"
-      - "hnqz-xxl:172.21.0.7"
-      - "hnqz-mysql:172.21.0.7"
-      - "hnqz-sentinel:172.21.0.71"
-
-  hnqz-daemon-quartz:
-    build:
-      context: ./hnqz-visual/hnqz-daemon-quartz
-    restart: always
-    image: hnqz-daemon-quartz
-    container_name: hnqz-daemon-quartz
-    extra_hosts:
-      - "hnqz-register:172.21.0.7"
-      - "hnqz-gateway:172.21.0.7"
-      - "hnqz-redis:172.21.0.7"
-      - "hnqz-zookeeper:172.21.0.7"
-      - "hnqz-xxl:172.21.0.7"
-      - "hnqz-mysql:172.21.0.7"
-      - "hnqz-sentinel:172.21.0.71"
-
-  hnqz-upms:
-    build:
-      context: ./hnqz-upms/hnqz-upms-biz
-    restart: always
-    container_name: hnqz-upms
-    image: hnqz-upms
-    extra_hosts:
-      - "hnqz-register:172.21.0.7"
-      - "hnqz-gateway:172.21.0.7"
-      - "hnqz-redis:172.21.0.7"
-      - "hnqz-zookeeper:172.21.0.7"
-      - "hnqz-xxl:172.21.0.7"
-      - "hnqz-mysql:172.21.0.7"
-      - "hnqz-sentinel:172.21.0.71"
-#  hnqz-monitor:
-#    build:
-#      context: ./hnqz-visual/hnqz-monitor
-#    restart: always
-#    image: hnqz-monitor
-#    container_name: hnqz-monitor
-#    ports:
-#      - 5001:5001
-#
-
-#  hnqz-daemon-elastic-job:
-#    build:
-#      context: ./hnqz-visual/hnqz-daemon-elastic-job
-#    restart: always
-#    image: hnqz-daemon-elastic-job
-#    container_name: hnqz-daemon-elastic-job
-
-#  hnqz-codegen:
-#    build:
-#      context: ./hnqz-visual/hnqz-codegen
-#    restart: always
-#    image: hnqz-codegen
-#    container_name: hnqz-codegen
-
-#  hnqz-mp-platform:
-#    build:
-#      context: ./hnqz-visual/hnqz-mp-platform
-#    restart: always
-#    image: hnqz-mp-platform
-#    container_name: hnqz-mp-platform
-#
-#  hnqz-pay-platform:
-#    build:
-#      context: ./hnqz-visual/hnqz-pay-platform
-#    restart: always
-#    image: hnqz-pay-platform
-#    container_name: hnqz-pay-platform
-#
-#  hnqz-oa-platform:
-#    build:
-#      context: ./hnqz-visual/hnqz-oa-platform
-#    restart: always
-#    image: hnqz-oa-platform
-#    container_name: hnqz-oa-platform
-#
-#  hnqz-tx-manager:
-#    build:
-#      context: ./hnqz-visual/hnqz-tx-manager
-#    restart: always
-#    image: hnqz-tx-manager
-#    container_name: hnqz-tx-manager
-#    ports:
-#      - 5004:5004
-#      - 9998:9998
-#
-#  hnqz-sentinel:
-#    build:
-#      context: ./hnqz-visual/hnqz-sentinel-dashboard
-#    restart: always
-#    image: hnqz-sentinel
-#    container_name: hnqz-sentinel
-#    ports:
-#      - 5020:5020

+ 0 - 18
hnqz-auth/Dockerfile

@@ -1,18 +0,0 @@
-FROM pig4cloud/java:8-jre
-
-MAINTAINER
-
-ENV TZ=Asia/Shanghai
-ENV JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
-
-RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
-RUN mkdir -p /hnqz-auth
-
-WORKDIR /hnqz-auth
-
-EXPOSE 3000
-
-ADD ./target/hnqz-auth.jar ./
-
-CMD sleep 120;java $JAVA_OPTS -jar hnqz-auth.jar

+ 0 - 49
hnqz-common/hnqz-common-bom/pom.xml

@@ -23,11 +23,9 @@
 		<druid.version>1.1.22</druid.version>
 		<mysql.connector.version>8.0.20</mysql.connector.version>
 		<mp.weixin.version>3.7.0</mp.weixin.version>
-		<ijpay.version>1.2.0</ijpay.version>
 		<groovy.version>3.0.3</groovy.version>
 		<security.oauth.version>2.3.6.RELEASE</security.oauth.version>
 		<fastjson.version>1.2.69</fastjson.version>
-		<aliyun.version>3.0.52.ALL</aliyun.version>
 		<commons-io.version>2.8.0</commons-io.version>
 	</properties>
 
@@ -73,16 +71,6 @@
 				<artifactId>hnqz-common-oss</artifactId>
 				<version>${hnqz.version}</version>
 			</dependency>
-			<dependency>
-				<groupId>com.qunzhixinxi</groupId>
-				<artifactId>hnqz-common-ding</artifactId>
-				<version>${hnqz.version}</version>
-			</dependency>
-			<dependency>
-				<groupId>com.qunzhixinxi</groupId>
-				<artifactId>hnqz-common-qcc</artifactId>
-				<version>${hnqz.version}</version>
-			</dependency>
 			<dependency>
 				<groupId>com.qunzhixinxi</groupId>
 				<artifactId>hnqz-common-security</artifactId>
@@ -103,26 +91,11 @@
 				<artifactId>hnqz-common-sequence</artifactId>
 				<version>${hnqz.version}</version>
 			</dependency>
-			<!--<dependency>-->
-			<!--	<groupId>com.qunzhixinxi</groupId>-->
-			<!--	<artifactId>hnqz-common-swagger</artifactId>-->
-			<!--	<version>${hnqz.version}</version>-->
-			<!--</dependency>-->
-			<dependency>
-				<groupId>com.qunzhixinxi</groupId>
-				<artifactId>hnqz-common-taxhelper</artifactId>
-				<version>${hnqz.version}</version>
-			</dependency>
 			<dependency>
 				<groupId>com.qunzhixinxi</groupId>
 				<artifactId>hnqz-common-mq</artifactId>
 				<version>${hnqz.version}</version>
 			</dependency>
-			<!--<dependency>-->
-			<!--	<groupId>com.qunzhixinxi</groupId>-->
-			<!--	<artifactId>hnqz-common-transaction</artifactId>-->
-			<!--	<version>${hnqz.version}</version>-->
-			<!--</dependency>-->
 			<dependency>
 				<groupId>com.qunzhixinxi</groupId>
 				<artifactId>hnqz-upms-api</artifactId>
@@ -163,17 +136,6 @@
 				<artifactId>fastjson</artifactId>
 				<version>${fastjson.version}</version>
 			</dependency>
-			<!--&lt;!&ndash;swagger 最新依赖内置版本&ndash;&gt;-->
-			<!--<dependency>-->
-			<!--	<groupId>io.swagger</groupId>-->
-			<!--	<artifactId>swagger-models</artifactId>-->
-			<!--	<version>${swagger.core.version}</version>-->
-			<!--</dependency>-->
-			<!--<dependency>-->
-			<!--	<groupId>io.swagger</groupId>-->
-			<!--	<artifactId>swagger-annotations</artifactId>-->
-			<!--	<version>${swagger.core.version}</version>-->
-			<!--</dependency>-->
 			<!-- io -->
 			<dependency>
 				<groupId>commons-io</groupId>
@@ -191,17 +153,6 @@
 				<artifactId>weixin-java-common</artifactId>
 				<version>${mp.weixin.version}</version>
 			</dependency>
-			<!--支付相关SDK-->
-			<dependency>
-				<groupId>com.github.javen205</groupId>
-				<artifactId>IJPay</artifactId>
-				<version>${ijpay.version}</version>
-			</dependency>
-			<dependency>
-				<groupId>com.alipay.sdk</groupId>
-				<artifactId>alipay-sdk-java</artifactId>
-				<version>${aliyun.version}</version>
-			</dependency>
 			<!--定义groovy 版本-->
 			<dependency>
 				<groupId>org.codehaus.groovy</groupId>

+ 0 - 49
hnqz-common/hnqz-common-ding/pom.xml

@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<parent>
-		<artifactId>hnqz-common</artifactId>
-		<groupId>com.qunzhixinxi</groupId>
-		<version>3.9.0</version>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
-
-	<artifactId>hnqz-common-ding</artifactId>
-	<packaging>jar</packaging>
-
-	<properties>
-		<fastjson.version>1.2.69</fastjson.version>
-	</properties>
-
-
-	<dependencies>
-		<!--hutool-->
-		<dependency>
-			<groupId>com.qunzhixinxi</groupId>
-			<artifactId>hnqz-common-core</artifactId>
-		</dependency>
-
-		<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
-		<dependency>
-			<groupId>commons-io</groupId>
-			<artifactId>commons-io</artifactId>
-			<version>2.8.0</version>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.httpcomponents</groupId>
-			<artifactId>httpclient</artifactId>
-			<version>4.5.3</version>
-		</dependency>
-
-		<dependency>
-			<groupId>com.alibaba</groupId>
-			<artifactId>fastjson</artifactId>
-			<version>${fastjson.version}</version>
-		</dependency>
-
-	</dependencies>
-
-
-</project>

+ 0 - 48
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/DingAutoConfiguration.java

@@ -1,48 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: hnqz
- */
-
-package com.qunzhixinxi.hnqz.common.ding;
-
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.service.DingService;
-import lombok.AllArgsConstructor;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-
-/**
- * aws 自动配置类
- *
- * @author hnqz
- * @author 858695266
- */
-@AllArgsConstructor
-//@EnableConfigurationProperties({ DingConfig.class })
-public class DingAutoConfiguration {
-
-//	private final DingConfig config;
-
-	@Bean
-	@ConditionalOnMissingBean(DingService.class)
-//	@ConditionalOnProperty(name = "ding.enable", havingValue = "true", matchIfMissing = true)
-	public DingService dingService() {
-		return new DingService();
-	}
-
-
-}

+ 0 - 25
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/config/DingConfig.java

@@ -1,25 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.config;
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-/**
- *  人力家配置
- *
- * @author zhangwt
- * @since 1.0
- */
-@Data
-//@ConfigurationProperties( prefix = "ding.master")
-public class DingConfig {
-    /**
-     * appId
-     */
-    private String appId;
-    private String appSecret;
-    private String queryUrl;
-    private String rsaPublicKey;
-
-
-}

+ 0 - 34
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/CommonNotify.java

@@ -1,34 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.sign.AccessSign;
-import com.qunzhixinxi.hnqz.common.ding.utils.SignUtils;
-import lombok.Data;
-import lombok.Getter;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 公共请求参数
- *
- * @author zhangwt
- * @since 1.0
- */
-@Data
-public class CommonNotify {
-
-	/**
-	 * sign
-	 */
-	protected String sign;
-
-	/**
-	 * data
-	 */
-	protected String data;
-
-
-
-}

+ 0 - 49
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/CommonRequest.java

@@ -1,49 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.qunzhixinxi.hnqz.common.ding.sign.AccessSign;
-import lombok.Getter;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 公共请求参数
- *
- * @author zhangwt
- * @since 1.0
- */
-public abstract class CommonRequest {
-
-	/**
-	 * token数据
-	 */
-	@Getter
-	@JsonIgnore
-	protected AccessSign sign;
-
-	/**
-	 * 查询地址
-	 */
-	@Getter
-	@JsonIgnore
-	protected String queryUrl;
-
-	/**
-	 * uri
-	 */
-	@Getter
-	@JsonIgnore
-	protected String uri;
-
-	/**
-	 * uri
-	 */
-	@Getter
-	@JsonIgnore
-	protected String body;
-
-
-
-
-}

+ 0 - 38
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/CommonResponse.java

@@ -1,38 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-/**
- * 公共请求参数
- *
- * @author zhangwt
- * @since 1.0
- */
-@Data
-public abstract class CommonResponse {
-	/**
-	 * 业务码
-	 */
-	private String code;
-
-	/**
-	 * 信息
-	 */
-	private String msg;
-
-
-
-	private Boolean success;
-
-	/**
-	 * 是否成功
-	 *
-	 * @param
-	 * @return
-	 * @author jimmy.zhang
-	 * @since 1.0
-	 */
-	public boolean isSuccess() {
-		return "200".equals(this.code)&&success;
-	}
-}

+ 0 - 37
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployAccountQueryRequest.java

@@ -1,37 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.sign.AccessSign;
-import com.qunzhixinxi.hnqz.common.ding.utils.JsonUtils;
-import com.qunzhixinxi.hnqz.common.ding.utils.SignUtils;
-import lombok.Data;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Data
-public class EmployAccountQueryRequest extends CommonRequest{
-
-	private static final String PATH = "/oapi/v1/employ/account/query";
-
-	public EmployAccountQueryRequest(
-			DingConfig config) {
-
-		String serviceSign = null;
-		try {
-			//签名
-			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
-					"POST", new HashMap<>(), new byte[0]);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		this.body = "";
-		this.sign = new AccessSign(config.getAppId(),serviceSign);
-		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
-	}
-
-
-}

+ 0 - 10
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployAccountQueryResponse.java

@@ -1,10 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployAccountQueryResponse extends CommonResponse {
-
-	private EmployAccountQueryResult data;
-
-}

+ 0 - 14
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployAccountQueryResult.java

@@ -1,14 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class EmployAccountQueryResult {
-
-
-	private List<EmployAccountQueryResultItem> accountList;
-
-
-}

+ 0 - 14
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployAccountQueryResultItem.java

@@ -1,14 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployAccountQueryResultItem {
-
-
-	private String amount;
-	private String accountName;
-	private String accountNo;
-
-
-}

+ 0 - 21
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckNotify.java

@@ -1,21 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.utils.SignUtils;
-import lombok.Data;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-
-@Slf4j
-@Getter
-@Setter
-public class EmployCheckNotify {
-
-	private EmployCheckNotifyData data;
-
-	private String sign;
-
-
-}

+ 0 - 13
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckNotifyData.java

@@ -1,13 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class EmployCheckNotifyData {
-
-	private String callbackType;
-
-	private List<EmployCheckNotifyDataItem> freelancesResult;
-}

+ 0 - 13
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckNotifyDataItem.java

@@ -1,13 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployCheckNotifyDataItem {
-
-	private String name;
-	private String mobile;
-	private String idCard;
-	private Integer status;
-	private String remark;
-}

+ 0 - 41
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckRequest.java

@@ -1,41 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.sign.AccessSign;
-import com.qunzhixinxi.hnqz.common.ding.utils.JsonUtils;
-import com.qunzhixinxi.hnqz.common.ding.utils.SignUtils;
-import lombok.Data;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Data
-public class EmployCheckRequest extends CommonRequest{
-
-	private static final String PATH = "/oapi/v1/employ/freelances/check";
-
-	public EmployCheckRequest(
-			DingConfig config,
-			List list) {
-
-		Map<String,Object> map = new HashMap<>();
-		map.put("freelances",list);
-		String bodyStr = JsonUtils.serializer(map);
-		String serviceSign = null;
-		try {
-			//签名
-			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
-					"POST", new HashMap<>(), bodyStr.getBytes());
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		this.body = bodyStr;
-		this.sign = new AccessSign(config.getAppId(),serviceSign);
-		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
-	}
-
-
-}

+ 0 - 10
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckResponse.java

@@ -1,10 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployCheckResponse extends CommonResponse {
-
-	private EmployCheckResult data;
-
-}

+ 0 - 14
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckResult.java

@@ -1,14 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class EmployCheckResult {
-
-
-	private List<EmployCheckResultItem> freelancesResult;
-
-
-}

+ 0 - 18
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployCheckResultItem.java

@@ -1,18 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class EmployCheckResultItem {
-
-
-	private String name;
-	private String mobile;
-	private String idCard;
-	private Integer checkStatus;
-	private String checkRemark;
-
-
-}

+ 0 - 41
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployFreelancesQueryRequest.java

@@ -1,41 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.sign.AccessSign;
-import com.qunzhixinxi.hnqz.common.ding.utils.JsonUtils;
-import com.qunzhixinxi.hnqz.common.ding.utils.SignUtils;
-import lombok.Data;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@Data
-public class EmployFreelancesQueryRequest extends CommonRequest{
-
-	private static final String PATH = "/oapi/v1/employ/freelances/payResult";
-
-	public EmployFreelancesQueryRequest(DingConfig config, String statementNo) {
-
-
-		Map<String, Object> map = new HashMap<>();
-		map.put("statementNo", statementNo);
-		String bodyStr = JsonUtils.serializer(map);
-
-		this.body = bodyStr;
-		String serviceSign = null;
-		try {
-			//签名
-			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
-					"POST", new HashMap<>(), body.getBytes());
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		this.body = bodyStr;
-		this.sign = new AccessSign(config.getAppId(),serviceSign);
-		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
-	}
-
-
-}

+ 0 - 10
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployFreelancesQueryResponse.java

@@ -1,10 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployFreelancesQueryResponse extends CommonResponse {
-
-	private EmployFreelancesQueryResult data;
-
-}

+ 0 - 13
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployFreelancesQueryResult.java

@@ -1,13 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class EmployFreelancesQueryResult {
-
-	private List<EmployFreelancesQueryResultItem> payResult;
-
-
-}

+ 0 - 16
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployFreelancesQueryResultItem.java

@@ -1,16 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployFreelancesQueryResultItem {
-
-
-	private String name;
-	private String mobile;
-	private String idCard;
-	private Integer payStatus;
-	private String failReason;
-
-
-}

+ 0 - 19
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayNotify.java

@@ -1,19 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import lombok.Data;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-
-@Getter
-@Setter
-@Slf4j
-public class EmployPayNotify {
-
-
-	private EmployPayNotifyData data;
-
-	private String sign;
-
-}

+ 0 - 19
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayNotifyData.java

@@ -1,19 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.List;
-
-@Getter
-@Setter
-@Slf4j
-public class EmployPayNotifyData {
-
-	private String callbackType;
-	private String statementNo;
-	private List<EmployPayNotifyDataItem> freelancesPayResult;
-
-}

+ 0 - 21
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayNotifyDataItem.java

@@ -1,21 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-
-@Getter
-@Setter
-@Slf4j
-public class EmployPayNotifyDataItem {
-
-	private String name;
-	private String mobile;
-	private String idCard;
-	private Integer settlementStatus;
-	private String remark;
-	private String settlementTime;
-
-
-}

+ 0 - 69
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayRequest.java

@@ -1,69 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.sign.AccessSign;
-import com.qunzhixinxi.hnqz.common.ding.utils.JsonUtils;
-import com.qunzhixinxi.hnqz.common.ding.utils.SignUtils;
-import lombok.Data;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Data
-@Deprecated
-public class EmployPayRequest extends CommonRequest {
-
-	private static final String PATH = "/oapi/v1/employ/freelances/pay";
-
-
-	/**
-	 * bizType
-	 *	79 软件开发服务
-	 66 信息系统服务
-	 77 技术咨询划服务
-	 30 市场推广服务
-	 70 其他咨询服务
-	 203 现场辅助服务
-	 **/
-
-	/**
-	 * @param config
-	 * @param subjectName
-	 * @param statementNo
-	 * @param statementName
-	 * @param bizType
-	 * @param list
-	 */
-	public EmployPayRequest(
-			DingConfig config,
-			String subjectName,
-			String statementNo,
-			String statementName,
-			Integer bizType,
-			List list) {
-
-		Map<String, Object> map = new HashMap<>();
-		map.put("subjectName", subjectName);
-		map.put("statementNo", statementNo);
-		map.put("statementName", statementName);
-		map.put("bizType", bizType);
-		map.put("freelances", list);
-		String bodyStr = JsonUtils.serializer(map);
-		String serviceSign = null;
-		try {
-			//签名
-			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
-					"POST", new HashMap<>(), bodyStr.getBytes());
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		this.body = bodyStr;
-		this.sign = new AccessSign(config.getAppId(), serviceSign);
-		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
-	}
-
-
-}

+ 0 - 80
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayRequestV2.java

@@ -1,80 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.sign.AccessSign;
-import com.qunzhixinxi.hnqz.common.ding.utils.JsonUtils;
-import com.qunzhixinxi.hnqz.common.ding.utils.SignUtils;
-import lombok.Data;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-
-@Data
-@Deprecated
-public class EmployPayRequestV2 extends CommonRequest {
-
-	private static final String PATH = "/oapi/v2/employ/freelances/pay";
-
-	private static String[] statementTaskDescArr = {"通过不定时客户拜访,调查及了解客户信息及所需方向,根据所需定向推广业务管理系统",
-			"推广业务管理系统,使受众知晓及分享本系统",
-			"通过现有信息做推广任务,使客户了解要本产品【业务管理系统】信息",
-			"通过不同的方式推广业务管理系统、提升产品知名度,建立品牌形象"
-	};
-
-
-	/**
-	 * bizType
-	 *	79 软件开发服务
-	 66 信息系统服务
-	 77 技术咨询划服务
-	 30 市场推广服务
-	 70 其他咨询服务
-	 203 现场辅助服务
-	 **/
-
-	/**
-	 * @param config
-	 * @param subjectName
-	 * @param statementNo
-	 * @param statementName
-	 * @param bizType
-	 * @param list
-	 */
-	public EmployPayRequestV2(
-			DingConfig config,
-			String subjectName,
-			String statementNo,
-			String statementName,
-			Integer bizType,
-			List list) {
-
-		Map<String, Object> map = new HashMap<>();
-		map.put("subjectName", subjectName);
-		map.put("statementNo", statementNo);
-		map.put("statementName", statementName);
-		map.put("bizType", bizType);
-
-		int idx = (int) (Math.random() * 4);
-
-		map.put("statementTaskDesc",statementTaskDescArr[idx]);
-		map.put("statementTaskSettlementRules","完成不同任务获得不同任务积分,根据不同任务给与0~30000积分,每个积分兑换0.5~2元,按次数结算");
-		map.put("freelances", list);
-		String bodyStr = JsonUtils.serializer(map);
-		String serviceSign = null;
-		try {
-			//签名
-			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
-					"POST", new HashMap<>(), bodyStr.getBytes());
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		this.body = bodyStr;
-		this.sign = new AccessSign(config.getAppId(), serviceSign);
-		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
-	}
-
-}

+ 0 - 82
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayRequestV3.java

@@ -1,82 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import cn.hutool.core.date.DatePattern;
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.sign.AccessSign;
-import com.qunzhixinxi.hnqz.common.ding.utils.JsonUtils;
-import com.qunzhixinxi.hnqz.common.ding.utils.SignUtils;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Data
-public class EmployPayRequestV3 extends CommonRequest {
-
-	private static final String PATH = "/oapi/v3/employ/freelances/pay";
-
-	private static String[] statementTaskDescArr = {"通过不定时客户拜访,调查及了解客户信息及所需方向,根据所需定向推广业务管理系统",
-			"推广业务管理系统,使受众知晓及分享本系统",
-			"通过现有信息做推广任务,使客户了解要本产品【业务管理系统】信息",
-			"通过不同的方式推广业务管理系统、提升产品知名度,建立品牌形象"
-	};
-
-	/**
-	 * bizType
-	 *	79 软件开发服务
-	 *	66 信息系统服务
-	 *	77 技术咨询划服务
-	 *	30 市场推广服务
-	 *	70 其他咨询服务
-	 *	203 现场辅助服务
-	 * @param config
-	 * @param subjectName 结算主体
-	 * @param statementNo 结算单id
-	 * @param statementName 结算单名称
-	 * @param bizType 业务类型
-	 * @param taskStartTime 任务开始时间
-	 * @param taskEndTime 任务结束时间
-	 * @param list
-	 */
-	public EmployPayRequestV3(
-			DingConfig config,
-			String subjectName,
-			String statementNo,
-			String statementName,
-			Integer bizType,
-			List list,
-			LocalDateTime taskStartTime,
-			LocalDateTime taskEndTime) {
-
-		Map<String, Object> map = new HashMap<>();
-		map.put("subjectName", subjectName);
-		map.put("statementNo", statementNo);
-		map.put("statementName", statementName);
-		map.put("bizType", bizType);
-		int idx = (int) (Math.random() * 4);
-		map.put("statementTaskDesc", statementTaskDescArr[idx]);
-		map.put("statementTaskSettlementRules", "完成不同任务获得不同任务积分,根据不同任务给与0~30000积分,每个积分兑换0.5~2元,按次数结算");
-		map.put("freelances", list);
-		map.put("taskStartTime", DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN).format(taskStartTime));
-		map.put("taskEndTime", DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN).format(taskEndTime));
-
-		String bodyStr = JsonUtils.serializer(map);
-		String serviceSign = null;
-
-		try {
-			//签名
-			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(), "POST", new HashMap<>(), bodyStr.getBytes());
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		this.body = bodyStr;
-		this.sign = new AccessSign(config.getAppId(), serviceSign);
-		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
-	}
-
-}

+ 0 - 10
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayResponse.java

@@ -1,10 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployPayResponse extends CommonResponse {
-
-	private EmployPayResult data;
-
-}

+ 0 - 14
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayResult.java

@@ -1,14 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class EmployPayResult {
-
-	private List<EmployPayResultSuccessItem> successResult;
-	private List<EmployPayResultfailItem> failResult;
-
-
-}

+ 0 - 14
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayResultSuccessItem.java

@@ -1,14 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployPayResultSuccessItem {
-
-
-	private String name;
-	private String mobile;
-	private String idCard;
-
-
-}

+ 0 - 15
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployPayResultfailItem.java

@@ -1,15 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployPayResultfailItem {
-
-
-	private String name;
-	private String mobile;
-	private String idCard;
-	private String checkRemark;
-
-
-}

+ 0 - 19
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployRemitNotify.java

@@ -1,19 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import lombok.Data;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-
-@Getter
-@Setter
-@Slf4j
-public class EmployRemitNotify{
-
-
-	private EmployRemitNotifyData data;
-
-	private String sign;
-
-}

+ 0 - 20
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployRemitNotifyData.java

@@ -1,20 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-
-@Getter
-@Setter
-@Slf4j
-public class EmployRemitNotifyData {
-
-
-
-	private String callbackType;
-
-	private EmployRemitNotifyDataInfo accountInfo;
-
-
-}

+ 0 - 20
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/EmployRemitNotifyDataInfo.java

@@ -1,20 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-
-@Getter
-@Setter
-@Slf4j
-public class EmployRemitNotifyDataInfo {
-
-	private String accountName;
-	private String accountNo;
-	private String opType;
-	private String amount;
-	private String bankSerialNo;
-
-
-}

+ 0 - 39
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/NotifyResponse.java

@@ -1,39 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import lombok.Data;
-
-@Data
-public class NotifyResponse extends CommonResponse{
-
-	private String data;
-
-	/**
-	 * 失败的静态方法
-	 *
-	 * @param
-	 * @return
-	 * @author jimmy.zhang
-	 * @date 2019-08-05
-	 */
-	public static NotifyResponse success() {
-		NotifyResponse  result = new NotifyResponse();
-		result.setCode("200");
-		result.setSuccess(true);
-		return result;
-	}
-
-	public static NotifyResponse failure(String msg) {
-		NotifyResponse  result = new NotifyResponse();
-		result.setCode("9999");
-		result.setMsg(msg);
-		result.setSuccess(false);
-		return result;
-	}
-
-	public static NotifyResponse failure() {
-		NotifyResponse  result = new NotifyResponse();
-		result.setCode("9999");
-		result.setSuccess(false);
-		return result;
-	}
-}

+ 0 - 24
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/NotifyType.java

@@ -1,24 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-
-public enum NotifyType {
-
-	FREELANCES_CHECK("FREELANCES_CHECK", "灵工认证状态通知"),
-	ACCOUNT_RECEIVE("ACCOUNT_RECEIVE", "账户到账通知"),
-	FREELANCES_PAY("FREELANCES_PAY", "结算单发放结果通知");
-
-	private String code;
-
-	private String desc;
-
-
-	NotifyType(final String code, final String desc) {
-		this.code = code;
-		this.desc = desc;
-	}
-
-	public String getCode() {
-
-		return code;
-	}
-}

+ 0 - 226
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/Test.java

@@ -1,226 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import com.qunzhixinxi.hnqz.common.ding.utils.HttpClientUtils;
-import io.micrometer.core.instrument.util.StringUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClients;
-import org.jasypt.contrib.org.apache.commons.codec_1_3.binary.Base64;
-
-import javax.crypto.Mac;
-import javax.crypto.spec.SecretKeySpec;
-import java.io.*;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-public class Test {
-
-
-	public static void main(String[] args) throws Exception {
-
-		/**
-		 * 参数列表
-		 */
-
-		String bodyStr = "{\n" +
-				"    \"freelances\": [\n" +
-				"      {\n" +
-				"        \"mobile\": \"15000998877\",\n" +
-				"        \"name\": \"张三\",\n" +
-				"        \"idType\": \"1\",\n" +
-				"        \"idCard\": \"350198765623418765\"\n" +
-				"      }\n" +
-				"    ]\n" +
-				"}";
-		String serviceSign = serviceSign("/oapi/v1/employ/freelances/check",
-				"POST", new HashMap<>(), bodyStr.getBytes());
-		System.out.println("serviceSign=========" + serviceSign);
-		// 创建一个post对象
-		String url = "https://test-f.renlijia.com/oapi/v1/employ/freelances/check";
-		HttpPost post = new HttpPost(url);
-
-		StringEntity s = new StringEntity(bodyStr, "UTF-8"); // 中文乱码在此解决
-		s.setContentType("application/json");
-		post.setEntity(s);
-		post.setHeader("app-id","888999");
-		post.setHeader("signature",serviceSign);
-
-		// 执行post请求
-		CloseableHttpResponse response = HttpClients.createDefault().execute(post);
-//		String json = HttpClientUtils.doPost("https://test-f.renlijia.com", params);
-
-		String result = fromStream(response.getEntity().getContent(), "UTF-8");
-		System.out.println("result-----" + result);
-
-		System.out.println("response=========" + response.getStatusLine().getStatusCode());
-		System.out.println("response=========" + response.getEntity().getContent().toString());
-	}
-
-	private static String fromStream(InputStream is, String charset) throws IOException {
-		BufferedReader in = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-		StringBuffer buffer = new StringBuffer();
-
-		String line = "";
-		while ((line = in.readLine()) != null) {
-			buffer.append(line);
-		}
-
-		return new String(buffer.toString().getBytes("UTF-8"), charset);
-	}
-
-
-	/**
-	 * 签名算法HmacSha256
-	 */
-	public static final String HMAC_SHA256 = "HmacSHA256";
-
-	/**
-	 * 编码
-	 */
-	public static final String ENCODING = "UTF-8";
-	/**
-	 * 换⾏符
-	 */
-	private static char LF = '\n';
-
-	private static final String HTTP_METHOD_POST = "post";
-	private static final String HTTP_METHOD_PUT = "put";
-
-	/**
-	 * 26 * 获取请求签名
-	 * 27 *
-	 * 28 * @param uri 原始HTTP请求PATH(例:/oapi/v1/employ/free
-	 * lances/check)
-	 * 29 * @param httpMethod 原始HTTP请求⽅法(例:POST)5
-	 * 30 * @param paramsMap 原始HTTP请求所有Query+Form参数(POST请求:Ma
-	 * ps.newHashMap())
-	 * 31 * @param body 原始HTTP请求Body体(仅当请求为POST/PUT且⾮表
-	 * 单请求才需要设置此属性,表单形式的需要将参数放到paramsMap中)
-	 * 32 * @param appId ⽤户id
-	 * 33 * @return 签名结果
-	 * 34 * @throws Exception
-	 * 35
-	 */
-
-	public static String serviceSign(String uri, String httpMethod, Map<String, Object> paramsMap, byte[] body) throws Exception {
-		String bodyMd5 = buildBodyMd5(httpMethod, body);
-		String resourceToSign = buildResource(uri, paramsMap);
-		String stringToSign = buildStringToSign(resourceToSign,
-				httpMethod, bodyMd5);
-
-		Mac hmacSha256 = Mac.getInstance(HMAC_SHA256);
-		String appSecret = "5T8134269D467IGa0ZC7s907666r2C43";
-		byte[] keyBytes = appSecret.getBytes(ENCODING);
-		hmacSha256.init(new SecretKeySpec(keyBytes, 0, keyBytes.
-				length, HMAC_SHA256));
-		return new String(Base64.encodeBase64(hmacSha256.doFinal
-				(stringToSign.getBytes(ENCODING))), ENCODING);
-	}
-
-
-	public static String buildBodyMd5(String httpMethod, byte[] body) throws IOException {
-		if (body == null) {
-			return null;
-		}
-		if (!httpMethod.equalsIgnoreCase(HTTP_METHOD_POST) && !httpMethod.equalsIgnoreCase(HTTP_METHOD_PUT)){
-			return null;
-		}
-		InputStream inputStream = new ByteArrayInputStream(body);
-		byte[] bodyBytes = IOUtils.toByteArray(inputStream);
-		if (bodyBytes != null && bodyBytes.length > 0) {
-			return base64AndMD5(bodyBytes).trim();
-		}
-		return null;
-	}
-
-	public static String base64AndMD5(byte[] bytes) {
-		try {
-			final MessageDigest md = MessageDigest.getInstance(
-					"MD5");
-			md.reset();
-			md.update(bytes);
-			final Base64 base64 = new Base64();
-			return new String(base64.encode(md.digest()));
-		} catch (final NoSuchAlgorithmException e) {
-			throw new IllegalArgumentException("unknown algorith m MD5");
-		}
-	}
-
-	public static String buildResource(String uri, Map<String, Object> paramsMap) {
-		StringBuilder builder = new StringBuilder();
-		builder.append(uri);
-		TreeMap<String, Object> sortMap = new TreeMap<>();
-		sortMap.putAll(paramsMap);
-		if (sortMap.size() > 0) {
-			builder.append('?');
-			builder.append(buildMapToSign(sortMap));
-		}
-		return builder.toString();
-	}
-
-	public static String buildStringToSign(String resourceToSign, String method, String bodyMd5) {
-		StringBuilder sb = new StringBuilder();
-		sb.append(method).append(LF);
-		if (StringUtils.isNotBlank(bodyMd5)) {
-			sb.append(bodyMd5);
-		}
-		sb.append(LF);
-		sb.append(resourceToSign);
-		return sb.toString();
-	}
-
-	/**
-	 * 将Map转换为用&及=拼接的字符串
-	 */
-	public static String buildMapToSign(Map<String, Object> paramMap) {
-		StringBuilder builder = new StringBuilder();
-
-		for (Map.Entry<String, Object> e : paramMap.entrySet()) {
-			if (builder.length() > 0) {
-				builder.append('&');
-			}
-			String key = e.getKey();
-			Object value = e.getValue();
-			if (value != null) {
-				if (value instanceof List) {
-					List list = (List) value;
-					if (list.size() == 0) {
-						builder.append(key);
-					} else {
-						builder.append(key).append("=").append(String.valueOf(list.get(0)));
-					}
-				} else if (value instanceof Object[]) {
-					Object[] objs = (Object[]) value;
-					if (objs.length == 0) {
-						builder.append(key);
-					} else {
-						builder.append(key).append("=").append(String.valueOf(objs[0]));
-					}
-				} else {
-					builder.append(key).append("=").append(String.valueOf(value));
-				}
-			}
-		}
-		return builder.toString();
-	}
-
-
-	public void check() throws IOException {
-
-		String resourceToSign = "/oapi/v1/employ/freelances/check";
-		String body ="{\"freelances\":[{\"mobile\":\"15000998877\",\"name\":\"张三\",\"idType\":\"1\",\n" +
-				"\"idCard\":\"350198765623418765\"}]}";
-
-		String bodyMd5 = buildBodyMd5(HTTP_METHOD_POST, body.getBytes());
-
-		String stringToSign = buildStringToSign(resourceToSign, HTTP_METHOD_POST, bodyMd5);
-	}
-}

+ 0 - 56
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/entity/TestNotify.java

@@ -1,56 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.entity;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.qunzhixinxi.hnqz.common.ding.utils.SignUtils;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class TestNotify {
-
-
-
-	public static void main(String[] args) throws Exception {
-		String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoCEnYZYntCEjiapiLlJ6pjQtPqZhK/G7qCG9RFYk53Aw9VL4c637gLWsND+Hqizi3MIMI7lZBWwAghF4dtVnvhqUCbTdnml86ji4CNbPIQ+G79TdnpNJXzdL3r+tHK8Rp6bofXfCnft0hYvA+Y+/YeFDEhNqk65PAurt/osMwxl4FOKN0eFO5ZY7L6RtdbXjx8sFiRQQJiEqkPLFpHydaFWzJlIosgEV8UCnFyrqtIgCPyiKP3wV2T4d/2WiQ3jrOcU1sKHMuXwcAnb1HrBGjj4TKp2ySuWUpUI16a3ibhwAiOK6YWe7Az2HU1lKyOIr4fQBuuLjsUU7N3Ipoi8hcwIDAQAB";
-		String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCgISdhlie0ISOJqmIuUnqmNC0+pmEr8buoIb1EViTncDD1UvhzrfuAtaw0P4eqLOLcwgwjuVkFbACCEXh21We+GpQJtN2eaXzqOLgI1s8hD4bv1N2ek0lfN0vev60crxGnpuh9d8Kd+3SFi8D5j79h4UMSE2qTrk8C6u3+iwzDGXgU4o3R4U7lljsvpG11tePHywWJFBAmISqQ8sWkfJ1oVbMmUiiyARXxQKcXKuq0iAI/KIo/fBXZPh3/ZaJDeOs5xTWwocy5fBwCdvUesEaOPhMqnbJK5ZSlQjXpreJuHACI4rphZ7sDPYdTWUrI4ivh9AG64uOxRTs3cimiLyFzAgMBAAECggEAYxSAkJJfWMaUfa8OdwkT2Nk6EaTTRWSar6rIuIrw5L93m6ROFQ3XK8m9lsqkf/isGtp6tnQOEBvGqLR0rFrZiTha1zKxWj59S1PzE40Otq8r2CQHSQJriN3nNRm23KO6sdjFzDSZGDWp4KQbsI9wZPkEDiAzdtOJEg4ZWsHhEKoq/hdsVSzcQpWmCm17zXB0BUapTrXSaCGqnnfdhSFc8Noy9zNKr9wKQoOQMgwcQg+eDHMCcZH5LuelqbgdmSBtW6uzySPcKhW0gG2idaMHIRRsnyTmgj/NTZrAUr2XYZLhZmR6+56a7M7GHlIpOob9sxIIEdWHYbeNbxiS5hHtEQKBgQDexorVc9E8F68gDt/6YP26fra7oO5yiBej98ArJZ+bymPxwMSkzm+/trfU/rtjoxLNQAolBEMr5PLL117GMYZ92BVpVQHOFWbIL08HcEMTz5P6rOPAk36sq/NxXDLND+7oY8Fo8Y4JwXb5tGs5LhnmCfJO2cu2RP5tsUosdL/lqwKBgQC4AtExZ03JdoMPLuld4dqGy7+e8OvWiTXE5Qbd6ZrZ/rdN3zQSodAWcczGq9sUtnZmRPc/vAslWrsLpMryaREWLdGDaWiYimCgKuTKPP2l+DxggBcm7zNx8VcdNBuPZDwp6IAf/HtxDpqgp26N95UkYMLojBgl9ZrAreJUuP3bWQKBgGUEtvPv3tNXEgyBckNBNA0bZJVUdovs9ntd3wAxwVyNvCBl/0WUbswKePXWxPZ7fg0gmvkKI8OFwCt67/kDgC8UizEGYRkoT0E7YqTG3UPgfwPO3j/3Ihv+pRekbUzbisRKZ+vEjVoTJnY4v95f71KG9B+ZV2zBgHYRTMc38cSdAoGAaABnngWmKHTMNFuuWHqbmU41Wq8OjK32bveHPwuWkxltHx1FgDZmtxjQxYVCiN1r4/ecyzAMGKvERht4/TO3DZMN9Lkx/e1QGZbEwy1fq1u3PE+JRl8x83eVZhMadJwRiRo4uFtqpYa8jIq1aJYDfJEX+Hmd+G5tbfOZlYsNJ9kCgYEAj2grwMCXMShQSLzzNaE1iaAWYxtQcO+3Z8NPZDzaWLHUP5mbubWJXv9aywjd3oe6WJfnnlOxR92nh08OLsuQP7AvQtqDyyQj1ilTr5J8bWs15iXBKHNDx1p71bAYk3KFeXapRPtBcYF6h7iPiZA/mFTh8EVie/1tNH/UXUHV5ZY=";
-		String ming = "{\n" +
-				"        \"callbackType\": \"FREELANCES_CHECK\",\n" +
-				"        \"freelancesResult\": [\n" +
-				"            {\n" +
-				"                \"mobile\": \"13141282987\",\n" +
-				"                \"name\": \"张文涛\",\n" +
-				"                \"idCard\": \"410482199006075956\",\n" +
-				"                \"status\": 1,\n" +
-				"                \"remark\": \"\"\n" +
-				"            }\n" +
-				"        ]\n" +
-				"    }";
-		Map map = new HashMap<>();
-		Map map1 = new HashMap<>();
-
-
-		map1.put("mobile","13141282987");
-		map1.put("name","张文涛");
-		map1.put("idCard","410482199006075956");
-		map1.put("idCard","410482199006075956");
-		map1.put("status",1);
-		map1.put("remark","");
-		map.put("callbackType","FREELANCES_CHECK");
-		List list = new ArrayList();
-		list.add(map1);
-		map.put("freelancesResult",list);
-
-		String jsonObject= JSON.toJSONString(map);
-		System.err.println("加密后:"+ jsonObject);
-//		JSONObject jsonObject = JSON.parseObject(ming);
-		String sign = SignUtils.sign(privateKey, jsonObject);
-		System.err.println("加密后:"+ sign);
-		//解密后的明文
-		boolean verify = SignUtils.verify(publicKey, ming, sign);
-		System.err.println("验签结果:"+ verify);
-	}
-
-}

+ 0 - 50
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/enums/DingEnum.java

@@ -1,50 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * <p>
- * 结算相关字典
- */
-@Getter
-@AllArgsConstructor
-public enum DingEnum {
-
-	//灵工认证状态
-	CER_STATUS_1(1, "认证成功"),
-	CER_STATUS_2(2, "认证失败"),
-	CER_STATUS_3(3, "认证中"),
-	CER_STATUS_4(4, "未认证"),
-	//settleStatus结算状态
-	SETTLE_STATUS_SUCCESS(1,"结算成功"),
-	SETTLE_STATUS_FAIL(2,"结算失败"),
-	SETTLE_STATUS_SUBMIT(3,"全部提交"),
-	SETTLE_STATUS_NO(4,"未结算"),
-
-	SETTLE_STATUS_PART(5,"部分提交"),
-
-	SETTLE_STATUS_WAIT(9,"待结算"),
-
-	NOTE_STATUS_NO(0,"未结算"), // 未提交/提交失败
-	NOTE_STATUS_SUCCESS(1,"结算成功"),
-	NOTE_STATUS_FAIL(2,"结算失败"),  //提交成功  人力家返回结算失败
-	NOTE_STATUS_SUBMIT(3,"已提交"),
-//	NOTE_STATUS_WAIT(9,"待认证"),
-
-
-
-	;
-
-
-	/**
-	 * 类型
-	 */
-	private Integer type;
-
-	/**
-	 * 描述
-	 */
-	private String description;
-
-}

+ 0 - 24
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/enums/DingSubjectChannelEnum.java

@@ -1,24 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * {@code DingSubjectChannelEnum}
- * <p>
- * 人力家结算通道枚举
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2022/01/21 16:56
- */
-@Getter
-@AllArgsConstructor
-public enum DingSubjectChannelEnum {
-
-	DEF(0, "默认");
-
-	private final int code;
-
-	private final String message;
-}

+ 0 - 211
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/service/DingService.java

@@ -1,211 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.service;
-
-
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import com.qunzhixinxi.hnqz.common.ding.entity.*;
-import com.qunzhixinxi.hnqz.common.ding.utils.HttpClientUtils;
-import com.qunzhixinxi.hnqz.common.ding.utils.JsonUtils;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-
-import java.time.LocalDateTime;
-import java.util.List;
-
-@RequiredArgsConstructor
-@Slf4j
-public class DingService {
-
-//	private final DingConfig config;
-
-	/**
-	 * 灵工信息认证
-	 *
-	 * @param
-	 * @return
-	 * @author zhangwt
-	 * @since 1.0
-	 * 示例:
-	 * {
-	 * "mobile": "15000998877",
-	 * "name": "张三",
-	 * "idType": "1",
-	 * "idCard": "350198765623418765"
-	 * }
-	 */
-	public EmployCheckResponse check(DingConfig config, List list) {
-
-		EmployCheckRequest request = new EmployCheckRequest(config, list);
-		log.info("人力家请求报文: {}", request.getBody());
-		String json = HttpClientUtils.doPost(request);
-		log.info("人力家返回数据: {}", json);
-		EmployCheckResponse response = JsonUtils.deserializer(json, EmployCheckResponse.class);
-		if (!response.isSuccess()) {
-			log.error("灵工信息认证失败, code: {}, message: {}", response.getCode(), response.getMsg());
-		}
-		return response;
-	}
-
-	/**
-	 * 子账户余额查询
-	 *
-	 * @param
-	 * @return
-	 * @author zhangwt
-	 * @since 1.0
-	 */
-	public EmployAccountQueryResponse query(DingConfig config) {
-
-		EmployAccountQueryRequest request = new EmployAccountQueryRequest(config);
-		log.info("人力家请求报文: {}", request.getBody());
-		String json = HttpClientUtils.doPost(request);
-		log.info("人力家返回数据: {}", json);
-		EmployAccountQueryResponse response = JsonUtils.deserializer(json, EmployAccountQueryResponse.class);
-		if (!response.isSuccess()) {
-			log.error("子账户余额查询失败, code: {}, message: {}", response.getCode(), response.getMsg());
-		}
-		return response;
-	}
-
-
-	/**
-	 * 子账户余额查询
-	 *
-	 * @param subjectName   结算主体
-	 * @param statementNo   结算单id
-	 * @param statementName 结算单名称
-	 * @param bizType       业务类型
-	 * @param list
-	 * @return 示例:
-	 * {
-	 * "name": "张三",
-	 * "mobile": "15000998877",
-	 * "idCard": "350198765623418765"
-	 * "amount": "0.22"
-	 * }
-	 */
-	// @Deprecated
-	// public EmployPayResponse pay(DingConfig config,String subjectName,
-	// 						   String statementNo,
-	// 						   String statementName,
-	// 						   Integer bizType,
-	// 						   List list) {
-	//
-	// 	EmployPayRequest request = new EmployPayRequest(config, subjectName,
-	// 			statementNo,
-	// 			statementName,
-	// 			bizType,
-	// 			list);
-	// 	log.info("人力家请求报文: {}",request.getBody());
-	// 	String json = HttpClientUtils.doPost(request);
-	// 	log.info("人力家返回数据: {}", json);
-	// 	EmployPayResponse response = JsonUtils.deserializer(json, EmployPayResponse.class);
-	// 	if (!response.isSuccess()) {
-	// 		log.error("结算单推送失败, code: {}, message: {}", response.getCode(), response.getMsg());
-	// 	}
-	// 	return response;
-	// }
-
-	/**
-	 * 子账户余额查询
-	 *
-	 * @param subjectName   结算主体
-	 * @param statementNo   结算单id
-	 * @param statementName 结算单名称
-	 * @param bizType       业务类型
-	 * @param list
-	 * @return 示例:
-	 * {
-	 * "name": "张三",
-	 * "mobile": "15000998877",
-	 * "idCard": "350198765623418765"
-	 * "amount": "0.22"
-	 * }
-	 */
-	@Deprecated
-	public EmployPayResponse payV2(DingConfig config, String subjectName,
-								   String statementNo,
-								   String statementName,
-								   Integer bizType,
-								   List list) {
-
-		EmployPayRequestV2 request = new EmployPayRequestV2(config, subjectName,
-				statementNo,
-				statementName,
-				bizType,
-				list);
-		log.info("人力家请求报文: {}", request.getBody());
-		String json = HttpClientUtils.doPost(request);
-		log.info("人力家返回数据: {}", json);
-		EmployPayResponse response = JsonUtils.deserializer(json, EmployPayResponse.class);
-		if (!response.isSuccess()) {
-			log.error("结算单推送失败, code: {}, message: {}", response.getCode(), response.getMsg());
-		}
-		return response;
-	}
-
-	/**
-	 * 结算单推送
-	 *
-	 * @param subjectName   结算主体
-	 * @param statementNo   结算单id
-	 * @param statementName 结算单名称
-	 * @param bizType       业务类型
-	 * @param list          自由职业者
-	 * @param taskStartTime 任务开始时间
-	 * @param taskEndTime   任务结束时间
-	 * @return 示例:
-	 * {
-	 * "name": "张三",
-	 * "mobile": "15000998877",
-	 * "idCard": "350198765623418765"
-	 * "amount": "0.22"
-	 * }
-	 */
-	public EmployPayResponse payV3(DingConfig config, String subjectName,
-								   String statementNo,
-								   String statementName,
-								   Integer bizType,
-								   List list,
-								   LocalDateTime taskStartTime,
-								   LocalDateTime taskEndTime) {
-
-		EmployPayRequestV3 request = new EmployPayRequestV3(
-				config,
-				subjectName,
-				statementNo,
-				statementName,
-				bizType,
-				list,
-				taskStartTime,
-				taskEndTime);
-		log.info("人力家请求报文: {}", request.getBody());
-		String json = HttpClientUtils.doPost(request);
-		log.info("人力家返回数据: {}", json);
-		EmployPayResponse response = JsonUtils.deserializer(json, EmployPayResponse.class);
-		if (!response.isSuccess()) {
-			log.error("结算单推送失败, code: {}, message: {}", response.getCode(), response.getMsg());
-		}
-		return response;
-	}
-
-
-	/**
-	 * 结算单查询
-	 *
-	 * @param statementNo 结算单id
-	 * @return 查询结果
-	 */
-	public static EmployFreelancesQueryResponse freelancesQuery(DingConfig config, String statementNo) {
-		EmployFreelancesQueryRequest request = new EmployFreelancesQueryRequest(config, statementNo);
-
-		log.info("人力家请求报文: {}", request.getBody());
-		String json = HttpClientUtils.doPost(request);
-		log.info("人力家返回数据: {}", json);
-		EmployFreelancesQueryResponse response = JsonUtils.deserializer(json, EmployFreelancesQueryResponse.class);
-		if (!response.isSuccess()) {
-			log.error("结算单查询失败, code: {}, message: {}", response.getCode(), response.getMsg());
-		}
-		return response;
-	}
-
-}

+ 0 - 31
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/sign/AccessSign.java

@@ -1,31 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.sign;
-
-import lombok.Data;
-
-import java.time.Duration;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-
-/**
- * 鉴权Token
- *
- * @author jimmy.zhang
- * @since 1.0
- */
-@Data
-public class AccessSign {
-    /**
-     * 引用id
-     */
-    private String appId;
-
-    /**
-     * 授权码
-     */
-    private String sign;
-
-	public AccessSign(String appId, String sign) {
-		this.appId = appId;
-		this.sign = sign;
-	}
-}

+ 0 - 26
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/DingConvertUtil.java

@@ -1,26 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.utils;
-
-public class DingConvertUtil {
-
-	public String codeToMsg(String code){
-		if(null == code){
-			return "";
-		}
-		switch (code) {
-			case "1001": return "手机号不合法";
-			case "1002": return "身份证号码不合法";
-			case "1003": return "当月单人应发金额导入数据已大于100000";
-			case "1004": return "未签约";
-			case "1005": return "该身份证号码已签约,但是手机号不同";
-			case "1006": return "该身份证号码已签约,但是手机号、姓名不同";
-			case "1007": return "该手机号已签约,但是身份证号码不同";
-			case "1008": return "该手机号和身份证号已签约但姓名不同";
-			case "1009": return "最大支持2位小数";
-			case "1013": return "提交数据不全";
-			case "1014": return "个人信息和已有收款人重复";
-			case "1015": return "金额非数字类型";
-			case "1016": return "灵工认证未推送";
-			default: return "";
-		}
-	}
-}

+ 0 - 165
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/HttpClientUtils.java

@@ -1,165 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.utils;
-
-import com.qunzhixinxi.hnqz.common.ding.entity.CommonRequest;
-import com.qunzhixinxi.hnqz.common.ding.sign.AccessSign;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * http工具类
- *
- * @author zhangwt
- * @since 1.0
- */
-@Slf4j
-public class HttpClientUtils {
-    private HttpClientUtils() {
-    }
-
-    private static final int RESPONSE_OK = 200;
-    private static final String CHARSET_HTTP = "UTF-8";
-    private static final String CHARSET_STREAM = "ISO-8859-1";
-
-    /**
-     * get请求
-     *
-     * @param
-     * @return
-     * @author zhangwt
-     * @since 1.0
-     */
-    public static String doGet(String url, Map<String, String> params) {
-        CloseableHttpResponse response = null;
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        String result = null;
-        try {
-            List<NameValuePair> entity = buildParams(params);
-
-            // 创建一个get对象
-            URIBuilder builder = new URIBuilder(url);
-            builder.setParameters(entity);
-            HttpGet get = new HttpGet(builder.build());
-
-            // 执行get请求
-            response = httpClient.execute(get);
-
-            // 网关调用成功
-            if (response.getStatusLine().getStatusCode() == RESPONSE_OK) {
-                result = fromStream(response.getEntity().getContent(), CHARSET_HTTP);
-                log.info("httpClient Get请求结果:{}", result);
-            }
-        } catch (Exception e) {
-            log.error("httpClient Get请求失败", e);
-        } finally {
-            try {
-                if (null != response) {
-                    response.close();
-                }
-                if (null != httpClient) {
-                    httpClient.close();
-                }
-            } catch (IOException e) {
-                log.error("httpClient Get关闭异常", e);
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * post请求
-     *
-     * @param
-     * @return
-     * @author zhangwt
-     * @since 1.0
-     */
-    public static String doPost(CommonRequest request) {
-        CloseableHttpResponse response = null;
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        String result = null;
-        try {
-			// 创建一个post对象
-			HttpPost post = new HttpPost(request.getQueryUrl());
-
-			AccessSign sign = request.getSign();
-			// 增加header
-			post.setHeader("app-id",sign.getAppId());
-			post.setHeader("signature",sign.getSign());
-
-			// 增加body
-			StringEntity entity = new StringEntity(request.getBody(), CHARSET_HTTP);
-			entity.setContentEncoding(CHARSET_HTTP);
-			entity.setContentType("application/json");
-			post.setEntity(entity);
-
-			// 执行post请求
-			response = httpClient.execute(post);
-
-			// 网关调用成功
-			if (response.getStatusLine().getStatusCode() == RESPONSE_OK) {
-				result = fromStream(response.getEntity().getContent(), CHARSET_HTTP);
-				log.info("httpClient Post请求结果:{}", result);
-			}
-        } catch (Exception e) {
-            log.error("httpClient Post请求失败", e);
-        } finally {
-            try {
-                if (null != response) {
-                    response.close();
-                }
-                if (null != httpClient) {
-                    httpClient.close();
-                }
-            } catch (IOException e) {
-                log.error("httpClient Post关闭异常", e);
-            }
-        }
-
-        return result;
-    }
-
-    private static List<NameValuePair> buildParams(Map<String, String> params) {
-        if (params == null || params.size() == 0) {
-            return null;
-        }
-
-        List<NameValuePair> results = new ArrayList<NameValuePair>();
-        for (Map.Entry<String, String> entry : params.entrySet()) {
-            String key = entry.getKey();
-            String value = entry.getValue();
-            results.add(new BasicNameValuePair(key, value));
-        }
-
-        return results;
-    }
-
-    private static String fromStream(InputStream is, String charset) throws IOException {
-        BufferedReader in = new BufferedReader(new InputStreamReader(is, CHARSET_STREAM));
-        StringBuffer buffer = new StringBuffer();
-
-        String line = "";
-        while ((line = in.readLine()) != null) {
-            buffer.append(line);
-        }
-
-        return new String(buffer.toString().getBytes(CHARSET_STREAM), charset);
-    }
-}

+ 0 - 43
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/JsonUtils.java

@@ -1,43 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.utils;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import lombok.extern.slf4j.Slf4j;
-
-import java.io.IOException;
-
-/**
- * json工具类
- *
- * @author zhangwt
- * @since 1.0
- */
-@Slf4j
-public class JsonUtils {
-    private JsonUtils() {
-    }
-
-    public static String serializer(Object obj) {
-        try {
-            ObjectMapper mapper = new ObjectMapper();
-            return mapper.writeValueAsString(obj);
-        } catch (IOException ex) {
-            log.error("json序列化失败", ex);
-        }
-
-        return null;
-    }
-
-    public static <T> T deserializer(String json, Class<T> valueType) {
-        try {
-            ObjectMapper mapper = new ObjectMapper();
-            mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
-            T response = mapper.readValue(json, valueType);
-            return response;
-        } catch (IOException ex) {
-            log.error("json反序列化失败", ex);
-        }
-
-        return null;
-    }
-}

+ 0 - 173
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/RsaCoreUtil.java

@@ -1,173 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.codec.binary.Base64;
-
-import java.security.KeyFactory;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.interfaces.RSAPrivateKey;
-import java.security.interfaces.RSAPublicKey;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.security.spec.X509EncodedKeySpec;
-
-@Slf4j
-public enum RsaCoreUtil {
-
-	SHA1_SIGN_RSA_ENCRY("SHA1WithRSA", "RSA"),
-
-	SHA1_SIGN_RSA_PKCS1Padding_ENCRY("SHA1WithRSA", "RSA/ECB/PKCS1Padding");
-
-	RsaCoreUtil(String signAlgorithms, String algorithm){
-		this.signAlgorithms = signAlgorithms;
-		this.algorithm = algorithm;
-	}
-
-
-
-	private static final String KEY_ALGORITHM = "RSA";
-
-	private  String algorithm = "RSA";
-	private  String signAlgorithms = "SHA1WithRSA";
-
-
-	/**
-	 * 从字符串中加载公钥
-	 *
-	 * @param publicKeyStr
-	 *            公钥数据字符串
-	 * @throws Exception
-	 *             加载公钥时产生的异常
-	 */
-	private RSAPublicKey getPublicKey(String publicKeyStr) throws Exception {
-		try {
-			byte[] buffer = Base64.decodeBase64(publicKeyStr);
-			KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
-			X509EncodedKeySpec keySpec = new X509EncodedKeySpec(buffer);
-			RSAPublicKey publicKey = (RSAPublicKey) keyFactory
-					.generatePublic(keySpec);
-			return publicKey;
-		} catch (NoSuchAlgorithmException e) {
-			throw new Exception("无此算法");
-		} catch (InvalidKeySpecException e) {
-			throw new Exception("公钥非法");
-		}  catch (NullPointerException e) {
-			throw new Exception("公钥数据为空");
-		}
-	}
-
-	/**
-	 * 从字符串中加载私钥
-	 *
-	 * @param privateKeyStr
-	 *            公钥数据字符串
-	 * @throws Exception
-	 *             加载私钥时产生的异常
-	 */
-	private RSAPrivateKey getPrivateKey(String privateKeyStr) throws Exception {
-		try {
-			byte[] buffer = Base64.decodeBase64(privateKeyStr);
-			PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(buffer);
-			KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
-			RSAPrivateKey privateKey = (RSAPrivateKey) keyFactory
-					.generatePrivate(keySpec);
-			return privateKey;
-		} catch (NoSuchAlgorithmException e) {
-			throw new Exception("无此算法");
-		} catch (InvalidKeySpecException e) {
-			throw new Exception("私钥非法");
-
-		} catch (NullPointerException e) {
-			throw new Exception("私钥数据为空");
-		}
-
-	}
-
-	/**
-	 * 数据签名
-	 *
-	 *            签名内容
-	 *            私钥
-	 * @return 返回签名数据
-	 */
-	public final byte[] sign(byte[] plainBytes, String privateKeyStr) {
-		try {
-			PrivateKey priKey = getPrivateKey(privateKeyStr);
-
-			return sign(plainBytes, priKey);
-		} catch (Exception e) {
-			log.info("sign with exception, e : " + e.toString());
-			throw new RuntimeException(e);
-		}
-
-	}
-
-
-	/**
-	 * 数据签名
-	 *
-	 *            签名内容
-	 *            私钥
-	 * @return 返回签名数据
-	 */
-	public final byte[] sign(byte[] plainBytes, PrivateKey priKey) {
-		try {
-			java.security.Signature signature = java.security.Signature
-					.getInstance(signAlgorithms);
-			signature.initSign(priKey);
-			signature.update(plainBytes);
-			return signature.sign();
-		} catch (Exception e) {
-			log.info("sign with exception, e : " + e.toString(),e);
-			throw new RuntimeException(e);
-		}
-
-	}
-
-	/**
-	 * 签名验证
-	 *
-	 * @return
-	 */
-	public final boolean verify(byte[] plainBytes, byte[] signBytes,
-								String publicKeyStr) {
-
-		try {
-			PublicKey pubKey = getPublicKey(publicKeyStr);
-			return verify(plainBytes, signBytes, pubKey);
-
-		} catch (Exception e) {
-			log.info("verify with exception, e : " + e.toString());
-			throw new RuntimeException(e);
-		}
-	}
-
-
-	/**
-	 * 签名验证
-	 *
-	 * @return
-	 */
-	public final boolean verify(byte[] plainBytes, byte[] signBytes,
-								PublicKey publicKey) {
-		try {
-
-			java.security.Signature signature = java.security.Signature
-					.getInstance(signAlgorithms);
-			signature.initVerify(publicKey);
-			signature.update(plainBytes);
-			boolean bverify = signature.verify(signBytes);
-
-			log.debug("in the verify, content : " + plainBytes + ", with the singned : " + signBytes + ", result : " + bverify);
-			return bverify;
-
-		} catch (Exception e) {
-			log.info("verify with exception, e : " + e.toString());
-			throw new RuntimeException(e);
-		}
-	}
-
-
-}

+ 0 - 217
hnqz-common/hnqz-common-ding/src/main/java/com/qunzhixinxi/hnqz/common/ding/utils/SignUtils.java

@@ -1,217 +0,0 @@
-package com.qunzhixinxi.hnqz.common.ding.utils;
-
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
-import io.micrometer.core.instrument.util.StringUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.io.IOUtils;
-
-import javax.crypto.Mac;
-import javax.crypto.spec.SecretKeySpec;
-import java.io.*;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-@Slf4j
-public class SignUtils {
-
-	private static String CHAR_SET = "UTF-8";
-
-	public SignUtils() {
-	}
-
-	private static String fromStream(InputStream is, String charset) throws IOException {
-		BufferedReader in = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-		StringBuffer buffer = new StringBuffer();
-
-		String line = "";
-		while ((line = in.readLine()) != null) {
-			buffer.append(line);
-		}
-
-		return new String(buffer.toString().getBytes("UTF-8"), charset);
-	}
-
-
-	/**
-	 * 签名算法HmacSha256
-	 */
-	public static final String HMAC_SHA256 = "HmacSHA256";
-
-	/**
-	 * 编码
-	 */
-	public static final String ENCODING = "UTF-8";
-	/**
-	 * 换⾏符
-	 */
-	private static char LF = '\n';
-
-	private static final String HTTP_METHOD_POST = "post";
-	private static final String HTTP_METHOD_PUT = "put";
-
-	/**
-	 * 获取请求签名
-	 *
-	 * @param uri        原始HTTP请求PATH(例:/oapi/v1/employ/freelances/check)
-	 * @param httpMethod 原始HTTP请求方法(例:POST)
-	 * @param paramsMap  原始HTTP请求所有Query+Form参数(POST请求:Maps.newHashMap())
-	 * @param body       原始HTTP请求Body体(仅当请求为POST/PUT且非表单请求才需要设置此属性,表单形式的需要将参数放到paramsMap中)
-	 * @param appSecret      用户id
-	 * @return 签名结果
-	 * @throws Exception
-	 */
-//	public static String serviceSign(DingConfig config, String httpMethod,
-//									 Map<String, Object> paramsMap, byte[] body) throws Exception {
-//		String bodyMd5 = buildBodyMd5(httpMethod, body);
-//		String resourceToSign = buildResource(config.getQueryUrl(), paramsMap);
-//		String stringToSign = buildStringToSign(resourceToSign,
-//				httpMethod, bodyMd5);
-//		Mac hmacSha256 = Mac.getInstance(HMAC_SHA256);
-//		String appSecret = config.getAppSecret();
-//		byte[] keyBytes = appSecret.getBytes(ENCODING);
-//		hmacSha256.init(new SecretKeySpec(keyBytes, 0, keyBytes.
-//				length, HMAC_SHA256));
-//		return new String(Base64.encodeBase64(hmacSha256.doFinal
-//				(stringToSign.getBytes(ENCODING))), ENCODING);
-//	}
-
-
-	public static String serviceSign(String uri,String appSecret, String httpMethod, Map<String, Object> paramsMap, byte[] body) throws Exception {
-		String bodyMd5 = buildBodyMd5(httpMethod, body);
-		String resourceToSign = buildResource(uri, paramsMap);
-		String stringToSign = buildStringToSign(resourceToSign,
-				httpMethod, bodyMd5);
-
-		Mac hmacSha256 = Mac.getInstance(HMAC_SHA256);
-//		String appSecret = "5T8134269D467IGa0ZC7s907666r2C43";
-		byte[] keyBytes = appSecret.getBytes(ENCODING);
-		hmacSha256.init(new SecretKeySpec(keyBytes, 0, keyBytes.
-				length, HMAC_SHA256));
-		return new String(Base64.encodeBase64(hmacSha256.doFinal
-				(stringToSign.getBytes(ENCODING))), ENCODING);
-	}
-
-
-	public static String buildBodyMd5(String httpMethod, byte[] body) throws IOException {
-		if (body == null) {
-			return null;
-		}
-		if (!httpMethod.equalsIgnoreCase(HTTP_METHOD_POST) && !httpMethod.equalsIgnoreCase(HTTP_METHOD_PUT)) {
-			return null;
-		}
-		InputStream inputStream = new ByteArrayInputStream(body);
-		byte[] bodyBytes = IOUtils.toByteArray(inputStream);
-		if (bodyBytes != null && bodyBytes.length > 0) {
-			return base64AndMD5(bodyBytes).trim();
-		}
-		return null;
-	}
-
-	public static String base64AndMD5(byte[] bytes) {
-		try {
-			final MessageDigest md = MessageDigest.getInstance(
-					"MD5");
-			md.reset();
-			md.update(bytes);
-			final Base64 base64 = new Base64();
-			return new String(base64.encode(md.digest()));
-		} catch (final NoSuchAlgorithmException e) {
-			throw new IllegalArgumentException("unknown algorith m MD5");
-		}
-	}
-
-	public static String buildResource(String uri, Map<String, Object> paramsMap) {
-		StringBuilder builder = new StringBuilder();
-		builder.append(uri);
-		TreeMap<String, Object> sortMap = new TreeMap<>();
-		sortMap.putAll(paramsMap);
-		if (sortMap.size() > 0) {
-			builder.append('?');
-			builder.append(buildMapToSign(sortMap));
-		}
-		return builder.toString();
-	}
-
-	public static String buildStringToSign(String resourceToSign, String method, String bodyMd5) {
-		StringBuilder sb = new StringBuilder();
-		sb.append(method).append(LF);
-		if (StringUtils.isNotBlank(bodyMd5)) {
-			sb.append(bodyMd5);
-		}
-		sb.append(LF);
-		sb.append(resourceToSign);
-		return sb.toString();
-	}
-
-	/**
-	 * 将Map转换为用&及=拼接的字符串
-	 */
-	public static String buildMapToSign(Map<String, Object> paramMap) {
-		StringBuilder builder = new StringBuilder();
-
-		for (Map.Entry<String, Object> e : paramMap.entrySet()) {
-			if (builder.length() > 0) {
-				builder.append('&');
-			}
-			String key = e.getKey();
-			Object value = e.getValue();
-			if (value != null) {
-				if (value instanceof List) {
-					List list = (List) value;
-					if (list.size() == 0) {
-						builder.append(key);
-					} else {
-						builder.append(key).append("=").append(String.valueOf(list.get(0)));
-					}
-				} else if (value instanceof Object[]) {
-					Object[] objs = (Object[]) value;
-					if (objs.length == 0) {
-						builder.append(key);
-					} else {
-						builder.append(key).append("=").append(String.valueOf(objs[0]));
-					}
-				} else {
-					builder.append(key).append("=").append(String.valueOf(value));
-				}
-			}
-		}
-		return builder.toString();
-	}
-
-	/**
-	 * 加签(人力家方加签)
-	 * @param privateKey  人力家私钥
-	 * @param data  请求data
-	 * @return
-	 */
-	public static String sign(String privateKey, String data){
-		try {
-			byte[] result = RsaCoreUtil.SHA1_SIGN_RSA_ENCRY.sign(data.getBytes(CHAR_SET), privateKey);
-			return Base64.encodeBase64String(result);
-		} catch (UnsupportedEncodingException e) {
-			log.info("sign with exception, e : " + e);
-			throw new RuntimeException(e);
-		}
-	}
-	/**
-	 * 验签
-	 * @param rsaPublicKey 人力家公钥(人力家提供)
-	 * @param refData 请求data
-	 * @param sign 请求sign
-	 * @return
-	 */
-	public static boolean verify(String rsaPublicKey, String refData, String sign) {
-		try {
-			return RsaCoreUtil.SHA1_SIGN_RSA_ENCRY.verify(refData.getBytes("UTF-8"),
-					Base64.decodeBase64(sign), rsaPublicKey);
-		} catch (UnsupportedEncodingException e) {
-			log.info("verify with exception, e : ", e);
-			throw new RuntimeException("verify exception");
-		}
-	}
-
-}

+ 0 - 2
hnqz-common/hnqz-common-ding/src/main/resources/META-INF/spring.factories

@@ -1,2 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  com.qunzhixinxi.hnqz.common.ding.DingAutoConfiguration

+ 0 - 46
hnqz-common/hnqz-common-qcc/pom.xml

@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<parent>
-		<artifactId>hnqz-common</artifactId>
-		<groupId>com.qunzhixinxi</groupId>
-		<version>3.9.0</version>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
-
-	<artifactId>hnqz-common-qcc</artifactId>
-
-	<properties>
-		<fastjson.version>1.2.69</fastjson.version>
-	</properties>
-
-	<dependencies>
-		<!--hutool-->
-		<dependency>
-			<groupId>com.qunzhixinxi</groupId>
-			<artifactId>hnqz-common-core</artifactId>
-		</dependency>
-
-		<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
-		<dependency>
-			<groupId>commons-io</groupId>
-			<artifactId>commons-io</artifactId>
-			<version>2.8.0</version>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.httpcomponents</groupId>
-			<artifactId>httpclient</artifactId>
-			<version>4.5.3</version>
-		</dependency>
-
-		<dependency>
-			<groupId>com.alibaba</groupId>
-			<artifactId>fastjson</artifactId>
-			<version>${fastjson.version}</version>
-		</dependency>
-
-	</dependencies>
-
-</project>

+ 0 - 31
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/QccAutoConfiguration.java

@@ -1,31 +0,0 @@
-
-package com.qunzhixinxi.hnqz.common.qcc;
-
-import com.qunzhixinxi.hnqz.common.qcc.config.QccConfig;
-import com.qunzhixinxi.hnqz.common.qcc.service.QccService;
-import lombok.AllArgsConstructor;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-
-/**
- * @Modify: start
- * @Version: v2021.4.16
- * @Author: ryz
- * @Date: 2021/5/6
-*/
-@AllArgsConstructor
-@EnableConfigurationProperties({ QccConfig.class })
-public class QccAutoConfiguration {
-
-//	private final QccConfig config;
-
-	@Bean
-	@ConditionalOnMissingBean(QccService.class)
-//	@ConditionalOnProperty(name = "qcc.enable", havingValue = "true", matchIfMissing = true)
-	public QccService qccService() {
-		return new QccService();
-	}
-
-
-}

+ 0 - 14
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/config/QccConfig.java

@@ -1,14 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.config;
-
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-@Data
-@ConfigurationProperties( prefix = "qcc.master")
-public class QccConfig {
-
-	private String AppKey = "da79e5335f9a452a8dc095c9773bd8d6";
-
-	private String SecretKey = "38202FB1F88158222585263F19616B7F";
-}

+ 0 - 49
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/CommonRequest.java

@@ -1,49 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.entity;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import lombok.Getter;
-
-import java.util.Map;
-
-/**
- * 公共请求参数
- *
- * @author zhangwt
- * @since 1.0
- */
-public abstract class CommonRequest {
-
-	/**
-	 * token数据
-	 */
-	@Getter
-	@JsonIgnore
-	protected String token;
-
-	/**
-	 * 查询地址
-	 */
-	@Getter
-	@JsonIgnore
-	protected String queryUrl;
-
-	/**
-	 * 查询地址
-	 */
-	@Getter
-	@JsonIgnore
-	protected String timestamp;
-
-
-	/**
-	 * 查询地址
-	 */
-	@Getter
-	@JsonIgnore
-	protected Map<String,String> params;
-
-
-
-
-
-}

+ 0 - 35
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/CommonResponse.java

@@ -1,35 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.entity;
-
-import lombok.Data;
-
-/**
- * 公共请求参数
- *
- * @author xyz
- * @since 1.0
- */
-@Data
-public abstract class CommonResponse {
-	/**
-	 * 业务码
-	 */
-	private String Status;
-
-	/**
-	 * 信息
-	 */
-	private String Message;
-
-
-	/**
-	 * 是否成功
-	 *
-	 * @param
-	 * @return
-	 * @author xyz
-	 * @since 1.0
-	 */
-	public boolean isSuccess() {
-		return "200".equals(this.Status);
-	}
-}

+ 0 - 11
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/EmployeeGetListDataItem.java

@@ -1,11 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.entity;
-
-import lombok.Data;
-
-@Data
-public class EmployeeGetListDataItem {
-
-	private String KeyNo;
-	private String Name;
-	private String Job;
-}

+ 0 - 26
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/EmployeeGetListRequest.java

@@ -1,26 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.entity;
-
-
-import com.qunzhixinxi.hnqz.common.qcc.config.QccConfig;
-import lombok.Data;
-import org.apache.commons.codec.digest.DigestUtils;
-
-import java.util.Map;
-
-@Data
-public class EmployeeGetListRequest extends CommonRequest {
-
-	private static final String PATH = "http://api.qichacha.com/ECIEmployee/GetList";
-
-
-	public static EmployeeGetListRequest from(Map<String, String> params, QccConfig config) {
-		EmployeeGetListRequest request = new EmployeeGetListRequest();
-		params.put("key", config.getAppKey());
-		String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
-		request.timestamp = timestamp;
-		request.token = DigestUtils.md5Hex(config.getAppKey().concat(timestamp).concat(config.getSecretKey())).toUpperCase();
-		request.queryUrl = PATH;
-		request.params = params;
-		return request;
-	}
-}

+ 0 - 15
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/EmployeeGetListResponse.java

@@ -1,15 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.entity;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class EmployeeGetListResponse extends CommonResponse{
-
-	private String OrderNumber;
-
-	private List<EmployeeGetListDataItem> Result;
-
-	private PageInfo Paging;
-}

+ 0 - 11
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/entity/PageInfo.java

@@ -1,11 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.entity;
-
-import lombok.Data;
-
-@Data
-public class PageInfo {
-
-	private Integer PageSize;
-	private Integer PageIndex;
-	private Integer TotalRecords;
-}

+ 0 - 67
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/service/QccService.java

@@ -1,67 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.service;
-
-
-import com.qunzhixinxi.hnqz.common.qcc.config.QccConfig;
-import com.qunzhixinxi.hnqz.common.qcc.entity.EmployeeGetListRequest;
-import com.qunzhixinxi.hnqz.common.qcc.entity.EmployeeGetListResponse;
-import com.qunzhixinxi.hnqz.common.qcc.utils.HttpClientUtils;
-import com.qunzhixinxi.hnqz.common.qcc.utils.JsonUtils;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@Slf4j
-public class QccService {
-
-	@Autowired
-	private QccConfig config;
-
-
-	/**
-	 * 查询企业重要人员
-	 * @author xyz
-	 * @since 1.0
-	 * params 示例:
-	 * {
-	 * "searchKey": "北京朔源科技有限公司",  必输
-	 * "pageIndex": "1",    非必输
-	 * "pageSize": "10"     非必输  最大支持20
-	 * }
-	 */
-	public EmployeeGetListResponse getList(Map<String, String> params) {
-
-		log.info("******************开启调用企查查接口*******************");
-		log.info("**********************getList************************");
-
-		EmployeeGetListRequest request = EmployeeGetListRequest.from(params, config);
-
-		String json = HttpClientUtils.doGet(request);
-		log.info("企查查接口getList返回数据: {}", json);
-		EmployeeGetListResponse response = JsonUtils.deserializer(json, EmployeeGetListResponse.class);
-		if (!response.isSuccess()) {
-			log.error("企查查接口, Status: {}, Message: {}", response.getStatus(), response.getMessage());
-		}
-		return response;
-	}
-
-//	public static void main(String[] args) {
-//
-//		QccConfig config = new QccConfig();
-//
-//		Map<String, String> params = new HashMap<>();
-//		params.put("key", config.getAppKey());
-//		params.put("searchKey", "大象慧云信息技术有限公司");
-//		params.put("pageIndex", "1");
-//		params.put("pageSize", "10");
-//
-//		EmployeeGetListRequest request = EmployeeGetListRequest.from(params, config);
-//		String json = HttpClientUtils.doGet(request);
-//
-//		System.err.println(json);
-//	}
-
-
-}

+ 0 - 113
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/utils/HttpClientUtils.java

@@ -1,113 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.utils;
-
-import com.qunzhixinxi.hnqz.common.qcc.entity.EmployeeGetListRequest;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * http工具类
- *
- * @author zhangwt
- * @since 1.0
- */
-@Slf4j
-public class HttpClientUtils {
-    private HttpClientUtils() {
-    }
-
-    private static final int RESPONSE_OK = 200;
-    private static final String CHARSET_HTTP = "UTF-8";
-    private static final String CHARSET_STREAM = "ISO-8859-1";
-
-    /**
-     * get请求
-     *
-     * @param
-     * @return
-     * @author zhangwt
-     * @since 1.0
-     */
-    public static String doGet(EmployeeGetListRequest request) {
-        CloseableHttpResponse response = null;
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        String result = null;
-        try {
-            List<NameValuePair> entity = buildParams(request.getParams());
-
-            // 创建一个get对象
-            URIBuilder builder = new URIBuilder(request.getQueryUrl());
-            builder.setParameters(entity);
-            HttpGet get = new HttpGet(builder.build());
-			get.setHeader("Token", request.getToken());
-			get.setHeader("Timespan", request.getTimestamp());
-
-
-            // 执行get请求
-            response = httpClient.execute(get);
-
-            // 网关调用成功
-            if (response.getStatusLine().getStatusCode() == RESPONSE_OK) {
-                result = fromStream(response.getEntity().getContent(), CHARSET_HTTP);
-                log.info("httpClient Get请求结果:{}", result);
-            }
-        } catch (Exception e) {
-            log.error("httpClient Get请求失败", e);
-        } finally {
-            try {
-                if (null != response) {
-                    response.close();
-                }
-                if (null != httpClient) {
-                    httpClient.close();
-                }
-            } catch (IOException e) {
-                log.error("httpClient Get关闭异常", e);
-            }
-        }
-
-        return result;
-    }
-
-
-
-    private static List<NameValuePair> buildParams(Map<String, String> params) {
-        if (params == null || params.size() == 0) {
-            return null;
-        }
-
-        List<NameValuePair> results = new ArrayList<NameValuePair>();
-        for (Map.Entry<String, String> entry : params.entrySet()) {
-            String key = entry.getKey();
-            String value = entry.getValue();
-            results.add(new BasicNameValuePair(key, value));
-        }
-
-        return results;
-    }
-
-    private static String fromStream(InputStream is, String charset) throws IOException {
-        BufferedReader in = new BufferedReader(new InputStreamReader(is, CHARSET_STREAM));
-        StringBuffer buffer = new StringBuffer();
-
-        String line = "";
-        while ((line = in.readLine()) != null) {
-            buffer.append(line);
-        }
-
-        return new String(buffer.toString().getBytes(CHARSET_STREAM), charset);
-    }
-}

+ 0 - 46
hnqz-common/hnqz-common-qcc/src/main/java/com/qunzhixinxi/hnqz/common/qcc/utils/JsonUtils.java

@@ -1,46 +0,0 @@
-package com.qunzhixinxi.hnqz.common.qcc.utils;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.MapperFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import lombok.extern.slf4j.Slf4j;
-
-import java.io.IOException;
-
-/**
- * json工具类
- *
- * @author zhangwt
- * @since 1.0
- */
-@Slf4j
-public class JsonUtils {
-    private JsonUtils() {
-    }
-
-    public static String serializer(Object obj) {
-        try {
-            ObjectMapper mapper = new ObjectMapper();
-            return mapper.writeValueAsString(obj);
-        } catch (IOException ex) {
-            log.error("json序列化失败", ex);
-        }
-
-        return null;
-    }
-
-    public static <T> T deserializer(String json, Class<T> valueType) {
-        try {
-            ObjectMapper mapper = new ObjectMapper();
-            mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
-			// 忽略字段大小写
-			mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
-            T response = mapper.readValue(json, valueType);
-            return response;
-        } catch (IOException ex) {
-            log.error("json反序列化失败", ex);
-        }
-
-        return null;
-    }
-}

+ 0 - 2
hnqz-common/hnqz-common-qcc/src/main/resources/META-INF/spring.factories

@@ -1,2 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  com.qunzhixinxi.hnqz.common.qcc.QccAutoConfiguration

+ 0 - 50
hnqz-common/hnqz-common-swagger/pom.xml

@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~
-  ~      Copyright (c) 2018-2025, hnqz All rights reserved.
-  ~
-  ~  Redistribution and use in source and binary forms, with or without
-  ~  modification, are permitted provided that the following conditions are met:
-  ~
-  ~ Redistributions of source code must retain the above copyright notice,
-  ~  this list of conditions and the following disclaimer.
-  ~  Redistributions in binary form must reproduce the above copyright
-  ~  notice, this list of conditions and the following disclaimer in the
-  ~  documentation and/or other materials provided with the distribution.
-  ~  Neither the name of the pig4cloud.com developer nor the names of its
-  ~  contributors may be used to endorse or promote products derived from
-  ~  this software without specific prior written permission.
-  ~  Author: hnqz
-  ~
-  -->
-
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>com.qunzhixinxi</groupId>
-		<artifactId>hnqz-common</artifactId>
-		<version>3.9.0</version>
-	</parent>
-
-	<artifactId>hnqz-common-swagger</artifactId>
-	<packaging>jar</packaging>
-
-	<description>hnqz 接口文档</description>
-
-
-	<dependencies>
-		<!--swagger 依赖-->
-		<dependency>
-			<groupId>io.springfox</groupId>
-			<artifactId>springfox-swagger2</artifactId>
-			<version>${swagger.fox.version}</version>
-		</dependency>
-		<!--knife4j是为Java MVC框架集成Swagger生成Api文档的增强-->
-		<dependency>
-			<groupId>com.github.xiaoymin</groupId>
-			<artifactId>knife4j-micro-spring-boot-starter</artifactId>
-			<version>${knife4j.version}</version>
-		</dependency>
-	</dependencies>
-</project>

+ 0 - 36
hnqz-common/hnqz-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/annotation/EnableHnqzSwagger2.java

@@ -1,36 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: hnqz
- */
-
-package com.qunzhixinxi.hnqz.common.swagger.annotation;
-
-import com.qunzhixinxi.hnqz.common.swagger.config.SwaggerAutoConfiguration;
-import org.springframework.context.annotation.Import;
-
-import java.lang.annotation.*;
-
-/**
- * @author hnqz
- * @date 2018/7/21 开启hnqz swagger
- */
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Inherited
-@Import({ SwaggerAutoConfiguration.class })
-public @interface EnableHnqzSwagger2 {
-
-}

+ 0 - 143
hnqz-common/hnqz-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/config/SwaggerAutoConfiguration.java

@@ -1,143 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: hnqz
- */
-package com.qunzhixinxi.hnqz.common.swagger.config;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.ParameterBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.schema.ModelRef;
-import springfox.documentation.service.*;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spi.service.contexts.SecurityContext;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author hnqz swagger配置 禁用方法1:使用注解@Profile({"dev","test"})
- * 表示在开发或测试环境开启,而在生产关闭。(推荐使用) 禁用方法2:使用注解@ConditionalOnProperty(name = "swagger.enable",
- * havingValue = "true") 然后在测试配置或者开发配置中添加swagger.enable=true即可开启,生产环境不填则默认关闭Swagger.
- */
-@Configuration
-@EnableSwagger2
-@EnableAutoConfiguration
-@ConditionalOnProperty(name = "swagger.enabled", matchIfMissing = true)
-public class SwaggerAutoConfiguration {
-
-	/**
-	 * 默认的排除路径,排除Spring Boot默认的错误处理路径和端点
-	 */
-	private static final List<String> DEFAULT_EXCLUDE_PATH = Arrays.asList("/error", "/actuator/**");
-
-	private static final String BASE_PATH = "/**";
-
-	@Bean
-	@ConditionalOnMissingBean
-	public SwaggerProperties swaggerProperties() {
-		return new SwaggerProperties();
-	}
-
-	@Bean
-	public Docket api(SwaggerProperties swaggerProperties) {
-		// base-path处理
-		if (swaggerProperties.getBasePath().isEmpty()) {
-			swaggerProperties.getBasePath().add(BASE_PATH);
-		}
-		// noinspection unchecked
-		List<Predicate<String>> basePath = new ArrayList();
-		swaggerProperties.getBasePath().forEach(path -> basePath.add(PathSelectors.ant(path)));
-
-		// exclude-path处理
-		if (swaggerProperties.getExcludePath().isEmpty()) {
-			swaggerProperties.getExcludePath().addAll(DEFAULT_EXCLUDE_PATH);
-		}
-		List<Predicate<String>> excludePath = new ArrayList<>();
-		swaggerProperties.getExcludePath().forEach(path -> excludePath.add(PathSelectors.ant(path)));
-
-		// 版本请求头处理
-		ParameterBuilder versionPar = new ParameterBuilder();
-		List<Parameter> pars = new ArrayList<>();
-		versionPar.name("VERSION").description("灰度路由版本信息").modelRef(new ModelRef("string")).parameterType("header")
-				.required(false).build();
-		pars.add(versionPar.build());
-
-		// noinspection Guava
-		return new Docket(DocumentationType.SWAGGER_2).host(swaggerProperties.getHost())
-				.apiInfo(apiInfo(swaggerProperties)).globalOperationParameters(pars).select()
-				.apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage()))
-				.paths(Predicates.and(Predicates.not(Predicates.or(excludePath)), Predicates.or(basePath))).build()
-				.securitySchemes(Collections.singletonList(securitySchema()))
-				.securityContexts(Collections.singletonList(securityContext())).pathMapping("/");
-	}
-
-	/**
-	 * 配置默认的全局鉴权策略的开关,通过正则表达式进行匹配;默认匹配所有URL
-	 * @return
-	 */
-	private SecurityContext securityContext() {
-		return SecurityContext.builder().securityReferences(defaultAuth())
-				.forPaths(PathSelectors.regex(swaggerProperties().getAuthorization().getAuthRegex())).build();
-	}
-
-	/**
-	 * 默认的全局鉴权策略
-	 * @return
-	 */
-	private List<SecurityReference> defaultAuth() {
-		ArrayList<AuthorizationScope> authorizationScopeList = new ArrayList<>();
-		swaggerProperties().getAuthorization().getAuthorizationScopeList()
-				.forEach(authorizationScope -> authorizationScopeList.add(
-						new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription())));
-		AuthorizationScope[] authorizationScopes = new AuthorizationScope[authorizationScopeList.size()];
-		return Collections
-				.singletonList(SecurityReference.builder().reference(swaggerProperties().getAuthorization().getName())
-						.scopes(authorizationScopeList.toArray(authorizationScopes)).build());
-	}
-
-	private OAuth securitySchema() {
-		ArrayList<AuthorizationScope> authorizationScopeList = new ArrayList<>();
-		swaggerProperties().getAuthorization().getAuthorizationScopeList()
-				.forEach(authorizationScope -> authorizationScopeList.add(
-						new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription())));
-		ArrayList<GrantType> grantTypes = new ArrayList<>();
-		swaggerProperties().getAuthorization().getTokenUrlList()
-				.forEach(tokenUrl -> grantTypes.add(new ResourceOwnerPasswordCredentialsGrant(tokenUrl)));
-		return new OAuth(swaggerProperties().getAuthorization().getName(), authorizationScopeList, grantTypes);
-	}
-
-	private ApiInfo apiInfo(SwaggerProperties swaggerProperties) {
-		return new ApiInfoBuilder().title(swaggerProperties.getTitle()).description(swaggerProperties.getDescription())
-				.license(swaggerProperties.getLicense()).licenseUrl(swaggerProperties.getLicenseUrl())
-				.termsOfServiceUrl(swaggerProperties.getTermsOfServiceUrl())
-				.contact(new Contact(swaggerProperties.getContact().getName(), swaggerProperties.getContact().getUrl(),
-						swaggerProperties.getContact().getEmail()))
-				.version(swaggerProperties.getVersion()).build();
-	}
-
-}

+ 0 - 161
hnqz-common/hnqz-common-swagger/src/main/java/com/qunzhixinxi/hnqz/common/swagger/config/SwaggerProperties.java

@@ -1,161 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, hnqz All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: hnqz
- */
-package com.qunzhixinxi.hnqz.common.swagger.config;
-
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * SwaggerProperties
- *
- * @author: hnqz
- * @date: 2018/7/25 14:00
- */
-@Data
-@ConfigurationProperties("swagger")
-public class SwaggerProperties {
-
-	/**
-	 * 是否开启swagger
-	 */
-	private Boolean enabled;
-
-	/**
-	 * swagger会解析的包路径
-	 **/
-	private String basePackage = "";
-
-	/**
-	 * swagger会解析的url规则
-	 **/
-	private List<String> basePath = new ArrayList<>();
-
-	/**
-	 * 在basePath基础上需要排除的url规则
-	 **/
-	private List<String> excludePath = new ArrayList<>();
-
-	/**
-	 * 标题
-	 **/
-	private String title = "";
-
-	/**
-	 * 描述
-	 **/
-	private String description = "";
-
-	/**
-	 * 版本
-	 **/
-	private String version = "";
-
-	/**
-	 * 许可证
-	 **/
-	private String license = "";
-
-	/**
-	 * 许可证URL
-	 **/
-	private String licenseUrl = "";
-
-	/**
-	 * 服务条款URL
-	 **/
-	private String termsOfServiceUrl = "";
-
-	/**
-	 * host信息
-	 **/
-	private String host = "";
-
-	/**
-	 * 联系人信息
-	 */
-	private Contact contact = new Contact();
-
-	/**
-	 * 全局统一鉴权配置
-	 **/
-	private Authorization authorization = new Authorization();
-
-	@Data
-	@NoArgsConstructor
-	public static class Contact {
-
-		/**
-		 * 联系人
-		 **/
-		private String name = "";
-
-		/**
-		 * 联系人url
-		 **/
-		private String url = "";
-
-		/**
-		 * 联系人email
-		 **/
-		private String email = "";
-
-	}
-
-	@Data
-	@NoArgsConstructor
-	public static class Authorization {
-
-		/**
-		 * 鉴权策略ID,需要和SecurityReferences ID保持一致
-		 */
-		private String name = "";
-
-		/**
-		 * 需要开启鉴权URL的正则
-		 */
-		private String authRegex = "^.*$";
-
-		/**
-		 * 鉴权作用域列表
-		 */
-		private List<AuthorizationScope> authorizationScopeList = new ArrayList<>();
-
-		private List<String> tokenUrlList = new ArrayList<>();
-
-	}
-
-	@Data
-	@NoArgsConstructor
-	public static class AuthorizationScope {
-
-		/**
-		 * 作用域名称
-		 */
-		private String scope = "";
-
-		/**
-		 * 作用域描述
-		 */
-		private String description = "";
-
-	}
-
-}

+ 0 - 73
hnqz-common/hnqz-common-taxhelper/pom.xml

@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<parent>
-		<artifactId>hnqz-common</artifactId>
-		<groupId>com.qunzhixinxi</groupId>
-		<version>3.9.0</version>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
-
-	<artifactId>hnqz-common-taxhelper</artifactId>
-	<packaging>jar</packaging>
-	<description>税邦云模块</description>
-	<properties>
-		<common-io.version>2.8.0</common-io.version>
-		<fastjson.version>1.2.69</fastjson.version>
-		<httpclient.version>4.5.3</httpclient.version>
-	</properties>
-
-
-	<dependencies>
-		<!--hutool-->
-		<dependency>
-			<groupId>com.qunzhixinxi</groupId>
-			<artifactId>hnqz-common-core</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>commons-io</groupId>
-			<artifactId>commons-io</artifactId>
-			<version>${common-io.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-lang3</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.httpcomponents</groupId>
-			<artifactId>httpclient</artifactId>
-			<version>${httpclient.version}</version>
-		</dependency>
-
-		<dependency>
-			<groupId>com.alibaba</groupId>
-			<artifactId>fastjson</artifactId>
-			<version>${fastjson.version}</version>
-		</dependency>
-
-		<!-- 配置国密加密sm的jar包 -->
-<!--		<dependency>-->
-<!--			<groupId>org.bouncycastle</groupId>-->
-<!--			<artifactId>bcprov-jdk15on</artifactId>-->
-<!--			<version>1.60</version>-->
-<!--			<scope>system</scope>-->
-<!--			<systemPath>${pom.basedir}/src/main/resources/lib/bcprov-jdk15on-1.60.jar</systemPath>-->
-<!--		</dependency>-->
-
-		<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
-		<dependency>
-			<groupId>org.bouncycastle</groupId>
-			<artifactId>bcprov-jdk15on</artifactId>
-			<version>1.60</version>
-		</dependency>
-
-
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-aop</artifactId>
-		</dependency>
-	</dependencies>
-</project>

+ 0 - 204
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/Common.java

@@ -1,204 +0,0 @@
-package com.logosdata.security;
-
-public class Common {
-	public static int SGD_SM1_ECB = 0X00000101;
-	public static int SGD_SM1_CBC = 0X00000102;
-	public static int SGD_SM1_CFB = 0X00000104;
-	public static int SGD_SM1_OFB = 0X00000108;
-	public static int SGD_SM1_MAC = 0X00000110;
-	
-	public static int SGD_SSF33_ECB = 0X00000201;
-	public static int SGD_SSF33_CBC = 0X00000202;
-	public static int SGD_SSF33_CFB = 0X00000204;
-	public static int SGD_SSF33_OFB = 0X00000208;
-	public static int SGD_SSF33_MAC = 0X00000210;
-	
-	public static int SGD_SM4_ECB = 0X00000401;
-	public static int SGD_SM4_CBC = 0X00000402;
-	public static int SGD_SM4_CFB = 0X00000404;
-	public static int SGD_SM4_OFB = 0X00000408;
-	public static int SGD_SM4_MAC = 0X00000410;
-	
-	public static int SGD_ZUC_EEA3 = 0X00000801;
-	public static int SGD_ZUC_EIA3 = 0X00000802;
-	
-	
-	public static int SGD_RSA = 0X00010000;
-	public static int SGD_SM2 = 0X00020100;
-	public static int SGD_SM2_1 = 0X00020200;
-	public static int SGD_SM2_2 = 0X00020400;
-	public static int SGD_SM2_3 = 0X00020800;
-
-	public static int SGD_SM9 = 0X00040100;
-	public static int SGD_SM9_1 = 0X00040200;
-	public static int SGD_SM9_2 = 0X00040400;
-	public static int SGD_SM9_3 = 0X00040800;
-	
-	public static int SGD_SM3 = 0X00000001;
-	public static int SGD_SHA1 = 0X00000002;
-	public static int SGD_SHA256 = 0X00000004;
-	
-	public static int SGD_SM3_RSA = 0X00010001;
-	public static int SGD_SHA1_RSA = 0X00010002;
-	public static int SGD_SHA256_SHA = 0X00010004;
-
-	public static int SGD_SM3_SM2 = 0X00020201;
-	public static int SGD_SM3_SM9 = 0X00040201;
-	
-	public static int SGD_KEY_INDEX = 0X00000101;
-	public static int SGD_SECRET_KEY = 0X00000102;
-	public static int SGD_PUBLIC_KEY_SIGN = 0X00000103;
-	public static int SGD_PUBLIC_KEY_ENCRYPT = 0X00000104;
-	public static int SGD_PRIVATE_KEY_SIGN = 0X00000105;
-	public static int SGD_PRIVATE_KEY_ENCRYPT = 0X00000106;
-	public static int SGD_KEY_COMPONENT = 0X00000107;
-	public static int SGD_PASSWORD = 0X00000108;
-	public static int SGD_PUBLIC_KEY_CERT = 0X00000109;
-	public static int SGD_ATTRIBUTE_CERT = 0X0000010A;
-	public static int SGD_SIGNATURE_DATA = 0X00000111;
-	public static int SGD_ENVELOPE_DATA = 0X00000112;
-	public static int SGD_RANDOM_DATA = 0X00000113;
-	public static int SGD_PLAIN_DATA = 0X00000114;
-	public static int SGD_CIPHER_DATA = 0X00000115;
-	public static int SGD_DIGEST_DATA = 0X00000116;
-	public static int SGD_USER_DATA = 0X00000117;
-	
-	public static int SGD_CERT_VERSION = 0X00000001;
-	public static int SGD_CERT_SERIAL = 0X00000002;
-	public static int SGD_CERT_ISSUER = 0X00000005;
-	public static int SGD_CERT_VALID_TIME = 0X00000006;
-	public static int SGD_CERT_SUBJECT = 0X00000007;
-	public static int SGD_CERT_DER_PUBLIC_KEY = 0X00000008;
-	public static int SGD_CERT_DER_PUBLIC_EXTENSIONS = 0X00000009;
-	public static int SGD_EXT_AUTHORITYKEYIDENTIFIER_INFO = 0X00000011;
-	public static int SGD_EXT_SUBJECTKEYIDENTIFIER_INFO = 0X00000012;
-	public static int SGD_EXT_KEYUSAGE_INFO = 0X00000013;
-	public static int SGD_EXT_PRIVATEKEYUSAGEPERIOD_INFO = 0X00000014;
-	public static int SGD_EXT_CERTIFICATEPOLICIES_INFO = 0X00000015;
-	public static int SGD_EXT_POLICYMAPPING_INFO = 0X00000016;
-	public static int SGD_EXT_BASICCONSTRAINTS_INFO = 0X00000017;
-	public static int SGD_EXT_POLICYCONSTRAINTS_INFO = 0X00000018;
-	public static int SGD_EXT_EXTKEYUSAGE_INFO = 0X00000019;
-	public static int SGD_EXT_CRLDISTRIBUTIONPOINTS_INFO = 0X0000001A;
-	public static int SGD_EXT_NESCAPE_INFO = 0X0000001B;
-	public static int SGD_EXT_SELFDEFINED_EXTENSION_INFO = 0X0000001C;
-	public static int SGD_CERT_ISSUER_CN = 0X00000021;
-	public static int SGD_CERT_ISSUER_O = 0X00000022;
-	public static int SGD_CERT_ISSUER_OU = 0X00000023;
-	public static int SGD_CERT_SUBJECT_CN = 0X00000031;
-	public static int SGD_CERT_SUBJECT_O = 0X00000032;
-	public static int SGD_CERT_SUBJECT_OU = 0X00000033;
-	public static int SGD_CERT_SUBJECT_EMAIL = 0X00000034;
-	public static int SGD_CERT_NOTBEFORE_TIME = 0X00000035;
-	public static int SGD_CERT_NOTAFTER_TIME = 0X00000036;
-	
-	public static int SGD_TIME_OF_STAMP = 0X00000201;
-	public static int SGD_CN_OD_TSSIGNER = 0X00000202;
-	public static int SGD_ORINGICAL_DATA = 0X00000203;
-	public static int SGD_CERT_OF_TSSERVER = 0X00000204;
-	public static int SGD_CENTCHAIN_OF_TSSERVER = 0X00000205;
-	public static int SGD_SOURCE_OF_TIME = 0X00000206;
-	public static int SGD_TIME_PRECISION = 0X00000207;
-	public static int SGD_RESPONSE_TYPE = 0X00000208;
-	public static int SGD_SUBJECT_COUNTRY_OF_TSSIGNER = 0X00000209;
-	public static int SGD_SUBJECT_ORGNIZATION_OF_TSSIGNER = 0X0000020A;
-	public static int SGD_SUBJECT_CITY_OF_TSSIGNER = 0X0000020B;
-	public static int SGD_SUBJECT_EMAIL_OF_TSSIGNER = 0X0000020C;
-	
-	public static int SGD_SP_ID = 0X00000001;
-	public static int SGD_SP_USER_ID = 0X00000002;
-	public static int SGD_IDP_ID = 0X00000003;
-	public static int SGD_IDP_USER_ID = 0X00000004;
-	
-	public static int SGD_ENCODING_RAW = 0X00000000;
-	public static int SGD_ENCODING_DER = 0X01000000;
-	public static int SGD_ENCODING_BASE64 = 0X02000000;
-	public static int SGD_ENCODING_PEM = 0X03000000;
-	public static int SGD_ENCODING_TXT = 0X04000000;
-	
-	public static int SGD_PROTOCOL_CSP = 1;
-	public static int SGD_PROTOCOL_PKCS11 = 2;
-	public static int SGD_PROTOCOL_SDS = 3;
-	public static int SGD_PROTOCOL_UKEY = 4;
-	public static int SGD_PROTOCOL_CNG = 5;
-	public static int SGD_PROTOCOL_GCS = 6;
-	
-	public static int SGD_CRL_VERIFY = 1;
-	public static int SGD_OSXP_VERIFY = 2;
-	
-	public static int SGD_ROLE_SUPER_MANAGER = 0X00000001;
-	public static int SGD_ROLE_MANAGER = 0X00000002;
-	public static int SGD_ROLE_AUDIT_MANAGER = 0X00000003;
-	public static int SGD_ROLE_AUDITOR = 0X00000004;
-	public static int SGD_ROLE_OPERATOR = 0X00000005;
-	public static int SGD_ROLE_USER = 0X00000006;
-	
-	public static int SGD_OPERATION_SIGNIN = 0X00000001;
-	public static int SGD_OPERATION_SIGNOUT = 0X00000002;
-	public static int SGD_OPERATION_CREATE = 0X00000003;
-	public static int SGD_OPERATION_DELETE = 0X00000004;
-	public static int SGD_OPERATION_MODIFY = 0X00000005;
-	public static int SGD_OPERATION_CHG_PWD = 0X00000006;
-	public static int SGD_OPERATION_AUTHORIZATION = 0X00000007;
-
-	public static int SGD_OPERATION_SUCCESS = 0X00000000;
-
-	public static int SGD_MAIN_KEY = 0X00000101;
-	public static int SGD_DEVICE_KEYS = 0X00000102;
-	public static int SGD_USER_KEYS = 0X00000103;
-	public static int SGD_KEK = 0X00000104;
-	public static int SGD_SESSION_KEY = 0X00000105;
-	public static int SGD_PRIKEY_PASSWORD = 0X00000106;
-	public static int SGD_COMPARTITION_KEY = 0X00000107;
-	
-	public static int SGD_KEK_GENERATION = 0X00000101;
-	public static int SGD_KEK_DISPENSE = 0X00000102;
-	public static int SGD_KEK_IMPORT = 0X00000103;
-	public static int SGD_KEK_EXPORT = 0X00000104;
-	public static int SGD_KEK_DIVISION = 0X00000105;
-	public static int SGD_KEK_COMPOSE = 0X00000106;
-	public static int SGD_KEK_RENEWAL = 0X00000107;
-	public static int SGD_KEK_BACKUP = 0X00000108;
-	public static int SGD_KEK_RESTORE = 0X00000109;
-	public static int SGD_KEK_DESTROY = 0X0000010A;
-	
-	public static int SGD_SYSTEM_INIT = 0X00000201;
-	public static int SGD_SYSTEM_START = 0X00000202;
-	public static int SGD_SYSTEM_SHUT = 0X00000203;
-	public static int SGD_SYSTEM_RESTART = 0X00000204;
-	public static int SGD_SYSTEM_QUERY = 0X00000205;
-	public static int SGD_SYSTEM_BACKUP = 0X00000206;
-	public static int SGD_SYSTEM_RESTORE = 0X00000207;
-
-	public static int SGD_DEVICE_SORT = 0X00000201;
-	public static int SGD_DEVICE_TYPE = 0X00000202;
-	public static int SGD_DEVICE_NAME = 0X00000203;
-	public static int SGD_DEVICE_MANUFACTURER = 0X00000204;
-	public static int SGD_DEVICE_HARDWARE_VERSION = 0X00000205;
-	public static int SGD_DEVICE_SOFTWARE_VERSION = 0X00000206;
-	public static int SGD_DEVICE_STANDARD_VERSION = 0X00000207;
-	public static int SGD_DEVICE_SEIAL_NUMBER = 0X00000208;
-	public static int SGD_DEVICE_SUPPORT_ASYM_ALG = 0X00000209;
-	public static int SGD_DEVICE_SUPPORT_SYMM_ALG = 0X0000020A;
-	public static int SGD_DEVICE_SUPPORT_HASH_ALG = 0X0000020B;
-	public static int SGD_DEVICE_SUPPORT_STORAGE_SPACE = 0X0000020C;
-	public static int SGD_DEVICE_SUPPORT_FREE_SPACE = 0X0000020D;
-	public static int SGD_DEVICE_RUNTIME = 0X0000020E;
-	public static int SGD_DEVICE_USED_TIMES = 0X0000020F;
-	public static int SGD_DEVICE_LOCATION = 0X00000210;
-	public static int SGD_DEVICE_DESCRIPTION = 0X00000211;
-	public static int SGD_DEVICE_MANAGER_INFO = 0X00000212;
-	public static int SGD_DEVICE_MAX_DATA_SIZE = 0X00000213;
-
-	public static int SGD_DEVICE_SORT_SJ = 0X02000000;
-	public static int SGD_DEVICE_SORT_SK = 0X03000000;
-	public static int SGD_DEVICE_SORT_SM = 0X04000000;
-	
-	public static int SGD_DEVICE_SORT_FE = 0X00000100;
-	public static int SGD_DEVICE_SORT_FA = 0X00000200;
-	public static int SGD_DEVICE_SORT_FM = 0X00000400;
-	
-	public static int SGD_STATUS_INIT = 0X00000201;
-	public static int SGD_STATUS_READY = 0X00000202;
-	public static int SGD_STATUS_EXCEPTION = 0X00000203;
-}

+ 0 - 899
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/SM2.java

@@ -1,899 +0,0 @@
-package com.logosdata.security;
-
-
-import com.logosdata.security.util.SM2KeyPair;
-import com.logosdata.security.util.StreamTool;
-import org.bouncycastle.crypto.params.ECDomainParameters;
-import org.bouncycastle.math.ec.ECCurve;
-import org.bouncycastle.math.ec.ECPoint;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.math.BigInteger;
-import java.security.SecureRandom;
-import java.util.Arrays;
-
-/**
- * SM2公钥加密算法实现 包括 -签名,验签 -密钥交换 -公钥加密,私钥解密
- * 
- * @author Potato
- *
- */
-public class SM2 {
-	private static BigInteger n = new BigInteger(
-			"FFFFFFFE" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "7203DF6B" + "21C6052B" + "53BBF409" + "39D54123", 16);
-	private static BigInteger p = new BigInteger(
-			"FFFFFFFE" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "00000000" + "FFFFFFFF" + "FFFFFFFF", 16);
-	private static BigInteger a = new BigInteger(
-			"FFFFFFFE" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "00000000" + "FFFFFFFF" + "FFFFFFFC", 16);
-	private static BigInteger b = new BigInteger(
-			"28E9FA9E" + "9D9F5E34" + "4D5A9E4B" + "CF6509A7" + "F39789F5" + "15AB8F92" + "DDBCBD41" + "4D940E93", 16);
-	private static BigInteger gx = new BigInteger(
-			"32C4AE2C" + "1F198119" + "5F990446" + "6A39C994" + "8FE30BBF" + "F2660BE1" + "715A4589" + "334C74C7", 16);
-	private static BigInteger gy = new BigInteger(
-			"BC3736A2" + "F4F6779C" + "59BDCEE3" + "6B692153" + "D0A9877C" + "C62A4740" + "02DF32E5" + "2139F0A0", 16);
-	private static ECDomainParameters ecc_bc_spec;
-	private static int w = (int) Math.ceil(n.bitLength() * 1.0 / 2) - 1;
-	private static BigInteger _2w = new BigInteger("2").pow(w);
-	private static final int DIGEST_LENGTH = 32;
-
-	private static SecureRandom random = new SecureRandom();
-	private static ECCurve.Fp curve;
-	private static ECPoint G;
-	private boolean debug = false;
-
-	public boolean isDebug() {
-		return debug;
-	}
-
-	public void setDebug(boolean debug) {
-		this.debug = debug;
-	}
-
-	/**
-	 * 以16进制打印字节数组
-	 * 
-	 * @param b
-	 */
-	public static void printHexString(byte[] b) {
-		for (int i = 0; i < b.length; i++) {
-			String hex = Integer.toHexString(b[i] & 0xFF);
-			if (hex.length() == 1) {
-				hex = '0' + hex;
-			}
-			System.out.print(hex.toUpperCase());
-		}
-		System.out.println();
-	}
-
-	/**
-	 * 随机数生成器
-	 * 
-	 * @param max
-	 * @return
-	 */
-	private static BigInteger random(BigInteger max) {
-
-		BigInteger r = new BigInteger(256, random);
-		// int count = 1;
-
-		while (r.compareTo(max) >= 0) {
-			r = new BigInteger(128, random);
-			// count++;
-		}
-
-		// System.out.println("count: " + count);
-		return r;
-	}
-
-	/**
-	 * 判断字节数组是否全0
-	 * 
-	 * @param buffer
-	 * @return
-	 */
-	private boolean allZero(byte[] buffer) {
-		for (int i = 0; i < buffer.length; i++) {
-			if (buffer[i] != 0)
-				return false;
-		}
-		return true;
-	}
-
-	/**
-	 * 公钥加密
-	 * 	 * @param input
-	 *            加密原文
-	 * @param publicKey
-	 *            公钥
-	 * @return
-	 */
-	public byte[] encrypt(String input, ECPoint publicKey) {
-
-		byte[] inputBuffer = input.getBytes();
-		if (debug)
-			printHexString(inputBuffer);
-
-		return encrypt(inputBuffer, publicKey);
-	}
-	/**
-	 * 公钥加密
-	 * 
-	 * @param inputBuffer
-	 *            加密原文
-	 * @param publicKey
-	 *            公钥
-	 * @return
-	 */
-	public byte[] encrypt(byte[] inputBuffer, ECPoint publicKey) {
-
-		byte[] C1Buffer;
-		ECPoint kpb;
-		byte[] t;
-		do {
-			/* 1 产生随机数k,k属于[1, n-1] */
-			BigInteger k = random(n);
-			if (debug) {
-				System.out.print("k: ");
-				printHexString(k.toByteArray());
-			}
-
-			/* 2 计算椭圆曲线点C1 = [k]G = (x1, y1) */
-			ECPoint C1 = G.multiply(k);
-			C1Buffer = C1.getEncoded(false);
-			if (debug) {
-				System.out.print("C1: ");
-				printHexString(C1Buffer);
-			}
-
-			/*
-			 * 3 计算椭圆曲线点 S = [h]Pb
-			 */
-			BigInteger h = ecc_bc_spec.getH();
-			if (h != null) {
-				ECPoint S = publicKey.multiply(h);
-				if (S.isInfinity())
-					throw new IllegalStateException();
-			}
-
-			/* 4 计算 [k]PB = (x2, y2) */
-			kpb = publicKey.multiply(k).normalize();
-
-			/* 5 计算 t = KDF(x2||y2, klen) */
-			byte[] kpbBytes = kpb.getEncoded(false);
-			t = KDF(kpbBytes, inputBuffer.length);
-			// DerivationFunction kdf = new KDF1BytesGenerator(new
-			// ShortenedDigest(new SHA256Digest(), DIGEST_LENGTH));
-			//
-			// t = new byte[inputBuffer.length];
-			// kdf.init(new ISO18033KDFParameters(kpbBytes));
-			// kdf.generateBytes(t, 0, t.length);
-		} while (allZero(t));
-
-		/* 6 计算C2=M^t */
-		byte[] C2 = new byte[inputBuffer.length];
-		for (int i = 0; i < inputBuffer.length; i++) {
-			C2[i] = (byte) (inputBuffer[i] ^ t[i]);
-		}
-
-		/* 7 计算C3 = Hash(x2 || M || y2) */
-		byte[] C3 = sm3hash(kpb.getXCoord().toBigInteger().toByteArray(), inputBuffer,
-				kpb.getYCoord().toBigInteger().toByteArray());
-
-		/* 8 输出密文 C=C1 || C2 || C3 */
-
-		byte[] encryptResult = new byte[C1Buffer.length + C2.length + C3.length];
-
-		System.arraycopy(C1Buffer, 0, encryptResult, 0, C1Buffer.length);
-		System.arraycopy(C2, 0, encryptResult, C1Buffer.length, C2.length);
-		System.arraycopy(C3, 0, encryptResult, C1Buffer.length + C2.length, C3.length);
-
-		if (debug) {
-			System.out.print("密文: ");
-			printHexString(encryptResult);
-		}
-
-		return encryptResult;
-	}
-
-	/**
-	 * 公钥加密
-	 * 
-	 * @param inputfile
-	 *            加密原文
-	 * @param publicKey
-	 *            公钥
-	 * @return
-	 * @throws Exception 
-	 */
-	public byte[] encrypt(File inputfile, ECPoint publicKey) throws Exception {
-		if(inputfile.exists()) {
-			InputStream inStream = new FileInputStream(inputfile);
-			byte[] inputBuffer = StreamTool.readInputStream2ByteArray(inStream);
-			return encrypt(inputBuffer, publicKey);
-		} else {
-			throw new FileNotFoundException();
-		}
-	}
-	
-	/**
-	 * 私钥解密
-	 * 
-	 * @param encryptData
-	 *            密文数据字节数组
-	 * @param privateKey
-	 *            解密私钥
-	 * @return
-	 */
-	public String decrypt(byte[] encryptData, BigInteger privateKey) {
-
-		if (debug)
-			System.out.println("encryptData length: " + encryptData.length);
-
-		byte[] C1Byte = new byte[65];
-		System.arraycopy(encryptData, 0, C1Byte, 0, C1Byte.length);
-
-		ECPoint C1 = curve.decodePoint(C1Byte).normalize();
-
-		/*
-		 * 计算椭圆曲线点 S = [h]C1 是否为无穷点
-		 */
-		BigInteger h = ecc_bc_spec.getH();
-		if (h != null) {
-			ECPoint S = C1.multiply(h);
-			if (S.isInfinity())
-				throw new IllegalStateException();
-		}
-		/* 计算[dB]C1 = (x2, y2) */
-		ECPoint dBC1 = C1.multiply(privateKey).normalize();
-
-		/* 计算t = KDF(x2 || y2, klen) */
-		byte[] dBC1Bytes = dBC1.getEncoded(false);
-		int klen = encryptData.length - 65 - DIGEST_LENGTH;
-		byte[] t = KDF(dBC1Bytes, klen);
-		// DerivationFunction kdf = new KDF1BytesGenerator(new
-		// ShortenedDigest(new SHA256Digest(), DIGEST_LENGTH));
-		// if (debug)
-		// System.out.println("klen = " + klen);
-		// kdf.init(new ISO18033KDFParameters(dBC1Bytes));
-		// kdf.generateBytes(t, 0, t.length);
-
-		if (allZero(t)) {
-			System.err.println("all zero");
-			throw new IllegalStateException();
-		}
-
-		/* 5 计算M'=C2^t */
-		byte[] M = new byte[klen];
-		for (int i = 0; i < M.length; i++) {
-			M[i] = (byte) (encryptData[C1Byte.length + i] ^ t[i]);
-		}
-		if (debug)
-			printHexString(M);
-
-		/* 6 计算 u = Hash(x2 || M' || y2) 判断 u == C3是否成立 */
-		byte[] C3 = new byte[DIGEST_LENGTH];
-
-		if (debug)
-			try {
-				System.out.println("M = " + new String(M, "UTF8"));
-			} catch (UnsupportedEncodingException e1) {
-				// TODO Auto-generated catch block
-				e1.printStackTrace();
-			}
-
-		System.arraycopy(encryptData, encryptData.length - DIGEST_LENGTH, C3, 0, DIGEST_LENGTH);
-		byte[] u = sm3hash(dBC1.getXCoord().toBigInteger().toByteArray(), M,
-				dBC1.getYCoord().toBigInteger().toByteArray());
-		if (Arrays.equals(u, C3)) {
-			if (debug)
-				System.out.println("解密成功");
-			try {
-				return new String(M, "UTF8");
-			} catch (UnsupportedEncodingException e) {
-				e.printStackTrace();
-			}
-			return null;
-		} else {
-			if (debug) {
-				System.out.print("u = ");
-				printHexString(u);
-				System.out.print("C3 = ");
-				printHexString(C3);
-				System.err.println("解密验证失败");
-			}
-			return null;
-		}
-
-	}
-
-	// /**
-	// * SHA摘要
-	// * @param x2
-	// * @param M
-	// * @param y2
-	// * @return
-	// */
-	// private byte[] calculateHash(BigInteger x2, byte[] M, BigInteger y2) {
-	// ShortenedDigest digest = new ShortenedDigest(new SHA256Digest(),
-	// DIGEST_LENGTH);
-	// byte[] buf = x2.toByteArray();
-	// digest.update(buf, 0, buf.length);
-	// digest.update(M, 0, M.length);
-	// buf = y2.toByteArray();
-	// digest.update(buf, 0, buf.length);
-	//
-	// buf = new byte[DIGEST_LENGTH];
-	// digest.doFinal(buf, 0);
-	//
-	// return buf;
-	// }
-
-	/**
-	 * 判断是否在范围内
-	 * 
-	 * @param param
-	 * @param min
-	 * @param max
-	 * @return
-	 */
-	private boolean between(BigInteger param, BigInteger min, BigInteger max) {
-		if (param.compareTo(min) >= 0 && param.compareTo(max) < 0) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	/**
-	 * 判断生成的公钥是否合法
-	 * 
-	 * @param publicKey
-	 * @return
-	 */
-	private boolean checkPublicKey(ECPoint publicKey) {
-
-		if (!publicKey.isInfinity()) {
-
-			BigInteger x = publicKey.getXCoord().toBigInteger();
-			BigInteger y = publicKey.getYCoord().toBigInteger();
-
-			if (between(x, new BigInteger("0"), p) && between(y, new BigInteger("0"), p)) {
-
-				BigInteger xResult = x.pow(3).add(a.multiply(x)).add(b).mod(p);
-
-				if (debug)
-					System.out.println("xResult: " + xResult.toString());
-
-				BigInteger yResult = y.pow(2).mod(p);
-
-				if (debug)
-					System.out.println("yResult: " + yResult.toString());
-
-				if (yResult.equals(xResult) && publicKey.multiply(n).isInfinity()) {
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * 生成密钥对
-	 * 
-	 * @return
-	 */
-	public SM2KeyPair generateKeyPair() {
-
-		BigInteger d = random(n.subtract(new BigInteger("1")));
-
-		SM2KeyPair keyPair = new SM2KeyPair(G.multiply(d).normalize(), d);
-
-		if (checkPublicKey(keyPair.getPublicKey())) {
-			if (debug)
-				System.out.println("generate key successfully");
-			return keyPair;
-		} else {
-			if (debug)
-				System.err.println("generate key failed");
-			return null;
-		}
-	}
-
-	public SM2() {
-		curve = new ECCurve.Fp(p, // q
-				a, // a
-				b); // b
-		G = curve.createPoint(gx, gy);
-		ecc_bc_spec = new ECDomainParameters(curve, G, n);
-	}
-
-	public SM2(boolean debug) {
-		this();
-		this.debug = debug;
-	}
-
-	/**
-	 * 导出公钥到本地
-	 * 
-	 * @param publicKey
-	 * @param path
-	 */
-	public void exportPublicKey(ECPoint publicKey, String path) {
-		File file = new File(path);
-		try {
-			if (!file.exists())
-				file.createNewFile();
-			byte buffer[] = publicKey.getEncoded(false);
-			FileOutputStream fos = new FileOutputStream(file);
-			fos.write(buffer);
-			fos.close();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-	/**
-	 * 从本地导入公钥
-	 * 
-	 * @param path
-	 * @return
-	 */
-	public ECPoint importPublicKey(String path) {
-		File file = new File(path);
-		try {
-			if (!file.exists())
-				return null;
-			FileInputStream fis = new FileInputStream(file);
-			ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
-			byte buffer[] = new byte[16];
-			int size;
-			while ((size = fis.read(buffer)) != -1) {
-				baos.write(buffer, 0, size);
-			}
-			fis.close();
-			return curve.decodePoint(baos.toByteArray());
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	/**
-	 * 导出私钥到本地
-	 * 
-	 * @param privateKey
-	 * @param path
-	 */
-	public void exportPrivateKey(BigInteger privateKey, String path) {
-		File file = new File(path);
-		try {
-			if (!file.exists())
-				file.createNewFile();
-			ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
-			oos.writeObject(privateKey);
-			oos.close();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-	/**
-	 * 从本地导入私钥
-	 * 
-	 * @param path
-	 * @return
-	 */
-	public BigInteger importPrivateKey(String path) {
-		File file = new File(path);
-		try {
-			if (!file.exists())
-				return null;
-			FileInputStream fis = new FileInputStream(file);
-			ObjectInputStream ois = new ObjectInputStream(fis);
-			BigInteger res = (BigInteger) (ois.readObject());
-			ois.close();
-			fis.close();
-			return res;
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	/**
-	 * 字节数组拼接
-	 * 
-	 * @param params
-	 * @return
-	 */
-	private static byte[] join(byte[]... params) {
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		byte[] res = null;
-		try {
-			for (int i = 0; i < params.length; i++) {
-				baos.write(params[i]);
-			}
-			res = baos.toByteArray();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		return res;
-	}
-
-	/**
-	 * sm3摘要
-	 * 
-	 * @param params
-	 * @return
-	 */
-	private static byte[] sm3hash(byte[]... params) {
-		byte[] res = null;
-		try {
-			res = SM3.hash(join(params));
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return res;
-	}
-
-	/**
-	 * 取得用户标识字节数组
-	 * 
-	 * @param IDA
-	 * @param aPublicKey
-	 * @return
-	 */
-	private static byte[] ZA(String IDA, ECPoint aPublicKey) {
-		byte[] idaBytes = IDA.getBytes();
-		int entlenA = idaBytes.length * 8;
-		byte[] ENTLA = new byte[] { (byte) (entlenA & 0xFF00), (byte) (entlenA & 0x00FF) };
-		byte[] ZA = sm3hash(ENTLA, idaBytes, a.toByteArray(), b.toByteArray(), gx.toByteArray(), gy.toByteArray(),
-				aPublicKey.getXCoord().toBigInteger().toByteArray(),
-				aPublicKey.getYCoord().toBigInteger().toByteArray());
-		return ZA;
-	}
-
-	/**
-	 * 签名
-	 * 
-	 * @param M
-	 *            签名信息
-	 * @param IDA
-	 *            签名方唯一标识
-	 * @param keyPair
-	 *            签名方密钥对
-	 * @return 签名
-	 */
-	public Signature sign(String M, String IDA, SM2KeyPair keyPair) {
-		byte[] ZA = ZA(IDA, keyPair.getPublicKey());
-		byte[] M_ = join(ZA, M.getBytes());
-		BigInteger e = new BigInteger(1, sm3hash(M_));
-		// BigInteger k = new BigInteger(
-		// "6CB28D99 385C175C 94F94E93 4817663F C176D925 DD72B727 260DBAAE
-		// 1FB2F96F".replace(" ", ""), 16);
-		BigInteger k;
-		BigInteger r;
-		do {
-			k = random(n);
-			ECPoint p1 = G.multiply(k).normalize();
-			BigInteger x1 = p1.getXCoord().toBigInteger();
-			r = e.add(x1);
-			r = r.mod(n);
-		} while (r.equals(BigInteger.ZERO) || r.add(k).equals(n));
-
-		BigInteger s = ((keyPair.getPrivateKey().add(BigInteger.ONE).modInverse(n))
-				.multiply((k.subtract(r.multiply(keyPair.getPrivateKey()))).mod(n))).mod(n);
-
-		return new Signature(r, s);
-	}
-
-	/**
-	 * 验签
-	 * 
-	 * @param M
-	 *            签名信息
-	 * @param signature
-	 *            签名
-	 * @param IDA
-	 *            签名方唯一标识
-	 * @param aPublicKey
-	 *            签名方公钥
-	 * @return true or false
-	 */
-	public boolean verify(String M, Signature signature, String IDA, ECPoint aPublicKey) {
-		if (!between(signature.r, BigInteger.ONE, n))
-			return false;
-		if (!between(signature.s, BigInteger.ONE, n))
-			return false;
-
-		byte[] M_ = join(ZA(IDA, aPublicKey), M.getBytes());
-		BigInteger e = new BigInteger(1, sm3hash(M_));
-		BigInteger t = signature.r.add(signature.s).mod(n);
-
-		if (t.equals(BigInteger.ZERO))
-			return false;
-
-		ECPoint p1 = G.multiply(signature.s).normalize();
-		ECPoint p2 = aPublicKey.multiply(t).normalize();
-		BigInteger x1 = p1.add(p2).normalize().getXCoord().toBigInteger();
-		BigInteger R = e.add(x1).mod(n);
-		if (R.equals(signature.r))
-			return true;
-		return false;
-	}
-
-	/**
-	 * 密钥派生函数
-	 * 
-	 * @param Z
-	 * @param klen
-	 *            生成klen字节数长度的密钥
-	 * @return
-	 */
-	private static byte[] KDF(byte[] Z, int klen) {
-		int ct = 1;
-		int end = (int) Math.ceil(klen * 1.0 / 32);
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		try {
-			for (int i = 1; i < end; i++) {
-				baos.write(sm3hash(Z, SM3.toByteArray(ct)));
-				ct++;
-			}
-			byte[] last = sm3hash(Z, SM3.toByteArray(ct));
-			if (klen % 32 == 0) {
-				baos.write(last);
-			} else
-				baos.write(last, 0, klen % 32);
-			return baos.toByteArray();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	/**
-	 * 传输实体类
-	 * 
-	 * @author Potato
-	 *
-	 */
-	private static class TransportEntity implements Serializable {
-		final byte[] R; //R点
-		final byte[] S; //验证S
-		final byte[] Z; //用户标识
-		final byte[] K; //公钥
-
-		public TransportEntity(byte[] r, byte[] s, byte[] z, ECPoint pKey) {
-			R = r;
-			S = s;
-			Z=z;
-			K=pKey.getEncoded(false);
-		}
-	}
-
-	/**
-	 * 密钥协商辅助类
-	 * 
-	 * @author Potato
-	 *
-	 */
-	public static class KeyExchange {
-		BigInteger rA;
-		ECPoint RA;
-		ECPoint V;
-		byte[] Z;
-		byte[] key;
-		
-		String ID;
-		SM2KeyPair keyPair;
-
-		public KeyExchange(String ID,SM2KeyPair keyPair) {
-			this.ID=ID;
-			this.keyPair = keyPair;
-			this.Z=ZA(ID, keyPair.getPublicKey());
-		}
-
-		/**
-		 * 密钥协商发起第一步
-		 * 
-		 * @return
-		 */
-		public TransportEntity keyExchange_1() {
-			rA = random(n);
-			// rA=new BigInteger("83A2C9C8 B96E5AF7 0BD480B4 72409A9A 327257F1
-			// EBB73F5B 073354B2 48668563".replace(" ", ""),16);
-			RA = G.multiply(rA).normalize();
-			return new TransportEntity(RA.getEncoded(false), null,Z,keyPair.getPublicKey());
-		}
-
-		/**
-		 * 密钥协商响应方
-		 * 
-		 * @param entity 传输实体
-		 * @return
-		 */
-		public TransportEntity keyExchange_2(TransportEntity entity) {
-			BigInteger rB = random(n);
-			// BigInteger rB=new BigInteger("33FE2194 0342161C 55619C4A 0C060293
-			// D543C80A F19748CE 176D8347 7DE71C80".replace(" ", ""),16);
-			ECPoint RB = G.multiply(rB).normalize();
-			
-			this.rA=rB;
-			this.RA=RB;
-
-			BigInteger x2 = RB.getXCoord().toBigInteger();
-			x2 = _2w.add(x2.and(_2w.subtract(BigInteger.ONE)));
-
-			BigInteger tB = keyPair.getPrivateKey().add(x2.multiply(rB)).mod(n);
-			ECPoint RA = curve.decodePoint(entity.R).normalize();
-			
-			BigInteger x1 = RA.getXCoord().toBigInteger();
-			x1 = _2w.add(x1.and(_2w.subtract(BigInteger.ONE)));
-
-			ECPoint aPublicKey=curve.decodePoint(entity.K).normalize();
-			ECPoint temp = aPublicKey.add(RA.multiply(x1).normalize()).normalize();
-			ECPoint V = temp.multiply(ecc_bc_spec.getH().multiply(tB)).normalize();
-			if (V.isInfinity())
-				throw new IllegalStateException();
-			this.V=V;
-			
-			byte[] xV = V.getXCoord().toBigInteger().toByteArray();
-			byte[] yV = V.getYCoord().toBigInteger().toByteArray();
-			byte[] KB = KDF(join(xV, yV, entity.Z, this.Z), 16);
-			key = KB;
-			System.out.print("协商得B密钥:");
-			printHexString(KB);
-			byte[] sB = sm3hash(new byte[] { 0x02 }, yV,
-					sm3hash(xV, entity.Z, this.Z, RA.getXCoord().toBigInteger().toByteArray(),
-							RA.getYCoord().toBigInteger().toByteArray(), RB.getXCoord().toBigInteger().toByteArray(),
-							RB.getYCoord().toBigInteger().toByteArray()));
-			return new TransportEntity(RB.getEncoded(false), sB,this.Z,keyPair.getPublicKey());
-		}
-
-		/**
-		 * 密钥协商发起方第二步
-		 * 
-		 * @param entity 传输实体
-		 */
-		public TransportEntity keyExchange_3(TransportEntity entity) {
-			BigInteger x1 = RA.getXCoord().toBigInteger();
-			x1 = _2w.add(x1.and(_2w.subtract(BigInteger.ONE)));
-
-			BigInteger tA = keyPair.getPrivateKey().add(x1.multiply(rA)).mod(n);
-			ECPoint RB = curve.decodePoint(entity.R).normalize();
-			
-			BigInteger x2 = RB.getXCoord().toBigInteger();
-			x2 = _2w.add(x2.and(_2w.subtract(BigInteger.ONE)));
-
-			ECPoint bPublicKey=curve.decodePoint(entity.K).normalize();
-			ECPoint temp = bPublicKey.add(RB.multiply(x2).normalize()).normalize();
-			ECPoint U = temp.multiply(ecc_bc_spec.getH().multiply(tA)).normalize();
-			if (U.isInfinity())
-				throw new IllegalStateException();
-			this.V=U;
-			
-			byte[] xU = U.getXCoord().toBigInteger().toByteArray();
-			byte[] yU = U.getYCoord().toBigInteger().toByteArray();
-			byte[] KA = KDF(join(xU, yU,
-					this.Z, entity.Z), 16);
-			key = KA;
-			System.out.print("协商得A密钥:");
-			printHexString(KA);
-			byte[] s1= sm3hash(new byte[] { 0x02 }, yU,
-					sm3hash(xU, this.Z, entity.Z, RA.getXCoord().toBigInteger().toByteArray(),
-							RA.getYCoord().toBigInteger().toByteArray(), RB.getXCoord().toBigInteger().toByteArray(),
-							RB.getYCoord().toBigInteger().toByteArray()));
-			if(Arrays.equals(entity.S, s1))
-				System.out.println("B->A 密钥确认成功");
-			else
-				System.out.println("B->A 密钥确认失败");
-			byte[] sA= sm3hash(new byte[] { 0x03 }, yU,
-					sm3hash(xU, this.Z, entity.Z, RA.getXCoord().toBigInteger().toByteArray(),
-							RA.getYCoord().toBigInteger().toByteArray(), RB.getXCoord().toBigInteger().toByteArray(),
-							RB.getYCoord().toBigInteger().toByteArray()));
-			
-			return new TransportEntity(RA.getEncoded(false), sA,this.Z,keyPair.getPublicKey());
-		}
-		
-		/**
-		 * 密钥确认最后一步
-		 * 
-		 * @param entity 传输实体
-		 */
-		public void keyExchange_4(TransportEntity entity) {
-			byte[] xV = V.getXCoord().toBigInteger().toByteArray();
-			byte[] yV = V.getYCoord().toBigInteger().toByteArray();
-			ECPoint RA = curve.decodePoint(entity.R).normalize();
-			byte[] s2= sm3hash(new byte[] { 0x03 }, yV,
-					sm3hash(xV, entity.Z, this.Z, RA.getXCoord().toBigInteger().toByteArray(),
-							RA.getYCoord().toBigInteger().toByteArray(), this.RA.getXCoord().toBigInteger().toByteArray(),
-							this.RA.getYCoord().toBigInteger().toByteArray()));
-			if(Arrays.equals(entity.S, s2))
-				System.out.println("A->B 密钥确认成功");
-			else
-				System.out.println("A->B 密钥确认失败");
-		}
-	}
-
-	public static void main(String[] args) throws UnsupportedEncodingException {
-
-		SM2 sm02 = new SM2();
-//		 BigInteger px = new BigInteger(
-//		 "0AE4C779 8AA0F119 471BEE11 825BE462 02BB79E2 A5844495 E97C04FF"+
-//		 "4DF2548A".replace(" ", ""), 16);
-//		 BigInteger py = new BigInteger(
-//		 "7C0240F8 8F1CD4E1 6352A73C 17B7F16F 07353E53 A176D684 A9FE0C6B"+
-//		 "B798E857".replace(" ", ""), 16);
-//		 ECPoint publicKey = sm02.curve.createPoint(px, py);
-//		 BigInteger privateKey = new BigInteger(
-//		 "128B2FA8 BD433C6C 068C8D80 3DFF7979 2A519A55 171B1B65 0C23661D"+
-//		 "15897263".replace(" ", ""), 16);
-
-		 SM2KeyPair keyPair = sm02.generateKeyPair();
-		 ECPoint publicKey=keyPair.getPublicKey();
-		 System.out.println(publicKey);
-		 BigInteger privateKey=keyPair.getPrivateKey();
-		 System.out.println(privateKey);
-		 sm02.exportPublicKey(publicKey, "E:/publickey.pem");
-		 sm02.exportPrivateKey(privateKey, "E:/privatekey.pem");
-
-		System.out.println("-----------------公钥加密与解密-----------------");
-//		ECPoint publicKey = sm02.importPublicKey("E:/publickey.pem");
-//		BigInteger privateKey = sm02.importPrivateKey("E:/privatekey.pem");
-		byte[] data = sm02.encrypt("测试加密aaaaaaaaaaa123aabb", publicKey);
-		System.out.print("密文:");
-		SM2.printHexString(data);
-		System.out.println("解密后明文:" + sm02.decrypt(data, privateKey));
-
-		System.out.println("-----------------签名与验签-----------------");
-		String IDA = "Heartbeats";
-		String M = "要签名的信息";
-		Signature signature = sm02.sign(M, IDA, new SM2KeyPair(publicKey, privateKey));
-		System.out.println("用户标识:" + IDA);
-		System.out.println("签名信息:" + M);
-		System.out.println("数字签名:" + signature);
-		System.out.println("验证签名:" + sm02.verify(M, signature, IDA, publicKey));
-
-		System.out.println("-----------------密钥协商-----------------");
-		String aID = "AAAAAAAAAAAAA";
-		SM2KeyPair aKeyPair = sm02.generateKeyPair();
-		KeyExchange aKeyExchange = new KeyExchange(aID,aKeyPair);
-
-		String bID = "BBBBBBBBBBBBB";
-		SM2KeyPair bKeyPair = sm02.generateKeyPair();
-		KeyExchange bKeyExchange = new KeyExchange(bID,bKeyPair);
-		TransportEntity entity1 = aKeyExchange.keyExchange_1();
-		TransportEntity entity2 = bKeyExchange.keyExchange_2(entity1);
-		TransportEntity entity3 = aKeyExchange.keyExchange_3(entity2);
-		bKeyExchange.keyExchange_4(entity3);
-	}
-
-	public static class Signature implements Serializable {
-		
-		private static final long serialVersionUID = 1373021590252408264L;
-		
-		BigInteger r;
-		BigInteger s;
-
-		public Signature(BigInteger r, BigInteger s) {
-			this.r = r;
-			this.s = s;
-		}
-
-		public String toString() {
-			return r.toString(16) + "," + s.toString(16);
-		}
-	}
-}

+ 0 - 242
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/SM3.java

@@ -1,242 +0,0 @@
-package com.logosdata.security;
-
-import com.logosdata.security.util.StreamTool;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.math.BigInteger;
-import java.util.Arrays;
-
-/**
- * SM3杂凑算法实现
- *
- * @author Potato
- */
-public class SM3 {
-
-	private static char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
-			'F'};
-	private static final String ivHexStr = "7380166f 4914b2b9 172442d7 da8a0600 a96f30bc 163138aa e38dee4d b0fb0e4e";
-	private static final BigInteger IV = new BigInteger(ivHexStr.replaceAll(" ", ""), 16);
-	private static final Integer Tj15 = Integer.valueOf("79cc4519", 16);
-	private static final Integer Tj63 = Integer.valueOf("7a879d8a", 16);
-	private static final byte[] FirstPadding = {(byte) 0x80};
-	private static final byte[] ZeroPadding = {(byte) 0x00};
-
-	private static int T(int j) {
-		if (j >= 0 && j <= 15) {
-			return Tj15.intValue();
-		} else if (j >= 16 && j <= 63) {
-			return Tj63.intValue();
-		} else {
-			throw new RuntimeException("data invalid");
-		}
-	}
-
-	private static Integer FF(Integer x, Integer y, Integer z, int j) {
-		if (j >= 0 && j <= 15) {
-			return Integer.valueOf(x.intValue() ^ y.intValue() ^ z.intValue());
-		} else if (j >= 16 && j <= 63) {
-			return Integer.valueOf(
-					(x.intValue() & y.intValue()) | (x.intValue() & z.intValue()) | (y.intValue() & z.intValue()));
-		} else {
-			throw new RuntimeException("data invalid");
-		}
-	}
-
-	private static Integer GG(Integer x, Integer y, Integer z, int j) {
-		if (j >= 0 && j <= 15) {
-			return Integer.valueOf(x.intValue() ^ y.intValue() ^ z.intValue());
-		} else if (j >= 16 && j <= 63) {
-			return Integer.valueOf((x.intValue() & y.intValue()) | (~x.intValue() & z.intValue()));
-		} else {
-			throw new RuntimeException("data invalid");
-		}
-	}
-
-	private static Integer P0(Integer x) {
-		return Integer
-				.valueOf(x.intValue() ^ Integer.rotateLeft(x.intValue(), 9) ^ Integer.rotateLeft(x.intValue(), 17));
-	}
-
-	private static Integer P1(Integer x) {
-		return Integer
-				.valueOf(x.intValue() ^ Integer.rotateLeft(x.intValue(), 15) ^ Integer.rotateLeft(x.intValue(), 23));
-	}
-
-	private static byte[] padding(byte[] source) throws IOException {
-		if (source.length >= 0x2000000000000000l) {
-			throw new RuntimeException("src data invalid.");
-		}
-		long l = source.length * 8;
-		long k = 448 - (l + 1) % 512;
-		if (k < 0) {
-			k = k + 512;
-		}
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		baos.write(source);
-		baos.write(FirstPadding);
-		long i = k - 7;
-		while (i > 0) {
-			baos.write(ZeroPadding);
-			i -= 8;
-		}
-		baos.write(long2bytes(l));
-		return baos.toByteArray();
-	}
-
-	private static byte[] long2bytes(long l) {
-		byte[] bytes = new byte[8];
-		for (int i = 0; i < 8; i++) {
-			bytes[i] = (byte) (l >>> ((7 - i) * 8));
-		}
-		return bytes;
-	}
-
-	public static byte[] hash(byte[] source) throws IOException {
-		byte[] m1 = padding(source);
-		int n = m1.length / (512 / 8);
-		byte[] b;
-		byte[] vi = IV.toByteArray();
-		byte[] vi1 = null;
-		for (int i = 0; i < n; i++) {
-			b = Arrays.copyOfRange(m1, i * 64, (i + 1) * 64);
-			vi1 = CF(vi, b);
-			vi = vi1;
-		}
-		return vi1;
-	}
-
-	public static byte[] hash(String source) throws Exception {
-		return hash(source.getBytes());
-	}
-
-	public static byte[] hash(File file) throws Exception {
-		if (file.exists()) {
-			InputStream inStream = new FileInputStream(file);
-			return hash(StreamTool.readInputStream2ByteArray(inStream));
-		} else {
-			throw new FileNotFoundException();
-		}
-	}
-
-	private static byte[] CF(byte[] vi, byte[] bi) throws IOException {
-		int a, b, c, d, e, f, g, h;
-		a = toInteger(vi, 0);
-		b = toInteger(vi, 1);
-		c = toInteger(vi, 2);
-		d = toInteger(vi, 3);
-		e = toInteger(vi, 4);
-		f = toInteger(vi, 5);
-		g = toInteger(vi, 6);
-		h = toInteger(vi, 7);
-
-		int[] w = new int[68];
-		int[] w1 = new int[64];
-		for (int i = 0; i < 16; i++) {
-			w[i] = toInteger(bi, i);
-		}
-		for (int j = 16; j < 68; j++) {
-			w[j] = P1(w[j - 16] ^ w[j - 9] ^ Integer.rotateLeft(w[j - 3], 15)) ^ Integer.rotateLeft(w[j - 13], 7)
-					^ w[j - 6];
-		}
-		for (int j = 0; j < 64; j++) {
-			w1[j] = w[j] ^ w[j + 4];
-		}
-		int ss1, ss2, tt1, tt2;
-		for (int j = 0; j < 64; j++) {
-			ss1 = Integer.rotateLeft(Integer.rotateLeft(a, 12) + e + Integer.rotateLeft(T(j), j), 7);
-			ss2 = ss1 ^ Integer.rotateLeft(a, 12);
-			tt1 = FF(a, b, c, j) + d + ss2 + w1[j];
-			tt2 = GG(e, f, g, j) + h + ss1 + w[j];
-			d = c;
-			c = Integer.rotateLeft(b, 9);
-			b = a;
-			a = tt1;
-			h = g;
-			g = Integer.rotateLeft(f, 19);
-			f = e;
-			e = P0(tt2);
-		}
-		byte[] v = toByteArray(a, b, c, d, e, f, g, h);
-		for (int i = 0; i < v.length; i++) {
-			v[i] = (byte) (v[i] ^ vi[i]);
-		}
-		return v;
-	}
-
-	private static int toInteger(byte[] source, int index) {
-		StringBuilder valueStr = new StringBuilder("");
-		for (int i = 0; i < 4; i++) {
-			valueStr.append(hexDigits[(byte) ((source[index * 4 + i] & 0xF0) >> 4)]);
-			valueStr.append(hexDigits[(byte) (source[index * 4 + i] & 0x0F)]);
-		}
-		return Long.valueOf(valueStr.toString(), 16).intValue();
-
-	}
-
-	private static byte[] toByteArray(int a, int b, int c, int d, int e, int f, int g, int h) throws IOException {
-		ByteArrayOutputStream baos = new ByteArrayOutputStream(32);
-		baos.write(toByteArray(a));
-		baos.write(toByteArray(b));
-		baos.write(toByteArray(c));
-		baos.write(toByteArray(d));
-		baos.write(toByteArray(e));
-		baos.write(toByteArray(f));
-		baos.write(toByteArray(g));
-		baos.write(toByteArray(h));
-		return baos.toByteArray();
-	}
-
-	public static byte[] toByteArray(int i) {
-		byte[] byteArray = new byte[4];
-		byteArray[0] = (byte) (i >>> 24);
-		byteArray[1] = (byte) ((i & 0xFFFFFF) >>> 16);
-		byteArray[2] = (byte) ((i & 0xFFFF) >>> 8);
-		byteArray[3] = (byte) (i & 0xFF);
-		return byteArray;
-	}
-
-	private static String byteToHexString(byte b) {
-		int n = b;
-		if (n < 0)
-			n = 256 + n;
-		int d1 = n / 16;
-		int d2 = n % 16;
-		return "" + hexDigits[d1] + hexDigits[d2];
-	}
-
-	public static String byteArrayToHexString(byte[] b) {
-		StringBuffer resultSb = new StringBuffer();
-		for (int i = 0; i < b.length; i++) {
-			resultSb.append(byteToHexString(b[i]));
-		}
-		return resultSb.toString();
-	}
-
-	public static String hashHex(byte[] b) {
-		try {
-			return SM3.byteArrayToHexString(SM3.hash(b));
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	public static String hashHex(String str) {
-		return hashHex(str.getBytes());
-	}
-
-	public static String hashHex(String str, String charset) throws UnsupportedEncodingException {
-		return hashHex(str.getBytes(charset));
-	}
-
-	public static void main(String[] args) throws IOException {
-		System.out.println(SM3.byteArrayToHexString(SM3.hash("abc".getBytes())));
-	}
-}

+ 0 - 437
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/SM4.java

@@ -1,437 +0,0 @@
-package com.logosdata.security;
-
-import com.logosdata.security.util.NumberTool;
-import com.logosdata.security.util.SM4Base;
-import com.logosdata.security.util.SM4_Context;
-import com.logosdata.security.util.StreamTool;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Base64;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-
-public class SM4 {
-	
-	private String secretKey = "";
-	private String iv = "";
-	private boolean hexString = false;
-
-	public static void main(String[] args) throws IOException {
-		String plainText = "ererfeiisgod";
-
-		SM4 sm4 = new SM4();
-		sm4.secretKey = "JeF8U9wHFOMfs2Y8";
-		sm4.hexString = false;
-
-		System.out.println("ECB模式");
-		String cipherText = sm4.encryptDataToString_ECB(plainText);
-		System.out.println("密文: " + cipherText);
-		System.out.println("");
-
-		plainText = sm4.decryptDataToString_ECB(cipherText);
-		System.out.println("明文: " + plainText);
-		System.out.println("");
-
-		System.out.println("CBC模式");
-		sm4.iv = "UISwD9fW6cFh9SNS";
-		cipherText = sm4.encryptDataToString_CBC(plainText);
-		System.out.println("密文: " + cipherText);
-		System.out.println("");
-
-		plainText = sm4.decryptDataToString_CBC(cipherText);
-		System.out.println("明文: " + plainText);
-	}
-	
-	public String decryptDataToString_CBC(String cipherText) {
-		return decryptDataToString_CBC(cipherText, "GBK");
-	}
-
-	public String decryptDataToString_CBC(String cipherText, String charset) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_DECRYPT;
-
-			byte[] keyBytes;
-			byte[] ivBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-				ivBytes = NumberTool.hexStringToBytes(iv);
-			} else {
-				keyBytes = secretKey.getBytes();
-				ivBytes = iv.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_dec(ctx, keyBytes);
-			byte[] decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, Base64.getDecoder().decode(cipherText));
-			return new String(decrypted, charset);
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-	
-	public byte[] decryptData_CBC(String cipherText) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_DECRYPT;
-
-			byte[] keyBytes;
-			byte[] ivBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-				ivBytes = NumberTool.hexStringToBytes(iv);
-			} else {
-				keyBytes = secretKey.getBytes();
-				ivBytes = iv.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_dec(ctx, keyBytes);
-			return sm4.sm4_crypt_cbc(ctx, ivBytes, Base64.getDecoder().decode(cipherText));
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-
-	public String decryptDataToString_CBC(byte[] bytes) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_DECRYPT;
-
-			byte[] keyBytes;
-			byte[] ivBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-				ivBytes = NumberTool.hexStringToBytes(iv);
-			} else {
-				keyBytes = secretKey.getBytes();
-				ivBytes = iv.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_dec(ctx, keyBytes);
-			byte[] decrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, bytes);
-			return new String(decrypted, "GBK");
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-		
-	public byte[] decryptData_ECB(byte[] bytes) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_DECRYPT;
-
-			byte[] keyBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-			} else {
-				keyBytes = secretKey.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_dec(ctx, keyBytes);
-			return sm4.sm4_crypt_ecb(ctx, bytes);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-	
-	public byte[] decryptData_ECB(String cipherText) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_DECRYPT;
-
-			byte[] keyBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-			} else {
-				keyBytes = secretKey.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_dec(ctx, keyBytes);
-			return sm4.sm4_crypt_ecb(ctx, Base64.getDecoder().decode(cipherText));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-	
-	public String decryptDataToString_ECB(String cipherText) {
-		return decryptDataToString_ECB(cipherText, "GBK");
-	}
-	
-	public String decryptDataToString_ECB(String cipherText, String charset) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_DECRYPT;
-
-			byte[] keyBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-			} else {
-				keyBytes = secretKey.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_dec(ctx, keyBytes);
-			byte[] decrypted = sm4.sm4_crypt_ecb(ctx, Base64.getDecoder().decode(cipherText));
-			return new String(decrypted, charset);
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-	
-	public String encryptDataToString_CBC(byte[] bytes) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_ENCRYPT;
-
-			byte[] keyBytes;
-			byte[] ivBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-				ivBytes = NumberTool.hexStringToBytes(iv);
-			} else {
-				keyBytes = secretKey.getBytes();
-				ivBytes = iv.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_enc(ctx, keyBytes);
-			byte[] encrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, bytes);
-			String cipherText = Base64.getEncoder().encodeToString(encrypted);
-			if (cipherText != null && cipherText.trim().length() > 0) {
-				Pattern p = Pattern.compile("\\s*|\t|\r|\n");
-				Matcher m = p.matcher(cipherText);
-				cipherText = m.replaceAll("");
-			}
-			return cipherText;
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-
-	public String encryptDataToString_CBC(String plainText) {
-		return encryptDataToString_CBC(plainText, "GBK");
-	}
-	public String encryptDataToString_CBC(String plainText, String charset) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_ENCRYPT;
-
-			byte[] keyBytes;
-			byte[] ivBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-				ivBytes = NumberTool.hexStringToBytes(iv);
-			} else {
-				keyBytes = secretKey.getBytes();
-				ivBytes = iv.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_enc(ctx, keyBytes);
-			byte[] encrypted = sm4.sm4_crypt_cbc(ctx, ivBytes, plainText.getBytes(charset));
-			String cipherText = Base64.getEncoder().encodeToString(encrypted);
-			if (cipherText != null && cipherText.trim().length() > 0) {
-				Pattern p = Pattern.compile("\\s*|\t|\r|\n");
-				Matcher m = p.matcher(cipherText);
-				cipherText = m.replaceAll("");
-			}
-			return cipherText;
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-
-	public byte[] encryptData_CBC(String plainText, String charset) {
-		try {
-			return encryptData_CBC(plainText.getBytes(charset));
-		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
-			return null;
-		}		
-	}
-
-	public byte[] encryptData_CBC(byte[] bytes) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_ENCRYPT;
-
-			byte[] keyBytes;
-			byte[] ivBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-				ivBytes = NumberTool.hexStringToBytes(iv);
-			} else {
-				keyBytes = secretKey.getBytes();
-				ivBytes = iv.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_enc(ctx, keyBytes);
-			return sm4.sm4_crypt_cbc(ctx, ivBytes, bytes);		
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-
-	public byte[] encryptData_ECB(byte[] bytes) {
-//		SM4_Context ctx = new SM4_Context();
-//		SM4Base sm4 = new SM4Base();
-//		try {
-//			return sm4.sm4_crypt_ecb(ctx, bytes);
-//		} catch (Exception e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//			return null;
-//		}
-		
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_ENCRYPT;
-
-			byte[] keyBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-			} else {
-				keyBytes = secretKey.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_enc(ctx, keyBytes);
-			return sm4.sm4_crypt_ecb(ctx, bytes);			
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-	
-	public byte[] encryptData_ECB(File f) throws IOException {
-		if(f.exists()) {
-			InputStream inStream = new FileInputStream(f);
-			return encryptData_ECB(StreamTool.readInputStream2ByteArray(inStream));
-		} else {
-			throw new IOException("File not Found");
-		}
-		
-	}
-	
-	public byte[] encryptData_ECB(String plainText) {
-		return encryptData_ECB(plainText, "GBK");
-	}
-
-	public byte[] encryptData_ECB(String plainText, String charset) {
-		try {
-			return encryptData_ECB(plainText.getBytes(charset));
-		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-	
-	public String encryptDataToString_ECB(String plainText) {
-			return encryptDataToString_ECB(plainText, "GBK");
-	}
-
-	public String encryptDataToString_ECB(String plainText, String charset) {
-		try {
-			SM4_Context ctx = new SM4_Context();
-			ctx.isPadding = true;
-			ctx.mode = SM4Base.SM4_ENCRYPT;
-
-			byte[] keyBytes;
-			if (hexString) {
-				keyBytes = NumberTool.hexStringToBytes(secretKey);
-			} else {
-				keyBytes = secretKey.getBytes();
-			}
-
-			SM4Base sm4 = new SM4Base();
-			sm4.sm4_setkey_enc(ctx, keyBytes);
-			byte[] encrypted = sm4.sm4_crypt_ecb(ctx, plainText.getBytes(charset));
-			String cipherText = Base64.getEncoder().encodeToString(encrypted);
-			if (cipherText != null && cipherText.trim().length() > 0) {
-				Pattern p = Pattern.compile("\\s*|\t|\r|\n");
-				Matcher m = p.matcher(cipherText);
-				cipherText = m.replaceAll("");
-			}
-			return cipherText;
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-
-
-	/**
-	 * @return the iv
-	 */
-	public String getIv() {
-		return iv;
-	}
-
-	/**
-	 * @return the secretKey
-	 */
-	public String getSecretKey() {
-		return secretKey;
-	}
-
-	/**
-	 * @return the hexString
-	 */
-	public boolean isHexString() {
-		return hexString;
-	}
-
-	/**
-	 * @param hexString the hexString to set
-	 */
-	public void setHexString(boolean hexString) {
-		this.hexString = hexString;
-	}
-
-	/**
-	 * @param iv the iv to set
-	 */
-	public void setIv(String iv) {
-		this.iv = iv;
-	}
-
-	/**
-	 * @param secretKey the secretKey to set
-	 */
-	public void setSecretKey(String secretKey) {
-		this.secretKey = secretKey;
-	}
-	
-	
-}

+ 0 - 522
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/NumberTool.java

@@ -1,522 +0,0 @@
-package com.logosdata.security.util;
-
-import java.io.ByteArrayOutputStream;
-import java.math.BigInteger;
-import java.util.Arrays;
-
-public class NumberTool {
-	/**
-	 * 整形转换成网络传输的字节流(字节数组)型数据
-	 * 
-	 * @param num
-	 *            一个整型数据
-	 * @return 4个字节的自己数组
-	 */
-	public static byte[] intToBytes(int num) {
-		byte[] bytes = new byte[4];
-		bytes[0] = (byte) (0xff & (num));
-		bytes[1] = (byte) (0xff & (num >> 8));
-		bytes[2] = (byte) (0xff & (num >> 16));
-		bytes[3] = (byte) (0xff & (num >> 24));
-		return bytes;
-	}
-
-	/**
-	 * 四个字节的字节数据转换成一个整形数据
-	 * 
-	 * @param bytes
-	 *            4个字节的字节数组
-	 * @return 一个整型数据
-	 */
-	public static int byteToInt(byte[] bytes) {
-		int num = 0;
-		int temp;
-		temp = (0x000000ff & (bytes[0])) << 0;
-		num = num | temp;
-		temp = (0x000000ff & (bytes[1])) << 8;
-		num = num | temp;
-		temp = (0x000000ff & (bytes[2])) << 16;
-		num = num | temp;
-		temp = (0x000000ff & (bytes[3])) << 24;
-		num = num | temp;
-		return num;
-	}
-
-	/**
-	 * 长整形转换成网络传输的字节流(字节数组)型数据
-	 * 
-	 * @param num
-	 *            一个长整型数据
-	 * @return 4个字节的自己数组
-	 */
-	public static byte[] longToBytes(long num) {
-		byte[] bytes = new byte[8];
-		for (int i = 0; i < 8; i++) {
-			bytes[i] = (byte) (0xff & (num >> (i * 8)));
-		}
-
-		return bytes;
-	}
-
-	/**
-	 * 大数字转换字节流(字节数组)型数据
-	 * 
-	 * @param n
-	 * @return
-	 */
-	public static byte[] byteConvert32Bytes(BigInteger n) {
-		byte tmpd[] = (byte[]) null;
-		if (n == null) {
-			return null;
-		}
-
-		if (n.toByteArray().length == 33) {
-			tmpd = new byte[32];
-			System.arraycopy(n.toByteArray(), 1, tmpd, 0, 32);
-		} else if (n.toByteArray().length == 32) {
-			tmpd = n.toByteArray();
-		} else {
-			tmpd = new byte[32];
-			for (int i = 0; i < 32 - n.toByteArray().length; i++) {
-				tmpd[i] = 0;
-			}
-			System.arraycopy(n.toByteArray(), 0, tmpd, 32 - n.toByteArray().length, n.toByteArray().length);
-		}
-		return tmpd;
-	}
-
-	/**
-	 * 换字节流(字节数组)型数据转大数字
-	 * 
-	 * @param b
-	 * @return
-	 */
-	public static BigInteger byteConvertInteger(byte[] b) {
-		if (b[0] < 0) {
-			byte[] temp = new byte[b.length + 1];
-			temp[0] = 0;
-			System.arraycopy(b, 0, temp, 1, b.length);
-			return new BigInteger(temp);
-		}
-		return new BigInteger(b);
-	}
-
-	/**
-	 * 根据字节数组获得值(十六进制数字)
-	 * 
-	 * @param bytes
-	 * @return
-	 */
-	public static String getHexString(byte[] bytes) {
-		return getHexString(bytes, true);
-	}
-
-	/**
-	 * 根据字节数组获得值(十六进制数字)
-	 * 
-	 * @param bytes
-	 * @param upperCase
-	 * @return
-	 */
-	public static String getHexString(byte[] bytes, boolean upperCase) {
-		StringBuffer ret = new StringBuffer();
-		for (int i = 0; i < bytes.length; i++) {
-			ret.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));
-		}
-		return upperCase ? ret.toString().toUpperCase() : ret.toString();
-	}
-
-	/**
-	 * 打印十六进制字符串
-	 * 
-	 * @param bytes
-	 */
-	public static void printHexString(byte[] bytes) {
-		for (int i = 0; i < bytes.length; i++) {
-			String hex = Integer.toHexString(bytes[i] & 0xFF);
-			if (hex.length() == 1) {
-				hex = '0' + hex;
-			}
-			System.out.print("0x" + hex.toUpperCase() + ",");
-		}
-		System.out.println("");
-	}
-
-	/**
-	 * Convert hex string to byte[]
-	 * 
-	 * @param hexString
-	 *            the hex string
-	 * @return byte[]
-	 */
-	public static byte[] hexStringToBytes(String hexString) {
-		if (hexString == null || hexString.equals("")) {
-			return null;
-		}
-
-		hexString = hexString.toUpperCase();
-		int length = hexString.length() / 2;
-		char[] hexChars = hexString.toCharArray();
-		byte[] d = new byte[length];
-		for (int i = 0; i < length; i++) {
-			int pos = i * 2;
-			d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
-		}
-		return d;
-	}
-
-	/**
-	 * Convert char to byte
-	 * 
-	 * @param c
-	 *            char
-	 * @return byte
-	 */
-	public static byte charToByte(char c) {
-		return (byte) "0123456789ABCDEF".indexOf(c);
-	}
-
-	/**
-	 * 用于建立十六进制字符的输出的小写字符数组
-	 */
-	private static final char[] DIGITS_LOWER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd',
-			'e', 'f' };
-
-	/**
-	 * 用于建立十六进制字符的输出的大写字符数组
-	 */
-	private static final char[] DIGITS_UPPER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
-			'E', 'F' };
-
-	public static final String[] BIN_String = { "0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000",
-			"1001", "1010", "1011", "1100", "1101", "1110", "1111" };
-
-	/**
-	 * 将字节数组转换为十六进制字符数组
-	 *
-	 * @param data
-	 *            byte[]
-	 * @return 十六进制char[]
-	 */
-	public static char[] encodeHex(byte[] data) {
-		return encodeHex(data, true);
-	}
-
-	/**
-	 * 将字节数组转换为十六进制字符数组
-	 *
-	 * @param data
-	 *            byte[]
-	 * @param toLowerCase
-	 *            <code>true</code> 传换成小写格式 , <code>false</code> 传换成大写格式
-	 * @return 十六进制char[]
-	 */
-	public static char[] encodeHex(byte[] data, boolean toLowerCase) {
-		return encodeHex(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER);
-	}
-
-	/**
-	 * 将字节数组转换为十六进制字符数组
-	 *
-	 * @param data
-	 *            byte[]
-	 * @param toDigits
-	 *            用于控制输出的char[]
-	 * @return 十六进制char[]
-	 */
-	protected static char[] encodeHex(byte[] data, char[] toDigits) {
-		return encodeHexString(data, toDigits).toCharArray();
-	}
-
-	/**
-	 * 将字节数组转换为十六进制字符串
-	 *
-	 * @param data
-	 *            byte[]
-	 * @return 十六进制String
-	 */
-	public static String encodeHexString(byte[] data) {
-		return encodeHexString(data, true);
-	}
-
-	/**
-	 * 将字节数组转换为十六进制字符串
-	 *
-	 * @param data
-	 *            byte[]
-	 * @param toLowerCase
-	 *            <code>true</code> 传换成小写格式 , <code>false</code> 传换成大写格式
-	 * @return 十六进制String
-	 */
-	public static String encodeHexString(byte[] data, boolean toLowerCase) {
-		return encodeHexString(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER);
-	}
-
-	/**
-	 * 将字节数组转换为十六进制字符串
-	 *
-	 * @param data
-	 *            byte[]
-	 * @param toDigits
-	 *            用于控制输出的char[]
-	 * @return 十六进制String
-	 */
-	protected static String encodeHexString(byte[] data, char[] toDigits) {
-		int l = data.length;
-		StringBuffer out = new StringBuffer();
-		for (int i = 0; i < l; i++) {
-			out.append(toDigits[(0xF0 & data[i]) >>> 4]);
-			out.append(toDigits[0x0F & data[i]]);
-		}
-		return out.toString();
-	}
-
-	/**
-	 * 将十六进制字符数组转换为字节数组
-	 *
-	 * @param data
-	 *            十六进制char[]
-	 * @return byte[]
-	 * @throws RuntimeException
-	 *             如果源十六进制字符数组是一个奇怪的长度,将抛出运行时异常
-	 */
-	public static byte[] decodeHex(char[] data) {
-		int len = data.length;
-
-		if ((len & 0x01) != 0) {
-			throw new RuntimeException("Odd number of characters.");
-		}
-
-		ByteArrayOutputStream out = new ByteArrayOutputStream();
-
-		for (int i = 0; i < len; i += 2) {
-			out.write(((toDigit(data[i], i) << 4) | toDigit(data[i + 1], i + 1)) & 0xff);
-		}
-		return out.toByteArray();
-	}
-
-	/**
-	 * 将十六进制字符转换成一个整数
-	 *
-	 * @param ch
-	 *            十六进制char
-	 * @param index
-	 *            十六进制字符在字符数组中的位置
-	 * @return 一个整数
-	 * @throws RuntimeException
-	 *             当ch不是一个合法的十六进制字符时,抛出运行时异常
-	 */
-	protected static int toDigit(char ch, int index) {
-		int digit = Character.digit(ch, 16);
-		if (digit == -1) {
-			throw new RuntimeException("Illegal hexadecimal character " + ch + " at index " + index);
-		}
-		return digit;
-	}
-
-	/**
-	 * 数字字符串转ASCII码字符串
-	 * 
-	 * @param String
-	 *            字符串
-	 * @return ASCII字符串
-	 */
-	public static String StringToAsciiString(String content) {
-		StringBuilder result = new StringBuilder();
-		for (char c : content.toCharArray()) {
-			result.append(Integer.toHexString(c));
-		}
-		return result.toString();
-	}
-
-	/**
-	 * 十六进制转字符串
-	 * 
-	 * @param hexString
-	 *            十六进制字符串
-	 * @param encodeType
-	 *            编码类型4:Unicode,2:普通编码
-	 * @return 字符串
-	 */
-	public static String hexStringToString(String hexString, int encodeType) {
-		StringBuilder result = new StringBuilder();
-		int max = hexString.length() / encodeType;
-		for (int i = 0; i < max; i++) {
-			char c = (char) hexStringToAlgorism(hexString.substring(i * encodeType, (i + 1) * encodeType));
-			result.append(c);
-		}
-		return result.toString();
-	}
-
-	/**
-	 * 十六进制字符串装十进制
-	 * 
-	 * @param hex
-	 *            十六进制字符串
-	 * @return 十进制数值
-	 */
-	public static int hexStringToAlgorism(String hex) {
-		return Integer.parseInt(hex, 16);
-	}
-
-	/**
-	 * 十六转二进制
-	 * 
-	 * @param hex
-	 *            十六进制字符串
-	 * @return 二进制字符串
-	 */
-	public static String hexStringToBinary(String hex) {
-		hex = hex.toUpperCase();
-		StringBuffer sb = new StringBuffer();
-		for (char c : hex.toCharArray()) {
-			sb.append(BIN_String[charToByte(c)]);
-		}
-		return sb.toString();
-	}
-
-	/**
-	 * ASCII码字符串转数字字符串
-	 * 
-	 * @param String
-	 *            ASCII字符串
-	 * @return 字符串
-	 */
-	public static String AsciiStringToString(String content) {
-		StringBuffer result = new StringBuffer();
-		int length = content.length() / 2;
-		for (int i = 0; i < length; i+=2) {
-			String c = content.substring(i, i + 2);
-			int a = hexStringToAlgorism(c);
-			char b = (char) a;
-			String d = String.valueOf(b);
-			result.append(d);
-		}
-		return result.toString();
-	}
-
-	/**
-	 * 将十进制转换为指定长度的十六进制字符串
-	 * 
-	 * @param algorism
-	 *            int 十进制数字
-	 * @param maxLength
-	 *            int 转换后的十六进制字符串长度
-	 * @return String 转换后的十六进制字符串
-	 */
-	public static String algorismToHexString(int algorism, int maxLength) {
-		String result = Integer.toHexString(algorism);
-
-		if (result.length() % 2 == 1) {
-			result = "0" + result;
-		}
-		return patchHexString(result.toUpperCase(), maxLength);
-	}
-
-	/**
-	 * 字节数组转为普通字符串(ASCII对应的字符)
-	 * 
-	 * @param bytearray
-	 *            byte[]
-	 * @return String
-	 */
-	public static String byteToString(byte[] bytearray) {
-		StringBuilder resultBuffer = new StringBuilder();
-		for (byte b : bytearray) {
-			resultBuffer.append(b);
-		}
-		return resultBuffer.toString();
-	}
-
-	/**
-	 * 二进制字符串转十进制
-	 * 
-	 * @param binary
-	 *            二进制字符串
-	 * @return 十进制数值
-	 */
-	public static int binaryToAlgorism(String binary) {
-		return Integer.parseInt(binary, 2);
-	}
-
-	/**
-	 * 十进制转换为十六进制字符串
-	 * 
-	 * @param algorism
-	 *            int 十进制的数字
-	 * @return String 对应的十六进制字符串
-	 */
-	public static String algorismToHEXString(int algorism) {
-		String result = Integer.toHexString(algorism);
-
-		if (result.length() % 2 == 1) {
-			result = "0" + result;
-
-		}
-		result = result.toUpperCase();
-		return result;
-	}
-
-	/**
-	 * HEX字符串前补0,主要用于长度位数不足。
-	 * 
-	 * @param str
-	 *            String 需要补充长度的十六进制字符串
-	 * @param maxLength
-	 *            int 补充后十六进制字符串的长度
-	 * @return 补充结果
-	 */
-	static public String patchHexString(String str, int maxLength) {
-		StringBuffer sb= new StringBuffer();
-		for (int i = 0; i < maxLength - str.length(); i++) {
-			sb.append("0");
-		}
-		str = (sb.toString() + str).substring(0, maxLength);
-		return str;
-	}
-
-	/**
-	 * 将一个字符串转换为int
-	 * 
-	 * @param s
-	 *            String 要转换的字符串
-	 * @param defaultInt
-	 *            int 如果出现异常,默认返回的数字
-	 * @param radix
-	 *            int 要转换的字符串是什么进制的,如16 8 10.
-	 * @return int 转换后的数字
-	 */
-	public static int parseToInt(String s, int defaultInt, int radix) {
-		int i = 0;
-		try {
-			i = Integer.parseInt(s, radix);
-		} catch (NumberFormatException ex) {
-			i = defaultInt;
-		}
-		return i;
-	}
-
-	/**
-	 * 将一个十进制形式的数字字符串转换为int
-	 * 
-	 * @param s
-	 *            String 要转换的字符串
-	 * @param defaultInt
-	 *            int 如果出现异常,默认返回的数字
-	 * @return int 转换后的数字
-	 */
-	public static int parseToInt(String s, int defaultInt) {
-		int i = 0;
-		try {
-			i = Integer.parseInt(s);
-		} catch (NumberFormatException ex) {
-			i = defaultInt;
-		}
-		return i;
-	}
-
-
-	public static byte[] subByte(byte[] input, int startIndex, int length) {
-		return Arrays.copyOfRange(input, startIndex, startIndex + length);
-	}
-}

+ 0 - 23
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/Params.java

@@ -1,23 +0,0 @@
-package com.logosdata.security.util;
-
-import java.math.BigInteger;
-
-/**
- * 国密办文件中推荐的椭圆曲线相关参数
- * @author Potato
- *
- */
-public class Params {
-	private static BigInteger n = new BigInteger(
-			"FFFFFFFE" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "7203DF6B" + "21C6052B" + "53BBF409" + "39D54123", 16);
-	private static BigInteger p = new BigInteger(
-			"FFFFFFFE" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "00000000" + "FFFFFFFF" + "FFFFFFFF", 16);
-	private static BigInteger a = new BigInteger(
-			"FFFFFFFE" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "00000000" + "FFFFFFFF" + "FFFFFFFC", 16);
-	private static BigInteger b = new BigInteger(
-			"28E9FA9E" + "9D9F5E34" + "4D5A9E4B" + "CF6509A7" + "F39789F5" + "15AB8F92" + "DDBCBD41" + "4D940E93", 16);
-	private static BigInteger gx = new BigInteger(
-			"32C4AE2C" + "1F198119" + "5F990446" + "6A39C994" + "8FE30BBF" + "F2660BE1" + "715A4589" + "334C74C7", 16);
-	private static BigInteger gy = new BigInteger(
-			"BC3736A2" + "F4F6779C" + "59BDCEE3" + "6B692153" + "D0A9877C" + "C62A4740" + "02DF32E5" + "2139F0A0", 16);
-}

+ 0 - 30
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/SM2KeyPair.java

@@ -1,30 +0,0 @@
-package com.logosdata.security.util;
-
-import org.bouncycastle.math.ec.ECPoint;
-
-import java.math.BigInteger;
-
-/**
- * SM2密钥对Bean
- * @author Potato
- *
- */
-public class SM2KeyPair {
-
-	private final ECPoint publicKey;
-	private final BigInteger privateKey;
-
-	public SM2KeyPair(ECPoint publicKey, BigInteger privateKey) {
-		this.publicKey = publicKey;
-		this.privateKey = privateKey;
-	}
-
-	public ECPoint getPublicKey() {
-		return publicKey;
-	}
-
-	public BigInteger getPrivateKey() {
-		return privateKey;
-	}
-
-}

+ 0 - 284
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/SM4Base.java

@@ -1,284 +0,0 @@
-package com.logosdata.security.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-
-public class SM4Base {
-	public static final int SM4_ENCRYPT = 1;
-
-	public static final int SM4_DECRYPT = 0;
-
-	private long GET_ULONG_BE(byte[] b, int i) {
-		long n = (long) (b[i] & 0xff) << 24 | (long) ((b[i + 1] & 0xff) << 16) | (long) ((b[i + 2] & 0xff) << 8)
-				| (long) (b[i + 3] & 0xff) & 0xffffffffL;
-		return n;
-	}
-
-	private void PUT_ULONG_BE(long n, byte[] b, int i) {
-		b[i] = (byte) (int) (0xFF & n >> 24);
-		b[i + 1] = (byte) (int) (0xFF & n >> 16);
-		b[i + 2] = (byte) (int) (0xFF & n >> 8);
-		b[i + 3] = (byte) (int) (0xFF & n);
-	}
-
-	private long SHL(long x, int n) {
-		return (x & 0xFFFFFFFF) << n;
-	}
-
-	private long ROTL(long x, int n) {
-		return SHL(x, n) | x >> (32 - n);
-	}
-
-	private void SWAP(long[] sk, int i) {
-		long t = sk[i];
-		sk[i] = sk[(31 - i)];
-		sk[(31 - i)] = t;
-	}
-
-	public static final byte[] SboxTable = { (byte) 0xd6, (byte) 0x90, (byte) 0xe9, (byte) 0xfe, (byte) 0xcc,
-			(byte) 0xe1, 0x3d, (byte) 0xb7, 0x16, (byte) 0xb6, 0x14, (byte) 0xc2, 0x28, (byte) 0xfb, 0x2c, 0x05, 0x2b,
-			0x67, (byte) 0x9a, 0x76, 0x2a, (byte) 0xbe, 0x04, (byte) 0xc3, (byte) 0xaa, 0x44, 0x13, 0x26, 0x49,
-			(byte) 0x86, 0x06, (byte) 0x99, (byte) 0x9c, 0x42, 0x50, (byte) 0xf4, (byte) 0x91, (byte) 0xef, (byte) 0x98,
-			0x7a, 0x33, 0x54, 0x0b, 0x43, (byte) 0xed, (byte) 0xcf, (byte) 0xac, 0x62, (byte) 0xe4, (byte) 0xb3, 0x1c,
-			(byte) 0xa9, (byte) 0xc9, 0x08, (byte) 0xe8, (byte) 0x95, (byte) 0x80, (byte) 0xdf, (byte) 0x94,
-			(byte) 0xfa, 0x75, (byte) 0x8f, 0x3f, (byte) 0xa6, 0x47, 0x07, (byte) 0xa7, (byte) 0xfc, (byte) 0xf3, 0x73,
-			0x17, (byte) 0xba, (byte) 0x83, 0x59, 0x3c, 0x19, (byte) 0xe6, (byte) 0x85, 0x4f, (byte) 0xa8, 0x68, 0x6b,
-			(byte) 0x81, (byte) 0xb2, 0x71, 0x64, (byte) 0xda, (byte) 0x8b, (byte) 0xf8, (byte) 0xeb, 0x0f, 0x4b, 0x70,
-			0x56, (byte) 0x9d, 0x35, 0x1e, 0x24, 0x0e, 0x5e, 0x63, 0x58, (byte) 0xd1, (byte) 0xa2, 0x25, 0x22, 0x7c,
-			0x3b, 0x01, 0x21, 0x78, (byte) 0x87, (byte) 0xd4, 0x00, 0x46, 0x57, (byte) 0x9f, (byte) 0xd3, 0x27, 0x52,
-			0x4c, 0x36, 0x02, (byte) 0xe7, (byte) 0xa0, (byte) 0xc4, (byte) 0xc8, (byte) 0x9e, (byte) 0xea, (byte) 0xbf,
-			(byte) 0x8a, (byte) 0xd2, 0x40, (byte) 0xc7, 0x38, (byte) 0xb5, (byte) 0xa3, (byte) 0xf7, (byte) 0xf2,
-			(byte) 0xce, (byte) 0xf9, 0x61, 0x15, (byte) 0xa1, (byte) 0xe0, (byte) 0xae, 0x5d, (byte) 0xa4, (byte) 0x9b,
-			0x34, 0x1a, 0x55, (byte) 0xad, (byte) 0x93, 0x32, 0x30, (byte) 0xf5, (byte) 0x8c, (byte) 0xb1, (byte) 0xe3,
-			0x1d, (byte) 0xf6, (byte) 0xe2, 0x2e, (byte) 0x82, 0x66, (byte) 0xca, 0x60, (byte) 0xc0, 0x29, 0x23,
-			(byte) 0xab, 0x0d, 0x53, 0x4e, 0x6f, (byte) 0xd5, (byte) 0xdb, 0x37, 0x45, (byte) 0xde, (byte) 0xfd,
-			(byte) 0x8e, 0x2f, 0x03, (byte) 0xff, 0x6a, 0x72, 0x6d, 0x6c, 0x5b, 0x51, (byte) 0x8d, 0x1b, (byte) 0xaf,
-			(byte) 0x92, (byte) 0xbb, (byte) 0xdd, (byte) 0xbc, 0x7f, 0x11, (byte) 0xd9, 0x5c, 0x41, 0x1f, 0x10, 0x5a,
-			(byte) 0xd8, 0x0a, (byte) 0xc1, 0x31, (byte) 0x88, (byte) 0xa5, (byte) 0xcd, 0x7b, (byte) 0xbd, 0x2d, 0x74,
-			(byte) 0xd0, 0x12, (byte) 0xb8, (byte) 0xe5, (byte) 0xb4, (byte) 0xb0, (byte) 0x89, 0x69, (byte) 0x97, 0x4a,
-			0x0c, (byte) 0x96, 0x77, 0x7e, 0x65, (byte) 0xb9, (byte) 0xf1, 0x09, (byte) 0xc5, 0x6e, (byte) 0xc6,
-			(byte) 0x84, 0x18, (byte) 0xf0, 0x7d, (byte) 0xec, 0x3a, (byte) 0xdc, 0x4d, 0x20, 0x79, (byte) 0xee, 0x5f,
-			0x3e, (byte) 0xd7, (byte) 0xcb, 0x39, 0x48 };
-
-	public static final int[] FK = { 0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc };
-
-	public static final int[] CK = { 0x00070e15, 0x1c232a31, 0x383f464d, 0x545b6269, 0x70777e85, 0x8c939aa1, 0xa8afb6bd,
-			0xc4cbd2d9, 0xe0e7eef5, 0xfc030a11, 0x181f262d, 0x343b4249, 0x50575e65, 0x6c737a81, 0x888f969d, 0xa4abb2b9,
-			0xc0c7ced5, 0xdce3eaf1, 0xf8ff060d, 0x141b2229, 0x30373e45, 0x4c535a61, 0x686f767d, 0x848b9299, 0xa0a7aeb5,
-			0xbcc3cad1, 0xd8dfe6ed, 0xf4fb0209, 0x10171e25, 0x2c333a41, 0x484f565d, 0x646b7279 };
-
-	private byte sm4Sbox(byte inch) {
-		int i = inch & 0xFF;
-		byte retVal = SboxTable[i];
-		return retVal;
-	}
-
-	private long sm4Lt(long ka) {
-		long bb = 0L;
-		long c = 0L;
-		byte[] a = new byte[4];
-		byte[] b = new byte[4];
-		PUT_ULONG_BE(ka, a, 0);
-		b[0] = sm4Sbox(a[0]);
-		b[1] = sm4Sbox(a[1]);
-		b[2] = sm4Sbox(a[2]);
-		b[3] = sm4Sbox(a[3]);
-		bb = GET_ULONG_BE(b, 0);
-		c = bb ^ ROTL(bb, 2) ^ ROTL(bb, 10) ^ ROTL(bb, 18) ^ ROTL(bb, 24);
-		return c;
-	}
-
-	private long sm4F(long x0, long x1, long x2, long x3, long rk) {
-		return x0 ^ sm4Lt(x1 ^ x2 ^ x3 ^ rk);
-	}
-
-	private long sm4CalciRK(long ka) {
-		long bb = 0L;
-		long rk = 0L;
-		byte[] a = new byte[4];
-		byte[] b = new byte[4];
-		PUT_ULONG_BE(ka, a, 0);
-		b[0] = sm4Sbox(a[0]);
-		b[1] = sm4Sbox(a[1]);
-		b[2] = sm4Sbox(a[2]);
-		b[3] = sm4Sbox(a[3]);
-		bb = GET_ULONG_BE(b, 0);
-		rk = bb ^ ROTL(bb, 13) ^ ROTL(bb, 23);
-		return rk;
-	}
-
-	private void sm4_setkey(long[] SK, byte[] key) {
-		long[] MK = new long[4];
-		long[] k = new long[36];
-		int i = 0;
-		MK[0] = GET_ULONG_BE(key, 0);
-		MK[1] = GET_ULONG_BE(key, 4);
-		MK[2] = GET_ULONG_BE(key, 8);
-		MK[3] = GET_ULONG_BE(key, 12);
-		k[0] = MK[0] ^ (long) FK[0];
-		k[1] = MK[1] ^ (long) FK[1];
-		k[2] = MK[2] ^ (long) FK[2];
-		k[3] = MK[3] ^ (long) FK[3];
-		long item = k[1]^k[2]^k[3];
-		for (; i < 32; i++) {
-			k[(i + 4)] = (k[i] ^ sm4CalciRK(item ^ (long) CK[i]));
-			SK[i] = k[(i + 4)];
-			item ^= k[i+4]^k[i+1];
-		}
-	}
-
-	private void sm4_one_round(long[] sk, byte[] input, byte[] output) {
-		int i = 0;
-		long[] ulbuf = new long[36];
-		ulbuf[0] = GET_ULONG_BE(input, 0);
-		ulbuf[1] = GET_ULONG_BE(input, 4);
-		ulbuf[2] = GET_ULONG_BE(input, 8);
-		ulbuf[3] = GET_ULONG_BE(input, 12);
-		while (i < 32) {
-			ulbuf[(i + 4)] = sm4F(ulbuf[i], ulbuf[(i + 1)], ulbuf[(i + 2)], ulbuf[(i + 3)], sk[i]);
-			i++;
-		}
-		PUT_ULONG_BE(ulbuf[35], output, 0);
-		PUT_ULONG_BE(ulbuf[34], output, 4);
-		PUT_ULONG_BE(ulbuf[33], output, 8);
-		PUT_ULONG_BE(ulbuf[32], output, 12);
-	}
-
-	private byte[] padding(byte[] input, int mode) {
-		if (input == null) {
-			return null;
-		}
-
-		byte[] ret = (byte[]) null;
-		if (mode == SM4_ENCRYPT) {
-			int p = 16 - input.length % 16;
-			ret = new byte[input.length + p];
-			System.arraycopy(input, 0, ret, 0, input.length);
-			for (int i = 0; i < p; i++) {
-				ret[input.length + i] = (byte) p;
-			}
-		} else {
-			int p = input[input.length - 1];
-			ret = new byte[input.length - p];
-			System.arraycopy(input, 0, ret, 0, input.length - p);
-		}
-		return ret;
-	}
-
-	public void sm4_setkey_enc(SM4_Context ctx, byte[] key) throws Exception {
-		if (ctx == null) {
-			throw new Exception("ctx is null!");
-		}
-
-		if (key == null || key.length != 16) {
-			throw new Exception("key error!");
-		}
-
-		ctx.mode = SM4_ENCRYPT;
-		sm4_setkey(ctx.sk, key);
-	}
-
-	public void sm4_setkey_dec(SM4_Context ctx, byte[] key) throws Exception {
-		if (ctx == null) {
-			throw new Exception("ctx is null!");
-		}
-
-		if (key == null || key.length != 16) {
-			throw new Exception("key error!");
-		}
-
-		int i = 0;
-		ctx.mode = SM4_DECRYPT;
-		sm4_setkey(ctx.sk, key);
-		for (i = 0; i < 16; i++) {
-			SWAP(ctx.sk, i);
-		}
-	}
-
-	public byte[] sm4_crypt_ecb(SM4_Context ctx, byte[] input) throws Exception {
-		if (input == null) {
-			throw new Exception("input is null!");
-		}
-
-		if ((ctx.isPadding) && (ctx.mode == SM4_ENCRYPT)) {
-			input = padding(input, SM4_ENCRYPT);
-		}
-
-		int length = input.length;
-		ByteArrayInputStream bins = new ByteArrayInputStream(input);
-		ByteArrayOutputStream bous = new ByteArrayOutputStream();
-		for (; length > 0; length -= 16) {
-			byte[] in = new byte[16];
-			byte[] out = new byte[16];
-			bins.read(in);
-			sm4_one_round(ctx.sk, in, out);
-			bous.write(out);
-		}
-
-		byte[] output = bous.toByteArray();
-		if (ctx.isPadding && ctx.mode == SM4_DECRYPT) {
-			output = padding(output, SM4_DECRYPT);
-		}
-		bins.close();
-		bous.close();
-		return output;
-	}
-
-	public byte[] sm4_crypt_cbc(SM4_Context ctx, byte[] iv, byte[] input) throws Exception {
-		if (iv == null || iv.length != 16) {
-			throw new Exception("iv error!");
-		}
-
-		if (input == null) {
-			throw new Exception("input is null!");
-		}
-
-		if (ctx.isPadding && ctx.mode == SM4_ENCRYPT) {
-			input = padding(input, SM4_ENCRYPT);
-		}
-
-		int i = 0;
-		int length = input.length;
-		ByteArrayInputStream bins = new ByteArrayInputStream(input);
-		ByteArrayOutputStream bous = new ByteArrayOutputStream();
-		if (ctx.mode == SM4_ENCRYPT) {
-			for (; length > 0; length -= 16) {
-				byte[] in = new byte[16];
-				byte[] out = new byte[16];
-				byte[] out1 = new byte[16];
-
-				bins.read(in);
-				for (i = 0; i < 16; i++) {
-					out[i] = ((byte) (in[i] ^ iv[i]));
-				}
-				sm4_one_round(ctx.sk, out, out1);
-				System.arraycopy(out1, 0, iv, 0, 16);
-				bous.write(out1);
-			}
-		} else {
-			byte[] temp = new byte[16];
-			for (; length > 0; length -= 16) {
-				byte[] in = new byte[16];
-				byte[] out = new byte[16];
-				byte[] out1 = new byte[16];
-
-				bins.read(in);
-				System.arraycopy(in, 0, temp, 0, 16);
-				sm4_one_round(ctx.sk, in, out);
-				for (i = 0; i < 16; i++) {
-					out1[i] = ((byte) (out[i] ^ iv[i]));
-				}
-				System.arraycopy(temp, 0, iv, 0, 16);
-				bous.write(out1);
-			}
-		}
-
-		byte[] output = bous.toByteArray();
-		if (ctx.isPadding && ctx.mode == SM4_DECRYPT) {
-			output = padding(output, SM4_DECRYPT);
-		}
-		bins.close();
-		bous.close();
-		return output;
-	}
-}

+ 0 - 15
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/SM4_Context.java

@@ -1,15 +0,0 @@
-package com.logosdata.security.util;
-
-public class SM4_Context {
-	public int mode;
-
-	public long[] sk;
-
-	public boolean isPadding;
-
-	public SM4_Context() {
-		this.mode = 1;
-		this.isPadding = true;
-		this.sk = new long[32];
-	}
-}

+ 0 - 164
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/SignUtils.java

@@ -1,164 +0,0 @@
-package com.logosdata.security.util;
-
-import com.alibaba.fastjson.JSONObject;
-import com.logosdata.security.SM2;
-import com.logosdata.security.SM3;
-import com.logosdata.security.SM4;
-import lombok.extern.slf4j.Slf4j;
-import org.bouncycastle.math.ec.ECPoint;
-
-import java.io.ByteArrayInputStream;
-import java.io.ObjectInputStream;
-import java.math.BigInteger;
-import java.util.Base64;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * {@code SignUtils} 签名工具类
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-18
- * @since ver.1.0.0
- */
-@Slf4j
-public final class SignUtils {
-
-	private SignUtils(){}
-
-	/**
-	 * 通用解密方法
-	 * @param json
-	 * @param secretKey
-	 * @return
-	 * @throws Exception
-	 */
-	public static String decryptData(String json, String secretKey) throws Exception {
-		JSONObject jsonObject = JSONObject.parseObject(json);
-		String decData = null;
-
-		SM4 sm4 = new SM4();
-		sm4.setSecretKey(secretKey);
-		sm4.setHexString(false);
-		// 响应业务报文data
-		String dataString =jsonObject.getString("data");
-		decData = sm4.decryptDataToString_ECB(dataString, "UTF-8");
-		// 响应签名sign
-		String signString = jsonObject.getString("sign");
-		byte[] sign = Base64.getDecoder().decode(signString.getBytes());
-		Object signature1 =toObject(sign);
-		log.info("签名:" + signature1.toString());
-		String[] arr = signature1.toString().split(",");
-		BigInteger r = new BigInteger(arr[0], 16);
-		BigInteger s = new BigInteger(arr[1], 16);
-		SM2.Signature signature = new SM2.Signature(r, s);
-		System.err.println(signature);
-
-		// sm2加密
-		SM2 sm2 = new SM2();
-		// 读取公钥
-		ECPoint publicKey = sm2.importPublicKey(getConfigPublicKey().get("publicKey").toString());
-		String IDA = "taxhelper";
-		log.info("签名信息:" + decData);
-		byte[] hash = SM3.hash(decData.getBytes("UTF-8"));
-		// 验签
-		boolean flag = sm2.verify(new String(hash), signature, IDA, publicKey);
-		System.out.println(flag);
-		if (flag) {
-			log.info("验证签名成功");
-			return decData;
-		} else {
-			log.info("验证签名失败");
-
-			// String errorMsg = "{\"message\":\"验证签名失败\"}";
-			String errorMsg = "验证签名失败";
-
-			throw new RuntimeException(errorMsg);
-		}
-	}
-
-	/**
-	 * 通用加密方法
-	 * @param param
-	 * @param secretKey
-	 * @return
-	 * @throws Exception
-	 */
-	public static Map<String, Object> encryptData(Map<String, Object> param, String secretKey) throws Exception {
-		Map<String, Object> newParam = new HashMap<>();
-		JSONObject jsonObject = new JSONObject();
-		jsonObject.putAll(param);
-		String decData = jsonObject.toString();
-
-		SM4 sm4 = new SM4();
-		// 加密密钥,由双方协定产生
-		sm4.setSecretKey(secretKey);
-		sm4.setHexString(false);
-
-		log.info("ECB模式加密");
-		String encData = sm4.encryptDataToString_ECB(decData, "UTF-8");
-		log.info("密文: " + encData);
-
-		byte[] hash = SM3.hash(decData.getBytes("UTF-8"));
-
-		SM2 sm2 = new SM2();
-		ECPoint publicKey = sm2.importPublicKey(getConfigPublicKey().get("publicKey").toString());
-		byte[] sign = sm2.encrypt(hash, publicKey);
-
-		newParam = new HashMap<>();
-		newParam.put("data", encData);
-		newParam.put("sign", Base64.getEncoder().encodeToString(sign));
-		log.info("data:" + encData);
-		log.info("sign:" + Base64.getEncoder().encodeToString(sign));
-		return newParam;
-	}
-
-	public static Object toObject(byte[] bytes) throws Exception {
-		Object obj = null;
-		try {
-			// bytearray to object
-			ByteArrayInputStream bi = new ByteArrayInputStream(bytes);
-			ObjectInputStream oi = new ObjectInputStream(bi);
-
-			obj = oi.readObject();
-			log.error("签名对象:", obj);
-			bi.close();
-			oi.close();
-		} catch (Exception e) {
-			System.out.println("translation" + e.getMessage());
-			e.printStackTrace();
-		}
-		return obj;
-	}
-
-	public static Map<String, Object> getConfigPublicKey() {
-		Map<String, Object> map = new HashMap<String, Object>();
-		Properties props = System.getProperties(); // 获得系统属性集
-		String osName = props.getProperty("os.name").toLowerCase(); // 操作系统名称
-		if (osName.indexOf("linux") != -1 || osName.indexOf("unix") != -1) {
-//			map.put("publicKey", "/home/logos/dzdk-api-gateway/publickey.pem");
-//			map.put("privateKey", "/home/logos/dzdk-api-gateway/privatekey.pem");
-//			map.put("publicKey", "/opt/wmproject/SBY-Secret/publickey.pem");
-//			map.put("privateKey", "/opt/wmproject/SBY-Secret/privatekey.pem");
-			map.put("publicKey", "/excel/publickey.pem");
-			map.put("privateKey", "/excel/privatekey.pem");
-		}
-		if (osName.indexOf("mac") != -1){
-			map.put("publicKey", "/Users/jimmy/Developer/repos/cert/taxhelpor/publickey.pem");
-			map.put("privateKey", "/Users/xuqiqi/IdeaProjects/logos/dzdk-api-gateway/privatekey.pem");
-		}
-		if (osName.indexOf("windows") != -1) {
-			// 开发测试
-			map.put("publicKey", "D:/publickey.pem");
-			map.put("privateKey", "D:/常用文本文件/代征代扣/封装接口资料/开发测试环境密钥/privatekey.pem");
-//            // 生产
-//            map.put("publicKey", "D:/常用文本文件/代征代扣/封装接口资料/生产环境密钥/publickey.pem");
-//            map.put("privateKey", "D:/常用文本文件/代征代扣/封装接口资料/生产环境密钥/privatekey.pem");
-		}
-		return map;
-	}
-
-
-}

+ 0 - 43
hnqz-common/hnqz-common-taxhelper/src/main/java/com/logosdata/security/util/StreamTool.java

@@ -1,43 +0,0 @@
-package com.logosdata.security.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class StreamTool {
-	public static byte[] readInputStream2ByteArray(InputStream inStream) throws IOException{
-		ByteArrayOutputStream outStream = new ByteArrayOutputStream();
-		byte[] buffer = new byte[1024];
-		int len=0;
-		while ((len=inStream.read(buffer))!=-1){
-			outStream.write(buffer,0,len);
-		}
-		return outStream.toByteArray();
-	}
-	public static String readInputStream2String(InputStream inStream) throws IOException{
-		ByteArrayOutputStream outStream = new ByteArrayOutputStream();
-		byte[] buffer = new byte[1024];
-		int len=0;
-		while ((len=inStream.read(buffer))!=-1){
-			outStream.write(buffer,0,len);
-		}
-		return outStream.toString();
-	}
-	public static File readInputStream2File(InputStream inStream ,File file) throws IOException{
-		@SuppressWarnings("resource")
-		FileOutputStream outStream = new FileOutputStream(file);
-		byte[] buffer = new byte[1024];
-		int len=0;
-		while ((len=inStream.read(buffer))!=-1){
-			outStream.write(buffer,0,len);
-		}
-		return file;
-	}
-	public static File readInputStream2File(InputStream inStream ,String filepath , String key) throws IOException{
-		File file = File.createTempFile(filepath, key);
-		return readInputStream2File(inStream ,file);
-		
-	}
-}

+ 0 - 24
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/TaxHelperAutoConfiguration.java

@@ -1,24 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.service.TaxHelperService;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.context.annotation.Bean;
-import org.springframework.web.client.RestTemplate;
-
-/**
- * {@code TaxHelperAutoConfiguration} 类
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-18
- * @since ver.1.0.0
- */
-public class TaxHelperAutoConfiguration {
-
-	@Bean
-	@ConditionalOnMissingBean(value = TaxHelperService.class)
-	public TaxHelperService taxHelperService(){
-		return new TaxHelperService();
-	}
-
-}

+ 0 - 20
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/annotation/TaxHelper.java

@@ -1,20 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * 税邦云注解,用于表示方法,方便AOP拦截
- */
-@Target(value = {ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface TaxHelper {
-
-	/**
-	 * 说明
-	 * @return
-	 */
-	String value() default "";
-}

+ 0 - 62
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/common/CommonConstants.java

@@ -1,62 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.common;
-
-/**
- * {@code CommonConstants} 接口用户定义全局变量
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-22
- * @since ver.1.0.0
- */
-public interface CommonConstants {
-
-	/**
-	 * 登录时间参数格式化格式模板
-	 */
-	String LOGIN_DATE_TIME_FORMAT_PATTERN = "yyyyMMddHHmmss";
-	String DEFAULT_DATE_TIME_FORMAT_PATTERN = "yyyy-MM-dd HH:mm:ss";
-
-	//~=======================================[ 状态码常量 ]=========================================
-	/**
-	 * 成功
-	 */
-	int SUCCESS_CODE = 2000;
-
-	/**
-	 * 客户端问题失败
-	 */
-	int CLIENT_ERROR_CODE = 4000;
-
-	/**
-	 * 服务端问题失败
-	 */
-	int SERVER_ERROR_CODE = 5000;
-
-	/**
-	 * E证通上次认证结果(成功)
-	 */
-	int LAST_STATUS_SUCCESS_CODE = 1;
-
-	/**
-	 * E证通上次认证结果(失败)
-	 */
-	int LAST_STATUS_FAILURE_CODE = 0;
-
-	//~=======================================[ 认证结果信息 ]=========================================
-
-	String NO_RES_MSG = "无";
-	String ALREADY_CERT_SUCCESSFUL = "该人员已实名认证成功";
-	String ALREADY_ADD_MEMBER_SUCCESSFUL = "此会员已在统一社会社用代码为%s的企业下存在";
-
-	//~=======================================[ 服务方法名称 ]=========================================
-
-	/**
-	 * 操作方法
-	 */
-	String ADD_MEMBER_METHOD = "税邦云增员方法";
-	String H5_TOKEN_METHOD = "税邦云H5TOKEN方法";
-	String BINDING_CARD_CODE_METHOD = "税邦云绑卡验证码";
-	String ACK_BINDING_CARD_METHOD = "税邦云绑卡确认";
-	String USER_AGREEMENT_TEXT_METHOD = "用户协议文本方法";
-	String USER_AGREEMENT_SIGNATURE_METHOD = "用户签约方法";
-}

+ 0 - 32
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/config/TaxHelperConfig.java

@@ -1,32 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.config;
-
-import lombok.Data;
-
-/**
- * {@code TaxHelperConfig} 税邦云配置
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-18
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperConfig {
-
-	/**
-	 * app id
-	 */
-	private String appId;
-
-	/**
-	 * app secrete
-	 */
-	private String appSecrete;
-
-	/**
-	 * url
-	 */
-	private String queryUrl;
-
-
-}

+ 0 - 30
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/EncryptLoginInfo.java

@@ -1,30 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import lombok.Data;
-
-import java.util.Base64;
-
-/**
- * {@code EncryptLoginInfo} 类登录加密参数
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-23
- * @since ver.1.0.0
- */
-@Data
-public class EncryptLoginInfo extends TaxHelperModel {
-
-	private static final long serialVersionUID = -6028459062639673570L;
-
-	private final String data;
-	private final String sign;
-	private final String key;
-
-	public EncryptLoginInfo(String data, byte[] sign, byte[] key, String appId) {
-		this.data = data;
-		this.sign = Base64.getEncoder().encodeToString(sign);
-		this.key = Base64.getEncoder().encodeToString(key);
-		this.appId = appId;
-	}
-}

+ 0 - 65
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperAddMemberModel.java

@@ -1,65 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-import lombok.Getter;
-
-/**
- * {@code TaxHelperAddMemberModel} 类增员model
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-22
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperAddMemberModel extends TaxHelperModel {
-
-	private static final long serialVersionUID = -7620192525029595859L;
-
-	// 企业信用代码
-	private String enterpriseCode;
-
-	// 会员名称
-	private String name;
-
-	// 人员类型
-	private Integer type;
-
-	// 会员证件类型(固定值):1->身份证
-	private final Integer cardType;
-
-	// 身份证号
-	private String idCard;
-
-	// 手机号
-	private String phone;
-
-	// 邮箱(固定值)
-	private final String email;
-
-	// 地址(固定值)
-	private final String address;
-
-	// 回调接口
-	private String notifyUrl;
-
-	// 支付通道(固定值):1->银行卡
-	private final Integer payChannel;
-
-	// 支付卡号(平安银行使用)
-	private String payAccount;
-
-	public TaxHelperAddMemberModel(TaxHelperConfig taxHelperConfig) {
-		this.appId = taxHelperConfig.getAppId();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-		// 身份证
-		this.cardType = 1;
-		this.email = "taxhelper@yaoyi.net";
-		this.address = "北京";
-		// 银行卡
-		this.payChannel = 1;
-	}
-
-}

+ 0 - 37
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperAppletBizTokenModel.java

@@ -1,37 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-
-
-/**
- * {@code TaxHelperAppletBizTokenModel} 微信小程序token获取model
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-22
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperAppletBizTokenModel extends TaxHelperModel {
-
-	private static final long serialVersionUID = -1708106472881176225L;
-
-	/**
-	 * 身份证号
-	 */
-	private String idCard;
-
-	/**
-	 * 回调地址
-	 */
-	private String notifyUrl;
-
-	public TaxHelperAppletBizTokenModel(TaxHelperConfig taxHelperConfig){
-		this.appId = taxHelperConfig.getAppId();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-	}
-
-
-}

+ 0 - 26
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperAppletCheckFaceModel.java

@@ -1,26 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-
-/**
- * {@code TaxHelperAppletCheckFaceModel} 小程序认证model
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-03-01
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperAppletCheckFaceModel extends TaxHelperModel {
-
-	private static final long serialVersionUID = -535499912852093824L;
-
-	String token;
-
-	public TaxHelperAppletCheckFaceModel(TaxHelperConfig taxHelperConfig){
-		this.appId = taxHelperConfig.getAppId();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-	}
-}

+ 0 - 36
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperBindingCardConfirmModel.java

@@ -1,36 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-
-/**
- * {@code TaxHelperBindingCardConfirmModel} 确认绑卡model
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-22
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperBindingCardConfirmModel extends TaxHelperModel{
-
-	private static final long serialVersionUID = 8398378169078855852L;
-
-	// 身份证号
-	private String idCard;
-
-	// 银行卡号
-	private String payAccount;
-
-	// 验证码(6位)
-	private String verificationCode;
-
-	// 回调地址
-	private String notifyUrl;
-
-	public TaxHelperBindingCardConfirmModel(TaxHelperConfig taxHelperConfig) {
-		this.appId = taxHelperConfig.getAppId();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-	}
-}

+ 0 - 33
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperBindingCardVerificationModel.java

@@ -1,33 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-
-/**
- * {@code TaxHelperBindingCardVerificationModel} 绑卡时获取验证码model
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-22
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperBindingCardVerificationModel extends TaxHelperModel{
-
-	private static final long serialVersionUID = 3683744599482273750L;
-
-	// 身份证号
-	private String idCard;
-
-	// 银行卡号
-	private String payAccount;
-
-	// 绑定的手机号
-	private String payAccountPhone;
-
-	public TaxHelperBindingCardVerificationModel(TaxHelperConfig taxHelperConfig){
-		this.appId = taxHelperConfig.getAppId();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-	}
-}

+ 0 - 31
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperECheckModel.java

@@ -1,31 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-import lombok.Getter;
-
-/**
- * {@code TaxHelperECheckModel} 小程序根据token查询E证通认证结果MODEL
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-06-08
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperECheckModel extends TaxHelperModel {
-
-	private static final long serialVersionUID = 7675884361217719910L;
-
-	String token;
-
-	@Getter
-	private final String merchantId;
-
-	public TaxHelperECheckModel(TaxHelperConfig taxHelperConfig){
-		this.appId = taxHelperConfig.getAppId();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-		this.merchantId = "0NSJ2104091559324068";
-	}
-}

+ 0 - 42
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperEidTokenModel.java

@@ -1,42 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-import lombok.Getter;
-
-
-/**
- * {@code TaxHelperAppletBizTokenModel} 微信e政通人脸核身获取token
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-06-07
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperEidTokenModel extends TaxHelperModel {
-
-	private static final long serialVersionUID = 2900768927090608155L;
-
-	/**
-	 * 身份证号
-	 */
-	private String idCard;
-
-	/**
-	 * 	EID商户id
-	 */
-	@Getter
-	final String merchantId;
-
-
-	public TaxHelperEidTokenModel(TaxHelperConfig taxHelperConfig){
-		this.appId = taxHelperConfig.getAppId();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-		// this.merchantId = "0NSJ2104091559324068";
-		this.merchantId = "0NSJ2201061648099814";
-	}
-
-
-}

+ 0 - 31
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperGetUserAgreementModel.java

@@ -1,31 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * {@code TaxHelperGetUserAgreementModel}
- * <p>
- * 获取用户协议内容模型
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021/08/09 16:24:37
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class TaxHelperGetUserAgreementModel extends TaxHelperModel {
-	private static final long serialVersionUID = 3735101469690170491L;
-
-	/**
-	 * 企业的统一社会信用代码
-	 */
-	private String enterpriseCode;
-
-	public TaxHelperGetUserAgreementModel(TaxHelperConfig config){
-		this.appId = config.getAppId();
-		this.appSecrete = config.getAppSecrete();
-		this.queryUrl = config.getQueryUrl();
-	}
-}

+ 0 - 42
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperH5BizTokenModel.java

@@ -1,42 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-
-
-/**
- * {@code TaxHelperH5BizTokenModel} H5 token获取model
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-22
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperH5BizTokenModel extends TaxHelperModel {
-
-	private static final long serialVersionUID = -1708106472881176225L;
-
-	/**
-	 * 身份证号
-	 */
-	private String idCard;
-
-	/**
-	 * 用户完成或取消验证后网页跳转的目标URL。(回调方法为Post)
-	 */
-	private String returnUrl;
-
-	/**
-	 * 回调地址
-	 */
-	private String notifyUrl;
-
-	public TaxHelperH5BizTokenModel(TaxHelperConfig taxHelperConfig){
-		this.appId = taxHelperConfig.getAppId();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-	}
-
-
-}

+ 0 - 41
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperLoginModel.java

@@ -1,41 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.common.CommonConstants;
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Getter;
-
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-
-/**
- * {@code TaxHelperLoginModel} 登录model
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-22
- * @since ver.1.0.0
- */
-@Getter
-public class TaxHelperLoginModel extends TaxHelperModel {
-
-	private static final long serialVersionUID = -1575146161143142084L;
-
-	/**
-	 * 登录时间
-	 */
-	private final String time;
-
-	/**
-	 * query url
-	 */
-	private final String queryUrl;
-
-	public TaxHelperLoginModel(TaxHelperConfig taxHelperConfig) {
-		this.appId = taxHelperConfig.getAppId();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		DateTimeFormatter df = DateTimeFormatter.ofPattern(CommonConstants.LOGIN_DATE_TIME_FORMAT_PATTERN);
-		this.time = df.format(LocalDateTime.now());
-	}
-
-}

+ 0 - 35
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperModel.java

@@ -1,35 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * {@code TaxHelperModel} class is Base Data Structure
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-22
- * @since ver.1.0.0
- */
-@Data
-public abstract class TaxHelperModel implements Serializable {
-
-	private static final long serialVersionUID = -8165614947827381458L;
-
-	/**
-	 * app id
-	 */
-	protected String appId;
-
-	/**
-	 * app secrete
-	 */
-	protected String appSecrete;
-
-	/**
-	 * query url
-	 */
-	protected String queryUrl;
-
-}

+ 0 - 93
hnqz-common/hnqz-common-taxhelper/src/main/java/com/qunzhixinxi/hnqz/common/taxhelper/entity/model/TaxHelperSettlementModel.java

@@ -1,93 +0,0 @@
-package com.qunzhixinxi.hnqz.common.taxhelper.entity.model;
-
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * {@code TaxHelperSettlementModel} 结算model
- *
- * @author Hengchen.Sun
- * @version 1.0.0
- * @date 2021-02-22
- * @since ver.1.0.0
- */
-@Data
-public class TaxHelperSettlementModel extends TaxHelperModel {
-	private static final long serialVersionUID = 3367994202968726174L;
-
-	// 企业信用代码
-	private String enterpriseCode;
-
-	// 扩展字段名称,用于对应业务摘要中扩展字段名称
-	private List<String> extendFieldNames;
-
-	// 结算清单列表
-	private List<DetailedArr> detailedArr;
-
-	// 业务摘要列表
-	private List<AbstractArr> abstractArr;
-
-	// 结算人员数
-	private Integer count;
-
-	// 回调接口
-	private String notifyUrl;
-
-	public TaxHelperSettlementModel(TaxHelperConfig taxHelperConfig) {
-		this.appId = taxHelperConfig.getAppId();
-		this.appSecrete = taxHelperConfig.getAppSecrete();
-		this.queryUrl = taxHelperConfig.getQueryUrl();
-	}
-
-	// 结算清单
-	@Data
-	public static class DetailedArr implements Serializable {
-
-		private static final long serialVersionUID = -1682151136227573346L;
-
-		// 身份证号
-		private String idCard;
-
-		// 人员类别与发表对应.xlsx
-		private String categoryName;
-
-		// 结算金额
-		private Double inputAmount;
-
-
-	}
-
-	// 业务摘要
-	@Data
-	public static class AbstractArr implements Serializable{
-		private static final long serialVersionUID = 1750808233582651712L;
-
-		//身份证号
-		private String idCard;
-
-		// 货物单价
-		private Double price;
-
-		// 货物数量
-		private Integer number;
-
-		// 合计
-		private Double amount;
-
-		// 扩展字段(10)
-		private String extendField1;
-		private String extendField2;
-		private String extendField3;
-		private String extendField4;
-		private String extendField5;
-		private String extendField6;
-		private String extendField7;
-		private String extendField8;
-		private String extendField9;
-		private String extendField10;
-
-	}
-}

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov