This commit is contained in:
root 2024-11-12 13:11:42 +08:00
parent 7208146a87
commit 6f5c93d3be
6 changed files with 58 additions and 26 deletions

View File

@ -7,15 +7,16 @@ type interview struct {
fields string `data:"title,content,address,begin_time,end_time,user_uid"` fields string `data:"title,content,address,begin_time,end_time,user_uid"`
create string `name:"create title* content* address* begin_time*@date end_time*@date" role:"leader"` create string `name:"create title* content* address* begin_time*@date end_time*@date" role:"leader"`
remove string `name:"remove" role:"leader"` remove string `name:"remove" role:"leader"`
start string `name:"start" role:"leader"`
stop string `name:"stop" role:"leader"`
} }
func (s interview) List(m *ice.Message, arg ...string) { func (s interview) List(m *ice.Message, arg ...string) {
s.ValueList(m, arg) s.ValueList(m, arg).Table(func(value ice.Maps) {
m.Table(func(value ice.Maps) {
m.PushButton(s.Start) m.PushButton(s.Start)
}) })
} }
func (s interview) Start(m *ice.Message, arg ...string) {} func (s interview) Start(m *ice.Message, arg ...string) {}
func (s interview) stop(m *ice.Message, arg ...string) {} func (s interview) Stop(m *ice.Message, arg ...string) {}
func init() { ice.TeamCtxCmd(interview{}) } func init() { ice.TeamCtxCmd(interview{}) }

View File

@ -21,9 +21,12 @@ const (
COMPANY_NAME = "company_name" COMPANY_NAME = "company_name"
AUTH_UID = "auth_uid" AUTH_UID = "auth_uid"
RECRUITMENT_STATUS = "recruitment_status" RECRUITMENT_STATUS = "recruitment_status"
RECRUITMENT_UID = "recruitment_uid"
SALARY = "salary" SALARY = "salary"
SENIORITY = "seniority" SENIORITY = "seniority"
MOBILE = "mobile"
DEGREE = "degree" DEGREE = "degree"
COUNT = "count"
) )
type UserGroup struct { type UserGroup struct {
@ -53,6 +56,7 @@ type Recruitment struct {
} }
type Resume struct { type Resume struct {
db.ModelNameInfo db.ModelNameInfo
RecruitmentUID string `gorm:"type:char(32);index"`
GroupUID string `gorm:"type:char(32);index"` GroupUID string `gorm:"type:char(32);index"`
Email string `gorm:"type:varchar(32)"` Email string `gorm:"type:varchar(32)"`
Mobile string `gorm:"type:varchar(32)"` Mobile string `gorm:"type:varchar(32)"`

View File

@ -43,7 +43,8 @@
"resume": { "resume": {
"name": "姓名", "name": "姓名",
"info": "简介", "info": "简介",
"degree": "学历" "degree": "学历",
"address": "面试地址"
}, },
"interview": { "interview": {
"start": "开始面试" "start": "开始面试"

View File

@ -11,9 +11,9 @@ type recruitment struct {
Table Table
resume resume resume resume
fields string `data:"title,degree,seniority,salary,content,total,count,recruitment_status,user_uid"` fields string `data:"title,degree,seniority,salary,content,total,count,recruitment_status,user_uid"`
create string `name:"create title* degree* seniority* salary* content* total*=1" role:"leader"` create string `name:"create title* degree* seniority* salary* content* total*=1" role:"leader,worker"`
modify string `name:"modify content*" role:"leader"` modify string `name:"modify content*" role:"leader,worker"`
remove string `name:"remove" role:"leader"` remove string `name:"remove" role:"leader,worker"`
start string `name:"start" role:"leader"` start string `name:"start" role:"leader"`
stop string `name:"stop" role:"leader"` stop string `name:"stop" role:"leader"`
resumeInsert string `name:"create name* info* mobile* email degree*" role:"void"` resumeInsert string `name:"create name* info* mobile* email degree*" role:"void"`
@ -52,22 +52,37 @@ func (s recruitment) Inputs(m *ice.Message, arg ...string) {
} }
} }
func (s recruitment) List(m *ice.Message, arg ...string) { func (s recruitment) List(m *ice.Message, arg ...string) {
msg := m.Spawn()
list := map[string]int{}
s.Fields(msg, model.RECRUITMENT_UID, "count(*) AS `count`").Groups(msg, model.RECRUITMENT_UID)
msg = msg.Cmd(s.resume, s.Select, m.OptionSimple(model.GROUP_UID, model.USER_UID))
msg.Table(func(value ice.Maps) { list[value[model.RECRUITMENT_UID]] = kit.Int(value[model.COUNT]) })
s.ValueList(m, arg).Table(func(value ice.Maps) { s.ValueList(m, arg).Table(func(value ice.Maps) {
count := list[value[model.UID]]
button := []ice.Any{}
switch RecruitmentStatus(kit.Int(value[model.RECRUITMENT_STATUS])) { switch RecruitmentStatus(kit.Int(value[model.RECRUITMENT_STATUS])) {
case RecruitmentCreate: case RecruitmentCreate:
m.PushButton(s.Start, s.Modify, s.Remove) if s.IsLeader(m) {
button = append(button, s.Start)
}
if s.IsWorker(m) {
button = append(button, s.Modify, s.Remove)
}
case RecruitmentStart: case RecruitmentStart:
if m.Option(model.MARKET_UID) != "" { if count == 0 || s.IsWorker(m) {
m.PushButton(s.ResumeInsert) button = append(button, s.ResumeInsert)
} else if s.IsLeader(m) {
m.PushButton(s.ResumeInsert, s.MarketInsert, s.Modify, s.Stop)
} else {
m.PushButton(s.ResumeInsert)
} }
case RecruitmentStop: if m.Option(model.MARKET_UID) == "" {
m.PushButton() if s.IsLeader(m) {
button = append(button, s.MarketInsert, s.Modify, s.Stop)
} else if s.IsWorker(m) {
button = append(button, s.Modify)
} }
}
}
m.PushButton(button...)
}).Display("") }).Display("")
kit.If(m.Length() == 0, func() { s.Button(m.SetResult(), "") })
} }
func (s recruitment) Start(m *ice.Message, arg ...string) { func (s recruitment) Start(m *ice.Message, arg ...string) {
s.ValueModify(m, model.STATUS, kit.Format(RecruitmentStart)) s.ValueModify(m, model.STATUS, kit.Format(RecruitmentStart))
@ -76,7 +91,10 @@ func (s recruitment) Stop(m *ice.Message, arg ...string) {
s.ValueModify(m, model.STATUS, kit.Format(RecruitmentStop)) s.ValueModify(m, model.STATUS, kit.Format(RecruitmentStop))
} }
func (s recruitment) ResumeInsert(m *ice.Message, arg ...string) { func (s recruitment) ResumeInsert(m *ice.Message, arg ...string) {
m.Cmdy(s.resume, s.Insert, arg, m.OptionSimple(model.GROUP_UID, model.USER_UID)) if m.Warn(m.Cmd(s.resume, s.Select, model.RECRUITMENT_UID, m.Option(model.UID), m.OptionSimple(model.MOBILE)).Length() > 0, "已经投过简历,请勿重复投递,投递") {
return
}
m.Cmdy(s.resume, s.Insert, arg, m.OptionSimple(model.GROUP_UID, model.USER_UID), model.RECRUITMENT_UID, m.Option(model.UID))
} }
func init() { ice.TeamCtxCmd(recruitment{}) } func init() { ice.TeamCtxCmd(recruitment{}) }

View File

@ -12,14 +12,21 @@ type resume struct {
fields string `data:"name,info,mobile,email,degree,user_uid"` fields string `data:"name,info,mobile,email,degree,user_uid"`
create string `name:"create name* info* mobile* email degree" role:"leader"` create string `name:"create name* info* mobile* email degree" role:"leader"`
remove string `name:"remove" role:"leader"` remove string `name:"remove" role:"leader"`
interviewInsert string `name:"create title* content* address* begin_time*@date end_time*@date" role:"leader"` interviewInsert string `name:"create title* content* begin_time*:select@date end_time*:select@date address*" role:"leader"`
} }
func (s resume) Inputs(m *ice.Message, arg ...string) {
switch arg[0] {
case model.TITLE:
m.Push(arg[0], "一面")
m.Push(arg[0], "二面")
m.Push(arg[0], "三面")
}
}
func (s resume) List(m *ice.Message, arg ...string) { func (s resume) List(m *ice.Message, arg ...string) {
s.ValueList(m, arg).Display("") s.ValueList(m, arg).Table(func(value ice.Maps) {
m.Table(func(value ice.Maps) {
m.PushButton(s.InterviewInsert) m.PushButton(s.InterviewInsert)
}) }).Display("")
} }
func (s resume) InterviewInsert(m *ice.Message, arg ...string) { func (s resume) InterviewInsert(m *ice.Message, arg ...string) {
m.Cmdy(s.interview, s.interview.Insert, arg, m.OptionSimple(model.GROUP_UID, model.USER_UID)) m.Cmdy(s.interview, s.interview.Insert, arg, m.OptionSimple(model.GROUP_UID, model.USER_UID))

View File

@ -6,6 +6,7 @@ Volcanos(chat.ONIMPORT, {
can.onimport.titleAction(can, value), can.onimport.titleAction(can, value),
]}, ]},
{view: html.STATUS, list: [ {view: html.STATUS, list: [
can.onimport.timeView(can, value),
can.onimport.textView(can, value, "degree", "status"), can.onimport.textView(can, value, "degree", "status"),
can.onimport.textView(can, value, "seniority", "status"), can.onimport.textView(can, value, "seniority", "status"),
can.onimport.textView(can, value, "salary", "status"), can.onimport.textView(can, value, "salary", "status"),