介绍
类即为java类,自定义按钮,触发器,定时类等模块都可以调用自定义类,在类中处理一些逻辑。
💡
注意:当调用CCService的方法时,要对异常进行抛出或者捕获。定时类是一段Jave代码片段,新建定时作业时,指定定时类,定时类中的代码可以根据定时作业设置的时间执行。
进入类开发页面
- 登录系统,点击右上角人头像,选择开发者平台按钮,此按钮目前只开放给管理员简档用户。

- 选择左侧:扩展——》类

案例:查询客户对象数据
import net.sf.json.JSONObject;
import net.sf.json.JSONArray;
import net.sf.json.JSON;
/**
* author:*** on 2022-10-12
* 客户类
*/
public class AccountClass{
private CCService cs;
private UserInfo userInfo;
public AccountClass(UserInfo userInfo) {
this.userInfo = userInfo;
cs = new CCService(userInfo);
}
public JSONObject selectAccount() throws Exception {
JSONObject rtninfo = new JSONObject();//New JSONObject
JSONArray dataList = new JSONArray();//New JSONArray
boolean flag = false;
try{
//查询客户对象数据
String sql = "select name,leixing,fenji,hangye from Account where is_deleted='0' ";
List<CCObject> AccountList = cs.cqlQuery("Account", sql);//客户List
for (int i=0;i<AccountList.size();i++) {
String name = AccountList.get(i).get("name")==null?"":AccountList.get(i).get("name").toString();//客户名称
String type = AccountList.get(i).get("leixing")==null?"":AccountList.get(i).get("leixing").toString();//类型
String grade = AccountList.get(i).get("fenji")==null?"0":AccountList.get(i).get("fenji").toString();//分级
String industry = AccountList.get(i).get("hangye")==null?"0":AccountList.get(i).get("hangye").toString();//行业
JSONObject data = new JSONObject();//New JSONObject
data.put("name", name);//客户名称
data.put("type", type);//类型
data.put("grade", grade);//分级
data.put("industry", industry);//行业
data.put("no",(i+1)+"");//序号
dataList.add(data);
}
flag = true;
}catch(Exception e){
throw e;
}
rtninfo.put("status",flag);//状态
rtninfo.put("data",dataList.toString());//客户数据
return rtninfo;
}
}