yingp 6 роки тому
коміт
09381215a0
100 змінених файлів з 7569 додано та 0 видалено
  1. 33 0
      .gitignore
  2. 56 0
      README.md
  3. 16 0
      applications/base/build.gradle
  4. 47 0
      applications/base/src/main/java/com/usoftchina/uas/base/enum/Status.enum.json
  5. 37 0
      applications/base/src/main/java/com/usoftchina/uas/base/list/Filter.plan.json
  6. 22 0
      applications/base/src/main/java/com/usoftchina/uas/base/operation/Audit.opt.json
  7. 8 0
      applications/base/src/main/java/com/usoftchina/uas/base/operation/AuditOperationHandler.java
  8. 58 0
      applications/base/src/main/java/com/usoftchina/uas/base/permission/Base.perm.json
  9. 12 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/ChinaIDCard.vdt.json
  10. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/ChinaIDCardValidation.java
  11. 12 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/DefaultData.vdt.json
  12. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/DefaultDataValidation.java
  13. 12 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/Email.vdt.json
  14. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/EmailValidation.java
  15. 29 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/EntryCount.vdt.json
  16. 19 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/Legal.vdt.json
  17. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/LegalValidation.java
  18. 12 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/OneEntry.vdt.json
  19. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/OneEntryValidation.java
  20. 48 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/PriceLimit.vdt.json
  21. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/PriceLimitValidation.java
  22. 16 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/Regexp.vdt.json
  23. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/RegexpValidation.java
  24. 12 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/Required.vdt.json
  25. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/RequiredValidation.java
  26. 21 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueEntryFields.vdt.json
  27. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueEntryFieldsValidation.java
  28. 12 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueField.vdt.json
  29. 8 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueFieldValidation.java
  30. 17 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueFields.vdt.json
  31. 8 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueFieldsValidation.java
  32. 5 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/Used.vdt.json
  33. 10 0
      applications/base/src/main/java/com/usoftchina/uas/base/validation/UsedValidation.java
  34. 23 0
      applications/cloud/cloud-sign-service/README.md
  35. 16 0
      applications/cloud/cloud-sign-service/build.gradle
  36. 11 0
      applications/cloud/cloud-sign-service/src/main/resources/static/index.html
  37. 3 0
      applications/scm/scm-base/build.gradle
  38. 6 0
      applications/scm/scm-base/out/production/resources/metadata/Assert.domain.json
  39. 6 0
      applications/scm/scm-base/out/production/resources/metadata/Base.domain.json
  40. 114 0
      applications/scm/scm-base/out/production/resources/metadata/Base.fn.json
  41. 17 0
      applications/scm/scm-base/out/production/resources/metadata/Base.module.json
  42. 6 0
      applications/scm/scm-base/out/production/resources/metadata/Cost.domain.json
  43. 6 0
      applications/scm/scm-base/out/production/resources/metadata/Customer.domain.json
  44. 6 0
      applications/scm/scm-base/out/production/resources/metadata/Ecommerce.domain.json
  45. 6 0
      applications/scm/scm-base/out/production/resources/metadata/Finance.domain.json
  46. 6 0
      applications/scm/scm-base/out/production/resources/metadata/PLM.domain.json
  47. 6 0
      applications/scm/scm-base/out/production/resources/metadata/PM.domain.json
  48. 6 0
      applications/scm/scm-base/out/production/resources/metadata/Scm.domain.json
  49. 6 0
      applications/scm/scm-base/out/production/resources/metadata/Sys.domain.json
  50. 781 0
      applications/scm/scm-base/out/production/resources/metadata/product/Product.form.json
  51. 5 0
      applications/scm/scm-base/out/production/resources/metadata/supplier/Supplier.filter.json
  52. 943 0
      applications/scm/scm-base/out/production/resources/metadata/supplier/Supplier.form.json
  53. 6 0
      applications/scm/scm-base/src/main/resources/metadata/Assert.domain.json
  54. 6 0
      applications/scm/scm-base/src/main/resources/metadata/Base.domain.json
  55. 114 0
      applications/scm/scm-base/src/main/resources/metadata/Base.fn.json
  56. 17 0
      applications/scm/scm-base/src/main/resources/metadata/Base.module.json
  57. 6 0
      applications/scm/scm-base/src/main/resources/metadata/Cost.domain.json
  58. 6 0
      applications/scm/scm-base/src/main/resources/metadata/Customer.domain.json
  59. 6 0
      applications/scm/scm-base/src/main/resources/metadata/Ecommerce.domain.json
  60. 6 0
      applications/scm/scm-base/src/main/resources/metadata/Finance.domain.json
  61. 6 0
      applications/scm/scm-base/src/main/resources/metadata/PLM.domain.json
  62. 6 0
      applications/scm/scm-base/src/main/resources/metadata/PM.domain.json
  63. 6 0
      applications/scm/scm-base/src/main/resources/metadata/Scm.domain.json
  64. 6 0
      applications/scm/scm-base/src/main/resources/metadata/Sys.domain.json
  65. 781 0
      applications/scm/scm-base/src/main/resources/metadata/product/Product.form.json
  66. 5 0
      applications/scm/scm-base/src/main/resources/metadata/supplier/Supplier.filter.json
  67. 943 0
      applications/scm/scm-base/src/main/resources/metadata/supplier/Supplier.form.json
  68. 3 0
      applications/scm/scm-purchase/build.gradle
  69. BIN
      applications/scm/scm-purchase/out/production/classes/META-INF/uas-platform.applications.scm.scm-purchase.main.kotlin_module
  70. 184 0
      applications/scm/scm-purchase/out/production/resources/metadata/Purchase.fn.json
  71. 1125 0
      applications/scm/scm-purchase/out/production/resources/metadata/Purchase.form.json
  72. 32 0
      applications/scm/scm-purchase/out/production/resources/metadata/Purchase.module.json
  73. 184 0
      applications/scm/scm-purchase/src/main/resources/metadata/Purchase.fn.json
  74. 1125 0
      applications/scm/scm-purchase/src/main/resources/metadata/Purchase.form.json
  75. 32 0
      applications/scm/scm-purchase/src/main/resources/metadata/Purchase.module.json
  76. 8 0
      applications/starter/build.gradle
  77. BIN
      applications/starter/out/production/classes/META-INF/uas-platform.applications.starter.main.kotlin_module
  78. BIN
      applications/starter/out/production/classes/com/usoftchina/uas/ApplicationStarter.class
  79. BIN
      applications/starter/out/production/classes/com/usoftchina/uas/config/WebConfig.class
  80. BIN
      applications/starter/out/production/classes/com/usoftchina/uas/error/DefaultErrorConfig.class
  81. BIN
      applications/starter/out/production/classes/com/usoftchina/uas/error/GlobalExceptionHandler.class
  82. BIN
      applications/starter/out/production/classes/com/usoftchina/uas/error/ServletErrorUtils.class
  83. BIN
      applications/starter/out/production/classes/com/usoftchina/uas/error/UnCaughtErrorFilter.class
  84. 22 0
      applications/starter/out/production/resources/application.yml
  85. 10 0
      applications/starter/out/production/resources/banner.txt
  86. 3 0
      applications/starter/out/production/resources/config/application-prod.yml
  87. 3 0
      applications/starter/out/production/resources/config/application-test.yml
  88. 24 0
      applications/starter/src/main/java/com/usoftchina/uas/ApplicationStarter.java
  89. 21 0
      applications/starter/src/main/java/com/usoftchina/uas/config/WebConfig.java
  90. 25 0
      applications/starter/src/main/java/com/usoftchina/uas/error/DefaultErrorConfig.java
  91. 53 0
      applications/starter/src/main/java/com/usoftchina/uas/error/GlobalExceptionHandler.java
  92. 53 0
      applications/starter/src/main/java/com/usoftchina/uas/error/ServletErrorUtils.java
  93. 36 0
      applications/starter/src/main/java/com/usoftchina/uas/error/UnCaughtErrorFilter.java
  94. 22 0
      applications/starter/src/main/resources/application.yml
  95. 10 0
      applications/starter/src/main/resources/banner.txt
  96. 3 0
      applications/starter/src/main/resources/config/application-prod.yml
  97. 3 0
      applications/starter/src/main/resources/config/application-test.yml
  98. 69 0
      build.gradle
  99. 6 0
      framework/framework-app/build.gradle
  100. BIN
      framework/framework-app/out/production/classes/com/usoftchina/uas/app/view/HomeController.class

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
+.git
+logs
+rebel.xml
+target
+!.mvn/wrapper/maven-wrapper.jar
+### VSCODE ###
+.vscode
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+
+### IntelliJ IDEA ###
+.gradle
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+nbproject/private/
+build/
+nbbuild/
+dist/
+node_modules/
+nbdist/
+.nb-gradle/
+generatorConfig.xml
+
+*.log:

+ 56 - 0
README.md

