大陆黄色一级片-大陆黄色网-大陆精品偷拍视频在线播放-大杳蕉伊人狼人久久一本线-国产精品国产三级国产普通-国产精品国产三级国产普通话对白

產(chǎn)品中心 業(yè)內(nèi)新聞 案例中心 視頻中心

Excel數(shù)據(jù)導(dǎo)入Mobox低代碼平臺 Excel數(shù)據(jù)導(dǎo)入Mobox低代碼平臺

Excel數(shù)據(jù)導(dǎo)入Mobox低代碼平臺

Excel數(shù)據(jù)導(dǎo)入Mobox低代碼平臺

 

我們系統(tǒng)上線的時候,原先的歷史數(shù)據(jù)是沒有的,為了快速接軌企業(yè)已有數(shù)據(jù),我們可以通過excel 對歷史數(shù)據(jù)進(jìn)行導(dǎo)入操作。導(dǎo)入一般可以通過腳本做一些定制開發(fā)來實(shí)現(xiàn)

 

列子:

數(shù)據(jù)導(dǎo)入的sheet 要求

這個系統(tǒng)只能導(dǎo)入,左邊第一個sheet (命名無所謂)(注意:若數(shù)據(jù)列表 這個sheet左邊還有隱藏的sheet,那么系統(tǒng)也不能獲取 數(shù)據(jù)列表sheet頁的數(shù)據(jù))

對Excel單元格的要求

單元個里面的數(shù)據(jù),只能是字符串或數(shù)值。若是計算公式或函數(shù) ,將無法獲取

另外,單元個內(nèi)容 不能出現(xiàn) /\<> & 符號,不能有換行或大量空格

分析excel格式

1、字段分3類:

  • 關(guān)鍵字段

如,產(chǎn)品名稱 ,這個是必須有數(shù)值的

  • 屬性字段

用于登記各種屬性信息

  • 計算字段

若有數(shù)據(jù),則直接獲取

若沒有,可以通過lua腳本計算生成

這種字段,一般也是必須有數(shù)值的

2、第一行是表頭行,數(shù)據(jù)行從第二行開始

 

定義導(dǎo)入功能

通過Mobox 3000 功能點(diǎn)進(jìn)行定義,設(shè)置界面如下:

導(dǎo)入腳本,參考:

json? = require(“json”)
mobox = require(“OILua_JavelinExt”)
require(“oi_basestrfunc”)
function ImportKA(strLuaDEID)
? ? local nRet, strRetInfo
? ? — 獲取導(dǎo)入的數(shù)據(jù), 返回 [[{“attr”:”xx”,”value”:””},…]]
? ? — V2.0
? ? nRet, strRetInfo = mobox.getCurEditDataPacket(strLuaDEID)
? ? if (nRet ~= 0 or strRetInfo == ”) then
? ? ? ? mobox.error(strLuaDEID, “無法獲取導(dǎo)入數(shù)據(jù)!”)
? ? ? ? return
? ? end
? ? local input_rows = json.decode(strRetInfo)
? ? local n, nCount, nValue, nMaxRow, nRow
? ? local strAddAttr = ”
? ? — 一些關(guān)鍵屬性
? ? local strKAName = ”
? ? local strKAType = ”
? ? local strArea = ”
? ? — 步驟1 獲取從excel導(dǎo)入的一行數(shù)據(jù),根據(jù)excel的列定義進(jìn)行屬性組合 strAddAttr
? ? nMaxRow = #input_rows
? ? for nRow = 1, nMaxRow do
? ? ? ? input = input_rows[nRow]
? ? ? ? nCount = #input
? ? ? ? — V2.1
? ? ? ? strAddAttr = ”
? ? ? ? strKAName = ”
? ? ? ? strKAType = ”
? ? ? ? strArea = ”
? ? ? ? for n = 1, nCount do
? ? ? ? ? ? strAttr = input[n].attr
? ? ? ? ? ? strValue = input[n].value
? ? ? ? ? ? if (strAttr ~= ” and strValue ~= ”) then
? ? ? ? ? ? ? ? — 根據(jù)導(dǎo)入的excel列頭名稱進(jìn)行判斷
? ? ? ? ? ? ? ? — 關(guān)鍵屬性判斷
? ? ? ? ? ? ? ? if (strAttr == “客戶名稱”) then
? ? ? ? ? ? ? ? ? ? if (strValue == ”) then
? ? ? ? ? ? ? ? ? ? ? ? mobox.error(strLuaDEID, strAttr .. “不能為空!”)
? ? ? ? ? ? ? ? ? ? ? ? return
? ? ? ? ? ? ? ? ? ? end
? ? ? ? ? ? ? ? ? ? strKAName = strValue
? ? ? ? ? ? ? ? ? ? strAddAttr = strAddAttr .. ‘{“attr”:”S_KA_NAME”,”value”:”‘ .. strKAName .. ‘”},’
? ? ? ? ? ? ? ?— 常規(guī)屬性
? ? ? ? ? ? ? ? elseif (strAttr == “所屬地區(qū)”) then
? ? ? ? ? ? ? ? ? ? strArea = strValue
? ? ? ? ? ? ? ? ? ? strAddAttr = strAddAttr .. ‘{“attr”:”S_AREA”,”value”:”‘ .. strArea .. ‘”},’
? ? ? ? ? ? ? ? elseif (strAttr == “客戶類型”) then
? ? ? ? ? ? ? ? ? ? strKAType = strValue
? ? ? ? ? ? ? ? ? ? strAddAttr = strAddAttr .. ‘{“attr”:”S_KA_TYPE”,”value”:”‘ .. strKAType .. ‘”},’
? ? ? ? ? ? ? ? end
? ? ? ? ? ? end
? ? ? ? end
? ? ? ? –去除最后一個,
? ? ? ? local strAddAttr1 = trim_laster_char(strAddAttr)
? ? ? ? — 步驟2 根據(jù)客戶名稱來判斷導(dǎo)入的客戶是否已經(jīng)存在
? ? ? ? —? ? ? ?如果已經(jīng)存在,根據(jù)導(dǎo)入的數(shù)據(jù)進(jìn)行覆蓋
? ? ? ? —? ? ? ?如果不存在需要創(chuàng)建
? ? ? ? local attrs
? ? ? ? local strCondition = “S_KA_NAME='” .. strKAName .. “‘”
? ? ? ? nRet, strRetInfo = mobox.existThisData(strLuaDEID, “客戶”, strCondition)
? ? ? ? if (nRet ~= 0) then
? ? ? ? ? ? mobox.error(strLuaDEID, “在檢查客戶是否存在時失敗! ” .. strRetInfo)
? ? ? ? ? ? return
? ? ? ? end
? ? ? ? if (strRetInfo == ‘yes’) then
? ? ? ? ? ? — 已經(jīng)存在,根據(jù)導(dǎo)入的數(shù)據(jù)進(jìn)行覆蓋
? ? ? ? ? ? strCondition = “S_KA_NAME='” .. strKAName .. “‘”
? ? ? ? ? ? strSetSQL =? “S_KA_NAME = ‘” .. strKAName ..”‘ , S_KA_TYPE ='” ..strKAType .. “‘ , S_AREA = ‘” .. strArea ..”‘ “
? ? ? ? ? ? nRet, strRetInfo = mobox.updateDataAttrByCondition(strLuaDEID, “客戶”, strCondition, strSetSQL)
? ? ? ? ? ? if (nRet ~= 0) then
? ? ? ? ? ? ? ? mobox.error(strLuaDEID, strRetInfo)
? ? ? ? ? ? ? ? return
? ? ? ? ? ? end
? ? ? ? elseif (strRetInfo == ‘no’) then
? ? ? ? ? ? — 創(chuàng)建客戶
? ? ? ? ? ? –mobox.writeSysLog(“strAddAttr1”, strAddAttr1)
? ? ? ? ? ? strAddAttr1 = ‘[‘ .. strAddAttr1 .. ‘]’
? ? ? ? ? ? –mobox.writeSysLog(“strAddAttr2”, strAddAttr1)
? ? ? ? ? ? nRet, strRetInfo = mobox.createDataObj(strLuaDEID, “客戶”, strAddAttr1)
? ? ? ? ? ? if (nRet ~= 0) then
? ? ? ? ? ? ? ? mobox.error(strLuaDEID, “創(chuàng)建客戶失敗! ” .. strRetInfo )
? ? ? ? ? ? ? ? return
? ? ? ? ? ? end
? ? ? ? end
? ? end
end
標(biāo)簽:低代碼腳本 上一篇: 下一篇:
展開更多
預(yù)約軟件體驗

loading...

主站蜘蛛池模板: 富二代精品视频 | 成人夜色视频网站在线观看 | 深爱五月开心网亚洲综合 | 精品久久久久久久九九九精品 | 韩国一级永久免费观看网址 | 在线观看毛片网站 | 国产成人免费永久播放视频平台 | 国产精品免费一区二区三区 | v欧美精品v日本精品 | 久久99热久久精品91 | 亚洲精品日韩一区二区 | 国产亚洲人成网站在线观看不卡 | 免费看a级片 | 国产一区二区成人 | 国产精品午夜性视频 | 久久精品国产这里是免费 | 日本国产最新一区二区三区 | 国产一区二区在线免费观看 | 欧美日韩午夜视频 | 久久国产99 | 成视频年人黄网站免费 | 国产福利最新手机在线观看 | 色噜噜亚洲男人的天堂 | 成年女人毛片免费观看97 | 在线精品亚洲 | 久久精品无遮挡一级毛片 | 免费国产一区二区在免费观看 | 久艹在线视频 | 一级黄片毛片 | 欧美不卡一区 | 国产精品单位女同事在线 | 久久视奸| 成人在线手机视频 | 97在线视频网站 | 在线视频 中文字幕 | 免费视频久久看 | 久久精品在现线观看免费15 | 成人网18免费下 | 欧美成人毛片 | 午夜亚洲国产成人不卡在线 | 亚洲haose在线观看 |