|
|
@ -56,6 +56,7 @@ namespace ICS.Application.Business.Service |
|
|
|
/// 出入库记录表的基础操作方法
|
|
|
|
/// </summary>
|
|
|
|
private readonly IIcsWareHouseLotInfoLogManager _icsWareHouseLotInfoLogManager; |
|
|
|
private readonly IRepository<IcsLotOnWipItem, long> _lotOnWipItemRepository;//上料
|
|
|
|
public IcsSanJBarCodeAppService( |
|
|
|
IRepository<IcsItemLot, long> Repository |
|
|
|
, IExtensionAppService extensionService |
|
|
@ -65,6 +66,7 @@ namespace ICS.Application.Business.Service |
|
|
|
, ISystemAppService sysAppService |
|
|
|
, IRepository<IcsWareHouseLotInfoLog, long> wareHouseLrepository |
|
|
|
, IIcsWareHouseLotInfoLogManager icsWareHouseLotInfoLogManager |
|
|
|
, IRepository<IcsLotOnWipItem, long> lotOnWipItemRepository |
|
|
|
) |
|
|
|
{ |
|
|
|
_repository = Repository; |
|
|
@ -75,6 +77,7 @@ namespace ICS.Application.Business.Service |
|
|
|
_sysAppService = sysAppService; |
|
|
|
_wareHouseLrepository = wareHouseLrepository; |
|
|
|
_icsWareHouseLotInfoLogManager = icsWareHouseLotInfoLogManager; |
|
|
|
_lotOnWipItemRepository = lotOnWipItemRepository; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -711,8 +714,13 @@ namespace ICS.Application.Business.Service |
|
|
|
if (entity == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException(L("NoExistsCurrentCode", input.Id)); |
|
|
|
} |
|
|
|
|
|
|
|
var lotwips = _lotOnWipItemRepository.GetAllList(a => a.MLotNo == entity.BarCode); |
|
|
|
if (lotwips != null && lotwips.Count > 0) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("当前条码:"+ entity.BarCode + "已上过料,不能删除发料"); |
|
|
|
} |
|
|
|
|
|
|
|
var log = _wareHouseLrepository.GetAllList(a => a.LotNo == entity.BarCode && a.BusinessCode == "散料发料"); |
|
|
|
|
|
|
|
if (log != null && log.Count() > 0) |
|
|
@ -734,7 +742,17 @@ namespace ICS.Application.Business.Service |
|
|
|
{ |
|
|
|
throw new UserFriendlyException(L("NoExistsCurrentCode", string.Join(",", input.ToArray()))); |
|
|
|
} |
|
|
|
|
|
|
|
List<string> ListBar = entitys.Select(a => a.BarCode).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
var lotwips = _lotOnWipItemRepository.GetAllList(a => ListBar.Contains( a.MLotNo )); |
|
|
|
if (lotwips != null && lotwips.Count > 0) |
|
|
|
{ |
|
|
|
List<string> ListBar_SL = lotwips.Select(a => a.MLotNo).ToList(); |
|
|
|
throw new UserFriendlyException("以下条码已上过料,不能删除发料:" + string.Join(",", ListBar_SL.ToArray())); |
|
|
|
} |
|
|
|
|
|
|
|
var log = _wareHouseLrepository.GetAllList(a => ListBar.Contains(a.LotNo) && a.BusinessCode == "散料发料"); |
|
|
|
if (log != null && log.Count > 0) |
|
|
|
{ |
|
|
|