@@ -0,0 +1,56 @@
+## UAS2.0框架
+
+### 项目结构
+
+```
+├─uu-platform
+│  │  
+│  ├─apis-------------------------------------接口定义
+│  ├─db---------------------------------------数据库脚本
+│  ├─external---------------------------------第三方对接
+│  ├─fronted----------------------------------前端
+│  ├─runtime----------------------------------服务运行
+│  ├─services---------------------------------服务实现
+│  ├─shared-----------------------------------公共模块
+│  │
+```
+
+### 开发环境配置
+
+| 工具/环境      |  版本  |
+| --------   | :----:  |
+| gradle |  5.4  |
+| idea |  2019.3  |
+| java |  1.8  |
+
+### 本地构建
+
+```
+gradlew build -x test
+```
+
+### 测试运行环境
+
+> 服务器
+
+| IP      |  账号  |  密码  |  环境  |  资源  |
+| --------   | :----:  | :----: | :------:  | :------:  |
+| 10.1.81.81 |  root  | select123*** |  CentOS7, Tigase, MySQL  | Cpu: 8, Mem: 16G, Disk: 60G |
+| 10.1.81.82 |  root  | select123*** |  CentOS7, MySQL  | Cpu: 8, Mem: 16G, Disk: 60G |
+| 10.1.81.83 |  root  | select123*** |  CentOS7, Docker  | Cpu: 8, Mem: 16G, Disk: 60G |
+
+> 数据库
+
+| 数据库      | 类型   | 地址   |  账号  |  密码  |  说明  |
+| --------   | :-----: | :-----:  | :----:  | :----: | :------  |
+| uu_base | mysql | 10.1.81.82:3306 |  root  | select111*** |  基础库  |
+
+> 中间件
+
+| 类型 | 地址 | 账号 | 密码 | 说明 |
+| ---- | :----: | :----: | :----: | ---- |
+| redis | 10.1.81.82:6379 | | | 内存数据库 |
+
+> 部署
+
+* [jenkins](http://10.1.81.61:8080/job/uu/view/test) **账号** admin **密码** select123***

+ 16 - 0
applications/base/build.gradle

@@ -0,0 +1,16 @@
+plugins {
+    id 'java'
+}
+
+group 'com.usoftchina.uas'
+version '2.0.0-SNAPSHOT'
+
+sourceCompatibility = 1.8
+
+repositories {
+    mavenCentral()
+}
+
+dependencies {
+    testCompile group: 'junit', name: 'junit', version: '4.12'
+}

+ 47 - 0
applications/base/src/main/java/com/usoftchina/uas/base/enum/Status.enum.json

@@ -0,0 +1,47 @@
+[{
+  "id": "status",
+  "name": "数据状态",
+  "entries": [{
+    "name": "在录入",
+    "value": "E"
+  }, {
+    "name": "已提交",
+    "value": "S"
+  }, {
+    "name": "已审核",
+    "value": "A"
+  }]
+}, {
+  "id": "permStatus",
+  "name": "权限状态",
+  "entries": [{
+    "name": "无权",
+    "value": "N"
+  }, {
+    "name": "有权",
+    "value": "Y"
+  }]
+}, {
+  "id": "execStatus",
+  "name": "执行状态",
+  "entries": [{
+    "name": "成功",
+    "value": "S"
+  }, {
+    "name": "失败",
+    "value": "F"
+  }, {
+    "name": "部分成功",
+    "value": "P"
+  }]
+}, {
+  "id": "enableStatus",
+  "name": "禁用状态",
+  "entries": [{
+    "name": "禁用",
+    "value": "N"
+  }, {
+    "name": "启用",
+    "value": "Y"
+  }]
+}]

+ 37 - 0
applications/base/src/main/java/com/usoftchina/uas/base/list/Filter.plan.json

@@ -0,0 +1,37 @@
+[{
+  "id": "default",
+  "name": "缺省方案",
+  "filter": []
+}, {
+  "id": "today",
+  "name": "今天",
+  "filter": [{
+    "fieldFn": "billDateField",
+    "compare": "=",
+    "valueFn": "today"
+  }]
+}, {
+  "id": "thisWeek",
+  "name": "本周",
+  "filter": [{
+    "fieldFn": "billDateField",
+    "compare": ">=",
+    "valueFn": "thisWeekBegin"
+  }, {
+    "fieldFn": "billDateField",
+    "compare": "<=",
+    "valueFn": "thisWeekEnd"
+  }]
+}, {
+  "id": "thisMonth",
+  "name": "本月",
+  "filter": [{
+    "fieldFn": "billDateField",
+    "compare": ">=",
+    "valueFn": "thisMonthBegin"
+  }, {
+    "fieldFn": "billDateField",
+    "compare": "<=",
+    "valueFn": "thisMonthEnd"
+  }]
+}]

+ 22 - 0
applications/base/src/main/java/com/usoftchina/uas/base/operation/Audit.opt.json

@@ -0,0 +1,22 @@
+[{
+  "id": "audit",
+  "name": "审核",
+  "className": "com.usoftchina.uas.base.operation.AuditOperationHandler",
+  "form": {
+    "layout": "vbox",
+    "items": [{
+      "name": "statusField",
+      "label": "审核状态字段",
+      "xtype": "statusFieldCombo"
+    }, {
+      "name": "statusValue",
+      "label": "审核通过名称",
+      "xtype": "statusCombo"
+    }, {
+      "name": "commentField",
+      "label": "审核意见字段",
+      "xtype": "textFieldCombo"
+    }]
+  },
+  "log": true
+}]

+ 8 - 0
applications/base/src/main/java/com/usoftchina/uas/base/operation/AuditOperationHandler.java

@@ -0,0 +1,8 @@
+package com.usoftchina.uas.base.operation;
+
+/**
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class AuditOperationHandler {
+}

+ 58 - 0
applications/base/src/main/java/com/usoftchina/uas/base/permission/Base.perm.json

@@ -0,0 +1,58 @@
+[{
+  "id": "track",
+  "name": "业务流程查询"
+}, {
+  "id": "import",
+  "name": "导入"
+}, {
+  "id": "export",
+  "name": "导出"
+}, {
+  "id": "delete",
+  "name": "删除"
+}, {
+  "id": "freeze",
+  "name": "冻结"
+}, {
+  "id": "unFreeze",
+  "name": "取消冻结"
+}, {
+  "id": "close",
+  "name": "关闭"
+}, {
+  "id": "unClose",
+  "name": "反关闭"
+}, {
+  "id": "new",
+  "name": "新增"
+}, {
+  "id": "modify",
+  "name": "修改"
+}, {
+  "id": "submit",
+  "name": "提交"
+}, {
+  "id": "audit",
+  "name": "审核"
+}, {
+  "id": "unAudit",
+  "name": "反审核"
+}, {
+  "id": "view",
+  "name": "查看"
+}, {
+  "id": "trackUp",
+  "name": "上查"
+}, {
+  "id": "trackDown",
+  "name": "下查"
+}, {
+  "id": "print",
+  "name": "打印"
+}, {
+  "id": "cancel",
+  "name": "作废"
+}, {
+  "id": "accessory",
+  "name": "附件"
+}]

+ 12 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/ChinaIDCard.vdt.json

@@ -0,0 +1,12 @@
+[{
+  "id": "chinaIDCard",
+  "name": "合法性检查,检查大陆居民身份证格式合法性",
+  "className": "com.usoftchina.uas.base.validation.ChinaIDCardValidation",
+  "form": {
+    "items": [{
+      "name": "idCardField",
+      "label": "选择需要进行大陆居民身份证号码检查的字段",
+      "xtype": "fieldTree"
+    }]
+  }
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/ChinaIDCardValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 合法性检查,检查大陆居民身份证格式合法性
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class ChinaIDCardValidation {
+}

+ 12 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/DefaultData.vdt.json

@@ -0,0 +1,12 @@
+[{
+  "id": "defaultData",
+  "name": "合法性检查,默认数据设置",
+  "className": "com.usoftchina.uas.base.validation.DefaultDataValidation",
+  "form": {
+    "items": [{
+      "name": "selectField",
+      "label": "选择需要进行检查的复选框字段",
+      "xtype": "fieldTree"
+    }]
+  }
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/DefaultDataValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 合法性检查,默认数据设置
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class DefaultDataValidation {
+}

+ 12 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/Email.vdt.json

@@ -0,0 +1,12 @@
+[{
+  "id": "email",
+  "name": "合法性检查,检查邮件格式合法性",
+  "className": "com.usoftchina.uas.base.validation.EmailValidation",
+  "form": {
+    "items": [{
+      "name": "emailField",
+      "label": "选择需要进行邮箱合法性检查的字段",
+      "xtype": "fieldTree"
+    }]
+  }
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/EmailValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 合法性检查,检查邮件格式合法性
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class EmailValidation {
+}

+ 29 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/EntryCount.vdt.json

@@ -0,0 +1,29 @@
+[{
+  "id": "entryCount",
+  "name": "合法性检查,检查分录列合计",
+  "className": "com.usoftchina.uas.base.validation.EntryCountValidation",
+  "form": {
+    "layout": "vbox",
+    "items": [{
+      "name": "entryField",
+      "label": "分录项",
+      "xtype": "entryFieldCombo"
+    }, {
+      "name": "groupField",
+      "label": "分组列",
+      "xtype": "fieldCombo"
+    }, {
+      "name": "countField",
+      "label": "合计列",
+      "xtype": "numberFieldCombo"
+    }, {
+      "name": "compare",
+      "label": "操作符",
+      "xtype": "compareCombo"
+    }, {
+      "name": "compareValue",
+      "label": "比较值",
+      "xtype": "numberfield"
+    }]
+  }
+}]

+ 19 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/Legal.vdt.json

@@ -0,0 +1,19 @@
+[{
+  "id": "legal",
+  "name": "单据合法性校验",
+  "className": "com.usoftchina.uas.base.validation.LegalValidation",
+  "form": {
+    "items": [{
+      "name": "expression",
+      "xtype": "fieldExpTree"
+    }, {
+      "name": "triggerOnTrue",
+      "label": "校验表达式为真时提示",
+      "xtype": "checkbox"
+    }, {
+      "name": "message",
+      "label": "提示信息",
+      "xtype": "textfield"
+    }]
+  }
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/LegalValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 单据合法性校验
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class LegalValidation {
+}

+ 12 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/OneEntry.vdt.json

@@ -0,0 +1,12 @@
+[{
+  "id": "oneEntry",
+  "name": "有且只能选择一条分录",
+  "className": "com.usoftchina.uas.base.validation.OneEntryValidation",
+  "form": {
+    "items": [{
+      "name": "selectField",
+      "label": "选择需要进行检查的复选框字段",
+      "xtype": "fieldTree"
+    }]
+  }
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/OneEntryValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 有且只能选择一条分录
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class OneEntryValidation {
+}

+ 48 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/PriceLimit.vdt.json

@@ -0,0 +1,48 @@
+[{
+  "id": "priceLimit",
+  "name": "限价控制检查",
+  "className": "com.usoftchina.uas.base.validation.PriceLimitValidation",
+  "form": {
+    "layout": {
+      "type": "table",
+      "columns": 2
+    },
+    "items": [{
+      "name": "productField",
+      "label": "物料字段",
+      "xtype": "productFieldCombo"
+    }, {
+      "name": "priceCateField",
+      "label": "价目表字段",
+      "xtype": "priceCateFieldCombo"
+    }, {
+      "name": "priceField",
+      "label": "单价字段",
+      "xtype": "priceFieldCombo"
+    }, {
+      "name": "taxPriceField",
+      "label": "含税单价字段",
+      "xtype": "priceFieldCombo"
+    }, {
+      "name": "maxPriceField",
+      "label": "价格上限字段",
+      "xtype": "priceFieldCombo"
+    }, {
+      "name": "minPriceField",
+      "label": "价格下限字段",
+      "xtype": "priceFieldCombo"
+    }, {
+      "name": "unitField",
+      "label": "单位字段",
+      "xtype": "unitFieldCombo"
+    }, {
+      "name": "hasTaxField",
+      "label": "是否含税字段",
+      "xtype": "checkboxFieldCombo"
+    }, {
+      "name": "isGiftField",
+      "label": "是否赠品字段",
+      "xtype": "checkboxFieldCombo"
+    }]
+  }
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/PriceLimitValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 限价控制检查
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class PriceLimitValidation {
+}

+ 16 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/Regexp.vdt.json

@@ -0,0 +1,16 @@
+[{
+  "id": "regexp",
+  "name": "正则表达式验证",
+  "className": "com.usoftchina.uas.base.validation.RegexpValidation",
+  "form": {
+    "items": [{
+      "name": "textField",
+      "label": "选择需要校验字符串格式的字段",
+      "xtype": "textfieldTree"
+    }, {
+      "name": "expression",
+      "label": "正则表达式",
+      "xtype": "textfield"
+    }]
+  }
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/RegexpValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 正则表达式验证
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class RegexpValidation {
+}

+ 12 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/Required.vdt.json

@@ -0,0 +1,12 @@
+[{
+  "id": "required",
+  "name": "合法性检查,字段必录",
+  "className": "com.usoftchina.uas.base.validation.RequiredValidation",
+  "form": {
+    "items": [{
+      "name": "requiredFields",
+      "label": "选择需要校验必录的字段列表",
+      "xtype": "fieldTree"
+    }]
+  }
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/RequiredValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 合法性检查,字段必录
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class RequiredValidation {
+}

+ 21 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueEntryFields.vdt.json

@@ -0,0 +1,21 @@
+[{
+  "id": "uniqueField",
+  "name": "合法性检查,检查分录组合字段唯一性",
+  "className": "com.usoftchina.uas.base.validation.UniqueEntryFieldsValidation",
+  "form": {
+    "items": [{
+      "name": "uniqueFields",
+      "label": "选择需要进行唯一性检查的组合字段",
+      "xtype": "fieldTree",
+      "selectModel": "multi"
+    }, {
+      "name": "onlyCurrentForm",
+      "label": "仅检查当前表单内数据",
+      "xtype": "checkbox"
+    }, {
+      "name": "ignoreNull",
+      "label": "空值不参与校验",
+      "xtype": "checkbox"
+    }]
+  }
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueEntryFieldsValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 合法性检查,检查分录组合字段唯一性
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class UniqueEntryFieldsValidation {
+}

+ 12 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueField.vdt.json

@@ -0,0 +1,12 @@
+[{
+  "id": "uniqueField",
+  "name": "合法性检查,检查字段唯一性",
+  "className": "com.usoftchina.uas.base.validation.UniqueFieldValidation",
+  "form": {
+    "items": [{
+      "name": "uniqueField",
+      "label": "选择需要进行唯一性检查的字段",
+      "xtype": "fieldTree"
+    }]
+  }
+}]

+ 8 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueFieldValidation.java

@@ -0,0 +1,8 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class UniqueFieldValidation {
+}

+ 17 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueFields.vdt.json

@@ -0,0 +1,17 @@
+[{
+  "id": "uniqueField",
+  "name": "合法性检查,检查组合字段唯一性",
+  "className": "com.usoftchina.uas.base.validation.UniqueFieldsValidation",
+  "form": {
+    "items": [{
+      "name": "uniqueFields",
+      "label": "选择需要进行唯一性检查的组合字段",
+      "xtype": "fieldTree",
+      "selectModel": "multi"
+    }, {
+      "name": "ignoreNull",
+      "label": "空值不参与校验",
+      "xtype": "checkbox"
+    }]
+  }
+}]

+ 8 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/UniqueFieldsValidation.java

@@ -0,0 +1,8 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class UniqueFieldsValidation {
+}

+ 5 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/Used.vdt.json

@@ -0,0 +1,5 @@
+[{
+  "id": "used",
+  "name": "检查当前基础资料是否被其他业务对象使用",
+  "className": "com.usoftchina.uas.base.validation.UsedValidation"
+}]

+ 10 - 0
applications/base/src/main/java/com/usoftchina/uas/base/validation/UsedValidation.java

@@ -0,0 +1,10 @@
+package com.usoftchina.uas.base.validation;
+
+/**
+ * 检查当前基础资料是否被其他业务对象使用
+ *
+ * @author yingp
+ * @date 2019/8/9
+ */
+public class UsedValidation {
+}

+ 23 - 0
applications/cloud/cloud-sign-service/README.md

@@ -0,0 +1,23 @@
+### 无纸化签名服务
+
+**说明**
+
+- 用于电子签名功能
+- 通过html5 canvas实现
+- 因为客户服务器外网问题,不能部署到客户环境,需要部署到云端
+
+**如何在线签名**
+
+- 系统里面点击个人信息设置
+- 手机扫描二维码,打开一个签名H5页面
+- 手写电子签名
+- 确认完成,生成图片
+- 消息通知客户服务器,客户服务器下载签名图片
+- 用户在系统页面预览签名图片
+
+**如果能部署到客户环境,可以放在UU互联的应用里面**
+
+- 打开UU互联 - 小工具 - 电子签名
+- 确认完成,生成图片
+- 用户在系统页面预览签名图片
+

+ 16 - 0
applications/cloud/cloud-sign-service/build.gradle

@@ -0,0 +1,16 @@
+plugins {
+    id 'java'
+}
+
+group 'com.usoftchina.uas'
+version '2.0.0-SNAPSHOT'
+
+sourceCompatibility = 1.8
+
+repositories {
+    mavenCentral()
+}
+
+dependencies {
+    testCompile group: 'junit', name: 'junit', version: '4.12'
+}

Різницю між файлами не показано, бо вона завелика
+ 11 - 0
applications/cloud/cloud-sign-service/src/main/resources/static/index.html


+ 3 - 0
applications/scm/scm-base/build.gradle

@@ -0,0 +1,3 @@
+dependencies {
+    compile project(':framework:framework-form')
+}

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/Assert.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "资产管理",
+    "id": "assert"
+  }
+]

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/Base.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "基础管理",
+    "id": "base"
+  }
+]

+ 114 - 0
applications/scm/scm-base/out/production/resources/metadata/Base.fn.json

@@ -0,0 +1,114 @@
+[
+  {
+    "groupId": "base_data_main",
+    "groupName": "主数据",
+    "module": "base_data",
+    "entries": [
+      {
+        "text": "物料",
+        "formId": "base_product",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "物料列表",
+        "formId": "base_product",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "供应商",
+        "formId": "base_supplier",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "供应商列表",
+        "formId": "base_supplier",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "客户",
+        "formId": "base_customer",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "客户列表",
+        "formId": "base_customer",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "部门",
+        "formId": "base_dept",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "部门列表",
+        "formId": "base_dept",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "员工",
+        "formId": "base_emp",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "员工列表",
+        "formId": "base_emp",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "base_data_public",
+    "groupName": "公共资料",
+    "module": "base_data",
+    "entries": [
+      {
+        "text": "币别",
+        "formId": "base_currency",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "计量单位",
+        "formId": "base_unit",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "base_data_support",
+    "groupName": "辅助资料",
+    "module": "base_data",
+    "entries": [
+      {
+        "text": "辅助资料列表",
+        "formId": "base_supportdata",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "new"
+      }
+    ]
+  }
+]

+ 17 - 0
applications/scm/scm-base/out/production/resources/metadata/Base.module.json

@@ -0,0 +1,17 @@
+[
+  {
+    "id": "base_data",
+    "name": "基础资料",
+    "domain": "base"
+  },
+  {
+    "id": "base_setting",
+    "name": "公共设置",
+    "domain": "base"
+  },
+  {
+    "id": "base_init",
+    "name": "初始化管理",
+    "domain": "base"
+  }
+]

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/Cost.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "成本管理",
+    "id": "cost"
+  }
+]

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/Customer.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "客户关系管理",
+    "id": "cust"
+  }
+]

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/Ecommerce.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "电商与分销",
+    "id": "ec"
+  }
+]

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/Finance.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "财务会计",
+    "id": "fa"
+  }
+]

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/PLM.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "PLM",
+    "id": "plm"
+  }
+]

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/PM.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "生产制造",
+    "id": "pm"
+  }
+]

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/Scm.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "供应链",
+    "id": "scm"
+  }
+]

+ 6 - 0
applications/scm/scm-base/out/production/resources/metadata/Sys.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "系统管理",
+    "id": "sys"
+  }
+]

+ 781 - 0
applications/scm/scm-base/out/production/resources/metadata/product/Product.form.json

@@ -0,0 +1,781 @@
+[
+  {
+    "id": "base_product",
+    "name": "物料",
+    "type": "baseData",
+    "nameColumnName": "BASE_PRODUCT.PR_NAME",
+    "idColumnName": "PR_ID",
+    "codeColumnName": "PR_CODE",
+    "entities": [
+      {
+        "name": "物料",
+        "tableName": "BASE_PRODUCT",
+        "type": "head",
+        "fields": [
+          {
+            "name": "编码",
+            "columnName": "PR_CODE",
+            "type": "code",
+            "length": 50
+          },
+          {
+            "name": "名称",
+            "columnName": "PR_NAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "创建人",
+            "columnName": "PR_CREATOR",
+            "type": "creator"
+          },
+          {
+            "name": "创建日期",
+            "columnName": "PR_CREATEDATE",
+            "type": "createDate"
+          },
+          {
+            "name": "修改人",
+            "columnName": "PR_MODIFIER",
+            "type": "modifier"
+          },
+          {
+            "name": "修改日期",
+            "columnName": "PR_MODIFYDATE",
+            "type": "modifyDate"
+          },
+          {
+            "name": "审核人",
+            "columnName": "PR_AUDITOR",
+            "type": "user"
+          },
+          {
+            "name": "审核日期",
+            "columnName": "PR_AUDITDATE",
+            "type": "date"
+          },
+          {
+            "name": "单据状态",
+            "columnName": "PR_STATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "E",
+                "name": "在录入"
+              },
+              {
+                "code": "S",
+                "name": "已提交"
+              },
+              {
+                "code": "A",
+                "name": "已审核"
+              }
+            ]
+          },
+          {
+            "name": "禁用人",
+            "columnName": "PR_FORBIDER",
+            "type": "user"
+          },
+          {
+            "name": "禁用日期",
+            "columnName": "PR_FORBIDDATE",
+            "type": "date"
+          },
+          {
+            "name": "禁用状态",
+            "columnName": "PR_FORBIDSTATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "N",
+                "name": "否",
+                "control": [
+                  {
+                    "type": "field",
+                    "scope": [
+                      "BASE_PRODUCT.PR_CODE",
+                      "BASE_PRODUCT.PR_NAME"
+                    ]
+                  },
+                  {
+                    "type": "menubar",
+                    "scope": []
+                  }
+                ]
+              },
+              {
+                "code": "Y",
+                "name": "是"
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "name": "基本信息",
+        "tableName": "BASE_PRODUCT_BASE",
+        "type": "subHead",
+        "idColumnName": "PR_BASE_ID",
+        "fields": [
+          {
+            "name": "允许采购",
+            "columnName": "PR_IS_PURCHASE",
+            "type": "checkbox"
+          },
+          {
+            "name": "允许销售",
+            "columnName": "PR_IS_SALE",
+            "type": "checkbox"
+          },
+          {
+            "name": "允许生产",
+            "columnName": "PR_IS_MAKE",
+            "type": "checkbox"
+          },
+          {
+            "name": "允许委外",
+            "columnName": "PR_IS_OSMAKE",
+            "type": "checkbox"
+          },
+          {
+            "name": "允许库存",
+            "columnName": "PR_IS_STOCK",
+            "type": "checkbox"
+          }
+        ]
+      },
+      {
+        "name": "采购",
+        "tableName": "BASE_PRODUCT_PURC",
+        "type": "subHead",
+        "idColumnName": "PR_PURC_ID",
+        "fields": [
+          {
+            "name": "最小包装数",
+            "columnName": "PR_MIN_PACK",
+            "type": "int"
+          },
+          {
+            "name": "收货提前天数",
+            "columnName": "PR_RECE_DAY",
+            "type": "int"
+          },
+          {
+            "name": "允许退料",
+            "columnName": "PR_PURC_RETURN",
+            "type": "checkbox"
+          },
+          {
+            "name": "采购单位",
+            "columnName": "PR_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          },
+          {
+            "name": "采购计价单位",
+            "columnName": "PR_PRICE_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          }
+        ]
+      },
+      {
+        "name": "销售",
+        "tableName": "BASE_PRODUCT_SALE",
+        "type": "subHead",
+        "idColumnName": "PR_SALE_ID",
+        "fields": [
+          {
+            "name": "起订量",
+            "columnName": "PR_MIN_ORDER",
+            "type": "int"
+          },
+          {
+            "name": "允许退料",
+            "columnName": "PR_SALE_RETURN",
+            "type": "checkbox"
+          },
+          {
+            "name": "销售单位",
+            "columnName": "PR_SALE_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          },
+          {
+            "name": "销售计价单位",
+            "columnName": "PR_SALE_PRICE_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          }
+        ]
+      }
+    ],
+    "operations": [
+      {
+        "id": "save",
+        "name": "保存",
+        "type": "save"
+      },
+      {
+        "id": "submit",
+        "name": "提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PR_STATUS",
+          "statusValue": "S"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "只能提交在录入的单据"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unSubmit",
+        "name": "反提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PR_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已提交,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未提交"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "audit",
+        "name": "审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PR_STATUS",
+          "statusValue": "A"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "请先提交单据"
+            },
+            "level": "error"
+          },
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "单据已经审核,无需再审"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unAudit",
+        "name": "反审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PR_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未审核"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "new",
+        "name": "新增",
+        "type": "addView",
+        "params": {
+          "viewName": "base_product",
+          "viewType": "form",
+          "openType": "card"
+        }
+      },
+      {
+        "id": "close",
+        "name": "退出",
+        "type": "closeView"
+      },
+      {
+        "id": "returnData",
+        "name": "返回数据",
+        "type": "returnData"
+      }
+    ],
+    "codeRules": [
+      {
+        "default": true,
+        "name": "物料编码规则",
+        "description": "物料编码规则",
+        "editable": true,
+        "repairable": true,
+        "entries": [
+          {
+            "type": "number",
+            "cover": "0",
+            "seed": 1,
+            "increment": 1,
+            "length": 4
+          }
+        ]
+      }
+    ],
+    "views": [
+      {
+        "viewType": "form",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "保存",
+                "reference": "tbSave",
+                "operation": "save"
+              },
+              {
+                "text": "提交",
+                "menu": [
+                  {
+                    "text": "提交",
+                    "reference": "tbSubmit",
+                    "operation": "submit"
+                  },
+                  {
+                    "text": "反提交",
+                    "reference": "tbUnSubmit",
+                    "operation": "unSubmit"
+                  }
+                ]
+              },
+              {
+                "text": "审核",
+                "menu": [
+                  {
+                    "text": "审核",
+                    "reference": "tbAudit",
+                    "operation": "audit"
+                  },
+                  {
+                    "text": "反审核",
+                    "reference": "tbUnAudit",
+                    "operation": "unAudit"
+                  }
+                ]
+              },
+              {
+                "text": "列表"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "container",
+            "height": 50,
+            "layout": "absolute",
+            "items": [
+              {
+                "xtype": "textfield",
+                "fieldLabel": "编码",
+                "bind": "{BASE_PRODUCT.PR_CODE}",
+                "emptyText": "保存时自动生成",
+                "x": 10,
+                "y": 10,
+                "width": 300
+              },
+              {
+                "xtype": "textfield",
+                "fieldLabel": "名称",
+                "bind": "{BASE_PRODUCT.PR_NAME}",
+                "x": 310,
+                "y": 10,
+                "width": 300
+              }
+            ]
+          },
+          {
+            "xtype": "tabpanel",
+            "ui": "form",
+            "height": 500,
+            "items": [
+              {
+                "title": "基本信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许采购",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_PURCHASE}",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许销售",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_SALE}",
+                    "x": 10,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许生产",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_MAKE}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许委外",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_OSMAKE}",
+                    "x": 310,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许库存",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_STOCK}",
+                    "x": 610,
+                    "y": 10,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "采购",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "numberfield",
+                    "fieldLabel": "最小包装数",
+                    "bind": "{BASE_PRODUCT_PURC.PR_MIN_PACK}",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "numberfield",
+                    "fieldLabel": "收货提前天数",
+                    "bind": "{BASE_PRODUCT_PURC.PR_RECE_DAY}",
+                    "x": 10,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许退料",
+                    "bind": "{BASE_PRODUCT_SALE.PR_PURC_RETURN}",
+                    "x": 10,
+                    "y": 90,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "采购单位",
+                    "bind": "{BASE_PRODUCT_PURC.PR_PURC_UNIT}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "采购计价单位",
+                    "bind": "{BASE_PRODUCT_PURC.PR_PURC_PRICE_UNIT}",
+                    "x": 310,
+                    "y": 50,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "销售",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "numberfield",
+                    "fieldLabel": "起订量",
+                    "bind": "{BASE_PRODUCT_SALE.PR_MIN_ORDER}",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许退料",
+                    "bind": "{BASE_PRODUCT_SALE.PR_SALE_RETURN}",
+                    "x": 10,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "销售单位",
+                    "bind": "{BASE_PRODUCT_SALE.PR_SALE_UNIT}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "销售计价单位",
+                    "bind": "{BASE_PRODUCT_SALE.PR_SALE_PRICE_UNIT}",
+                    "x": 310,
+                    "y": 50,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "其他信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "x": 10,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "创建人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_CREATOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "创建日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_PRODUCT.PR_CREATEDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 90,
+                    "width": 300,
+                    "fieldLabel": "修改人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_MODIFIER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 130,
+                    "width": 300,
+                    "fieldLabel": "修改日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_PRODUCT.PR_MODIFYDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "审核人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_AUDITOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "审核日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_PRODUCT.PR_AUDITDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "禁用状态",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_FORBIDSTATUS}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "禁用人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_FORBIDER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 90,
+                    "width": 300,
+                    "fieldLabel": "禁用时间",
+                    "xtype": "datefield",
+                    "bind": "{BASE_PRODUCT.PR_FORBIDDATE}",
+                    "disabled": true
+                  }
+                ]
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "viewType": "list",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "过滤"
+              },
+              {
+                "text": "返回数据",
+                "reference": "returnDataBtn",
+                "operation": "returnData"
+              },
+              {
+                "text": "刷新"
+              },
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增",
+                    "reference": "newBtn",
+                    "operation": "new"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "打开"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "gridpanel",
+            "ui": "form",
+            "showFilterBar": true,
+            "showHeaderFilter": true,
+            "showPagingBar": true,
+            "height": 584,
+            "selType": "checkboxmodel",
+            "columns": [
+              {
+                "text": "编码",
+                "dataIndex": "PR_CODE",
+                "entity": "BASE_PRODUCT"
+              },
+              {
+                "text": "名称",
+                "dataIndex": "PR_NAME",
+                "entity": "BASE_PRODUCT",
+                "width": 200
+              },
+              {
+                "text": "单据状态",
+                "dataIndex": "PR_STATUS",
+                "entity": "BASE_PRODUCT"
+              },
+              {
+                "text": "禁用状态",
+                "dataIndex": "PR_FORBIDSTATUS",
+                "entity": "BASE_PRODUCT"
+              }
+            ]
+          }
+        ]
+      }
+    ]
+  }
+]

