Commit e05d23d6 authored by 周尚's avatar 周尚

perfect the README doc

parent 0967cc16
* 项目说明
使用 /openresty(nginx+)/ 框架搭建服务器, 主要针对 *异步非阻* 场景, 使用 ~lua~ 开发功能支持模块
* 主要功能
详见 [[file:nginx/lua/luabiz/README.org::*%E6%A8%A1%E5%9D%97%E8%AF%B4%E6%98%8E][模块说明]]
使用 [[https://github.com/openresty/openresty][openresty]] 框架, 业务功能使用 ~ngx_lua~ 开发
* 项目地址
** 测试
192.168.254.7:/root/www/openresty
** 生产
121.196.219.142:/root/www/openresty
* 日志
- 使用 =syslog-ng= 模块
- 当前路径 ~/var/log/ngx~
- 配置文件 ~/etc/syslog-ng/syslog-ng.conf~
* 业务功能
** 业务清单
*** 唐库6.0
1. [X] 唐库 6.0 异步通知
*** 唐库7.0
1. [-] 业务批处理
1. [X] 库存信息类
1. [X] 门店库存
......@@ -45,3 +46,5 @@
1. [X] 门店信息
2. [X] 款台信息
3. [X] 门店汇总
** 业务代码
详见 [[file:nginx/lua/luabiz/README.org::*%E6%A8%A1%E5%9D%97%E8%AF%B4%E6%98%8E][模块说明]]
* 代码依赖
- [[https://github.com/cloudflare/lua-resty-logger-socket][lua-resty-logger-socket]]
- =syslog-ng=
* 模块说明
| 文件名 | 说明 |
|---------------+----------------------------|
| ~zx_base.lua~ | 基础支持 |
|---------------+----------------------------|
| ~async.lua~ | 唐库6.0 异步通知功能模块 |
|---------------+----------------------------|
| ~sync.lua~ | 唐库7.0 总控-节点 同步模块 |
| ~check.lua~ | 唐库7.0 通用字段校验 |
| ~settle.lua~ | 批处理业务 |
| 文件名 | 说明 |
|-------------------+----------------------------|
| ~init.lua~ | 初始化模块 |
| ~mods.lua~ | 模块加载 |
| ~db_conf.lua~ | 数据库配置 |
|-------------------+----------------------------|
| ~zx_base.lua~ | 基础支持 |
|-------------------+----------------------------|
| ~async.lua~ | 唐库6.0 异步通知功能模块 |
|-------------------+----------------------------|
| ~settle.lua~ | 批处理业务 |
| ~node_card.lua~ | 卡表批处理 |
| ~node_ticket.lua~ | 券表批处理 |
| ~tk_sdt.lua~ | 门店日统计 |
| ~tk_sync.lua~ | 唐库7.0 总控-节点 同步模块 |
......@@ -97,24 +97,22 @@ local function sdt_sql(tk_biz, tk_control, total_time)
for i=1, #shops do
local shop = shops[i]
local sql = {}
local res
while true do
local shop
local sql = {}
local res
shop = shops[i]
-- CHECK if exists
local sql_check = string.format(
[[SELECT * FROM tk_sdt WHERE DATE(total_date) = DATE('%s') ]]..
[[AND shop_map_id = %s ]],
os.date('%Y%m%d',total_time),
os.date('%Y%m%d', total_time),
tostring(shop.shop_map_id))
res, err, errcode, sqlstate = db_biz:query(sql_check)
log_lua:log(log_lua:__FILE__() .. ":" .. log_lua:__LINE__(), "NOTICE: " .. sql_check)
if not res then
log_lua:log(log_lua:__FILE__() .. ":" .. log_lua:__LINE__(), "ERR: " .. "failed to connect:", json.encode(tk_biz),
":", err, ":", errcode, ":", sqlstate, ".")
log_lua:log(log_lua:__FILE__() .. ":" .. log_lua:__LINE__(), "ERR: " .. sql_check)
return
end
if #res ~= 0 then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment