2
3
lining 6 rokov pred
rodič
commit
6d643e3bc4

+ 2 - 0
src/dashoo.cn/backend/api/business/todolist/todolist.go

@@ -5,6 +5,7 @@ type TodoList struct {
 	SupplierId       string `xorm:"VARCHAR(30)`
 	CertId           string `xorm:"VARCHAR(30)"`
 	QualId           string `xorm:"VARCHAR(30)"`
+	BusinessKey      string `xorm:"VARCHAR(30)"`
 	SupplierTypeCode string `xorm:"VARCHAR(30)"`
 	Type             string `xorm:"VARCHAR(10)"` // 1 准入 2 增项 3 年审 4 信息变更 5 资质变更
 	SupplierName     string `xorm:"VARCHAR(50)"`
@@ -13,6 +14,7 @@ type TodoList struct {
 	WorkflowId       string `xorm:"VARCHAR(50)"`
 	AnnualId         string `xorm:"VARCHAR(50)"`
 	Step             string `xorm:"VARCHAR(50)"`
+	CreateTime       int64
 }
 
 const (

+ 1 - 1
src/dashoo.cn/backend/api/business/workflow/workflow.go

@@ -26,7 +26,7 @@ type ActiMyTasksVM struct {
 
 type ActiMyTasksRetWithTimeVM struct {
 	BusinessKey string `json:"businessKey"`
-	CreateTime  string `json:"createTime"`
+	CreateTime  int64 `json:"createTime"`
 }
 
 type ActiHistoricTask struct {

+ 203 - 4
src/dashoo.cn/backend/api/controllers/oilsupplier/todolist.go

@@ -26,7 +26,7 @@ type TodoListController struct {
 // @router /gettodolist [get]
 func (this *TodoListController) GetMyTaskEntityList() {
 	var todolists []todolist.TodoList
-	var todo todolist.TodoList
+
 
 	page := this.GetPageInfoForm()
 	where := " 1=1 "
@@ -55,36 +55,54 @@ func (this *TodoListController) GetMyTaskEntityList() {
 	}
 	actisvc := workflow.GetActivitiService(utils.DBE)
 
-	//myTasksRetWithTimes := actisvc.GetMyTasksWithTime(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
-	//fmt.Println(myTasksRetWithTimes)
 	svc := supplier.GetOilSupplierService(utils.DBE)
+	var myTasksRetWithTimes []workflow.ActiMyTasksRetWithTimeVM
 	if stype == "1" || stype == "" {
+		var todo todolist.TodoList
 		//找出待办任务===准入
 		var certIdList string
 		ids := actisvc.GetMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
 		if len(strings.Trim(ids, ",")) > 0 {
 			certIdList += strings.Trim(ids, ",")+ ","
 		}
+
+		myTasksRetWithTimes = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id)
 		ids = actisvc.GetMyTasks(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id)
 		if len(strings.Trim(ids, ",")) > 0 {
 			certIdList += strings.Trim(ids, ",")+ ","
 		}
 
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetMyTasks(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id)
 		if len(strings.Trim(ids, ",")) > 0 {
 			certIdList += strings.Trim(ids, ",")+ ","
 		}
 
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id)
 		if len(strings.Trim(ids, ",")) > 0 {
 			certIdList += strings.Trim(ids, ",")+ ","
 		}
 
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetMyTasks(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id)
 		if len(strings.Trim(ids, ",")) > 0 {
 			certIdList += strings.Trim(ids, ",")+ ","
 		}
 
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetMyTasks(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id)
 		if len(strings.Trim(ids, ",")) > 0 {
 			certIdList += strings.Trim(ids, ",")+ ","
@@ -98,6 +116,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				certIdarr[i] = strings.Split(item, "-")[0]
 			}
 		}
+		fmt.Println(myTasksRetWithTimes)
 		certIdList = strings.Join(certIdarr, ",")
 		var list []supplier.OilSupplierView
 		if certIdList != "" {
@@ -111,9 +130,11 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				todo.SupplierName = item.SupplierName
 				todo.UserName = this.User.Realname
 				todo.Status = item.Status
+				todo.BusinessKey = item.CertId + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
+
 	}
 	if stype == "2" || stype == "" {
 		//找出待办任务 -- 增项
@@ -121,31 +142,61 @@ func (this *TodoListController) GetMyTaskEntityList() {
 		whereapp = whereapp + " and b.Status>0"
 
 		var appendIdList string
+
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids := actisvc.GetMyTasks(workflow.OIL_APPEND_APPLY, this.User.Id)
 		if ids != "" {
 			appendIdList = ids
 			appendIdList = appendIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetMyTasks(workflow.OIL_FIRST_APPEND_APPLY, this.User.Id)
 		if ids != "" {
 			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
 			appendIdList = appendIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetMyTasks(workflow.OIL_SECOND_APPEND_APPLY, this.User.Id)
 		if ids != "" {
 			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
 			appendIdList = appendIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_ENUSER_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetMyTasks(workflow.OIL_ENUSER_APPEND_APPLY, this.User.Id)
 		if ids != "" {
 			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
 			appendIdList = appendIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_ENUSER_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetMyTasks(workflow.OIL_FIRST_ENUSER_APPEND_APPLY, this.User.Id)
 		if ids != "" {
 			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
 			appendIdList = appendIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_ENUSER_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetMyTasks(workflow.OIL_SECOND_ENUSER_APPEND_APPLY, this.User.Id)
 		if ids != "" {
 			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
@@ -163,6 +214,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 		appendIdList = strings.Trim(appendIdList, ",")
 		var listapp []suppliercertappend.OilSupplierCertAppendTodo
 		svcapp := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+		var todo todolist.TodoList
 		if appendIdList != "" {
 			whereapp += " and b.Id in (" + appendIdList + ")"
 			svcapp.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertAppendName, page.CurrentPage, page.Size, orderby, asc, &listapp, whereapp)
@@ -173,6 +225,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				todo.UserName = this.User.Realname
 				todo.SupplierTypeCode = item.AppendType
 				todo.Status = item.Status
+				todo.BusinessKey = strconv.Itoa(item.Id) + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
@@ -183,6 +236,11 @@ func (this *TodoListController) GetMyTaskEntityList() {
 		if supplierName != "" {
 			whereannu = whereannu + " and SupplierName like '%" + supplierName + "%'"
 		}
+
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_AUDIT_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		var listannu []annualaudit.OilAnnualAudit
 		annuIdList := actisvc.GetMyTasks(workflow.OIL_AUDIT_APPLY, this.User.Id)
 		annuIdarr := strings.Split(annuIdList, ",")
@@ -199,6 +257,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 			whereannu += " and Status > 0 "
 			svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &listannu, whereannu)
 
+			var todo todolist.TodoList
 			for _, item := range listannu {
 				todo.Id = item.Id
 				todo.SupplierId = strconv.Itoa(item.SupplierId)
@@ -210,6 +269,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				todo.WorkflowId = item.WorkflowId
 				todo.Status = item.Status
 				todo.CertId = strconv.Itoa(item.CerId)
+				todo.BusinessKey = strconv.Itoa(item.CerId) + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
@@ -221,6 +281,10 @@ func (this *TodoListController) GetMyTaskEntityList() {
 		if supplierName != "" {
 			whereInfo = where + " and SupplierName like '%" + supplierName + "%'"
 		}
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_INFO_CHANGE, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		infoList := actisvc.GetMyTasks(workflow.OIL_INFO_CHANGE, this.User.Id)
 		infoIdarr := strings.Split(infoList, ",")
 		for i, item := range infoIdarr {
@@ -230,6 +294,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 			}
 		}
 		infoList = strings.Join(infoIdarr, ",")
+		var todo todolist.TodoList
 		if infoList != "" {
 			whereInfo += " and Id in (" + infoList + ")"
 			svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &listInfo, whereInfo)
@@ -241,12 +306,17 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				todo.UserName = this.User.Realname
 				todo.SupplierTypeCode = item.SupplierTypeName
 				todo.Status = item.Status
+				todo.BusinessKey = strconv.Itoa(item.Id) + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
 	}
 	if stype == "5" || stype == "" {
 		// 资质变更
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_QUAL_CHANGE, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		var listqual []qualchange.OilQualChangeMain
 		qualList := actisvc.GetMyTasks(workflow.OIL_QUAL_CHANGE, this.User.Id)
 		qualIdarr := strings.Split(qualList, ",")
@@ -266,6 +336,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 			wherequal += " and Id in (" + qualList + ")"
 			wherequal += " and Status > 0 "
 			svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &listqual, wherequal)
+			var todo todolist.TodoList
 			for _, item := range listqual {
 				todo.Id = item.Id
 				todo.CertId = strconv.Itoa(item.SupplierCertId)
@@ -275,6 +346,7 @@ func (this *TodoListController) GetMyTaskEntityList() {
 				todo.UserName = this.User.Realname
 				todo.SupplierTypeCode = "0"
 				todo.Status = item.Status
+				todo.BusinessKey = strconv.Itoa(item.Id) + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
@@ -290,15 +362,35 @@ func (this *TodoListController) GetMyTaskEntityList() {
 		svc := register.GetOilCorporateInfoService(utils.DBE)
 		var list []register.OilCorporateInfo
 		_, list = svc.GetCompanyListByWhere(page.CurrentPage, page.Size, "Id desc", "OilCorporateInfo", where)
+		var todo todolist.TodoList
 		for _, item := range list {
 			todo.Id = item.Id
 			todo.Type = todolist.REGISTER
 			todo.SupplierName = item.SupplierName
 			todo.UserName = this.User.Realname
 			todo.Status = strconv.Itoa(item.CheckStatus)
+			todo.CreateTime = item.CreateOn.Unix() * 1000
 			todolists = append(todolists, todo)
 		}
 	}
+	for i,todo := range todolists {
+		for _,myTasksRetWithTime := range myTasksRetWithTimes {
+			if todo.BusinessKey == myTasksRetWithTime.BusinessKey {
+				todolists[i].CreateTime = myTasksRetWithTime.CreateTime
+			}
+		}
+	}
+	num := len(todolists)
+	for i := 0; i < num; i++ {
+		for j := i + 1; j < num; j++ {
+			if todolists[i].CreateTime < todolists[j].CreateTime {
+				tmp := todolists[i]
+				todolists[i] = todolists[j]
+				todolists[j] = tmp
+			}
+		}
+	}
+
 	var datainfo DataInfo
 	datainfo.Items = todolists
 	this.Data["json"] = &datainfo
@@ -342,34 +434,61 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 
 	actisvc := workflow.GetActivitiService(utils.DBE)
 	svc := supplier.GetOilSupplierService(utils.DBE)
+	var myTasksRetWithTimes []workflow.ActiMyTasksRetWithTimeVM
 	if stype == "1" || stype == "" {
 		//已办任务===准入
 		var certIdList string
+		myTasksRetWithTimes = actisvc.GetMyTasksWithTime(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
 		ids := actisvc.GetHistoryMyTasks(workflow.OIL_SUPPLIER_APPLY, this.User.Id)
 		if ids != "" {
 			certIdList = ids
 			certIdList = certIdList + ","
 		}
+
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetHistoryMyTasks(workflow.OIL_FIRST_SUPPLIER_APPLY, this.User.Id)
 		if ids != "" {
 			certIdList = fmt.Sprintf("%s %s", certIdList, ids)
 			certIdList = certIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetHistoryMyTasks(workflow.OIL_SECOND_SUPPLIER_APPLY, this.User.Id)
 		if ids != "" {
 			certIdList = fmt.Sprintf("%s %s", certIdList, ids)
 			certIdList = certIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetHistoryMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id)
 		if ids != "" {
-			certIdList = fmt.Sprintf("%s %s", certIdList, actisvc.GetHistoryMyTasks(workflow.OIL_ENUSER_SUPPLIER_APPLY, this.User.Id))
+			certIdList = fmt.Sprintf("%s %s", certIdList, ids)
 			certIdList = certIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetHistoryMyTasks(workflow.OIL_FIRST_ENUSER_SUPPLIER_APPLY, this.User.Id)
 		if ids != "" {
 			certIdList = fmt.Sprintf("%s %s", certIdList, ids)
 			certIdList = certIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetHistoryMyTasks(workflow.OIL_SECOND_ENUSER_SUPPLIER_APPLY, this.User.Id)
 		if ids != "" {
 			certIdList = fmt.Sprintf("%s %s", certIdList, ids)
@@ -396,6 +515,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 				todo.SupplierName = item.SupplierName
 				todo.UserName = this.User.Realname
 				todo.Status = item.Status
+				todo.BusinessKey = item.CertId + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
@@ -406,22 +526,67 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 		whereapp = whereapp + " and b.Status>0"
 
 		var appendIdList string
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids := actisvc.GetHistoryMyTasks(workflow.OIL_APPEND_APPLY, this.User.Id)
 		if ids != "" {
 			appendIdList = ids
 			appendIdList = appendIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetHistoryMyTasks(workflow.OIL_FIRST_APPEND_APPLY, this.User.Id)
 		if ids != "" {
 			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
 			appendIdList = appendIdList + ","
 		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		ids = actisvc.GetHistoryMyTasks(workflow.OIL_SECOND_APPEND_APPLY, this.User.Id)
 		if ids != "" {
 			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
 			appendIdList = appendIdList + ","
 		}
 
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_ENUSER_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
+		ids = actisvc.GetHistoryMyTasks(workflow.OIL_ENUSER_APPEND_APPLY, this.User.Id)
+		if ids != "" {
+			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
+			appendIdList = appendIdList + ","
+		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_FIRST_ENUSER_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
+		ids = actisvc.GetHistoryMyTasks(workflow.OIL_FIRST_ENUSER_APPEND_APPLY, this.User.Id)
+		if ids != "" {
+			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
+			appendIdList = appendIdList + ","
+		}
+
+		arr = actisvc.GetMyTasksWithTime(workflow.OIL_SECOND_ENUSER_APPEND_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
+		ids = actisvc.GetHistoryMyTasks(workflow.OIL_SECOND_ENUSER_APPEND_APPLY, this.User.Id)
+		if ids != "" {
+			appendIdList = fmt.Sprintf("%s %s", appendIdList, ids)
+			appendIdList = appendIdList + ","
+		}
+
+
 		appendIdarr := strings.Split(appendIdList, ",")
 		for i, item := range appendIdarr {
 			idx := strings.Index(item, "-")
@@ -442,6 +607,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 				todo.UserName = this.User.Realname
 				todo.SupplierTypeCode = item.AppendType
 				todo.Status = item.Status
+				todo.BusinessKey = strconv.Itoa(item.Id) + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
@@ -453,6 +619,10 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			whereannu = whereannu + " and SupplierName like '%" + supplierName + "%'"
 		}
 		var listannu []annualaudit.OilAnnualAudit
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_AUDIT_APPLY, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		annuIdList := actisvc.GetHistoryMyTasks(workflow.OIL_AUDIT_APPLY, this.User.Id)
 		annuIdarr := strings.Split(annuIdList, ",")
 		for i, item := range annuIdarr {
@@ -479,6 +649,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 				todo.WorkflowId = item.WorkflowId
 				todo.Status = item.Status
 				todo.CertId = strconv.Itoa(item.CerId)
+				todo.BusinessKey = strconv.Itoa(item.CerId) + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
@@ -490,6 +661,10 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 		if supplierName != "" {
 			whereInfo = where + " and SupplierName like '%" + supplierName + "%'"
 		}
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_INFO_CHANGE, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		infoList := actisvc.GetHistoryMyTasks(workflow.OIL_INFO_CHANGE, this.User.Id)
 		infoIdarr := strings.Split(infoList, ",")
 		for i, item := range infoIdarr {
@@ -509,6 +684,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 				todo.UserName = this.User.Realname
 				todo.SupplierTypeCode = item.SupplierTypeName
 				todo.Status = item.Status
+				todo.BusinessKey = strconv.Itoa(item.Id) + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
@@ -516,6 +692,10 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 	if stype == "5" || stype == "" {
 		// 资质变更
 		var listqual []qualchange.OilQualChangeMain
+		arr := actisvc.GetMyTasksWithTime(workflow.OIL_QUAL_CHANGE, this.User.Id)
+		for _,s := range arr {
+			myTasksRetWithTimes = append(myTasksRetWithTimes, s)
+		}
 		qualList := actisvc.GetHistoryMyTasks(workflow.OIL_QUAL_CHANGE, this.User.Id)
 		qualIdarr := strings.Split(qualList, ",")
 		for i, item := range qualIdarr {
@@ -543,6 +723,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 				todo.UserName = this.User.Realname
 				todo.SupplierTypeCode = "0"
 				todo.Status = item.Status
+				todo.BusinessKey = strconv.Itoa(item.Id) + "-"+ strconv.Itoa(item.AuditIndex)
 				todolists = append(todolists, todo)
 			}
 		}
@@ -564,9 +745,27 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 			todo.SupplierName = item.SupplierName
 			todo.UserName = this.User.Realname
 			todo.Status = strconv.Itoa(item.CheckStatus)
+			todo.CreateTime = item.CreateOn.Unix() * 1000
 			todolists = append(todolists, todo)
 		}
 	}
+	for i,todo := range todolists {
+		for _,myTasksRetWithTime := range myTasksRetWithTimes {
+			if todo.BusinessKey == myTasksRetWithTime.BusinessKey {
+				todolists[i].CreateTime = myTasksRetWithTime.CreateTime
+			}
+		}
+	}
+	num := len(todolists)
+	for i := 0; i < num; i++ {
+		for j := i + 1; j < num; j++ {
+			if todolists[i].CreateTime < todolists[j].CreateTime {
+				tmp := todolists[i]
+				todolists[i] = todolists[j]
+				todolists[j] = tmp
+			}
+		}
+	}
 	var datainfo DataInfo
 	datainfo.Items = todolists
 	this.Data["json"] = &datainfo

+ 37 - 5
src/dashoo.cn/frontend_web/src/pages/index.vue

@@ -70,6 +70,12 @@
 
           <el-table-column label="执行人" prop="UserName" align="center"></el-table-column>
 
+            <!--<el-table-column label="提交" prop="CreateTime">-->
+              <!--<template slot-scope="scope">-->
+                <!--{{ jstimehandle(timestampToTime(scope.row.CreateTime)) }}-->
+              <!--</template>-->
+            <!--</el-table-column>-->
+
           <el-table-column label="操作" width="130" align="center" fixed="right">
             <template slot-scope="scope">
               <el-button type="text" title="办理"  icon="el-icon-edit" size="mini" @click="rowClick(scope.row)">办理</el-button>
@@ -295,11 +301,11 @@
 
         },
         formData: {
-          Id: '', //int
-          UserId: '', //int
-          UserName: '', //账号/Email
-          UserRealName: '', //用户真实姓名
-          UserTelephone: '', //用户手机号
+          Id: '', // int
+          UserId: '', // int
+          UserName: '', // 账号/Email
+          UserRealName: '', // 用户真实姓名
+          UserTelephone: '', // 用户手机号
           UserPass: '',
           UserPass2: '',
           SupplierName: '',
@@ -634,6 +640,32 @@
             return val
         }
       },
+      timestampToTime (val) {
+        var date = new Date(val) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
+        var Y = date.getFullYear() + '-'
+        var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
+        var D = date.getDate() + ' '
+        var h = date.getHours() + ':'
+        var m = date.getMinutes() + ':'
+        var s = date.getSeconds()
+        return Y + M + D + h + m + s
+      },
+      jstimehandle (val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else if (val === '1970-01-01 8:0:0') {
+          return '----'
+        } else if (val === '1970-01-1 8:0:0') {
+          return '----'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 19)
+        }
+      },
       handleCurrentChange (value) {
         this.currentPage = value
         this.initData()