+ 5 - 0
applications/scm/scm-base/out/production/resources/metadata/supplier/Supplier.filter.json

@@ -0,0 +1,5 @@
+[
+  {
+
+  }
+]

+ 943 - 0
applications/scm/scm-base/out/production/resources/metadata/supplier/Supplier.form.json

@@ -0,0 +1,943 @@
+[
+  {
+    "id": "base_supplier",
+    "name": "供应商",
+    "type": "baseData",
+    "nameColumnName": "SU_NAME",
+    "idColumnName": "SU_ID",
+    "codeColumnName": "SU_CODE",
+    "entities": [
+      {
+        "name": "单据头",
+        "tableName": "BASE_SUPPLIER",
+        "type": "head",
+        "fields": [
+          {
+            "name": "编码",
+            "columnName": "SU_CODE",
+            "type": "code",
+            "length": 50
+          },
+          {
+            "name": "名称",
+            "columnName": "SU_NAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "简称",
+            "columnName": "SU_SHORTNAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "创建人",
+            "columnName": "SU_CREATOR",
+            "type": "creator"
+          },
+          {
+            "name": "创建日期",
+            "columnName": "SU_CREATEDATE",
+            "type": "createDate"
+          },
+          {
+            "name": "修改人",
+            "columnName": "SU_MODIFIER",
+            "type": "modifier"
+          },
+          {
+            "name": "修改日期",
+            "columnName": "SU_MODIFYDATE",
+            "type": "modifyDate"
+          },
+          {
+            "name": "审核人",
+            "columnName": "SU_AUDITOR",
+            "type": "user"
+          },
+          {
+            "name": "审核日期",
+            "columnName": "SU_AUDITDATE",
+            "type": "date"
+          },
+          {
+            "name": "单据状态",
+            "columnName": "SU_STATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "E",
+                "name": "在录入"
+              },
+              {
+                "code": "S",
+                "name": "已提交"
+              },
+              {
+                "code": "A",
+                "name": "已审核"
+              }
+            ]
+          },
+          {
+            "name": "禁用人",
+            "columnName": "SU_FORBIDER",
+            "type": "user"
+          },
+          {
+            "name": "禁用日期",
+            "columnName": "SU_FORBIDDATE",
+            "type": "date"
+          },
+          {
+            "name": "禁用状态",
+            "columnName": "SU_FORBIDSTATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "N",
+                "name": "否",
+                "control": [
+                  {
+                    "type": "field",
+                    "scope": [
+                      "BASE_SUPPLIER.SU_CODE",
+                      "BASE_SUPPLIER.SU_NAME",
+                      "BASE_SUPPLIER.SU_SHORTNAME",
+                      "BASE_SUPPLIER_BASE.SU_COUNTRY",
+                      "BASE_SUPPLIER_BASE.SU_AREA",
+                      "BASE_SUPPLIER_BASE.SU_ADDRESS",
+                      "BASE_SUPPLIER_BASE.SU_CREDITCODE",
+                      "BASE_SUPPLIER_BASE.SU_TRADE",
+                      "BASE_SUPPLIER_BASE.SU_REGADDRESS",
+                      "BASE_SUPPLIER_BASE.SU_GRADE",
+                      "BASE_SUPPLIER_BASE.SU_CLASSIFY"
+                    ]
+                  },
+                  {
+                    "type": "menubar",
+                    "scope": []
+                  }
+                ]
+              },
+              {
+                "code": "Y",
+                "name": "是"
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "name": "基本信息",
+        "tableName": "BASE_SUPPLIER_BASE",
+        "type": "subHead",
+        "idColumnName": "SU_BASE_ID",
+        "fields": [
+          {
+            "name": "国家",
+            "columnName": "SU_COUNTRY",
+            "type": "supportData",
+            "ref": "base_country"
+          },
+          {
+            "name": "地区",
+            "columnName": "SU_AREA",
+            "type": "supportData",
+            "ref": "base_area",
+            "parentRefField": "SU_COUNTRY"
+          },
+          {
+            "name": "通讯地址",
+            "columnName": "SU_ADDRESS",
+            "type": "textarea",
+            "length": 255
+          },
+          {
+            "name": "行业",
+            "columnName": "SU_TRADE",
+            "type": "supportData",
+            "ref": "base_trade"
+          },
+          {
+            "name": "统一社会信用代码",
+            "columnName": "SU_CREDITCODE",
+            "type": "text",
+            "length": 50
+          },
+          {
+            "name": "注册地址",
+            "columnName": "SU_REGADDRESS",
+            "type": "textarea",
+            "length": 255
+          },
+          {
+            "name": "供应商等级",
+            "columnName": "SU_GRADE",
+            "type": "supportData",
+            "ref": "base_supplier_grade"
+          },
+          {
+            "name": "供应商分类",
+            "columnName": "SU_CLASSIFY",
+            "type": "supportData",
+            "ref": "base_supplier_classify"
+          }
+        ]
+      },
+      {
+        "name": "联系人",
+        "tableName": "BASE_SUPPLIER_CT",
+        "type": "entry",
+        "idColumnName": "SU_CONTRACT_ID",
+        "fields": [
+          {
+            "name": "编码",
+            "columnName": "SU_CODE",
+            "type": "text",
+            "length": 50
+          },
+          {
+            "name": "联系人",
+            "columnName": "SU_CONTRACT",
+            "type": "text",
+            "length": 50
+          },
+          {
+            "name": "电话",
+            "columnName": "SU_TEL",
+            "type": "text",
+            "length": 20
+          },
+          {
+            "name": "邮箱",
+            "columnName": "SU_EMAIL",
+            "type": "text",
+            "length": 50
+          },
+          {
+            "name": "默认",
+            "columnName": "SU_IS_DEFAULT",
+            "type": "checkbox"
+          },
+          {
+            "name": "备注",
+            "columnName": "SU_DESC",
+            "type": "text",
+            "length": 255
+          }
+        ]
+      },
+      {
+        "name": "银行信息",
+        "tableName": "BASE_SUPPLIER_BANK",
+        "type": "entry",
+        "idColumnName": "SU_BANK_ID",
+        "fields": [
+          {
+            "name": "国家",
+            "columnName": "SU_COUNTRY",
+            "type": "supportData",
+            "ref": "base_country"
+          },
+          {
+            "name": "开户银行",
+            "columnName": "SU_OPENNAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "开户行地址",
+            "columnName": "SU_OPENADDR",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "银行账号",
+            "columnName": "SU_CODE",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "账户名称",
+            "columnName": "SU_NAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "币别",
+            "columnName": "SU_CURRENCY",
+            "type": "baseData",
+            "ref": "base_currency"
+          },
+          {
+            "name": "默认",
+            "columnName": "SU_IS_DEFAULT",
+            "type": "checkbox"
+          }
+        ]
+      },
+      {
+        "name": "财务信息",
+        "tableName": "BASE_SUPPLIER_FIN",
+        "type": "subHead",
+        "idColumnName": "SU_FINANCE_ID",
+        "fields": [
+          {
+            "name": "发票类型",
+            "columnName": "SU_INVOICE_TYPE",
+            "type": "enumData",
+            "ref": "base_invoice_type"
+          },
+          {
+            "name": "结算币别",
+            "columnName": "SU_CURRENCY",
+            "type": "baseData",
+            "ref": "base_currency"
+          }
+        ]
+      }
+    ],
+    "operations": [
+      {
+        "id": "save",
+        "name": "保存",
+        "type": "save"
+      },
+      {
+        "id": "submit",
+        "name": "提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "SU_STATUS",
+          "statusValue": "S"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "只能提交在录入的单据"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unSubmit",
+        "name": "反提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "SU_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已提交,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未提交"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "audit",
+        "name": "审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "SU_STATUS",
+          "statusValue": "A"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "请先提交单据"
+            },
+            "level": "error"
+          },
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "单据已经审核,无需再审"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unAudit",
+        "name": "反审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "SU_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未审核"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "new",
+        "name": "新增",
+        "type": "addView",
+        "params": {
+          "viewName": "base_supplier",
+          "viewType": "form",
+          "openType": "card"
+        }
+      },
+      {
+        "id": "close",
+        "name": "退出",
+        "type": "closeView"
+      },
+      {
+        "id": "returnData",
+        "name": "返回数据",
+        "type": "returnData"
+      }
+    ],
+    "views": [
+      {
+        "viewType": "form",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "保存",
+                "reference": "tbSave",
+                "operation": "save"
+              },
+              {
+                "text": "提交",
+                "menu": [
+                  {
+                    "text": "提交",
+                    "reference": "tbSubmit",
+                    "operation": "submit"
+                  },
+                  {
+                    "text": "反提交",
+                    "reference": "tbUnSubmit",
+                    "operation": "unSubmit"
+                  }
+                ]
+              },
+              {
+                "text": "审核",
+                "menu": [
+                  {
+                    "text": "审核",
+                    "reference": "tbAudit",
+                    "operation": "audit"
+                  },
+                  {
+                    "text": "反审核",
+                    "reference": "tbUnAudit",
+                    "operation": "unAudit"
+                  }
+                ]
+              },
+              {
+                "text": "列表"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "container",
+            "height": 50,
+            "layout": "absolute",
+            "items": [
+              {
+                "xtype": "textfield",
+                "fieldLabel": "编码",
+                "bind": "{BASE_SUPPLIER.SU_CODE}",
+                "emptyText": "保存时自动生成",
+                "x": 10,
+                "y": 10,
+                "width": 300
+              },
+              {
+                "xtype": "textfield",
+                "fieldLabel": "名称",
+                "bind": "{BASE_SUPPLIER.SU_NAME}",
+                "x": 310,
+                "y": 10,
+                "width": 300
+              },
+              {
+                "xtype": "textfield",
+                "fieldLabel": "简称",
+                "bind": "{BASE_SUPPLIER.SU_SHORTNAME}",
+                "x": 610,
+                "y": 10,
+                "width": 300
+              }
+            ]
+          },
+          {
+            "xtype": "tabpanel",
+            "ui": "form",
+            "height": 500,
+            "items": [
+              {
+                "title": "基本信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "国家",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_COUNTRY}",
+                    "editable": false,
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "地区",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_AREA}",
+                    "editable": false,
+                    "x": 10,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textarea",
+                    "fieldLabel": "通讯地址",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_ADDRESS}",
+                    "x": 10,
+                    "y": 90,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "行业",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_TRADE}",
+                    "editable": false,
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "统一社会信用码",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_CREDITCODE}",
+                    "x": 310,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textarea",
+                    "fieldLabel": "注册地址",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_REGADDRESS}",
+                    "x": 310,
+                    "y": 90,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "供应商等级",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_GRADE}",
+                    "x": 610,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "供应商分类",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_CLASSIFY}",
+                    "x": 610,
+                    "y": 50,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "联系人",
+                "layout": "fit",
+                "items": [
+                  {
+                    "xtype": "gridpanel",
+                    "ui": "form",
+                    "height": 368,
+                    "entity": "BASE_SUPPLIER_CT",
+                    "bind": "{BASE_SUPPLIER_CT}",
+                    "columns": [
+                      {
+                        "text": "编码",
+                        "dataIndex": "SU_CODE"
+                      },
+                      {
+                        "text": "联系人",
+                        "dataIndex": "SU_CONTRACT"
+                      },
+                      {
+                        "text": "电话",
+                        "dataIndex": "SU_TEL"
+                      },
+                      {
+                        "text": "邮箱",
+                        "dataIndex": "SU_EMAIL"
+                      },
+                      {
+                        "text": "默认",
+                        "dataIndex": "SU_IS_DEFAULT"
+                      },
+                      {
+                        "text": "备注",
+                        "dataIndex": "SU_DESC"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "title": "财务信息",
+                "layout": {
+                  "type": "vbox",
+                  "pack": "start",
+                  "align": "stretch"
+                },
+                "items": [
+                  {
+                    "xtype": "container",
+                    "height": 50,
+                    "layout": "absolute",
+                    "items": [
+                      {
+                        "xtype": "textfield",
+                        "fieldLabel": "发票类型",
+                        "bind": "{BASE_SUPPLIER_FIN.SU_INVOICE_TYPE}",
+                        "x": 10,
+                        "y": 10,
+                        "width": 300
+                      },
+                      {
+                        "xtype": "textfield",
+                        "fieldLabel": "结算币别",
+                        "bind": "{BASE_SUPPLIER_FIN.SU_CURRENCY}",
+                        "x": 310,
+                        "y": 10,
+                        "width": 300
+                      }
+                    ]
+                  },
+                  {
+                    "xtype": "gridpanel",
+                    "ui": "form",
+                    "height": 368,
+                    "entity": "BASE_SUPPLIER_BANK",
+                    "bind": "{BASE_SUPPLIER_BANK}",
+                    "columns": [
+                      {
+                        "text": "国家",
+                        "dataIndex": "SU_COUNTRY"
+                      },
+                      {
+                        "text": "开户银行",
+                        "dataIndex": "SU_OPENNAME"
+                      },
+                      {
+                        "text": "银行账号",
+                        "dataIndex": "SU_CODE"
+                      },
+                      {
+                        "text": "账户名称",
+                        "dataIndex": "SU_NAME"
+                      },
+                      {
+                        "text": "币别",
+                        "dataIndex": "SU_CURRENCY"
+                      },
+                      {
+                        "text": "默认",
+                        "dataIndex": "SU_IS_DEFAULT"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "title": "其他信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "x": 10,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "创建人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_CREATOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "创建日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_SUPPLIER.SU_CREATEDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 90,
+                    "width": 300,
+                    "fieldLabel": "修改人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_MODIFIER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 130,
+                    "width": 300,
+                    "fieldLabel": "修改日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_SUPPLIER.SU_MODIFYDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "审核人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_AUDITOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "审核日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_SUPPLIER.SU_AUDITDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "禁用状态",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_FORBIDSTATUS}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "禁用人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_FORBIDER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 90,
+                    "width": 300,
+                    "fieldLabel": "禁用时间",
+                    "xtype": "datefield",
+                    "bind": "{BASE_SUPPLIER.SU_FORBIDDATE}",
+                    "disabled": true
+                  }
+                ]
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "viewType": "list",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "过滤"
+              },
+              {
+                "text": "返回数据",
+                "reference": "returnDataBtn",
+                "operation": "returnData"
+              },
+              {
+                "text": "刷新"
+              },
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增",
+                    "reference": "newBtn",
+                    "operation": "new"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "打开"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "gridpanel",
+            "ui": "form",
+            "showFilterBar": true,
+            "showHeaderFilter": true,
+            "showPagingBar": true,
+            "height": 584,
+            "selType": "checkboxmodel",
+            "columns": [
+              {
+                "text": "编码",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_CODE"
+              },
+              {
+                "text": "名称",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_NAME",
+                "width": 200
+              },
+              {
+                "text": "简称",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_SHORTNAME"
+              },
+              {
+                "text": "分类",
+                "entity": "BASE_SUPPLIER_BASE",
+                "dataIndex": "SU_CLASSIFY"
+              },
+              {
+                "text": "审核人",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_AUDITOR"
+              },
+              {
+                "text": "审核日期",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_AUDITDATE"
+              },
+              {
+                "text": "单据状态",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_STATUS"
+              },
+              {
+                "text": "禁用状态",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_FORBIDSTATUS"
+              }
+            ]
+          }
+        ]
+      }
+    ],
+    "codeRules": [
+      {
+        "default": true,
+        "name": "供应商编码规则",
+        "description": "供应商编码规则",
+        "editable": true,
+        "repairable": true,
+        "entries": [
+          {
+            "type": "number",
+            "cover": "0",
+            "seed": 1,
+            "increment": 1,
+            "length": 4
+          }
+        ]
+      }
+    ]
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/Assert.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "资产管理",
+    "id": "assert"
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/Base.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "基础管理",
+    "id": "base"
+  }
+]

+ 114 - 0
applications/scm/scm-base/src/main/resources/metadata/Base.fn.json

@@ -0,0 +1,114 @@
+[
+  {
+    "groupId": "base_data_main",
+    "groupName": "主数据",
+    "module": "base_data",
+    "entries": [
+      {
+        "text": "物料",
+        "formId": "base_product",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "物料列表",
+        "formId": "base_product",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "供应商",
+        "formId": "base_supplier",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "供应商列表",
+        "formId": "base_supplier",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "客户",
+        "formId": "base_customer",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "客户列表",
+        "formId": "base_customer",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "部门",
+        "formId": "base_dept",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "部门列表",
+        "formId": "base_dept",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "员工",
+        "formId": "base_emp",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "员工列表",
+        "formId": "base_emp",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "base_data_public",
+    "groupName": "公共资料",
+    "module": "base_data",
+    "entries": [
+      {
+        "text": "币别",
+        "formId": "base_currency",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "计量单位",
+        "formId": "base_unit",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "base_data_support",
+    "groupName": "辅助资料",
+    "module": "base_data",
+    "entries": [
+      {
+        "text": "辅助资料列表",
+        "formId": "base_supportdata",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "new"
+      }
+    ]
+  }
+]

+ 17 - 0
applications/scm/scm-base/src/main/resources/metadata/Base.module.json

@@ -0,0 +1,17 @@
+[
+  {
+    "id": "base_data",
+    "name": "基础资料",
+    "domain": "base"
+  },
+  {
+    "id": "base_setting",
+    "name": "公共设置",
+    "domain": "base"
+  },
+  {
+    "id": "base_init",
+    "name": "初始化管理",
+    "domain": "base"
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/Cost.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "成本管理",
+    "id": "cost"
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/Customer.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "客户关系管理",
+    "id": "cust"
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/Ecommerce.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "电商与分销",
+    "id": "ec"
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/Finance.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "财务会计",
+    "id": "fa"
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/PLM.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "PLM",
+    "id": "plm"
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/PM.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "生产制造",
+    "id": "pm"
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/Scm.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "供应链",
+    "id": "scm"
+  }
+]

+ 6 - 0
applications/scm/scm-base/src/main/resources/metadata/Sys.domain.json

@@ -0,0 +1,6 @@
+[
+  {
+    "name": "系统管理",
+    "id": "sys"
+  }
+]

+ 781 - 0
applications/scm/scm-base/src/main/resources/metadata/product/Product.form.json

@@ -0,0 +1,781 @@
+[
+  {
+    "id": "base_product",
+    "name": "物料",
+    "type": "baseData",
+    "nameColumnName": "BASE_PRODUCT.PR_NAME",
+    "idColumnName": "PR_ID",
+    "codeColumnName": "PR_CODE",
+    "entities": [
+      {
+        "name": "物料",
+        "tableName": "BASE_PRODUCT",
+        "type": "head",
+        "fields": [
+          {
+            "name": "编码",
+            "columnName": "PR_CODE",
+            "type": "code",
+            "length": 50
+          },
+          {
+            "name": "名称",
+            "columnName": "PR_NAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "创建人",
+            "columnName": "PR_CREATOR",
+            "type": "creator"
+          },
+          {
+            "name": "创建日期",
+            "columnName": "PR_CREATEDATE",
+            "type": "createDate"
+          },
+          {
+            "name": "修改人",
+            "columnName": "PR_MODIFIER",
+            "type": "modifier"
+          },
+          {
+            "name": "修改日期",
+            "columnName": "PR_MODIFYDATE",
+            "type": "modifyDate"
+          },
+          {
+            "name": "审核人",
+            "columnName": "PR_AUDITOR",
+            "type": "user"
+          },
+          {
+            "name": "审核日期",
+            "columnName": "PR_AUDITDATE",
+            "type": "date"
+          },
+          {
+            "name": "单据状态",
+            "columnName": "PR_STATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "E",
+                "name": "在录入"
+              },
+              {
+                "code": "S",
+                "name": "已提交"
+              },
+              {
+                "code": "A",
+                "name": "已审核"
+              }
+            ]
+          },
+          {
+            "name": "禁用人",
+            "columnName": "PR_FORBIDER",
+            "type": "user"
+          },
+          {
+            "name": "禁用日期",
+            "columnName": "PR_FORBIDDATE",
+            "type": "date"
+          },
+          {
+            "name": "禁用状态",
+            "columnName": "PR_FORBIDSTATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "N",
+                "name": "否",
+                "control": [
+                  {
+                    "type": "field",
+                    "scope": [
+                      "BASE_PRODUCT.PR_CODE",
+                      "BASE_PRODUCT.PR_NAME"
+                    ]
+                  },
+                  {
+                    "type": "menubar",
+                    "scope": []
+                  }
+                ]
+              },
+              {
+                "code": "Y",
+                "name": "是"
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "name": "基本信息",
+        "tableName": "BASE_PRODUCT_BASE",
+        "type": "subHead",
+        "idColumnName": "PR_BASE_ID",
+        "fields": [
+          {
+            "name": "允许采购",
+            "columnName": "PR_IS_PURCHASE",
+            "type": "checkbox"
+          },
+          {
+            "name": "允许销售",
+            "columnName": "PR_IS_SALE",
+            "type": "checkbox"
+          },
+          {
+            "name": "允许生产",
+            "columnName": "PR_IS_MAKE",
+            "type": "checkbox"
+          },
+          {
+            "name": "允许委外",
+            "columnName": "PR_IS_OSMAKE",
+            "type": "checkbox"
+          },
+          {
+            "name": "允许库存",
+            "columnName": "PR_IS_STOCK",
+            "type": "checkbox"
+          }
+        ]
+      },
+      {
+        "name": "采购",
+        "tableName": "BASE_PRODUCT_PURC",
+        "type": "subHead",
+        "idColumnName": "PR_PURC_ID",
+        "fields": [
+          {
+            "name": "最小包装数",
+            "columnName": "PR_MIN_PACK",
+            "type": "int"
+          },
+          {
+            "name": "收货提前天数",
+            "columnName": "PR_RECE_DAY",
+            "type": "int"
+          },
+          {
+            "name": "允许退料",
+            "columnName": "PR_PURC_RETURN",
+            "type": "checkbox"
+          },
+          {
+            "name": "采购单位",
+            "columnName": "PR_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          },
+          {
+            "name": "采购计价单位",
+            "columnName": "PR_PRICE_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          }
+        ]
+      },
+      {
+        "name": "销售",
+        "tableName": "BASE_PRODUCT_SALE",
+        "type": "subHead",
+        "idColumnName": "PR_SALE_ID",
+        "fields": [
+          {
+            "name": "起订量",
+            "columnName": "PR_MIN_ORDER",
+            "type": "int"
+          },
+          {
+            "name": "允许退料",
+            "columnName": "PR_SALE_RETURN",
+            "type": "checkbox"
+          },
+          {
+            "name": "销售单位",
+            "columnName": "PR_SALE_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          },
+          {
+            "name": "销售计价单位",
+            "columnName": "PR_SALE_PRICE_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          }
+        ]
+      }
+    ],
+    "operations": [
+      {
+        "id": "save",
+        "name": "保存",
+        "type": "save"
+      },
+      {
+        "id": "submit",
+        "name": "提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PR_STATUS",
+          "statusValue": "S"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "只能提交在录入的单据"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unSubmit",
+        "name": "反提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PR_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已提交,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未提交"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "audit",
+        "name": "审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PR_STATUS",
+          "statusValue": "A"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "请先提交单据"
+            },
+            "level": "error"
+          },
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "单据已经审核,无需再审"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unAudit",
+        "name": "反审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PR_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PR_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未审核"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "new",
+        "name": "新增",
+        "type": "addView",
+        "params": {
+          "viewName": "base_product",
+          "viewType": "form",
+          "openType": "card"
+        }
+      },
+      {
+        "id": "close",
+        "name": "退出",
+        "type": "closeView"
+      },
+      {
+        "id": "returnData",
+        "name": "返回数据",
+        "type": "returnData"
+      }
+    ],
+    "codeRules": [
+      {
+        "default": true,
+        "name": "物料编码规则",
+        "description": "物料编码规则",
+        "editable": true,
+        "repairable": true,
+        "entries": [
+          {
+            "type": "number",
+            "cover": "0",
+            "seed": 1,
+            "increment": 1,
+            "length": 4
+          }
+        ]
+      }
+    ],
+    "views": [
+      {
+        "viewType": "form",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "保存",
+                "reference": "tbSave",
+                "operation": "save"
+              },
+              {
+                "text": "提交",
+                "menu": [
+                  {
+                    "text": "提交",
+                    "reference": "tbSubmit",
+                    "operation": "submit"
+                  },
+                  {
+                    "text": "反提交",
+                    "reference": "tbUnSubmit",
+                    "operation": "unSubmit"
+                  }
+                ]
+              },
+              {
+                "text": "审核",
+                "menu": [
+                  {
+                    "text": "审核",
+                    "reference": "tbAudit",
+                    "operation": "audit"
+                  },
+                  {
+                    "text": "反审核",
+                    "reference": "tbUnAudit",
+                    "operation": "unAudit"
+                  }
+                ]
+              },
+              {
+                "text": "列表"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "container",
+            "height": 50,
+            "layout": "absolute",
+            "items": [
+              {
+                "xtype": "textfield",
+                "fieldLabel": "编码",
+                "bind": "{BASE_PRODUCT.PR_CODE}",
+                "emptyText": "保存时自动生成",
+                "x": 10,
+                "y": 10,
+                "width": 300
+              },
+              {
+                "xtype": "textfield",
+                "fieldLabel": "名称",
+                "bind": "{BASE_PRODUCT.PR_NAME}",
+                "x": 310,
+                "y": 10,
+                "width": 300
+              }
+            ]
+          },
+          {
+            "xtype": "tabpanel",
+            "ui": "form",
+            "height": 500,
+            "items": [
+              {
+                "title": "基本信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许采购",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_PURCHASE}",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许销售",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_SALE}",
+                    "x": 10,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许生产",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_MAKE}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许委外",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_OSMAKE}",
+                    "x": 310,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许库存",
+                    "bind": "{BASE_PRODUCT_BASE.PR_IS_STOCK}",
+                    "x": 610,
+                    "y": 10,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "采购",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "numberfield",
+                    "fieldLabel": "最小包装数",
+                    "bind": "{BASE_PRODUCT_PURC.PR_MIN_PACK}",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "numberfield",
+                    "fieldLabel": "收货提前天数",
+                    "bind": "{BASE_PRODUCT_PURC.PR_RECE_DAY}",
+                    "x": 10,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许退料",
+                    "bind": "{BASE_PRODUCT_SALE.PR_PURC_RETURN}",
+                    "x": 10,
+                    "y": 90,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "采购单位",
+                    "bind": "{BASE_PRODUCT_PURC.PR_PURC_UNIT}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "采购计价单位",
+                    "bind": "{BASE_PRODUCT_PURC.PR_PURC_PRICE_UNIT}",
+                    "x": 310,
+                    "y": 50,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "销售",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "numberfield",
+                    "fieldLabel": "起订量",
+                    "bind": "{BASE_PRODUCT_SALE.PR_MIN_ORDER}",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "checkbox",
+                    "fieldLabel": "允许退料",
+                    "bind": "{BASE_PRODUCT_SALE.PR_SALE_RETURN}",
+                    "x": 10,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "销售单位",
+                    "bind": "{BASE_PRODUCT_SALE.PR_SALE_UNIT}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "销售计价单位",
+                    "bind": "{BASE_PRODUCT_SALE.PR_SALE_PRICE_UNIT}",
+                    "x": 310,
+                    "y": 50,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "其他信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "x": 10,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "创建人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_CREATOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "创建日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_PRODUCT.PR_CREATEDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 90,
+                    "width": 300,
+                    "fieldLabel": "修改人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_MODIFIER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 130,
+                    "width": 300,
+                    "fieldLabel": "修改日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_PRODUCT.PR_MODIFYDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "审核人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_AUDITOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "审核日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_PRODUCT.PR_AUDITDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "禁用状态",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_FORBIDSTATUS}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "禁用人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_PRODUCT.PR_FORBIDER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 90,
+                    "width": 300,
+                    "fieldLabel": "禁用时间",
+                    "xtype": "datefield",
+                    "bind": "{BASE_PRODUCT.PR_FORBIDDATE}",
+                    "disabled": true
+                  }
+                ]
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "viewType": "list",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "过滤"
+              },
+              {
+                "text": "返回数据",
+                "reference": "returnDataBtn",
+                "operation": "returnData"
+              },
+              {
+                "text": "刷新"
+              },
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增",
+                    "reference": "newBtn",
+                    "operation": "new"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "打开"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "gridpanel",
+            "ui": "form",
+            "showFilterBar": true,
+            "showHeaderFilter": true,
+            "showPagingBar": true,
+            "height": 584,
+            "selType": "checkboxmodel",
+            "columns": [
+              {
+                "text": "编码",
+                "dataIndex": "PR_CODE",
+                "entity": "BASE_PRODUCT"
+              },
+              {
+                "text": "名称",
+                "dataIndex": "PR_NAME",
+                "entity": "BASE_PRODUCT",
+                "width": 200
+              },
+              {
+                "text": "单据状态",
+                "dataIndex": "PR_STATUS",
+                "entity": "BASE_PRODUCT"
+              },
+              {
+                "text": "禁用状态",
+                "dataIndex": "PR_FORBIDSTATUS",
+                "entity": "BASE_PRODUCT"
+              }
+            ]
+          }
+        ]
+      }
+    ]
+  }
+]

+ 5 - 0
applications/scm/scm-base/src/main/resources/metadata/supplier/Supplier.filter.json

@@ -0,0 +1,5 @@
+[
+  {
+
+  }
+]

+ 943 - 0
applications/scm/scm-base/src/main/resources/metadata/supplier/Supplier.form.json

