From b33137dec35adf4e4d19938a2af5f98a5ad05828 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 18 Aug 2023 10:56:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9F=A5=E8=AF=A2=E5=8E=82=E5=AE=B6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8=E5=8F=82=E6=95=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/category.go | 3 +-- ats/verify/simulation/simulation_manage.go | 1 + dto/category.go | 4 ++++ service/category.go | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/category.go b/api/category.go index dd5dce2..59e096d 100644 --- a/api/category.go +++ b/api/category.go @@ -72,10 +72,9 @@ func pageQueryCategory(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/category/list [get] func listQueryCategory(c *gin.Context) { - req := dto.PageCategoryReqDto{} + req := dto.CategoryReqDto{} if err := c.ShouldBind(&req); err != nil { zap.S().Warn("查询参数绑定错误,使用默认参数", err) - req.Default() } zap.S().Debug("查厂家参数", req) page, err := service.ListCategoryQuery(&req) diff --git a/ats/verify/simulation/simulation_manage.go b/ats/verify/simulation/simulation_manage.go index 4933123..f3d9712 100644 --- a/ats/verify/simulation/simulation_manage.go +++ b/ats/verify/simulation/simulation_manage.go @@ -122,6 +122,7 @@ func convert(info *dynamics.TrainInfo, sta *state.TrainState, vs *memory.VerifyS zap.S().Debugf("原始消息:[%d-%d-%d]", info.Number, info.Link, info.LinkOffset) sta.HeadLinkId = strconv.Itoa(int(info.Link)) sta.HeadLinkOffset = int64(info.LinkOffset) + sta.Up = info.Up id, port, offset, runDirection, pointTo := memory.QueryDeviceByCalcLink(vs, int32(info.Link), sta.HeadLinkOffset, sta.Up, sta.RunDirection) zap.S().Debugf("转换后的消息:[%d-车头:%s-偏移:%d-上行:%v-是否ab:%v]", info.Number, id, offset, runDirection, pointTo) sta.HeadDeviceId = id diff --git a/dto/category.go b/dto/category.go index 60f5d45..2d8498a 100644 --- a/dto/category.go +++ b/dto/category.go @@ -5,6 +5,10 @@ type PageCategoryReqDto struct { Name string `json:"name" form:"name"` } +type CategoryReqDto struct { + Name string `json:"name" form:"name"` +} + type CategoryDto struct { Id int `json:"id" form:"id"` Code string `json:"code" form:"code"` diff --git a/service/category.go b/service/category.go index f904219..1ec45a8 100644 --- a/service/category.go +++ b/service/category.go @@ -24,7 +24,7 @@ func PageCategoryQuery(query *dto.PageCategoryReqDto) (*dto.PageDto, error) { } // 查询草稿列表 -func ListCategoryQuery(query *dto.PageCategoryReqDto) ([]*model.Category, error) { +func ListCategoryQuery(query *dto.CategoryReqDto) ([]*model.Category, error) { d := dbquery.Category dq := d.Where() if query.Name != "" {