客户端专用 busi对象类 CTNSysBusiLib
使用说明
本类集合了常用的业务函数
///获取设备班次 sEqptIDS 类似于 '342','142'
int getShiftIDS(const string& sEpqtIDS, const string& sDateTime, CSelectHelp& helpOut);
///获取Site对应的设备列表
int getLocEqpts(CSelectHelp& help,int iSiteID);
///获取变量的设备对应关系
int getAllVarEqpts(CSelectHelp& help);
///获取系统的树形help,如果sSysID为空返回全部
int getSysTree(CSelectHelp& help,int iSysID = 0);
///获取一个用户的详细信息
int getUserInfo(const string& sUserName, CSelectHelp& help);
///获取用户信息,适合于树型控件展示
int getUserTree(CSelectHelp& help)
{
help.reset();
string sql = "select dept_name, dept_id, parent_dept_id, 1 as isfolder,"
"'/picture/common/tree/com_tree_folder.png' as pic_path, '' as selecctedimg from uums_dept ";
string sql2 = "select user_cn_name, user_id, dept_id, 0, '/picture/common/tree/com_tree_file.png', '' from uums_user "
" where user_name<>'admin' and user_name<>'sysadmin' and(is_delete = 0 or is_delete is null) ";
CSelectHelp help2;
if (gTNApp->m_remoteICE_m.select(sql, "", help, m_sError) < 0)
return -1;
if (gTNApp->m_remoteICE_m.select(sql2, "", help2, m_sError) < 0)
return -1;
for (int i = 0; i < help2.size(); i++)
{
string sv = " ";
sv += help2.valueString(i, "user_id");
help2.setValueString(i, "user_id", sv);
}
help.unionHelp(help2);
return help.size();
}
///获取部门树
int getDeptTree(CSelectHelp& help);
///获取设备地点树
int getLocationEqptTree(CSelectHelp& help,string sColumns="");
////按工序过滤设备
int getLocationEqptTreeFilterProcess(CSelectHelp& help, CSelectHelp& helpProcess);
///获取实际设备地点树
int getLocationRealEqptTree(CSelectHelp& help);
///获取生产线地点树
int getLocationLineTree(CSelectHelp& help);
///获取material树
int getMaterialTree(CSelectHelp& help);
///获取站点地点树
int getLocationDcLocTree(CSelectHelp& help,bool bFull=true);
///获取地点树
int getLocationTree(CSelectHelp& help);
///获取用户所属地点权限
int getUserLocationRight(const string& sUserID,CSelectHelp& help);
///获取用户是否拥有某一个节点的权限,type=2代表写权限,1代表读权限
bool userHasLocationRight(const string& sUserID,const string& sLocationID,int iType=2);
///获取业务参数,sKey为键 例如unit
int getSysparameter(const string& sKey, CSelectHelp& help);
///获取班产量,-1都代表忽略参数
int getShiftOutput(CSelectHelp &help, const string& sFrom, const string& sTo, int iShiftID = -1, const string& sEqptId = "", const string& sMaterialID="");
///获取设备OEE相关的异常分析数据,如果sEqptIDs为空,则代表查询全部
int getOEEFault(CSelectHelp& help, const string& sFrim, const string& sTo, const string& sEqptIDs);
///获取设备状态对应help, 列名==>eqpt_status,color,name
void getEqptStatusMapHelp(CSelectHelp& help);
///获取设备状态的颜色值
unsigned int getEventStatusColor(int iStatus);
///获取事件的值与状态名称的Intent
void getEventStatusMap(CIntent& it);
///获取设备状态对应Intent
void getEqptStatusMap(CIntent& it);
///获取工单状态对应Intent
void getWoStatusMap(CIntent& it);
///获取设备状态对应颜色Intent
void getEqptStatusColorMap(CIntent& it);
string error();
///给事件处理中心发送事件
int sendEvent(CIntent& itIn, CIntent& itOut);
///获取实时数据
int dcGet(CSelectHelp& help, const string& sEqpts);
///获取设备状态
int getEqptState(CSelectHelp& help, const string& sEqpts);
///下载指定的工艺文档 bCheckSize代表是否检查文件大小变化
string getMtDoc(string sMaterialID, string sProcessName, string sDocType,bool bCheckSize=true);
///获取最可能的两个当前班次
int getShiftHelp(int iSiteID,CSelectHelp& help);
///获取指定时间的班次
int getShiftHelpByDate(int iSiteID, const string& sDate, CSelectHelp& help);
///获取指定时间的上一个班次
int getPreShiftHelp(int iSiteID, const string& sDate,int iShiftID, CSelectHelp& help);
///获取指定时间的上一个班次
int getNextShiftHelp(int iSiteID, const string& sDate, int iShiftID, CSelectHelp& help);
///获取当前班次
int getCurrentShiftHelp(int iSiteID, const string& sDate, int iShiftID, CSelectHelp& help);