标记同步成功
This commit is contained in:
Binary file not shown.
@@ -165,5 +165,21 @@ namespace WMS.Web.Api.Controllers
|
|||||||
|
|
||||||
return await _inStockService.Sync(dto, loginInfo);
|
return await _inStockService.Sync(dto, loginInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标记同步成功
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Route("Sync")]
|
||||||
|
public async Task<Result> SyncSuccess([FromBody] List<SyncSuccessRequest> dto)
|
||||||
|
{
|
||||||
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||||
|
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||||
|
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||||
|
|
||||||
|
return await _inStockService.SyncSuccess(dto, loginInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,6 +209,13 @@
|
|||||||
<param name="dto"></param>
|
<param name="dto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Api.Controllers.InStockController.SyncSuccess(System.Collections.Generic.List{WMS.Web.Core.Dto.InStock.SyncSuccessRequest})">
|
||||||
|
<summary>
|
||||||
|
标记同步成功
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Api.Controllers.InStockTaskController">
|
<member name="T:WMS.Web.Api.Controllers.InStockTaskController">
|
||||||
<summary>
|
<summary>
|
||||||
入库任务单-接口
|
入库任务单-接口
|
||||||
|
|||||||
@@ -2903,6 +2903,31 @@
|
|||||||
保存入库单-请求对象
|
保存入库单-请求对象
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Core.Dto.InStock.SyncSuccessRequest">
|
||||||
|
<summary>
|
||||||
|
入库单标记同步金蝶成功
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.InStock.SyncSuccessRequest.Id">
|
||||||
|
<summary>
|
||||||
|
单据ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.InStock.SyncSuccessRequest.SourceBillNo">
|
||||||
|
<summary>
|
||||||
|
来源单号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.InStock.SyncSuccessRequest.MaterialNumber">
|
||||||
|
<summary>
|
||||||
|
物料编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.InStock.SyncSuccessRequest.ErpBillNo">
|
||||||
|
<summary>
|
||||||
|
金蝶入库单号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Dto.InStockQueryRequest">
|
<member name="T:WMS.Web.Core.Dto.InStockQueryRequest">
|
||||||
<summary>
|
<summary>
|
||||||
入库单查询请求对象
|
入库单查询请求对象
|
||||||
|
|||||||
@@ -823,6 +823,15 @@
|
|||||||
重传
|
重传
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Entitys.InStock.OperationSyncSuccess(System.String,System.String,System.String)">
|
||||||
|
<summary>
|
||||||
|
同步成功
|
||||||
|
</summary>
|
||||||
|
<param name="sourceBillNo"></param>
|
||||||
|
<param name="materialNumber"></param>
|
||||||
|
<param name="erpBillNo"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Entitys.InStockDetails">
|
<member name="T:WMS.Web.Domain.Entitys.InStockDetails">
|
||||||
<summary>
|
<summary>
|
||||||
wms入库单明细
|
wms入库单明细
|
||||||
@@ -3658,6 +3667,14 @@
|
|||||||
<param name="loginInfo"></param>
|
<param name="loginInfo"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.IInStockService.SyncSuccess(System.Collections.Generic.List{WMS.Web.Core.Dto.InStock.SyncSuccessRequest},WMS.Web.Core.Dto.Login.LoginInDto)">
|
||||||
|
<summary>
|
||||||
|
标记同步成功
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<param name="loginInfo"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.IService.IInStockService.Receive(WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskRequest,WMS.Web.Core.Dto.Login.LoginInDto)">
|
<member name="M:WMS.Web.Domain.IService.IInStockService.Receive(WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskRequest,WMS.Web.Core.Dto.Login.LoginInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
收货
|
收货
|
||||||
@@ -5412,6 +5429,15 @@
|
|||||||
<param name="isTransaction"></param>
|
<param name="isTransaction"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.InStockService.SyncSuccess(System.Collections.Generic.List{WMS.Web.Core.Dto.InStock.SyncSuccessRequest},WMS.Web.Core.Dto.Login.LoginInDto)">
|
||||||
|
<summary>
|
||||||
|
标记同步成功
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<param name="loginInfo"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:System.NotImplementedException"></exception>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Services.InStockTaskBoxService">
|
<member name="T:WMS.Web.Domain.Services.InStockTaskBoxService">
|
||||||
<summary>
|
<summary>
|
||||||
任务单的箱收货记录服务
|
任务单的箱收货记录服务
|
||||||
|
|||||||
30
src/WMS.Web.Core/Dto/InStock/SyncSuccessRequest.cs
Normal file
30
src/WMS.Web.Core/Dto/InStock/SyncSuccessRequest.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using Npoi.Mapper.Attributes;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto.InStock
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 入库单标记同步金蝶成功
|
||||||
|
/// </summary>
|
||||||
|
public class SyncSuccessRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 单据ID
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 来源单号
|
||||||
|
/// </summary>
|
||||||
|
public string SourceBillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
/// </summary>
|
||||||
|
public string MaterialNumber { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 金蝶入库单号
|
||||||
|
/// </summary>
|
||||||
|
public string ErpBillNo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using WMS.Web.Core;
|
using WMS.Web.Core;
|
||||||
|
using WMS.Web.Core.Internal.Results;
|
||||||
using WMS.Web.Domain.Values;
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
namespace WMS.Web.Domain.Entitys
|
namespace WMS.Web.Domain.Entitys
|
||||||
@@ -20,11 +21,11 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// ID
|
/// ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override int Id { get; set; }
|
public override int Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据编号
|
/// 单据编号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BillNo { get; set; }
|
public string BillNo { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 入库类型
|
/// 入库类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -98,7 +99,7 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
this.CreateTime = DateTime.Now;
|
this.CreateTime = DateTime.Now;
|
||||||
if (this.Type == InstockType.Purchase)
|
if (this.Type == InstockType.Purchase)
|
||||||
{
|
{
|
||||||
this.SuccessSync = SyncStatus.SyncIng;
|
this.SuccessSync = SyncStatus.SyncIng;
|
||||||
this.ErpDetails.ForEach(f => f.SuccessSync = SyncStatus.SyncIng);
|
this.ErpDetails.ForEach(f => f.SuccessSync = SyncStatus.SyncIng);
|
||||||
}
|
}
|
||||||
else//非采购订单,这里就没有记录erpdetails的数据了
|
else//非采购订单,这里就没有记录erpdetails的数据了
|
||||||
@@ -151,8 +152,8 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// <param name="erpBillNo"></param>
|
/// <param name="erpBillNo"></param>
|
||||||
public void SyncSuccess(int erpDetailId, int operateId, string erpBillNo)
|
public void SyncSuccess(int erpDetailId, int operateId, string erpBillNo)
|
||||||
{
|
{
|
||||||
var erpd = this.ErpDetails.Where(s=>s.ErpDetailId==erpDetailId).ToList();
|
var erpd = this.ErpDetails.Where(s => s.ErpDetailId == erpDetailId).ToList();
|
||||||
erpd.ForEach(det =>
|
erpd.ForEach(det =>
|
||||||
{
|
{
|
||||||
det.SuccessSync = SyncStatus.Success;
|
det.SuccessSync = SyncStatus.Success;
|
||||||
det.ErpSyncBillNo = erpBillNo;
|
det.ErpSyncBillNo = erpBillNo;
|
||||||
@@ -189,7 +190,7 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
this.OperateId = operateId;
|
this.OperateId = operateId;
|
||||||
this.SyncTime = DateTime.Now;
|
this.SyncTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 全部失败
|
/// 全部失败
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -212,7 +213,7 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
if (this.SuccessSync != SyncStatus.Fail) return;
|
if (this.SuccessSync != SyncStatus.Fail) return;
|
||||||
this.SuccessSync = SyncStatus.SyncIng;
|
this.SuccessSync = SyncStatus.SyncIng;
|
||||||
var erpDetails = this.ErpDetails
|
var erpDetails = this.ErpDetails
|
||||||
.Where(w => w.SuccessSync == SyncStatus.Fail || w.SuccessSync==SyncStatus.SubmitFail || w.SuccessSync == SyncStatus.CheckFail)
|
.Where(w => w.SuccessSync == SyncStatus.Fail || w.SuccessSync == SyncStatus.SubmitFail || w.SuccessSync == SyncStatus.CheckFail)
|
||||||
.ToList();
|
.ToList();
|
||||||
foreach (var e in erpDetails)
|
foreach (var e in erpDetails)
|
||||||
{
|
{
|
||||||
@@ -220,5 +221,27 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
}
|
}
|
||||||
this.Remark = "";
|
this.Remark = "";
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 同步成功
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sourceBillNo"></param>
|
||||||
|
/// <param name="materialNumber"></param>
|
||||||
|
/// <param name="erpBillNo"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Result OperationSyncSuccess(string sourceBillNo, string materialNumber, string erpBillNo)
|
||||||
|
{
|
||||||
|
var erpDetail = this.ErpDetails.FirstOrDefault(f => f.SourceBillNo.Equals(sourceBillNo) && f.MaterialNumber.Equals(materialNumber));
|
||||||
|
if (erpDetail == null) return Result.ReFailure(ResultCodes.NoDateError);
|
||||||
|
if (this.SuccessSync == SyncStatus.Success || erpDetail.SuccessSync == SyncStatus.Success)
|
||||||
|
return Result.ReFailure(ResultCodes.SyncSuccessError);
|
||||||
|
|
||||||
|
erpDetail.ErpSyncBillNo = erpBillNo;
|
||||||
|
erpDetail.SuccessSync = SyncStatus.Success;
|
||||||
|
|
||||||
|
if (this.ErpDetails.Where(w => w.SuccessSync == SyncStatus.Success).Count() == this.ErpDetails.Count())
|
||||||
|
this.SuccessSync = SyncStatus.Success;
|
||||||
|
|
||||||
|
return Result.ReSuccess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ namespace WMS.Web.Domain.IService
|
|||||||
/// <param name="loginInfo"></param>
|
/// <param name="loginInfo"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<Result> Sync(OperateRequest dto, LoginInDto loginInfo, bool isRepeatSync = true);
|
Task<Result> Sync(OperateRequest dto, LoginInDto loginInfo, bool isRepeatSync = true);
|
||||||
|
/// <summary>
|
||||||
|
/// 标记同步成功
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="loginInfo"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Result> SyncSuccess(List<SyncSuccessRequest> dto, LoginInDto loginInfo);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 收货
|
/// 收货
|
||||||
|
|||||||
@@ -1139,7 +1139,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
list.SelectMany(s => s.Details)
|
list.SelectMany(s => s.Details)
|
||||||
.Where(w => t_boxIds.Contains(w.BoxId))
|
.Where(w => t_boxIds.Contains(w.BoxId))
|
||||||
.ForEach(f => f.UnBind = true);
|
.ForEach(f => f.UnBind = true);
|
||||||
|
|
||||||
if (list.Count != 0)
|
if (list.Count != 0)
|
||||||
{
|
{
|
||||||
var isSuccess = await _inStockRepositories.UpdateRange(list, isTransaction);
|
var isSuccess = await _inStockRepositories.UpdateRange(list, isTransaction);
|
||||||
@@ -1148,5 +1148,30 @@ namespace WMS.Web.Domain.Services
|
|||||||
}
|
}
|
||||||
return Result.ReSuccess();
|
return Result.ReSuccess();
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 标记同步成功
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="loginInfo"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<Result> SyncSuccess(List<SyncSuccessRequest> dto, LoginInDto loginInfo)
|
||||||
|
{
|
||||||
|
_logger.LogInformation($"标记同步成功:{JsonConvert.SerializeObject(dto)} 操作人:{loginInfo.UserInfo.StaffId},{loginInfo.UserInfo.Nickname}");
|
||||||
|
|
||||||
|
var ids = dto.Select(s => s.Id).ToList();
|
||||||
|
var entityList = await _inStockRepositories.GetList(ids);
|
||||||
|
foreach (var d in dto)
|
||||||
|
{
|
||||||
|
var entity = entityList.FirstOrDefault(f => f.Id == d.Id);
|
||||||
|
if (entity == null) return Result.ReFailure(ResultCodes.NoDateError);
|
||||||
|
var res = entity.OperationSyncSuccess(d.SourceBillNo, d.MaterialNumber, d.ErpBillNo);
|
||||||
|
if (!res.IsSuccess) return res;
|
||||||
|
}
|
||||||
|
var isSuccess = await _inStockRepositories.UpdateRange(entityList, true);
|
||||||
|
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
|
|
||||||
|
return Result.ReSuccess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,5 +97,6 @@ namespace WMS.Web.Domain.Values
|
|||||||
public static ValueTuple<int, string> SubscribeNotificationNoData = (700001, "订阅通知信息不存在");
|
public static ValueTuple<int, string> SubscribeNotificationNoData = (700001, "订阅通知信息不存在");
|
||||||
|
|
||||||
public static ValueTuple<int, string> GetBarCodeSerialNumberError = (800001, "获取序列码异常");
|
public static ValueTuple<int, string> GetBarCodeSerialNumberError = (800001, "获取序列码异常");
|
||||||
|
public static ValueTuple<int, string> SyncSuccessError = (800002, "单据已经同步成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user