* feat: support product yarn batches * feat: improve product yarn ratio workflow * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
26 lines
648 B
Go
26 lines
648 B
Go
package logic
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"muyu-apiserver/model"
|
|
"muyu-apiserver/rpc/inventory/pb"
|
|
)
|
|
|
|
func yarnToPb(yarn *model.InvYarn, supplierName string) *pb.YarnInfo {
|
|
return &pb.YarnInfo{
|
|
YarnId: yarn.YarnId,
|
|
YarnName: yarn.YarnName,
|
|
Color: yarn.Color,
|
|
WeightGM: fmt.Sprintf("%.4f", yarn.WeightGM),
|
|
SupplierId: yarn.SupplierId,
|
|
SupplierName: supplierName,
|
|
DyeFactory: yarn.DyeFactory,
|
|
ImageUrl: yarn.ImageUrl,
|
|
Remark: yarn.Remark.String,
|
|
Status: yarn.Status,
|
|
CreatedAt: yarn.CreatedAt.Format("2006-01-02 15:04:05"),
|
|
UpdatedAt: yarn.UpdatedAt.Format("2006-01-02 15:04:05"),
|
|
}
|
|
}
|