|
|
@@ -1,11 +1,14 @@
|
|
|
package workflow
|
|
|
|
|
|
import (
|
|
|
+ "dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
+ "dashoo.cn/backend/api/business/paymentinfo"
|
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
"dashoo.cn/business2/permission"
|
|
|
"dashoo.cn/business2/userRole"
|
|
|
"dashoo.cn/utils"
|
|
|
+ "fmt"
|
|
|
"sort"
|
|
|
)
|
|
|
|
|
|
@@ -27,7 +30,9 @@ func (this *WorkflowController) GetHistoricTask() {
|
|
|
var historicTasks []workflow.ActiHistoricTask
|
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
historicTasks = svcActiviti.GetHistoricTasks(processKey, businessKey, processInstanceId)
|
|
|
-
|
|
|
+ sort.Slice(historicTasks, func(i, j int) bool {
|
|
|
+ return historicTasks[i].StartTime < historicTasks[j].StartTime
|
|
|
+ })
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = historicTasks
|
|
|
this.Data["json"] = &datainfo
|
|
|
@@ -114,3 +119,56 @@ func (this *WorkflowController) GetHistoricImg() {
|
|
|
this.Ctx.Output.Body(entity)
|
|
|
}
|
|
|
|
|
|
+// @Title 获取实体by SrcId
|
|
|
+// @Description 获取实体by SrcId
|
|
|
+// @Success 200 {object} paymentinfo.PaymentinfoList
|
|
|
+// @router /getWorkflowNodeBySrcId [get]
|
|
|
+func (this *WorkflowController) GetWorkflowNodeBySrcId() {
|
|
|
+ srcid := this.GetString("srcid")
|
|
|
+ var model paymentinfo.OilPaymentInfo
|
|
|
+ svc := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
+ where := "SrcId=" + srcid
|
|
|
+ has := svc.GetEntity(&model, where)
|
|
|
+
|
|
|
+ fmt.Println(has)
|
|
|
+
|
|
|
+ var historicTasks []workflow.ActiHistoricTask
|
|
|
+
|
|
|
+
|
|
|
+ if has {
|
|
|
+ var historicTask workflow.ActiHistoricTask
|
|
|
+ historicTask.TaskName = "缴费"
|
|
|
+ historicTask.StartTime = model.CreateOn.Unix() * 1000
|
|
|
+ historicTask.EndTime = model.ModifiedOn.Unix() * 1000
|
|
|
+ historicTask.Assignee = "--"
|
|
|
+ if model.IsPay == "0" {
|
|
|
+ historicTask.Remarks = "未确认"
|
|
|
+ } else if model.IsPay == "1" {
|
|
|
+ historicTask.Remarks = "已确认"
|
|
|
+ } else if model.IsPay == "2" {
|
|
|
+ historicTask.Remarks = "已缴费"
|
|
|
+ }
|
|
|
+ historicTasks = append(historicTasks, historicTask)
|
|
|
+ }
|
|
|
+
|
|
|
+ if model.IsPay == "2" {
|
|
|
+ var cert suppliercert.OilSupplierCert
|
|
|
+ has := svc.GetEntity(&cert, "Id=" + srcid)
|
|
|
+ if has {
|
|
|
+ var historicTask workflow.ActiHistoricTask
|
|
|
+ historicTask.StartTime = 0
|
|
|
+ historicTask.EndTime = 0
|
|
|
+ historicTask.TaskName = "入库"
|
|
|
+ historicTask.Assignee = "--"
|
|
|
+ if cert.Status == "7" {
|
|
|
+ historicTask.Remarks = "待入库"
|
|
|
+ } else {
|
|
|
+ historicTask.Remarks = "已入库"
|
|
|
+ }
|
|
|
+ historicTasks = append(historicTasks, historicTask)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.Data["json"] = &historicTasks
|
|
|
+ this.ServeJSON()
|
|
|
+}
|