Browse Source

Merge branch 'master' of http://192.168.1.41:3000/caipin/construction_management

caipin 4 năm trước cách đây
mục cha
commit
f305b8c0ac

+ 1 - 0
.gitignore

@@ -5,3 +5,4 @@
 /web/docs/docs.go
 /web/docs/swagger.json
 /web/docs/swagger.yaml
+/web/main.go

+ 3 - 0
conf/project.go

@@ -43,6 +43,9 @@ const NodeRpcHost = "localhost:50051"
 // 是否需要启动全局计划任务服务
 var RunningCrontabService = false
 
+// 分页-页数
+var PageSize = 10
+
 // 审批常量
 type auditStatus struct {
 	uncheck  int

+ 19 - 12
dao/annex_dao.go

@@ -8,6 +8,8 @@
 package dao
 
 import (
+	"fmt"
+
 	"github.com/go-xorm/xorm"
 	"go.mod/models"
 	"go.mod/web/viewmodels"
@@ -26,33 +28,38 @@ func NewAnnexDao(engine *xorm.Engine) *AnnexDao {
 }
 
 // 获取附件列表
-func (d *AnnexDao) GetList(dataType int, dataId int) []viewmodels.AnnexListView {
+func (d *AnnexDao) GetList(dataType int, dataId int, pageNo int, pageSize int) ([]viewmodels.AnnexListView, int64) {
 	dataList := make([]viewmodels.AnnexListView, 0)
-	err := d.engine.
-		Asc("create_time").
-		Sql("select f.`account_id`, f.`create_time`, f.`name` as filename, f.`oss_url` as filepath, a.`name` as acount_name from `cm_annex` as f, `cm_project_acount` as a where f.`account_id` = a.`id` and f.`data_type` = ? and f.`data_id` = ?", dataType, dataId).
-		Find(&dataList)
+	start := (pageNo - 1) * pageSize
+	// fmt.Println("start", start, "pageSize", pageSize)
+	total, err := d.engine.Table("`cm_annex` as f").
+		Select("f.`id`, f.`account_id`, f.`create_time`, f.`name` as file_name, f.`oss_url` as file_path, a.`name` as account_name").
+		Join("LEFT", "`cm_project_account` as a", "a.id = f.account_id").
+		Where("f.data_id = ? and f.data_type = ?", dataId, dataType).
+		Limit(pageSize, start).
+		FindAndCount(&dataList)
+	// fmt.Println("total", total)
 	if err != nil {
-		return dataList
+		return dataList, 0
 	}
-	return dataList
+	return dataList, total
 }
 
 // 获取总数
 func (d *AnnexDao) GetCount(dataType int, dataId int) (int64, error) {
-	file := models.CmAnnex{}
-	total, err := d.engine.
-		Where("`data_type`= ? and `data_id` = ?", dataType, dataId).
-		Count(file)
+	file := models.CmAnnex{DataType: dataType, DataId: dataId}
+	total, err := d.engine.Count(&file)
+	fmt.Println(err)
 	if err != nil {
 		return 0, err
 	}
-	return total, err
+	return total, nil
 }
 
 // 批量插入数据
 func (d *AnnexDao) InsertByList(data []models.CmAnnex) error {
 	_, err := d.engine.Insert(&data)
+	// fmt.Println("__________________________________", data)
 	return err
 }
 

+ 7 - 5
dao/safe_dao.go

@@ -36,16 +36,18 @@ func (d *SafeDao) FindById(id int) *models.CmSafe {
 }
 
 // id获得数据
-func (d *SafeDao) GetListByBid(id int) []models.CmSafe {
+func (d *SafeDao) GetListByBid(id int, pageNo int, pageSize int) ([]models.CmSafe, int64) {
 	dataList := make([]models.CmSafe, 0)
-	err := d.engine.
+	start := (pageNo - 1) * pageSize
+	total, err := d.engine.
 		Where("bidsection_id=?", id).
 		Asc("id").
-		Find(&dataList)
+		Limit(pageSize, start).
+		FindAndCount(&dataList)
 	if err != nil {
-		return dataList
+		return dataList, 0
 	}
-	return dataList
+	return dataList, total
 }
 
 // 插入单条记录

+ 26 - 6
services/annex_service.go

@@ -7,7 +7,9 @@
 package services
 
 import (
+	"fmt"
 	"log"
+	"time"
 
 	"go.mod/comm"
 	"go.mod/conf"
@@ -21,10 +23,11 @@ import (
 
 type AnnexService interface {
 	ValidRule(ctx iris.Context) (viewmodels.Annex, error)
+	ValidCreate(ctx iris.Context) (viewmodels.AnnexCreate, error)
 	Create(uid int, dataType int, dataId int, list []viewmodels.AnnexList) error
 	Delete(id int) error
 	GetCounts(dataType int, dataId int) (int64, error)
-	Get(dataType int, dataId int) []viewmodels.AnnexListView
+	Get(dataType int, dataId int, pageNo int, pageSize int) ([]viewmodels.AnnexListView, int64)
 }
 
 // //返回service操作类
@@ -43,20 +46,22 @@ func NewAnnexService() AnnexService {
 }
 
 // 附件列表
-func (s *annexService) Get(dataType int, dataId int) []viewmodels.AnnexListView {
+func (s *annexService) Get(dataType int, dataId int, pageNo int, pageSize int) ([]viewmodels.AnnexListView, int64) {
 	fileData := make([]viewmodels.AnnexListView, 0)
-	list := s.daoAnnex.GetList(dataType, dataId)
+	list, total := s.daoAnnex.GetList(dataType, dataId, pageNo, pageSize)
 	for _, item := range list {
 		annexVM := viewmodels.AnnexListView{}
 		uid, _ := comm.AesEncrypt(item.AccountId, conf.SignSecret)
 		annexVM.AccountId = uid
+		id, _ := comm.AesEncrypt(item.Id, conf.SignSecret)
+		annexVM.Id = id
 		annexVM.AccountName = item.AccountName
 		annexVM.CreateTime = item.CreateTime
 		annexVM.FileName = item.FileName
 		annexVM.FilePath = item.FilePath
 		fileData = append(fileData, annexVM)
 	}
-	return fileData
+	return fileData, total
 }
 
 // 计算附件总数
@@ -68,16 +73,22 @@ func (s *annexService) GetCounts(dataType int, dataId int) (int64, error) {
 // 插入数据
 func (s *annexService) Create(uid int, dataType int, dataId int, list []viewmodels.AnnexList) error {
 	fileData := make([]models.CmAnnex, 0)
+	fmt.Println("-------------------------", list)
 	for _, file := range list {
 		fileVM := models.CmAnnex{}
 		fileVM.DataType = dataType
 		fileVM.DataId = dataId
 		fileVM.AccountId = uid
-		fileVM.Name = file.Name
-		fileVM.OssUrl = file.OssUrl
+		fileVM.Name = file.FileName
+		fileVM.OssUrl = file.FilePath
+		// fileVM.CreateTime = time.Unix(file.CreateTime, 0)
+		// time, _ := time.Parse("2020-11-11 20:11:11", file.CreateTime)
 		fileVM.CreateTime = file.CreateTime
+		fileVM.UpdateTime = time.Now()
+		// fmt.Println("------------------", file.CreateTime)
 		fileData = append(fileData, fileVM)
 	}
+	fmt.Println("fileData", fileData)
 	err := s.daoAnnex.InsertByList(fileData)
 	return err
 }
@@ -103,6 +114,15 @@ func (s *annexService) ValidRule(ctx iris.Context) (viewmodels.Annex, error) {
 		}
 		return annexVaild, err
 	}
+	return annexVaild, nil
+}
 
+func (s *annexService) ValidCreate(ctx iris.Context) (viewmodels.AnnexCreate, error) {
+	annexVaild := viewmodels.AnnexCreate{}
+	err := ctx.ReadJSON(&annexVaild)
+	if err != nil {
+		log.Println("safe-ValidRule-ReadJSON转换异常, error=", err)
+		return annexVaild, err
+	}
 	return annexVaild, nil
 }

+ 10 - 32
services/safe_service.go

@@ -15,13 +15,11 @@ import (
 )
 
 type SafeService interface {
-	Get(id int, pid int) []viewmodels.SafeList
+	Get(id int, pid int, pageNo int, pageSize int) ([]viewmodels.SafeList, int64)
 	Post(data models.CmSafe) error
 	Del(id int) error
 	GetDetail(id int, pid int) viewmodels.SafeDetail
-	// SaveFileInfo(bid int, sid int, uid int, fileList []viewmodels.FileList) error
 	ValidRule(ctx iris.Context) (viewmodels.Safe, error)
-	// ValidFile(ctx iris.Context) (viewmodels.File, error)
 }
 
 // //返回service操作类
@@ -39,12 +37,13 @@ func NewSafeService() SafeService {
 	return &safeService{
 		validDetail:       "/api/safe/detail",
 		daoSafe:           dao.NewSafeDao(datasource.InstanceDbMaster()),
+		daoAnnex:          dao.NewAnnexDao(datasource.InstanceDbMaster()),
 		daoSafeAudit:      dao.NewSafeAuditDao(datasource.InstanceDbMaster()),
 		daoProjectAccount: dao.NewProjectAccountDao(datasource.InstanceDbMaster()),
 	}
 }
-func (s *safeService) Get(id int, pid int) []viewmodels.SafeList {
-	datalist := s.daoSafe.GetListByBid(id)
+func (s *safeService) Get(id int, pid int, pageNo int, pageSize int) ([]viewmodels.SafeList, int64) {
+	datalist, total := s.daoSafe.GetListByBid(id, pageNo, pageSize)
 	safeList := make([]viewmodels.SafeList, 0)
 	for _, item := range datalist {
 		safeVM := viewmodels.SafeList{}
@@ -63,7 +62,7 @@ func (s *safeService) Get(id int, pid int) []viewmodels.SafeList {
 		safeVM.FileCounts = counts
 		safeList = append(safeList, safeVM)
 	}
-	return safeList
+	return safeList, total
 }
 
 // post请求,插入单条数据
@@ -105,37 +104,16 @@ func (s *safeService) GetDetail(id int, pid int) viewmodels.SafeDetail {
 	account := s.daoProjectAccount.Get(safeData.Uid, pid)
 	data.AuditName = account.Name
 	data.CreateTime = safeData.CreateTime
-	data.FileList = s.daoAnnex.GetList(3, safeData.Id)
+	fileList, total := s.daoAnnex.GetList(3, safeData.Id, 1, conf.PageSize)
+	fileVM := viewmodels.FileStruct{}
+	fileVM.FileList = fileList
+	fileVM.Total = total
+	data.File = fileVM
 	auditors := s.daoSafeAudit.GetAuditors(safeData.Id, safeData.Times, account.Id)
 	data.Auditors = auditors
 	return data
 }
 
-// 安全巡检附件数据存库
-// func (s *safeService) SaveFileInfo(bid int, sid int, uid int, fileList []viewmodels.FileList) error {
-// 	fileData := make([]models.CmSafeFile, 0)
-// 	for _, file := range fileList {
-// 		fileVM := models.CmSafeFile{}
-// 		fileVM.BidsectionId = bid
-// 		fileVM.SafeId = sid
-// 		fileVM.Uid = uid
-// 		createTime, _ := time.Parse("2020-11-11 20:30:12", file.CreateTime)
-// 		fileVM.CreatedTime = createTime
-// 		fileVM.FileName = file.FileName
-// 		fileVM.FilePath = file.FilePath
-// 		fileData = append(fileData, fileVM)
-// 	}
-// 	err := s.daoSafeFile.InsertByList(fileData)
-// 	return err
-// }
-
-// 校验文件规则
-// func (s *safeService) ValidFile(ctx iris.Context) (viewmodels.File, error) {
-// 	fileValid := viewmodels.File{}
-// 	err := ctx.ReadJSON(&fileValid)
-// 	return fileValid, err
-// }
-
 // 规则校验
 func (s *safeService) ValidRule(ctx iris.Context) (viewmodels.Safe, error) {
 	safeVaild := viewmodels.Safe{}

+ 80 - 2
web/api/annex_api.go

@@ -30,6 +30,8 @@ type AnnexApi struct {
 // @Security ApiKeyAuth
 // @Param   dataType     path    int     true        "附件类型"
 // @Param   dataId     path    string     true        "源数据id"
+// @Param   pageNo     path    int     true        "页码" eg:1
+// @Param   pageSize     path    int     true        "页数" eg:15
 // @Success 200 {object} viewmodels.AnnexList "{code:0成功,data:viewmodels.AnnexList,msg:}"
 // @Failure 400 {string} string	"{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}"
 // @Router /api/file [get]
@@ -44,10 +46,86 @@ func (c *AnnexApi) Get() {
 	dataType, err := strconv.Atoi(annexData.DataType)
 	// data = c.ServiceAnnex.Get(dataType, dataId)
 	// dataType, err := strconv.Atoi(annexData.DataType)
-	data := c.ServiceAnnex.Get(dataType, dataId)
+	data, total := c.ServiceAnnex.Get(dataType, dataId, annexData.PageNo, annexData.PageSize)
+	c.Ctx.JSON(iris.Map{
+		"code":  0,
+		"msg":   "请求成功",
+		"data":  data,
+		"total": total,
+	})
+}
+
+// @Summary 提交文件记录
+// @Tags 附件
+// @Description 提交文件记录
+// @Accept  json
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param   fileList     body    array     true        "附件数组"
+// @Param   dataType     body    int     true        "类型" eg:"1"
+// @Param   dataId     body    string     true        "数据id"
+// @Success 200 {string} string	"{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}"
+// @Failure 400 {string} string	"{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}"
+// @Router /api/file [post]
+func (c *AnnexApi) Post() {
+	// 1.规则验证
+	annexData, err := c.ServiceAnnex.ValidCreate(c.Ctx)
+	if err != nil {
+		c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
+		return
+	}
+	dataId, err := utils.GetDecryptId(annexData.DataId)
+	if err != nil {
+		c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
+		return
+	}
+
+	uid, err := utils.GetProjectAccountId(c.Ctx)
+	if err != nil {
+		c.Ctx.JSON(iris.Map{"code": -1, "msg": "未登录或账号失效,请重新登录"})
+		return
+	}
+
+	err = c.ServiceAnnex.Create(uid, annexData.DataType, dataId, annexData.FileList)
+	if err != nil {
+		c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
+		return
+	}
+	c.Ctx.JSON(iris.Map{
+		"code": 0,
+		"msg":  "请求成功",
+	})
+}
+
+// @Summary 删除附件
+// @Tags 附件
+// @Description 删除附件
+// @Accept  json
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param   id     body    string     true        "数据id"
+// @Success 200 {string} string	"{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}"
+// @Failure 400 {string} string	"{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}"
+// @Router /api/file [delete]
+func (c *AnnexApi) Delete() {
+	// 1.规则验证
+	queryId := c.Ctx.URLParam("id")
+	if queryId == "" {
+		c.Ctx.JSON(iris.Map{"code": -1, "msg": "id不能为空"})
+		return
+	}
+	id, err := utils.GetDecryptId(queryId)
+	if err != nil {
+		c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
+		return
+	}
+	err = c.ServiceAnnex.Delete(id)
+	if err != nil {
+		c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
+		return
+	}
 	c.Ctx.JSON(iris.Map{
 		"code": 0,
 		"msg":  "请求成功",
-		"data": data,
 	})
 }

+ 7 - 53
web/api/safe_api.go

@@ -32,6 +32,8 @@ type SafeApi struct {
 // @Produce  json
 // @Security ApiKeyAuth
 // @Param   bidsectionId     path    string     true        "标段ID"
+// @Param   pageNo     path    int     true        "页码" eg:1
+// @Param   pageSize     path    int     true        "页数" eg:15
 // @Success 200 {object} viewmodels.Safe "{code:0成功,data:viewmodels.Safe,msg:}"
 // @Failure 400 {string} string	"{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}"
 // @Router /api/safe [get]
@@ -53,12 +55,13 @@ func (c *SafeApi) Get() {
 		return
 	}
 	// c.ServiceSafe.Get(bidsectionId, RpcConnect)
-	SafeData := c.ServiceSafe.Get(bidsectionId, pid)
+	SafeData, total := c.ServiceSafe.Get(bidsectionId, pid, safeData.PageNo, safeData.PageSize)
 
 	c.Ctx.JSON(iris.Map{
-		"code": 0,
-		"msg":  "请求成功",
-		"data": SafeData,
+		"code":  0,
+		"msg":   "请求成功",
+		"data":  SafeData,
+		"total": total,
 	})
 }
 
@@ -188,52 +191,3 @@ func (c *SafeApi) GetDetail() {
 		"data": SafeData,
 	})
 }
-
-// @Summary 巡检附件记录
-// @Tags 安全巡检
-// @Description 上传附件巡检记录
-// @Accept  json
-// @Produce  json
-// @Security ApiKeyAuth
-// @Param   bidsectionId     body    string     true        "标段ID"
-// @Success 200 {object} viewmodels.Safe "{code:0成功,msg:}"
-// @Failure 400 {string} string	"{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}"
-// @Router /api/safe/file [post]
-// func (c *SafeApi) PostFile() {
-// 	// 1.规则验证
-// 	safeData, err := c.ServiceSafe.ValidFile(c.Ctx)
-// 	if err != nil {
-// 		c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
-// 		return
-// 	}
-// 	bidsectionId, err := utils.GetDecryptId(safeData.BidsectionId)
-// 	if err != nil {
-// 		c.Ctx.JSON(iris.Map{"code": -1, "msg": "ReadJSON转换异常,请检查参数"})
-// 		return
-// 	}
-// 	sId, err := utils.GetDecryptId(safeData.SaveId)
-// 	if err != nil {
-// 		c.Ctx.JSON(iris.Map{"code": -1, "msg": "ReadJSON转换异常,请检查参数"})
-// 		return
-// 	}
-
-// 	uid, err := utils.GetProjectAccountId(c.Ctx)
-// 	if err != nil {
-// 		c.Ctx.JSON(iris.Map{"code": -1, "msg": "未登录或账号失效,请重新登录"})
-// 		return
-// 	}
-
-// 	err = c.ServiceSafe.SaveFileInfo(bidsectionId, sId, uid, safeData.FileList)
-
-// 	if err != nil {
-// 		c.Ctx.JSON(iris.Map{
-// 			"code": -1,
-// 			"msg":  fmt.Sprintf("%s", err),
-// 		})
-// 		return
-// 	}
-// 	c.Ctx.JSON(iris.Map{
-// 		"code": 0,
-// 		"msg":  "请求成功",
-// 	})
-// }

+ 1 - 1
web/main.go

@@ -51,7 +51,7 @@ func main() {
 
 	// api接口文档配置
 	config := &swagger.Config{
-		URL: "http://cm.com/docs/swagger.json", //The url pointing to API definition
+		URL: "http://localhost:6060/docs/swagger.json", //The url pointing to API definition
 	}
 
 	app.Get("/swagger/{any:path}", swagger.CustomWrapHandler(config, swaggerFiles.Handler))

+ 29 - 3
web/viewmodels/annex.go

@@ -21,27 +21,46 @@ type Annex struct {
 	AccountId  string    `form:"accoundId" json:"accoundId"`
 	CreateTime time.Time `form:"createTime" json:"createTime"`
 	UpdateTime time.Time `form:"updateTime" json:"updateTime"`
+	PageNo     int       `from:"pageNo" json:"pageNo"`
+	PageSize   int       `from:"pageSize" json:"pageSize"`
 }
 
 type AnnexList struct {
-	Name       string    `form:"name" json:"name"`
-	OssUrl     string    `form:"OSSUrl" json:"OSSUrl"`
+	FileName   string    `form:"filename" json:"filename"`
+	FilePath   string    `form:"filepath" json:"filepath"`
 	CreateTime time.Time `form:"createTime" json:"createTime"`
 }
 
 type AnnexListView struct {
+	Id          string    `from:"id" json:"id"`
 	FileName    string    `from:"filename" json:"filename"`
 	FilePath    string    `from:"filepath" json:"filepath"`
-	AccountName string    `from:"account_name" json:"acountName"`
+	AccountName string    `from:"accountName" json:"accountName"`
 	AccountId   string    `from:"account_id" json:"acountId"`
 	CreateTime  time.Time `from:"create_time" json:"createTime"`
 }
 
+type AnnexCreate struct {
+	DataType int         `form:"dataType" json:"dataType"`
+	DataId   string      `form:"dataId" json:"dataId"`
+	FileList []AnnexList `form:"fileList" json:"fileList"`
+}
+
+func (l AnnexCreate) ValidateCreate() error {
+	return validation.ValidateStruct(&l,
+		validation.Field(&l.DataType, validation.Required.Error("存储类型不能为空")),
+		validation.Field(&l.DataId, validation.Required.Error("存储ID不能为空")),
+		validation.Field(&l.FileList, validation.Required.Error("附件不能为空")),
+	)
+}
+
 func (l Annex) Validate() error {
 	return validation.ValidateStruct(&l,
 		validation.Field(&l.DataType, validation.Required.Error("存储类型不能为空")),
 		validation.Field(&l.DataId, validation.Required.Error("存储ID不能为空")),
 		validation.Field(&l.AccountId, validation.Required.Error("账号ID不能为空")),
+		validation.Field(&l.PageNo, validation.Required.Error("页码不能为空")),
+		validation.Field(&l.PageSize, validation.Required.Error("页数不能为空")),
 	)
 }
 
@@ -51,3 +70,10 @@ func (l Annex) ValidateGet() error {
 		validation.Field(&l.DataId, validation.Required.Error("存储ID不能为空")),
 	)
 }
+
+// func (l Annex) ValidateAdd() error {
+// 	return validation.ValidateStruct(&l,
+// 		validation.Field(&l.DataType, validation.Required.Error("存储类型不能为空")),
+// 		validation.Field(&l.DataId, validation.Required.Error("存储ID不能为空")),
+// 	)
+// }

+ 11 - 2
web/viewmodels/safe.go

@@ -26,6 +26,8 @@ type Safe struct {
 	InspectionDetail string `form:"inspectionDetail" json:"inspectionDetail"`
 	Demand           string `form:"demand" json:"demand"`
 	Status           int    `form:"status" json:"status"`
+	PageNo           int    `form:"pageNo" json:"pageNo"`
+	PageSize         int    `form:"pageSize" json:"pageSize"`
 }
 type SafeList struct {
 	Id               string `form:"id" json:"id" `
@@ -52,11 +54,16 @@ type SafeDetail struct {
 	Demand           string               `form:"demand" json:"demand"`
 	Status           int                  `form:"status" json:"status"`
 	AuditName        string               `form:"auditName" json:"auditName"`
-	FileList         []AnnexListView      `form:"files" json:"files"`
+	File             FileStruct           `form:"file" json:"file"`
 	Auditors         []Auditors           `form:"auditors" json:"auditors"`
 	auditorHistory   []models.CmSafeAudit `form:"auditorHistory" json:"auditorHistory"`
 }
 
+// 单独出一个struct方便分页使用
+type FileStruct struct {
+	Total    int64           `form:"total" json:"total"`
+	FileList []AnnexListView `form:"fileList" json:"fileList"`
+}
 type SafeFile struct {
 	FileName    string    `from:"filename" json:"filename"`
 	FilePath    string    `from:"filepath" json:"filepath"`
@@ -65,7 +72,7 @@ type SafeFile struct {
 	CreateTime  time.Time `from:"create_time" json:"createTime"`
 }
 type Auditors struct {
-	Name string
+	Name string `from:"name" json:"name"`
 }
 
 type SafeListAuditRecord struct {
@@ -76,6 +83,8 @@ type SafeListAuditRecord struct {
 func (l Safe) ValidateList() error {
 	return validation.ValidateStruct(&l,
 		validation.Field(&l.BidsectionId, validation.Required.Error("标段ID不能为空")),
+		validation.Field(&l.PageNo, validation.Required.Error("页码不能为空")),
+		validation.Field(&l.PageSize, validation.Required.Error("页数不能为空")),
 	)
 }