mirror of
https://shylinux.com/x/community
synced 2025-04-25 17:48:06 +08:00
add some
This commit is contained in:
parent
1e9a95ae42
commit
e7b7d7bb0a
@ -189,6 +189,9 @@ func newTables() Tables {
|
||||
func newTable() Table {
|
||||
return Table{UserPlace: userPlace{}, Place: place{}, Street: street{}}
|
||||
}
|
||||
func NewTables(userPlace, place Tabler, street Container) Tables {
|
||||
return Tables{Table: NewTable(userPlace, place, street)}
|
||||
}
|
||||
func NewTable(userPlace, place Tabler, street Container) Table {
|
||||
return Table{UserPlace: userPlace, Place: place, Street: street}
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ $output>div.list>div.title { font-weight:bold; display:flex; align-items:center;
|
||||
$output>div.list>div.title span:first-child { flex-grow:1; }
|
||||
$output>div.list>div.title div.action div.item { margin-right:5px; }
|
||||
$output>div.list>div.title div.action div.item.button.icons input { display:none; }
|
||||
$output>div.list>div.role:not(.hide) { display:flex; align-items:center; justify-content:space-around; }
|
||||
$output>div.list>div.role span { padding:5px; cursor:pointer; }
|
||||
$output>div.list>div.role span.select { border-bottom:var(--box-notice3); }
|
||||
$output>div.list>div.item.index { padding:10px; display:flex; flex-direction:column; align-items:center; float:left; }
|
||||
$output>div.list>div.item.index.hide { display:none; }
|
||||
$output>div.list>div.item.index img { width:100%; }
|
||||
|
@ -17,6 +17,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
},
|
||||
myPortal: function(can, msg) {
|
||||
var PLACE_UID = msg.Option("_place_uid"), PLACE_NAME = msg.Option("_place_name"), PLACE_TYPE = msg.Option("_place_type")
|
||||
var USER_PLACE_ROLE = msg.Option("_user_place_role"), STREET_NAME = msg.Option("_street_name")
|
||||
can.isCmdMode() && (can.db.hash = can.misc.SearchHash(can)), can.db.hash[0] && can.onexport.session(can, PLACE_UID, can.db.hash[0])
|
||||
if (can.Option(PLACE_UID) == "") {
|
||||
if (can.db.hash.length > 1 && can.db.hash[0]) { return can.Option(PLACE_UID, can.db.hash[0]), can.Option(ctx.INDEX, can.db.hash[1]), can.Update() }
|
||||
@ -28,7 +29,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
var uid = can.onimport.myPlace(can, msg, can.ui.myplace, PLACE_UID, PLACE_NAME, PLACE_TYPE)
|
||||
msg.Length() > 0 && can.run({}, [uid], function(msg) {
|
||||
can.page.Append(can, can.ui.myindex, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Index", "我的应用")}]}])
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex, PLACE_UID), can.onimport.selectIndex(can, can.sup.current)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex, PLACE_UID, USER_PLACE_ROLE), can.onimport.selectIndex(can, can.sup.current)
|
||||
})
|
||||
} else {
|
||||
can.onimport.myData(can, msg, can._output, PLACE_UID, PLACE_NAME)
|
||||
@ -51,8 +52,14 @@ Volcanos(chat.ONIMPORT, {
|
||||
can.page.Append(can, target, [{view: html.ACTION, _init: function(target) { can.onappend._action(can, msg.Option(ice.MSG_ACTION), target) }}])
|
||||
return place_uid
|
||||
},
|
||||
myIndex: function(can, msg, target, PLACE_UID) {
|
||||
myIndex: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
|
||||
var width = (can.ConfWidth()-40)/parseInt((can.ConfWidth()-40)/100), height = width+20; can.user.isMobile && !can.user.isLandscape() && (width = (can.ConfWidth()-40)/4, height = width+20)
|
||||
var role = can.page.Append(can, target, [{view: aaa.ROLE, list: can.core.Item(can.Conf("_trans.value."+USER_PLACE_ROLE), function(key, value) {
|
||||
return {text: [value, "", key], onclick: function(event) {
|
||||
can.onimport.selectIndex(can, can.sup.current, key)
|
||||
can.onmotion.select(can, role, html.SPAN, event.target)
|
||||
}}
|
||||
}) }])._target; can.ui.role = role
|
||||
can.page.Append(can, target||can._output, msg.Table(function(value) {
|
||||
// if (value.enable != ice.TRUE) { return }
|
||||
return {view: [[html.ITEM, ctx.INDEX].concat(
|
||||
@ -66,12 +73,14 @@ Volcanos(chat.ONIMPORT, {
|
||||
}}
|
||||
}))
|
||||
},
|
||||
selectIndex: function(can, value) {
|
||||
selectIndex: function(can, value, role) { role = role||value._role
|
||||
can.ui.role && can.onmotion.toggle(can, can.ui.role, value._role == "creator")
|
||||
can.ui.role && can.onmotion.select(can, can.ui.role, html.SPAN, can.page.SelectOne(can, can.ui.role, "span."+role))
|
||||
can.page.Select(can, can.ui.myindex, html.DIV_ITEM, function(target) {
|
||||
var list = target.className.split(" ")
|
||||
if (list.indexOf(mdb.TYPE) > -1 && list.indexOf(value._type) == -1) {
|
||||
can.onmotion.toggle(can, target, false)
|
||||
} else if (list.indexOf(aaa.ROLE) > -1 && list.indexOf(value._role) == -1) {
|
||||
} else if (list.indexOf(aaa.ROLE) > -1 && list.indexOf(role) == -1) {
|
||||
can.onmotion.toggle(can, target, false)
|
||||
} else {
|
||||
can.onmotion.toggle(can, target, true)
|
||||
|
@ -1,9 +1,11 @@
|
||||
chapter "公安系统"
|
||||
refer `
|
||||
公众号 https://mp.weixin.qq.com/cgi-bin/home?t=home/index&lang=zh_CN&token=494166701
|
||||
ICON https://igoutu.cn/icons/officel
|
||||
GORM https://gorm.io/docs/indexes.html
|
||||
`
|
||||
field web.chat.wx.access
|
||||
field web.chat.wx.menu
|
||||
field web.code.mysql.client
|
||||
field web.code.mysql.query args `mysql gonganxitong`
|
||||
field web.code.db.database
|
||||
|
@ -9,35 +9,33 @@ import (
|
||||
|
||||
type call struct {
|
||||
Tables
|
||||
queue queue
|
||||
schedule schedule
|
||||
reception reception
|
||||
call string `name:"call" role:"void"`
|
||||
call string `name:"call" help:"叫号" role:"void"`
|
||||
expire string `name:"expire" role:"void"`
|
||||
finish string `name:"finish" role:"void"`
|
||||
list string `name:"list queue_uid uid reception_uid auto"`
|
||||
}
|
||||
|
||||
func (s call) Call(m *ice.Message, arg ...string) {
|
||||
if !m.WarnNotRight(!s.CheckRole(m, UserQueueCreator, UserQueueServer)) {
|
||||
m.Cmdy(s.schedule, s.schedule.Call)
|
||||
m.PushAction(s.Expire, s.Finish)
|
||||
if s.CheckRole(m, UserQueueCreator, UserQueueServer) {
|
||||
m.Cmdy(s.schedule, s.schedule.Call).PushAction(s.Expire, s.Finish)
|
||||
}
|
||||
}
|
||||
func (s call) Expire(m *ice.Message, arg ...string) {
|
||||
if !m.WarnNotRight(!s.CheckRole(m, UserQueueCreator, UserQueueServer)) {
|
||||
m.Cmdy(s.schedule, s.schedule.Expire)
|
||||
m.ProcessRefresh()
|
||||
if s.CheckRole(m, UserQueueCreator, UserQueueServer) {
|
||||
m.Cmdy(s.schedule, s.schedule.Expire).ProcessRefresh()
|
||||
}
|
||||
}
|
||||
func (s call) Finish(m *ice.Message, arg ...string) {
|
||||
if !m.WarnNotRight(!s.CheckRole(m, UserQueueCreator, UserQueueServer)) {
|
||||
m.Cmdy(s.schedule, s.schedule.Finish)
|
||||
m.ProcessRefresh()
|
||||
if s.CheckRole(m, UserQueueCreator, UserQueueServer) {
|
||||
m.Cmdy(s.schedule, s.schedule.Finish).ProcessRefresh()
|
||||
}
|
||||
}
|
||||
func (s call) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
m.Cmdy(s.schedule, s.schedule.SelectByStatus, arg[0], ScheduleTake).PushAction().Action(s.Call)
|
||||
m.Cmdy(s.schedule, s.schedule.SelectByStatus, arg[0], ScheduleTake).Action(s.Call)
|
||||
kit.If(m.Length() == 0, func() { m.Echo(m.Trans("not found order", "没有等待")) })
|
||||
} else if len(arg) == 2 {
|
||||
m.Cmdy(s.schedule, arg[0], arg[1]).Table(func(value ice.Maps) {
|
||||
@ -48,8 +46,8 @@ func (s call) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
}).Action(s.Call)
|
||||
} else if len(arg) == 3 {
|
||||
m.Cmdy(s.schedule, s.Select, model.QUEUE_UID, arg[0], model.STATUS, ScheduleTake, model.RECEPTION_UID, arg[2]).PushAction().Action(s.Call)
|
||||
m.Cmdy(s.schedule, s.Select, model.QUEUE_UID, arg[0], model.RECEPTION_UID, arg[2], model.STATUS, ScheduleTake).PushAction().Action(s.Call)
|
||||
}
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(call{}) }
|
||||
func init() { ice.TeamCtxCmd(call{Tables: newTables()}) }
|
||||
|
@ -19,6 +19,12 @@ func (s Tables) CheckRole(m *ice.Message, arg ...UserQueueRole) bool {
|
||||
func (s Tables) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
return Table{}.RewriteAppend(m, arg...)
|
||||
}
|
||||
func newTables() Tables {
|
||||
return Tables{Tables: guanlixitong.NewTables(userQueue{}, queue{})}
|
||||
}
|
||||
func newTable() Table {
|
||||
return Table{Table: guanlixitong.NewTable(userQueue{}, queue{})}
|
||||
}
|
||||
|
||||
type Table struct {
|
||||
guanlixitong.Table
|
||||
@ -51,6 +57,7 @@ func (s Table) CheckRole(m *ice.Message, arg ...UserQueueRole) bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
m.WarnNotRight(true, role.String())
|
||||
return false
|
||||
}
|
||||
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
|
@ -1,8 +1,6 @@
|
||||
package yuehaoxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
)
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type history struct {
|
||||
Tables
|
||||
|
@ -17,6 +17,7 @@ const (
|
||||
QUEUE_TYPE = "queue_type"
|
||||
RECEPTION_UID = "reception_uid"
|
||||
RECEPTION_NAME = "reception_name"
|
||||
VOLUME_UID = "volume_uid"
|
||||
SCHEDULE_UID = "schedule_uid"
|
||||
SCHEDULE_STATUS = "schedule_status"
|
||||
COMPANY_UID = "company_uid"
|
||||
@ -67,6 +68,7 @@ type Schedule struct {
|
||||
CancelTime db.Time
|
||||
TakeTime db.Time
|
||||
CallTime db.Time
|
||||
ExpireTime db.Time
|
||||
FinishTime db.Time
|
||||
Status uint8
|
||||
}
|
||||
|
@ -9,22 +9,18 @@ import (
|
||||
type open struct {
|
||||
Tables
|
||||
volume volume
|
||||
create string `name:"plan reception_uid* amount* begin_time@date end_time@date" role:"void"`
|
||||
create string `name:"plan reception_uid*:select amount* begin_time:select@date end_time:select@date" role:"void"`
|
||||
}
|
||||
|
||||
func (s open) Create(m *ice.Message, arg ...string) {
|
||||
if !m.WarnNotRight(!s.CheckRole(m)) {
|
||||
m.Cmd(s.volume, s.Create, arg, m.OptionSimple(model.QUEUE_UID))
|
||||
m.Cmd(s.volume, s.Create, arg, m.OptionSimple(model.QUEUE_UID), model.COUNT, "0")
|
||||
}
|
||||
}
|
||||
func (s open) List(m *ice.Message, arg ...string) {
|
||||
if !m.WarnNotRight(!s.CheckRole(m.Options(model.QUEUE_UID, arg[0]))) {
|
||||
m.Cmdy(s.volume, arg)
|
||||
if m.Length() == 0 {
|
||||
m.SetResult()
|
||||
if m.Cmdy(s.volume, arg); m.Length() == 0 {
|
||||
m.EchoInfoButton(m.Trans("please create open", "请创建放号"), s.Create)
|
||||
} else {
|
||||
m.Action(s.Create)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,21 +9,29 @@ import (
|
||||
|
||||
type plan struct {
|
||||
Tables
|
||||
volume volume
|
||||
schedule schedule
|
||||
create string `name:"create reception_uid* volume_uid*" role:"void"`
|
||||
cancel string `name:"cancel" role:"void"`
|
||||
queue queue
|
||||
volume volume
|
||||
schedule schedule
|
||||
reception reception
|
||||
create string `name:"create reception_uid*:select volume_uid*:select" role:"void"`
|
||||
cancel string `name:"cancel" role:"void"`
|
||||
}
|
||||
|
||||
func (s plan) Create(m *ice.Message, arg ...string) {
|
||||
m.Cmd(s.schedule, s.Create, arg, m.OptionSimple(model.QUEUE_UID, model.USER_UID), model.STATUS, SchedulePlan)
|
||||
}
|
||||
func (s plan) Cancel(m *ice.Message, arg ...string) {
|
||||
m.Cmd(s.schedule, s.Cancel)
|
||||
m.Cmdy(s.schedule, s.Create, arg, m.OptionSimple(model.QUEUE_UID, model.USER_UID), model.STATUS, SchedulePlan)
|
||||
m.Option(model.UID, m.Result())
|
||||
}
|
||||
func (s plan) List(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.schedule, s.schedule.SelectByStatus, arg[0], SchedulePlan, m.OptionSimple(model.USER_UID)).PushAction(s.Cancel)
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton(m.Trans("please create schedule", "请创建预约"), s.Create) })
|
||||
if len(arg) == 1 {
|
||||
m.Cmdy(s.schedule, s.schedule.SelectByStatus, arg[0], SchedulePlan, m.OptionSimple(model.USER_UID)).PushAction(s.Cancel)
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton(m.Trans("please create schedule", "请创建预约"), s.Create) }, func() { m.Action(s.Create) })
|
||||
} else if len(arg) == 2 {
|
||||
m.FieldsSetDetail()
|
||||
m.Cmdy(s.schedule, s.schedule.SelectByStatus, arg[0], SchedulePlan, m.OptionSimple(model.USER_UID), s.Key(s.schedule, model.UID), arg[1]).PushAction(s.Cancel)
|
||||
}
|
||||
}
|
||||
func (s plan) Cancel(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.schedule, s.Cancel)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(plan{}) }
|
||||
func init() { ice.TeamCtxCmd(plan{Tables: newTables()}) }
|
||||
|
@ -2,6 +2,7 @@
|
||||
"portal": "约号系统",
|
||||
"placeCreate": "创建场景",
|
||||
"placeRemove": "删除场景",
|
||||
"queueUser": "服务用户",
|
||||
"reception": "服务接待",
|
||||
"volume": "服务计划",
|
||||
"schedule": "订单数据",
|
||||
@ -13,6 +14,7 @@
|
||||
"expire": "过号",
|
||||
"finish": "完成",
|
||||
"icons": {
|
||||
"queueUser": "https://img.icons8.com/officel/80/person-at-home.png",
|
||||
"reception": "https://img.icons8.com/officel/80/meeting-room.png",
|
||||
"volume": "https://img.icons8.com/officel/80/combo-chart.png",
|
||||
"schedule": "https://img.icons8.com/officel/80/List-of-parts.png",
|
||||
@ -35,10 +37,10 @@
|
||||
"reception_name": "服务接待",
|
||||
"volume_uid": "服务时间",
|
||||
"schedule_status": "订单状态",
|
||||
"amount": "放号总量",
|
||||
"count": "约号数量",
|
||||
"take_time": "取号时间",
|
||||
"call_time": "叫号时间"
|
||||
"call_time": "叫号时间",
|
||||
"amount": "放号总量",
|
||||
"count": "约号数量"
|
||||
},
|
||||
"value": {
|
||||
"schedule_status": {
|
||||
|
14
src/yuehaoxitong/queueUser.go
Normal file
14
src/yuehaoxitong/queueUser.go
Normal file
@ -0,0 +1,14 @@
|
||||
package yuehaoxitong
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type queueUser struct {
|
||||
Tables
|
||||
userQueue userQueue
|
||||
}
|
||||
|
||||
func (s queueUser) List(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.userQueue, s.userQueue.User, arg)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(queueUser{}) }
|
@ -25,13 +25,13 @@ func (s reception) Create(m *ice.Message, arg ...string) {
|
||||
}
|
||||
func (s reception) Rename(m *ice.Message, arg ...string) {
|
||||
if !m.WarnNotRight(!s.CheckRole(m)) {
|
||||
s.Table.Rename(m.Spawn())
|
||||
s.Table.Rename(m.Spawn()).ProcessRefresh()
|
||||
s.RecordEvent(m, m.Option(model.QUEUE_UID), kit.Format(m.Trans("rename reception %s", "重命名服务接待 %s"), m.Option(mdb.NAME)), arg...)
|
||||
}
|
||||
}
|
||||
func (s reception) Delete(m *ice.Message, arg ...string) {
|
||||
if !m.WarnNotRight(!s.CheckRole(m)) {
|
||||
s.Table.Delete(m.Spawn(), m.OptionSimple(model.UID)...)
|
||||
s.Table.Delete(m, m.OptionSimple(model.UID)...).ProcessRefresh()
|
||||
s.RecordEvent(m, m.Option(model.QUEUE_UID), kit.Format(m.Trans("delete reception %s", "删除服务接待 %s"), m.Option(mdb.NAME)), arg...)
|
||||
}
|
||||
}
|
||||
|
@ -11,15 +11,25 @@ type schedule struct {
|
||||
Table
|
||||
queue queue
|
||||
userQueue userQueue
|
||||
volume volume
|
||||
reception reception
|
||||
volume volume
|
||||
portal string `data:"true"`
|
||||
plan string `name:"plan begin_time@date end_time@date"`
|
||||
}
|
||||
|
||||
func (s schedule) Plan(m *ice.Message, arg ...string) {
|
||||
arg = kit.TransArgValueTime(arg, model.BEGIN_TIME, model.END_TIME)
|
||||
s.Table.Create(m, append(arg, m.OptionSimple(model.QUEUE_UID, model.USER_UID)...)...)
|
||||
func (s schedule) Create(m *ice.Message, arg ...string) {
|
||||
s.Transaction(m, func() {
|
||||
msg := m.Cmd(s.volume, s.SelectForUpdate, model.UID, m.Option(model.VOLUME_UID))
|
||||
if m.Warn(kit.Int(msg.Append(model.COUNT)) >= kit.Int(msg.Append(model.AMOUNT)), "本服务已约满") {
|
||||
return
|
||||
}
|
||||
m.Cmd(s.volume, s.AddCount, m.Option(model.VOLUME_UID), "1")
|
||||
s.Table.Create(m, arg...)
|
||||
})
|
||||
if !m.IsErr() {
|
||||
m.Option(model.UID, m.Result())
|
||||
s.SendTemplate(m, "约号成功")
|
||||
}
|
||||
}
|
||||
func (s schedule) Call(m *ice.Message, arg ...string) {
|
||||
s.Orders(m, model.TAKE_TIME).Limit(m, 1)
|
||||
@ -29,15 +39,18 @@ func (s schedule) Call(m *ice.Message, arg ...string) {
|
||||
return
|
||||
}
|
||||
s.ChangeStatus(m, m.Append(model.UID), "", ScheduleTake, ScheduleCall, arg...)
|
||||
s.SendTemplate(m, "服务已叫号")
|
||||
}
|
||||
func (s schedule) SelectByStatus(m *ice.Message, arg ...string) {
|
||||
s.Tables(m, s.volume).FieldsWithCreatedAT(m, s,
|
||||
model.SCHEDULE_STATUS, s.Key(s.volume, model.BEGIN_TIME), s.Key(s.volume, model.END_TIME), s.Key(s, model.RECEPTION_UID), model.USER_UID,
|
||||
model.SCHEDULE_STATUS, s.Key(s.volume, model.BEGIN_TIME), s.Key(s.volume, model.END_TIME), model.VOLUME_UID, s.Key(s, model.RECEPTION_UID), model.USER_UID,
|
||||
s.Key(s, model.QUEUE_UID),
|
||||
).Orders(m, s.Desc(model.BEGIN_TIME))
|
||||
s.Select(m, kit.Simple(s.Key(s, model.QUEUE_UID), arg[0], model.STATUS, arg[1], arg[2:])...)
|
||||
s.RewriteAppend(m)
|
||||
s.SelectJoin(m, s.reception)
|
||||
s.SelectJoinUser(m)
|
||||
m.PushAction().Action()
|
||||
}
|
||||
func (s schedule) List(m *ice.Message, arg ...string) {
|
||||
if s.CheckRole(m.Options(model.QUEUE_UID, arg[0]), UserQueueCreator, UserQueueServer) {
|
||||
@ -57,29 +70,43 @@ func (s schedule) List(m *ice.Message, arg ...string) {
|
||||
s.RewriteAppend(m)
|
||||
s.SelectJoin(m, s.reception)
|
||||
s.SelectJoinUser(m)
|
||||
kit.If(m.Length() == 0, func() { m.Echo(m.Trans("not found", "没有预约")) })
|
||||
m.PushAction().Action()
|
||||
}
|
||||
func (s schedule) Cancel(m *ice.Message, arg ...string) {
|
||||
s.Transaction(m, func() {
|
||||
m.Cmd(s.volume, s.AddCount, m.Option(model.VOLUME_UID), "-1")
|
||||
s.ChangeStatus(m, m.Option(model.UID), "", SchedulePlan, ScheduleTake, arg...)
|
||||
})
|
||||
if !m.IsErr() {
|
||||
s.SendTemplate(m, "约号取消")
|
||||
}
|
||||
}
|
||||
func (s schedule) Take(m *ice.Message, arg ...string) {
|
||||
s.ChangeStatus(m, m.Option(model.UID), "", SchedulePlan, ScheduleTake, arg...)
|
||||
}
|
||||
func (s schedule) Cancel(m *ice.Message, arg ...string) {
|
||||
s.ChangeStatus(m, m.Option(model.UID), "", SchedulePlan, ScheduleTake, arg...)
|
||||
s.SendTemplate(m, "取号取消")
|
||||
}
|
||||
func (s schedule) Expire(m *ice.Message, arg ...string) {
|
||||
s.ChangeStatus(m, m.Option(model.UID), "", ScheduleCall, ScheduleExpire, arg...)
|
||||
s.SendTemplate(m, "服务已过号")
|
||||
}
|
||||
func (s schedule) Finish(m *ice.Message, arg ...string) {
|
||||
s.ChangeStatus(m, m.Option(model.UID), "", ScheduleCall, ScheduleFinish, arg...)
|
||||
s.SendTemplate(m, "服务已完成")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(schedule{}) }
|
||||
func init() { ice.TeamCtxCmd(schedule{Table: newTable{}}) }
|
||||
|
||||
func (s schedule) ChangeStatus(m *ice.Message, uid, key string, from, to ScheduleStatus, arg ...string) *ice.Message {
|
||||
kit.If(key == "", func() { key = m.ActionKey() + "_time" })
|
||||
s.Table.ChangeStatus(m, uid, int(from), int(to), kit.TransArgValueTime(append(arg, key, m.Time()), key)...)
|
||||
return m
|
||||
}
|
||||
func (s schedule) SendTemplate(m *ice.Message, arg ...string) {
|
||||
queue := m.Cmd(s.queue, s.Select, model.UID, m.Option(model.QUEUE_UID))
|
||||
reception := m.Cmd(s.reception, s.Select, model.UID, m.Option(model.RECEPTION_UID))
|
||||
m.Option(model.QUEUE_NAME, queue.Append(model.NAME)+" "+reception.Append(model.NAME))
|
||||
s.Table.SendTemplate(m, "", m.Option(model.USER_UID), arg[0])
|
||||
}
|
||||
|
||||
type ScheduleStatus int
|
||||
|
||||
|
@ -10,15 +10,15 @@ import (
|
||||
type take struct {
|
||||
Tables
|
||||
schedule schedule
|
||||
take string `name:"take" role:"void"`
|
||||
take string `name:"take" help:"取号" role:"void"`
|
||||
}
|
||||
|
||||
func (s take) Take(m *ice.Message, arg ...string) {
|
||||
m.Cmd(s.schedule, s.schedule.Take)
|
||||
}
|
||||
func (s take) List(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.schedule, s.schedule.SelectByStatus, arg[0], SchedulePlan, m.OptionSimple(model.USER_UID)).PushAction(s.Take).Action()
|
||||
kit.If(m.Length() == 0, func() { m.Echo(m.Trans("not found plan", "没有预约")) })
|
||||
m.Cmdy(s.schedule, s.schedule.SelectByStatus, arg[0], SchedulePlan, m.OptionSimple(model.USER_UID)).PushAction(s.Take)
|
||||
kit.If(m.Length() == 0, func() { m.Echo(m.Trans("not found plan", "没有未取的号")) })
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(take{}) }
|
||||
|
@ -15,7 +15,7 @@ func (s userQueue) User(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.QUEUE_UID, arg[0])
|
||||
} else if len(arg) == 2 {
|
||||
s.Select(m, model.QUEUE_UID, arg[0], model.UID, arg[1])
|
||||
s.SelectDetail(m, model.QUEUE_UID, arg[0], model.UID, arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package yuehaoxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/yuehaoxitong/model"
|
||||
)
|
||||
@ -13,6 +12,9 @@ type volume struct {
|
||||
portal string `data:"true"`
|
||||
}
|
||||
|
||||
func (s volume) AddCount(m *ice.Message, arg ...string) {
|
||||
s.Table.AddCount(m, model.COUNT, arg[1], arg[0])
|
||||
}
|
||||
func (s volume) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
if m.Option(model.RECEPTION_UID) != "" {
|
||||
@ -30,8 +32,7 @@ func (s volume) List(m *ice.Message, arg ...string) {
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, s.Key(s, model.QUEUE_UID), arg[0], s.Key(s, model.UID), arg[1])
|
||||
}
|
||||
kit.If(m.Length() == 0, func() { m.Echo(m.Trans("not found", "没有放号")) })
|
||||
m.Action()
|
||||
m.PushAction()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user