Compare commits

..

2 Commits

Author SHA1 Message Date
e690af265a 测试 2026-04-15 13:57:21 +08:00
13ec30acbd 改了规格 2026-04-15 13:56:39 +08:00
8 changed files with 83 additions and 20 deletions

View File

@@ -25,16 +25,19 @@ namespace BarCode.Web.Api.Controllers
private readonly IBoxMarkService _boxMarkService;
private readonly IBoxMarkRepositories _boxMarkRepositories;
private readonly IExportExcelService _exportExcelService;
private readonly IErpBasicDataExtendService _erpBasicDataExtendService;
public BoxMarkController(
ILoginService loginService,
IBoxMarkRepositories boxMarkRepositories,
IBoxMarkService boxMarkService,
IExportExcelService exportExcelService)
IExportExcelService exportExcelService, IErpBasicDataExtendService erpBasicDataExtendService)
{
this._loginService = loginService;
this._boxMarkService = boxMarkService;
this._exportExcelService = exportExcelService;
this._boxMarkRepositories = boxMarkRepositories;
this._erpBasicDataExtendService = erpBasicDataExtendService;
}
/// <summary>

View File

@@ -160,16 +160,16 @@
物料规格型号
</summary>
</member>
<member name="P:BarCode.Web.Core.Dto.BoxMarkQueryResponse.MaterialNumber">
<summary>
物料编码
</summary>
</member>
<member name="P:BarCode.Web.Core.Dto.BoxMarkQueryResponse.MaterialName">
<summary>
物料名称
</summary>
</member>
<member name="P:BarCode.Web.Core.Dto.BoxMarkQueryResponse.MaterialNumber">
<summary>
物料编码
</summary>
</member>
<member name="P:BarCode.Web.Core.Dto.BoxMarkQueryResponse.BarCode">
<summary>
69条码
@@ -266,6 +266,16 @@
物料
</summary>
</member>
<member name="P:BarCode.Web.Core.Dto.GenerateBoxMarkDto.Specifications">
<summary>
物料规格
</summary>
</member>
<member name="P:BarCode.Web.Core.Dto.GenerateBoxMarkDto.MaterialName">
<summary>
物料名称
</summary>
</member>
<member name="P:BarCode.Web.Core.Dto.GenerateBoxMarkDto.ProductQty">
<summary>
产品数量

View File

@@ -181,6 +181,16 @@
物料编码
</summary>
</member>
<member name="P:BarCode.Web.Domain.Entitys.BoxMark.Specifications">
<summary>
物料编码
</summary>
</member>
<member name="P:BarCode.Web.Domain.Entitys.BoxMark.MaterialName">
<summary>
物料名称
</summary>
</member>
<member name="P:BarCode.Web.Domain.Entitys.BoxMark.ProductQty">
<summary>
产品数量

View File

@@ -34,14 +34,15 @@ namespace BarCode.Web.Core.Dto
/// </summary>
public string Specifications { get; set; }
/// <summary>
/// 物料名称
/// </summary>
public string MaterialName { get; set; }
/// <summary>
/// 物料编码
/// </summary>
public string MaterialNumber { get; set; }
/// <summary>
/// 物料名称
/// </summary>
public string MaterialName { get; set; }
/// <summary>
/// 69条码

View File

@@ -28,6 +28,14 @@ namespace BarCode.Web.Core.Dto
[Required(ErrorMessage = "物料不能为空")]
public string MaterialNumber { get; set; } = string.Empty;
/// <summary>
/// 物料规格
/// </summary>
public string? Specifications { get; set; } = string.Empty;
/// <summary>
/// 物料名称
/// </summary>
public string? MaterialName { get; set; } = string.Empty;
/// <summary>
/// 产品数量
/// </summary>

View File

@@ -36,8 +36,20 @@ namespace BarCode.Web.Domain.Entitys
/// <summary>
/// 物料编码
/// </summary>
public string MaterialNumber { get; set; }
/// <summary>
/// 物料编码
/// </summary>
[Column("Specifications")]
public string Specifications { get; set; }
/// <summary>
/// 物料名称
/// </summary>
[Column("MaterialName")]
public string MaterialName { get; set; }
/// <summary>
/// 产品数量
/// </summary>

