From b84bd7e16fe2287f7f608355d0bb7fac3c4b7890 Mon Sep 17 00:00:00 2001 From: hoteas Date: Mon, 27 Dec 2021 14:09:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/config/app.json | 1081 +++++++++++++++++++++++++++++++++++- example/config/config.json | 5 +- example/main.go | 51 +- 3 files changed, 1082 insertions(+), 55 deletions(-) diff --git a/example/config/app.json b/example/config/app.json index 2c054c2..24dc91d 100644 --- a/example/config/app.json +++ b/example/config/app.json @@ -23,6 +23,18 @@ "label": "消耗原材料", "table": "produce_material" }, + { + "label": "生产计划", + "table": "produce" + }, + { + "label": "生产计划", + "table": "produce" + }, + { + "label": "生产计划", + "table": "produce" + }, { "label": "生产计划", "table": "produce" @@ -57,6 +69,14 @@ { "label": "炉温监控", "table": "furnace_temperature" + }, + { + "label": "排号计划", + "table": "ctg_order_date" + }, + { + "label": "预约订单", + "table": "order" } ], "name": "sys" @@ -81,6 +101,18 @@ "label": "产线管理", "table": "product_line" }, + { + "label": "成品管理", + "table": "product" + }, + { + "label": "成品管理", + "table": "product" + }, + { + "label": "成品管理", + "table": "product" + }, { "label": "成品管理", "table": "product" @@ -100,12 +132,47 @@ "label": "出入库管理", "table": "material_inout" }, + { + "label": "原材料管理", + "table": "material" + }, + { + "label": "原材料管理", + "table": "material" + }, + { + "label": "原材料管理", + "table": "material" + }, { "label": "原材料管理", "table": "material" } ], "name": "sys:material" + }, + { + "icon": "el-icon-setting", + "label": "办理订单", + "menus": [ + { + "label": "办理订单", + "table": "matter_order" + }, + { + "label": "办理事项", + "table": "matter" + }, + { + "label": "办理事项", + "table": "matter" + }, + { + "label": "办理事项", + "table": "matter" + } + ], + "name": "sys:matter" } ], "name": "admin", @@ -366,6 +433,125 @@ "name": "index", "notUse": true, "type": "index" + }, + { + "label": "周一上午", + "name": "am1", + "sortable": true, + "type": "number" + }, + { + "label": "周二上午", + "name": "am2", + "sortable": true, + "type": "number" + }, + { + "label": "周三上午", + "name": "am3", + "sortable": true, + "type": "number" + }, + { + "label": "周四上午", + "name": "am4", + "sortable": true, + "type": "number" + }, + { + "label": "周五上午", + "name": "am5", + "sortable": true, + "type": "number" + }, + { + "label": "周一下午", + "name": "pm1", + "sortable": true, + "type": "number" + }, + { + "label": "周二下午", + "name": "pm2", + "sortable": true, + "type": "number" + }, + { + "label": "周三下午", + "name": "pm3", + "sortable": true, + "type": "number" + }, + { + "label": "周四下午", + "name": "pm4", + "sortable": true, + "type": "number" + }, + { + "label": "周五下午", + "name": "pm5", + "sortable": true, + "type": "number" + }, + { + "label": "办理地址", + "list": false, + "must": false, + "name": "address", + "type": "text" + }, + { + "label": "叫号起始号", + "name": "startnum", + "sortable": true, + "type": "number" + }, + { + "label": "办理窗口", + "name": "window", + "type": "text" + }, + { + "label": "天府通办APP端", + "must": true, + "name": "tftbapp", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + } + ], + "sortable": true, + "type": "select" + }, + { + "label": "天府通办web端", + "must": true, + "name": "tftbweb", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + } + ], + "sortable": true, + "type": "select" + }, + { + "label": "图标", + "list": false, + "must": false, + "name": "icon", + "type": "image" } ], "label": "事项管理", @@ -427,10 +613,202 @@ "name": "org_id", "type": "tree", "value": "name" + }, + { + "label": "天府通办APP端", + "must": true, + "name": "tftbapp", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null + }, + { + "label": "天府通办web端", + "must": true, + "name": "tftbweb", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null } ], "table": "category" }, + "ctg_order_date": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "名称", + "name": "name", + "type": "text" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "预约日期", + "name": "date", + "type": "time" + }, + { + "label": "排号起始数", + "name": "start_sn", + "sortable": true, + "type": "number" + }, + { + "label": "排号结束号", + "name": "max_sn", + "sortable": true, + "type": "number" + }, + { + "label": "当前排号", + "name": "now_sn", + "sortable": true, + "type": "number" + }, + { + "label": "类别", + "link": "category", + "name": "category_id", + "sortable": true, + "type": "number", + "value": "name" + } + ], + "label": "排号计划", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "类别", + "link": "category", + "name": "category_id", + "type": "tree", + "value": "name" + } + ], + "table": "ctg_order_date" + }, "furnace_temperature": { "auth": [ "add", @@ -965,6 +1343,700 @@ ], "table": "material_inout" }, + "matter": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "办理地址", + "list": false, + "must": false, + "name": "address", + "type": "text" + }, + { + "label": "业务名称", + "name": "name", + "type": "text" + }, + { + "label": "排序 序号越大越排前面", + "list": false, + "must": false, + "name": "sort", + "sortable": true, + "type": "number" + }, + { + "label": "归属专区", + "link": "matter", + "must": false, + "name": "parent_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "创建人员", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "天府通办APP端", + "must": true, + "name": "tftbapp", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + } + ], + "sortable": true, + "type": "select" + }, + { + "label": "天府通办web端", + "must": true, + "name": "tftbweb", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + } + ], + "sortable": true, + "type": "select" + }, + { + "label": "图标", + "list": false, + "must": false, + "name": "icon", + "type": "image" + }, + { + "label": "关联部门", + "link": "org", + "name": "org_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "info": false, + "label": "索引", + "list": false, + "must": false, + "name": "index", + "notUse": true, + "type": "index" + }, + { + "label": "表单", + "list": false, + "must": false, + "name": "rule", + "type": "form" + } + ], + "label": "办理事项", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "天府通办APP端", + "must": true, + "name": "tftbapp", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null + }, + { + "label": "天府通办web端", + "must": true, + "name": "tftbweb", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "归属专区", + "link": "matter", + "name": "parent_id", + "type": "tree", + "value": "name" + }, + { + "label": "关联部门", + "link": "org", + "name": "org_id", + "type": "tree", + "value": "name" + } + ], + "table": "matter" + }, + "matter_order": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "办理事项", + "name": "name", + "type": "text" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "办理用户", + "link": "user", + "name": "user_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "办结时间", + "name": "finish_time", + "type": "time" + }, + { + "label": "办理事项", + "link": "matter", + "name": "matter_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "办理状态", + "must": true, + "name": "status", + "options": [ + { + "name": "待分配", + "value": "0" + }, + { + "name": "待办结", + "value": "1" + }, + { + "name": "已办结", + "value": "2" + }, + { + "name": "已逾期", + "value": "3" + }, + { + "name": "异常", + "value": "4" + } + ], + "type": "select" + }, + { + "label": "办事员", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "表单信息", + "list": false, + "must": false, + "name": "rule", + "type": "form" + } + ], + "label": "办理订单", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "办理状态", + "must": true, + "name": "status", + "options": [ + { + "name": "待分配", + "value": "0" + }, + { + "name": "待办结", + "value": "1" + }, + { + "name": "已办结", + "value": "2" + }, + { + "name": "已逾期", + "value": "3" + }, + { + "name": "异常", + "value": "4" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "办理事项", + "link": "matter", + "name": "matter_id", + "type": "tree", + "value": "name" + } + ], + "table": "matter_order" + }, + "order": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "预约时间", + "name": "name", + "type": "text" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "预约用户", + "link": "user", + "name": "user_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "预约日期", + "name": "date", + "type": "time" + }, + { + "label": "排号", + "name": "sn", + "sortable": true, + "type": "number" + }, + { + "label": "预约分类", + "link": "category", + "name": "category_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "预约状态", + "must": true, + "name": "status", + "options": [ + { + "name": "待分配", + "value": "0" + }, + { + "name": "待办结", + "value": "1" + }, + { + "name": "已办结", + "value": "2" + }, + { + "name": "已逾期", + "value": "3" + }, + { + "name": "异常", + "value": "4" + } + ], + "type": "select" + }, + { + "label": "办事员", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + } + ], + "label": "预约订单", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "预约状态", + "must": true, + "name": "status", + "options": [ + { + "name": "待分配", + "value": "0" + }, + { + "name": "待办结", + "value": "1" + }, + { + "name": "已办结", + "value": "2" + }, + { + "name": "已逾期", + "value": "3" + }, + { + "name": "异常", + "value": "4" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "预约分类", + "link": "category", + "name": "category_id", + "type": "tree", + "value": "name" + } + ], + "table": "order" + }, "org": { "auth": [ "add", @@ -2418,6 +3490,13 @@ "must": false, "name": "modify_time", "type": "time" + }, + { + "label": "身份证号", + "list": false, + "must": false, + "name": "idcard", + "type": "text" } ], "label": "客户管理", @@ -2470,4 +3549,4 @@ "table": "user" } } -} +} \ No newline at end of file diff --git a/example/config/config.json b/example/config/config.json index f8ee783..0e31e49 100644 --- a/example/config/config.json +++ b/example/config/config.json @@ -24,7 +24,7 @@ "db": { "mysql": { "host": "192.168.6.253", - "name": "bzyyweb", + "name": "myhs", "password": "dasda8454456", "port": "3306", "prefix": "", @@ -45,8 +45,5 @@ "mode": 2, "port": "8080", "sessionName": "HOTIME", - "smsKey": "b0eb4bf0198b9983cffcb85b69fdf4fa", - "smsLogin": "【恩易办】您的验证码为:{code},请在5分钟内使用,切勿将验证码泄露于他人,如非本人操作请忽略。", - "smsNotice": "【恩易办】你收到一条新的预约事项,{name}预约办理{ctg}事项,预约办理时间:{date},排号:{sn}。", "tpt": "tpt" } \ No newline at end of file diff --git a/example/main.go b/example/main.go index 6238a78..c11b09e 100644 --- a/example/main.go +++ b/example/main.go @@ -263,55 +263,6 @@ func main() { appIns.Run(hotime.Router{ "admin": admin.Project, "app": app.Project, - //"app": hotime.Proj{ - // "index": hotime.Ctr{ - // "test": func(this *hotime.Context) { - // - // data := this.Db.Get("cached", "*") - // fmt.Println(data) - // fmt.Println(this.Session("test").ToCeilInt()) - // this.Session("test1", 98984984) - // fmt.Println(this.Session("test1").Data) - // this.Error.SetError(errors.New("dasdasdas")) - // //fmt.Println(this.Db.GetTag()) - // //this.Application.Log.Error("dasdasdas") - // //this.Log.Error("dadasdasd") - // //x:=this.Db.Action(func(db hotime.HoTimeDB) bool { - // // - // // db.Insert("user",hotime.Map{"unickname":"dasdas"}) - // // - // // return true - // //}) - // //hotime.LogError("dasdasdasdasdas") - // this.Display(5, "dsadas") - // }, - // "websocket": func(this *hotime.Context) { - // hdler := websocket.Handler(func(ws *websocket.Conn) { - // for true { - // msg := make([]byte, 5120) - // n, err := ws.Read(msg) - // go func() { - // time.Sleep(time.Second * 5) - // ws.Write([]byte("dsadasdasgregergrerge")) - // - // }() - // if err != nil { - // return - // } - // fmt.Printf("Receive: %s\n", msg[:n]) - // - // send_msg := "[" + string(msg[:n]) + "]" - // m, err := ws.Write([]byte(send_msg)) - // if err != nil { - // return - // } - // fmt.Printf("Send: %s\n", msg[:m]) - // } - // }) - // hdler.ServeHTTP(this.Resp, this.Req) - // }, - // }, - //}, }) } func Process(conn net.Conn, appIns *hotime.Application) { @@ -353,7 +304,7 @@ func Process(conn net.Conn, appIns *hotime.Application) { } } - oldSn := appIns.Db.Get("produce_product", "id", common.Map{"sn": sn, "produce_id": produce.GetCeilInt("id")}) + oldSn := appIns.Db.Get("produce_product", "id", common.Map{"AND": common.Map{"sn": sn, "produce_id": produce.GetCeilInt("id")}}) if oldSn != nil { fmt.Println(client, sn, "已经添加请勿重复添加") // 读到了n个数据 continue