aiM18开发者中心 aiM18开发者中心
文档主页
  • 平台

    • 平台总体概述
    • 前端开发须知
    • 后台开发须知
    • EBI开发须知
    • JSF组件属性表
    • BPM扩展接口
    • 一查到底扩展接口
    • 手机App设置
  • ERP

    • ERP 后端扩展
    • ERP 应用配置
    • ERP 前端扩展
  • 教程

    • 设置Eclipse开发环境
    • 创建App教程
  • 平台相关

    • API授权
    • 通用的数据对象
    • 核心的API
    • EBI相关接口
  • 企业资源规划
  • 人力资本管理
  • 业务流程处理
  • 日程管理
  • 文档管理
  • 教程

    • 通过API与aiM18进行交互
教程
GitHub (opens new window)
文档主页
  • 平台

    • 平台总体概述
    • 前端开发须知
    • 后台开发须知
    • EBI开发须知
    • JSF组件属性表
    • BPM扩展接口
    • 一查到底扩展接口
    • 手机App设置
  • ERP

    • ERP 后端扩展
    • ERP 应用配置
    • ERP 前端扩展
  • 教程

    • 设置Eclipse开发环境
    • 创建App教程
  • 平台相关

    • API授权
    • 通用的数据对象
    • 核心的API
    • EBI相关接口
  • 企业资源规划
  • 人力资本管理
  • 业务流程处理
  • 日程管理
  • 文档管理
  • 教程

    • 通过API与aiM18进行交互
教程
GitHub (opens new window)
  • 通用

    • 访问授权
    • 通用JSON对象
      • SqlTable
      • SqlEntity
      • CheckMsg
      • 其他有用的类
    • 核心服务
    • 商业智能
    • 错误码说明
  • 业务流程管理

    • 业务流程管理
  • 日程管理

    • 日程管理
  • 文档管理

    • 文档管理系统
  • 企业资源规划

    • API授权流程
    • 基础资料
    • 财务
    • 财务EBI
    • 委外代销
    • EBI
    • 仓库管理方案
    • 零售
    • 零售储值
    • 零售和第三方物流
    • 生产
    • 贸易和财务
    • 采购
    • 销售
    • 库存
    • 委外
  • 人力资本管理

    • API授权流程
    • 绩效管理
    • 考勤管理
    • 临时工
    • 人事管理
    • 请假管理
    • 医疗索偿
    • 薪资管理
    • 招聘管理
    • 培训&资助
  • Web Services中文
  • 通用
Multiable
2024-02-23
目录

通用JSON对象

版本: 1.0 | 发布日期: 30/6/2023

本节介绍 aiM18 在各种网络服务请求中接收或返回的通用 JSON 对象

# SqlTable

SqlTable 是 aiM18 广泛使用的 Java 类。你可以在 Github (opens new window) 上查看其详细源代码。

如果你的编程语言是 Java,你可以使用在 github 上获得的类定义,将 JSON 直接转换为 Java 类,以便进行后续操作。其 JSON 格式如下所示:

SqlTable JSON:

{
  "name":"test",		//SqlTable name
  "size":2, 			//The row count
  "fields":[			//The fields info of the table 
		{
          "name":"id",							// Field name
          "fieldClassName":"Long", 				// Class name of the field
          "fieldClass":"java.lang.Long",		// Field class
          "classType":10
        },
    	{
          "name":"code",
          "fieldClassName":"String",
          "fieldClass":"java.lang.String",
          "classType":0
        },
    	{ 
          "name":"lastModifyDate",
          "fieldClassName":"Date",
           "fieldClass":"java.util.Date",
           "classType":21
        }],
 "values":[			//The values of the field
       {
         "id":3,
         "code":"AS0221",
         "lastModifyDate":"2017-10-25 12:06:34"
       },					
       {
         "id":2,
         "code":"DS22",
         "lastModifyDate":"2017-10-19 09:37:10"
       }]
}

SqlTable的参数:

名字 类型 说明
name String SqlTable名称(如数据字典所述)
size int 行数
fields JSON Array 表格的字段信息
values JSON Array 字段的值

# SqlEntity

SqlEntity 是一个 JSON 对象,代表 aiM18 中一个模块单据的数据。请注意,一个 SqlEntity 可以包含多个 SqlTable。

SqlEntity JSON:

{
	"moduleType":"employee",			//Module name
	"mainTableName":"employee",			//The main table of the module
	"subTableNames":"employeepic;employee_attach", // Sub table name list,separate by ";"
	"employee": a sqlTable to json string ,		//The json can refer to the above sqltable
    "employeepic": a sqlTable to json string ,
	"employee_attach" : a sqlTable to json string 
}

SqlEntity的参数:

名字 类型 说明
moduleType String 模块类型(如数据字典所述)
mainTableName String 模块主表
subTableNames String 子表名称列表,以分号;分隔
the name of mainTable SqlTable json string SqlTable JSON
the name of subTable1 SqlTable json string SqlTable JSON
the name of subTable2 SqlTable json string SqlTable JSON
... ... ...

# CheckMsg

CheckMsg 是一个 JSON 对象,代表 aiM18 中各种Web服务的结果信息。

CheckMsg JSON:

{
    "id":101905,
   	"key":"core_101905",
  	"pass":false,	//When the operation is success, it will be yes;
 	"type":"Error",	//It can be "Error","Info","Warning"
    "info":"required. field(module.required)",		//Info show to ap
    "info_desc":"Required field is empty.",			//Info show to user
  	"exception":"",			//If an exception occurs,exception message will write here.
    "htmlMessage":false,	
    "jsonStr":"",
    "locators":[			//You can find which table and column are wrong with these infos;
            {				
             "colName":"desc",
             "id":0,
             "locatorKey":"employee.desc",
             "row":0,			//Row is only for footer table,for headerTable the row should 0
             "tableName":"employee",
             "type":"Field"
            },
    		{
              "colName":"dept",
              "id":0,
              "locatorKey":"employee.dept",
              "row":0,
              "tableName":"employee",
              "type":"Field"
            }],
   
    "trace":"[ModuleChecker.checkFieldDataDictSetting_458]-[CheckerLib.runChecker_225]-[CawEntityCurdAction.updateEntity_107]-[CawEntityInterceptor.logCall_42]-[view24.updateEntity_-1]"	//You can trace the error in java code with this info.
    
}

CheckMsg的参数:

名字 类型 说明
id long 在一个app中是唯一的
key String 在一个app中是唯一的
pass boolean 当操作成功时,结果为true
type String 消息类型
info String JSON可以参考上面的SqlTable
info_desc String JSON可以参考上面的SqlTable
exception String 异常消息
htmlMessage boolean 如果消息使用 html 代码,则为 true
jsonStr json String 一些特殊的值
locators json Array 你可以通过这些信息找到哪些表和列有错误
trace String 返回错误的 Java 代码信息

# 其他有用的类

aiM18在 Github (opens new window) 上提供了其他通用的POJO类定义和Util方法 。如果你的编程语言是 Java,可以在路径中加入这些类。

  1. CheckResult
  2. EntityResult
  3. LocatorType
  4. MsgLocator
  5. MsgType
  6. SqlClassType
  7. SqlTableField
  8. SqlTableIterator
  9. Util
Last Updated: 2025/04/09, 02:58:38
访问授权
核心服务

← 访问授权 核心服务→

Theme by Vdoing | Copyright © 1990-2025 Multiable | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式