caipin 4 년 전
부모
커밋
79c06f3ae3
2개의 변경된 파일23개의 추가작업 그리고 9개의 파일을 삭제
  1. 4 4
      services/safe_service.go
  2. 19 5
      web/viewmodels/approver.go

+ 4 - 4
services/safe_service.go

@@ -24,7 +24,7 @@ type SafeService interface {
 	GetDetail(id int, pid int) viewmodels.SafeDetail
 
 	GetSurvey(projectId int, bidsectionId int) map[string]interface{}
-	GetPending(projectId int, projectAccountId int) []viewmodels.Approver
+	GetPending(projectId int, projectAccountId int) []viewmodels.ApproverMessage
 	ValidRule(ctx iris.Context) (viewmodels.Safe, error)
 }
 
@@ -329,7 +329,7 @@ func (s *safeService) GetSurvey(projectId int, bidsectionId int) map[string]inte
 }
 
 // 获得账号下需要审批的巡检
-func (s *safeService) GetPending(projectId int, projectAccountId int) []viewmodels.Approver {
+func (s *safeService) GetPending(projectId int, projectAccountId int) []viewmodels.ApproverMessage {
 
 	// 1.获得审批列表
 	approverData := s.daoApprover.GetStatusByProjectAndAccount(projectId, projectAccountId, 1)
@@ -357,9 +357,9 @@ func (s *safeService) GetPending(projectId int, projectAccountId int) []viewmode
 
 	// data := s.daoSafe.GetStatusByProjectAndAccount(projectId, projectAccountId, 1)
 
-	list := make([]viewmodels.Approver, 0)
+	list := make([]viewmodels.ApproverMessage, 0)
 	for _, item := range approverData {
-		approverVM := viewmodels.Approver{}
+		approverVM := viewmodels.ApproverMessage{}
 
 		Id, _ := comm.AesEncrypt(strconv.Itoa(item.Id), conf.SignSecret)
 		// BidsectionId, _ := comm.AesEncrypt(strconv.Itoa(item.BidsectionId), conf.SignSecret)

+ 19 - 5
web/viewmodels/approver.go

@@ -7,15 +7,29 @@
 package viewmodels
 
 type Approver struct {
+	Id           string `from:"id" json:"id"`
+	ProjectId    string `from:"projectId" json:"projectId"`
+	BidsectionId string `from:"bidsectionId" json:"bidsectionId"`
+	DataType     int    `from:"dataType" json:"dataType"`
+	DataId       string `from:"dataId" json:"dataId"`
+	Status       int    `from:"status" json:"status"`
+	Progress     string `from:"progress" json:"progress"`
+	AuditOrder   int    `from:"auditOrder" json:"auditOrder"`
+	AuditId      string `from:"auditId" json:"auditId"`
+
+	Code             string `from:"code" json:"code"`
+	InspectionDetail string `from:"inspectionDetail" json:"inspectionDetail"`
+	Name             string `from:"name" json:"name"`
+	Position         string `from:"position" json:"position"`
+	CreateTime       string `form:"createTime" json:"createTime"`
+}
+
+type ApproverMessage struct {
 	Id string `from:"id" json:"id"`
-	// ProjectId    string `from:"projectId" json:"projectId"`
-	// BidsectionId string `from:"bidsectionId" json:"bidsectionId"`
+
 	DataType int    `from:"dataType" json:"dataType"`
 	DataId   string `from:"dataId" json:"dataId"`
 	Status   int    `from:"status" json:"status"`
-	// Progress     string `from:"progress" json:"progress"`
-	// AuditOrder   int    `from:"auditOrder" json:"auditOrder"`
-	// AuditId      string `from:"auditId" json:"auditId"`
 
 	Code             string `from:"code" json:"code"`
 	InspectionDetail string `from:"inspectionDetail" json:"inspectionDetail"`