// Package genin // @Link https://github.com/xiujiecn/xiu-admin // @Copyright Copyright (c) 2026 LiXiujie // @Author Lxj // @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE // @AutoGenerate Version package model import ( "context" "git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/library/allocationunits" "git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/library/xgorm/hook" "git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model/entity" "git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model/request" "github.com/gogf/gf/v2/encoding/gjson" "github.com/gogf/gf/v2/os/gtime" ) // BatchMainUpdateFields 修改批次主表字段过滤 type BatchMainUpdateFields struct { BatchNo string `json:"batchNo" dc:"批次编号"` OrderSn string `json:"orderSn" dc:"订单编号"` BatchType int `json:"batchType" dc:"批次类型 枚举"` BatchStatus int `json:"batchStatus" dc:"批次状态 枚举"` SourceType int `json:"sourceType" dc:"来源方式 枚举"` SourceBatchNo string `json:"sourceBatchNo" dc:"来源批次编号"` IsCrossDept int `json:"isCrossDept" dc:"是否跨级操作机构 0-否 1-是"` TargetDeptId int64 `json:"targetDeptId" dc:"目标机构编号"` DeptId int64 `json:"deptId" dc:"机构编号"` TotalCount int `json:"totalCount" dc:"总数量"` ValidCount int `json:"validCount" dc:"有效数量"` SuccessCount int `json:"successCount" dc:"成功数量"` FailCount int `json:"failCount" dc:"失败数量"` RunResult int `json:"runResult" dc:"运行结果:0-待运行 1-运行中 2-成功 3-失败"` FailReason string `json:"failReason" dc:"失败原因"` BatchInfo *gjson.Json `json:"batchInfo" dc:"批次信息:入库/出库展示字段"` Remark *gjson.Json `json:"remark" dc:"备注扩展字段"` StartTime *gtime.Time `json:"startTime" dc:"开始时间"` EndTime *gtime.Time `json:"endTime" dc:"结束时间"` TenantId string `json:"tenantId" dc:"租户ID"` UpdatedBy int64 `json:"updatedBy" dc:"更新者ID"` UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"` } // BatchMainInsertFields 新增批次主表字段过滤 type BatchMainInsertFields struct { SourceChannel string `json:"sourceChannel" dc:"发起渠道"` ExecutionMode int `json:"executionMode" dc:"操作规模"` BatchNo string `json:"batchNo" dc:"批次编号"` OrderSn string `json:"orderSn" dc:"订单编号"` BatchType int `json:"batchType" dc:"批次类型 枚举"` BatchStatus int `json:"batchStatus" dc:"批次状态 枚举"` SourceType int `json:"sourceType" dc:"来源方式 枚举"` SourceBatchNo string `json:"sourceBatchNo" dc:"来源批次编号"` IsCrossDept int `json:"isCrossDept" dc:"是否跨级操作机构 0-否 1-是"` TargetDeptId int64 `json:"targetDeptId" dc:"目标机构编号"` DeptId int64 `json:"deptId" dc:"机构编号"` TotalCount int `json:"totalCount" dc:"总数量"` ValidCount int `json:"validCount" dc:"有效数量"` SuccessCount int `json:"successCount" dc:"成功数量"` FailCount int `json:"failCount" dc:"失败数量"` RunResult int `json:"runResult" dc:"运行结果:0-待运行 1-运行中 2-成功 3-失败"` FailReason string `json:"failReason" dc:"失败原因"` BatchInfo *gjson.Json `json:"batchInfo" dc:"批次信息:入库/出库展示字段"` Remark *gjson.Json `json:"remark" dc:"备注扩展字段"` StartTime *gtime.Time `json:"startTime" dc:"开始时间"` EndTime *gtime.Time `json:"endTime" dc:"结束时间"` TenantId string `json:"tenantId" dc:"租户ID"` CreatedDept int64 `json:"createdDept" dc:"创建部门ID"` CreatedBy int64 `json:"createdBy" dc:"创建者ID"` CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"` } // BatchMainEditParam 修改/新增批次主表 type BatchMainEditParam struct { //entity.BatchMain ExecutionMode *int `json:"executionMode" v:"in:1,2" dc:"新建批次操作规模:1单卡2批量"` Id int64 `json:"id" dc:"主键ID"` BatchNo *string `json:"batchNo" dc:"批次编号"` OrderSn *string `json:"orderSn" dc:"订单编号"` BatchType *int `json:"batchType" dc:"批次类型 枚举"` BatchStatus *int `json:"batchStatus" dc:"批次状态 枚举"` SourceType *int `json:"sourceType" dc:"来源方式 枚举"` SourceBatchNo *string `json:"sourceBatchNo" dc:"来源批次编号"` IsCrossDept *int `json:"isCrossDept" dc:"是否跨级操作机构 0-否 1-是"` TargetDeptId *int64 `json:"targetDeptId" dc:"目标机构编号"` DeptId *int64 `json:"deptId" dc:"机构编号"` TotalCount *int `json:"totalCount" dc:"总数量"` ValidCount *int `json:"validCount" dc:"有效数量"` SuccessCount *int `json:"successCount" dc:"成功数量"` FailCount *int `json:"failCount" dc:"失败数量"` RunResult *int `json:"runResult" dc:"运行结果:0-待运行 1-运行中 2-成功 3-失败"` FailReason *string `json:"failReason" dc:"失败原因"` BatchInfo *gjson.Json `json:"batchInfo" dc:"批次信息:入库/出库展示字段"` Remark *gjson.Json `json:"remark" dc:"备注扩展字段"` StartTime *gtime.Time `json:"startTime" dc:"开始时间"` EndTime *gtime.Time `json:"endTime" dc:"结束时间"` TenantId *string `json:"tenantId" dc:"租户ID"` CreatedDept *int64 `json:"createdDept" dc:"创建部门ID"` CreatedBy *int64 `json:"createdBy" dc:"创建者ID"` CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"` UpdatedBy *int64 `json:"updatedBy" dc:"更新者ID"` UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"` } func (in *BatchMainEditParam) Filter(ctx context.Context) (err error) { return } type BatchMainEditModel struct{} // BatchMainDeleteParam 删除批次主表 type BatchMainDeleteParam struct { Id interface{} `json:"id" v:"required#主键ID不能为空" dc:"主键ID"` } func (in *BatchMainDeleteParam) Filter(ctx context.Context) (err error) { return } type BatchMainDeleteModel struct{} type BatchMainRequeueParam struct { BatchNo string `json:"batchNo" v:"required#批次编号不能为空" dc:"批次编号"` Reason string `json:"reason" v:"required#重投原因不能为空" dc:"重投原因"` } func (in *BatchMainRequeueParam) Filter(ctx context.Context) (err error) { return } type BatchMainRequeueModel struct { BatchNo string `json:"batchNo" dc:"批次编号"` BatchType int `json:"batchType" dc:"批次类型"` BatchAsyncStatus int `json:"batchAsyncStatus" dc:"异步处理状态"` RunResult int `json:"runResult" dc:"运行结果"` Requeued bool `json:"requeued" dc:"是否已重投"` } // BatchMainViewParam 获取指定批次主表信息 type BatchMainViewParam struct { Id int64 `json:"id" v:"required#主键ID不能为空" dc:"主键ID"` } func (in *BatchMainViewParam) Filter(ctx context.Context) (err error) { return } type BatchMainViewModel struct { entity.BatchMain SourceDeptId int64 `json:"sourceDeptId" orm:"-"` SourceDeptName string `json:"sourceDeptName" orm:"-"` TargetDeptName string `json:"targetDeptName" orm:"-"` TargetDeptMode string `json:"targetDeptMode" orm:"-"` CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者ID摘要信息"` UpdatedBySumma *hook.MemberSumma `json:"updatedBySumma" dc:"更新者ID摘要信息"` } // BatchMainListParam 获取批次主表列表 type BatchMainListParam struct { request.PageInfo Id int64 `json:"id" dc:"主键ID"` BatchNo string `json:"batchNo" dc:"批次编号"` OrderSn string `json:"orderSn" dc:"订单编号"` BatchType *int `json:"batchType" dc:"批次类型 枚举"` CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"` } func (in *BatchMainListParam) Filter(ctx context.Context) (err error) { return } type BatchMainListModel struct { SourceDeptId int64 `json:"sourceDeptId" orm:"-"` SourceDeptName string `json:"sourceDeptName" orm:"-"` TargetDeptName string `json:"targetDeptName" orm:"-"` TargetDeptMode string `json:"targetDeptMode" orm:"-"` BatchInfo *gjson.Json `json:"batchInfo" dc:"批次信息:入库/出库展示字段"` Id int64 `json:"id" dc:"主键ID"` BatchNo string `json:"batchNo" dc:"批次编号"` OrderSn string `json:"orderSn" dc:"订单编号"` BatchType int `json:"batchType" dc:"批次类型 枚举"` BatchAsyncStatus int `json:"batchAsyncStatus" dc:"异步处理状态 0=已创建 1=待处理 2=处理中 3=成功 4=失败 5=部分成功"` SourceType int `json:"sourceType" dc:"来源方式 枚举"` SourceBatchNo string `json:"sourceBatchNo" dc:"来源批次编号"` IsCrossDept int `json:"isCrossDept" dc:"是否跨级操作机构 0-否 1-是"` TargetDeptId int64 `json:"targetDeptId" dc:"目标机构编号"` DeptId int64 `json:"deptId" dc:"机构编号"` TotalCount int `json:"totalCount" dc:"总数量"` ValidCount int `json:"validCount" dc:"有效数量"` SuccessCount int `json:"successCount" dc:"成功数量"` FailCount int `json:"failCount" dc:"失败数量"` RunResult int `json:"runResult" dc:"运行结果:0-待运行 1-运行中 2-成功 3-失败"` StartTime *gtime.Time `json:"startTime" dc:"开始时间"` EndTime *gtime.Time `json:"endTime" dc:"结束时间"` TenantId string `json:"tenantId" dc:"租户ID"` CreatedDept int64 `json:"createdDept" dc:"创建部门ID"` CreatedBy int64 `json:"createdBy" dc:"创建者ID"` CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者ID摘要信息"` CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"` UpdatedBy int64 `json:"updatedBy" dc:"更新者ID"` UpdatedBySumma *hook.MemberSumma `json:"updatedBySumma" dc:"更新者ID摘要信息"` UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"` } // BatchMainSuccessListParam 获取指定类型成功批次列表 type BatchMainSuccessListParam struct { request.PageInfo ChanKey string `json:"chanKey" dc:"上游渠道编码"` BatchType int `json:"batchType" dc:"批次类型(不传则查询所有成功批次)"` BatchNo string `json:"batchNo" dc:"批次编号"` Time []*gtime.Time `json:"time" dc:"批次执行时间"` } func (in *BatchMainSuccessListParam) Filter(ctx context.Context) (err error) { return } type BatchMainSuccessListModel struct { allocationunits.Fields StoredSourceDeptId int64 `json:"-" orm:"created_dept"` StoredTargetDeptId int64 `json:"-" orm:"target_dept_id"` BatchInfo *gjson.Json `json:"batchInfo" dc:"批次业务参数"` BatchNo string `json:"batchNo" dc:"批次编号"` BatchType int `json:"batchType" dc:"批次类型"` BatchTime *gtime.Time `json:"batchTime" orm:"start_time" dc:"批次执行时间"` TotalCount int `json:"totalCount" dc:"总数量"` StockCount int `json:"stockCount" dc:"在库数量"` } // BatchMainExportModel 导出批次主表 type BatchMainExportModel struct { Id int64 `json:"id" dc:"主键ID"` BatchNo string `json:"batchNo" dc:"批次编号"` OrderSn string `json:"orderSn" dc:"订单编号"` BatchType int `json:"batchType" dc:"批次类型 枚举"` BatchAsyncStatus int `json:"batchAsyncStatus" dc:"异步处理状态 0=已创建 1=待处理 2=处理中 3=成功 4=失败 5=部分成功"` SourceType int `json:"sourceType" dc:"来源方式 枚举"` SourceBatchNo string `json:"sourceBatchNo" dc:"来源批次编号"` IsCrossDept int `json:"isCrossDept" dc:"是否跨级操作机构 0-否 1-是"` TargetDeptId int64 `json:"targetDeptId" dc:"目标机构编号"` DeptId int64 `json:"deptId" dc:"机构编号"` TotalCount int `json:"totalCount" dc:"总数量"` ValidCount int `json:"validCount" dc:"有效数量"` SuccessCount int `json:"successCount" dc:"成功数量"` FailCount int `json:"failCount" dc:"失败数量"` RunResult int `json:"runResult" dc:"运行结果:0-待运行 1-运行中 2-成功 3-失败"` StartTime *gtime.Time `json:"startTime" dc:"开始时间"` EndTime *gtime.Time `json:"endTime" dc:"结束时间"` TenantId string `json:"tenantId" dc:"租户ID"` CreatedDept int64 `json:"createdDept" dc:"创建部门ID"` CreatedBy int64 `json:"createdBy" dc:"创建者ID"` CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"` UpdatedBy int64 `json:"updatedBy" dc:"更新者ID"` UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"` }