Commit f856eef1 authored by liudong1993's avatar liudong1993
parents 65bbae6a ef351fa1
......@@ -2101,6 +2101,17 @@ namespace Property.Module.FixedAssets
return list;
}
/// <summary>
/// 根据条件获取盘点列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Supplies_Check_Extend> GetSuppliesCheckList(RB_Supplies_Check_Extend dmodel)
{
return supplies_CheckRepository.GetList(dmodel);
}
/// <summary>
/// 新增修改盘点单
/// </summary>
......
......@@ -56,6 +56,20 @@ namespace Property.Repository
{
where += " and " + nameof(RB_Supplies_Check_Extend.BranchId) + "=" + dmodel.BranchId;
}
if (!string.IsNullOrWhiteSpace(dmodel.Periods))
{
where += " and " + nameof(RB_Supplies_Check_Extend.Periods) + " like '%" + dmodel.Periods + "%'";
}
if (dmodel.StartDate.HasValue)
{
where += $" and nameof(RB_Supplies_Check_Extend.StartDate) >={dmodel.StartDate} ";
}
if (dmodel.EndDate.HasValue)
{
where += $" and nameof(RB_Supplies_Check_Extend.StartDate) <={dmodel.EndDate} ";
}
if (!string.IsNullOrWhiteSpace(dmodel.Periods))
{
where += " and " + nameof(RB_Supplies_Check_Extend.Periods) + " like '%" + dmodel.Periods + "%'";
......@@ -64,6 +78,10 @@ namespace Property.Repository
{
where += " and " + nameof(RB_Supplies_Check_Extend.WarehouseId) + "=" + dmodel.WarehouseId;
}
if (dmodel.CheckState.HasValue && dmodel.CheckState > 0)
{
where += " and " + nameof(RB_Supplies_Check_Extend.CheckState) + "=" + (int)dmodel.CheckState;
}
string sql = $@" select * from RB_Supplies_Check {where} order by Id desc";
return Get<RB_Supplies_Check_Extend>(sql).ToList();
}
......
......@@ -226,6 +226,13 @@ namespace Property.WebApi.Controllers.Mall
return ApiResult.Failed("请选择您要出库的商品");
}
//判断当前仓库是否在盘点中2020-07-28 Add By:W
var suppliesCheckList = suppliesModule.GetSuppliesCheckList(new RB_Supplies_Check_Extend { RB_Group_Id = userInfo.RB_Group_id, StartDate = System.DateTime.Now, EndDate = System.DateTime.Now, WarehouseId = applyModel.WarehouseId , CheckState =REBORN.Common.Enum.SuppliesCheckStatusEnum.InTheInventory });
if (suppliesCheckList != null && suppliesCheckList.Any())
{
return ApiResult.ParamIsNull("仓库盘点中,不能出库");
}
//查询之前的申请信息
var oldModel = warehouseOutModule.GetApplyEntity(applyModel.ID).RefMapperTo<RB_WarehouseOut_Apply_Extend>();
if (oldModel != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment