|
@@ -52,7 +52,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
|
|
|
|
[ObservableProperty]
|
|
[ObservableProperty]
|
|
[Range(0.1, 100000000, ErrorMessage = "报检数量不能小于等于0")]
|
|
[Range(0.1, 100000000, ErrorMessage = "报检数量不能小于等于0")]
|
|
- private double _inspQuantity; //报检数量
|
|
|
|
|
|
+ private decimal _inspQuantity; //报检数量
|
|
|
|
|
|
[ObservableProperty]
|
|
[ObservableProperty]
|
|
private int _totalPackage; //总包数
|
|
private int _totalPackage; //总包数
|
|
@@ -222,7 +222,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
}
|
|
}
|
|
|
|
|
|
/*将累计报检数量(含本次)、累计报检次数附加到“申请检验准备情况说明”中*/
|
|
/*将累计报检数量(含本次)、累计报检次数附加到“申请检验准备情况说明”中*/
|
|
- double totalInspectedQuantity = InspQuantity + CalculateInspectedQuantity(WorkYear, SelectedCompany?.Guid, SelectedMaterial?.Guid);
|
|
|
|
|
|
+ decimal totalInspectedQuantity = InspQuantity + CalculateInspectedQuantity(WorkYear, SelectedCompany?.Guid, SelectedMaterial?.Guid);
|
|
ApplyDescription += $"该品种累计报检数量:{totalInspectedQuantity}米(含此次报检数量){Environment.NewLine}";
|
|
ApplyDescription += $"该品种累计报检数量:{totalInspectedQuantity}米(含此次报检数量){Environment.NewLine}";
|
|
|
|
|
|
//int totalTimes = CalculateSampleTimes(WorkYear, SelectedCompany?.Guid, SelectedMaterial?.Guid);
|
|
//int totalTimes = CalculateSampleTimes(WorkYear, SelectedCompany?.Guid, SelectedMaterial?.Guid);
|
|
@@ -257,9 +257,9 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
/// <param name="companyGuid">生产企业</param>
|
|
/// <param name="companyGuid">生产企业</param>
|
|
/// <param name="materialGuid">产品</param>
|
|
/// <param name="materialGuid">产品</param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- private double CalculateInspectedQuantity(int year, Guid? companyGuid, Guid? materialGuid)
|
|
|
|
|
|
+ private decimal CalculateInspectedQuantity(int year, Guid? companyGuid, Guid? materialGuid)
|
|
{
|
|
{
|
|
- double totalInspectedQty = 0;
|
|
|
|
|
|
+ decimal totalInspectedQty = 0;
|
|
if (companyGuid == null || materialGuid == null) return 0;
|
|
if (companyGuid == null || materialGuid == null) return 0;
|
|
|
|
|
|
var inspectApplies = _inspectService.Query(x => x.Year == year && x.CompanyGuid == companyGuid && x.MaterialGuid == materialGuid).ToList();
|
|
var inspectApplies = _inspectService.Query(x => x.Year == year && x.CompanyGuid == companyGuid && x.MaterialGuid == materialGuid).ToList();
|
|
@@ -463,7 +463,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
|
|
|
|
if (dt.Columns.Contains("数量"))
|
|
if (dt.Columns.Contains("数量"))
|
|
{
|
|
{
|
|
- double quantity = double.Parse(dr["数量"].ToString() ?? string.Empty);
|
|
|
|
|
|
+ decimal quantity = decimal.Parse(dr["数量"].ToString() ?? string.Empty);
|
|
applyDetail.Quantity = Math.Round(quantity, 1);
|
|
applyDetail.Quantity = Math.Round(quantity, 1);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -574,7 +574,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
{
|
|
{
|
|
errorMessage.Append("合同信息不允许为空!\n");
|
|
errorMessage.Append("合同信息不允许为空!\n");
|
|
}
|
|
}
|
|
- double sum = 0;
|
|
|
|
|
|
+ decimal sum = 0;
|
|
foreach (var detail in ContractDetails)
|
|
foreach (var detail in ContractDetails)
|
|
{
|
|
{
|
|
sum += detail.UnInspectQty;
|
|
sum += detail.UnInspectQty;
|
|
@@ -686,7 +686,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 根据规则分摊报检数量
|
|
/// 根据规则分摊报检数量
|
|
/// </summary>
|
|
/// </summary>
|
|
- private void ShareInspectQty(ObservableCollection<SelectContractDetailModel> contractDetails, double remainQty)
|
|
|
|
|
|
+ private void ShareInspectQty(ObservableCollection<SelectContractDetailModel> contractDetails, decimal remainQty)
|
|
{
|
|
{
|
|
//分摊报检数量
|
|
//分摊报检数量
|
|
if (contractDetails.Count == 0) return;
|
|
if (contractDetails.Count == 0) return;
|
|
@@ -760,7 +760,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
/// </summary>
|
|
/// </summary>
|
|
private void CalculateDetailSummary()
|
|
private void CalculateDetailSummary()
|
|
{
|
|
{
|
|
- double sum = 0;
|
|
|
|
|
|
+ decimal sum = 0;
|
|
foreach (var detail in InspectApplyDetails)
|
|
foreach (var detail in InspectApplyDetails)
|
|
{
|
|
{
|
|
sum += detail.Quantity;
|
|
sum += detail.Quantity;
|