Files
tianrunCRM/Assets/trCRM/upgradeRes4Dev/priority/lua/net/NetProto.lua

751 lines
26 KiB
Lua
Raw Normal View History

2020-07-04 14:41:25 +08:00
NetProto = {}
local onReceiveCmdCallback = nil
local PanelListener = {}
---@type CLLQueue
local ListenerQueue = CLLQueue.new()
NetProto.send = {}
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
2020-07-14 22:04:03 +08:00
local host = "app.ttf-cti.com" -- "47.111.20.34"
2020-07-09 08:50:24 +08:00
local port = 29004
local baseUrl = joinStr("http://", host, ":", port, "/open_api/")
local socketUrl = joinStr("ws://", host, ":", port, "/tr_socket/websocket/")
2020-08-02 08:47:44 +08:00
NetProto.setSever = function(_host, _port)
host = _host
port = _port
2020-07-28 21:02:59 +08:00
baseUrl = joinStr("http://", host, ":", port, "/open_api/")
socketUrl = joinStr("ws://", host, ":", port, "/tr_socket/websocket/")
end
2020-08-05 21:12:20 +08:00
NetProto.isDebug = false
2020-07-04 14:41:25 +08:00
---@type Dist.SpringWebsocket.Client
2020-07-09 08:50:24 +08:00
local socket = Client4Stomp.self
2020-07-04 14:41:25 +08:00
local appid = 2020158
local appsecret = "ea042bc86428ca968756a6e47b10742d"
local ErrCode = {
success = 1000,
invalidToken = 2019
}
local wrapSendData = function(map)
map = map or {}
map.appid = appid
map.timestamp = DateEx.nowMS + 1000
map.sign = NetProto.sign
local dList = {}
for k, v in pairs(map) do
2020-07-24 22:12:55 +08:00
if v and (type(v) == "number" or type(v) == "string" or type(v) == "boolean") then
table.insert(dList, joinStr(k, "=", Uri.EscapeDataString(tostring(v))))
2020-07-04 14:41:25 +08:00
end
end
return table.concat(dList, "&")
end
local dispatch = function(content, params)
hideHotWheel()
local cmd = params.cmd -- 接口名
local callback = params.callback
local orgs = params.orgs
local map = content or {}
-- 解密bio
local succ = map.success == nil and true or map.success
local msg = map.message or ""
local code = succ and (map.code or NetSuccess) or (map.code or -1)
-- if MyCfg.self.isEditMode then
-- print(joinStr("cmd:[", cmd, "]code:[", code, "]msg:", msg))
-- end
if code == ErrCode.invalidToken then
-- 重新设置token
Prefs.setToken("")
NetProto.init()
end
if (not succ) then
printe(joinStr("cmd:[", cmd, "]code:[", code, "]msg:", msg))
-- retInfor.msg = Localization.Get(joinStr("Error_", succ))
if not isNilOrEmpty(msg) then
2020-07-16 23:06:09 +08:00
MyUtl.toastW(msg)
2020-07-04 14:41:25 +08:00
end
hideHotWheel()
else
-- success
NetProto.onReceiveCMD(cmd, map)
end
Utl.doCallback(callback, map, orgs)
-- 线程安全考虑先把要处理的panle放到quque中
for k, p in pairs(PanelListener) do
ListenerQueue:enQueue(p)
end
2020-08-06 22:56:33 +08:00
---@type Coolape.CLPanelLua
2020-07-04 14:41:25 +08:00
local p
while (ListenerQueue:size() > 0) do
---@type coolape.Coolape.CLPanelBase
p = ListenerQueue:deQueue()
2020-08-06 22:56:33 +08:00
if p and (not p:IsNull()) and p.gameObject.activeInHierarchy then
2020-07-04 14:41:25 +08:00
p:procNetwork(cmd, code, msg, map)
2020-08-06 22:56:33 +08:00
else
NetProto.removePanelListener(p)
2020-07-04 14:41:25 +08:00
end
end
end
local dispatchHttp = function(content, params)
2020-08-05 21:12:20 +08:00
if NetProto.isDebug then
2020-07-04 14:41:25 +08:00
print(content)
end
local map = json.decode(content)
dispatch(map, params)
end
local onFailedSend = function(content, params)
hideHotWheel()
local cmd = params.cmd -- 接口名
local failedCallback = params.failedCallback
local orgs = params.orgs
Utl.doCallback(failedCallback, nil, orgs)
end
2020-08-01 17:55:18 +08:00
-- 上传头像
NetProto.uploadUserHeadIcon = function(path, finishCallback)
NetProto._uploadFile("updateUserImg", path, "", finishCallback)
end
NetProto.uploadFile = function(path, uploadPath, finishCallback)
NetProto._uploadFile("uploadFile", path, uploadPath, finishCallback)
end
NetProto._uploadFile = function(methord, path, uploadPath, finishCallback)
local params = {
operator = NetProto.loginNo,
uploadPath = uploadPath
}
local url = joinStr(baseUrl, methord, "?", wrapSendData(params))
local www =
WWWEx.uploadFile(
url,
NetProto.httpHeader,
"uploadFile",
Path.GetFileName(path),
File.ReadAllBytes(path),
CLAssetType.text,
function(content, orgs)
content = json.decode(content)
if content.success then
Utl.doCallback(finishCallback, content)
else
printe(content.message)
Utl.doCallback(finishCallback, content)
end
end,
function(content, orgs)
Utl.doCallback(finishCallback, nil)
end,
nil,
true,
1
)
return www
end
2020-07-04 14:41:25 +08:00
NetProto.sendGet = function(cmd, map, callback, failedCallback, orgs, _baseUrl)
if isNilOrEmpty(NetProto.sign) and (cmd ~= NetProto.cmds.getTokenForAPI) then
2020-07-16 23:06:09 +08:00
MyUtl.toastW("与服务器失去联络,请重试!")
2020-07-04 14:41:25 +08:00
NetProto.init()
return
end
showHotWheel()
local _url = _baseUrl or baseUrl
local url = joinStr(_url, cmd, "?", wrapSendData(map))
local params = {
cmd = cmd,
orgs = orgs,
callback = callback,
failedCallback = failedCallback
}
url = Uri.EscapeUriString(url)
2020-08-05 21:12:20 +08:00
if NetProto.isDebug then
2020-07-04 14:41:25 +08:00
print(url)
end
WWWEx.get(url, NetProto.httpHeader, CLAssetType.text, dispatchHttp, onFailedSend, params, true, 1)
end
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
local onGetToken = function(token)
Prefs.setToken(token)
NetProto.token = token
NetProto.sign = Utl.getSha256(joinStr(appid, "&", NetProto.token))
NetProto.httpHeader = {
Authorization = joinStr("Bearer ", NetProto.token)
}
-- print("token==" .. NetProto.token)
-- print("sign==" .. NetProto.sign)
end
function NetProto.init(callback)
-- NetProto.token = Prefs.getToken()
NetProto.getTokenForAPI(
appsecret,
function(data, orgs)
if data.success then
onGetToken(data.result)
Utl.doCallback(callback, true)
else
2020-07-09 09:23:09 +08:00
MyUtl.toastW(data.msg)
2020-07-04 14:41:25 +08:00
Utl.doCallback(callback, false)
end
end,
function()
2020-07-16 23:06:09 +08:00
MyUtl.toastW("取得会话ID失败")
2020-07-04 14:41:25 +08:00
Utl.doCallback(callback, false)
end
)
end
---@param p Coolape.CLPanelBase
function NetProto.addPanelListener(p)
if p then
2020-08-06 22:56:33 +08:00
PanelListener[p.name] = p
2020-07-04 14:41:25 +08:00
end
end
---@param p Coolape.CLPanelBase
function NetProto.removePanelListener(p)
if p then
2020-08-06 22:56:33 +08:00
PanelListener[p.name] = nil
2020-07-04 14:41:25 +08:00
end
end
function NetProto.cleanPanelListeners()
PanelListener = {}
end
function NetProto.setReceiveCMDCallback(cb)
onReceiveCmdCallback = cb
end
---public 缓存数据
function NetProto.onReceiveCMD(cmd, data)
if onReceiveCmdCallback then
onReceiveCmdCallback(cmd, data)
end
end
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
NetProto.getTokenForAPI = function(appsecret, callback, failedCallback, orgs)
local map = {
appsecret = appsecret
}
NetProto.sendGet(NetProto.cmds.getTokenForAPI, map, callback, failedCallback, orgs, baseUrl)
end
NetProto.login = function(map, callback, failedCallback, orgs)
2020-07-28 21:02:59 +08:00
map.model = SystemInfo.deviceModel
2020-07-04 14:41:25 +08:00
NetProto.sendGet(NetProto.cmds.login, map, callback, failedCallback, orgs)
end
-- 取得短信验证码
NetProto.sendVerMsg = function(map, callback, failedCallback, orgs)
NetProto.sendGet(NetProto.cmds.sendVerMsg, map, callback, failedCallback, orgs)
end
NetProto.updateLoginNoPwd = function(map, callback, failedCallback, orgs)
NetProto.sendGet(NetProto.cmds.updateLoginNoPwd, map, callback, failedCallback, orgs)
end
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
NetProto.cmds = {
getTokenForAPI = "getTokenForAPI",
login = "login",
sendVerMsg = "sendVerMsg", -- 取得短信验证码
updateLoginNoPwd = "updateLoginNoPwd", -- 设置新密码
announcement_query = "announcement_query", -- 系统公告
booking_query = "booking_query", -- 待跟进客户
replenish_query = "replenish_query", -- 待补货
filter_customers = "filter_customers", -- 过滤条件
list_customers = "list_customers", -- 客户列表
person_view_query = "person_view_query", -- 头像
bi_call = "bi_call", -- 打电话
query_cust_calllog = "query_cust_calllog", -- 通话记录
sales_view_query = "sales_view_query", -- 今日成交&今日金额&本月金额
custtype_report = "custtype_report", -- 客户类型分布
order_report = "order_report", -- 客户类型分布
target_report = "target_report", -- 客户类型分布
2020-07-08 08:01:34 +08:00
update_customer = "update_customer", -- 更新客户信息
2020-07-10 22:33:30 +08:00
save_customer = "save_customer", -- 新建客户
create_followUp_record = "create_followUp_record", -- 新建跟进
2020-07-14 22:04:03 +08:00
load_wfTicket_Settings = "load_WfTicket_Settings", -- 工单配置信息
2020-07-11 20:53:21 +08:00
selectProductInfo = "selectProductInfo", -- 商品列表
2020-07-14 22:04:03 +08:00
createWfInfo = "createWfInfo", -- 创建订单
2020-07-18 21:12:14 +08:00
create_followUp_task = "create_followUp_task", -- 创建跟进预约
2020-07-24 22:12:55 +08:00
list_followUp_records = "list_followUp_records", -- 跟进记录
2020-07-28 21:02:59 +08:00
workFlowQuery = "workFlowQuery", -- 工单列表
backToGH = "backToGH", -- 返回公海
delCustomerInfo = "delCustomerInfo", -- 删除客户
2020-08-05 20:46:00 +08:00
loadProductType = "loadProductType", -- 商品类型
2020-07-28 21:02:59 +08:00
pageGHQueryList = "pageGHQueryList", -- 公海列表
2020-08-01 17:55:18 +08:00
getFromGH = "getFromGH", -- 获取客户
list_followUp_tasks = "list_followUp_tasks", --预约记录
personal_data_query = "personal_data_query", -- 个人信息
updateUserInfo = "updateUserInfo", -- 更新用户信息
updateUserPhone = "updateUserPhone", -- 更新用户手机号
get_customerById = "get_customerById", -- 取得客户
2020-08-06 22:56:33 +08:00
readNotice = "readNotice" -- 已读公告
2020-07-04 14:41:25 +08:00
}
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
local __callbackInfor = {} -- 回调信息
local __callTimes = 1
---public 处理回调
local doCallbackSocket = function(result)
local callbackKey = result.callbackId
if callbackKey then
local cbinfor = __callbackInfor[callbackKey]
if cbinfor and cbinfor[1] then
pcall(cbinfor[1], result, cbinfor[2])
end
__callbackInfor[callbackKey] = nil
end
end
---public 超时处理
local timeOutCallback = function(param)
if __callbackInfor[param.callbackId] then
printe("timeOutCallback====")
-- 说明请求还没有返回
local result = {callbackId = param.callbackId, code = -100, success = false, message = "请求超时"}
doCallbackSocket(result)
dispatch(result, {cmd = param.action})
end
end
---public 设计回调信息
local setCallback = function(callback, orgs, timeOutSec)
local callbackKey
-- if callback then
callbackKey = os.time() + __callTimes
__callTimes = __callTimes + 1
__callbackInfor[callbackKey] = {callback, orgs}
-- end
if timeOutSec and timeOutSec > 0 then
InvokeEx.invoke(timeOutCallback, orgs, timeOutSec)
end
return callbackKey
end
---------------------------------------------------------------------------------------
NetProto.socketInit = function(comanyId, loginNo, groupId)
-- 网络
NetProto.comanyId = comanyId
NetProto.loginNo = loginNo
NetProto.groupId = groupId
socket:init(socketUrl, NetProto.OnReceiveStompMsg)
end
---@param frame Dist.SpringWebsocket.StompFrame
NetProto.OnReceiveStompMsg = function(frame)
2020-08-05 21:12:20 +08:00
-- if NetProto.isDebug then
2020-07-14 22:04:03 +08:00
-- print(frame.Code, frame.Content)
-- end
2020-07-04 14:41:25 +08:00
if frame.Code == StompStatus.OPENSERVER then
socket:Connect(nil, NetProto.OnReceiveStompMsg)
elseif frame.Code == StompStatus.CONNECTED then
socket:Subscribe(
joinStr("socket.client.", NetProto.comanyId, ".", NetProto.loginNo, ".notice"),
NetProto.OnReceiveStompMsg
)
socket:Subscribe(
joinStr("socket.client.", NetProto.comanyId, ".", NetProto.loginNo, ".response"),
NetProto.OnReceiveStompMsg
)
if NetProto.isReconnect then
-- 说明是重连
NetProto.isReconnect = false
NetProto.reconnectTimes = 0
InvokeEx.invoke(NetProto.reSendWenConnected, 0.5)
else
dispatch({success = true}, {cmd = "connect"})
end
elseif frame.Code == StompStatus.MESSAGE then
local success, content = pcall(json.decode, frame.Content)
if not success then
printe(content)
return
end
if content then
local cmd = content.action
if not cmd then
local callbackKey = content.callbackId
if callbackKey then
local cbinfor = __callbackInfor[callbackKey]
if cbinfor then
local orgs = cbinfor[2]
cmd = orgs.action
end
end
end
2020-07-21 22:50:03 +08:00
2020-08-05 21:12:20 +08:00
if NetProto.isDebug then
2020-07-14 22:04:03 +08:00
printw(cmd, frame.Content)
end
2020-07-04 14:41:25 +08:00
if cmd then
doCallbackSocket(content)
dispatch(content, {cmd = cmd})
end
end
elseif frame.Code == StompStatus.ERROR then
elseif frame.Code == StompStatus.SERVERCLOSED then
dispatch({success = false}, {cmd = "connect"})
NetProto.reconnectSocket()
elseif frame.Code == StompStatus.SERVERERROR then
dispatch({success = false}, {cmd = "connect"})
NetProto.reconnectSocket()
end
end
NetProto.reconnectSocket = function()
socket:close()
InvokeEx.cancelInvoke(NetProto.doReconnectSocket)
InvokeEx.invoke(NetProto.doReconnectSocket, 1)
end
---public 重连socket服务器
NetProto.doReconnectSocket = function()
NetProto.reconnectTimes = NetProto.reconnectTimes or 0
NetProto.isReconnect = true
if NetProto.reconnectTimes > 1 then
2020-07-14 22:04:03 +08:00
NetProto.reconnectTimes = 0
2020-07-04 14:41:25 +08:00
-- 重连失败提示
CLUIUtl.showConfirm("服务器连接失败,请重试", NetProto.doReconnectSocket)
else
NetProto.reconnectTimes = NetProto.reconnectTimes + 1
socket:init(socketUrl, NetProto.OnReceiveStompMsg)
end
end
---public 重新发送数据
NetProto.reSendWenConnected = function()
local list = {}
for k, v in pairs(__callbackInfor) do
table.insert(list, v)
end
__callbackInfor = {}
for i, v in ipairs(list) do
local callback = v[1]
local content = v[2]
NetProto.sendSocket(content, callback)
end
end
NetProto.sendSocket = function(content, callback, timeOutSec)
if (content == nil) then
printe("发送信息不能为空")
return
end
content.operator = NetProto.loginNo
2020-07-08 08:01:34 +08:00
content.loginNo = content.loginNo or NetProto.loginNo
2020-07-04 14:41:25 +08:00
content.companyId = NetProto.comanyId
content.callbackId = setCallback(callback, content, timeOutSec)
local contentStr = json.encode(content)
2020-07-09 08:50:24 +08:00
NetProto.doSendMsg(contentStr)
2020-07-04 14:41:25 +08:00
end
NetProto.doSendMsg = function(contentStr)
2020-08-05 21:12:20 +08:00
if NetProto.isDebug then
2020-07-04 14:41:25 +08:00
print("send=", contentStr)
end
socket:Send("/tr_socket", {atytopic = "socket.server.operation"}, contentStr)
end
---public 取得系统公告
NetProto.send.announcement_query = function(callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.announcement_query
NetProto.sendSocket(content, callback, timeOutSec)
end
---public 待跟进客户
NetProto.send.booking_query = function(callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.booking_query
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
---public 待补货
NetProto.send.replenish_query = function(callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.replenish_query
NetProto.sendSocket(content, callback, timeOutSec)
end
---public 取得客户过滤条件
NetProto.send.filter_customers = function(callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.filter_customers
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.list_customers = function(filters, queryKey, page, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.list_customers
content.filters = filters
content.keywords = queryKey
content.current_page = page
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.person_view_query = function(callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.person_view_query
2020-07-08 08:01:34 +08:00
content.loginNo = NetProto.loginNo
2020-07-04 14:41:25 +08:00
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.bi_call = function(custId, phoneNo, loginNo, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.bi_call
content.custId = custId
content.phoneNo = phoneNo
content.loginNo = loginNo or NetProto.loginNo
2020-07-21 22:50:03 +08:00
content.appIP = CLUIFormUtl.GetMyIP(CLUIFormUtl.ADDRESSFAM.IPv4) -- 本机的ip地址
2020-07-04 14:41:25 +08:00
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.query_cust_calllog = function(phoneNo, loginNo, current_page, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.query_cust_calllog
content.groupId = NetProto.groupId
2020-07-08 08:01:34 +08:00
content.loginNo = loginNo or NetProto.loginNo
content.phoneNo = phoneNo
2020-07-04 14:41:25 +08:00
content.current_page = current_page or 1
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.sales_view_query = function(loginNo, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.sales_view_query
content.groupId = NetProto.groupId
2020-07-08 08:01:34 +08:00
content.loginNo = loginNo or NetProto.loginNo
2020-07-04 14:41:25 +08:00
NetProto.sendSocket(content, callback, timeOutSec)
end
---public 客户类型分布
NetProto.send.custtype_report = function(loginNo, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.custtype_report
content.groupId = NetProto.groupId
2020-07-08 08:01:34 +08:00
content.loginNo = loginNo or NetProto.loginNo
2020-07-04 14:41:25 +08:00
NetProto.sendSocket(content, callback, timeOutSec)
end
---public 客户类型分布
NetProto.send.order_report = function(loginNo, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.order_report
content.groupId = NetProto.groupId
2020-07-08 08:01:34 +08:00
content.loginNo = loginNo or NetProto.loginNo
2020-07-04 14:41:25 +08:00
NetProto.sendSocket(content, callback, timeOutSec)
end
---public 客户类型分布
NetProto.send.target_report = function(loginNo, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.target_report
content.groupId = NetProto.groupId
2020-07-08 08:01:34 +08:00
content.loginNo = loginNo or NetProto.loginNo
2020-07-04 14:41:25 +08:00
NetProto.sendSocket(content, callback, timeOutSec)
end
---public 更新客户信息
NetProto.send.update_customer = function(customer, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.update_customer
content.groupId = NetProto.groupId
content.customer = customer
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-07-08 08:01:34 +08:00
NetProto.send.save_customer = function(customer, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.save_customer
content.loginNo = NetProto.loginNo
content.groupId = NetProto.groupId
content.customer = customer
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-07-10 22:33:30 +08:00
NetProto.send.create_followUp_record = function(followUpRecordJson, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.create_followUp_record
2020-07-21 22:50:03 +08:00
followUpRecordJson.loginNo = NetProto.loginNo
2020-07-10 22:33:30 +08:00
followUpRecordJson.groupId = NetProto.groupId
2020-08-01 17:55:18 +08:00
followUpRecordJson.recordingTime = followUpRecordJson.recordingTime or DateEx.nowString()
2020-07-10 22:33:30 +08:00
content.followUpRecordJson = followUpRecordJson
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-07-11 20:53:21 +08:00
NetProto.send.load_wfTicket_Settings = function(callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.load_wfTicket_Settings
content.loginNo = NetProto.loginNo
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-07-14 22:04:03 +08:00
NetProto.send.selectProductInfo = function(searchKey, page, callback, timeOutSec)
2020-07-11 20:53:21 +08:00
local content = {}
content.action = NetProto.cmds.selectProductInfo
content.loginNo = NetProto.loginNo
content.groupId = NetProto.groupId
2020-07-28 21:02:59 +08:00
-- content.flag = 0
2020-07-14 22:04:03 +08:00
content.current_page = page
2020-07-28 21:02:59 +08:00
content.keywords = searchKey
2020-07-14 22:04:03 +08:00
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-08-06 22:56:33 +08:00
NetProto.send.createWfInfo = function(workFlowInfo, wfOptions, callback, timeOutSec)
2020-07-14 22:04:03 +08:00
local content = {}
content.action = NetProto.cmds.createWfInfo
local user = DBUser.getUserById(NetProto.loginNo)
content.wfStatus = "正常工单"
content.loginName = user.loginName
content.loginNo = NetProto.loginNo
content.groupId = NetProto.groupId
content.workFlowInfo = workFlowInfo
2020-08-06 22:56:33 +08:00
content.wfOptions = wfOptions
2020-07-11 20:53:21 +08:00
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-07-14 22:04:03 +08:00
2020-07-18 21:12:14 +08:00
NetProto.send.create_followUp_task = function(followUpTaskJson, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.create_followUp_task
content.followUpTaskJson = followUpTaskJson
content.followUpTaskJson.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-07-21 22:50:03 +08:00
NetProto.send.list_followUp_records = function(filters, queryKey, page, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.list_followUp_records
content.filters = filters
content.keywords = queryKey
content.current_page = page
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-07-24 22:12:55 +08:00
NetProto.send.workFlowQuery = function(filters, queryKey, page, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.workFlowQuery
content.groupId = NetProto.groupId
content.filters = filters
content.keywords = queryKey
content.current_page = page
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-07-28 21:02:59 +08:00
NetProto.send.backToGH = function(ids, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.backToGH
content.groupId = NetProto.groupId
content.ids = ids
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.delCustomerInfo = function(ids, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.delCustomerInfo
content.groupId = NetProto.groupId
content.ids = ids
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.loadProductType = function(callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.loadProductType
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.pageGHQueryList = function(filters, queryKey, page, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.pageGHQueryList
content.groupId = NetProto.groupId
content.filters = filters
content.keywords = queryKey
content.current_page = page
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-08-01 17:55:18 +08:00
NetProto.send.getFromGH = function(content, callback, timeOutSec)
content = content or {}
content.action = NetProto.cmds.getFromGH
content.groupId = NetProto.groupId
-- content.ids = ids
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.list_followUp_tasks = function(filters, queryKey, page, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.list_followUp_tasks
content.groupId = NetProto.groupId
content.filters = filters
content.keywords = queryKey
content.current_page = page
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.personal_data_query = function(callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.personal_data_query
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.updateUserInfo = function(content, callback, timeOutSec)
content = content or {}
content.action = NetProto.cmds.updateUserInfo
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.updateUserPhone = function(content, callback, timeOutSec)
content = content or {}
content.action = NetProto.cmds.updateUserPhone
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.get_customerById = function(custId, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.get_customerById
content.custId = custId
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.readNotice = function(id, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.readNotice
content.id = id
content.groupId = NetProto.groupId
NetProto.sendSocket(content, callback, timeOutSec)
end
2020-07-04 14:41:25 +08:00
------------------------------------------------------
return NetProto