feat:完善项目

This commit is contained in:
henry
2021-11-08 11:09:27 +08:00
parent 85b58968d1
commit 1502076841
20 changed files with 397 additions and 32 deletions

View File

@ -6,7 +6,9 @@ import (
"ArmedPolice/app/model"
"ArmedPolice/app/service"
"ArmedPolice/serve/orm"
"ArmedPolice/utils"
"errors"
"fmt"
"gorm.io/gorm"
"time"
)
@ -77,14 +79,27 @@ func (c *Person) Examine(id uint64, status int, remark string, isAssist int) err
if _status == model2.WorkProgressStatusForRefuse {
goto FINISH
}
if newNextScheduleInfo, err = mWorkSchedule.NextSchedule(); err != nil {
// 下一流程信息
if newNextScheduleInfo, err = mWorkSchedule.NextSchedule(model2.WorkInstanceAssist(isAssist) == model2.WorkInstanceAssistForYes); err != nil {
return err
}
// 无下一流程,工单直接完成
if newNextScheduleInfo == nil {
if newNextScheduleInfo == nil || newNextScheduleInfo.ID <= 0 {
goto FINISH
}
workUpdates["status"] = model2.WorkInstanceStatusForOngoing
workUpdates["schedule"] = newNextScheduleInfo.ID
if newNextScheduleInfo.IsNext {
workUpdates["is_assist"] = isAssist
}
// 推送通知
go utils.TryCatch(func() {
for _, u := range newNextScheduleInfo.Reviewer {
// Socket通知
fmt.Println(u)
}
})
FINISH:
if err = model2.Updates(mWorkInstance.WorkInstance, workUpdates, tx); err != nil {
return err