ソースを参照

warning: health update

Yi 4 日 前
コミット
35f3345096
4 ファイル変更10 行追加7 行削除
  1. 0 4
      go.sum
  2. 6 1
      model/outbound_detail.go
  3. 3 1
      module/backend/goods.go
  4. 1 1
      module/backend/neck_ring_warning.go

+ 0 - 4
go.sum

@@ -36,10 +36,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
 cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
-gitee.com/xuyiping_admin/go_proto v0.0.0-20250624035747-6854c41ebc86 h1:UblLdMMaG8umGXUEDj23Uv4zO5ireKh4tm5FSDqTiVo=
-gitee.com/xuyiping_admin/go_proto v0.0.0-20250624035747-6854c41ebc86/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
-gitee.com/xuyiping_admin/go_proto v0.0.0-20250624083202-b4e70fad3c6f h1:KfgRw6vaWKPJX3w6lOOUSlnJDLelE24YAVWBvsu9UrI=
-gitee.com/xuyiping_admin/go_proto v0.0.0-20250624083202-b4e70fad3c6f/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
 gitee.com/xuyiping_admin/go_proto v0.0.0-20250624095218-69693701e5c3 h1:vc+2kAaoBLBnA6oY1yyVVlhK2xc5ea6IH9F5+jbz62A=
 gitee.com/xuyiping_admin/go_proto v0.0.0-20250624095218-69693701e5c3/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
 gitee.com/xuyiping_admin/go_proto v0.0.0-20250630022121-999540eb0dba h1:rNvvHHAz0biEGAEtJk4MnN9uBCt7PkKLKjuyxtbgljc=

+ 6 - 1
model/outbound_detail.go

@@ -49,9 +49,13 @@ func NewOutboundDetailList(outboundId int64, req []*pasturePb.OutboundApplyGoods
 
 type OutboundDetailSlice []*OutboundDetail
 
-func (o OutboundDetailSlice) ToPB() []*pasturePb.OutboundApplyGoodsItem {
+func (o OutboundDetailSlice) ToPB(unitMap map[pasturePb.Unit_Kind]string) []*pasturePb.OutboundApplyGoodsItem {
 	res := make([]*pasturePb.OutboundApplyGoodsItem, len(o))
 	for i, v := range o {
+		unitName := ""
+		if unit, ok := unitMap[v.Unit]; ok {
+			unitName = unit
+		}
 		res[i] = &pasturePb.OutboundApplyGoodsItem{
 			GoodsId:     int32(v.GoodsId),
 			GoodsName:   v.GoodsName,
@@ -60,6 +64,7 @@ func (o OutboundDetailSlice) ToPB() []*pasturePb.OutboundApplyGoodsItem {
 			BatchNumber: v.BatchNumber,
 			Price:       float32(v.Price) / 100,
 			Unit:        v.Unit,
+			UnitName:    unitName,
 			Quantity:    uint32(v.Quantity),
 		}
 	}

+ 3 - 1
module/backend/goods.go

@@ -553,6 +553,8 @@ func (s *StoreEntry) OutboundDetail(ctx context.Context, id int64) (*pasturePb.O
 	if outbound.ExamineAt > 0 {
 		examineAtFormat = time.Unix(outbound.ExamineAt, 0).Local().Format(model.LayoutTime)
 	}
+
+	unitMap := s.UnitMap()
 	return &pasturePb.OutboundDetailResponse{
 		Code: http.StatusOK,
 		Msg:  "ok",
@@ -571,7 +573,7 @@ func (s *StoreEntry) OutboundDetail(ctx context.Context, id int64) (*pasturePb.O
 			ExamineAtFormat:   examineAtFormat,
 			GoodsItem: &pasturePb.OutboundApplyItem{
 				OutType:          outbound.OutType,
-				Goods:            model.OutboundDetailSlice(outboundLogs).ToPB(),
+				Goods:            model.OutboundDetailSlice(outboundLogs).ToPB(unitMap),
 				ApplicantRemarks: outbound.ApplicantRemarks,
 			},
 		},

+ 1 - 1
module/backend/neck_ring_warning.go

@@ -302,7 +302,7 @@ func (s *StoreEntry) NeckRingNoDiseaseBatch(ctx context.Context, req *pasturePb.
 }
 func (s *StoreEntry) EstrusWarningQuery(ctx context.Context, pastureId int64) (*gorm.DB, error) {
 	nowTime := time.Now().Local()
-	startTime := time.Unix(util.TimeParseLocalUnix(nowTime.Format(model.LayoutDate2)), 0).Format(model.LayoutTime)
+	startTime := time.Unix(util.TimeParseLocalUnix(nowTime.AddDate(0, 0, -1).Format(model.LayoutDate2)), 0).Format(model.LayoutTime)
 	entTime := time.Unix(util.TimeParseLocalEndUnix(nowTime.Format(model.LayoutDate2)), 0).Format(model.LayoutTime)
 	systemBasic, err := s.FindSystemBasic(ctx, pastureId, model.EstrusWaringDays)
 	if err != nil {