修改了入库的时候暂存问题
This commit is contained in:
39
src/WMS.Web.Domain/Entitys/uc_warehouse_position.cs
Normal file
39
src/WMS.Web.Domain/Entitys/uc_warehouse_position.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using WMS.Web.Core;
|
||||
using WMS.Web.Core.Help;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Values;
|
||||
|
||||
namespace WMS.Web.Domain.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 老ops箱信息头
|
||||
/// </summary>
|
||||
|
||||
[Serializable]
|
||||
[Table("uc_warehouse_position")]
|
||||
public class uc_warehouse_position : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string position_code { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string position { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -155,6 +155,15 @@ namespace WMS.Web.Domain.IService.Public
|
||||
/// <returns></returns>
|
||||
string GetOrgName(List<ErpOrgDto> erpOrgs, string orgCode);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取仓位编码
|
||||
/// </summary>
|
||||
/// <param name="erpOrgs"></param>
|
||||
/// <param name="orgCode"></param>
|
||||
/// <returns></returns>
|
||||
// string GetPositionName(List<uc_warehouse_position> positons, string postionCode);
|
||||
|
||||
/// <summary>
|
||||
/// 获取组织ID
|
||||
/// </summary>
|
||||
|
||||
@@ -176,6 +176,7 @@ namespace WMS.Web.Domain.IService.Public
|
||||
/// <returns></returns>
|
||||
Task<ResultList<ErpOrgDto>> BillQueryForOrg();
|
||||
|
||||
//Task<ResultList<uc_warehouse_position>> BillQueryForPosi();
|
||||
/// <summary>
|
||||
/// 供应商
|
||||
/// </summary>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Dto.Erp.Org;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
|
||||
namespace WMS.Web.Domain.Infrastructure
|
||||
@@ -32,6 +33,9 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
/// 查询实体集合
|
||||
Task<List<Box>> GetEntityList(List<int> ids);
|
||||
|
||||
/// 查询实体集合
|
||||
Task<List<uc_warehouse_position>> Getuc_warehouse_position();
|
||||
|
||||
Task<List<Box>> GetEntityListByNos(List<string> billNos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -990,6 +990,11 @@ namespace WMS.Web.Domain.Services
|
||||
currentDet = details.Where(x => x.DetailId == det.ErpInStockDetailId.Value.ToString()).FirstOrDefault();
|
||||
if (currentDet != null)
|
||||
{
|
||||
//加了这里yzh20260730
|
||||
if(currentDet.DocumentStatus=="Z")
|
||||
{
|
||||
currentDet.Qty = det.Qty;
|
||||
}
|
||||
var res = await this.QueryFirst(currentDet, erpDto.TargetFormId, entity.BillNo, det, sc_erpService);
|
||||
if (res.result.IsSuccess)
|
||||
entity.SyncSuccess(det.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.erpBillNo);
|
||||
@@ -1328,8 +1333,10 @@ namespace WMS.Web.Domain.Services
|
||||
ErpOperateDto o_dto = new ErpOperateDto(formId, currentDet.OrderBillNo);//res_s.Data
|
||||
if (currentDet.DocumentStatus == ErpOrderStatus.Z.ToString())
|
||||
{
|
||||
|
||||
//保存
|
||||
_logger.LogInformation($"入库单->查询到已有暂存的入库单 开始保存 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(purchaseInstock)}");
|
||||
|
||||
var res_s = await sc_erpService.Save<ErpPurchaseInStockSaveDto>(purchaseInstock, formId);
|
||||
if (!res_s.IsSuccess)
|
||||
{
|
||||
|
||||
@@ -612,6 +612,15 @@ namespace WMS.Web.Domain.Services
|
||||
if (org_result.IsSuccess)
|
||||
orgs = org_result.Data.ToList();
|
||||
|
||||
|
||||
|
||||
//取仓位
|
||||
var postionList = await _boxRepositories.Getuc_warehouse_position();
|
||||
//List<uc_warehouse_position> posi = new List<uc_warehouse_position>();
|
||||
//if (postionList.Count>0)
|
||||
// posi = postionList.ToList();
|
||||
|
||||
|
||||
//取客户
|
||||
var customer_result = await _erpService.BillQueryForCustomer();
|
||||
List<ErpCustomerDto> customers = new List<ErpCustomerDto>();
|
||||
@@ -640,11 +649,15 @@ namespace WMS.Web.Domain.Services
|
||||
var details = outStockList.SelectMany(s => s.Details).ToList();
|
||||
var boxDetails = outStockList.SelectMany(s => s.Details).SelectMany(s => s.BoxsDetails).ToList();
|
||||
var boxList = await _boxRepositories.GetEntityList(boxDetails.Select(s => s.BoxId).ToList());
|
||||
|
||||
foreach (var b in boxDetails)
|
||||
{
|
||||
var detail = details.FirstOrDefault(f => f.Id == b.DetailId);
|
||||
var outStock = outStockList.FirstOrDefault(f => f.Id == detail.Fid);
|
||||
var m = materials.FirstOrDefault(f => f.MaterialNumber.Equals(detail.MaterialNumber));
|
||||
//var postionList = await _boxRepositories.Getuc_warehouse_position(boxDetails.Select(s => s.SubStockCode).ToList());
|
||||
|
||||
|
||||
OutStockTaskInfoDetailsResponse infoDetail = new OutStockTaskInfoDetailsResponse()
|
||||
{
|
||||
BoxBillNo = boxList.FirstOrDefault(f => f.Id == b.BoxId)?.BoxBillNo ?? "",
|
||||
@@ -655,7 +668,8 @@ namespace WMS.Web.Domain.Services
|
||||
BoxHigh = b.BoxHigh,
|
||||
BoxWeight = b.BoxWeight,
|
||||
Qty = b.Qty,
|
||||
position=b.SubStockCode,
|
||||
position_code = b.SubStockCode,
|
||||
position = postionList.FirstOrDefault(f=>f.position_code==b.SubStockCode)?.position??"",
|
||||
SerialNumbers = string.Join(",", b.SerialNumbers),
|
||||
SerialNumberList = b.SerialNumbers,
|
||||
Method = outStock.Method.GetRemark(),
|
||||
|
||||
@@ -407,6 +407,20 @@ namespace WMS.Web.Domain.Services.Public
|
||||
return org == null ? "" : org.Name;
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 获取仓位名称
|
||||
///// </summary>
|
||||
///// <param name="erpOrgs"></param>
|
||||
///// <param name="orgCode"></param>
|
||||
///// <returns></returns>
|
||||
//public string GetPositionName(List<uc_warehouse_position> positons, string postionCode)
|
||||
//{
|
||||
// if (positons == null || positons.Count == 0)
|
||||
// return "";
|
||||
// var posi = positons.Where(x => x.position_code == postionCode).FirstOrDefault();
|
||||
// return posi == null ? "" : posi.position;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 获取组织id
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user