Commit dcde14c7 authored by liudong1993's avatar liudong1993

1

parent 3a7e30ec
...@@ -30,6 +30,11 @@ namespace Property.Model.Extend ...@@ -30,6 +30,11 @@ namespace Property.Model.Extend
/// 仓库id /// 仓库id
/// </summary> /// </summary>
public int? WareHouseId { get; set; } public int? WareHouseId { get; set; }
/// <summary>
/// 是否查询库存 1是
/// </summary>
public int? IsSelectInventory { get; set; }
/// <summary> /// <summary>
/// 库存数量 /// 库存数量
/// </summary> /// </summary>
......
...@@ -3807,6 +3807,8 @@ namespace Property.Module.FixedAssets ...@@ -3807,6 +3807,8 @@ namespace Property.Module.FixedAssets
{ {
var list = property_BuyingRequisitionRepository.GetPageList(pageIndex, pageSize, demodel, out count); var list = property_BuyingRequisitionRepository.GetPageList(pageIndex, pageSize, demodel, out count);
if (list.Any()) { if (list.Any()) {
string SchoolIds = string.Join(",", list.Select(x => x.SchoolId).Distinct());
var slist = schoolRepository.GetSchoolListRepository(new RB_School_ViewModel() { Group_Id = demodel.RB_Group_Id ?? 0, QSIds = SchoolIds });
foreach (var item in list) { foreach (var item in list) {
if (item.Images == "" || item.Images == null) if (item.Images == "" || item.Images == null)
{ {
...@@ -3818,6 +3820,7 @@ namespace Property.Module.FixedAssets ...@@ -3818,6 +3820,7 @@ namespace Property.Module.FixedAssets
{ {
item.ImageList.Add(Config.GetFileUrl(img)); item.ImageList.Add(Config.GetFileUrl(img));
} }
item.SchoolName = slist.Where(x => x.SId == item.SchoolId).FirstOrDefault()?.SName ?? "";
} }
} }
return list; return list;
...@@ -4507,7 +4510,7 @@ namespace Property.Module.FixedAssets ...@@ -4507,7 +4510,7 @@ namespace Property.Module.FixedAssets
//先生成采购信息 //先生成采购信息
demodel.SupplierName = supplierModel.Name; demodel.SupplierName = supplierModel.Name;
demodel.TotalNumber = demodel.DetailList.Sum(x => x.Number); demodel.TotalNumber = demodel.DetailList.Sum(x => x.Number);
demodel.TotalCostMoney = demodel.DetailList.Sum(x => x.CostMoney); demodel.TotalCostMoney = demodel.DetailList.Sum(x => x.CostMoney * x.Number);
demodel.StockInStatus = 1; demodel.StockInStatus = 1;
int ProcurementId = property_ProcurementRepository.Insert(demodel); int ProcurementId = property_ProcurementRepository.Insert(demodel);
if (ProcurementId > 0) { if (ProcurementId > 0) {
......
...@@ -205,6 +205,10 @@ namespace Property.Module.FixedAssets ...@@ -205,6 +205,10 @@ namespace Property.Module.FixedAssets
string Sstr = string.Join(",", list.Select(x => x.Id).Distinct()); string Sstr = string.Join(",", list.Select(x => x.Id).Distinct());
iList = supplies_InventoryRepository.GetList(new RB_Supplies_Inventory_Extend() { RB_Group_Id = demodel.RB_Group_Id, WarehouseIdStr = demodel.WareHouseId.Value.ToString(), SuppliesIdStr = Sstr }); iList = supplies_InventoryRepository.GetList(new RB_Supplies_Inventory_Extend() { RB_Group_Id = demodel.RB_Group_Id, WarehouseIdStr = demodel.WareHouseId.Value.ToString(), SuppliesIdStr = Sstr });
} }
if (demodel.IsSelectInventory == 1 && list.Any()) {
string Sstr = string.Join(",", list.Select(x => x.Id).Distinct());
iList = supplies_InventoryRepository.GetList(new RB_Supplies_Inventory_Extend() { RB_Group_Id = demodel.RB_Group_Id, SuppliesIdStr = Sstr });
}
foreach (var item in list) foreach (var item in list)
{ {
if (item.Images == "" || item.Images == null) if (item.Images == "" || item.Images == null)
...@@ -217,7 +221,7 @@ namespace Property.Module.FixedAssets ...@@ -217,7 +221,7 @@ namespace Property.Module.FixedAssets
{ {
item.ImageList.Add(Config.GetFileUrl(img)); item.ImageList.Add(Config.GetFileUrl(img));
} }
item.InventoryNum = iList.Where(x => x.SuppliesId == item.Id).FirstOrDefault()?.Number ?? 0; item.InventoryNum = iList.Where(x => x.SuppliesId == item.Id)?.Sum(x => x.Number ?? 0);
item.GoodsSpecificationList = new List<string>(); item.GoodsSpecificationList = new List<string>();
item.GoodsCategoryList = new List<string>(); item.GoodsCategoryList = new List<string>();
if (!string.IsNullOrEmpty(item.SpecificationName)) if (!string.IsNullOrEmpty(item.SpecificationName))
...@@ -3909,7 +3913,7 @@ namespace Property.Module.FixedAssets ...@@ -3909,7 +3913,7 @@ namespace Property.Module.FixedAssets
//先生成采购信息 //先生成采购信息
demodel.SupplierName = supplierModel.Name; demodel.SupplierName = supplierModel.Name;
demodel.TotalNumber = demodel.DetailList.Sum(x => x.Number); demodel.TotalNumber = demodel.DetailList.Sum(x => x.Number);
demodel.TotalCostMoney = demodel.DetailList.Sum(x => x.CostMoney); demodel.TotalCostMoney = demodel.DetailList.Sum(x => x.CostMoney * x.Number);
demodel.StockInStatus = 1; demodel.StockInStatus = 1;
int ProcurementId = supplies_ProcurementRepository.Insert(demodel); int ProcurementId = supplies_ProcurementRepository.Insert(demodel);
if (ProcurementId > 0) if (ProcurementId > 0)
...@@ -4013,7 +4017,7 @@ namespace Property.Module.FixedAssets ...@@ -4013,7 +4017,7 @@ namespace Property.Module.FixedAssets
} }
}; };
property_BuyingRequisitionRepository.Update(keyValues, wheres); property_BuyingRequisitionRepository.Update(keyValues, wheres);
Remark = "通过请购单【" + demodel.BuyingRequisitionId + "】生成资产采购单;"; Remark = "通过请购单【" + demodel.BuyingRequisitionId + "】生成耗材采购单;";
} }
//更新采购信息 单据id //更新采购信息 单据id
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
...@@ -4046,7 +4050,7 @@ namespace Property.Module.FixedAssets ...@@ -4046,7 +4050,7 @@ namespace Property.Module.FixedAssets
} }
}; };
property_BuyingRequisitionRepository.Update(keyValues, wheres); property_BuyingRequisitionRepository.Update(keyValues, wheres);
Remark = "通过请购单【" + demodel.BuyingRequisitionId + "】生成资产采购单;"; Remark = "通过请购单【" + demodel.BuyingRequisitionId + "】生成耗材采购单;";
} }
//更新采购信息 单据id //更新采购信息 单据id
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
...@@ -4755,7 +4759,7 @@ namespace Property.Module.FixedAssets ...@@ -4755,7 +4759,7 @@ namespace Property.Module.FixedAssets
var financeObj = new var financeObj = new
{ {
demodel.CreateBy, userInfo.EmployeeId,
IsPublic = 0,//存货出库 IsPublic = 0,//存货出库
ClientType = 10, ClientType = 10,
configModel.ClientID, configModel.ClientID,
......
...@@ -29,6 +29,9 @@ namespace Property.Repository ...@@ -29,6 +29,9 @@ namespace Property.Repository
if (!string.IsNullOrEmpty(dmodel.Name)) { if (!string.IsNullOrEmpty(dmodel.Name)) {
where += " and pb." + nameof(RB_Property_BuyingRequisition_Extend.Name) + " like '%" + dmodel.Name+"%'"; where += " and pb." + nameof(RB_Property_BuyingRequisition_Extend.Name) + " like '%" + dmodel.Name+"%'";
} }
if (dmodel.Id > 0) {
where += " and pb." + nameof(RB_Property_BuyingRequisition_Extend.Id) + " =" + dmodel.Id;
}
if (dmodel.Type > 0) { if (dmodel.Type > 0) {
where += " and pb." + nameof(RB_Property_BuyingRequisition_Extend.Type) + " =" + dmodel.Type; where += " and pb." + nameof(RB_Property_BuyingRequisition_Extend.Type) + " =" + dmodel.Type;
} }
...@@ -112,6 +115,10 @@ left join rb_property_category pc on pb.CategoryId = pc.Id ...@@ -112,6 +115,10 @@ left join rb_property_category pc on pb.CategoryId = pc.Id
where += " and pu." + nameof(RB_Property_BuyingRequisition_Extend.Name) + " like @Name"; where += " and pu." + nameof(RB_Property_BuyingRequisition_Extend.Name) + " like @Name";
parameters.Add("Name", "%" + dmodel.Name + "%"); parameters.Add("Name", "%" + dmodel.Name + "%");
} }
if (dmodel.Id > 0)
{
where += " and pu." + nameof(RB_Property_BuyingRequisition_Extend.Id) + "=" + dmodel.Id;
}
if (dmodel.CategoryId > 0) if (dmodel.CategoryId > 0)
{ {
where += " and pu." + nameof(RB_Property_BuyingRequisition_Extend.CategoryId) + "=" + dmodel.CategoryId; where += " and pu." + nameof(RB_Property_BuyingRequisition_Extend.CategoryId) + "=" + dmodel.CategoryId;
......
...@@ -30,6 +30,10 @@ namespace Property.Repository ...@@ -30,6 +30,10 @@ namespace Property.Repository
{ {
where += " and pc." + nameof(RB_Property_Procurement_Extend.SchoolId) + "=" + dmodel.SchoolId; where += " and pc." + nameof(RB_Property_Procurement_Extend.SchoolId) + "=" + dmodel.SchoolId;
} }
if (dmodel.Id > 0)
{
where += " and pc." + nameof(RB_Property_Procurement_Extend.Id) + "=" + dmodel.Id;
}
if (dmodel.StockInStatus > 0) if (dmodel.StockInStatus > 0)
{ {
where += " and pc." + nameof(RB_Property_Procurement_Extend.StockInStatus) + "=" + dmodel.StockInStatus; where += " and pc." + nameof(RB_Property_Procurement_Extend.StockInStatus) + "=" + dmodel.StockInStatus;
......
...@@ -30,6 +30,10 @@ namespace Property.Repository ...@@ -30,6 +30,10 @@ namespace Property.Repository
{ {
where += " and pc." + nameof(RB_Supplies_Procurement_Extend.SchoolId) + "=" + dmodel.SchoolId; where += " and pc." + nameof(RB_Supplies_Procurement_Extend.SchoolId) + "=" + dmodel.SchoolId;
} }
if (dmodel.Id > 0)
{
where += " and pc." + nameof(RB_Supplies_Procurement_Extend.Id) + "=" + dmodel.Id;
}
if (dmodel.StockInStatus > 0) if (dmodel.StockInStatus > 0)
{ {
where += " and pc." + nameof(RB_Supplies_Procurement_Extend.StockInStatus) + "=" + dmodel.StockInStatus; where += " and pc." + nameof(RB_Supplies_Procurement_Extend.StockInStatus) + "=" + dmodel.StockInStatus;
......
...@@ -58,6 +58,9 @@ namespace Property.Repository ...@@ -58,6 +58,9 @@ namespace Property.Repository
if (dmodel.FinanceId > 0) { if (dmodel.FinanceId > 0) {
where += " and p.FinanceId =" + dmodel.FinanceId; where += " and p.FinanceId =" + dmodel.FinanceId;
} }
if (dmodel.ProcurementId > 0) {
where += " and ss.ProcurementId =" + dmodel.ProcurementId;
}
if (dmodel.StockInState > 0) { if (dmodel.StockInState > 0) {
where += " and ss." + nameof(RB_Supplies_StockIn_Extend.StockInState) + "=" + (int)dmodel.StockInState; where += " and ss." + nameof(RB_Supplies_StockIn_Extend.StockInState) + "=" + (int)dmodel.StockInState;
} }
...@@ -66,7 +69,7 @@ namespace Property.Repository ...@@ -66,7 +69,7 @@ namespace Property.Repository
left join rb_supplies_warehouse sw on ss.WarehouseId=sw.Id left join rb_supplies_warehouse sw on ss.WarehouseId=sw.Id
left join rb_supplies_stockindetail ssd on ss.Id=ssd.StockInId left join rb_supplies_stockindetail ssd on ss.Id=ssd.StockInId
left join rb_supplies_material sm on ssd.SuppliesId=sm.Id left join rb_supplies_material sm on ssd.SuppliesId=sm.Id
left join RB_Procurement p on ss.ProcurementId=p.Id left join rb_supplies_procurement p on ss.ProcurementId=p.Id
{where} group by ss.Id order by ss.Id desc"; {where} group by ss.Id order by ss.Id desc";
return GetPage<RB_Supplies_StockIn_Extend>(pageIndex, pageSize, out count, sql).ToList(); return GetPage<RB_Supplies_StockIn_Extend>(pageIndex, pageSize, out count, sql).ToList();
} }
......
...@@ -61,7 +61,7 @@ namespace Property.Repository ...@@ -61,7 +61,7 @@ namespace Property.Repository
left join rb_supplies_stockoutapplyfordetail pc2 on pc.Id=pc2.ApplyForId left join rb_supplies_stockoutapplyfordetail pc2 on pc.Id=pc2.ApplyForId
left join rb_supplies_material m on pc2.SuppliesId = m.Id left join rb_supplies_material m on pc2.SuppliesId = m.Id
{where} group by pc.Id order by pc.Id desc"; {where} group by pc.Id order by pc.Id desc";
return GetPage<RB_Supplies_StockOutApplyFor_Extend>(pageIndex, pageSize, out count, sql).ToList(); return GetPage<RB_Supplies_StockOutApplyFor_Extend>(pageIndex, pageSize, out count, sql, parms).ToList();
} }
/// <summary> /// <summary>
...@@ -106,7 +106,7 @@ left join rb_supplies_material m on pc2.SuppliesId = m.Id ...@@ -106,7 +106,7 @@ left join rb_supplies_material m on pc2.SuppliesId = m.Id
left join rb_supplies_stockoutapplyfordetail pc2 on pc.Id=pc2.ApplyForId left join rb_supplies_stockoutapplyfordetail pc2 on pc.Id=pc2.ApplyForId
left join rb_supplies_material m on pc2.SuppliesId = m.Id left join rb_supplies_material m on pc2.SuppliesId = m.Id
{where} group by pc.Id order by pc.Id desc"; {where} group by pc.Id order by pc.Id desc";
return Get<RB_Supplies_StockOutApplyFor_Extend>(sql).ToList(); return Get<RB_Supplies_StockOutApplyFor_Extend>(sql, parms).ToList();
} }
} }
} }
...@@ -73,6 +73,7 @@ namespace Property.WebApi.Controllers.Mall ...@@ -73,6 +73,7 @@ namespace Property.WebApi.Controllers.Mall
x.WareHouseName, x.WareHouseName,
x.WarehouseId, x.WarehouseId,
x.Remark, x.Remark,
x.ApplyForId,
x.EmployeeId, x.EmployeeId,
EmName = CacheManager.User.UserReidsCache.GetEmployee(x.EmployeeId)?.EmName ?? "", EmName = CacheManager.User.UserReidsCache.GetEmployee(x.EmployeeId)?.EmName ?? "",
DetailList = x.DetailList.Select(z => new DetailList = x.DetailList.Select(z => new
......
...@@ -669,6 +669,7 @@ namespace Property.WebApi.Controllers.User ...@@ -669,6 +669,7 @@ namespace Property.WebApi.Controllers.User
x.WareHouseName, x.WareHouseName,
x.WarehouseId, x.WarehouseId,
x.Remark, x.Remark,
x.ApplyForId,
x.EmployeeId, x.EmployeeId,
EmName = CacheManager.User.UserReidsCache.GetEmployee(x.EmployeeId)?.EmName ?? "", EmName = CacheManager.User.UserReidsCache.GetEmployee(x.EmployeeId)?.EmName ?? "",
DetailList = x.DetailList.Select(z => new DetailList = x.DetailList.Select(z => new
...@@ -3311,7 +3312,7 @@ namespace Property.WebApi.Controllers.User ...@@ -3311,7 +3312,7 @@ namespace Property.WebApi.Controllers.User
{ {
return ApiResult.ParamIsNull("仓库盘点中,不能出库"); return ApiResult.ParamIsNull("仓库盘点中,不能出库");
} }
demodel.RB_Group_Id = userInfo.RB_Group_id;
string msg = suppliesModule.SetSuppliesApplyForStockOut(demodel, userInfo); string msg = suppliesModule.SetSuppliesApplyForStockOut(demodel, userInfo);
if (msg == "") if (msg == "")
{ {
......
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