Browse Source

update

main
wangshaoping 10 months ago
parent
commit
2fe4b3ae9d
  1. 22
      app.platform/build.gradle
  2. 6
      erm.frontend/package.json
  3. 6
      gradle.properties
  4. 4
      io.sc.engine.mv.frontend/package.json
  5. 4
      io.sc.engine.rule.frontend/package.json
  6. 2
      io.sc.platform.core.frontend/package.json
  7. 2
      io.sc.platform.core.frontend/src/components/index.ts
  8. 24
      io.sc.platform.core.frontend/src/platform/components/progress/WProgressBtn.vue
  9. 2
      io.sc.platform.core.frontend/src/platform/index.ts
  10. 28
      io.sc.platform.core.frontend/src/platform/plugin/axios.ts
  11. 2
      io.sc.platform.core.frontend/src/platform/plugin/index.ts
  12. 3
      io.sc.platform.core.frontend/src/platform/plugin/manager/I18nMessageManager.ts
  13. 8
      io.sc.platform.core.frontend/src/platform/utils/Downloader.ts
  14. 2
      io.sc.platform.core.frontend/src/routes/routes.json
  15. 203
      io.sc.platform.core.frontend/src/views/exportdata.vue
  16. 4
      io.sc.platform.core.frontend/template-project/package.json
  17. 9
      io.sc.platform.core/src/main/java/io/sc/platform/core/enums/ProgressStatus.java
  18. 4
      io.sc.platform.core/src/main/java/io/sc/platform/core/exception/ProgressableThreadIsNullException.java
  19. 5
      io.sc.platform.core/src/main/java/io/sc/platform/core/exception/ProgressableThreadIsRunningException.java
  20. 4
      io.sc.platform.core/src/main/java/io/sc/platform/core/exception/ProgressableThreadNameIsNullException.java
  21. 4
      io.sc.platform.core/src/main/java/io/sc/platform/core/exception/ProgressableThreadNotExistsException.java
  22. 10
      io.sc.platform.core/src/main/java/io/sc/platform/core/service/ProgressableThreadService.java
  23. 68
      io.sc.platform.core/src/main/java/io/sc/platform/core/service/impl/ProgressableThreadServiceImpl.java
  24. 34
      io.sc.platform.core/src/main/java/io/sc/platform/core/support/ProgressInfo.java
  25. 12
      io.sc.platform.core/src/main/java/io/sc/platform/core/support/ProgressableThread.java
  26. 4
      io.sc.platform.core/src/main/java/io/sc/platform/core/util/ValidatorUtil.java
  27. 5
      io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties
  28. 5
      io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties
  29. 5
      io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties
  30. 235
      io.sc.platform.developer.doc/asciidoc/bank-business/bank-business.adoc
  31. 4
      io.sc.platform.developer.doc/asciidoc/index.adoc
  32. BIN
      io.sc.platform.developer.doc/asciidoc/resources/files/bank-business/银行业务分类.xmind
  33. BIN
      io.sc.platform.developer.doc/asciidoc/resources/images/bank-business/001.png
  34. 4
      io.sc.platform.developer.frontend/package.json
  35. 195
      io.sc.platform.developer.frontend/src/views/backend/ExportLiquibase.vue
  36. 2
      io.sc.platform.gradle/templates/pgp/app/build.gradle
  37. 6
      io.sc.platform.gradle/templates/pgp/setup/gradle.properties
  38. 12
      io.sc.platform.installer/src/main/java/io/sc/platform/installer/controller/InstallerWebController.java
  39. 9
      io.sc.platform.installer/src/main/java/io/sc/platform/installer/service/InstallerService.java
  40. 39
      io.sc.platform.installer/src/main/java/io/sc/platform/installer/service/impl/InstallerServiceImpl.java
  41. 47
      io.sc.platform.installer/src/main/java/io/sc/platform/installer/support/InstallerProgressableThread.java
  42. 9
      io.sc.platform.jdbc.liquibase/src/main/java/io/sc/platform/jdbc/liquibase/exporter/LiquibaseDataCsvExporter.java
  43. 3
      io.sc.platform.jdbc.liquibase/src/main/java/io/sc/platform/jdbc/liquibase/importer/LiquibaseDataCsvImporter.java
  44. 55
      io.sc.platform.jdbc/src/main/java/io/sc/platform/jdbc/controller/JdbcDataWebController.java
  45. 23
      io.sc.platform.jdbc/src/main/java/io/sc/platform/jdbc/controller/support/ExporterThread.java
  46. 24
      io.sc.platform.jdbc/src/main/java/io/sc/platform/jdbc/controller/support/ImporterThread.java
  47. 4
      io.sc.platform.lcdp.frontend/package.json
  48. 4
      io.sc.platform.mvc.frontend/package.json
  49. 15
      io.sc.platform.mvc/src/main/java/io/sc/platform/mvc/controller/DownloaderController.java
  50. 20
      io.sc.platform.mvc/src/main/java/io/sc/platform/mvc/support/FileDownloader.java
  51. 6
      io.sc.platform.mvc/src/main/resources/META-INF/platform/plugins/application-properties.json
  52. 4
      io.sc.platform.security.frontend/package.json
  53. 4
      io.sc.platform.system.frontend/package.json
  54. 46
      io.sc.standard.api/src/main/java/io/sc/standard/api/AdminDivisionVo.java
  55. 60
      io.sc.standard.api/src/main/java/io/sc/standard/api/CounterpartyVo.java
  56. 131
      io.sc.standard.api/src/main/java/io/sc/standard/api/CountryVo.java
  57. 51
      io.sc.standard.api/src/main/java/io/sc/standard/api/CurrencyVo.java
  58. 28
      io.sc.standard.api/src/main/java/io/sc/standard/api/IndustryVo.java
  59. 60
      io.sc.standard.api/src/main/java/io/sc/standard/api/PerformanceStatusVo.java
  60. 4
      io.sc.standard.frontend/package.json
  61. 51
      io.sc.standard.frontend/src/i18n/messages.json
  62. 51
      io.sc.standard.frontend/src/i18n/messages_tw_CN.json
  63. 51
      io.sc.standard.frontend/src/i18n/messages_zh_CN.json
  64. 59
      io.sc.standard.frontend/src/views/Standard.vue
  65. 109
      io.sc.standard.frontend/src/views/standard/AdminDivision.vue
  66. 79
      io.sc.standard.frontend/src/views/standard/Counterparty.vue
  67. 274
      io.sc.standard.frontend/src/views/standard/Country.vue
  68. 72
      io.sc.standard.frontend/src/views/standard/Currency.vue
  69. 90
      io.sc.standard.frontend/src/views/standard/GB_T_2260_2007.vue
  70. 90
      io.sc.standard.frontend/src/views/standard/GB_T_4754_2017.vue
  71. 109
      io.sc.standard.frontend/src/views/standard/Industry.vue
  72. 79
      io.sc.standard.frontend/src/views/standard/PerformanceStatus.vue
  73. 2
      io.sc.standard/src/main/java/io/sc/standard/controller/AdminDivisionWebController.java
  74. 27
      io.sc.standard/src/main/java/io/sc/standard/controller/CounterpartyWebController.java
  75. 27
      io.sc.standard/src/main/java/io/sc/standard/controller/CountryWebController.java
  76. 26
      io.sc.standard/src/main/java/io/sc/standard/controller/CurrencyWebController.java
  77. 11
      io.sc.standard/src/main/java/io/sc/standard/controller/IndustryWebController.java
  78. 29
      io.sc.standard/src/main/java/io/sc/standard/controller/PerformanceStatusWebController.java
  79. 56
      io.sc.standard/src/main/java/io/sc/standard/jpa/entity/AdminDivisionEntity.java
  80. 118
      io.sc.standard/src/main/java/io/sc/standard/jpa/entity/BusinessCategoryEntity.java
  81. 108
      io.sc.standard/src/main/java/io/sc/standard/jpa/entity/CounterpartyEntity.java
  82. 224
      io.sc.standard/src/main/java/io/sc/standard/jpa/entity/CountryEntity.java
  83. 99
      io.sc.standard/src/main/java/io/sc/standard/jpa/entity/CurrencyEntity.java
  84. 47
      io.sc.standard/src/main/java/io/sc/standard/jpa/entity/IndustryEntity.java
  85. 110
      io.sc.standard/src/main/java/io/sc/standard/jpa/entity/PerformanceStatusEntity.java
  86. 2
      io.sc.standard/src/main/java/io/sc/standard/jpa/repository/AdminDivisionRepository.java
  87. 10
      io.sc.standard/src/main/java/io/sc/standard/jpa/repository/CounterpartyRepository.java
  88. 10
      io.sc.standard/src/main/java/io/sc/standard/jpa/repository/CountryRepository.java
  89. 10
      io.sc.standard/src/main/java/io/sc/standard/jpa/repository/CurrencyRepository.java
  90. 4
      io.sc.standard/src/main/java/io/sc/standard/jpa/repository/IndustryRepository.java
  91. 10
      io.sc.standard/src/main/java/io/sc/standard/jpa/repository/PerformanceStatusRepository.java
  92. 55
      io.sc.standard/src/main/java/io/sc/standard/plugins/PluginManager.java
  93. 12
      io.sc.standard/src/main/java/io/sc/standard/plugins/PluginSpiServiceImpl.java
  94. 17
      io.sc.standard/src/main/java/io/sc/standard/plugins/item/DataStandard.java
  95. 8
      io.sc.standard/src/main/java/io/sc/standard/service/CounterpartyService.java
  96. 8
      io.sc.standard/src/main/java/io/sc/standard/service/CountryService.java
  97. 8
      io.sc.standard/src/main/java/io/sc/standard/service/CurrencyService.java
  98. 2
      io.sc.standard/src/main/java/io/sc/standard/service/IndustryService.java
  99. 8
      io.sc.standard/src/main/java/io/sc/standard/service/PerformanceStatusService.java
  100. 2
      io.sc.standard/src/main/java/io/sc/standard/service/impl/AdminDivisionServiceImpl.java

22
app.platform/build.gradle

@ -15,17 +15,17 @@ dependencies {
project(":io.sc.platform.developer"), project(":io.sc.platform.developer"),
project(":io.sc.platform.security.loginform"), project(":io.sc.platform.security.loginform"),
project(":io.sc.engine.mv"), // project(":io.sc.engine.mv"),
project(":io.sc.engine.mv.frontend"), // project(":io.sc.engine.mv.frontend"),
project(":io.sc.engine.mv.sample"), // project(":io.sc.engine.mv.sample"),
//
project(":io.sc.engine.rule.client"), // project(":io.sc.engine.rule.client"),
project(":io.sc.engine.rule.client.spring"), // project(":io.sc.engine.rule.client.spring"),
project(":io.sc.engine.rule.core"), // project(":io.sc.engine.rule.core"),
project(":io.sc.engine.rule.server"), // project(":io.sc.engine.rule.server"),
project(":io.sc.engine.rule.sample"), // project(":io.sc.engine.rule.sample"),
//
project(":erm"), // project(":erm"),
// project(":erm"), // project(":erm"),
// project(":erm.frontend"), // project(":erm.frontend"),

6
erm.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "erm.frontend", "name": "erm.frontend",
"version": "8.1.36", "version": "8.1.37",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.182",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",
@ -100,4 +100,4 @@
"vue-i18n": "9.8.0", "vue-i18n": "9.8.0",
"vue-router": "4.2.5" "vue-router": "4.2.5"
} }
} }

6
gradle.properties

@ -36,9 +36,9 @@ application_version=1.0.0
# platform # platform
########################################################### ###########################################################
platform_group=io.sc platform_group=io.sc
platform_version=8.1.36 platform_version=8.1.37
platform_plugin_version=8.1.13 platform_plugin_version=8.1.13
platform_core_frontend_version=8.1.180 platform_core_frontend_version=8.1.182
########################################################### ###########################################################
# dependencies version # dependencies version
@ -62,7 +62,7 @@ jxls_jexcel_version=1.0.7
jxls_poi_version=1.0.15 jxls_poi_version=1.0.15
jxls_version=2.4.6 jxls_version=2.4.6
mybatis_version=3.5.10 mybatis_version=3.5.10
ooxml_schemas_version=4.1.2 ooxml_schemas_version=1.4
opencsv_version=5.7.1 opencsv_version=5.7.1
oshi_version=6.4.2 oshi_version=6.4.2
p6spy_version=3.9.1 p6spy_version=3.9.1

4
io.sc.engine.mv.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "io.sc.engine.mv.frontend", "name": "io.sc.engine.mv.frontend",
"version": "8.1.36", "version": "8.1.37",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.182",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

4
io.sc.engine.rule.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "io.sc.engine.rule.frontend", "name": "io.sc.engine.rule.frontend",
"version": "8.1.36", "version": "8.1.37",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.182",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

2
io.sc.platform.core.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "platform-core", "name": "platform-core",
"version": "8.1.180", "version": "8.1.187",
"description": "前端核心包,用于快速构建前端的脚手架", "description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件", "//main": "库的主文件",
"main": "dist/platform-core.js", "main": "dist/platform-core.js",

2
io.sc.platform.core.frontend/src/components/index.ts

@ -2,7 +2,7 @@
* , * ,
*/ */
import component_testcase_formElements from '@/views/FormElements.vue'; import component_testcase_formElements from '@/views/exportdata.vue';
import component_testcase_likmDialog from '@/views/likm/Dialog.vue'; import component_testcase_likmDialog from '@/views/likm/Dialog.vue';
import component_testcase_likmDrawer from '@/views/likm/Drawer.vue'; import component_testcase_likmDrawer from '@/views/likm/Drawer.vue';
import component_testcase_likmForm from '@/views/likm/Form.vue'; import component_testcase_likmForm from '@/views/likm/Form.vue';

24
io.sc.platform.core.frontend/src/platform/components/progress/WProgressBtn.vue

@ -11,12 +11,17 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, useAttrs, onMounted } from 'vue'; import { ref, useAttrs, onMounted } from 'vue';
import { axios, Environment } from '@/platform'; import { axios, noErrorAxios, Environment } from '@/platform';
const props = defineProps({ const props = defineProps({
dataUrl: { type: String, default: '' }, dataUrl: { type: String, default: '' },
interval: { type: Number, default: 1000 }, interval: { type: Number, default: 1000 },
}); });
const emit = defineEmits<{
//
(e: 'success', progressInfo: any): void;
}>();
const attrs = useAttrs(); const attrs = useAttrs();
const showRef = ref(false); const showRef = ref(false);
@ -28,19 +33,18 @@ const refreshProgress = () => {
axios axios
.get(Environment.apiContextPath(props.dataUrl)) .get(Environment.apiContextPath(props.dataUrl))
.then((response) => { .then((response) => {
if (response?.data?.running) { const progressInfo = response.data;
const progressInfo = response.data; if (response?.data?.status === 'COMPLETED') {
stop();
emit('success', progressInfo);
} else if (response?.data?.status === 'RUNNING') {
percentageRef.value = (progressInfo.currentWeight / progressInfo.totalWeight) * 100; percentageRef.value = (progressInfo.currentWeight / progressInfo.totalWeight) * 100;
messageRef.value = progressInfo.messageKey; messageRef.value = progressInfo.messageKey;
if (percentageRef.value >= 100) {
setTimeout(stop, 1000);
}
} else { } else {
stop(); stop();
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error);
stop(); stop();
}); });
}; };
@ -57,14 +61,14 @@ const stop = () => {
}; };
onMounted(() => { onMounted(() => {
axios noErrorAxios
.get(Environment.apiContextPath(props.dataUrl)) .get(Environment.apiContextPath(props.dataUrl))
.then((response) => { .then((response) => {
if (response?.data?.running) { if (response?.data?.status === 'RUNNING') {
start(); start();
} }
}) })
.catch(() => { .catch((error) => {
stop(); stop();
}); });
}); });

2
io.sc.platform.core.frontend/src/platform/index.ts

@ -68,7 +68,7 @@ export { PConst } from './PConst';
/** /**
* *
*/ */
export { axios, blobAxios } from './plugin'; export { axios, blobAxios, noErrorAxios } from './plugin';
export { eventBus } from './plugin'; export { eventBus } from './plugin';
export { i18n } from './plugin'; export { i18n } from './plugin';
export { usePlatformStore } from './plugin'; export { usePlatformStore } from './plugin';

28
io.sc.platform.core.frontend/src/platform/plugin/axios.ts

@ -4,7 +4,6 @@ import { i18n } from './i18n';
import { PConst } from '@/platform/PConst'; import { PConst } from '@/platform/PConst';
import { Environment } from '@/platform/plugin/environment'; import { Environment } from '@/platform/plugin/environment';
import { NotifyManager } from './manager'; import { NotifyManager } from './manager';
import { Tools } from '@/platform/utils';
const ignoredUrls: string[] = [PConst.API_I18N_MESSAGES_URL, PConst.API_APP_CONFIGURE_URL]; const ignoredUrls: string[] = [PConst.API_I18N_MESSAGES_URL, PConst.API_APP_CONFIGURE_URL];
const gc = Environment.getConfigure(); const gc = Environment.getConfigure();
@ -88,6 +87,31 @@ const axios = Axios.create({
axios.interceptors.request.use(requestInterceptor, requestErrorInterceptor); axios.interceptors.request.use(requestInterceptor, requestErrorInterceptor);
axios.interceptors.response.use(responseInterceptor, responseErrorInterceptor); axios.interceptors.response.use(responseInterceptor, responseErrorInterceptor);
// 无默认服务器端错误处理的 axios
const noErrorAxios = Axios.create({
baseURL: gc.axios?.baseURL || '',
timeout: gc.axios?.timeout || 1000 * 60,
});
noErrorAxios.interceptors.request.use(requestInterceptor, requestErrorInterceptor);
noErrorAxios.interceptors.response.use(responseInterceptor, (error: any) => {
// 请求失败, 进入该方法说明 response 的状态码不为 2xx
if (error.code === 'ECONNABORTED' || error.message.indexOf('timeout') !== -1 || error.message === 'Network Error') {
// 发生网络错误
const $t = i18n.global.t;
NotifyManager.error($t('NetworkError'));
return Promise.reject({
code: 'NetworkError',
errorMessageI18nKey: 'NetworkError',
errorMessage: error.message,
exception: 'NetworkError',
stackTrace: error.stack,
data: null,
});
} else {
return Promise.reject(error);
}
});
// 下载二进制 axios // 下载二进制 axios
const blobAxios = Axios.create({ const blobAxios = Axios.create({
baseURL: gc.axios?.baseURL || '', baseURL: gc.axios?.baseURL || '',
@ -105,4 +129,4 @@ export default {
}, },
}; };
export { axios, blobAxios }; export { axios, blobAxios, noErrorAxios };

2
io.sc.platform.core.frontend/src/platform/plugin/index.ts

@ -15,7 +15,7 @@ export default {
}, },
}; };
export { axios, blobAxios } from './axios'; export { axios, blobAxios, noErrorAxios } from './axios';
export { eventBus } from './quasar'; export { eventBus } from './quasar';
export { i18n } from './i18n'; export { i18n } from './i18n';
export { usePlatformStore } from './pinia'; export { usePlatformStore } from './pinia';

3
io.sc.platform.core.frontend/src/platform/plugin/manager/I18nMessageManager.ts

@ -4,7 +4,7 @@ import { Quasar, Notify } from 'quasar';
import { PConst } from '@/platform/PConst'; import { PConst } from '@/platform/PConst';
import { Environment } from '@/platform/plugin/environment'; import { Environment } from '@/platform/plugin/environment';
import { Tools } from '@/platform/utils'; import { Tools } from '@/platform/utils';
import { axios, i18n } from '@/platform/plugin'; import { axios, i18n, eventBus } from '@/platform/plugin';
import offLinei18nMessages from '@/platform/i18n'; import offLinei18nMessages from '@/platform/i18n';
@ -48,6 +48,7 @@ class I18nMessageManager {
I18nMessageManager.setQuasarLang(locale); I18nMessageManager.setQuasarLang(locale);
I18nMessageManager.setPlatformLang(locale, messages); I18nMessageManager.setPlatformLang(locale, messages);
I18nMessageManager.showNotify(locale, isShowNotify); I18nMessageManager.showNotify(locale, isShowNotify);
eventBus.emit('localeChanged', locale);
console.debug('I18n language was changed to ' + locale); console.debug('I18n language was changed to ' + locale);
} }

8
io.sc.platform.core.frontend/src/platform/utils/Downloader.ts