@@ -0,0 +1,943 @@
+[
+  {
+    "id": "base_supplier",
+    "name": "供应商",
+    "type": "baseData",
+    "nameColumnName": "SU_NAME",
+    "idColumnName": "SU_ID",
+    "codeColumnName": "SU_CODE",
+    "entities": [
+      {
+        "name": "单据头",
+        "tableName": "BASE_SUPPLIER",
+        "type": "head",
+        "fields": [
+          {
+            "name": "编码",
+            "columnName": "SU_CODE",
+            "type": "code",
+            "length": 50
+          },
+          {
+            "name": "名称",
+            "columnName": "SU_NAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "简称",
+            "columnName": "SU_SHORTNAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "创建人",
+            "columnName": "SU_CREATOR",
+            "type": "creator"
+          },
+          {
+            "name": "创建日期",
+            "columnName": "SU_CREATEDATE",
+            "type": "createDate"
+          },
+          {
+            "name": "修改人",
+            "columnName": "SU_MODIFIER",
+            "type": "modifier"
+          },
+          {
+            "name": "修改日期",
+            "columnName": "SU_MODIFYDATE",
+            "type": "modifyDate"
+          },
+          {
+            "name": "审核人",
+            "columnName": "SU_AUDITOR",
+            "type": "user"
+          },
+          {
+            "name": "审核日期",
+            "columnName": "SU_AUDITDATE",
+            "type": "date"
+          },
+          {
+            "name": "单据状态",
+            "columnName": "SU_STATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "E",
+                "name": "在录入"
+              },
+              {
+                "code": "S",
+                "name": "已提交"
+              },
+              {
+                "code": "A",
+                "name": "已审核"
+              }
+            ]
+          },
+          {
+            "name": "禁用人",
+            "columnName": "SU_FORBIDER",
+            "type": "user"
+          },
+          {
+            "name": "禁用日期",
+            "columnName": "SU_FORBIDDATE",
+            "type": "date"
+          },
+          {
+            "name": "禁用状态",
+            "columnName": "SU_FORBIDSTATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "N",
+                "name": "否",
+                "control": [
+                  {
+                    "type": "field",
+                    "scope": [
+                      "BASE_SUPPLIER.SU_CODE",
+                      "BASE_SUPPLIER.SU_NAME",
+                      "BASE_SUPPLIER.SU_SHORTNAME",
+                      "BASE_SUPPLIER_BASE.SU_COUNTRY",
+                      "BASE_SUPPLIER_BASE.SU_AREA",
+                      "BASE_SUPPLIER_BASE.SU_ADDRESS",
+                      "BASE_SUPPLIER_BASE.SU_CREDITCODE",
+                      "BASE_SUPPLIER_BASE.SU_TRADE",
+                      "BASE_SUPPLIER_BASE.SU_REGADDRESS",
+                      "BASE_SUPPLIER_BASE.SU_GRADE",
+                      "BASE_SUPPLIER_BASE.SU_CLASSIFY"
+                    ]
+                  },
+                  {
+                    "type": "menubar",
+                    "scope": []
+                  }
+                ]
+              },
+              {
+                "code": "Y",
+                "name": "是"
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "name": "基本信息",
+        "tableName": "BASE_SUPPLIER_BASE",
+        "type": "subHead",
+        "idColumnName": "SU_BASE_ID",
+        "fields": [
+          {
+            "name": "国家",
+            "columnName": "SU_COUNTRY",
+            "type": "supportData",
+            "ref": "base_country"
+          },
+          {
+            "name": "地区",
+            "columnName": "SU_AREA",
+            "type": "supportData",
+            "ref": "base_area",
+            "parentRefField": "SU_COUNTRY"
+          },
+          {
+            "name": "通讯地址",
+            "columnName": "SU_ADDRESS",
+            "type": "textarea",
+            "length": 255
+          },
+          {
+            "name": "行业",
+            "columnName": "SU_TRADE",
+            "type": "supportData",
+            "ref": "base_trade"
+          },
+          {
+            "name": "统一社会信用代码",
+            "columnName": "SU_CREDITCODE",
+            "type": "text",
+            "length": 50
+          },
+          {
+            "name": "注册地址",
+            "columnName": "SU_REGADDRESS",
+            "type": "textarea",
+            "length": 255
+          },
+          {
+            "name": "供应商等级",
+            "columnName": "SU_GRADE",
+            "type": "supportData",
+            "ref": "base_supplier_grade"
+          },
+          {
+            "name": "供应商分类",
+            "columnName": "SU_CLASSIFY",
+            "type": "supportData",
+            "ref": "base_supplier_classify"
+          }
+        ]
+      },
+      {
+        "name": "联系人",
+        "tableName": "BASE_SUPPLIER_CT",
+        "type": "entry",
+        "idColumnName": "SU_CONTRACT_ID",
+        "fields": [
+          {
+            "name": "编码",
+            "columnName": "SU_CODE",
+            "type": "text",
+            "length": 50
+          },
+          {
+            "name": "联系人",
+            "columnName": "SU_CONTRACT",
+            "type": "text",
+            "length": 50
+          },
+          {
+            "name": "电话",
+            "columnName": "SU_TEL",
+            "type": "text",
+            "length": 20
+          },
+          {
+            "name": "邮箱",
+            "columnName": "SU_EMAIL",
+            "type": "text",
+            "length": 50
+          },
+          {
+            "name": "默认",
+            "columnName": "SU_IS_DEFAULT",
+            "type": "checkbox"
+          },
+          {
+            "name": "备注",
+            "columnName": "SU_DESC",
+            "type": "text",
+            "length": 255
+          }
+        ]
+      },
+      {
+        "name": "银行信息",
+        "tableName": "BASE_SUPPLIER_BANK",
+        "type": "entry",
+        "idColumnName": "SU_BANK_ID",
+        "fields": [
+          {
+            "name": "国家",
+            "columnName": "SU_COUNTRY",
+            "type": "supportData",
+            "ref": "base_country"
+          },
+          {
+            "name": "开户银行",
+            "columnName": "SU_OPENNAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "开户行地址",
+            "columnName": "SU_OPENADDR",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "银行账号",
+            "columnName": "SU_CODE",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "账户名称",
+            "columnName": "SU_NAME",
+            "type": "text",
+            "length": 255
+          },
+          {
+            "name": "币别",
+            "columnName": "SU_CURRENCY",
+            "type": "baseData",
+            "ref": "base_currency"
+          },
+          {
+            "name": "默认",
+            "columnName": "SU_IS_DEFAULT",
+            "type": "checkbox"
+          }
+        ]
+      },
+      {
+        "name": "财务信息",
+        "tableName": "BASE_SUPPLIER_FIN",
+        "type": "subHead",
+        "idColumnName": "SU_FINANCE_ID",
+        "fields": [
+          {
+            "name": "发票类型",
+            "columnName": "SU_INVOICE_TYPE",
+            "type": "enumData",
+            "ref": "base_invoice_type"
+          },
+          {
+            "name": "结算币别",
+            "columnName": "SU_CURRENCY",
+            "type": "baseData",
+            "ref": "base_currency"
+          }
+        ]
+      }
+    ],
+    "operations": [
+      {
+        "id": "save",
+        "name": "保存",
+        "type": "save"
+      },
+      {
+        "id": "submit",
+        "name": "提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "SU_STATUS",
+          "statusValue": "S"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "只能提交在录入的单据"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unSubmit",
+        "name": "反提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "SU_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已提交,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未提交"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "audit",
+        "name": "审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "SU_STATUS",
+          "statusValue": "A"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "请先提交单据"
+            },
+            "level": "error"
+          },
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "单据已经审核,无需再审"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unAudit",
+        "name": "反审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "SU_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "SU_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未审核"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "new",
+        "name": "新增",
+        "type": "addView",
+        "params": {
+          "viewName": "base_supplier",
+          "viewType": "form",
+          "openType": "card"
+        }
+      },
+      {
+        "id": "close",
+        "name": "退出",
+        "type": "closeView"
+      },
+      {
+        "id": "returnData",
+        "name": "返回数据",
+        "type": "returnData"
+      }
+    ],
+    "views": [
+      {
+        "viewType": "form",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "保存",
+                "reference": "tbSave",
+                "operation": "save"
+              },
+              {
+                "text": "提交",
+                "menu": [
+                  {
+                    "text": "提交",
+                    "reference": "tbSubmit",
+                    "operation": "submit"
+                  },
+                  {
+                    "text": "反提交",
+                    "reference": "tbUnSubmit",
+                    "operation": "unSubmit"
+                  }
+                ]
+              },
+              {
+                "text": "审核",
+                "menu": [
+                  {
+                    "text": "审核",
+                    "reference": "tbAudit",
+                    "operation": "audit"
+                  },
+                  {
+                    "text": "反审核",
+                    "reference": "tbUnAudit",
+                    "operation": "unAudit"
+                  }
+                ]
+              },
+              {
+                "text": "列表"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "container",
+            "height": 50,
+            "layout": "absolute",
+            "items": [
+              {
+                "xtype": "textfield",
+                "fieldLabel": "编码",
+                "bind": "{BASE_SUPPLIER.SU_CODE}",
+                "emptyText": "保存时自动生成",
+                "x": 10,
+                "y": 10,
+                "width": 300
+              },
+              {
+                "xtype": "textfield",
+                "fieldLabel": "名称",
+                "bind": "{BASE_SUPPLIER.SU_NAME}",
+                "x": 310,
+                "y": 10,
+                "width": 300
+              },
+              {
+                "xtype": "textfield",
+                "fieldLabel": "简称",
+                "bind": "{BASE_SUPPLIER.SU_SHORTNAME}",
+                "x": 610,
+                "y": 10,
+                "width": 300
+              }
+            ]
+          },
+          {
+            "xtype": "tabpanel",
+            "ui": "form",
+            "height": 500,
+            "items": [
+              {
+                "title": "基本信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "国家",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_COUNTRY}",
+                    "editable": false,
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "地区",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_AREA}",
+                    "editable": false,
+                    "x": 10,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textarea",
+                    "fieldLabel": "通讯地址",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_ADDRESS}",
+                    "x": 10,
+                    "y": 90,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "行业",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_TRADE}",
+                    "editable": false,
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "统一社会信用码",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_CREDITCODE}",
+                    "x": 310,
+                    "y": 50,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textarea",
+                    "fieldLabel": "注册地址",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_REGADDRESS}",
+                    "x": 310,
+                    "y": 90,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "供应商等级",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_GRADE}",
+                    "x": 610,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "供应商分类",
+                    "bind": "{BASE_SUPPLIER_BASE.SU_CLASSIFY}",
+                    "x": 610,
+                    "y": 50,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "联系人",
+                "layout": "fit",
+                "items": [
+                  {
+                    "xtype": "gridpanel",
+                    "ui": "form",
+                    "height": 368,
+                    "entity": "BASE_SUPPLIER_CT",
+                    "bind": "{BASE_SUPPLIER_CT}",
+                    "columns": [
+                      {
+                        "text": "编码",
+                        "dataIndex": "SU_CODE"
+                      },
+                      {
+                        "text": "联系人",
+                        "dataIndex": "SU_CONTRACT"
+                      },
+                      {
+                        "text": "电话",
+                        "dataIndex": "SU_TEL"
+                      },
+                      {
+                        "text": "邮箱",
+                        "dataIndex": "SU_EMAIL"
+                      },
+                      {
+                        "text": "默认",
+                        "dataIndex": "SU_IS_DEFAULT"
+                      },
+                      {
+                        "text": "备注",
+                        "dataIndex": "SU_DESC"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "title": "财务信息",
+                "layout": {
+                  "type": "vbox",
+                  "pack": "start",
+                  "align": "stretch"
+                },
+                "items": [
+                  {
+                    "xtype": "container",
+                    "height": 50,
+                    "layout": "absolute",
+                    "items": [
+                      {
+                        "xtype": "textfield",
+                        "fieldLabel": "发票类型",
+                        "bind": "{BASE_SUPPLIER_FIN.SU_INVOICE_TYPE}",
+                        "x": 10,
+                        "y": 10,
+                        "width": 300
+                      },
+                      {
+                        "xtype": "textfield",
+                        "fieldLabel": "结算币别",
+                        "bind": "{BASE_SUPPLIER_FIN.SU_CURRENCY}",
+                        "x": 310,
+                        "y": 10,
+                        "width": 300
+                      }
+                    ]
+                  },
+                  {
+                    "xtype": "gridpanel",
+                    "ui": "form",
+                    "height": 368,
+                    "entity": "BASE_SUPPLIER_BANK",
+                    "bind": "{BASE_SUPPLIER_BANK}",
+                    "columns": [
+                      {
+                        "text": "国家",
+                        "dataIndex": "SU_COUNTRY"
+                      },
+                      {
+                        "text": "开户银行",
+                        "dataIndex": "SU_OPENNAME"
+                      },
+                      {
+                        "text": "银行账号",
+                        "dataIndex": "SU_CODE"
+                      },
+                      {
+                        "text": "账户名称",
+                        "dataIndex": "SU_NAME"
+                      },
+                      {
+                        "text": "币别",
+                        "dataIndex": "SU_CURRENCY"
+                      },
+                      {
+                        "text": "默认",
+                        "dataIndex": "SU_IS_DEFAULT"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "title": "其他信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "x": 10,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "创建人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_CREATOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "创建日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_SUPPLIER.SU_CREATEDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 90,
+                    "width": 300,
+                    "fieldLabel": "修改人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_MODIFIER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 130,
+                    "width": 300,
+                    "fieldLabel": "修改日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_SUPPLIER.SU_MODIFYDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "审核人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_AUDITOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "审核日期",
+                    "xtype": "datefield",
+                    "bind": "{BASE_SUPPLIER.SU_AUDITDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "禁用状态",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_FORBIDSTATUS}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "禁用人",
+                    "xtype": "textfield",
+                    "bind": "{BASE_SUPPLIER.SU_FORBIDER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 90,
+                    "width": 300,
+                    "fieldLabel": "禁用时间",
+                    "xtype": "datefield",
+                    "bind": "{BASE_SUPPLIER.SU_FORBIDDATE}",
+                    "disabled": true
+                  }
+                ]
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "viewType": "list",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "过滤"
+              },
+              {
+                "text": "返回数据",
+                "reference": "returnDataBtn",
+                "operation": "returnData"
+              },
+              {
+                "text": "刷新"
+              },
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增",
+                    "reference": "newBtn",
+                    "operation": "new"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "打开"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "gridpanel",
+            "ui": "form",
+            "showFilterBar": true,
+            "showHeaderFilter": true,
+            "showPagingBar": true,
+            "height": 584,
+            "selType": "checkboxmodel",
+            "columns": [
+              {
+                "text": "编码",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_CODE"
+              },
+              {
+                "text": "名称",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_NAME",
+                "width": 200
+              },
+              {
+                "text": "简称",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_SHORTNAME"
+              },
+              {
+                "text": "分类",
+                "entity": "BASE_SUPPLIER_BASE",
+                "dataIndex": "SU_CLASSIFY"
+              },
+              {
+                "text": "审核人",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_AUDITOR"
+              },
+              {
+                "text": "审核日期",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_AUDITDATE"
+              },
+              {
+                "text": "单据状态",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_STATUS"
+              },
+              {
+                "text": "禁用状态",
+                "entity": "BASE_SUPPLIER",
+                "dataIndex": "SU_FORBIDSTATUS"
+              }
+            ]
+          }
+        ]
+      }
+    ],
+    "codeRules": [
+      {
+        "default": true,
+        "name": "供应商编码规则",
+        "description": "供应商编码规则",
+        "editable": true,
+        "repairable": true,
+        "entries": [
+          {
+            "type": "number",
+            "cover": "0",
+            "seed": 1,
+            "increment": 1,
+            "length": 4
+          }
+        ]
+      }
+    ]
+  }
+]

+ 3 - 0
applications/scm/scm-purchase/build.gradle

@@ -0,0 +1,3 @@
+dependencies {
+    compile project(':applications:scm:scm-base')
+}

BIN
applications/scm/scm-purchase/out/production/classes/META-INF/uas-platform.applications.scm.scm-purchase.main.kotlin_module


+ 184 - 0
applications/scm/scm-purchase/out/production/resources/metadata/Purchase.fn.json

@@ -0,0 +1,184 @@
+[
+  {
+    "groupId": "scm_purchase_apply",
+    "groupName": "采购申请",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "采购申请单",
+        "formId": "scm_purchase_apply",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购申请单列表",
+        "formId": "scm_purchase_apply",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_contract",
+    "groupName": "合同管理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "采购合同",
+        "formId": "scm_purchase_contract",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购合同列表",
+        "formId": "scm_purchase_contract",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_order",
+    "groupName": "订单处理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "采购订单",
+        "formId": "scm_purchase_order",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购订单列表",
+        "formId": "scm_purchase_order",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "采购订单变更单",
+        "formId": "scm_purchase_change",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购订单变更单列表",
+        "formId": "scm_purchase_change",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_accept",
+    "groupName": "订单处理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "收料通知单",
+        "formId": "scm_purchase_accept",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "收料通知单列表",
+        "formId": "scm_purchase_accept",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "采购入库单",
+        "formId": "scm_purchase_in",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购入库单列表",
+        "formId": "scm_purchase_in",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_return",
+    "groupName": "退料处理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "退料申请单",
+        "formId": "scm_purchase_return",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "退料申请单列表",
+        "formId": "scm_purchase_return",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "采购退料单",
+        "formId": "scm_purchase_out",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购退料单列表",
+        "formId": "scm_purchase_out",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_supply",
+    "groupName": "货源管理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "供应商",
+        "formId": "base_supplier",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "供应商列表",
+        "formId": "base_supplier",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "采购价目表",
+        "formId": "scm_purchase_price",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购价目表列表",
+        "formId": "scm_purchase_price",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  }
+]

+ 1125 - 0
applications/scm/scm-purchase/out/production/resources/metadata/Purchase.form.json

