|  | @@ -10,6 +10,9 @@ import (
 | 
	
		
			
				|  |  |  	"strings"
 | 
	
		
			
				|  |  |  	"time"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +	"gitee.com/xuyiping_admin/pkg/logger/zaplog"
 | 
	
		
			
				|  |  | +	"go.uber.org/zap"
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
 | 
	
		
			
				|  |  |  	"gitee.com/xuyiping_admin/pkg/xerr"
 | 
	
		
			
				|  |  |  	"gorm.io/gorm"
 | 
	
	
		
			
				|  | @@ -264,12 +267,17 @@ func (s *StoreEntry) CreateGroupTransfer(ctx context.Context, req *pasturePb.Tra
 | 
	
		
			
				|  |  |  				return xerr.WithStack(err)
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -			if err = s.DB.Model(cow).
 | 
	
		
			
				|  |  | -				Updates(map[string]interface{}{
 | 
	
		
			
				|  |  | -					"pen_id":   v.TransferInPenId,
 | 
	
		
			
				|  |  | -					"pen_name": penMap[v.TransferReasonId].Name,
 | 
	
		
			
				|  |  | -				}).Error; err != nil {
 | 
	
		
			
				|  |  | -				return xerr.WithStack(err)
 | 
	
		
			
				|  |  | +			penInfo, ok := penMap[v.TransferInPenId]
 | 
	
		
			
				|  |  | +			if !ok {
 | 
	
		
			
				|  |  | +				return xerr.Custom("转栏的栏舍不存在")
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			cow.EventPenUpdate(penInfo)
 | 
	
		
			
				|  |  | +			if err = s.DB.Model(new(model.Cow)).
 | 
	
		
			
				|  |  | +				Select("pen_id", "pen_name", "cow_type").
 | 
	
		
			
				|  |  | +				Where("id = ?", cow.Id).
 | 
	
		
			
				|  |  | +				Updates(cow).Error; err != nil {
 | 
	
		
			
				|  |  | +				zaplog.Error("CowDiseaseCreate", zap.Any("EventPenUpdate", err))
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			// 事件日志
 |