@ -1,8 +1,8 @@
import { blobAxios } from '@/platform'; import { blobAxios } from '@/platform';
class Downloader { class Downloader {
public static get(url: string, data: any) { public static get(url: string) {
blobAxios.get(url, data, { responseType: 'blob' }).then((response) => { blobAxios.get(url, { responseType: 'blob' }).then((response) => {
Downloader.download(response); Downloader.download(response);
}); });
} }
@ -18,9 +18,7 @@ class Downloader {
const { data, headers } = response; const { data, headers } = response;
let fileName = headers['content-disposition-url-encode'].match(/filename=(.*)/)[1]; let fileName = headers['content-disposition-url-encode'].match(/filename=(.*)/)[1];
fileName = decodeURIComponent(fileName || 'download'); fileName = decodeURIComponent(fileName || 'download');
// 如果下载的内容是 json 字符串, 返回的 data 是一个 js Object, 需要转换成 json 字符串 const blob = new Blob([data], { type: headers['content-type'] });
const _data = data instanceof Object ? JSON.stringify(data, null, ' ') : data;
const blob = new Blob([_data], { type: headers['content-type'] });
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
const a = document.createElement('a'); const a = document.createElement('a');
a.href = url; a.href = url;

2
io.sc.platform.core.frontend/src/routes/routes.json

@ -5,7 +5,7 @@
"parent": "/", "parent": "/",
"priority": 0, "priority": 0,
"component": "component.testcase.formElements", "component": "component.testcase.formElements",
"componentPath": "@/views/FormElements.vue", "componentPath": "@/views/exportdata.vue",
"redirect": null, "redirect": null,
"meta": { "meta": {
"permissions": ["/testcase/formElements/**/*"] "permissions": ["/testcase/formElements/**/*"]

203
io.sc.platform.core.frontend/src/views/exportdata.vue

@ -0,0 +1,203 @@
<template>
<div>
<div class="row py-1 q-col-gutter-sm">
<div class="col-2">
<q-select
v-model="valueReactive.datasource"
:label="$t('developer.backend.export.liquibase.datasource')"
outlined
dense
emit-value
map-options
:options="datasourceOptionsRef"
@update:model-value="
(value) => {
datasourceChanged(value);
}
"
></q-select>
</div>
<div class="col-2">
<q-select
v-model="valueReactive.schema"
:label="$t('developer.backend.export.liquibase.schema')"
outlined
dense
emit-value
map-options
:options="schemaOptionsRef"
@update:model-value="
(value) => {
schemaChanged(valueReactive.datasource, value);
}
"
></q-select>
</div>
<div class="col-8">
<q-select
v-model="valueReactive.tables"
:label="$t('developer.backend.export.liquibase.tables')"
input-class="bg-red-200"
outlined
dense
emit-value
map-options
multiple
use-chips
:options="tablesOptionsRef"
@update:model-value="
(value) => {
if (value) {
if (value.length > 1) {
valueReactive.sql = 'select * from ${table}';
} else {
valueReactive.sql = 'select * from ' + value;
}
}
}
"
>
<template #append>
<q-btn
:title="$t('selectAll')"
icon="bi-check-square"
flat
dense
:disable="!(tablesOptionsRef?.length > 0)"
@click.stop.prevent="
() => {
const selecteds = [];
if (tablesOptionsRef) {
for (const table of tablesOptionsRef) {
selecteds.push(table.value);
}
}
valueReactive.tables = selecteds;
}
"
/>
<q-btn
:title="$t('unSelectAll')"
icon="bi-square"
flat
dense
:disable="!(tablesOptionsRef?.length > 0)"
@click.stop.prevent="
() => {
valueReactive.tables = [];
}
"
/>
</template>
</q-select>
</div>
</div>
<div class="row py-1 q-col-gutter-sm">
<div class="col-12">
<w-code-mirror v-model="valueReactive.sql" :label="$t('sql')" :rows="5" lang="sql"></w-code-mirror>
</div>
</div>
<div class="row justify-center q-gutter-md py-2">
<WProgressBtn
ref="progressBtnRef"
icon="bi-database-down"
:label="$t('export')"
data-url="/api/jdbc/data/traceExporterExecuteProgress"
@click="exportData"
@success="
(progressInfo) => {
Downloader.get(Environment.apiContextPath('/api/mvc/download?filePath=' + encodeURIComponent(progressInfo.result)));
}
"
></WProgressBtn>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, onUpdated } from 'vue';
import { useI18n } from 'vue-i18n';
import { axios, blobAxios, Environment, DialogManager, Downloader } from '@/platform';
import WProgressBtn from '../platform/components/progress/WProgressBtn.vue';
const { t } = useI18n();
const progressBtnRef = ref();
const datasourceOptionsRef = ref([]);
const schemaOptionsRef = ref([]);
const tablesOptionsRef = ref([]);
const valueReactive = reactive({
datasource: undefined,
schema: undefined,
tables: undefined,
sql: undefined,
});
const loadDatasource = () => {
axios.get(Environment.apiContextPath('/api/system/datasource?pageable=false&sortBy=name')).then((response) => {
const data = response?.data.content;
if (data && data.length > 0) {
datasourceOptionsRef.value.splice(0, datasourceOptionsRef.value.length);
for (let item of data) {
datasourceOptionsRef.value.push({ label: item.name, value: item.name });
}
}
});
};
const datasourceChanged = (datasource: string) => {
datasource = datasource || '';
axios.get(Environment.apiContextPath('/api/jdbc/metadata/getSchemas?datasource=' + datasource)).then((response) => {
const data = response?.data;
if (data && data.length > 0) {
schemaOptionsRef.value.splice(0, schemaOptionsRef.value.length);
tablesOptionsRef.value.splice(0, tablesOptionsRef.value.length);
for (let item of data) {
schemaOptionsRef.value.push({ label: item.name, value: item.name });
}
}
});
};
const schemaChanged = (datasource: string, schema: string) => {
datasource = datasource || '';
schema = schema || '';
axios.get(Environment.apiContextPath('/api/jdbc/metadata/getTables?datasource=' + datasource + '&schema=' + schema)).then((response) => {
const data = response?.data;
if (data && data.length > 0) {
tablesOptionsRef.value.splice(0, tablesOptionsRef.value.length);
for (let item of data) {
tablesOptionsRef.value.push({ label: item.name, value: item.name });
}
}
});
};
const exportData = (e) => {
DialogManager.confirm(t('developer.backend.export.liquibase.export.tip'), () => {
const data = valueReactive;
const config = {
datasource: data.datasource,
schema: data.schema,
tables: [],
};
const length = data.tables.length;
const sql = length === 1 ? data.sql : '';
for (let i = 0; i < length; i++) {
config.tables[i] = { name: data.tables[i], sql: sql ? sql : 'select * from ' + data.tables[i] };
}
axios.post(Environment.apiContextPath('/api/jdbc/data/exportData'), config).then((response) => {
progressBtnRef.value.start();
});
});
};
onMounted(() => {
loadDatasource();
datasourceChanged('');
});
onUpdated(() => {
loadDatasource();
});
</script>

4
io.sc.platform.core.frontend/template-project/package.json

@ -1,6 +1,6 @@
{ {
"name": "platform-core", "name": "platform-core",
"version": "8.1.180", "version": "8.1.187",
"description": "前端核心包,用于快速构建前端的脚手架", "description": "前端核心包,用于快速构建前端的脚手架",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -93,7 +93,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.187",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

9
io.sc.platform.core/src/main/java/io/sc/platform/core/enums/ProgressStatus.java

@ -0,0 +1,9 @@
package io.sc.platform.core.enums;
public enum ProgressStatus {
NOT_EXISTS, // 不存在
NOT_RUNNING, // 未运行
RUNNING, // 运行中
COMPLETED, // 已完成
ERROR; // 发生错误
}

4
io.sc.platform.core/src/main/java/io/sc/platform/core/exception/ProgressableThreadIsNullException.java

@ -0,0 +1,4 @@
package io.sc.platform.core.exception;
public class ProgressableThreadIsNullException extends RuntimeException{
}

5
io.sc.platform.core/src/main/java/io/sc/platform/core/exception/ProgressableThreadIsRunningException.java

@ -0,0 +1,5 @@
package io.sc.platform.core.exception;
public class ProgressableThreadIsRunningException extends RuntimeException{
}

4
io.sc.platform.core/src/main/java/io/sc/platform/core/exception/ProgressableThreadNameIsNullException.java

@ -0,0 +1,4 @@
package io.sc.platform.core.exception;
public class ProgressableThreadNameIsNullException extends RuntimeException{
}

4
io.sc.platform.core/src/main/java/io/sc/platform/core/exception/ProgressableThreadNotExistsException.java

@ -0,0 +1,4 @@
package io.sc.platform.core.exception;
public class ProgressableThreadNotExistsException extends RuntimeException{
}

10
io.sc.platform.core/src/main/java/io/sc/platform/core/service/ProgressableThreadService.java

@ -0,0 +1,10 @@
package io.sc.platform.core.service;
import io.sc.platform.core.support.ProgressInfo;
import io.sc.platform.core.support.ProgressableThread;
public interface ProgressableThreadService {
public ProgressInfo start(ProgressableThread progressableThread) throws Exception;
public ProgressInfo start(String name,ProgressableThread progressableThread) throws Exception;
public ProgressInfo getProgressInfo(String name) throws Exception;
}

68
io.sc.platform.core/src/main/java/io/sc/platform/core/service/impl/ProgressableThreadServiceImpl.java

@ -0,0 +1,68 @@
package io.sc.platform.core.service.impl;
import io.sc.platform.core.enums.ProgressStatus;
import io.sc.platform.core.exception.ProgressableThreadIsNullException;
import io.sc.platform.core.exception.ProgressableThreadIsRunningException;
import io.sc.platform.core.exception.ProgressableThreadNameIsNullException;
import io.sc.platform.core.exception.ProgressableThreadNotExistsException;
import io.sc.platform.core.service.ProgressableThreadService;
import io.sc.platform.core.support.ProgressInfo;
import io.sc.platform.core.support.ProgressableThread;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
@Service
public class ProgressableThreadServiceImpl implements ProgressableThreadService {
private Map<String,ProgressableThread> threadMap =new HashMap<>();
private Object lock =new Object();
@Override
public ProgressInfo start(ProgressableThread progressableThread) throws Exception {
if(progressableThread==null){
throw new ProgressableThreadIsNullException();
}
return start(progressableThread.getClass().getName(),progressableThread);
}
@Override
public ProgressInfo start(String name, ProgressableThread progressableThread) throws Exception {
if(!StringUtils.hasText(name)){
throw new ProgressableThreadNameIsNullException();
}
if(progressableThread==null){
throw new ProgressableThreadIsNullException();
}
synchronized (lock){
if(threadMap.containsKey(name)){
ProgressableThread thread =threadMap.get(name);
if(thread!=null){
if(thread.isAlive()){
throw new ProgressableThreadIsRunningException();
}
}
}
progressableThread.getProgressInfo().setStatus(ProgressStatus.RUNNING);
progressableThread.start();
threadMap.put(name,progressableThread);
return progressableThread.getProgressInfo();
}
}
@Override
public ProgressInfo getProgressInfo(String name) throws Exception {
if(!StringUtils.hasText(name)){
throw new ProgressableThreadNameIsNullException();
}
synchronized (lock){
ProgressableThread thread =threadMap.get(name);
if(thread!=null){
return thread.getProgressInfo();
}else{
throw new ProgressableThreadNotExistsException();
}
}
}
}

34
io.sc.platform.core/src/main/java/io/sc/platform/core/support/ProgressInfo.java

@ -1,5 +1,7 @@
package io.sc.platform.core.support; package io.sc.platform.core.support;
import io.sc.platform.core.enums.ProgressStatus;
import java.util.Date; import java.util.Date;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -7,7 +9,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* 进度信息 * 进度信息
*/ */
public class ProgressInfo { public class ProgressInfo {
private boolean running; private ProgressStatus status =ProgressStatus.NOT_EXISTS;
//开始时间 //开始时间
private Date startDatetime; private Date startDatetime;
//完成时间 //完成时间
@ -21,12 +23,7 @@ public class ProgressInfo {
//是否出现错误 //是否出现错误
private String errorMessage; private String errorMessage;
private String errorStackTrace; private String errorStackTrace;
private Object result;
public static ProgressInfo notRunning(){
ProgressInfo progressInfo =new ProgressInfo();
progressInfo.setRunning(false);
return progressInfo;
}
public ProgressInfo(){} public ProgressInfo(){}
@ -64,18 +61,18 @@ public class ProgressInfo {
public void done(){ public void done(){
this.currentWeight =this.totalWeight; this.currentWeight =this.totalWeight;
this.setStatus(ProgressStatus.COMPLETED);
this.setCompletedDatetime(new Date());
} }
public boolean getRunning() { public ProgressStatus getStatus() {
return running; return status;
} }
public void setRunning(boolean running) { public void setStatus(ProgressStatus status) {
this.running = running; this.status = status;
} }
public Date getStartDatetime() { public Date getStartDatetime() {
return startDatetime; return startDatetime;
} }
@ -132,10 +129,18 @@ public class ProgressInfo {
this.errorStackTrace = errorStackTrace; this.errorStackTrace = errorStackTrace;
} }
public Object getResult() {
return result;
}
public void setResult(Object result) {
this.result = result;
}
@Override @Override
public String toString() { public String toString() {
return "ProgressInfo{" + return "ProgressInfo{" +
"isRunning=" + running + "status=" + status +
", startDatetime=" + startDatetime + ", startDatetime=" + startDatetime +
", completedDatetime=" + completedDatetime + ", completedDatetime=" + completedDatetime +
", totalWeight=" + totalWeight + ", totalWeight=" + totalWeight +
@ -143,6 +148,7 @@ public class ProgressInfo {
", messageKey='" + messageKey + '\'' + ", messageKey='" + messageKey + '\'' +
", errorMessage='" + errorMessage + '\'' + ", errorMessage='" + errorMessage + '\'' +
", errorStack='" + errorStackTrace + '\'' + ", errorStack='" + errorStackTrace + '\'' +
", result='" + result + '\'' +
'}'; '}';
} }
} }

12
io.sc.platform.core/src/main/java/io/sc/platform/core/support/ProgressableThread.java

@ -0,0 +1,12 @@
package io.sc.platform.core.support;
/**
* 可跟踪执行进度的线程
*/
public class ProgressableThread extends Thread {
protected ProgressInfo progressInfo =new ProgressInfo();
public ProgressInfo getProgressInfo() {
return progressInfo;
}
}

4
io.sc.platform.core/src/main/java/io/sc/platform/core/util/ValidatorUtil.java

@ -21,10 +21,6 @@ public class ValidatorUtil {
List<ValidationError> errorList =new ArrayList<ValidationError>(); List<ValidationError> errorList =new ArrayList<ValidationError>();
for(FieldError error : errors){ for(FieldError error : errors){
Object[] objects =error.getArguments();
for(Object o : objects){
System.out.println(o.getClass().getName());
}
errorList.add(new ValidationError(getFieldName(error.getField()),error.getDefaultMessage())); errorList.add(new ValidationError(getFieldName(error.getField()),error.getDefaultMessage()));
} }
throw new ValidateException(errorList); throw new ValidateException(errorList);

5
io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties

@ -131,6 +131,7 @@ save=Save
search=Search search=Search
select=Select select=Select
selectAll=Select All selectAll=Select All
unSelectAll=UnSelect All
serializer=Serializer serializer=Serializer
size=Size size=Size
start=Start start=Start
@ -208,4 +209,6 @@ RegExp=Regular Expression
execute=Execute execute=Execute
executeAll=Execute All executeAll=Execute All
moreQueryCondition=More Query Condition moreQueryCondition=More Query Condition
valueType=Value Type valueType=Value Type
source=Source
target=Target

5
io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties

@ -131,6 +131,7 @@ save=\u4FDD\u5B58
search=\u641C\u7D22 search=\u641C\u7D22
select=\u9078\u64C7 select=\u9078\u64C7
selectAll=\u5168\u90E8\u9078\u64C7 selectAll=\u5168\u90E8\u9078\u64C7
unSelectAll=\u5168\u90E8\u53D6\u6D88
serializer=\u5E8F\u5217\u5316\u5668 serializer=\u5E8F\u5217\u5316\u5668
size=\u5C3A\u5BF8 size=\u5C3A\u5BF8
start=\u958B\u59CB start=\u958B\u59CB
@ -208,4 +209,6 @@ RegExp=\u6B63\u5247\u8868\u9054\u5F0F
execute=\u57F7\u884C execute=\u57F7\u884C
executeAll=\u57F7\u884C\u6240\u6709 executeAll=\u57F7\u884C\u6240\u6709
moreQueryCondition=\u66F4\u591A\u67E5\u8A62\u689D\u4EF6 moreQueryCondition=\u66F4\u591A\u67E5\u8A62\u689D\u4EF6
valueType=\u503C\u985E\u578B valueType=\u503C\u985E\u578B
source=\u6E90
target=\u76EE\u6A19

5
io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties

@ -131,6 +131,7 @@ save=\u4FDD\u5B58
search=\u641C\u7D22 search=\u641C\u7D22
select=\u9009\u62E9 select=\u9009\u62E9
selectAll=\u5168\u90E8\u9009\u62E9 selectAll=\u5168\u90E8\u9009\u62E9
unSelectAll=\u5168\u90E8\u53D6\u6D88
serializer=\u5E8F\u5217\u5316\u5668 serializer=\u5E8F\u5217\u5316\u5668
size=\u5C3A\u5BF8 size=\u5C3A\u5BF8
start=\u5F00\u59CB start=\u5F00\u59CB
@ -208,4 +209,6 @@ RegExp=\u6B63\u5219\u8868\u8FBE\u5F0F
execute=\u6267\u884C execute=\u6267\u884C
executeAll=\u6267\u884C\u6240\u6709 executeAll=\u6267\u884C\u6240\u6709
moreQueryCondition=\u66F4\u591A\u67E5\u8BE2\u6761\u4EF6 moreQueryCondition=\u66F4\u591A\u67E5\u8BE2\u6761\u4EF6
valueType=\u503C\u7C7B\u578B valueType=\u503C\u7C7B\u578B
source=\u6E90
target=\u76EE\u6807

235
io.sc.platform.developer.doc/asciidoc/bank-business/bank-business.adoc

@ -0,0 +1,235 @@
= 银行业务分类
商业银行最通用的分类是:负债业务(商业银行形成资金来源的业务),资产业务(商业银行运用资金的业务),
中间业务(银行不需运用自己的资金,代客户承办支付和其他委托事项而收取手续费的业务)。
image::bank-business/001.png[,90%]
== 资产业务
资产业务,是商业银行的主要收入来源。
=== 贷款(放款)业务
==== 信用贷款:信用贷款,指单凭借款人的信誉,而不需提供任何抵押品的贷款,是一种资本贷款。
* 普通借款限额:企业与银行订立一种非正式协议,以确定一个贷款,在限额内,企业可随时得到银行的贷款支持,限额的有效期一般不超过90天。普通贷款限额内的贷款,利率是浮动的,与银行的优惠利率挂钩。
* 透支贷款:银行通过允许客户在其帐户上透支的方式向客户提供贷款。提供这种便利被视为银行对客户所承担的合同之外的“附加义务”。
* 备用贷款承诺:备用贷款承诺,是一种比较正式和具有法律约束的协议。银行与企业签订正式合同,在合同中银行承诺在指定期限和限额内向企业提供相应贷款,企业要为银行的承诺提供费用。
* 消费者贷款:消费者贷款是对消费个人发放的用于购买耐用消费品或支付其他费用的贷款,商业银行向客户提供这种贷款时,要进行多方面的审查。
* 票据贴现贷款:票据贴现贷款,是顾客将未到期的票据提交银行,由银行扣除自贴现日起至到期日止的利息而取得现款。
==== 抵押贷款:抵押贷款有以下几种类型
存货贷款也称商品贷款,是一种以企业的存贷或商品作为抵押品的短期贷款。
客帐贷款银行发放的以应收帐款作为抵押的短期贷款,称为“客帐贷款”。这种贷款一般都为一种持续性的信贷协定。
证券贷款银行发放的企业借款,除以应收款和存货作为抵押外,也有不少是用各种证券特别是公司企业发行的股票和债券作押的。这类贷款称为“证券贷款”。
不动产抵押贷款通常是指以房地产或企业设备抵押品的贷款。
==== 保证书担保贷款:
保证书担保贷款,是指由经第三者出具保证书担保的贷款。保证书是保证为借款人作贷款担保,与银行的契约性文件,其中规定了银行和保证人的权利和义务。银行只要取得经保证人签字的银行拟定的标准格式保证书,即可向借款人发放贷款。所以,保证书是银行可以接受的最简单的担保形式。
==== 贷款证券化:
贷款证券化是指商业银行通过一定程序将贷款转化为证券发行的总理资过程。具体做法是:商业银行将所持有的各种流动性较差的贷款,组合成若干个资产库(Assets Pool),出售给专业性的融资公司(Special PurposeCorporation),再由融资公司以这些资产库为担保,发行资产抵押证券。这种资产抵押证券同样可以通过证券发行市场发行或私募的方式推销给投资者。出售证券所收回的资金则可做为商业银行新的资金来源再用于发放其它贷款。
=== 投资业务
商业银行的投资业务是指银行购买有价证券的活动。投资是商业银行一项重要的资产业务,是银行收入的主要来源之一。商业银行的投资业务,按照对象的不同,可分为国内证券投资和国际证券投资。
国内证券投资国内证券投资大体可分为三种类型:
政府证券投资
国家政府发行的证券,按照销售方式的不同,可以分为两种,一种叫作公开销售的证券,一种叫作不公开销售的证券。商业银行购买的政府证券,包括国库券、中期债券和长期债券三种。
. 国库券。国库券是政府短期债券,期限在一年以下。
. 中长期债券。中长期债券是国家为了基建投资的资金需要而发行的一种债券,其利率一般较高,期限也较长,是商业银行较好的投资对象。
. 长期债券
== 负债业务
负债是银行由于授信而承担的将以资产或资本偿付的能以货币计量的债务。存款、派生存款是银行的主要负债,约占资金来源的80%以上,另外联行存款、同业存款、借入或拆入款项或发行债券等,也构成银行的负债。
=== 活期存款
活期存款是相对于定期存款而言的,是不需预先通知可随时提取或支付的存款。
活期存款构成了商业银行的重要资金来源,也是商业银行创造信用的重要条件。但成本较高。商业银行只向客户免费或低费提供服务,一般不支付或较少支付利息。
=== 定期存款
定期存款是相对于活期存款而言的,是一种由存户预先约定期限的存款。定期存款占银行存款比重较高。因为定期存款固定而且比较长,从而为商业银行提供了稳定的资金来源,对商业银行长期贷款与投资具有重要意义。
=== 储蓄存款
储蓄存款是个人为积蓄货币和取得利息收入而开立的存款帐户,储蓄存款又可分为活期和定期。
储蓄存款的活期存款,或者称为活期储蓄存款,存取无一定期期限,只凭存折便可提现。存折一般不能转让流通,存户不能透支款项。
=== 可转让定期存单(CDs)
可转让定期存单存款是定期存款的一种主要形式,但与前述定期存款又有所区别。可转让存单存款的明显特点是:存单面额固定,不记姓名,利率有固定也有浮动,存期为3个月、6个月、9个月和12个月不等。存单能够流通转让,以能够满足流动性和盈利性的双重要求。
=== 可转让支付命令存款帐户
它实际上是一种不使用支票的支票帐户。它以支付命令书取代了支票。通过此帐户,商业银行既可以提供支付上的便利,又可以支付利息,从而吸引储户,扩大存款。
=== 自动转帐服务存款帐户
这一帐户与可转让支付命令存款帐户类似,是在电话转帐服务基础上发展而来。发展到自动转帐服务时,存户可以同时在银行开立两个帐户:储蓄帐户和活期存款帐户。银行收到存户所开出的支票需要付款时,可随即将支付款项从储蓄帐户上转到活期存款帐户上,自动转帐,即时支付支票上的款项。
=== 掉期存款
掉期存款指的是顾客在存款时把手上的由名义上兑换成其所选择的外币,作为外币定期存款存入银行。到期满时顾客先将外币存款连本带息兑回本币后才提取。存款期限由一个月至一年不等。
== 中间业务
中间业务又称表外业务,其收入不列入银行资产负债表。
=== 结算业务
结算业务是由商业银行的存款业务衍生出来的一种业务。
==== 结算工具
结算工具就是商业银行用于结算的各种票据。目前可选择使用的票据结算工具主要包括银行汇票、商业汇票、银行本票和支票等。
. 银行汇票:由企业单位或个人将款项交存开户银行,由银行签发给其持往异地采购商品时办理结算或支配现金的票据。
. 商业汇票:由企业签发的一种票据,适用于企业单位先发货后收款或双方约定延期付款的商品交易。
. 银行本票:申请人将款项交存银行,由银行签发给其凭以办理转帐或支取现金的票据。可分为不定额本票和定额本票。
. 支票:由企业单位或个人签发的,委托其开户银行付款的票据,是我国传统的票据结算工具,可用于支取现金和转帐。
==== 结算方式
===== 同城结算方式
. 支票结算: 商业银行最主要或大量的同城结算方式是支票结算。支票结算就是银行顾客根据其在银行的存款和透支限额开出支票,命令银行从其帐户中支付一定款项给收款人,从而实现资金调拨,了结债权债务关系的一种过程。
. 帐单支票与划拨制度: 这是不用开支票,通过直接记帐而实现资金结算的方式。
. 直接贷记转帐和直接借记转帐: 这两种结算方式是在自动交换所的基础上发展起来的。自动交换所交换的是磁带而不是支票。它通过电子计算机对各行送交的磁带进行处理,实现不同银行资金结算。
. 票据交换所自动转帐系统: 这是一种进行同城同业资金调拨的系统。参加这种系统的银行之间,所有同业拆借、外汇买卖、汇划款项等将有关数据输入到自动转帐系统的终端机,这样收款银行立即可以收到有关信息,交换所同时借记付款银行帐户,贷记收款银行帐户。
===== 异地结算方式
. 汇款结算: 汇款结算(Remittance),是付款人委托银行将款项汇给外地某收款人的一种结算方式。汇款结算又分为电汇、信汇和票汇三种形式。
. 托收结算: 托收结算(Collection),是指债权人或售货人为向外地债务人或购货人收取款项而向其开出汇票,并委托银行代为收取款项的一种结算方式。托收业务主要有光票托收和跟单托收两类。
. 信用证结算: 信用证(Letter ofCredit),一种有条件的银行付款承诺,即开证银行根据进口商的指示,向出口商开立的,授权其签发以进口商或银行为付款人的汇票,保证在条款规定条件下必定付款或承兑的文件。
. 电子资金划拨系统: 随着电子计算机等新技术投入银行运用,电子计算机的大型化和网络化改变了商业银行异地资金结算的传统处理方式。通过电子资金结算系统进行异地结算,使资金周转大大加快,业务费用大大降低。
=== 信用证业务
信用证(Letter ofCredit),作为商业贸易的手段之一,银行信用证是进口商的代理银行为进口商提供自身的信用,保证在一定的条件下承付出口商开给进口商的票据,即将所开票据当作是开给本行的票据。所谓信用证即是保证承付这些票据的证书。
==== 信用证的种类
. 银行信用证: 汇票的接受人是银行,开证行或受其委托的保兑银行承兑开给自己的汇票,这种信用证是银行信用证(Bank Credit)。
. 不可撤销信用证与可撤销信用证: 不可撤销信用证(IrrevocableCredit),是指开证行一旦开立了信用证并将之通知了受益人,在其有效期间,如若没有开证委托人、受益人或已依据此信用证贴现汇票的银行的同意,不可单方面地撤销此信用证,也不可变更其条件。
. 保兑信用证与不保兑信用证: 开证行以外的银行对卖方开出的汇票保证兑付,这种信用证称为保兑信用证(Confirmed Credit),而无此保证者则称为不保兑信用证(UnconfirmedCredit)。
. 一般信用证和特定信用证: 信用证的开证行特别指定某一银行贴现根据此信用证开出的汇票,这种信用证称为特定信用证(Special or Restricted Credit ),而不限定贴现银行者称为普通信用证(Generalor Open Credit)。
=== 信托业务
信托(Trust),可以从两方面考察,从委托人来说,信托是为自己或为第三者的利益,把自己的财产委托别人管理或处理的一种行为;从受托人来说,信托是受委托人的委托,为了受益人的利益,代为管理、营运或处理信托人托管财产的一种过程。广义的信托还包括代理业务,如受托代办有价证券的签证、发行、收回、掉换、转让、还本付息以及代客保管物品等。
信托与代理的主要区别在于财产权是否转移,如果财产权从委托人转移到受托人,则是信托关系,而代理则不涉及财产权转移。
信托关系(FiduciaryRelationship)是一种包括委托人、受托人和受益人在内的多边关系。
按信托方式划分:投资信托、融资信托、公益信托、职工福利信托。
. 证券投资信托: 证券投资信托是以投资有价证券,获取投资收益为目的信托。它是由信托部门将个人或企业、团体的投资资金集中起来,代替投资者进行投资,最后将投资收益和本金偿还给受益人。
. 动产或不动产信托: 动产或不动产信托是由大型设备或财产的所有者提出的、以融通资金为目的信托。
. 公益信托业务: 公益信托是一种由个人或团体捐赠或募集的基金,以用于公益事业为目的的信托。
=== 租赁业务
. 融资性租赁(Financial Lease ): 是以融通资金为目的租赁。一般先由承租人自行从供货处选好所需设备,并谈妥交易条件,然后找出租人(金融机构或其附属的专业子公司),要求后者按谈妥的条件向供货商购买设备,并签订租赁合同,取得设备使用权,并按期交纳租金。这时出租人支付了全部资金,等于提供了百分之百的信贷,因此又叫融资性租赁或资本性租赁。
. 操作性租赁(Operating Lease): 又叫服务性租赁,是由出租人向承租人提供一种特殊服务的租赁。这种特殊服务主要是指设备的短期使用或利用服务,如出租人买下库房、车船、电子计算机等,然后出租给承租人。操作性租赁通常适用于一些需要专门技术进行保养、技术更新、使用频度不高的设备。
. 出售与返租式租赁(Sale and Lease back): 是财产所有人将其财产出售以后又租回使用的一种租赁方式。这种租赁的后半段与一般租赁完全相同,只是增加了前半段的出售过程,财产所有者又变成了财产使用者。
. 转租赁(Sublease ): 是将设备或财产进行两次重复租赁的方式。国际租赁中通常采用这种租赁方式。
=== 代理业务
代理融通(Factoring)又叫代收帐款或收买应收帐款,是由商业银行或专业代理融通公司代顾客收取应收款项,并向顾客提供资金融通的一种业务方式。
代理融通业务一般涉及三方面当事人,一是商业银行或经营代理融通业务的公司,二是出售应收帐款、取得资金融通的工商企业,三是取得商业信用及赊欠工商企业贷款的顾客。三者的关系是,工商企业对顾客赊销货物或劳务,然后把应收的赊销帐款转让给银行或代理融通公司,由后者向企业提供资金并到期向顾客收帐。
=== 银行卡业务
. 信用卡: 信用卡是消费信贷的一种工具和形式,具有“先消费”、方便消费者的特点。信用卡的种类很多,除银行发行的信用卡外,还有商业和其他服务业发行的零信用卡、旅游娱乐卡等。
. 支票卡: 支票卡又叫保证卡,供客户开发支票时证明其身份的发卡。卡片载明客户的帐户、签名和有效期限。
. 自动出纳机卡和记帐卡: 自动出纳机卡是一种印有磁带、专供在自动出纳机上使用的塑料卡。卡上除标明发行银行、卡片号码外,磁带上还记录有客户的存款户帐号、密码和余额。
. 灵光卡和激光卡: 灵光卡又叫记帐卡、方便卡,是一种带微型集成电路的塑料卡片,具有自动、数据处理和储存的功能,卡片可以记录客户每笔收支和存款余额。
=== 咨询业务
在现代社会,信息已成为社会发展的主要支柱之一。商业银行通过资金运动的记录,以及与资金运动相关资料的收集整理,可以为企业提供丰富实用的经济信息。其主要内容有:企业财务资料资信评价;商品市场供需结构变化趋势介绍;金融市场动态分析。
== 国际业务
=== 国际结算业务
国际间进行贸易和非贸易往来而发生的债权债务,要用货币收付,在一定的形式和条件下结清,这样就产生了国际结算业务。国际结算方式是从简单的现金结算方式,发展到比较完善的银行信用证方式,货币的收付形成资金流动,而资金的流动又须通过各种结算工具的传送来实现。
国际间进行贸易和非贸易往来而发生的债权债务,要用货币收付,在一定的形式和条件下结清,这样就产生了国际结算业务。国际结算方式是从简单的现金结算方式,发展到比较完善的银行信用证方式,货币的收付形成资金流动,而资金的流动又须通过各种结算工具的传送来实现。
==== 汇款结算业务
汇款是付款人把应付款项交给自己的往来银行,请求银行代替自己通过邮寄的方法,把款项支付给收款人的一种结算方式。银行接到付款人的请求后,收下款项,然后以某种方式通知收款人所在地的代理行,请它向收款人支付相同金额的款项。最后,两个银行通过事先的办法,结清两者之间的债权债务。汇款结算方式一般涉及四个当事人,即汇款人、收款人、汇出行和汇入行。
国际汇款结算业务基本上分为三大类,即电汇、信汇和票汇。
==== 托收结算业务
托收是债权人为向国外债务人收取款项而向其开发汇票,委托银行代收的一种结算方式。
一笔托收结算业务通常有四个当事人,即委托人、托收银行、代收银行和付款人。
西方商业银行办理的国际托收结算业务为两大类,一类为光票托收,另一类为跟单托收。
==== 信用证结算业务
信用证结算方式是指进出口双方签订买卖合同后,进口商主动请示进口地银行向出口商开立信用证,对自己的付款责任作出保证。当出口商按照信用证的条款履行了自己的责任后,进口商将货款通过银行交付给出口商。
一笔信用证结算业务所涉及的基本当事人有三个,即开证申请人、受益人和开证银行。
==== 担保业务
在国际结算过程中,银行还经常以本身的信誉为进出口商提供担保,以促进结算过程的顺利进行。目前为进出口结算提供的担保主要有两种形式,即银行保证书和备用信用证。
银行保证书(Letterof Guarantee)
银行保证书又称保函,是银行应委托人的请求,向受益人开出的担保被保证人履行职责的一种文件。
备用信用证(Stand-byLetter of Credit)
备用信用证是一种银行保证书性质的凭证。它是开证行对受益人开出的担保文件。保证开证申请人履行自己的职责,否则银行负责清偿所欠受益的款项。
=== 国际信贷与投资
国际信贷与投资是商业银行国际业务中的资产业务。国际信贷与投资与国内资产业务有所不同。这种业务的对象绝大部分是国外借款者。
==== 进出口融资
商业银行国际信贷活动的一个重要方面,是为国际贸易提供资金融通。这种资金融通的对象,包括本国和外国的进出口商人。
商业银行为进出口贸易提供资金融通的形式很多,主要有以下几种:
进口押汇,是指进出口双方签订买卖合同后,进口方请求进口地的某个银行(一般为自己的往来银行),向出口方开立保证付款文件,大多为信用证。然后,开证行将此文件寄送给出口商,出口商见证后,将货物发运给进口商。银行为进口商开立信用保证文件的这一过程。
出口押汇,出口商根据买卖合同的规定向进口商发出货物后,取得了各种单据,同时,根据有关条款,向进口商开发汇票。
另外,提供资金融通的方式还有打包贷款,票据承兑,出口贷款等。
==== 国际贷款
国际贷款由于超越了国界,在贷款的对象、贷款的风险、贷款的方式等方面,都与国内贷款具有不同之处。商业银行国际贷款的类型,可以从不同的角度进行划分。
根据贷款对象的不同,可以划分为个人贷款、企业贷款、银行间贷款以及对外国政府和中央银行的贷款。
根据贷款期限的不同,可以划分为短期贷款、中期贷款和长期贷款,这种期限的划分与国内贷款形式大致相同。
根据贷款银行的不同,可以划分为单一银行贷款和多银行贷款。
单一银行贷款:是指贷款资金仅由一个银行提供。一般来说,单一银行贷款一般数额较小,期限较短。
多银行贷款:是指一笔贷款由几家银行共同提供,这种贷款主要有两种类型:第一,参与制贷款。第二,辛迪加贷款。
==== 国际投资
根据证券投资对象的不同。商业银行国际投资可以分为外国债券投资和欧洲债券投资两种。
外国债券投资。
外国债券(ForeignBond)是指由外国债务人在投资人所在国发行的,以投资国货币标价的借款凭证。外国债券的发行人包括外国公司、外国政府和国际组织。外国债券的购买人为债权国的工商企业、金融机构以及个人等,其中,商业银行是重要的投资者。
欧洲债券投资。
欧洲债券(Europe-Bond)是指债务人在欧洲金融市场上发行的,以销售国以外的货币标价的借款凭证。欧洲债券是目前国际债券的最主要形式。
欧洲债券有很多形式:
. 普通债券(Straight Band): 这是欧洲债券的基本形式,其特点是:债券的利息固定,有明确的到期日,由于所支付的利息不随金融市场上利率的变化而升降,因此,当市场利率波动剧烈时,就会影响其发行量。
. 复合货币债券(Multiple-Currency Bond): 债务人发行债券时,以几种货币表示债券的面值。投资人购买债券时,以其中的一种货币付款。
. 浮动利率债券(Floating Rate Bond): 浮动利率债券是指债券的票面利率随金融市场利率水平的变化而调整的债券。
. 可转换为股票的债券(Convertible Euro-Bond): 这种债券的特点是:债务人在发行债券时事行授权,投资者可以根据自己的愿望,将此种债券转换为发行公司的股票,成为该公司的股东。
商业银行的国际业务中,外汇交易业务也是很重要的一部分,它包括:外汇头寸、即期外汇买卖、远期外汇买卖、期权交易、套汇与套利、以及投机等。
== 银行间交易业务
=== 联行往来的基本概念
社会资金往来运动最终要体现在银行间的划拨上,当资金结算业务发生时,必然要通过两个或两个以上的银行机构往来才能完成,如果往来双方同属一个银行系统,即同属一个总行的各个分支机构间的资金帐务往来,则称其为联行往来:
. 全国联行往来: 全国联行往来适用于总行与所属各级分支之间以及不同省、自治区、直辖市各机构之间的资金帐务往来。全国联行往业帐务由总行负责监督管理。
. 分行辖内往来: 分行辖内往来适用于省、自治区、直辖市分行与所辖各分支机构之间以及同一省、自治区、直辖市辖内各银行机构之间的资金帐务往来。分行辖内联行在往来帐务由分行负责监督管理。
. 支行辖内往来: 支行辖内往来适用于县(市)支行与所属各机构之间以及同一县(市)支行内各机构之间的资金帐务往来。其所涉及的帐务由县(市)支行管理监督。
=== 联行往来账务核算
. 发报行核算: 发报行是联行往来帐务的发生行,是保证联行帐务正确进行的基础,对整个联行工作质量,起着重要作用。包括:报单的编制;报单的审查与寄发;联行往帐报告表的编制。
. 收报行核算: 收报行是联行往帐的受理者,它对发报行寄来的联行报单及所附凭证,必须进行认真审核和再复核,并应准确、迅速办理转帐和对帐,以保证全国联行往来核算工作的正确进行。
. 总行电子计算中心: 总行电子计算中心是对全国联行往来帐务进行逐笔集中监督的部门,它根据联行往帐报告表监督联行往帐;按收报行行号编制对帐表,寄收报行对帐,监督联行来帐,以保证全国联行往帐与来帐双方一致。

4
io.sc.platform.developer.doc/asciidoc/index.adoc

@ -32,10 +32,8 @@
本参考手册不仅适用于初级入门人员的培训材料使用,同样也可以作为高级开发人员的参考手册使用。 本参考手册不仅适用于初级入门人员的培训材料使用,同样也可以作为高级开发人员的参考手册使用。
include::getting-started/getting-started.adoc[leveloffset=+1] include::getting-started/getting-started.adoc[leveloffset=+1]
include::platform-extension/platform-extension.adoc[leveloffset=+1] include::platform-extension/platform-extension.adoc[leveloffset=+1]
include::bank-business/bank-business.adoc[leveloffset=+1]
include::9999-appendix/appendix.adoc[leveloffset=+1] include::9999-appendix/appendix.adoc[leveloffset=+1]

BIN
io.sc.platform.developer.doc/asciidoc/resources/files/bank-business/银行业务分类.xmind

Binary file not shown.

BIN
io.sc.platform.developer.doc/asciidoc/resources/images/bank-business/001.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

4
io.sc.platform.developer.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "io.sc.platform.developer.frontend", "name": "io.sc.platform.developer.frontend",
"version": "8.1.36", "version": "8.1.37",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.187",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

195
io.sc.platform.developer.frontend/src/views/backend/ExportLiquibase.vue

@ -1,58 +1,102 @@
<template> <template>
<div> <div>
<w-form <div class="row py-1 q-col-gutter-sm">
ref="formRef" <div class="col-2">
:fields="[ <q-select
{ v-model="valueReactive.datasource"
name: 'datasource', :label="$t('developer.backend.export.liquibase.datasource')"
label: $t('developer.backend.export.liquibase.datasource'), outlined
type: 'select', dense
clearable: true, emit-value
options: datasourceOptionsRef, map-options
'onUpdate:modelValue': (value) => { :options="datasourceOptionsRef"
datasourceChanged(value); @update:model-value="
}, (value) => {
}, datasourceChanged(value);
{ }
name: 'schema', "
label: $t('developer.backend.export.liquibase.schema'), ></q-select>
type: 'select', </div>
options: schemaOptionsRef, <div class="col-2">
'onUpdate:modelValue': (value) => { <q-select
schemaChanged(formRef.getFieldValue('datasource'), value); v-model="valueReactive.schema"
}, :label="$t('developer.backend.export.liquibase.schema')"
required: true, outlined
}, dense
{ emit-value
name: 'tables', map-options
label: $t('developer.backend.export.liquibase.tables'), :options="schemaOptionsRef"
type: 'select', @update:model-value="
multiple: true, (value) => {
clearable: true, schemaChanged(valueReactive.datasource, value);
options: tablesOptionsRef, }
'onUpdate:modelValue': (value) => { "
if (value) { ></q-select>
if (value.length > 1) { </div>
formRef.setFieldValue('sql', 'select * from ${table}'); <div class="col-8">
} else { <q-select
formRef.setFieldValue('sql', 'select * from ' + value); v-model="valueReactive.tables"
:label="$t('developer.backend.export.liquibase.tables')"
input-class="bg-red-200"
outlined
dense
emit-value
map-options
multiple
use-chips
:options="tablesOptionsRef"
@update:model-value="
(value) => {
if (value) {
if (value.length > 1) {
valueReactive.sql = 'select * from ${table}';
} else {
valueReactive.sql = 'select * from ' + value;
}
} }
} }
}, "
required: true, >
}, <template #append>
{ name: 'fetchSize', label: 'Fetch Size', type: 'number', defaultValue: 1000 }, <q-btn
{ :title="$t('selectAll')"
name: 'sql', icon="bi-check-square"
label: 'SQL', flat
type: 'code-mirror', dense
colSpan: 4, :disable="!(tablesOptionsRef?.length > 0)"
rows: 5, @click.stop.prevent="
lang: 'sql', () => {
}, const selecteds = [];
]" if (tablesOptionsRef) {
> for (const table of tablesOptionsRef) {
</w-form> selecteds.push(table.value);
}
}
valueReactive.tables = selecteds;
}
"
/>
<q-btn
:title="$t('unSelectAll')"
icon="bi-square"
flat
dense
:disable="!(tablesOptionsRef?.length > 0)"
@click.stop.prevent="
() => {
valueReactive.tables = [];
}
"
/>
</template>
</q-select>
</div>
</div>
<div class="row py-1 q-col-gutter-sm">
<div class="col-12">
<w-code-mirror v-model="valueReactive.sql" :label="$t('sql')" :rows="5" lang="sql"></w-code-mirror>
</div>
</div>
<div class="row justify-center q-gutter-md py-2"> <div class="row justify-center q-gutter-md py-2">
<w-progress-btn <w-progress-btn
@ -61,22 +105,33 @@
:label="$t('export')" :label="$t('export')"
data-url="/api/jdbc/data/traceExporterExecuteProgress" data-url="/api/jdbc/data/traceExporterExecuteProgress"
@click="exportData" @click="exportData"
@success="
(progressInfo) => {
Downloader.get(Environment.apiContextPath('/api/mvc/download?filePath=' + encodeURIComponent(progressInfo.result)));
}
"
></w-progress-btn> ></w-progress-btn>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, toRaw, onMounted, onUpdated } from 'vue'; import { ref, reactive, onMounted, onUpdated } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { axios, Environment, EnumTools, Formater, Options, DialogManager, NotifyManager, Tools } from 'platform-core'; import { axios, Environment, DialogManager, Downloader } from 'platform-core';
const { t } = useI18n(); const { t } = useI18n();
const formRef = ref();
const progressBtnRef = ref(); const progressBtnRef = ref();
const datasourceOptionsRef = ref([]); const datasourceOptionsRef = ref([]);
const schemaOptionsRef = ref([]); const schemaOptionsRef = ref([]);
const tablesOptionsRef = ref([]); const tablesOptionsRef = ref([]);
const valueReactive = reactive({
datasource: undefined,
schema: undefined,
tables: undefined,
sql: undefined,
});
const loadDatasource = () => { const loadDatasource = () => {
axios.get(Environment.apiContextPath('/api/system/datasource?pageable=false&sortBy=name')).then((response) => { axios.get(Environment.apiContextPath('/api/system/datasource?pageable=false&sortBy=name')).then((response) => {
const data = response?.data.content; const data = response?.data.content;
@ -118,25 +173,21 @@ const schemaChanged = (datasource: string, schema: string) => {
}; };
const exportData = (e) => { const exportData = (e) => {
formRef.value.validate().then((value) => { DialogManager.confirm(t('developer.backend.export.liquibase.export.tip'), () => {
if (value) { const data = valueReactive;
DialogManager.confirm(t('developer.backend.export.liquibase.export.tip'), () => { const config = {
const data = formRef.value.getData(); datasource: data.datasource,
const config = { schema: data.schema,
datasource: data.datasource, tables: [],
schema: data.schema, };
tables: [], const length = data.tables.length;
}; const sql = length === 1 ? data.sql : '';
const length = data.tables.length; for (let i = 0; i < length; i++) {
const sql = length === 1 ? formRef.value.getFieldValue('sql') : ''; config.tables[i] = { name: data.tables[i], sql: sql ? sql : 'select * from ' + data.tables[i] };
for (let i = 0; i < length; i++) {
config.tables[i] = { name: data.tables[i], sql: sql ? sql : 'select * from ' + data.tables[i] };
}
axios.post(Environment.apiContextPath('/api/jdbc/data/exportData'), config).then((response) => {
progressBtnRef.value.start();
});
});
} }
axios.post(Environment.apiContextPath('/api/jdbc/data/exportData'), config).then((response) => {
progressBtnRef.value.start();
});
}); });
}; };

2
io.sc.platform.gradle/templates/pgp/app/build.gradle

@ -25,6 +25,8 @@ dependencies {
project(":io.sc.engine.rule.server"), project(":io.sc.engine.rule.server"),
project(":io.sc.engine.rule.sample"), project(":io.sc.engine.rule.sample"),
project(":erm"),
// project(":erm"), // project(":erm"),
// project(":erm.frontend"), // project(":erm.frontend"),

6
io.sc.platform.gradle/templates/pgp/setup/gradle.properties

@ -36,9 +36,9 @@ application_version=1.0.0
# platform # platform
########################################################### ###########################################################
platform_group=io.sc platform_group=io.sc
platform_version=8.1.36 platform_version=8.1.37
platform_plugin_version=8.1.13 platform_plugin_version=8.1.13
platform_core_frontend_version=8.1.179 platform_core_frontend_version=8.1.182
########################################################### ###########################################################
# dependencies version # dependencies version
@ -62,7 +62,7 @@ jxls_jexcel_version=1.0.7
jxls_poi_version=1.0.15 jxls_poi_version=1.0.15
jxls_version=2.4.6 jxls_version=2.4.6
mybatis_version=3.5.10 mybatis_version=3.5.10
ooxml_schemas_version=4.1.2 ooxml_schemas_version=1.4
opencsv_version=5.7.1 opencsv_version=5.7.1
oshi_version=6.4.2 oshi_version=6.4.2
p6spy_version=3.9.1 p6spy_version=3.9.1

12
io.sc.platform.installer/src/main/java/io/sc/platform/installer/controller/InstallerWebController.java

@ -1,10 +1,12 @@
package io.sc.platform.installer.controller; package io.sc.platform.installer.controller;
import io.sc.platform.core.Environment; import io.sc.platform.core.Environment;
import io.sc.platform.core.service.ProgressableThreadService;
import io.sc.platform.core.service.RuntimeService; import io.sc.platform.core.service.RuntimeService;
import io.sc.platform.core.support.ProgressInfo; import io.sc.platform.core.support.ProgressInfo;
import io.sc.platform.core.util.IpUtil; import io.sc.platform.core.util.IpUtil;
import io.sc.platform.installer.service.InstallerService; import io.sc.platform.installer.service.InstallerService;
import io.sc.platform.installer.support.InstallerProgressableThread;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.MessageSource; import org.springframework.context.MessageSource;
@ -20,6 +22,7 @@ import java.util.Map;
public class InstallerWebController { public class InstallerWebController {
@Autowired private ApplicationContext applicationContext; @Autowired private ApplicationContext applicationContext;
@Autowired private InstallerService installerService; @Autowired private InstallerService installerService;
@Autowired private ProgressableThreadService progressableThreadService;
@Autowired private MessageSource messageSource; @Autowired private MessageSource messageSource;
@Autowired private RuntimeService runtimeService; @Autowired private RuntimeService runtimeService;
@ -51,13 +54,16 @@ public class InstallerWebController {
@PostMapping("/install") @PostMapping("/install")
@ResponseBody @ResponseBody
public void install(@RequestBody Map<String,String> config) throws Exception{ public void install(@RequestBody Map<String,String> config) throws Exception{
installerService.install(config); InstallerProgressableThread thread =new InstallerProgressableThread();
thread.setInstallerService(installerService);
thread.setConfig(config);
progressableThreadService.start(thread);
} }
@GetMapping("/progress") @GetMapping("/progress")
@ResponseBody @ResponseBody
public ProgressInfo getProgress(){ public ProgressInfo getProgress() throws Exception{
return installerService.getProgressInfo(); return progressableThreadService.getProgressInfo(InstallerProgressableThread.class.getName());
} }
@GetMapping("/info") @GetMapping("/info")

9
io.sc.platform.installer/src/main/java/io/sc/platform/installer/service/InstallerService.java

@ -37,13 +37,8 @@ public interface InstallerService {
/** /**
* 安装 * 安装
* @param config 安装配置 * @param config 安装配置
* @param progressInfo 安装进度信息对象
* @throws Exception 违例 * @throws Exception 违例
*/ */
public void install(Map<String,String> config) throws Exception; public void install(Map<String,String> config,ProgressInfo progressInfo) throws Exception;
/**
* 获取安装进度对象
* @return 安装进度对象
*/
public ProgressInfo getProgressInfo();
} }

39
io.sc.platform.installer/src/main/java/io/sc/platform/installer/service/impl/InstallerServiceImpl.java

@ -33,7 +33,6 @@ public class InstallerServiceImpl implements InstallerService {
private Boolean isInstalled; private Boolean isInstalled;
private List<InstallerItem> installerItems; private List<InstallerItem> installerItems;
private ProgressInfo progressInfo =new ProgressInfo(1,1);
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
@ -84,41 +83,29 @@ public class InstallerServiceImpl implements InstallerService {
} }
@Override @Override
@Async public void install(Map<String, String> config,ProgressInfo progressInfo) throws Exception {
public void install(Map<String, String> config) throws Exception {
List<InstallerItem> items =getInstallerItems(); List<InstallerItem> items =getInstallerItems();
if(items!=null && !items.isEmpty()){ if(items!=null && !items.isEmpty()){
int totalWeight =0; int totalWeight =0;
for(InstallerItem item : items){ for(InstallerItem item : items){
totalWeight +=item.getWeight(); totalWeight +=item.getWeight();
} }
progressInfo =new ProgressInfo(totalWeight,0); progressInfo.setTotalWeight(totalWeight);
try { // 安装
// 安装 for(InstallerItem item : items){
for(InstallerItem item : items){ progressInfo.setMessageKey(item.getProgressMessageKey());
progressInfo.setMessageKey(item.getProgressMessageKey()); Thread.sleep(1000);
Thread.sleep(1000); item.install(config,progressInfo,applicationContext);
item.install(config,progressInfo,applicationContext); progressInfo.addWeight(item.getWeight());
progressInfo.addWeight(item.getWeight()); }
} // 安装成功后
// 安装成功后 for(InstallerItem item : items){
for(InstallerItem item : items){ item.success(config,progressInfo,applicationContext);
item.success(config,progressInfo,applicationContext);
}
progressInfo.done();
} catch (Exception e) {
progressInfo.setErrorMessage(e.getMessage());
progressInfo.setErrorStackTrace(StringUtil.getStackTrace(e));
throw e;
} }
progressInfo.done();
} }
} }
@Override
public ProgressInfo getProgressInfo() {
return progressInfo;
}
private String buildLogMessage(List<InstallerItem> items){ private String buildLogMessage(List<InstallerItem> items){
Table table =new Table("There are " + items.size() + " installer item was found:"); Table table =new Table("There are " + items.size() + " installer item was found:");
table table

47
io.sc.platform.installer/src/main/java/io/sc/platform/installer/support/InstallerProgressableThread.java

@ -0,0 +1,47 @@
package io.sc.platform.installer.support;
import io.sc.platform.core.enums.ProgressStatus;
import io.sc.platform.core.support.ProgressableThread;
import io.sc.platform.core.util.StringUtil;
import io.sc.platform.installer.service.InstallerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
public class InstallerProgressableThread extends ProgressableThread {
private static final Logger log = LoggerFactory.getLogger(InstallerProgressableThread.class);
private InstallerService installerService;
private Map<String,String> config;
@Override
public void run() {
if(installerService!=null && config!=null){
try {
installerService.install(config,progressInfo);
progressInfo.setStatus(ProgressStatus.COMPLETED);
} catch (Exception e) {
log.error("",e);
progressInfo.setStatus(ProgressStatus.ERROR);
progressInfo.setErrorMessage(e.getMessage());
progressInfo.setErrorStackTrace(StringUtil.getStackTrace(e));
}
}
}
public InstallerService getInstallerService() {
return installerService;
}
public void setInstallerService(InstallerService installerService) {
this.installerService = installerService;
}
public Map<String, String> getConfig() {
return config;
}
public void setConfig(Map<String, String> config) {
this.config = config;
}
}

9
io.sc.platform.jdbc.liquibase/src/main/java/io/sc/platform/jdbc/liquibase/exporter/LiquibaseDataCsvExporter.java

@ -1,6 +1,7 @@
package io.sc.platform.jdbc.liquibase.exporter; package io.sc.platform.jdbc.liquibase.exporter;
import io.sc.platform.core.DirectoryManager; import io.sc.platform.core.DirectoryManager;
import io.sc.platform.core.enums.ProgressStatus;
import io.sc.platform.core.support.ProgressInfo; import io.sc.platform.core.support.ProgressInfo;
import io.sc.platform.core.util.DateUtil; import io.sc.platform.core.util.DateUtil;
import io.sc.platform.core.util.FileUtil; import io.sc.platform.core.util.FileUtil;
@ -36,7 +37,7 @@ public class LiquibaseDataCsvExporter implements DataExporter {
@Override @Override
public void exportData(DataSource dataSource, DataExportConfigure configure, ProgressInfo progressInfo, Locale locale) throws Exception{ public void exportData(DataSource dataSource, DataExportConfigure configure, ProgressInfo progressInfo, Locale locale) throws Exception{
progressInfo.setRunning(true); progressInfo.setStatus(ProgressStatus.RUNNING);
progressInfo.setStartDatetime(new Date()); progressInfo.setStartDatetime(new Date());
String[] tableNames =ExportTable.getTableNames(configure.getTables()); String[] tableNames =ExportTable.getTableNames(configure.getTables());
@ -57,9 +58,11 @@ public class LiquibaseDataCsvExporter implements DataExporter {
FileUtil.writeString(outPutDir + "/liquibase.xml",createLiquibaseFileContent(getLiquibaseChangeLogXmlFileName(configure),changeSetSb)); FileUtil.writeString(outPutDir + "/liquibase.xml",createLiquibaseFileContent(getLiquibaseChangeLogXmlFileName(configure),changeSetSb));
ZipUtil.zip(outPutDir); ZipUtil.zip(outPutDir);
// 设置结果为导出的 zip 文件全路径
progressInfo.setResult(outPutDir + ".zip");
//执行完毕 //执行完毕
progressInfo.setCompletedDatetime(new Date()); progressInfo.done();
progressInfo.setCurrentWeight(progressInfo.getTotalWeight());
} }
private void writeTable(DataSource dataSource,Table table,DataExportConfigure configure,ProgressInfo progressInfo, Locale locale) throws Exception{ private void writeTable(DataSource dataSource,Table table,DataExportConfigure configure,ProgressInfo progressInfo, Locale locale) throws Exception{

3
io.sc.platform.jdbc.liquibase/src/main/java/io/sc/platform/jdbc/liquibase/importer/LiquibaseDataCsvImporter.java

@ -2,6 +2,7 @@ package io.sc.platform.jdbc.liquibase.importer;
import io.sc.platform.core.DirectoryManager; import io.sc.platform.core.DirectoryManager;
import io.sc.platform.core.Environment; import io.sc.platform.core.Environment;
import io.sc.platform.core.enums.ProgressStatus;
import io.sc.platform.core.support.ProgressInfo; import io.sc.platform.core.support.ProgressInfo;
import io.sc.platform.core.util.DateUtil; import io.sc.platform.core.util.DateUtil;
import io.sc.platform.core.util.FileUtil; import io.sc.platform.core.util.FileUtil;
@ -36,7 +37,7 @@ import java.util.stream.Collectors;
public class LiquibaseDataCsvImporter implements DataImporter { public class LiquibaseDataCsvImporter implements DataImporter {
@Override @Override
public void importData(DataSource dataSource, DataImportConfigure configure, ProgressInfo progressInfo, Locale locale) throws Exception { public void importData(DataSource dataSource, DataImportConfigure configure, ProgressInfo progressInfo, Locale locale) throws Exception {
progressInfo.setRunning(true); progressInfo.setStatus(ProgressStatus.RUNNING);
progressInfo.setStartDatetime(new Date()); progressInfo.setStartDatetime(new Date());
progressInfo.setTotalWeight(configure.getFiles().size()+1); progressInfo.setTotalWeight(configure.getFiles().size()+1);
progressInfo.addWeight(1); progressInfo.addWeight(1);

55
io.sc.platform.jdbc/src/main/java/io/sc/platform/jdbc/controller/JdbcDataWebController.java

@ -1,9 +1,9 @@
package io.sc.platform.jdbc.controller; package io.sc.platform.jdbc.controller;
import io.sc.platform.core.service.ProgressableThreadService;
import io.sc.platform.core.support.ProgressInfo; import io.sc.platform.core.support.ProgressInfo;
import io.sc.platform.jdbc.controller.support.ExporterThread; import io.sc.platform.jdbc.controller.support.ExporterThread;
import io.sc.platform.jdbc.controller.support.ImporterThread; import io.sc.platform.jdbc.controller.support.ImporterThread;
import io.sc.platform.jdbc.exporter.exception.ExporterRunningException;
import io.sc.platform.jdbc.exporter.support.DataExportConfigure; import io.sc.platform.jdbc.exporter.support.DataExportConfigure;
import io.sc.platform.jdbc.exporter.support.DataImportConfigure; import io.sc.platform.jdbc.exporter.support.DataImportConfigure;
import io.sc.platform.jdbc.service.JdbcDataService; import io.sc.platform.jdbc.service.JdbcDataService;
@ -11,15 +11,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.util.Locale; import java.util.Locale;
@RestController @RestController
@RequestMapping("/api/jdbc/data") @RequestMapping("/api/jdbc/data")
public class JdbcDataWebController { public class JdbcDataWebController {
@Autowired private JdbcDataService jdbcDataService; @Autowired private JdbcDataService jdbcDataService;
private ImporterThread importerThread =null; @Autowired private ProgressableThreadService progressableThreadService;
private ExporterThread exporterThread =null;
@PostMapping("importData") @PostMapping("importData")
public void importData( public void importData(
@ -28,63 +26,28 @@ public class JdbcDataWebController {
@RequestPart(name="files",required = false) MultipartFile multipartFile, @RequestPart(name="files",required = false) MultipartFile multipartFile,
Locale locale) throws Exception Locale locale) throws Exception
{ {
//检查有当前用户启动的执行线程是否正在运行
if(importerThread!=null && importerThread.isAlive()){
throw new ExporterRunningException();
}
DataImportConfigure configure =new DataImportConfigure(); DataImportConfigure configure =new DataImportConfigure();
configure.setDatasource(datasource); configure.setDatasource(datasource);
configure.setDeleteFirst(deleteFirst); configure.setDeleteFirst(deleteFirst);
configure.addFile(multipartFile); configure.addFile(multipartFile);
//启动新线程
importerThread =new ImporterThread(jdbcDataService,configure,locale); ImporterThread thread =new ImporterThread(jdbcDataService,configure,locale);
importerThread.start(); progressableThreadService.start(thread);
} }
@PostMapping("exportData") @PostMapping("exportData")
public void exportData(@RequestBody DataExportConfigure configure, Locale locale) throws Exception { public void exportData(@RequestBody DataExportConfigure configure, Locale locale) throws Exception {
//检查有当前用户启动的执行线程是否正在运行 ExporterThread thread =new ExporterThread(jdbcDataService,configure,locale);
if(exporterThread!=null && exporterThread.isAlive()){ progressableThreadService.start(thread);
throw new ExporterRunningException();
}
//启动新线程
exporterThread =new ExporterThread(jdbcDataService,configure,locale);
exporterThread.start();
} }
@GetMapping("traceImporterExecuteProgress") @GetMapping("traceImporterExecuteProgress")
public ProgressInfo traceImporterExecuteProgress(Locale locale) throws Exception{ public ProgressInfo traceImporterExecuteProgress(Locale locale) throws Exception{
if(importerThread!=null){ return progressableThreadService.getProgressInfo(ImporterThread.class.getName());
Exception exception =importerThread.getException();
if(exception!=null){
importerThread.setException(null);
throw exception;
}
if(importerThread.isAlive()){
if(importerThread.getException()!=null){
throw importerThread.getException();
}
return importerThread.getProgressInfo();
}
}
return ProgressInfo.notRunning();
} }
@GetMapping("traceExporterExecuteProgress") @GetMapping("traceExporterExecuteProgress")
public ProgressInfo traceExporterExecuteProgress(Locale locale) throws Exception{ public ProgressInfo traceExporterExecuteProgress(Locale locale) throws Exception{
if(exporterThread!=null){ return progressableThreadService.getProgressInfo(ExporterThread.class.getName());
Exception exception =exporterThread.getException();
if(exception!=null){
exporterThread.setException(null);
throw exception;
}
if(exporterThread.isAlive()){
if(exporterThread.getException()!=null){
throw exporterThread.getException();
}
return exporterThread.getProgressInfo();
}
}
return ProgressInfo.notRunning();
} }
} }

23
io.sc.platform.jdbc/src/main/java/io/sc/platform/jdbc/controller/support/ExporterThread.java

@ -1,6 +1,9 @@
package io.sc.platform.jdbc.controller.support; package io.sc.platform.jdbc.controller.support;
import io.sc.platform.core.enums.ProgressStatus;
import io.sc.platform.core.support.ProgressInfo; import io.sc.platform.core.support.ProgressInfo;
import io.sc.platform.core.support.ProgressableThread;
import io.sc.platform.core.util.StringUtil;
import io.sc.platform.jdbc.exporter.support.DataExportConfigure; import io.sc.platform.jdbc.exporter.support.DataExportConfigure;
import io.sc.platform.jdbc.service.JdbcDataService; import io.sc.platform.jdbc.service.JdbcDataService;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -8,13 +11,11 @@ import org.slf4j.LoggerFactory;
import java.util.Locale; import java.util.Locale;
public class ExporterThread extends Thread { public class ExporterThread extends ProgressableThread {
private Logger log = LoggerFactory.getLogger(ExporterThread.class); private Logger log = LoggerFactory.getLogger(ExporterThread.class);
private JdbcDataService jdbcDataService; private JdbcDataService jdbcDataService;
private DataExportConfigure configure; private DataExportConfigure configure;
private Locale locale; private Locale locale;
private volatile ProgressInfo progressInfo =new ProgressInfo(100,0);
private Exception exception;
public ExporterThread(JdbcDataService jdbcDataService, DataExportConfigure configure, Locale locale){ public ExporterThread(JdbcDataService jdbcDataService, DataExportConfigure configure, Locale locale){
this.jdbcDataService =jdbcDataService; this.jdbcDataService =jdbcDataService;
@ -24,20 +25,14 @@ public class ExporterThread extends Thread {
@Override @Override
public void run() { public void run() {
try { try {
progressInfo.setStatus(ProgressStatus.RUNNING);
jdbcDataService.exportData(configure,progressInfo,locale); jdbcDataService.exportData(configure,progressInfo,locale);
progressInfo.setStatus(ProgressStatus.COMPLETED);
} catch (Exception e) { } catch (Exception e) {
this.exception =e;
log.error("",e); log.error("",e);
progressInfo.setStatus(ProgressStatus.ERROR);
progressInfo.setErrorMessage(e.getMessage());
progressInfo.setErrorStackTrace(StringUtil.getStackTrace(e));
} }
} }
public ProgressInfo getProgressInfo(){
return progressInfo;
}
public Exception getException() {
return exception;
}
public void setException(Exception exception) {
this.exception = exception;
}
} }

24
io.sc.platform.jdbc/src/main/java/io/sc/platform/jdbc/controller/support/ImporterThread.java

@ -1,6 +1,9 @@
package io.sc.platform.jdbc.controller.support; package io.sc.platform.jdbc.controller.support;
import io.sc.platform.core.enums.ProgressStatus;
import io.sc.platform.core.support.ProgressInfo; import io.sc.platform.core.support.ProgressInfo;
import io.sc.platform.core.support.ProgressableThread;
import io.sc.platform.core.util.StringUtil;
import io.sc.platform.jdbc.exporter.support.DataExportConfigure; import io.sc.platform.jdbc.exporter.support.DataExportConfigure;
import io.sc.platform.jdbc.exporter.support.DataImportConfigure; import io.sc.platform.jdbc.exporter.support.DataImportConfigure;
import io.sc.platform.jdbc.service.JdbcDataService; import io.sc.platform.jdbc.service.JdbcDataService;
@ -9,36 +12,29 @@ import org.slf4j.LoggerFactory;
import java.util.Locale; import java.util.Locale;
public class ImporterThread extends Thread { public class ImporterThread extends ProgressableThread {
private Logger log = LoggerFactory.getLogger(ImporterThread.class); private Logger log = LoggerFactory.getLogger(ImporterThread.class);
private JdbcDataService jdbcDataService; private JdbcDataService jdbcDataService;
private DataImportConfigure configure; private DataImportConfigure configure;
private Locale locale; private Locale locale;
private volatile ProgressInfo progressInfo =new ProgressInfo(100,0);
private Exception exception;
public ImporterThread(JdbcDataService jdbcDataService, DataImportConfigure configure, Locale locale){ public ImporterThread(JdbcDataService jdbcDataService, DataImportConfigure configure, Locale locale){
this.jdbcDataService =jdbcDataService; this.jdbcDataService =jdbcDataService;
this.configure =configure; this.configure =configure;
this.locale =locale; this.locale =locale;
} }
@Override @Override
public void run() { public void run() {
try { try {
progressInfo.setStatus(ProgressStatus.RUNNING);
jdbcDataService.importData(configure,progressInfo,locale); jdbcDataService.importData(configure,progressInfo,locale);
progressInfo.setStatus(ProgressStatus.COMPLETED);
} catch (Exception e) { } catch (Exception e) {
this.exception =e;
log.error("",e); log.error("",e);
progressInfo.setStatus(ProgressStatus.ERROR);
progressInfo.setErrorMessage(e.getMessage());
progressInfo.setErrorStackTrace(StringUtil.getStackTrace(e));
} }
} }
public ProgressInfo getProgressInfo(){
return progressInfo;
}
public Exception getException() {
return exception;
}
public void setException(Exception exception) {
this.exception = exception;
}
} }

4
io.sc.platform.lcdp.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "io.sc.platform.lcdp.frontend", "name": "io.sc.platform.lcdp.frontend",
"version": "8.1.36", "version": "8.1.37",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.182",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

4
io.sc.platform.mvc.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "io.sc.platform.mvc.frontend", "name": "io.sc.platform.mvc.frontend",
"version": "8.1.36", "version": "8.1.37",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.182",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

15
io.sc.platform.mvc/src/main/java/io/sc/platform/mvc/controller/DownloaderController.java

@ -4,19 +4,28 @@ import io.sc.platform.mvc.support.FileDownloader;
import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
@Controller @Controller
@RequestMapping("/api/mvc") @RequestMapping("/api/mvc")
public class DownloaderController { public class DownloaderController {
@RequestMapping(value="download",method=RequestMethod.GET) @RequestMapping(value="download",method=RequestMethod.GET)
public void downloadLogFile(@RequestParam("filePath") String filePath,@RequestParam("exportName") String exportName,HttpServletRequest request,HttpServletResponse response) throws Exception{ public void downloadLogFile(@RequestParam("filePath") String filePath,@RequestParam(value = "exportName",required = false) String exportName,HttpServletRequest request,HttpServletResponse response) throws Exception{
Resource resource =new DefaultResourceLoader().getResource("file:" + filePath); File file =new File(filePath);
FileDownloader.download(request, response, exportName, resource); if(file.isFile() && file.exists()) {
if(StringUtils.hasText(exportName)) {
FileDownloader.download(request, response, exportName, new FileInputStream(file));
}else{
FileDownloader.download(request, response, file.getName(), new FileInputStream(file));
}
}
} }
} }

20
io.sc.platform.mvc/src/main/java/io/sc/platform/mvc/support/FileDownloader.java

@ -1,19 +1,17 @@
package io.sc.platform.mvc.support; package io.sc.platform.mvc.support;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.Base64;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
import org.springframework.util.StringUtils;
public class FileDownloader { public class FileDownloader {
private static final Logger log =LoggerFactory.getLogger(FileDownloader.class); private static final Logger log =LoggerFactory.getLogger(FileDownloader.class);
@ -40,8 +38,8 @@ public class FileDownloader {
bos = new BufferedOutputStream(response.getOutputStream()); bos = new BufferedOutputStream(response.getOutputStream());
byte[] buff = new byte[2048]; byte[] buff = new byte[2048];
int bytesRead; int bytesRead;
while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) { while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
bos.write(buff, 0, bytesRead); bos.write(buff, 0, bytesRead);
} }
} catch (IOException e) { } catch (IOException e) {
log.error("",e); log.error("",e);

6
io.sc.platform.mvc/src/main/resources/META-INF/platform/plugins/application-properties.json

@ -87,10 +87,10 @@
"description": "servlet multipart configuration", "description": "servlet multipart configuration",
"properties": [ "properties": [
"spring.servlet.multipart.enabled = true", "spring.servlet.multipart.enabled = true",
"spring.servlet.multipart.file-size-threshold = 0", "spring.servlet.multipart.file-size-threshold = 100MB",
"spring.servlet.multipart.location = ${application.home.dir}/work/web/upload", "spring.servlet.multipart.location = ${application.home.dir}/work/web/upload",
"spring.servlet.multipart.max-file-size = -1", "spring.servlet.multipart.max-file-size = 100MB",
"spring.servlet.multipart.max-request-size = -1", "spring.servlet.multipart.max-request-size = 200MB",
"spring.servlet.multipart.resolve-lazily = false" "spring.servlet.multipart.resolve-lazily = false"
] ]
} }

4
io.sc.platform.security.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "io.sc.platform.security.frontend", "name": "io.sc.platform.security.frontend",
"version": "8.1.36", "version": "8.1.37",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [ "keywords": [
@ -93,7 +93,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.182",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

4
io.sc.platform.system.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "io.sc.platform.system.frontend", "name": "io.sc.platform.system.frontend",
"version": "8.1.36", "version": "8.1.37",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.182",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

46
io.sc.standard.api/src/main/java/io/sc/standard/api/AdminDivisionVo.java

@ -4,9 +4,13 @@ import io.sc.platform.orm.api.vo.AuditorVo;
public class AdminDivisionVo extends AuditorVo { public class AdminDivisionVo extends AuditorVo {
private String code; private String code;
private String parent;
private String name; private String name;
private String description; private String description;
private String mappingCode;
private String mappingName;
private String mappingDescription;
private String parent;
public String getCode() { public String getCode() {
return code; return code;
@ -16,14 +20,6 @@ public class AdminDivisionVo extends AuditorVo {
this.code = code; this.code = code;
} }
public String getParent() {
return parent;
}
public void setParent(String parent) {
this.parent = parent;
}
public String getName() { public String getName() {
return name; return name;
} }
@ -39,4 +35,36 @@ public class AdminDivisionVo extends AuditorVo {
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
public String getMappingCode() {
return mappingCode;
}
public void setMappingCode(String mappingCode) {
this.mappingCode = mappingCode;
}
public String getMappingName() {
return mappingName;
}
public void setMappingName(String mappingName) {
this.mappingName = mappingName;
}
public String getMappingDescription() {
return mappingDescription;
}
public void setMappingDescription(String mappingDescription) {
this.mappingDescription = mappingDescription;
}
public String getParent() {
return parent;
}
public void setParent(String parent) {
this.parent = parent;
}
} }

60
io.sc.standard.api/src/main/java/io/sc/standard/api/CounterpartyVo.java

@ -0,0 +1,60 @@
package io.sc.standard.api;
import io.sc.platform.orm.api.vo.AuditorVo;
public class CounterpartyVo extends AuditorVo {
private String code;
private String name;
private String description;
private String mappingCode;
private String mappingName;
private String mappingDescription;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMappingCode() {
return mappingCode;
}
public void setMappingCode(String mappingCode) {
this.mappingCode = mappingCode;
}
public String getMappingName() {
return mappingName;
}
public void setMappingName(String mappingName) {
this.mappingName = mappingName;
}
public String getMappingDescription() {
return mappingDescription;
}
public void setMappingDescription(String mappingDescription) {
this.mappingDescription = mappingDescription;
}
}

131
io.sc.standard.api/src/main/java/io/sc/standard/api/CountryVo.java

@ -0,0 +1,131 @@
package io.sc.standard.api;
import io.sc.platform.orm.api.vo.AuditorVo;
public class CountryVo extends AuditorVo {
private String code;
private String codeLatin2;
private String codeLatin3;
private String nameChinese;
private String nameChineseFull;
private String nameEnglish;
private String nameEnglishFull;
private String nameLocalShort;
private String remarkChinese;
private String remarkEnglish;
private String languageCode2;
private String languageCode3;
private Boolean isIndependent;
private String currency;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCodeLatin2() {
return codeLatin2;
}
public void setCodeLatin2(String codeLatin2) {
this.codeLatin2 = codeLatin2;
}
public String getCodeLatin3() {
return codeLatin3;
}
public void setCodeLatin3(String codeLatin3) {
this.codeLatin3 = codeLatin3;
}
public String getNameChinese() {
return nameChinese;
}
public void setNameChinese(String nameChinese) {
this.nameChinese = nameChinese;
}
public String getNameChineseFull() {
return nameChineseFull;
}
public void setNameChineseFull(String nameChineseFull) {
this.nameChineseFull = nameChineseFull;
}
public String getNameEnglish() {
return nameEnglish;
}
public void setNameEnglish(String nameEnglish) {
this.nameEnglish = nameEnglish;
}
public String getNameEnglishFull() {
return nameEnglishFull;
}
public void setNameEnglishFull(String nameEnglishFull) {
this.nameEnglishFull = nameEnglishFull;
}
public String getNameLocalShort() {
return nameLocalShort;
}
public void setNameLocalShort(String nameLocalShort) {
this.nameLocalShort = nameLocalShort;
}
public String getRemarkChinese() {
return remarkChinese;
}
public void setRemarkChinese(String remarkChinese) {
this.remarkChinese = remarkChinese;
}
public String getRemarkEnglish() {
return remarkEnglish;
}
public void setRemarkEnglish(String remarkEnglish) {
this.remarkEnglish = remarkEnglish;
}
public String getLanguageCode2() {
return languageCode2;
}
public void setLanguageCode2(String languageCode2) {
this.languageCode2 = languageCode2;
}
public String getLanguageCode3() {
return languageCode3;
}
public void setLanguageCode3(String languageCode3) {
this.languageCode3 = languageCode3;
}
public Boolean getIsIndependent() {
return isIndependent;
}
public void setIsIndependent(Boolean isIndependent) {
this.isIndependent = isIndependent;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
}

51
io.sc.standard.api/src/main/java/io/sc/standard/api/CurrencyVo.java

@ -0,0 +1,51 @@
package io.sc.standard.api;
import io.sc.platform.orm.api.vo.AuditorVo;
public class CurrencyVo extends AuditorVo {
private String code;
private String codeLatin;
private String nameChinese;
private String nameEnglish;
private String precision;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCodeLatin() {
return codeLatin;
}
public void setCodeLatin(String codeLatin) {
this.codeLatin = codeLatin;
}
public String getNameChinese() {
return nameChinese;
}
public void setNameChinese(String nameChinese) {
this.nameChinese = nameChinese;
}
public String getNameEnglish() {
return nameEnglish;
}
public void setNameEnglish(String nameEnglish) {
this.nameEnglish = nameEnglish;
}
public String getPrecision() {
return precision;
}
public void setPrecision(String precision) {
this.precision = precision;
}
}

28
io.sc.standard.api/src/main/java/io/sc/standard/api/IndustryVo.java

@ -6,6 +6,10 @@ public class IndustryVo extends AuditorVo {
private String code; private String code;
private String parent; private String parent;
private String name; private String name;
private String mappingCode;
private String mappingName;
private String mappingDescription;
private String description; private String description;
public String getCode() { public String getCode() {
@ -38,4 +42,28 @@ public class IndustryVo extends AuditorVo {
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
public String getMappingCode() {
return mappingCode;
}
public void setMappingCode(String mappingCode) {
this.mappingCode = mappingCode;
}
public String getMappingName() {
return mappingName;
}
public void setMappingName(String mappingName) {
this.mappingName = mappingName;
}
public String getMappingDescription() {
return mappingDescription;
}
public void setMappingDescription(String mappingDescription) {
this.mappingDescription = mappingDescription;
}
} }

60
io.sc.standard.api/src/main/java/io/sc/standard/api/PerformanceStatusVo.java

@ -0,0 +1,60 @@
package io.sc.standard.api;
import io.sc.platform.orm.api.vo.AuditorVo;
public class PerformanceStatusVo extends AuditorVo {
private String code;
private String name;
private String description;
private String mappingCode;
private String mappingName;
private String mappingDescription;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMappingCode() {
return mappingCode;
}
public void setMappingCode(String mappingCode) {
this.mappingCode = mappingCode;
}
public String getMappingName() {
return mappingName;
}
public void setMappingName(String mappingName) {
this.mappingName = mappingName;
}
public String getMappingDescription() {
return mappingDescription;
}
public void setMappingDescription(String mappingDescription) {
this.mappingDescription = mappingDescription;
}
}

4
io.sc.standard.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "io.sc.standard.frontend", "name": "io.sc.standard.frontend",
"version": "8.1.36", "version": "8.1.37",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.180", "platform-core": "8.1.183",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

51
io.sc.standard.frontend/src/i18n/messages.json

@ -1,11 +1,50 @@
{ {
"menu.system.standard" : "Data Standard Management", "menu.system.standard" : "Data Standard Management",
"standard.GB_T_4754_2017.grid.title" : "Industrial classification for national economic activities", "standard.industry.grid.title" : "Industrial classification for national economic activities",
"standard.GB_T_4754_2017.grid.toolbar.addTop" : "Add Top", "standard.industry.grid.toolbar.addTop" : "Add Top",
"standard.GB_T_4754_2017.grid.toolbar.addChild" : "Add Child", "standard.industry.grid.toolbar.addChild" : "Add Child",
"standard.GB_T_2260_2007.grid.title" : "Administrative Divisions", "standard.adminDivision.grid.title" : "Administrative Divisions",
"standard.GB_T_2260_2007.grid.toolbar.addTop" : "Add Top Administrative Division", "standard.adminDivision.grid.toolbar.addTop" : "Add Top Administrative Division",
"standard.GB_T_2260_2007.grid.toolbar.addChild" : "Add Child Administrative Division" "standard.adminDivision.grid.toolbar.addChild" : "Add Child Administrative Division",
"standard.performanceStatus.grid.title" : "Performance Status",
"standard.counterparty.grid.title" : "Counterparty Category",
"standard.country.grid.title" : "Country or Area",
"standard.country.entity.code" : "Code",
"standard.country.entity.codeLatin2" : "Code2",
"standard.country.entity.codeLatin3" : "Code3",
"standard.country.entity.nameChinese" : "Name(Chinese)",
"standard.country.entity.nameChineseFull" : "Name(Chinese Full)",
"standard.country.entity.nameEnglish" : "Name(English)",
"standard.country.entity.nameEnglishFull" : "Name(English Full)",
"standard.country.entity.nameLocalShort" : "Name(Local Short)",
"standard.country.entity.remarkChinese" : "Remark(Chinese)",
"standard.country.entity.remarkEnglish" : "Remark(English)",
"standard.country.entity.languageCode2" : "Language2",
"standard.country.entity.languageCode3" : "Language3",
"standard.country.entity.isIndependent" : "Is Independent",
"standard.country.entity.currency": "Currency",
"standard.currency.grid.title" : "Currency",
"standard.currency.entity.code" : "Code (Number)",
"standard.currency.entity.codeLatin" : "Code (Char)",
"standard.currency.entity.nameChinese" : "Name(Chinese)",
"standard.currency.entity.nameEnglish" : "Name(English)",
"standard.currency.entity.precision" : "Precision",
"standard.entity.source": "Source(Source System)",
"standard.entity.target": "Target(This System)",
"standard.entity.code" : "Target Code",
"standard.entity.name" : "Target Name",
"standard.entity.description" : "Target Description",
"standard.entity.mappingCode" : "Source Code",
"standard.entity.mappingName" : "Source Name",
"standard.entity.mappingDescription" : "Source Description",
"standard.entity.currency": "Currency",
"standard.entity.language": "Language"
} }

51
io.sc.standard.frontend/src/i18n/messages_tw_CN.json

@ -1,11 +1,50 @@
{ {
"menu.system.standard" : "數據標準管理", "menu.system.standard" : "數據標準管理",
"standard.GB_T_4754_2017.grid.title" : "國民經濟行業分類", "standard.industry.grid.title" : "國民經濟行業分類",
"standard.GB_T_4754_2017.grid.toolbar.addTop" : "添加頂級行業", "standard.industry.grid.toolbar.addTop" : "添加頂級行業",
"standard.GB_T_4754_2017.grid.toolbar.addChild" : "添加子行業", "standard.industry.grid.toolbar.addChild" : "添加子行業",
"standard.GB_T_2260_2007.grid.title" : "行政區劃分", "standard.adminDivision.grid.title" : "行政區劃分",
"standard.GB_T_2260_2007.grid.toolbar.addTop" : "添加頂級行政區", "standard.adminDivision.grid.toolbar.addTop" : "添加頂級行政區",
"standard.GB_T_2260_2007.grid.toolbar.addChild" : "添加子行政區", "standard.adminDivision.grid.toolbar.addChild" : "添加子行政區",
"standard.performanceStatus.grid.title" : "履约状态",
"standard.counterparty.grid.title" : "交易對手類型",
"standard.country.grid.title" : "國家和地區",
"standard.country.entity.code" : "代碼",
"standard.country.entity.codeLatin2" : "代碼(2字母)",
"standard.country.entity.codeLatin3" : "代碼(3字母)",
"standard.country.entity.nameChinese" : "名稱(中文簡稱)",
"standard.country.entity.nameChineseFull" : "名稱(中文全稱)",
"standard.country.entity.nameEnglish" : "名稱(英文簡稱)",
"standard.country.entity.nameEnglishFull" : "名稱(英文全稱)",
"standard.country.entity.nameLocalShort" : "名稱(當地簡稱)",
"standard.country.entity.remarkChinese" : "備註(中文)",
"standard.country.entity.remarkEnglish" : "備註(英文)",
"standard.country.entity.languageCode2" : "語種(2字母)",
"standard.country.entity.languageCode3" : "語種(3字母)",
"standard.country.entity.isIndependent" : "是否獨立?",
"standard.country.entity.currency": "貨幣",
"standard.currency.grid.title" : "貨幣",
"standard.currency.entity.code" : "代碼 (數字)",
"standard.currency.entity.codeLatin" : "代碼 (字母)",
"standard.currency.entity.nameChinese" : "中文名",
"standard.currency.entity.nameEnglish" : "英文名",
"standard.currency.entity.precision" : "輔助單位(精度)",
"standard.entity.source": "源(源系統)",
"standard.entity.target": "目標(本系統)",
"standard.entity.code": "目標代碼",
"standard.entity.name": "目標名稱",
"standard.entity.description": "目標描述",
"standard.entity.mappingCode": "源代碼",
"standard.entity.mappingName": "源名稱",
"standard.entity.mappingDescription": "源描述",
"standard.entity.currency": "貨幣",
"standard.entity.language": "語言"
} }

51
io.sc.standard.frontend/src/i18n/messages_zh_CN.json

@ -1,11 +1,50 @@
{ {
"menu.system.standard" : "数据标准管理", "menu.system.standard" : "数据标准管理",
"standard.GB_T_4754_2017.grid.title" : "国民经济行业分类", "standard.industry.grid.title" : "国民经济行业分类",
"standard.GB_T_4754_2017.grid.toolbar.addTop" : "添加顶级行业", "standard.industry.grid.toolbar.addTop" : "添加顶级行业",
"standard.GB_T_4754_2017.grid.toolbar.addChild" : "添加子行业", "standard.industry.grid.toolbar.addChild" : "添加子行业",
"standard.GB_T_2260_2007.grid.title" : "行政区划分", "standard.adminDivision.grid.title" : "行政区划分",
"standard.GB_T_2260_2007.grid.toolbar.addTop" : "添加顶级行政区", "standard.adminDivision.grid.toolbar.addTop" : "添加顶级行政区",
"standard.GB_T_2260_2007.grid.toolbar.addChild" : "添加子行政区", "standard.adminDivision.grid.toolbar.addChild" : "添加子行政区",
"standard.performanceStatus.grid.title" : "履约状态",
"standard.counterparty.grid.title" : "交易对手类型",
"standard.country.grid.title" : "国家和地区",
"standard.country.entity.code" : "代码",
"standard.country.entity.codeLatin2" : "代码(2字母)",
"standard.country.entity.codeLatin3" : "代码(3字母)",
"standard.country.entity.nameChinese" : "名称(中文简称)",
"standard.country.entity.nameChineseFull" : "名称(中文全称)",
"standard.country.entity.nameEnglish" : "名称(英文简称)",
"standard.country.entity.nameEnglishFull" : "名称(英文全称)",
"standard.country.entity.nameLocalShort" : "名称(当地简称)",
"standard.country.entity.remarkChinese" : "备注(中文)",
"standard.country.entity.remarkEnglish" : "备注(英文)",
"standard.country.entity.languageCode2" : "语种(2字母)",
"standard.country.entity.languageCode3" : "语种(3字母)",
"standard.country.entity.isIndependent" : "是否独立",
"standard.country.entity.currency": "货币",
"standard.currency.grid.title" : "货币",
"standard.currency.entity.code" : "代码 (数字)",
"standard.currency.entity.codeLatin" : "代码 (字母)",
"standard.currency.entity.nameChinese" : "中文名",
"standard.currency.entity.nameEnglish" : "英文名",
"standard.currency.entity.precision" : "辅助单位(精度)",
"standard.entity.source": "源(源系统)",
"standard.entity.target": "目标(本系统)",
"standard.entity.code": "目标代码",
"standard.entity.name": "目标名称",
"standard.entity.description": "目标描述",
"standard.entity.mappingCode": "源代码",
"standard.entity.mappingName": "源名称",
"standard.entity.mappingDescription": "源描述",
"standard.entity.currency": "货币",
"standard.entity.language": "语言"
} }

59
io.sc.standard.frontend/src/views/Standard.vue

@ -2,24 +2,48 @@
<div style="height: 100%"> <div style="height: 100%">
<q-splitter v-model="splitterModelRef" style="height: 100%"> <q-splitter v-model="splitterModelRef" style="height: 100%">
<template #before> <template #before>
<q-tabs v-model="selectedTabRef" vertical active-class="active-class"> <q-tabs v-model="selectedTabRef" vertical>
<q-tab name="GB_T_4754_2017" no-caps> <q-tab name="Industry" no-caps>
<div class="text-left" style="width: 200px">国民经济行业分类</div> <div class="text-left" style="width: 200px">{{ $t('standard.industry.grid.title') }}</div>
</q-tab> </q-tab>
<q-tab name="GB_T_2260_2007" no-caps> <q-tab name="AdminDivision" no-caps>
<div class="text-left" style="width: 200px">行政区划分</div> <div class="text-left" style="width: 200px">{{ $t('standard.adminDivision.grid.title') }}</div>
</q-tab>
<q-tab name="PerformanceStatus" no-caps>
<div class="text-left" style="width: 200px">{{ $t('standard.performanceStatus.grid.title') }}</div>
</q-tab>
<q-tab name="Counterparty" no-caps>
<div class="text-left" style="width: 200px">{{ $t('standard.counterparty.grid.title') }}</div>
</q-tab>
<q-tab name="Country" no-caps>
<div class="text-left" style="width: 200px">{{ $t('standard.country.grid.title') }}</div>
</q-tab>
<q-tab name="Currency" no-caps>
<div class="text-left" style="width: 200px">{{ $t('standard.currency.grid.title') }}</div>
</q-tab> </q-tab>
</q-tabs> </q-tabs>
</template> </template>
<template #after> <template #after>
<div class="pl-1" style="height: 100%"> <div class="pl-1" style="height: 100%">
<q-tab-panels v-model="selectedTabRef" animated swipeable keep-alive style="height: 100%"> <q-tab-panels v-model="selectedTabRef" animated swipeable style="height: 100%">
<q-tab-panel name="GB_T_4754_2017" class="px-0 pb-0" style="height: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 0px"> <q-tab-panel name="Industry" class="px-0 pb-0" style="height: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 0px">
<GB_T_4754_2017></GB_T_4754_2017> <Industry></Industry>
</q-tab-panel>
<q-tab-panel name="AdminDivision" class="px-0 pb-0" style="height: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 0px">
<AdminDivision></AdminDivision>
</q-tab-panel>
<q-tab-panel name="PerformanceStatus" class="px-0 pb-0" style="height: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 0px">
<PerformanceStatus></PerformanceStatus>
</q-tab-panel>
<q-tab-panel name="Counterparty" class="px-0 pb-0" style="height: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 0px">
<Counterparty></Counterparty>
</q-tab-panel>
<q-tab-panel name="Country" class="px-0 pb-0" style="height: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 0px">
<Country></Country>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="GB_T_2260_2007" class="px-0 pb-0" style="height: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 0px"> <q-tab-panel name="Currency" class="px-0 pb-0" style="height: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 0px">
<GB_T_2260_2007></GB_T_2260_2007> <Currency></Currency>
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
</div> </div>
@ -29,14 +53,13 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import GB_T_4754_2017 from './standard/GB_T_4754_2017.vue'; import Industry from './standard/Industry.vue';
import GB_T_2260_2007 from './standard/GB_T_2260_2007.vue'; import AdminDivision from './standard/AdminDivision.vue';
import PerformanceStatus from './standard/PerformanceStatus.vue';
import Counterparty from './standard/Counterparty.vue';
import Country from './standard/Country.vue';
import Currency from './standard/Currency.vue';
const splitterModelRef = ref(15); const splitterModelRef = ref(15);
const selectedTabRef = ref('GB_T_4754_2017'); const selectedTabRef = ref('Industry');
</script> </script>
<style>
.active-class {
font-weight: 700;
}
</style>

109
io.sc.standard.frontend/src/views/standard/AdminDivision.vue

@ -0,0 +1,109 @@
<template>
<w-grid
ref="gridRef"
:title="$t('standard.adminDivision.grid.title')"
hide-bottom
:config-button="true"
selection="multiple"
:checkbox-selection="true"
dense
:tree="true"
:tree-icon="
(row) => {
return { name: 'folder', color: 'amber' };
}
"
primary-key="code"
:data-url="Environment.apiContextPath('/api/standard/adminDivision')"
:pageable="false"
:pagination="{
sortBy: 'code',
descending: false,
}"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="[
'refresh',
'separator',
[
{
extend: 'add',
click: undefined,
},
{
extend: 'addTop',
label: $t('standard.adminDivision.grid.toolbar.addTop'),
},
{
extend: 'addChild',
label: $t('standard.adminDivision.grid.toolbar.addChild'),
},
],
'edit',
'remove',
'separator',
'view',
'separator',
'export',
]"
:columns="[
{
name: 'target',
label: $t('standard.entity.target'),
columns: [
{ width: 300, name: 'name', label: $t('name') },
{ width: 100, name: 'code', label: $t('code') },
{ width: 100, name: 'description', label: $t('description') },
],
},
{
name: 'source',
label: $t('standard.entity.source'),
columns: [
{ width: 300, name: 'mappingName', label: $t('name') },
{ width: 100, name: 'mappingCode', label: $t('code') },
{ width: 100, name: 'mappingDescription', label: $t('description') },
],
},
{ width: 100, name: 'lastModifier', label: $t('lastModifier') },
{ width: 120, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() },
]"
:editor="{
dialog: {
width: '600px',
},
form: {
colsNum: 1,
fields: [
{ name: 'code', label: $t('standard.entity.code'), type: 'text', required: true },
{ name: 'name', label: $t('standard.entity.name'), type: 'text', required: true },
{ name: 'description', label: $t('standard.entity.description'), type: 'textarea', rows: 3 },
{ name: 'mappingCode', label: $t('standard.entity.mappingCode'), type: 'text', required: true },
{ name: 'mappingName', label: $t('standard.entity.mappingName'), type: 'text' },
{ name: 'mappingDescription', label: $t('standard.entity.mappingDescription'), type: 'textarea', rows: 3 },
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'code', label: $t('standard.entity.code') },
{ name: 'name', label: $t('standard.entity.name') },
{ name: 'description', label: $t('standard.entity.description') },
{ name: 'mappingCode', label: $t('standard.entity.mappingCode') },
{ name: 'mappingName', label: $t('standard.entity.mappingName') },
{ name: 'mappingDescription', label: $t('standard.entity.mappingDescription') },
{ name: 'dataComeFrom', label: $t('dataComeFrom') },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
],
},
}"
></w-grid>
</template>
<script setup lang="ts">
import { Environment, Formater } from 'platform-core';
</script>

79
io.sc.standard.frontend/src/views/standard/Counterparty.vue

@ -0,0 +1,79 @@
<template>
<w-grid
ref="gridRef"
:title="$t('standard.counterparty.grid.title')"
:config-button="true"
selection="multiple"
:checkbox-selection="true"
:tree="false"
primary-key="code"
:data-url="Environment.apiContextPath('/api/standard/counterparty')"
:pageable="true"
:pagination="{
sortBy: 'code',
descending: false,
}"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="['refresh', 'separator', 'add', 'edit', 'remove', 'separator', 'view', 'separator', 'export']"
:columns="[
{
name: 'target',
label: $t('standard.entity.target'),
columns: [
{ width: 150, name: 'code', label: $t('code') },
{ width: 200, name: 'name', label: $t('name') },
{ width: 100, name: 'description', label: $t('description') },
],
},
{
name: 'source',
label: $t('standard.entity.source'),
columns: [
{ width: 150, name: 'mappingCode', label: $t('code') },
{ width: 200, name: 'mappingName', label: $t('name') },
{ width: 100, name: 'mappingDescription', label: $t('description') },
],
},
{ width: 100, name: 'lastModifier', label: $t('lastModifier') },
{ width: 120, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() },
]"
:editor="{
dialog: {
width: '600px',
},
form: {
colsNum: 1,
fields: [
{ name: 'code', label: $t('standard.entity.code'), type: 'text', required: true },
{ name: 'name', label: $t('standard.entity.name'), type: 'text', required: true },
{ name: 'description', label: $t('standard.entity.description'), type: 'textarea', rows: 3 },
{ name: 'mappingCode', label: $t('standard.entity.mappingCode'), type: 'text', required: true },
{ name: 'mappingName', label: $t('standard.entity.mappingName'), type: 'text' },
{ name: 'mappingDescription', label: $t('standard.entity.mappingDescription'), type: 'textarea', rows: 3 },
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'code', label: $t('standard.entity.code') },
{ name: 'name', label: $t('standard.entity.name') },
{ name: 'description', label: $t('standard.entity.description') },
{ name: 'mappingCode', label: $t('standard.entity.mappingCode') },
{ name: 'mappingName', label: $t('standard.entity.mappingName') },
{ name: 'mappingDescription', label: $t('standard.entity.mappingDescription') },
{ name: 'dataComeFrom', label: $t('dataComeFrom') },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
],
},
}"
></w-grid>
</template>
<script setup lang="ts">
import { Environment, Formater } from 'platform-core';
</script>

274
io.sc.standard.frontend/src/views/standard/Country.vue

@ -0,0 +1,274 @@
<template>
<w-grid
ref="gridRef"
:title="$t('standard.country.grid.title')"
:hide-bottom="false"
:config-button="true"
selection="multiple"
:checkbox-selection="true"
:tree="false"
primary-key="code"
:data-url="Environment.apiContextPath('/api/standard/country')"
:pageable="false"
:pagination="{
sortBy: 'codeLatin2',
descending: false,
}"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="['query', 'refresh', 'separator', 'add', 'edit', 'remove', 'separator', 'view', 'separator', 'export']"
:query-form-cols-num="5"
:query-form-fields="[
{ name: 'code', label: $t('standard.country.entity.code'), type: 'text', clearable: true },
{ name: 'codeLatin2', label: $t('standard.country.entity.codeLatin2'), type: 'text', clearable: true },
{ name: 'codeLatin3', label: $t('standard.country.entity.codeLatin3'), type: 'text', clearable: true },
{ name: 'nameChinese', label: $t('standard.country.entity.nameChinese'), type: 'text', clearable: true },
{ name: 'nameEnglish', label: $t('standard.country.entity.nameEnglish'), type: 'text', clearable: true },
]"
:columns="columnsRef"
:editor="{
dialog: {
width: '800px',
},
form: {
colsNum: 3,
fields: [
{ name: 'code', label: $t('standard.country.entity.code'), type: 'text', required: true },
{ name: 'codeLatin2', label: $t('standard.country.entity.codeLatin2'), type: 'text', required: true },
{ name: 'codeLatin3', label: $t('standard.country.entity.codeLatin3'), type: 'text', required: true },
{ name: 'nameChinese', label: $t('standard.country.entity.nameChinese'), type: 'text', required: true },
{ name: 'nameChineseFull', label: $t('standard.country.entity.nameChineseFull'), type: 'text', colSpan: 2 },
{ name: 'remarkChinese', label: $t('standard.country.entity.remarkChinese'), type: 'text', colSpan: 3 },
{ name: 'nameEnglish', label: $t('standard.country.entity.nameEnglish'), type: 'text', required: true },
{ name: 'nameEnglishFull', label: $t('standard.country.entity.nameEnglishFull'), type: 'text', colSpan: 2 },
{ name: 'remarkEnglish', label: $t('standard.country.entity.remarkEnglish'), type: 'text', colSpan: 3 },
{ name: 'nameLocalShort', label: $t('standard.country.entity.nameLocalShort'), type: 'text', colSpan: 2 },
{ name: 'isIndependent', label: $t('standard.country.entity.isIndependent'), type: 'select', options: Options.yesNo() },
{
name: 'currency',
label: $t('standard.country.entity.currency'),
type: 'select',
options: currencyOptionsRef,
colSpan: 2,
useInput: true,
hideSelected: true,
fillInput: true,
onFilter: (val, update) => {
if (val) {
update(() => {
const input = val.toUpperCase();
currencyOptionsRef.splice(0, currencyOptionsRef.length);
for (const currency of currencyList) {
if (
currency.code?.indexOf(input) > -1 ||
currency.codeLatin?.indexOf(input) > -1 ||
currency.nameChinese?.indexOf(input) > -1 ||
currency.nameEnglish?.indexOf(input) > -1
) {
const item = createCurrencyOptionItem(currency);
if (item) {
currencyOptionsRef.push(item);
}
}
}
});
} else {
update(() => {
currencyOptionsRef.splice(0, currencyOptionsRef.length);
for (const currency of currencyList) {
const item = createCurrencyOptionItem(currency);
if (item) {
currencyOptionsRef.push(item);
}
}
});
}
},
},
{ name: 'languageCode2', label: $t('standard.country.entity.languageCode2'), type: 'text', colsFirst: true },
{ name: 'languageCode3', label: $t('standard.country.entity.languageCode3'), type: 'text' },
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'code', label: $t('standard.country.entity.code') },
{ name: 'codeLatin2', label: $t('standard.country.entity.codeLatin2') },
{ name: 'codeLatin3', label: $t('standard.country.entity.codeLatin3') },
{ name: 'nameChinese', label: $t('standard.country.entity.nameChinese') },
{ name: 'nameChineseFull', label: $t('standard.country.entity.nameChineseFull') },
{ name: 'nameEnglish', label: $t('standard.country.entity.nameEnglish') },
{ name: 'nameEnglishFull', label: $t('standard.country.entity.nameEnglishFull') },
{ name: 'nameLocalShort', label: $t('standard.country.entity.nameLocalShort') },
{ name: 'remarkChinese', label: $t('standard.country.entity.remarkChinese') },
{ name: 'remarkEnglish', label: $t('standard.country.entity.remarkEnglish') },
{ name: 'languageCode2', label: $t('standard.country.entity.languageCode2') },
{ name: 'languageCode3', label: $t('standard.country.entity.languageCode3') },
{ name: 'isIndependent', label: $t('standard.country.entity.isIndependent') },
{
name: 'currency',
label: $t('standard.country.entity.currency'),
format: (value, row) => {
return getCurrencyLabel(currencyMap[row.currency]);
},
},
{ name: 'dataComeFrom', label: $t('dataComeFrom') },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
],
},
}"
></w-grid>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { axios, Environment, Formater, Options, eventBus } from 'platform-core';
let currentLocale = Environment.getConfigure().setting.i18n.locale;
let currencyMap = {};
let currencyList = [];
const { t } = useI18n();
const currencyOptionsRef = ref([]);
const columnsRef = ref([
{ width: 70, name: 'code', label: t('code') },
{ width: 70, name: 'codeLatin3', label: t('code') + '2' },
{
width: 150,
name: 'nameChinese',
label: t('name'),
format: (value, row) => {
if (row) {
return getCountryName(row);
}
},
},
{
name: 'currency',
label: t('standard.entity.currency'),
columns: [
{
width: 70,
name: 'currencyCode',
label: t('code'),
sortable: false,
format: (value, row) => {
if (row.currency) {
return currencyMap[row.currency]?.code;
}
},
},
{
width: 70,
name: 'currencyCodeLatin',
label: t('code') + '2',
sortable: false,
format: (value, row) => {
if (row.currency) {
return currencyMap[row.currency]?.codeLatin;
}
},
},
{
width: 150,
name: 'currencyname',
label: t('name'),
sortable: false,
format: (value, row) => {
if (row.currency) {
return getCurrencyName(currencyMap[row.currency]);
}
},
},
],
},
{
name: 'language',
label: t('standard.entity.language'),
columns: [{ width: 100, name: 'languageCode3', label: t('code') }],
},
{ width: 100, name: 'lastModifier', label: t('lastModifier') },
{ width: 120, name: 'lastModifyDate', label: t('lastModifyDate'), format: Formater.dateOnly() },
]);
eventBus.on('localeChanged', (locale) => {
currentLocale = locale;
if (locale === 'zh_CN') {
columnsRef.value.slice(2, 1, {
width: 200,
name: 'nameChinese',
label: t('name'),
format: (value, row) => {
if (row) {
return getCountryName(row);
}
},
});
} else {
columnsRef.value.slice(2, 1, {
width: 200,
name: 'nameEnglish',
label: t('name'),
format: (value, row) => {
if (row) {
return getCountryName(row);
}
},
});
}
});
onMounted(() => {
axios.get(Environment.apiContextPath('/api/standard/currency?pageable=false&sortBy=code')).then((response) => {
currencyOptionsRef.value.splice(0, currencyOptionsRef.value.length);
currencyMap = {};
currencyList = [];
if (response?.data?.content) {
for (const currency of response.data.content) {
currencyMap[currency.code] = currency;
currencyList.push(currency);
}
for (const currency of currencyList) {
const item = createCurrencyOptionItem(currency);
if (item) {
currencyOptionsRef.value.push(item);
}
}
}
});
});
const getCurrencyLabel = (currency) => {
return currency.code + ' ' + currency.codeLatin + ' ' + (currentLocale === 'zh_CN' ? currency.nameChinese : currency.nameEnglish);
};
const createCurrencyOptionItem = (currency) => {
if (currency) {
return {
value: currency.code,
label: getCurrencyLabel(currency),
};
}
return null;
};
const getCountryName = (country) => {
if (country) {
return currentLocale === 'zh_CN' ? country.nameChinese : country.nameEnglish;
}
return null;
};
const getCurrencyName = (currency) => {
if (currency) {
return currentLocale === 'zh_CN' ? currency.nameChinese : currency.nameEnglish;
}
return null;
};
</script>

72
io.sc.standard.frontend/src/views/standard/Currency.vue

@ -0,0 +1,72 @@
<template>
<w-grid
ref="gridRef"
:title="$t('standard.currency.grid.title')"
:hide-bottom="false"
:config-button="true"
selection="multiple"
:checkbox-selection="true"
:tree="false"
primary-key="code"
:data-url="Environment.apiContextPath('/api/standard/currency')"
:pageable="false"
:pagination="{
sortBy: 'codeLatin',
descending: false,
}"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="['query', 'refresh', 'separator', 'add', 'edit', 'remove', 'separator', 'view', 'separator', 'export']"
:query-form-cols-num="4"
:query-form-fields="[
{ name: 'code', label: $t('standard.currency.entity.code'), type: 'text', clearable: true },
{ name: 'codeLatin', label: $t('standard.currency.entity.codeLatin'), type: 'text', clearable: true },
{ name: 'nameChinese', label: $t('standard.country.entity.nameChinese'), type: 'text', clearable: true },
{ name: 'nameEnglish', label: $t('standard.country.entity.nameEnglish'), type: 'text', clearable: true },
]"
:columns="[
{ width: 80, name: 'code', label: $t('standard.currency.entity.code') },
{ width: 80, name: 'codeLatin', label: $t('standard.currency.entity.codeLatin') },
{ width: 150, name: 'nameChinese', label: $t('standard.currency.entity.nameChinese') },
{ width: 150, name: 'nameEnglish', label: $t('standard.currency.entity.nameEnglish') },
{ width: 100, name: 'precision', label: $t('standard.currency.entity.precision') },
{ width: 100, name: 'lastModifier', label: $t('lastModifier') },
{ width: 120, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() },
]"
:editor="{
dialog: {
width: '600px',
},
form: {
colsNum: 1,
fields: [
{ name: 'code', label: $t('standard.currency.entity.code'), type: 'text', required: true },
{ name: 'codeLatin', label: $t('standard.currency.entity.codeLatin'), type: 'text', required: true },
{ name: 'nameChinese', label: $t('standard.country.entity.nameChinese'), type: 'text', required: true },
{ name: 'nameEnglish', label: $t('standard.country.entity.nameEnglish'), type: 'text' },
{ name: 'precision', label: $t('standard.currency.entity.precision'), type: 'text', required: true, defaultValue: 2 },
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'code', label: $t('standard.currency.entity.code') },
{ name: 'codeLatin', label: $t('standard.currency.entity.codeLatin') },
{ name: 'nameChinese', label: $t('standard.country.entity.nameChinese') },
{ name: 'nameEnglish', label: $t('standard.country.entity.nameEnglish') },
{ name: 'precision', label: $t('standard.currency.entity.precision') },
{ name: 'dataComeFrom', label: $t('dataComeFrom') },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
],
},
}"
></w-grid>
</template>
<script setup lang="ts">
import { Environment, Formater, Options } from 'platform-core';
</script>

90
io.sc.standard.frontend/src/views/standard/GB_T_2260_2007.vue

@ -1,90 +0,0 @@
<template>
<w-grid
ref="treeGridRef"
:title="$t('standard.GB_T_2260_2007.grid.title')"
hide-bottom
:config-button="true"
selection="multiple"
:checkbox-selection="true"
:dense-body="true"
:tree="true"
:tree-icon="
(row) => {
return { name: 'folder', color: 'amber' };
}
"
primary-key="code"
:data-url="Environment.apiContextPath('/api/standard/adminDivision')"
:pageable="false"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="[
'refresh',
'separator',
[
{
extend: 'add',
click: undefined,
},
{
extend: 'addTop',
label: $t('standard.GB_T_2260_2007.grid.toolbar.addTop'),
},
{
extend: 'addChild',
label: $t('standard.GB_T_2260_2007.grid.toolbar.addChild'),
},
],
'edit',
'remove',
'separator',
'view',
'separator',
'export',
]"
:columns="[
{
width: '100px',
name: 'name',
label: $t('name'),
sortable: false,
},
{ width: 100, name: 'code', label: $t('code'), sortable: false },
{ width: 100, name: 'description', label: $t('description'), sortable: false },
{ width: 80, name: 'lastModifier', label: $t('lastModifier'), sortable: false },
{ width: 100, name: 'lastModifyDate', label: $t('lastModifyDate'), sortable: false, format: Formater.dateOnly() },
]"
:editor="{
dialog: {
width: '600px',
height: '300px',
},
form: {
colsNum: 1,
fields: [
{ name: 'code', label: $t('code'), type: 'text', required: true },
{ name: 'name', label: $t('name'), type: 'text', required: true },
{ name: 'description', label: $t('description'), type: 'textarea', rows: 3 },
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'code', label: $t('code') },
{ name: 'name', label: $t('name') },
{ name: 'description', label: $t('description') },
{ name: 'dataComeFrom', label: $t('dataComeFrom') },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
],
},
}"
></w-grid>
</template>
<script setup lang="ts">
import { Environment, Formater } from 'platform-core';
</script>

90
io.sc.standard.frontend/src/views/standard/GB_T_4754_2017.vue

@ -1,90 +0,0 @@
<template>
<w-grid
ref="treeGridRef"
:title="$t('standard.GB_T_4754_2017.grid.title')"
hide-bottom
:config-button="true"
selection="multiple"
:checkbox-selection="true"
:dense-body="true"
:tree="true"
:tree-icon="
(row) => {
return { name: 'folder', color: 'amber' };
}
"
primary-key="code"
:data-url="Environment.apiContextPath('/api/standard/industry')"
:pageable="false"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="[
'refresh',
'separator',
[
{
extend: 'add',
click: undefined,
},
{
extend: 'addTop',
label: $t('standard.GB_T_4754_2017.grid.toolbar.addTop'),
},
{
extend: 'addChild',
label: $t('standard.GB_T_4754_2017.grid.toolbar.addChild'),
},
],
'edit',
'remove',
'separator',
'view',
'separator',
'export',
]"
:columns="[
{
width: '100px',
name: 'name',
label: $t('name'),
sortable: false,
},
{ width: 100, name: 'code', label: $t('code'), sortable: false },
{ width: 100, name: 'description', label: $t('description'), sortable: false },
{ width: 80, name: 'lastModifier', label: $t('lastModifier'), sortable: false },
{ width: 100, name: 'lastModifyDate', label: $t('lastModifyDate'), sortable: false, format: Formater.dateOnly() },
]"
:editor="{
dialog: {
width: '600px',
height: '300px',
},
form: {
colsNum: 1,
fields: [
{ name: 'code', label: $t('code'), type: 'text', required: true },
{ name: 'name', label: $t('name'), type: 'text', required: true },
{ name: 'description', label: $t('description'), type: 'textarea', rows: 3 },
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'code', label: $t('code') },
{ name: 'name', label: $t('name') },
{ name: 'description', label: $t('description') },
{ name: 'dataComeFrom', label: $t('dataComeFrom') },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
],
},
}"
></w-grid>
</template>
<script setup lang="ts">
import { Environment, Formater } from 'platform-core';
</script>

109
io.sc.standard.frontend/src/views/standard/Industry.vue

@ -0,0 +1,109 @@
<template>
<w-grid
ref="treeGridRef"
:title="$t('standard.industry.grid.title')"
hide-bottom
:config-button="true"
selection="multiple"
:checkbox-selection="true"
dense
:tree="true"
:tree-icon="
(row) => {
return { name: 'folder', color: 'amber' };
}
"
primary-key="code"
:data-url="Environment.apiContextPath('/api/standard/industry')"
:pageable="false"
:pagination="{
sortBy: 'code',
descending: false,
}"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="[
'refresh',
'separator',
[
{
extend: 'add',
click: undefined,
},
{
extend: 'addTop',
label: $t('standard.industry.grid.toolbar.addTop'),
},
{
extend: 'addChild',
label: $t('standard.industry.grid.toolbar.addChild'),
},
],
'edit',
'remove',
'separator',
'view',
'separator',
'export',
]"
:columns="[
{
name: 'target',
label: $t('standard.entity.target'),
columns: [
{ width: 300, name: 'name', label: $t('name') },
{ width: 100, name: 'code', label: $t('code') },
{ width: 100, name: 'description', label: $t('description') },
],
},
{
name: 'source',
label: $t('standard.entity.source'),
columns: [
{ width: 300, name: 'mappingName', label: $t('name') },
{ width: 100, name: 'mappingCode', label: $t('code') },
{ width: 100, name: 'mappingDescription', label: $t('description') },
],
},
{ width: 100, name: 'lastModifier', label: $t('lastModifier') },
{ width: 120, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() },
]"
:editor="{
dialog: {
width: '600px',
},
form: {
colsNum: 1,
fields: [
{ name: 'code', label: $t('standard.entity.code'), type: 'text', required: true },
{ name: 'name', label: $t('standard.entity.name'), type: 'text', required: true },
{ name: 'description', label: $t('standard.entity.description'), type: 'textarea', rows: 3 },
{ name: 'mappingCode', label: $t('standard.entity.mappingCode'), type: 'text', required: true },
{ name: 'mappingName', label: $t('standard.entity.mappingName'), type: 'text' },
{ name: 'mappingDescription', label: $t('standard.entity.mappingDescription'), type: 'textarea', rows: 3 },
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'code', label: $t('standard.entity.code') },
{ name: 'name', label: $t('standard.entity.name') },
{ name: 'description', label: $t('standard.entity.description') },
{ name: 'mappingCode', label: $t('standard.entity.mappingCode') },
{ name: 'mappingName', label: $t('standard.entity.mappingName') },
{ name: 'mappingDescription', label: $t('standard.entity.mappingDescription') },
{ name: 'dataComeFrom', label: $t('dataComeFrom') },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
],
},
}"
></w-grid>
</template>
<script setup lang="ts">
import { Environment, Formater } from 'platform-core';
</script>

79
io.sc.standard.frontend/src/views/standard/PerformanceStatus.vue

@ -0,0 +1,79 @@
<template>
<w-grid
ref="gridRef"
:title="$t('standard.performanceStatus.grid.title')"
:config-button="true"
selection="multiple"
:checkbox-selection="true"
:tree="false"
primary-key="code"
:data-url="Environment.apiContextPath('/api/standard/performanceStatus')"
:pageable="true"
:pagination="{
sortBy: 'code',
descending: false,
}"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="['refresh', 'separator', 'add', 'edit', 'remove', 'separator', 'view', 'separator', 'export']"
:columns="[
{
name: 'target',
label: $t('standard.entity.target'),
columns: [
{ width: 100, name: 'code', label: $t('code') },
{ width: 100, name: 'name', label: $t('name') },
{ width: 100, name: 'description', label: $t('description') },
],
},
{
name: 'source',
label: $t('standard.entity.source'),
columns: [
{ width: 100, name: 'mappingCode', label: $t('code') },
{ width: 100, name: 'mappingName', label: $t('name') },
{ width: 100, name: 'mappingDescription', label: $t('description') },
],
},
{ width: 100, name: 'lastModifier', label: $t('lastModifier') },
{ width: 120, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() },
]"
:editor="{
dialog: {
width: '600px',
},
form: {
colsNum: 1,
fields: [
{ name: 'code', label: $t('standard.entity.code'), type: 'text', required: true },
{ name: 'name', label: $t('standard.entity.name'), type: 'text', required: true },
{ name: 'description', label: $t('standard.entity.description'), type: 'textarea', rows: 3 },
{ name: 'mappingCode', label: $t('standard.entity.mappingCode'), type: 'text', required: true },
{ name: 'mappingName', label: $t('standard.entity.mappingName'), type: 'text' },
{ name: 'mappingDescription', label: $t('standard.entity.mappingDescription'), type: 'textarea', rows: 3 },
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'code', label: $t('standard.entity.code') },
{ name: 'name', label: $t('standard.entity.name') },
{ name: 'description', label: $t('standard.entity.description') },
{ name: 'mappingCode', label: $t('standard.entity.mappingCode') },
{ name: 'mappingName', label: $t('standard.entity.mappingName') },
{ name: 'mappingDescription', label: $t('standard.entity.mappingDescription') },
{ name: 'dataComeFrom', label: $t('dataComeFrom') },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
],
},
}"
></w-grid>
</template>
<script setup lang="ts">
import { Environment, Formater } from 'platform-core';
</script>

