生成同步油漆BOM

This commit is contained in:
qianhao.xu 2025-08-04 11:05:21 +08:00
parent 1a78a1cea0
commit a3eaebdf65
6 changed files with 101 additions and 7 deletions

View File

@ -0,0 +1,40 @@
using Microsoft.AspNetCore.Mvc;
using DOAN.Model.Dto;
using DOAN.Admin.WebApi.Filters;
using DOAN.Service.MES.mm.paintedparts_call.IService;
using DOAN.Model.MES.mm.paintedparts_call;
using DOAN.Model.MES.mm.paintedparts_call.Dto;
//创建时间2025-07-21
namespace DOAN.Admin.WebApi.Controllers
{
/// <summary>
/// 叫料需求表
/// </summary>
[Verify]
[Route("mes/materialManagement/paintedparts_call/generatePaintBOM")]
public class MmGeneratePaintBOMController : BaseController
{
/// <summary>
/// 叫料需求表接口
/// </summary>
private readonly IMmGeneratePaintBOMService _MmGeneratePaintBOMService;
public MmGeneratePaintBOMController(IMmGeneratePaintBOMService mmGeneratePaintBOMService)
{
_MmGeneratePaintBOMService = mmGeneratePaintBOMService;
}
[HttpGet("generateBOM")]
public IActionResult GenerateMaterialBOM()
{
var response = _MmGeneratePaintBOMService.GenerateMaterialBOM();
return SUCCESS(response);
}
}
}

View File

@ -48,5 +48,12 @@ namespace DOAN.Model.MES.ERP
/// </summary>
[SugarColumn(ColumnName = "cInvCCode")]
public string InvCCode { get; set; }
/// <summary>
/// 存货代管商
/// </summary>
[SugarColumn(ColumnName = "clnvDefine8")]
public string ClnvDefine8 { get; set; }
}
}

View File

@ -69,12 +69,22 @@ namespace DOAN.Model.MES.base_
/// </summary>
public string Description { get; set; }
/// <summary>
/// 供应商外键id
/// </summary>
[SugarColumn(ColumnName = "fk_supplier_id")]
public int? FkSupplierId { get; set; }
/// <summary>
/// 供应商代码
/// </summary>
[SugarColumn(ColumnName = "supplier_code")]
public string SupplierCode { get; set; }
/// <summary>
/// 保质期单位
/// </summary>

View File

@ -237,13 +237,7 @@ namespace DOAN.Service.MES.ERP
{
// ERP中的物料清单
List<CustDevMesInventory> ERPInventories = Context.AsTenant()
.QueryableWithAttr<CustDevMesInventory>().ToList();
.QueryableWithAttr<CustDevMesInventory>().ToList();
var childDb = Context.AsTenant().GetConnectionWithAttr<BaseMaterialList>();//线程安全用GetConnectionWithAttrScope
//清空表
childDb.DbMaintenance.TruncateTable<BaseMaterialList>();
@ -257,6 +251,7 @@ namespace DOAN.Service.MES.ERP
.Map(dest => dest.ADDCode, src => src.InvAddCode)
.Map(dest => dest.Unit, src => src.ComUnitName)
.Map(dest => dest.FkMaterialTypeCode, src => src.InvCCode)
.Map(dest => dest.SupplierCode, src => src.ClnvDefine8)
;
List<BaseMaterialList> materialLists = ERPInventories.Adapt<List<BaseMaterialList>>();

View File

@ -0,0 +1,15 @@
using DOAN.Model.MES.mm.paintedparts_call;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DOAN.Service.MES.mm.paintedparts_call.IService
{
public interface IMmGeneratePaintBOMService : IBaseService<MmCallRequests>
{
int GenerateMaterialBOM();
}
}

View File

@ -0,0 +1,27 @@
using DOAN.Model.MES.mm.paintedparts_call;
using DOAN.Service.MES.mm.paintedparts_call.IService;
using Infrastructure.Attribute;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DOAN.Service.MES.mm.paintedparts_call
{
[AppService(ServiceType = typeof(IMmGeneratePaintBOMService), ServiceLifetime = LifeTime.Transient)]
public class MmGeneratePaintBOMService : BaseService<MmCallRequests>, IMmGeneratePaintBOMService
{
/// <summary>
/// 生成同步油漆BOM
/// </summary>
/// <returns></returns>
public int GenerateMaterialBOM()
{
return 0;
}
}
}