|
|
|
@ -0,0 +1,56 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using VOL.Core.Utilities;
|
|
|
|
|
using VOL.Entity.DomainModels;
|
|
|
|
|
using VOL.WMS.IServices.WMS;
|
|
|
|
|
using VOL.WMS.Repositories;
|
|
|
|
|
|
|
|
|
|
namespace VOL.WMS.Services.WMS
|
|
|
|
|
{
|
|
|
|
|
public class OP_WMS_COMMONService : IOP_WMS_COMMONService
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 取消业务相关逻辑检测
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="WMSDOID">业务Id</param>
|
|
|
|
|
/// <param name="CHANGETYPE">变动类型</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public WebResponseContent MoveCancelCheck(string WMSDOID, string CHANGETYPE)
|
|
|
|
|
{
|
|
|
|
|
var result = new WebResponseContent();
|
|
|
|
|
//库存变动明细
|
|
|
|
|
var wmsChanges = Op_Wms_ChangeRepository.Instance
|
|
|
|
|
.FindAsIQueryable(x => x.DOBSNO == WMSDOID && x.CHANGETYPE == CHANGETYPE).ToList();
|
|
|
|
|
//新库存
|
|
|
|
|
var wmsList = OP_WMSRepository.Instance
|
|
|
|
|
.FindAsIQueryable(x => wmsChanges.Select(s => s.WMSID).Contains(x.WMSID)).ToList();
|
|
|
|
|
//库存id列表
|
|
|
|
|
var wmsIdList = wmsList.Select(s => s.WMSID).ToList();
|
|
|
|
|
|
|
|
|
|
if (Op_Wms_ChangeRepository.Instance
|
|
|
|
|
.FindAsIQueryable(x => wmsIdList.Contains(x.WMSID) && x.CHANGETYPE != CHANGETYPE).Any())
|
|
|
|
|
{
|
|
|
|
|
return result.Error(CHANGETYPE + "之后进行过其他操作不能直接取消!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (OP_WMS_OUT_PLAN_DETAILRepository.Instance
|
|
|
|
|
.FindAsIQueryable(x => wmsIdList.Contains((Guid)x.WMSID)).Any())
|
|
|
|
|
{
|
|
|
|
|
return result.Error(CHANGETYPE + "之后的货物已被出库计划引用,不能直接取消!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CHANGETYPE == WMSCHANGTYPE.移库_移入)
|
|
|
|
|
{
|
|
|
|
|
if (OP_WMS_TRANSFERGOODS_DETAILRepository.Instance
|
|
|
|
|
.FindAsIQueryable(x => wmsIdList.Contains((Guid)x.WMSID)).Any())
|
|
|
|
|
{
|
|
|
|
|
return result.Error(CHANGETYPE + "之后的货物已被货权转移业务引用,不能直接取消!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result.OK();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|