2
io.sc.standard/src/main/java/io/sc/standard/controller/AdminDivisionWebController.java

@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@RestController @RestController("io.sc.standard.controller.AdminDivisionWebController")
@RequestMapping("/api/standard/adminDivision") @RequestMapping("/api/standard/adminDivision")
public class AdminDivisionWebController extends RestCrudController<AdminDivisionVo, AdminDivisionEntity,String, AdminDivisionRepository, AdminDivisionService> { public class AdminDivisionWebController extends RestCrudController<AdminDivisionVo, AdminDivisionEntity,String, AdminDivisionRepository, AdminDivisionService> {
@Override @Override

27
io.sc.standard/src/main/java/io/sc/standard/controller/CounterpartyWebController.java

@ -0,0 +1,27 @@
package io.sc.standard.controller;
import io.sc.platform.mvc.controller.support.RestCrudController;
import io.sc.platform.orm.service.support.QueryParameter;
import io.sc.standard.api.AdminDivisionVo;
import io.sc.standard.api.CounterpartyVo;
import io.sc.standard.jpa.entity.CounterpartyEntity;
import io.sc.standard.jpa.repository.CounterpartyRepository;
import io.sc.standard.service.CounterpartyService;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController("io.sc.standard.controller.CounterpartyWebController")
@RequestMapping("/api/standard/counterparty")
public class CounterpartyWebController extends RestCrudController<CounterpartyVo, CounterpartyEntity,String, CounterpartyRepository, CounterpartyService> {
@Override
protected Page<CounterpartyVo> query(HttpServletRequest request, HttpServletResponse response, QueryParameter queryParameter) throws Exception {
if(!queryParameter.existsSortBy()){
queryParameter.addSortBy("+code");
}
return super.query(request, response, queryParameter);
}
}

27
io.sc.standard/src/main/java/io/sc/standard/controller/CountryWebController.java

@ -0,0 +1,27 @@
package io.sc.standard.controller;
import io.sc.platform.mvc.controller.support.RestCrudController;
import io.sc.platform.orm.service.support.QueryParameter;
import io.sc.standard.api.CounterpartyVo;
import io.sc.standard.api.CountryVo;
import io.sc.standard.jpa.entity.CountryEntity;
import io.sc.standard.jpa.repository.CountryRepository;
import io.sc.standard.service.CountryService;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController("io.sc.standard.controller.CountryWebController")
@RequestMapping("/api/standard/country")
public class CountryWebController extends RestCrudController<CountryVo, CountryEntity,String, CountryRepository, CountryService> {
@Override
protected Page<CountryVo> query(HttpServletRequest request, HttpServletResponse response, QueryParameter queryParameter) throws Exception {
if(!queryParameter.existsSortBy()){
queryParameter.addSortBy("+code");
}
return super.query(request, response, queryParameter);
}
}

26
io.sc.standard/src/main/java/io/sc/standard/controller/CurrencyWebController.java

@ -0,0 +1,26 @@
package io.sc.standard.controller;
import io.sc.platform.mvc.controller.support.RestCrudController;
import io.sc.platform.orm.service.support.QueryParameter;
import io.sc.standard.api.CurrencyVo;
import io.sc.standard.jpa.entity.CurrencyEntity;
import io.sc.standard.jpa.repository.CurrencyRepository;
import io.sc.standard.service.CurrencyService;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController("io.sc.standard.controller.CurrencyWebController")
@RequestMapping("/api/standard/currency")
public class CurrencyWebController extends RestCrudController<CurrencyVo, CurrencyEntity,String, CurrencyRepository, CurrencyService> {
@Override
protected Page<CurrencyVo> query(HttpServletRequest request, HttpServletResponse response, QueryParameter queryParameter) throws Exception {
if(!queryParameter.existsSortBy()){
queryParameter.addSortBy("+code");
}
return super.query(request, response, queryParameter);
}
}

11
io.sc.standard/src/main/java/io/sc/standard/controller/IndustryWebController.java

@ -2,6 +2,7 @@ package io.sc.standard.controller;
import io.sc.platform.mvc.controller.support.RestCrudController; import io.sc.platform.mvc.controller.support.RestCrudController;
import io.sc.platform.orm.service.support.QueryParameter; import io.sc.platform.orm.service.support.QueryParameter;
import io.sc.standard.api.CounterpartyVo;
import io.sc.standard.api.IndustryVo; import io.sc.standard.api.IndustryVo;
import io.sc.standard.jpa.entity.IndustryEntity; import io.sc.standard.jpa.entity.IndustryEntity;
import io.sc.standard.jpa.repository.IndustryRepository; import io.sc.standard.jpa.repository.IndustryRepository;
@ -15,20 +16,14 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
@RestController @RestController("io.sc.standard.controller.IndustryWebController")
@RequestMapping("/api/standard/industry") @RequestMapping("/api/standard/industry")
public class IndustryWebController extends RestCrudController<IndustryVo, IndustryEntity,String, IndustryRepository, IndustryService> { public class IndustryWebController extends RestCrudController<IndustryVo, IndustryEntity,String, IndustryRepository, IndustryService> {
@Override @Override
public Page<IndustryVo> query(HttpServletRequest request, HttpServletResponse response, QueryParameter queryParameter) throws Exception { protected Page<IndustryVo> query(HttpServletRequest request, HttpServletResponse response, QueryParameter queryParameter) throws Exception {
if(!queryParameter.existsSortBy()){ if(!queryParameter.existsSortBy()){
queryParameter.addSortBy("+code"); queryParameter.addSortBy("+code");
} }
return super.query(request, response, queryParameter); return super.query(request, response, queryParameter);
} }
@GetMapping("level1")
public List<IndustryVo> getLevel1() {
return service.getLevel1();
}
} }

29
io.sc.standard/src/main/java/io/sc/standard/controller/PerformanceStatusWebController.java

@ -0,0 +1,29 @@
package io.sc.standard.controller;
import io.sc.platform.mvc.controller.support.RestCrudController;
import io.sc.platform.orm.service.support.QueryParameter;
import io.sc.standard.api.CounterpartyVo;
import io.sc.standard.api.PerformanceStatusVo;
import io.sc.standard.jpa.entity.PerformanceStatusEntity;
import io.sc.standard.jpa.repository.PerformanceStatusRepository;
import io.sc.standard.service.PerformanceStatusService;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@RestController("io.sc.standard.controller.PerformanceStatusWebController")
@RequestMapping("/api/standard/performanceStatus")
public class PerformanceStatusWebController extends RestCrudController<PerformanceStatusVo, PerformanceStatusEntity,String, PerformanceStatusRepository, PerformanceStatusService> {
@Override
protected Page<PerformanceStatusVo> query(HttpServletRequest request, HttpServletResponse response, QueryParameter queryParameter) throws Exception {
if(!queryParameter.existsSortBy()){
queryParameter.addSortBy("+code");
}
return super.query(request, response, queryParameter);
}
}

56
io.sc.standard/src/main/java/io/sc/standard/jpa/entity/AdminDivisionEntity.java

@ -9,21 +9,34 @@ import javax.validation.constraints.Size;
/** /**
* 国民经济行业分类(GB/T 47542017) * 国民经济行业分类(GB/T 47542017)
*/ */
@Entity @Entity(name="io.sc.standard.jpa.entity.AdminDivisionEntity")
@Table(name="ST_GB_T_2260_2007") @Table(name="ST_ADMIN_DIVISION")
public class AdminDivisionEntity extends AuditorEntity<AdminDivisionVo> { public class AdminDivisionEntity extends AuditorEntity<AdminDivisionVo> {
@Id @Id
@Column(name="CODE_", length=5) @Column(name="CODE_", length=6)
@Size(max=5) @Size(max=6)
private String code; private String code;
@Column(name="NAME_", length=254)
@Size(max=254) @Column(name="NAME_", length=1024)
@Size(max=1024)
private String name; private String name;
@Column(name="DESCRIPTION_", length=254) @Column(name="DESCRIPTION_", length=1024)
@Size(max=254) @Size(max=1024)
private String description; private String description;
@Column(name="MAPPING_CODE_", length=255)
@Size(max=255)
private String mappingCode;
@Column(name="MAPPING_NAME_", length=1024)
@Size(max=1024)
private String mappingName;
@Column(name="MAPPING_DESCRIPTION_", length=1024)
@Size(max=1024)
private String mappingDescription;
@ManyToOne(fetch=FetchType.LAZY) @ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="PARENT_CODE_") @JoinColumn(name="PARENT_CODE_")
protected AdminDivisionEntity parent; protected AdminDivisionEntity parent;
@ -35,6 +48,9 @@ public class AdminDivisionEntity extends AuditorEntity<AdminDivisionVo> {
vo.setCode(this.getCode()); vo.setCode(this.getCode());
vo.setName(this.getName()); vo.setName(this.getName());
vo.setDescription(this.getDescription()); vo.setDescription(this.getDescription());
vo.setMappingCode(this.getMappingCode());
vo.setMappingName(this.getMappingName());
vo.setMappingDescription(this.getMappingDescription());
vo.setParent(this.getParent()==null?null:this.getParent().getCode()); vo.setParent(this.getParent()==null?null:this.getParent().getCode());
return vo; return vo;
} }
@ -68,6 +84,30 @@ public class AdminDivisionEntity extends AuditorEntity<AdminDivisionVo> {
this.description = description; this.description = description;
} }
public String getMappingCode() {
return mappingCode;
}
public void setMappingCode(String mappingCode) {
this.mappingCode = mappingCode;
}
public String getMappingName() {
return mappingName;
}
public void setMappingName(String mappingName) {
this.mappingName = mappingName;
}
public String getMappingDescription() {
return mappingDescription;
}
public void setMappingDescription(String mappingDescription) {
this.mappingDescription = mappingDescription;
}
public AdminDivisionEntity getParent() { public AdminDivisionEntity getParent() {
return parent; return parent;
} }

118
io.sc.standard/src/main/java/io/sc/standard/jpa/entity/BusinessCategoryEntity.java

@ -0,0 +1,118 @@
package io.sc.standard.jpa.entity;
import io.sc.platform.orm.entity.AuditorEntity;
import io.sc.standard.api.IndustryVo;
import javax.persistence.*;
import javax.validation.constraints.Size;
/**
* 银行业务分类
*/
@Entity(name="io.sc.standard.jpa.entity.BusinessCategoryEntity")
@Table(name="ST_BUSINESS_CATEGORY")
public class BusinessCategoryEntity extends AuditorEntity<IndustryVo> {
@Id
@Column(name="CODE_", length=5)
@Size(max=5)
private String code;
@Column(name="NAME_", length=254)
@Size(max=254)
private String name;
@Column(name="DESCRIPTION_", length=1024)
@Size(max=1024)
private String description;
@Column(name="MAPPING_CODE_", length=255)
@Size(max=255)
private String mappingCode;
@Column(name="MAPPING_NAME_", length=1024)
@Size(max=1024)
private String mappingName;
@Column(name="MAPPING_DESCRIPTION_", length=1024)
@Size(max=1024)
private String mappingDescription;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="PARENT_CODE_")
protected BusinessCategoryEntity parent;
@Override
public IndustryVo toVo() {
IndustryVo vo =new IndustryVo();
super.toVo(vo);
vo.setCode(this.getCode());
vo.setName(this.getName());
vo.setDescription(this.getDescription());
vo.setMappingCode(this.getMappingCode());
vo.setMappingName(this.getMappingName());
vo.setMappingDescription(this.getMappingDescription());
vo.setParent(this.getParent()==null?null:this.getParent().getCode());
return vo;
}
public BusinessCategoryEntity(){}
public BusinessCategoryEntity(String code){
this.code =code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMappingCode() {
return mappingCode;
}
public void setMappingCode(String mappingCode) {
this.mappingCode = mappingCode;
}
public String getMappingName() {
return mappingName;
}
public void setMappingName(String mappingName) {
this.mappingName = mappingName;
}
public String getMappingDescription() {
return mappingDescription;
}
public void setMappingDescription(String mappingDescription) {
this.mappingDescription = mappingDescription;
}
public BusinessCategoryEntity getParent() {
return parent;
}
public void setParent(BusinessCategoryEntity parent) {
this.parent = parent;
}
}

108
io.sc.standard/src/main/java/io/sc/standard/jpa/entity/CounterpartyEntity.java

@ -0,0 +1,108 @@
package io.sc.standard.jpa.entity;
import io.sc.platform.orm.entity.AuditorEntity;
import io.sc.standard.api.CounterpartyVo;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Size;
/**
* 履约状态
*/
@Entity(name="io.sc.standard.jpa.entity.CounterpartyEntity")
@Table(name="ST_COUNTERPARTY")
public class CounterpartyEntity extends AuditorEntity<CounterpartyVo> {
@Id
@Column(name="CODE_", length=255)
@Size(max=255)
private String code;
@Column(name="NAME_", length=255)
@Size(max=255)
private String name;
@Column(name="DESCRIPTION_", length=255)
@Size(max=255)
private String description;
@Column(name="MAPPING_CODE_", length=255)
@Size(max=255)
private String mappingCode;
@Column(name="MAPPING_NAME_", length=255)
@Size(max=255)
private String mappingName;
@Column(name="MAPPING_DESCRIPTION_", length=255)
@Size(max=255)
private String mappingDescription;
@Override
public CounterpartyVo toVo() {
CounterpartyVo vo =new CounterpartyVo();
super.toVo(vo);
vo.setCode(this.getCode());
vo.setName(this.getName());
vo.setDescription(this.getDescription());
vo.setMappingCode(this.getMappingCode());
vo.setMappingName(this.getMappingName());
vo.setMappingDescription(this.getMappingDescription());
return vo;
}
public CounterpartyEntity(){}
public CounterpartyEntity(String code){
this.code =code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMappingCode() {
return mappingCode;
}
public void setMappingCode(String mappingCode) {
this.mappingCode = mappingCode;
}
public String getMappingName() {
return mappingName;
}
public void setMappingName(String mappingName) {
this.mappingName = mappingName;
}
public String getMappingDescription() {
return mappingDescription;
}
public void setMappingDescription(String mappingDescription) {
this.mappingDescription = mappingDescription;
}
}

224
io.sc.standard/src/main/java/io/sc/standard/jpa/entity/CountryEntity.java

@ -0,0 +1,224 @@
package io.sc.standard.jpa.entity;
import io.sc.platform.orm.converter.NumericBooleanConverter;
import io.sc.platform.orm.entity.AuditorEntity;
import io.sc.platform.system.org.jpa.entity.OrgEntity;
import io.sc.standard.api.CountryVo;
import javax.persistence.*;
import javax.validation.constraints.Size;
/**
* 国家和地区
*/
@Entity(name="io.sc.standard.jpa.entity.CountryEntity")
@Table(name="ST_COUNTRY")
public class CountryEntity extends AuditorEntity<CountryVo> {
// 代码
@Id
@Column(name="CODE_", length=3)
@Size(max=3)
private String code;
// 代码(两字符拉丁字母)
@Column(name="CODE_LATIN_2_", length=2)
@Size(max=2)
private String codeLatin2;
// 代码(三字符拉丁字母)
@Column(name="CODE_LATIN_3_", length=3)
@Size(max=3)
private String codeLatin3;
// 名称(中文简称)
@Column(name="NAME_CHINESE_", length=255)
@Size(max=255)
private String nameChinese;
// 名称(中文全称)
@Column(name="NAME_CHINESE_FULL_", length=255)
@Size(max=255)
private String nameChineseFull;
// 名称(英文简称)
@Column(name="NAME_ENGLISH_", length=255)
@Size(max=255)
private String nameEnglish;
// 名称(英文全称)
@Column(name="NAME_ENGLISH_FULL_", length=255)
@Size(max=255)
private String nameEnglishFull;
// 名称(当地简称)
@Column(name="NAME_LOCAL_SHORT_", length=255)
@Size(max=255)
private String nameLocalShort;
// 中文备注
@Column(name="REMARK_CHINESE_", length=512)
@Size(max=512)
private String remarkChinese;
// 英文备注
@Column(name="REMARK_ENGLISH_", length=512)
@Size(max=512)
private String remarkEnglish;
// 语种代码(两字母)
@Column(name="LANGUAGE_CODE_2_", length=30)
@Size(max=30)
private String languageCode2;
// 语种代码(三字母)
@Column(name="LANGUAGE_CODE_3_", length=45)
@Size(max=45)
private String languageCode3;
// 是否独立
@Column(name="IS_INDEPENDENT_")
@Convert(converter= NumericBooleanConverter.class)
private Boolean isIndependent;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="CURRENCY_CODE_")
private CurrencyEntity currency;
@Override
public CountryVo toVo() {
CountryVo vo =new CountryVo();
super.toVo(vo);
vo.setCode(this.getCode());
vo.setCodeLatin2(this.getCodeLatin2());
vo.setCodeLatin3(this.getCodeLatin3());
vo.setNameChinese(this.getNameChinese());
vo.setNameChineseFull(this.getNameChineseFull());
vo.setNameEnglish(this.getNameEnglish());
vo.setNameEnglishFull(this.getNameEnglishFull());
vo.setNameLocalShort(this.getNameLocalShort());
vo.setRemarkChinese(this.getRemarkChinese());
vo.setRemarkEnglish(this.getRemarkEnglish());
vo.setLanguageCode2(this.getLanguageCode2());
vo.setLanguageCode3(this.getLanguageCode3());
vo.setIsIndependent(this.getIsIndependent());
vo.setCurrency(this.getCurrency()==null?null:this.getCurrency().getCode());
return vo;
}
public CountryEntity(){}
public CountryEntity(String code){
this.code =code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCodeLatin2() {
return codeLatin2;
}
public void setCodeLatin2(String codeLatin2) {
this.codeLatin2 = codeLatin2;
}
public String getCodeLatin3() {
return codeLatin3;
}
public void setCodeLatin3(String codeLatin3) {
this.codeLatin3 = codeLatin3;
}
public String getNameChinese() {
return nameChinese;
}
public void setNameChinese(String nameChinese) {
this.nameChinese = nameChinese;
}
public String getNameChineseFull() {
return nameChineseFull;
}
public void setNameChineseFull(String nameChineseFull) {
this.nameChineseFull = nameChineseFull;
}
public String getNameEnglish() {
return nameEnglish;
}
public void setNameEnglish(String nameEnglish) {
this.nameEnglish = nameEnglish;
}
public String getNameEnglishFull() {
return nameEnglishFull;
}
public void setNameEnglishFull(String nameEnglishFull) {
this.nameEnglishFull = nameEnglishFull;
}
public String getNameLocalShort() {
return nameLocalShort;
}
public void setNameLocalShort(String nameLocalShort) {
this.nameLocalShort = nameLocalShort;
}
public String getRemarkChinese() {
return remarkChinese;
}
public void setRemarkChinese(String remarkChinese) {
this.remarkChinese = remarkChinese;
}
public String getRemarkEnglish() {
return remarkEnglish;
}
public void setRemarkEnglish(String remarkEnglish) {
this.remarkEnglish = remarkEnglish;
}
public String getLanguageCode2() {
return languageCode2;
}
public void setLanguageCode2(String languageCode2) {
this.languageCode2 = languageCode2;
}
public String getLanguageCode3() {
return languageCode3;
}
public void setLanguageCode3(String languageCode3) {
this.languageCode3 = languageCode3;
}
public Boolean getIsIndependent() {
return isIndependent;
}
public void setIsIndependent(Boolean isIndependent) {
this.isIndependent = isIndependent;
}
public CurrencyEntity getCurrency() {
return currency;
}
public void setCurrency(CurrencyEntity currency) {
this.currency = currency;
}
}

99
io.sc.standard/src/main/java/io/sc/standard/jpa/entity/CurrencyEntity.java

@ -0,0 +1,99 @@
package io.sc.standard.jpa.entity;
import io.sc.platform.orm.converter.NumericBooleanConverter;
import io.sc.platform.orm.entity.AuditorEntity;
import io.sc.standard.api.CurrencyVo;
import javax.persistence.*;
import javax.validation.constraints.Size;
/**
* 货币
*/
@Entity(name="io.sc.standard.jpa.entity.CurrencyEntity")
@Table(name="ST_CURRENCY")
public class CurrencyEntity extends AuditorEntity<CurrencyVo> {
// 代码(数字)
@Id
@Column(name="CODE_", length=3)
@Size(max=3)
private String code;
// 代码(字母)
@Column(name="CODE_LATIN_", length=3)
@Size(max=3)
private String codeLatin;
// 名称(中文)
@Column(name="NAME_CHINESE_", length=255)
@Size(max=255)
private String nameChinese;
// 名称(英文)
@Column(name="NAME_ENGLISH_", length=255)
@Size(max=255)
private String nameEnglish;
// 辅助单位(精度)
@Column(name="PRECISION_",length=10)
@Size(max=10)
private String precision;
@Override
public CurrencyVo toVo() {
CurrencyVo vo =new CurrencyVo();
super.toVo(vo);
vo.setCode(this.getCode());
vo.setCodeLatin(this.getCodeLatin());
vo.setNameChinese(this.getNameChinese());
vo.setNameEnglish(this.getNameEnglish());
vo.setPrecision(this.getPrecision());
return vo;
}
public CurrencyEntity(){}
public CurrencyEntity(String code){
this.code =code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCodeLatin() {
return codeLatin;
}
public void setCodeLatin(String codeLatin) {
this.codeLatin = codeLatin;
}
public String getNameChinese() {
return nameChinese;
}
public void setNameChinese(String nameChinese) {
this.nameChinese = nameChinese;
}
public String getNameEnglish() {
return nameEnglish;
}
public void setNameEnglish(String nameEnglish) {
this.nameEnglish = nameEnglish;
}
public String getPrecision() {
return precision;
}
public void setPrecision(String precision) {
this.precision = precision;
}
}

47
io.sc.standard/src/main/java/io/sc/standard/jpa/entity/IndustryEntity.java

@ -9,8 +9,8 @@ import javax.validation.constraints.Size;
/** /**
* 国民经济行业分类(GB/T 47542017) * 国民经济行业分类(GB/T 47542017)
*/ */
@Entity @Entity(name="io.sc.standard.jpa.entity.IndustryEntity")
@Table(name="ST_GB_T_4754_2017") @Table(name="ST_INDUSTRY")
public class IndustryEntity extends AuditorEntity<IndustryVo> { public class IndustryEntity extends AuditorEntity<IndustryVo> {
@Id @Id
@Column(name="CODE_", length=5) @Column(name="CODE_", length=5)
@ -21,10 +21,22 @@ public class IndustryEntity extends AuditorEntity<IndustryVo> {
@Size(max=254) @Size(max=254)
private String name; private String name;
@Column(name="DESCRIPTION_", length=254) @Column(name="DESCRIPTION_", length=1024)
@Size(max=254) @Size(max=1024)
private String description; private String description;
@Column(name="MAPPING_CODE_", length=255)
@Size(max=255)
private String mappingCode;
@Column(name="MAPPING_NAME_", length=1024)
@Size(max=1024)
private String mappingName;
@Column(name="MAPPING_DESCRIPTION_", length=1024)
@Size(max=1024)
private String mappingDescription;
@ManyToOne(fetch=FetchType.LAZY) @ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="PARENT_CODE_") @JoinColumn(name="PARENT_CODE_")
protected IndustryEntity parent; protected IndustryEntity parent;
@ -36,6 +48,9 @@ public class IndustryEntity extends AuditorEntity<IndustryVo> {
vo.setCode(this.getCode()); vo.setCode(this.getCode());
vo.setName(this.getName()); vo.setName(this.getName());
vo.setDescription(this.getDescription()); vo.setDescription(this.getDescription());
vo.setMappingCode(this.getMappingCode());
vo.setMappingName(this.getMappingName());
vo.setMappingDescription(this.getMappingDescription());
vo.setParent(this.getParent()==null?null:this.getParent().getCode()); vo.setParent(this.getParent()==null?null:this.getParent().getCode());
return vo; return vo;
} }
@ -69,6 +84,30 @@ public class IndustryEntity extends AuditorEntity<IndustryVo> {
this.description = description; this.description = description;
} }
public String getMappingCode() {
return mappingCode;
}
public void setMappingCode(String mappingCode) {
this.mappingCode = mappingCode;
}
public String getMappingName() {
return mappingName;
}
public void setMappingName(String mappingName) {
this.mappingName = mappingName;
}
public String getMappingDescription() {
return mappingDescription;
}
public void setMappingDescription(String mappingDescription) {
this.mappingDescription = mappingDescription;
}
public IndustryEntity getParent() { public IndustryEntity getParent() {
return parent; return parent;
} }

110
io.sc.standard/src/main/java/io/sc/standard/jpa/entity/PerformanceStatusEntity.java

@ -0,0 +1,110 @@
package io.sc.standard.jpa.entity;
import io.sc.platform.orm.entity.AuditorEntity;
import io.sc.standard.api.AdminDivisionVo;
import io.sc.standard.api.PerformanceStatusVo;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Size;
/**
* 履约状态
*/
@Entity(name="io.sc.standard.jpa.entity.PerformanceStatusEntity")
@Table(name="ST_PERFORMANCE_STATUS")
public class PerformanceStatusEntity extends AuditorEntity<PerformanceStatusVo> {
@Id
@Column(name="CODE_", length=1)
@Size(max=1)
private String code;
@Column(name="NAME_", length=20)
@Size(max=20)
private String name;
@Column(name="DESCRIPTION_", length=255)
@Size(max=255)
private String description;
@Column(name="MAPPING_CODE_", length=6)
@Size(max=6)
private String mappingCode;
@Column(name="MAPPING_NAME_", length=20)
@Size(max=20)
private String mappingName;
@Column(name="MAPPING_DESCRIPTION_", length=255)
@Size(max=255)
private String mappingDescription;
@Override
public PerformanceStatusVo toVo() {
PerformanceStatusVo vo =new PerformanceStatusVo();
super.toVo(vo);
vo.setCode(this.getCode());
vo.setName(this.getName());
vo.setDescription(this.getDescription());
vo.setMappingCode(this.getMappingCode());
vo.setMappingName(this.getMappingName());
vo.setMappingDescription(this.getMappingDescription());
return vo;
}
public PerformanceStatusEntity(){}
public PerformanceStatusEntity(String code){
this.code =code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMappingCode() {
return mappingCode;
}
public void setMappingCode(String mappingCode) {
this.mappingCode = mappingCode;
}
public String getMappingName() {
return mappingName;
}
public void setMappingName(String mappingName) {
this.mappingName = mappingName;
}
public String getMappingDescription() {
return mappingDescription;
}
public void setMappingDescription(String mappingDescription) {
this.mappingDescription = mappingDescription;
}
}

2
io.sc.standard/src/main/java/io/sc/standard/jpa/repository/AdminDivisionRepository.java

@ -2,7 +2,9 @@ package io.sc.standard.jpa.repository;
import io.sc.platform.orm.repository.DaoRepository; import io.sc.platform.orm.repository.DaoRepository;
import io.sc.standard.jpa.entity.AdminDivisionEntity; import io.sc.standard.jpa.entity.AdminDivisionEntity;
import org.springframework.stereotype.Service;
@Service("io.sc.standard.jpa.repository.AdminDivisionRepository")
public interface AdminDivisionRepository extends DaoRepository<AdminDivisionEntity,String> { public interface AdminDivisionRepository extends DaoRepository<AdminDivisionEntity,String> {
public AdminDivisionEntity findByCode(String code); public AdminDivisionEntity findByCode(String code);
} }

10
io.sc.standard/src/main/java/io/sc/standard/jpa/repository/CounterpartyRepository.java

@ -0,0 +1,10 @@
package io.sc.standard.jpa.repository;
import io.sc.platform.orm.repository.DaoRepository;
import io.sc.standard.jpa.entity.CounterpartyEntity;
import org.springframework.stereotype.Service;
@Service("io.sc.standard.jpa.repository.CounterpartyRepository")
public interface CounterpartyRepository extends DaoRepository<CounterpartyEntity,String> {
}

10
io.sc.standard/src/main/java/io/sc/standard/jpa/repository/CountryRepository.java

@ -0,0 +1,10 @@
package io.sc.standard.jpa.repository;
import io.sc.platform.orm.repository.DaoRepository;
import io.sc.standard.jpa.entity.CountryEntity;
import org.springframework.stereotype.Service;
@Service("io.sc.standard.jpa.repository.CountryRepository")
public interface CountryRepository extends DaoRepository<CountryEntity,String> {
}

10
io.sc.standard/src/main/java/io/sc/standard/jpa/repository/CurrencyRepository.java

@ -0,0 +1,10 @@
package io.sc.standard.jpa.repository;
import io.sc.platform.orm.repository.DaoRepository;
import io.sc.standard.jpa.entity.CurrencyEntity;
import org.springframework.stereotype.Service;
@Service("io.sc.standard.jpa.repository.CurrencyRepository")
public interface CurrencyRepository extends DaoRepository<CurrencyEntity,String> {
}

4
io.sc.standard/src/main/java/io/sc/standard/jpa/repository/IndustryRepository.java

@ -3,12 +3,14 @@ package io.sc.standard.jpa.repository;
import io.sc.platform.orm.repository.DaoRepository; import io.sc.platform.orm.repository.DaoRepository;
import io.sc.standard.jpa.entity.IndustryEntity; import io.sc.standard.jpa.entity.IndustryEntity;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@Service("io.sc.standard.jpa.repository.IndustryRepository")
public interface IndustryRepository extends DaoRepository<IndustryEntity,String> { public interface IndustryRepository extends DaoRepository<IndustryEntity,String> {
public IndustryEntity findByCode(String code); public IndustryEntity findByCode(String code);
@Query("select e from IndustryEntity e where e.parent is null order by e.code") @Query("select e from io.sc.standard.jpa.entity.IndustryEntity e where e.parent is null order by e.code")
public List<IndustryEntity> findLevel1(); public List<IndustryEntity> findLevel1();
} }

10
io.sc.standard/src/main/java/io/sc/standard/jpa/repository/PerformanceStatusRepository.java

@ -0,0 +1,10 @@
package io.sc.standard.jpa.repository;
import io.sc.platform.orm.repository.DaoRepository;
import io.sc.standard.jpa.entity.PerformanceStatusEntity;
import org.springframework.stereotype.Service;
@Service("io.sc.standard.jpa.repository.PerformanceStatusRepository")
public interface PerformanceStatusRepository extends DaoRepository<PerformanceStatusEntity,String> {
}

55
io.sc.standard/src/main/java/io/sc/standard/plugins/PluginManager.java

@ -1,55 +0,0 @@
package io.sc.standard.plugins;
import com.fasterxml.jackson.core.type.TypeReference;
import io.sc.platform.core.plugins.Plugin;
import io.sc.platform.core.plugins.PluginParser;
import io.sc.standard.plugins.item.DataStandard;
import java.util.ArrayList;
import java.util.List;
/**
* 系统参数和静态资源处理插件
*/
public class PluginManager {
private static final String DATA_STANDARD_LOCATION ="META-INF/platform/plugins/data-standard.json";
//
private List<Plugin<List<DataStandard>>> dataStandardPlugins =new ArrayList<>();
private List<DataStandard> dataStandards =new ArrayList<>();
/**
* 获取单例模式实例
* @return 实例
*/
public static PluginManager getInstance(){
return PluginManagerHolder.instance;
}
private static class PluginManagerHolder{
private static PluginManager instance =new PluginManager();
}
private PluginManager(){
PluginParser parser =new PluginParser();
loadDataStandardPlugins(parser);
}
public List<Plugin<List<DataStandard>>> getDataStandardPlugins() {
return dataStandardPlugins;
}
public void setDataStandardPlugins(List<Plugin<List<DataStandard>>> dataStandardPlugins) {
this.dataStandardPlugins = dataStandardPlugins;
}
private void loadDataStandardPlugins(PluginParser parser) {
dataStandardPlugins =parser.parse(DATA_STANDARD_LOCATION,new TypeReference<List<DataStandard>>(){});
if(dataStandardPlugins!=null && !dataStandardPlugins.isEmpty()){
List<DataStandard> items =new ArrayList<>();
for(Plugin<List<DataStandard>> plugin : dataStandardPlugins){
items.addAll(plugin.getValue());
}
this.dataStandards =items;
}
}
}

12
io.sc.standard/src/main/java/io/sc/standard/plugins/PluginSpiServiceImpl.java

@ -1,12 +0,0 @@
package io.sc.standard.plugins;
import io.sc.platform.core.spi.PluginSpiService;
/**
* 该类为 java SPI(Service Provider Interface) 模式的实现类, 用于加载插件
*/
public class PluginSpiServiceImpl implements PluginSpiService {
public PluginSpiServiceImpl(){
PluginManager.getInstance();
}
}

17
io.sc.standard/src/main/java/io/sc/standard/plugins/item/DataStandard.java

@ -1,17 +0,0 @@
package io.sc.standard.plugins.item;
import java.util.HashSet;
import java.util.Set;
public class DataStandard {
private String protocol;
private String host;
private Integer port;
private String contextPath;
private String name;
private Set<String> components =new HashSet<String>();
private Set<String> resources =new HashSet<String>();
//附加属性
private String configurationFileUrl; //菜单贡献项配置文件位置
}

8
io.sc.standard/src/main/java/io/sc/standard/service/CounterpartyService.java

@ -0,0 +1,8 @@
package io.sc.standard.service;
import io.sc.platform.orm.service.DaoService;
import io.sc.standard.jpa.entity.CounterpartyEntity;
import io.sc.standard.jpa.repository.CounterpartyRepository;
public interface CounterpartyService extends DaoService<CounterpartyEntity, String, CounterpartyRepository> {
}

8
io.sc.standard/src/main/java/io/sc/standard/service/CountryService.java

@ -0,0 +1,8 @@
package io.sc.standard.service;
import io.sc.platform.orm.service.DaoService;
import io.sc.standard.jpa.entity.CountryEntity;
import io.sc.standard.jpa.repository.CountryRepository;
public interface CountryService extends DaoService<CountryEntity, String, CountryRepository> {
}

8
io.sc.standard/src/main/java/io/sc/standard/service/CurrencyService.java

@ -0,0 +1,8 @@
package io.sc.standard.service;
import io.sc.platform.orm.service.DaoService;
import io.sc.standard.jpa.entity.CurrencyEntity;
import io.sc.standard.jpa.repository.CurrencyRepository;
public interface CurrencyService extends DaoService<CurrencyEntity, String, CurrencyRepository> {
}

2
io.sc.standard/src/main/java/io/sc/standard/service/IndustryService.java

@ -8,5 +8,5 @@ import io.sc.standard.jpa.repository.IndustryRepository;
import java.util.List; import java.util.List;
public interface IndustryService extends DaoService<IndustryEntity, String, IndustryRepository> { public interface IndustryService extends DaoService<IndustryEntity, String, IndustryRepository> {
public List<IndustryVo> getLevel1();
} }

8
io.sc.standard/src/main/java/io/sc/standard/service/PerformanceStatusService.java

@ -0,0 +1,8 @@
package io.sc.standard.service;
import io.sc.platform.orm.service.DaoService;
import io.sc.standard.jpa.entity.PerformanceStatusEntity;
import io.sc.standard.jpa.repository.PerformanceStatusRepository;
public interface PerformanceStatusService extends DaoService<PerformanceStatusEntity, String, PerformanceStatusRepository> {
}

2
io.sc.standard/src/main/java/io/sc/standard/service/impl/AdminDivisionServiceImpl.java

@ -6,7 +6,7 @@ import io.sc.standard.jpa.repository.AdminDivisionRepository;
import io.sc.standard.service.AdminDivisionService; import io.sc.standard.service.AdminDivisionService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service("io.sc.standard.service.impl.AdminDivisionServiceImpl")
public class AdminDivisionServiceImpl extends DaoServiceImpl<AdminDivisionEntity, String, AdminDivisionRepository> implements AdminDivisionService { public class AdminDivisionServiceImpl extends DaoServiceImpl<AdminDivisionEntity, String, AdminDivisionRepository> implements AdminDivisionService {
} }

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save