pan
2025-11-08 e83bd2f6a38957c0d47c9e0a6c6b2ca45836e114
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace WIDESEA_DTO.Basic
{
    public class MaterialWithUnits
    {
        public string MaterialCode { get; set; }
        public string IssueUnit { get; set; }
        public string PurchaseUnit { get; set; }
        public string StockUnit { get; set; }
        public List<UnitConversion> UnitConversions { get; set; } = new List<UnitConversion>();
    }
 
    public class UnitConversion
    {
        public string FromUom { get; set; }
        public string ToUom { get; set; }
        public decimal Ratio { get; set; }
    }
 
    public class MaterialWithUnitConversionResult
    {
        public decimal Quantity { get; set; }
        public string Unit { get; set; }
        public bool Converted { get; set; } // 标记是否实际进行了转换
 
        public MaterialWithUnitConversionResult(decimal quantity, string unit, bool converted = true)
        {
            Quantity = quantity;
            Unit = unit;
            Converted = converted;
        }
 
        public override string ToString()
        {
            return $"{Quantity} {Unit}";
        }
    }
 
    public class BatchConversionRequest
    {
        public string RequestId { get; set; }
        public string MaterialCode { get; set; }
        public decimal Quantity { get; set; }
        public string FromUnit { get; set; }
        public string ToUnit { get; set; }
    }
}