@@ -0,0 +1,1125 @@
+[
+  {
+    "id": "scm_purchase_order",
+    "name": "采购订单",
+    "type": "bill",
+    "idColumnName": "PO_ID",
+    "codeColumnName": "PO_CODE",
+    "entities": [
+      {
+        "name": "基本信息",
+        "tableName": "PUR_ORDER",
+        "type": "head",
+        "fields": [
+          {
+            "name": "单据编码",
+            "columnName": "PO_CODE",
+            "type": "code",
+            "length": 50
+          },
+          {
+            "name": "采购日期",
+            "columnName": "PO_DATE",
+            "type": "date"
+          },
+          {
+            "name": "供应商",
+            "columnName": "PO_SUPPLIER",
+            "type": "baseData",
+            "ref": "base_supplier",
+            "refField": "SU_NAME"
+          },
+          {
+            "name": "创建人",
+            "columnName": "PO_CREATOR",
+            "type": "creator"
+          },
+          {
+            "name": "创建日期",
+            "columnName": "PO_CREATEDATE",
+            "type": "createDate"
+          },
+          {
+            "name": "修改人",
+            "columnName": "PO_MODIFIER",
+            "type": "modifier"
+          },
+          {
+            "name": "修改日期",
+            "columnName": "PO_MODIFYDATE",
+            "type": "modifyDate"
+          },
+          {
+            "name": "审核人",
+            "columnName": "PO_AUDITOR",
+            "type": "user"
+          },
+          {
+            "name": "审核日期",
+            "columnName": "PO_AUDITDATE",
+            "type": "date"
+          },
+          {
+            "name": "单据状态",
+            "columnName": "PO_STATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "E",
+                "name": "在录入"
+              },
+              {
+                "code": "S",
+                "name": "已提交"
+              },
+              {
+                "code": "A",
+                "name": "已审核"
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "name": "明细信息",
+        "tableName": "PUR_ORDER_ENTRY",
+        "idColumnName": "PO_ENTRY_ID",
+        "seqColumnName": "PO_ENTRY_NO",
+        "type": "entry",
+        "fields": [
+          {
+            "name": "物料编码",
+            "columnName": "PO_ENTRY_PROD",
+            "type": "baseData",
+            "ref": "base_product",
+            "refField": "PR_CODE"
+          },
+          {
+            "name": "物料名称",
+            "columnName": "PO_ENTRY_PRODNAME",
+            "type": "baseDataProp",
+            "baseDataField": "PO_ENTRY_PROD",
+            "refField": "PR_NAME"
+          },
+          {
+            "name": "采购单位",
+            "columnName": "PO_ENTRY_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          },
+          {
+            "name": "采购数量",
+            "columnName": "PO_ENTRY_QTY",
+            "type": "qty"
+          },
+          {
+            "name": "计价单位",
+            "columnName": "PO_ENTRY_PRICE_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          },
+          {
+            "name": "计价数量",
+            "columnName": "PO_ENTRY_PRICE_QTY",
+            "type": "qty"
+          },
+          {
+            "name": "单价",
+            "columnName": "PO_ENTRY_PRICE",
+            "type": "price"
+          },
+          {
+            "name": "含税单价",
+            "columnName": "PO_ENTRY_TAXPRICE",
+            "type": "price"
+          },
+          {
+            "name": "折扣率%",
+            "columnName": "PO_ENTRY_DISCOUNT",
+            "type": "float"
+          },
+          {
+            "name": "税率%",
+            "columnName": "PO_ENTRY_TAXRATE",
+            "type": "float"
+          },
+          {
+            "name": "税额",
+            "columnName": "PO_ENTRY_TAXAMOUNT",
+            "type": "amount"
+          },
+          {
+            "name": "金额",
+            "columnName": "PO_ENTRY_AMOUNT",
+            "type": "amount"
+          },
+          {
+            "name": "价税合计",
+            "columnName": "PO_ENTRY_ALLAMOUNT",
+            "type": "amount"
+          },
+          {
+            "name": "交货日期",
+            "columnName": "PO_ENTRY_DELIVERY",
+            "type": "date"
+          },
+          {
+            "name": "交货地址",
+            "columnName": "PO_ENTRY_ADDRESS",
+            "type": "textarea",
+            "length": 255
+          }
+        ]
+      },
+      {
+        "name": "财务信息",
+        "tableName": "PUR_ORDER_FIN",
+        "idColumnName": "PO_FIN_ID",
+        "type": "subHead",
+        "fields": [
+          {
+            "name": "结算币别",
+            "columnName": "PO_FIN_CURR",
+            "type": "baseData",
+            "ref": "base_currency"
+          },
+          {
+            "name": "结算方式",
+            "columnName": "PO_FIN_SETTLE",
+            "type": "baseData",
+            "ref": "base_settle"
+          },
+          {
+            "name": "付款条件",
+            "columnName": "PO_FIN_PAYCOND",
+            "type": "baseData",
+            "ref": "base_paycondition"
+          }
+        ]
+      }
+    ],
+    "operations": [
+      {
+        "id": "save",
+        "name": "保存",
+        "type": "save"
+      },
+      {
+        "id": "submit",
+        "name": "提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PO_STATUS",
+          "statusValue": "S"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "只能提交在录入的单据"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unSubmit",
+        "name": "反提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PO_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已提交,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未提交"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "audit",
+        "name": "审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PO_STATUS",
+          "statusValue": "A"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "请先提交单据"
+            },
+            "level": "error"
+          },
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "单据已经审核,无需再审"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unAudit",
+        "name": "反审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PO_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未审核"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "new",
+        "name": "新增",
+        "type": "addView",
+        "params": {
+          "viewName": "scm_purchase_order",
+          "viewType": "form",
+          "openType": "card"
+        }
+      },
+      {
+        "id": "close",
+        "name": "关闭",
+        "type": "closeView"
+      },
+      {
+        "id": "showList",
+        "name": "列表",
+        "type": "addView",
+        "params": {
+          "viewName": "scm_purc_order",
+          "viewType": "list",
+          "openType": "card"
+        }
+      },
+      {
+        "id": "newEntry",
+        "name": "新增明细行",
+        "type": "newEntry",
+        "params": {
+          "entity": "PUR_ORDER_ENTRY"
+        }
+      }
+    ],
+    "codeRules": [
+      {
+        "default": true,
+        "name": "采购订单编码规则",
+        "description": "采购订单编码规则",
+        "editable": true,
+        "repairable": true,
+        "entries": [
+          {
+            "type": "date",
+            "field": "PO_DATE",
+            "format": "yyyyMM"
+          },
+          {
+            "type": "number",
+            "cover": "0",
+            "seed": 1,
+            "increment": 1,
+            "length": 4
+          }
+        ]
+      }
+    ],
+    "views": [
+      {
+        "viewType": "form",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "保存",
+                "reference": "tbSave",
+                "operation": "save"
+              },
+              {
+                "text": "提交",
+                "menu": [
+                  {
+                    "text": "提交",
+                    "reference": "tbSubmit",
+                    "operation": "submit"
+                  },
+                  {
+                    "text": "反提交",
+                    "reference": "tbUnSubmit",
+                    "operation": "unSubmit"
+                  }
+                ]
+              },
+              {
+                "text": "审核",
+                "menu": [
+                  {
+                    "text": "审核",
+                    "reference": "tbAudit",
+                    "operation": "audit"
+                  },
+                  {
+                    "text": "反审核",
+                    "reference": "tbUnAudit",
+                    "operation": "unAudit"
+                  }
+                ]
+              },
+              {
+                "text": "列表",
+                "reference": "showListBtn",
+                "operation": "showList"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "tabpanel",
+            "ui": "form",
+            "height": 120,
+            "items": [
+              {
+                "title": "基本信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "单据编号",
+                    "bind": "{PUR_ORDER.PO_CODE}",
+                    "emptyText": "保存时自动生成",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "datefield",
+                    "fieldLabel": "采购日期",
+                    "bind": "{PUR_ORDER.PO_DATE}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "供应商",
+                    "bind": "{PUR_ORDER.PO_SUPPLIER}",
+                    "x": 610,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "单据状态",
+                    "bind": "{PUR_ORDER.PO_STATUS}",
+                    "x": 910,
+                    "y": 10,
+                    "width": 300,
+                    "disabled": true
+                  }
+                ]
+              },
+              {
+                "title": "财务信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "结算币别",
+                    "bind": "{PUR_ORDER_FIN.PO_FIN_CURR}",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "结算方式",
+                    "bind": "{PUR_ORDER_FIN.PO_FIN_SETTLE}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "付款条件",
+                    "bind": "{PUR_ORDER_FIN.PO_FIN_PAYCOND}",
+                    "x": 610,
+                    "y": 10,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "其他",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "x": 10,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "创建人",
+                    "xtype": "textfield",
+                    "bind": "{PUR_ORDER.PO_CREATOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "创建日期",
+                    "xtype": "datefield",
+                    "bind": "{PUR_ORDER.PO_CREATEDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "修改人",
+                    "xtype": "textfield",
+                    "bind": "{PUR_ORDER.PO_MODIFIER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "修改日期",
+                    "xtype": "datefield",
+                    "bind": "{PUR_ORDER.PO_MODIFYDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "审核人",
+                    "xtype": "textfield",
+                    "bind": "{PUR_ORDER.PO_AUDITOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "审核日期",
+                    "xtype": "datefield",
+                    "bind": "{PUR_ORDER.PO_AUDITDATE}",
+                    "disabled": true
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "xtype": "tabpanel",
+            "ui": "form",
+            "items": [
+              {
+                "title": "明细信息",
+                "items": [
+                  {
+                    "xtype": "menubar",
+                    "ui": "form-menubar",
+                    "items": [
+                      {
+                        "text": "新增行",
+                        "menu": [
+                          {
+                            "text": "新增行",
+                            "reference": "newEntryBtn",
+                            "operation": "newEntry"
+                          },
+                          {
+                            "text": "插入行"
+                          },
+                          {
+                            "text": "复制行"
+                          },
+                          {
+                            "text": "关联复制行"
+                          },
+                          {
+                            "text": "多行关联复制行"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "删除行"
+                      },
+                      {
+                        "text": "批量填充"
+                      },
+                      {
+                        "text": "业务操作",
+                        "menu": [
+                          {
+                            "text": "获取批号"
+                          },
+                          {
+                            "text": "获取库存"
+                          },
+                          {
+                            "text": "累计数量取价"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "业务查询",
+                        "menu": [
+                          {
+                            "text": "价格查询"
+                          },
+                          {
+                            "text": "历史价格"
+                          },
+                          {
+                            "text": "库存查询"
+                          },
+                          {
+                            "text": "预留综合查询"
+                          },
+                          {
+                            "text": "研发资料"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "xtype": "gridpanel",
+                    "entity": "PUR_ORDER_ENTRY",
+                    "bind": "{PUR_ORDER_ENTRY}",
+                    "editable": true,
+                    "ui": "form",
+                    "height": 368,
+                    "columns": [
+                      {
+                        "text": "序号",
+                        "align": "center",
+                        "dataIndex": "PO_ENTRY_NO",
+                        "width": 60
+                      },
+                      {
+                        "text": "物料编码",
+                        "xtype": "searchcolumn",
+                        "dataIndex": "PO_ENTRY_PROD",
+                        "editor": {
+                          "xtype": "searchfield"
+                        }
+                      },
+                      {
+                        "text": "物料名称",
+                        "dataIndex": "PO_ENTRY_PRODNAME",
+                        "width": 160
+                      },
+                      {
+                        "text": "采购单位",
+                        "xtype": "searchcolumn",
+                        "dataIndex": "PO_ENTRY_UNIT",
+                        "editor": {
+                          "xtype": "searchfield"
+                        }
+                      },
+                      {
+                        "text": "采购数量",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_QTY",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "计价单位",
+                        "xtype": "searchcolumn",
+                        "dataIndex": "PO_ENTRY_PRICE_UNIT",
+                        "editor": {
+                          "xtype": "searchfield"
+                        }
+                      },
+                      {
+                        "text": "计价数量",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_PRICE_QTY",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "交货日期",
+                        "xtype": "datecolumn",
+                        "dataIndex": "PO_ENTRY_DELIVERY",
+                        "editor": {
+                          "xtype": "datefield"
+                        }
+                      },
+                      {
+                        "text": "单价",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_PRICE"
+                      },
+                      {
+                        "text": "含税单价",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_TAXPRICE",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "折扣率%",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_DISCOUNT",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "税率%",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_TAXRATE",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "税额",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_TAXAMOUNT"
+                      },
+                      {
+                        "text": "金额",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_AMOUNT"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "title": "交货安排"
+              },
+              {
+                "title": "明细财务信息"
+              },
+              {
+                "title": "其他信息"
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "viewType": "list",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "过滤"
+              },
+              {
+                "text": "刷新"
+              },
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增",
+                    "reference": "newBtn",
+                    "operation": "new"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "删除"
+              },
+              {
+                "text": "提交",
+                "menu": [
+                  {
+                    "text": "提交"
+                  },
+                  {
+                    "text": "反提交"
+                  }
+                ]
+              },
+              {
+                "text": "审核",
+                "menu": [
+                  {
+                    "text": "审核"
+                  },
+                  {
+                    "text": "反审核"
+                  }
+                ]
+              },
+              {
+                "text": "下推"
+              },
+              {
+                "text": "关联查询",
+                "menu": [
+                  {
+                    "text": "上查"
+                  },
+                  {
+                    "text": "下查"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "业务流程图"
+                  },
+                  {
+                    "text": "全流程跟踪"
+                  }
+                ]
+              },
+              {
+                "text": "业务操作",
+                "menu": [
+                  {
+                    "text": "作废"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "整单关闭"
+                  },
+                  {
+                    "text": "反关闭"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "计划确认"
+                  },
+                  {
+                    "text": "反计划确认"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "条码打印"
+                  },
+                  {
+                    "text": "修改变更"
+                  }
+                ]
+              },
+              {
+                "text": "业务查询",
+                "menu": [
+                  {
+                    "text": "预付查询"
+                  },
+                  {
+                    "text": "预留综合查询"
+                  },
+                  {
+                    "text": "研发资料"
+                  }
+                ]
+              },
+              {
+                "text": "选项",
+                "menu": [
+                  {
+                    "text": "选项"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "打印"
+                  },
+                  {
+                    "text": "预览"
+                  },
+                  {
+                    "text": "套打",
+                    "menu": [
+                      {
+                        "text": "套打设置"
+                      },
+                      {
+                        "xtype": "menuseparator"
+                      },
+                      {
+                        "text": "连续套打全部单据"
+                      },
+                      {
+                        "text": "连续套打所选单据"
+                      },
+                      {
+                        "text": "连续套打预览全部单据"
+                      },
+                      {
+                        "text": "连续套打预览所选单据"
+                      },
+                      {
+                        "xtype": "menuseparator"
+                      },
+                      {
+                        "text": "合并套打全部单据"
+                      },
+                      {
+                        "text": "合并套打所选单据"
+                      },
+                      {
+                        "text": "合并套打预览全部单据"
+                      },
+                      {
+                        "text": "合并套打预览所选单据"
+                      },
+                      {
+                        "xtype": "menuseparator"
+                      },
+                      {
+                        "text": "套打导出"
+                      },
+                      {
+                        "text": "分批打印全部单据"
+                      },
+                      {
+                        "text": "分批打印所选单据"
+                      }
+                    ]
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "导入",
+                    "menu": [
+                      {
+                        "text": "导入"
+                      },
+                      {
+                        "text": "导入模板设置"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "导出",
+                    "menu": [
+                      {
+                        "text": "导出模板设置"
+                      },
+                      {
+                        "text": "按列表导出数据"
+                      },
+                      {
+                        "text": "按导出模板导出数据"
+                      },
+                      {
+                        "text": "按导入模板导出数据"
+                      }
+                    ]
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "附件"
+                  }
+                ]
+              },
+              {
+                "text": "退出"
+              }
+            ]
+          },
+          {
+            "xtype": "fieldcontainer",
+            "fieldLabel": "我的方案",
+            "labelWidth": 88,
+            "padding": "10 0 10 0",
+            "items": [
+              {
+                "xtype": "segmentedbutton",
+                "ui": "form",
+                "items": [
+                  {
+                    "text": "缺省方案"
+                  },
+                  {
+                    "text": "我的未完成订单"
+                  },
+                  {
+                    "text": "今天"
+                  },
+                  {
+                    "text": "本周"
+                  },
+                  {
+                    "text": "本月",
+                    "pressed": true
+                  },
+                  {
+                    "text": "未入库完成采购订单"
+                  },
+                  {
+                    "text": "待审核采购订单"
+                  },
+                  {
+                    "text": "今日收货"
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "xtype": "gridpanel",
+            "ui": "form",
+            "height": 584,
+            "showFilterBar": true,
+            "showHeaderFilter": true,
+            "showPagingBar": true,
+            "selType": "checkboxmodel",
+            "reference": "PUR_ORDER_ENTRY",
+            "store": {
+              "fields": [
+              ]
+            },
+            "columns": [
+              {
+                "text": "单据编号",
+                "dataIndex": "PO_CODE"
+              },
+              {
+                "text": "采购日期",
+                "dataIndex": "PO_DATE"
+              },
+              {
+                "text": "供应商",
+                "dataIndex": "PO_SUPPLIER",
+                "width": 200
+              },
+              {
+                "text": "单据状态",
+                "dataIndex": "PO_STATUS"
+              },
+              {
+                "text": "物料编码",
+                "dataIndex": "PO_ENTRY_PROD",
+                "width": 160
+              },
+              {
+                "text": "物料名称",
+                "dataIndex": "PO_ENTRY_PRODNAME",
+                "width": 200
+              },
+              {
+                "text": "采购单位",
+                "dataIndex": "PO_ENTRY_UNIT"
+              },
+              {
+                "text": "采购数量",
+                "dataIndex": "PO_ENTRY_QTY"
+              },
+              {
+                "text": "交货日期",
+                "dataIndex": "PO_ENTRY_DELIVERY"
+              }
+            ]
+          }
+        ]
+      }
+    ]
+  }
+]

+ 32 - 0
applications/scm/scm-purchase/out/production/resources/metadata/Purchase.module.json

@@ -0,0 +1,32 @@
+[
+  {
+    "id": "scm_purchase",
+    "name": "采购管理",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_sale",
+    "name": "销售管理",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_credit",
+    "name": "信用管理",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_stock",
+    "name": "库存管理",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_org",
+    "name": "组织间结算",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_barcode",
+    "name": "条码管理",
+    "domain": "scm"
+  }
+]

+ 184 - 0
applications/scm/scm-purchase/src/main/resources/metadata/Purchase.fn.json

@@ -0,0 +1,184 @@
+[
+  {
+    "groupId": "scm_purchase_apply",
+    "groupName": "采购申请",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "采购申请单",
+        "formId": "scm_purchase_apply",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购申请单列表",
+        "formId": "scm_purchase_apply",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_contract",
+    "groupName": "合同管理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "采购合同",
+        "formId": "scm_purchase_contract",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购合同列表",
+        "formId": "scm_purchase_contract",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_order",
+    "groupName": "订单处理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "采购订单",
+        "formId": "scm_purchase_order",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购订单列表",
+        "formId": "scm_purchase_order",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "采购订单变更单",
+        "formId": "scm_purchase_change",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购订单变更单列表",
+        "formId": "scm_purchase_change",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_accept",
+    "groupName": "订单处理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "收料通知单",
+        "formId": "scm_purchase_accept",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "收料通知单列表",
+        "formId": "scm_purchase_accept",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "采购入库单",
+        "formId": "scm_purchase_in",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购入库单列表",
+        "formId": "scm_purchase_in",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_return",
+    "groupName": "退料处理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "退料申请单",
+        "formId": "scm_purchase_return",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "退料申请单列表",
+        "formId": "scm_purchase_return",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "采购退料单",
+        "formId": "scm_purchase_out",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购退料单列表",
+        "formId": "scm_purchase_out",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  },
+  {
+    "groupId": "scm_purchase_supply",
+    "groupName": "货源管理",
+    "module": "scm_purchase",
+    "entries": [
+      {
+        "text": "供应商",
+        "formId": "base_supplier",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "供应商列表",
+        "formId": "base_supplier",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      },
+      {
+        "text": "采购价目表",
+        "formId": "scm_purchase_price",
+        "viewType": "form",
+        "openType": "card",
+        "permission": "new"
+      },
+      {
+        "text": "采购价目表列表",
+        "formId": "scm_purchase_price",
+        "viewType": "list",
+        "openType": "card",
+        "permission": "view"
+      }
+    ]
+  }
+]

+ 1125 - 0
applications/scm/scm-purchase/src/main/resources/metadata/Purchase.form.json

@@ -0,0 +1,1125 @@
+[
+  {
+    "id": "scm_purchase_order",
+    "name": "采购订单",
+    "type": "bill",
+    "idColumnName": "PO_ID",
+    "codeColumnName": "PO_CODE",
+    "entities": [
+      {
+        "name": "基本信息",
+        "tableName": "PUR_ORDER",
+        "type": "head",
+        "fields": [
+          {
+            "name": "单据编码",
+            "columnName": "PO_CODE",
+            "type": "code",
+            "length": 50
+          },
+          {
+            "name": "采购日期",
+            "columnName": "PO_DATE",
+            "type": "date"
+          },
+          {
+            "name": "供应商",
+            "columnName": "PO_SUPPLIER",
+            "type": "baseData",
+            "ref": "base_supplier",
+            "refField": "SU_NAME"
+          },
+          {
+            "name": "创建人",
+            "columnName": "PO_CREATOR",
+            "type": "creator"
+          },
+          {
+            "name": "创建日期",
+            "columnName": "PO_CREATEDATE",
+            "type": "createDate"
+          },
+          {
+            "name": "修改人",
+            "columnName": "PO_MODIFIER",
+            "type": "modifier"
+          },
+          {
+            "name": "修改日期",
+            "columnName": "PO_MODIFYDATE",
+            "type": "modifyDate"
+          },
+          {
+            "name": "审核人",
+            "columnName": "PO_AUDITOR",
+            "type": "user"
+          },
+          {
+            "name": "审核日期",
+            "columnName": "PO_AUDITDATE",
+            "type": "date"
+          },
+          {
+            "name": "单据状态",
+            "columnName": "PO_STATUS",
+            "type": "status",
+            "statusList": [
+              {
+                "code": "E",
+                "name": "在录入"
+              },
+              {
+                "code": "S",
+                "name": "已提交"
+              },
+              {
+                "code": "A",
+                "name": "已审核"
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "name": "明细信息",
+        "tableName": "PUR_ORDER_ENTRY",
+        "idColumnName": "PO_ENTRY_ID",
+        "seqColumnName": "PO_ENTRY_NO",
+        "type": "entry",
+        "fields": [
+          {
+            "name": "物料编码",
+            "columnName": "PO_ENTRY_PROD",
+            "type": "baseData",
+            "ref": "base_product",
+            "refField": "PR_CODE"
+          },
+          {
+            "name": "物料名称",
+            "columnName": "PO_ENTRY_PRODNAME",
+            "type": "baseDataProp",
+            "baseDataField": "PO_ENTRY_PROD",
+            "refField": "PR_NAME"
+          },
+          {
+            "name": "采购单位",
+            "columnName": "PO_ENTRY_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          },
+          {
+            "name": "采购数量",
+            "columnName": "PO_ENTRY_QTY",
+            "type": "qty"
+          },
+          {
+            "name": "计价单位",
+            "columnName": "PO_ENTRY_PRICE_UNIT",
+            "type": "baseData",
+            "ref": "base_unit"
+          },
+          {
+            "name": "计价数量",
+            "columnName": "PO_ENTRY_PRICE_QTY",
+            "type": "qty"
+          },
+          {
+            "name": "单价",
+            "columnName": "PO_ENTRY_PRICE",
+            "type": "price"
+          },
+          {
+            "name": "含税单价",
+            "columnName": "PO_ENTRY_TAXPRICE",
+            "type": "price"
+          },
+          {
+            "name": "折扣率%",
+            "columnName": "PO_ENTRY_DISCOUNT",
+            "type": "float"
+          },
+          {
+            "name": "税率%",
+            "columnName": "PO_ENTRY_TAXRATE",
+            "type": "float"
+          },
+          {
+            "name": "税额",
+            "columnName": "PO_ENTRY_TAXAMOUNT",
+            "type": "amount"
+          },
+          {
+            "name": "金额",
+            "columnName": "PO_ENTRY_AMOUNT",
+            "type": "amount"
+          },
+          {
+            "name": "价税合计",
+            "columnName": "PO_ENTRY_ALLAMOUNT",
+            "type": "amount"
+          },
+          {
+            "name": "交货日期",
+            "columnName": "PO_ENTRY_DELIVERY",
+            "type": "date"
+          },
+          {
+            "name": "交货地址",
+            "columnName": "PO_ENTRY_ADDRESS",
+            "type": "textarea",
+            "length": 255
+          }
+        ]
+      },
+      {
+        "name": "财务信息",
+        "tableName": "PUR_ORDER_FIN",
+        "idColumnName": "PO_FIN_ID",
+        "type": "subHead",
+        "fields": [
+          {
+            "name": "结算币别",
+            "columnName": "PO_FIN_CURR",
+            "type": "baseData",
+            "ref": "base_currency"
+          },
+          {
+            "name": "结算方式",
+            "columnName": "PO_FIN_SETTLE",
+            "type": "baseData",
+            "ref": "base_settle"
+          },
+          {
+            "name": "付款条件",
+            "columnName": "PO_FIN_PAYCOND",
+            "type": "baseData",
+            "ref": "base_paycondition"
+          }
+        ]
+      }
+    ],
+    "operations": [
+      {
+        "id": "save",
+        "name": "保存",
+        "type": "save"
+      },
+      {
+        "id": "submit",
+        "name": "提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PO_STATUS",
+          "statusValue": "S"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "只能提交在录入的单据"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unSubmit",
+        "name": "反提交",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PO_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已提交,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未提交"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "audit",
+        "name": "审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PO_STATUS",
+          "statusValue": "A"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 在录入,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "E"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "请先提交单据"
+            },
+            "level": "error"
+          },
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,不允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": true,
+              "message": "单据已经审核,无需再审"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "unAudit",
+        "name": "反审核",
+        "type": "changeStatus",
+        "params": {
+          "statusField": "PO_STATUS",
+          "statusValue": "E"
+        },
+        "validators": [
+          {
+            "type": "legal",
+            "description": "状态 = 已审核,允许",
+            "params": {
+              "expression": [
+                {
+                  "field": "PO_STATUS",
+                  "compare": "=",
+                  "value": "A"
+                }
+              ],
+              "triggerOnTrue": false,
+              "message": "单据未审核"
+            },
+            "level": "error"
+          }
+        ],
+        "log": true
+      },
+      {
+        "id": "new",
+        "name": "新增",
+        "type": "addView",
+        "params": {
+          "viewName": "scm_purchase_order",
+          "viewType": "form",
+          "openType": "card"
+        }
+      },
+      {
+        "id": "close",
+        "name": "关闭",
+        "type": "closeView"
+      },
+      {
+        "id": "showList",
+        "name": "列表",
+        "type": "addView",
+        "params": {
+          "viewName": "scm_purc_order",
+          "viewType": "list",
+          "openType": "card"
+        }
+      },
+      {
+        "id": "newEntry",
+        "name": "新增明细行",
+        "type": "newEntry",
+        "params": {
+          "entity": "PUR_ORDER_ENTRY"
+        }
+      }
+    ],
+    "codeRules": [
+      {
+        "default": true,
+        "name": "采购订单编码规则",
+        "description": "采购订单编码规则",
+        "editable": true,
+        "repairable": true,
+        "entries": [
+          {
+            "type": "date",
+            "field": "PO_DATE",
+            "format": "yyyyMM"
+          },
+          {
+            "type": "number",
+            "cover": "0",
+            "seed": 1,
+            "increment": 1,
+            "length": 4
+          }
+        ]
+      }
+    ],
+    "views": [
+      {
+        "viewType": "form",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "保存",
+                "reference": "tbSave",
+                "operation": "save"
+              },
+              {
+                "text": "提交",
+                "menu": [
+                  {
+                    "text": "提交",
+                    "reference": "tbSubmit",
+                    "operation": "submit"
+                  },
+                  {
+                    "text": "反提交",
+                    "reference": "tbUnSubmit",
+                    "operation": "unSubmit"
+                  }
+                ]
+              },
+              {
+                "text": "审核",
+                "menu": [
+                  {
+                    "text": "审核",
+                    "reference": "tbAudit",
+                    "operation": "audit"
+                  },
+                  {
+                    "text": "反审核",
+                    "reference": "tbUnAudit",
+                    "operation": "unAudit"
+                  }
+                ]
+              },
+              {
+                "text": "列表",
+                "reference": "showListBtn",
+                "operation": "showList"
+              },
+              {
+                "text": "退出",
+                "reference": "closeBtn",
+                "operation": "close"
+              }
+            ]
+          },
+          {
+            "xtype": "tabpanel",
+            "ui": "form",
+            "height": 120,
+            "items": [
+              {
+                "title": "基本信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "单据编号",
+                    "bind": "{PUR_ORDER.PO_CODE}",
+                    "emptyText": "保存时自动生成",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "datefield",
+                    "fieldLabel": "采购日期",
+                    "bind": "{PUR_ORDER.PO_DATE}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "供应商",
+                    "bind": "{PUR_ORDER.PO_SUPPLIER}",
+                    "x": 610,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "textfield",
+                    "fieldLabel": "单据状态",
+                    "bind": "{PUR_ORDER.PO_STATUS}",
+                    "x": 910,
+                    "y": 10,
+                    "width": 300,
+                    "disabled": true
+                  }
+                ]
+              },
+              {
+                "title": "财务信息",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "结算币别",
+                    "bind": "{PUR_ORDER_FIN.PO_FIN_CURR}",
+                    "x": 10,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "结算方式",
+                    "bind": "{PUR_ORDER_FIN.PO_FIN_SETTLE}",
+                    "x": 310,
+                    "y": 10,
+                    "width": 300
+                  },
+                  {
+                    "xtype": "searchfield",
+                    "fieldLabel": "付款条件",
+                    "bind": "{PUR_ORDER_FIN.PO_FIN_PAYCOND}",
+                    "x": 610,
+                    "y": 10,
+                    "width": 300
+                  }
+                ]
+              },
+              {
+                "title": "其他",
+                "layout": "absolute",
+                "items": [
+                  {
+                    "x": 10,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "创建人",
+                    "xtype": "textfield",
+                    "bind": "{PUR_ORDER.PO_CREATOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 10,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "创建日期",
+                    "xtype": "datefield",
+                    "bind": "{PUR_ORDER.PO_CREATEDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "修改人",
+                    "xtype": "textfield",
+                    "bind": "{PUR_ORDER.PO_MODIFIER}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 310,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "修改日期",
+                    "xtype": "datefield",
+                    "bind": "{PUR_ORDER.PO_MODIFYDATE}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 10,
+                    "width": 300,
+                    "fieldLabel": "审核人",
+                    "xtype": "textfield",
+                    "bind": "{PUR_ORDER.PO_AUDITOR}",
+                    "disabled": true
+                  },
+                  {
+                    "x": 610,
+                    "y": 50,
+                    "width": 300,
+                    "fieldLabel": "审核日期",
+                    "xtype": "datefield",
+                    "bind": "{PUR_ORDER.PO_AUDITDATE}",
+                    "disabled": true
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "xtype": "tabpanel",
+            "ui": "form",
+            "items": [
+              {
+                "title": "明细信息",
+                "items": [
+                  {
+                    "xtype": "menubar",
+                    "ui": "form-menubar",
+                    "items": [
+                      {
+                        "text": "新增行",
+                        "menu": [
+                          {
+                            "text": "新增行",
+                            "reference": "newEntryBtn",
+                            "operation": "newEntry"
+                          },
+                          {
+                            "text": "插入行"
+                          },
+                          {
+                            "text": "复制行"
+                          },
+                          {
+                            "text": "关联复制行"
+                          },
+                          {
+                            "text": "多行关联复制行"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "删除行"
+                      },
+                      {
+                        "text": "批量填充"
+                      },
+                      {
+                        "text": "业务操作",
+                        "menu": [
+                          {
+                            "text": "获取批号"
+                          },
+                          {
+                            "text": "获取库存"
+                          },
+                          {
+                            "text": "累计数量取价"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "业务查询",
+                        "menu": [
+                          {
+                            "text": "价格查询"
+                          },
+                          {
+                            "text": "历史价格"
+                          },
+                          {
+                            "text": "库存查询"
+                          },
+                          {
+                            "text": "预留综合查询"
+                          },
+                          {
+                            "text": "研发资料"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "xtype": "gridpanel",
+                    "entity": "PUR_ORDER_ENTRY",
+                    "bind": "{PUR_ORDER_ENTRY}",
+                    "editable": true,
+                    "ui": "form",
+                    "height": 368,
+                    "columns": [
+                      {
+                        "text": "序号",
+                        "align": "center",
+                        "dataIndex": "PO_ENTRY_NO",
+                        "width": 60
+                      },
+                      {
+                        "text": "物料编码",
+                        "xtype": "searchcolumn",
+                        "dataIndex": "PO_ENTRY_PROD",
+                        "editor": {
+                          "xtype": "searchfield"
+                        }
+                      },
+                      {
+                        "text": "物料名称",
+                        "dataIndex": "PO_ENTRY_PRODNAME",
+                        "width": 160
+                      },
+                      {
+                        "text": "采购单位",
+                        "xtype": "searchcolumn",
+                        "dataIndex": "PO_ENTRY_UNIT",
+                        "editor": {
+                          "xtype": "searchfield"
+                        }
+                      },
+                      {
+                        "text": "采购数量",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_QTY",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "计价单位",
+                        "xtype": "searchcolumn",
+                        "dataIndex": "PO_ENTRY_PRICE_UNIT",
+                        "editor": {
+                          "xtype": "searchfield"
+                        }
+                      },
+                      {
+                        "text": "计价数量",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_PRICE_QTY",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "交货日期",
+                        "xtype": "datecolumn",
+                        "dataIndex": "PO_ENTRY_DELIVERY",
+                        "editor": {
+                          "xtype": "datefield"
+                        }
+                      },
+                      {
+                        "text": "单价",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_PRICE"
+                      },
+                      {
+                        "text": "含税单价",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_TAXPRICE",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "折扣率%",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_DISCOUNT",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "税率%",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_TAXRATE",
+                        "editor": {
+                          "xtype": "numberfield"
+                        }
+                      },
+                      {
+                        "text": "税额",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_TAXAMOUNT"
+                      },
+                      {
+                        "text": "金额",
+                        "xtype": "numbercolumn",
+                        "dataIndex": "PO_ENTRY_AMOUNT"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "title": "交货安排"
+              },
+              {
+                "title": "明细财务信息"
+              },
+              {
+                "title": "其他信息"
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "viewType": "list",
+        "layout": "fit",
+        "items": [
+          {
+            "xtype": "menubar",
+            "ui": "form-menubar",
+            "items": [
+              {
+                "text": "过滤"
+              },
+              {
+                "text": "刷新"
+              },
+              {
+                "text": "新增",
+                "menu": [
+                  {
+                    "text": "新增",
+                    "reference": "newBtn",
+                    "operation": "new"
+                  },
+                  {
+                    "text": "复制"
+                  }
+                ]
+              },
+              {
+                "text": "删除"
+              },
+              {
+                "text": "提交",
+                "menu": [
+                  {
+                    "text": "提交"
+                  },
+                  {
+                    "text": "反提交"
+                  }
+                ]
+              },
+              {
+                "text": "审核",
+                "menu": [
+                  {
+                    "text": "审核"
+                  },
+                  {
+                    "text": "反审核"
+                  }
+                ]
+              },
+              {
+                "text": "下推"
+              },
+              {
+                "text": "关联查询",
+                "menu": [
+                  {
+                    "text": "上查"
+                  },
+                  {
+                    "text": "下查"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "业务流程图"
+                  },
+                  {
+                    "text": "全流程跟踪"
+                  }
+                ]
+              },
+              {
+                "text": "业务操作",
+                "menu": [
+                  {
+                    "text": "作废"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "整单关闭"
+                  },
+                  {
+                    "text": "反关闭"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "计划确认"
+                  },
+                  {
+                    "text": "反计划确认"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "条码打印"
+                  },
+                  {
+                    "text": "修改变更"
+                  }
+                ]
+              },
+              {
+                "text": "业务查询",
+                "menu": [
+                  {
+                    "text": "预付查询"
+                  },
+                  {
+                    "text": "预留综合查询"
+                  },
+                  {
+                    "text": "研发资料"
+                  }
+                ]
+              },
+              {
+                "text": "选项",
+                "menu": [
+                  {
+                    "text": "选项"
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "打印"
+                  },
+                  {
+                    "text": "预览"
+                  },
+                  {
+                    "text": "套打",
+                    "menu": [
+                      {
+                        "text": "套打设置"
+                      },
+                      {
+                        "xtype": "menuseparator"
+                      },
+                      {
+                        "text": "连续套打全部单据"
+                      },
+                      {
+                        "text": "连续套打所选单据"
+                      },
+                      {
+                        "text": "连续套打预览全部单据"
+                      },
+                      {
+                        "text": "连续套打预览所选单据"
+                      },
+                      {
+                        "xtype": "menuseparator"
+                      },
+                      {
+                        "text": "合并套打全部单据"
+                      },
+                      {
+                        "text": "合并套打所选单据"
+                      },
+                      {
+                        "text": "合并套打预览全部单据"
+                      },
+                      {
+                        "text": "合并套打预览所选单据"
+                      },
+                      {
+                        "xtype": "menuseparator"
+                      },
+                      {
+                        "text": "套打导出"
+                      },
+                      {
+                        "text": "分批打印全部单据"
+                      },
+                      {
+                        "text": "分批打印所选单据"
+                      }
+                    ]
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "导入",
+                    "menu": [
+                      {
+                        "text": "导入"
+                      },
+                      {
+                        "text": "导入模板设置"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "导出",
+                    "menu": [
+                      {
+                        "text": "导出模板设置"
+                      },
+                      {
+                        "text": "按列表导出数据"
+                      },
+                      {
+                        "text": "按导出模板导出数据"
+                      },
+                      {
+                        "text": "按导入模板导出数据"
+                      }
+                    ]
+                  },
+                  {
+                    "xtype": "menuseparator"
+                  },
+                  {
+                    "text": "附件"
+                  }
+                ]
+              },
+              {
+                "text": "退出"
+              }
+            ]
+          },
+          {
+            "xtype": "fieldcontainer",
+            "fieldLabel": "我的方案",
+            "labelWidth": 88,
+            "padding": "10 0 10 0",
+            "items": [
+              {
+                "xtype": "segmentedbutton",
+                "ui": "form",
+                "items": [
+                  {
+                    "text": "缺省方案"
+                  },
+                  {
+                    "text": "我的未完成订单"
+                  },
+                  {
+                    "text": "今天"
+                  },
+                  {
+                    "text": "本周"
+                  },
+                  {
+                    "text": "本月",
+                    "pressed": true
+                  },
+                  {
+                    "text": "未入库完成采购订单"
+                  },
+                  {
+                    "text": "待审核采购订单"
+                  },
+                  {
+                    "text": "今日收货"
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "xtype": "gridpanel",
+            "ui": "form",
+            "height": 584,
+            "showFilterBar": true,
+            "showHeaderFilter": true,
+            "showPagingBar": true,
+            "selType": "checkboxmodel",
+            "reference": "PUR_ORDER_ENTRY",
+            "store": {
+              "fields": [
+              ]
+            },
+            "columns": [
+              {
+                "text": "单据编号",
+                "dataIndex": "PO_CODE"
+              },
+              {
+                "text": "采购日期",
+                "dataIndex": "PO_DATE"
+              },
+              {
+                "text": "供应商",
+                "dataIndex": "PO_SUPPLIER",
+                "width": 200
+              },
+              {
+                "text": "单据状态",
+                "dataIndex": "PO_STATUS"
+              },
+              {
+                "text": "物料编码",
+                "dataIndex": "PO_ENTRY_PROD",
+                "width": 160
+              },
+              {
+                "text": "物料名称",
+                "dataIndex": "PO_ENTRY_PRODNAME",
+                "width": 200
+              },
+              {
+                "text": "采购单位",
+                "dataIndex": "PO_ENTRY_UNIT"
+              },
+              {
+                "text": "采购数量",
+                "dataIndex": "PO_ENTRY_QTY"
+              },
+              {
+                "text": "交货日期",
+                "dataIndex": "PO_ENTRY_DELIVERY"
+              }
+            ]
+          }
+        ]
+      }
+    ]
+  }
+]

+ 32 - 0
applications/scm/scm-purchase/src/main/resources/metadata/Purchase.module.json

@@ -0,0 +1,32 @@
+[
+  {
+    "id": "scm_purchase",
+    "name": "采购管理",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_sale",
+    "name": "销售管理",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_credit",
+    "name": "信用管理",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_stock",
+    "name": "库存管理",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_org",
+    "name": "组织间结算",
+    "domain": "scm"
+  },
+  {
+    "id": "scm_barcode",
+    "name": "条码管理",
+    "domain": "scm"
+  }
+]

+ 8 - 0
applications/starter/build.gradle

@@ -0,0 +1,8 @@
+dependencies {
+    compile 'org.springframework.boot:spring-boot-starter-web'
+    compile 'org.springframework.boot:spring-boot-starter-jdbc'
+    compile project(':framework:framework-app')
+    compile project(':applications:scm:scm-base')
+    compile project(':applications:scm:scm-purchase')
+    compile "$ojdbc"
+}

BIN
applications/starter/out/production/classes/META-INF/uas-platform.applications.starter.main.kotlin_module


BIN
applications/starter/out/production/classes/com/usoftchina/uas/ApplicationStarter.class


BIN
applications/starter/out/production/classes/com/usoftchina/uas/config/WebConfig.class


BIN
applications/starter/out/production/classes/com/usoftchina/uas/error/DefaultErrorConfig.class


BIN
applications/starter/out/production/classes/com/usoftchina/uas/error/GlobalExceptionHandler.class


BIN
applications/starter/out/production/classes/com/usoftchina/uas/error/ServletErrorUtils.class


BIN
applications/starter/out/production/classes/com/usoftchina/uas/error/UnCaughtErrorFilter.class


+ 22 - 0
applications/starter/out/production/resources/application.yml

@@ -0,0 +1,22 @@
+spring:
+  datasource:
+    driver-class-name: oracle.jdbc.driver.OracleDriver
+    url: jdbc:oracle:thin:@10.1.81.2:1521:orcl
+    username: UAS_2
+    password: select!#%*(
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 50
+      idle-timeout: 30000
+      max-lifetime: 1800000
+      connection-timeout: 30000
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+
+logging:
+  level:
+    com.usoftchina: trace
+
+server:
+  servlet:
+    context-path: /api

+ 10 - 0
applications/starter/out/production/resources/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.BRIGHT_YELLOW}
+ _____  _____   _       ______
+|_   _||_   _| / \    .' ____ \
+  | |    | |  / _ \   | (___ \_|
+  | '    ' | / ___ \   _.____`.
+   \ \__/ /_/ /   \ \_| \____) |
+    `.__.'|____| |____|\______.'
+
+@Copyright 2019 Shenzhen Usoft Information Technology Co., Ltd.
+${AnsiColor.DEFAULT}

+ 3 - 0
applications/starter/out/production/resources/config/application-prod.yml

@@ -0,0 +1,3 @@
+logging:
+  level:
+    com.usoftchina: warn

+ 3 - 0
applications/starter/out/production/resources/config/application-test.yml

@@ -0,0 +1,3 @@
+logging:
+  level:
+    com.usoftchina: debug

+ 24 - 0
applications/starter/src/main/java/com/usoftchina/uas/ApplicationStarter.java

@@ -0,0 +1,24 @@
+package com.usoftchina.uas;
+
+import com.usoftchina.uas.jdbc.support.EnableDynamicDataSource;
+import com.usoftchina.uas.metadata.MetadataScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * @author yingp
+ * @date 2019/8/22
+ */
+@SpringBootApplication
+@EnableTransactionManagement
+@EnableAsync
+@EnableDynamicDataSource
+@MetadataScan(locations = "classpath*:metadata/**/*.*.json")
+public class ApplicationStarter {
+
+    public static void main(String[] args) {
+        SpringApplication.run(ApplicationStarter.class, args);
+    }
+}

+ 21 - 0
applications/starter/src/main/java/com/usoftchina/uas/config/WebConfig.java

@@ -0,0 +1,21 @@
+package com.usoftchina.uas.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @author yingp
+ * @date 2018/10/13
+ */
+@Configuration
+public class WebConfig implements WebMvcConfigurer {
+
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**")
+                .allowedMethods("*")
+                .allowedOrigins("*")
+                .allowedHeaders("*");
+    }
+}

+ 25 - 0
applications/starter/src/main/java/com/usoftchina/uas/error/DefaultErrorConfig.java

@@ -0,0 +1,25 @@
+package com.usoftchina.uas.error;
+
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.Ordered;
+
+import javax.servlet.DispatcherType;
+
+/**
+ * @author yingp
+ * @date 2018/10/16
+ */
+@Configuration
+public class DefaultErrorConfig {
+
+    @Bean
+    public FilterRegistrationBean<UnCaughtErrorFilter> unCaughtErrorFilter() {
+        UnCaughtErrorFilter filter = new UnCaughtErrorFilter();
+        FilterRegistrationBean<UnCaughtErrorFilter> registration = new FilterRegistrationBean<>(filter);
+        registration.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);
+        registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.ASYNC);
+        return registration;
+    }
+}

+ 53 - 0
applications/starter/src/main/java/com/usoftchina/uas/error/GlobalExceptionHandler.java

@@ -0,0 +1,53 @@
+package com.usoftchina.uas.error;
+
+import com.usoftchina.uas.base.Result;
+import com.usoftchina.uas.exception.BizException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author yingp
+ * @date 2018/10/16
+ */
+@ControllerAdvice
+public class GlobalExceptionHandler {
+
+    private Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
+
+    /**
+     * 默认异常处理
+     *
+     * @param request
+     * @param e
+     * @return
+     * @throws Exception
+     */
+    @ExceptionHandler(value = Exception.class)
+    @ResponseBody
+    public Result defaultHandler(HttpServletRequest request, Exception e) throws Exception{
+        String error = ServletErrorUtils.buildMessage(request, e);
+        logger.error(error, e);
+        return Result.throwable(e);
+    }
+
+    /**
+     * 业务异常
+     *
+     * @param request
+     * @param e
+     * @return
+     * @throws Exception
+     */
+    @ExceptionHandler(value = BizException.class)
+    @ResponseBody
+    public Result bizHandler(HttpServletRequest request, BizException e) throws Exception{
+        String error = ServletErrorUtils.buildMessage(request, e);
+        logger.error(error, e);
+        return Result.error(e);
+    }
+}

+ 53 - 0
applications/starter/src/main/java/com/usoftchina/uas/error/ServletErrorUtils.java

@@ -0,0 +1,53 @@
+package com.usoftchina.uas.error;
+
+import com.usoftchina.uas.base.Result;
+import com.usoftchina.uas.util.JsonUtils;
+import org.springframework.http.MediaType;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author yingp
+ * @date 2018/10/16
+ */
+public class ServletErrorUtils {
+    /**
+     * 构建异常信息
+     *
+     * @param request
+     * @param ex
+     * @return
+     */
+    public static String buildMessage(HttpServletRequest request, Throwable ex) {
+        StringBuilder message = new StringBuilder("Failed to handle request [");
+        message.append(request.getMethod());
+        message.append(" ");
+        message.append(request.getRequestURI());
+        message.append("]");
+        if (ex != null) {
+            message.append(": ");
+            message.append(ex.getMessage());
+        }
+        return message.toString();
+    }
+
+    /**
+     * 标准Result格式输出
+     *
+     * @param response
+     * @param e
+     * @throws IOException
+     * @throws ServletException
+     */
+    public static void writeErrorResult(HttpServletResponse response, Throwable e) throws IOException {
+        response.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE);
+        PrintWriter writer = response.getWriter();
+        writer.print(JsonUtils.toJsonString(Result.throwable(e)));
+        writer.flush();
+    }
+
+}

+ 36 - 0
applications/starter/src/main/java/com/usoftchina/uas/error/UnCaughtErrorFilter.java

@@ -0,0 +1,36 @@
+package com.usoftchina.uas.error;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.filter.OncePerRequestFilter;
+import org.springframework.web.util.NestedServletException;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * 处理过滤器里面的异常(无法通过ControllerAdvice处理的)
+ *
+ * @author yingp
+ * @date 2018/10/16
+ */
+public class UnCaughtErrorFilter extends OncePerRequestFilter {
+
+    private Logger logger = LoggerFactory.getLogger(UnCaughtErrorFilter.class);
+
+    @Override
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
+        try {
+            chain.doFilter(request, response);
+        } catch (Throwable ex) {
+            Throwable cause = ex;
+            if (ex instanceof NestedServletException) {
+                cause = ((NestedServletException) ex).getRootCause();
+            }
+            logger.error(ServletErrorUtils.buildMessage(request, cause), cause);
+            ServletErrorUtils.writeErrorResult(response, cause);
+        }
+    }
+}

+ 22 - 0
applications/starter/src/main/resources/application.yml

@@ -0,0 +1,22 @@
+spring:
+  datasource:
+    driver-class-name: oracle.jdbc.driver.OracleDriver
+    url: jdbc:oracle:thin:@10.1.81.2:1521:orcl
+    username: UAS_2
+    password: select!#%*(
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 50
+      idle-timeout: 30000
+      max-lifetime: 1800000
+      connection-timeout: 30000
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+
+logging:
+  level:
+    com.usoftchina: trace
+
+server:
+  servlet:
+    context-path: /api

+ 10 - 0
applications/starter/src/main/resources/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.BRIGHT_YELLOW}
+ _____  _____   _       ______
+|_   _||_   _| / \    .' ____ \
+  | |    | |  / _ \   | (___ \_|
+  | '    ' | / ___ \   _.____`.
+   \ \__/ /_/ /   \ \_| \____) |
+    `.__.'|____| |____|\______.'
+
+@Copyright 2019 Shenzhen Usoft Information Technology Co., Ltd.
+${AnsiColor.DEFAULT}

+ 3 - 0
applications/starter/src/main/resources/config/application-prod.yml

@@ -0,0 +1,3 @@
+logging:
+  level:
+    com.usoftchina: warn

+ 3 - 0
applications/starter/src/main/resources/config/application-test.yml

@@ -0,0 +1,3 @@
+logging:
+  level:
+    com.usoftchina: debug

+ 69 - 0
build.gradle

@@ -0,0 +1,69 @@
+plugins {
+    id "io.spring.dependency-management" version "1.0.7.RELEASE" apply false
+    id "org.springframework.boot" version "2.1.4.RELEASE" apply false
+}
+
+allprojects {
+    group 'com.usoftchina.uas'
+    version '2.0.0-SNAPSHOT'
+}
+
+subprojects { Project subproject ->
+    if (subproject.name in ["framework", "applications", "scm"]) {
+        return
+    }
+    apply plugin: 'java'
+    apply plugin: 'idea'
+    apply plugin: 'maven'
+    apply plugin: 'io.spring.dependency-management'
+
+    sourceCompatibility = 1.8
+    targetCompatibility = 1.8
+
+    [compileJava,compileTestJava,javadoc]*.options*.encoding = 'UTF-8'
+
+    ext {
+        springBootVersion = '2.1.4.RELEASE'
+        springCloudVersion = 'Greenwich.SR1'
+        // dependencies
+        alibabaThreadLocal = 'com.alibaba:transmittable-thread-local:2.10.2'
+        mysqlConnector = 'mysql:mysql-connector-java:6.0.6'
+        ojdbc = 'com.oracle:ojdbc6:11.2.0'
+        mybatisSpringBoot = 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.1'
+        pageHelperSpringBoot = 'com.github.pagehelper:pagehelper-spring-boot-starter:1.2.7'
+        gson = 'com.google.code.gson:gson:2.8.5'
+        guava = 'com.google.guava:guava:28.0-jre'
+    }
+
+    repositories {
+        mavenLocal()
+        mavenCentral()
+        maven { url "http://repo.spring.io/libs-milestone" }
+        maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
+        maven { url "https://oss.sonatype.org/content/repositories/snapshots"}
+    }
+
+    dependencyManagement {
+        imports {
+            mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
+        }
+    }
+
+    uploadArchives {
+        repositories {
+            mavenDeployer {
+                repository(url: "http://maven.ubtob.com/artifactory/libs-snapshot-local") {
+                    authentication(userName: "yingp", password: "111111")
+                }
+            }
+        }
+    }.dependsOn build
+
+    sourceSets {
+        main {
+            resources {
+                srcDirs = ["src/main/java", "src/main/resources"]
+            }
+        }
+    }
+}

+ 6 - 0
framework/framework-app/build.gradle

@@ -0,0 +1,6 @@
+dependencies {
+    compile project(':framework:framework-security')
+    compile project(':framework:framework-domain')
+    compile 'org.springframework:spring-web'
+    compileOnly 'javax.servlet:javax.servlet-api'
+}

BIN
framework/framework-app/out/production/classes/com/usoftchina/uas/app/view/HomeController.class


Деякі файли не було показано, через те що забагато файлів було змінено