View File

@@ -1,19 +1,22 @@
using AutoMapper;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BarCode.Web.Core.Dto;
using BarCode.Web.Core.Dto.Erp;
using BarCode.Web.Core.Dto.Login;
using BarCode.Web.Core.Internal.Results;
using BarCode.Web.Domain.Entitys;
using BarCode.Web.Domain.Infrastructure;
using BarCode.Web.Domain.IService;
using BarCode.Web.Domain.IService.Public;
using BarCode.Web.Domain.Services.Public;
using BarCode.Web.Domain.Values;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Org.BouncyCastle.Utilities.Date;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BarCode.Web.Domain.Services
{
@@ -26,14 +29,18 @@ namespace BarCode.Web.Domain.Services
public readonly IBasicsRepositories _transactionRepositories;
private readonly IBoxMarkRepositories _boxMarkRepositories;
private readonly ILogger<BoxMarkService> _logger;
private readonly IErpBasicDataExtendService _erpBasicDataExtendService;
private readonly IErpService _erpService;
public BoxMarkService(IMapper mapper, ILogger<BoxMarkService> logger,
IBasicsRepositories transactionRepositories,
IBoxMarkRepositories boxMarkRepositories)
IBoxMarkRepositories boxMarkRepositories, IErpBasicDataExtendService erpBasicDataExtendService, IErpService erpService)
{
_mapper = mapper;
_logger = logger;
_transactionRepositories = transactionRepositories;
_boxMarkRepositories = boxMarkRepositories;
_erpBasicDataExtendService = erpBasicDataExtendService;
_erpService = erpService;
}
/// <summary>
@@ -54,12 +61,23 @@ namespace BarCode.Web.Domain.Services
//1.获取最新的箱唛信息
var billNo_new = await _boxMarkRepositories.GetLastBillNo();
var materials_result = _erpService.BillQueryForMaterial().GetAwaiter().GetResult();
List<ErpMaterialDto> materials = new List<ErpMaterialDto>();
if (materials_result.IsSuccess)
materials = materials_result.Data.ToList();
dto.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, dto.MaterialNumber);
dto.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, dto.MaterialNumber);
//2.dto映射实体
var entity = new BoxMark();
entity= _mapper.Map(dto, entity);
entity.Create(loginInfo.UserInfo.UcId);
entity.SupplierCode = supplierCode;
entity.OrgCode = orgCode;
entity.Specifications = dto.Specifications;
entity.MaterialName=dto.MaterialName;
int new_firstBillNo = billNo_new == null ? 0 : billNo_new.FirstBillNo;
int new_lastBillNo = billNo_new == null ? 0 : billNo_new.LastBillNo;
entity.GenerateBillNo(new_firstBillNo, new_lastBillNo);

View File

@@ -148,6 +148,7 @@ namespace BarCode.Web.Repositories
if (dto.CreateEndDate != null)
query = query.Where(w => w.order.CreateTime.Date <= dto.CreateEndDate.Value);
int total = await query.CountAsync();
var list = await query.Select(s => new BoxMarkQueryResponse()
{
@@ -155,9 +156,9 @@ namespace BarCode.Web.Repositories
DetailId=s.detail.Id,
BillNo = s.detail.BillNo,
OrderBillNo = s.order.OrderBillNo,
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.order.MaterialNumber),
MaterialName = string.IsNullOrEmpty(s.order.MaterialName) ? _erpBasicDataExtendService.GetMaterialName(materials, s.order.MaterialNumber) : s.order.MaterialName, //_erpBasicDataExtendService.GetMaterialName(materials, s.order.MaterialNumber),
MaterialNumber = s.order.MaterialNumber,
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.order.MaterialNumber),
Specifications = string.IsNullOrEmpty(s.order.Specifications) ? _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.order.MaterialNumber) : s.order.Specifications,//_erpBasicDataExtendService.GetMaterialSpecifications(materials, s.order.MaterialNumber),
BarCode = _erpBasicDataExtendService.GetMaterialBarCode(materials, s.order.MaterialNumber),
CratingQty = s.order.CratingQty,