Commit 43c462b3 by zxw

Merge branch 'release/43c462b3'

parents a2cfa70a a6198896
......@@ -8394,8 +8394,8 @@ namespace JunmpPoliceStation.Controllers
var data = equipmentList.GroupBy(t => new { t.OrgId, t.WarehouseCode, t.EquipmentSizecode }).Select(c => new
{
c.FirstOrDefault().OrgId,
WarehouseCode=c.FirstOrDefault(x => x.WarehouseCode != null)?.WarehouseCode ?? "00000000-0000-0000-0000-000000000000",
WarehouseName=c.FirstOrDefault(x => x.WarehouseCode != null)?.WarehouseName ?? "",
WarehouseCode = c.FirstOrDefault(x => x.WarehouseCode != null)?.WarehouseCode ?? "00000000-0000-0000-0000-000000000000",
WarehouseName = c.FirstOrDefault(x => x.WarehouseCode != null)?.WarehouseName ?? "",
c.FirstOrDefault().EquipmentCode,
c.FirstOrDefault().EquipmentName,
c.FirstOrDefault().EquipmentSizecode,
......@@ -8484,7 +8484,7 @@ namespace JunmpPoliceStation.Controllers
"WarehouseCodeNavigation.Orgization"
};
Expression<Func<CommonJpEquipmentInventory, bool>> expression = t => OrgId.Equals(t.WarehouseCodeNavigation.OrgizationId);
Expression<Func<CommonJpEquipmentInventory, bool>> expression = t => OrgId.Equals(t.OrgId);
expression = LambdaExtensions.AndAlso(expression, t => t.InventoryState != "loss");
//orgList.Add(orgInfo.Id);//查询所有组织机构仓库库存信息
......@@ -8536,7 +8536,7 @@ namespace JunmpPoliceStation.Controllers
id = x.Key.WarehouseCode + x.Key.EquipmentSizecode,
warehouseName = x.FirstOrDefault().WarehouseCodeNavigation?.Name,
equipmentName = x.FirstOrDefault().EquipmentCodeNavigation?.Name,
warehouseId = x.FirstOrDefault().WarehouseCodeNavigation?.Id,
warehouseId = x.FirstOrDefault().WarehouseCodeNavigation?.Id ?? "00000000-0000-0000-0000-000000000000",
equipmentSizeName = x.FirstOrDefault().EquipmentSizecodeNavigation?.SizeName,
equipmentSizeId = x.FirstOrDefault().EquipmentSizecodeNavigation?.Id,
sumCount = x.Count(),
......
......@@ -633,8 +633,7 @@ namespace JunmpPoliceStation.Controllers
string equipmentSizecode = entity.equipmentSizecode;
var idList = OrgTreeModel.GetOrgIdList(orgModelList, org.Id);
//expressionPoliceman = t => idList.Contains(t.OrgId);
expressionPoliceman = t => t.OrgId== org.Id;
expressionPoliceman = t => idList.Contains(t.OrgId);
if (!String.IsNullOrEmpty(typeId))
{
......@@ -664,6 +663,10 @@ namespace JunmpPoliceStation.Controllers
zkCount = c.Where(f => f.CurrentState.Equals(0) || f.CurrentState.Equals(3)).Count(),
ckCount = c.Where(f => !(f.CurrentState == null || f.CurrentState.Equals(0) || f.CurrentState.Equals(3) || f.CurrentState.Equals(6))).Count(),
bfCount = c.Where(f => f.CurrentState.Equals(6)).Count(),
djgCount = c.Count(x => x.CurrentState == 3),
djgckCount = c.Count(x => x.CurrentState == 7),
priceCount = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null).Sum(k => k.Price),
children = c.OrderBy(z => z.TypeOneId).ThenBy(z => z.TypeTwoId).ThenBy(z => z.TypeThreeId).GroupBy(a => a.EquipmentCode).Select(c => new
{
......@@ -673,11 +676,15 @@ namespace JunmpPoliceStation.Controllers
zkCount = c.Where(f => f.CurrentState.Equals(0) || f.CurrentState.Equals(3)).Count(),
ckCount = c.Where(f => !(f.CurrentState == null || f.CurrentState.Equals(0) || f.CurrentState.Equals(3) || f.CurrentState.Equals(6))).Count(),
bfCount = c.Where(f => f.CurrentState.Equals(6)).Count(),
djgCount = c.Count(x => x.CurrentState == 3),
djgckCount = c.Count(x => x.CurrentState == 7),
priceCount = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null).Sum(k => k.Price)
}).Where(f => f.id != null && f.zsCount != 0).ToList()
}).Where(f => f.id != null && (f.zsCount != 0 || f.bfCount != 0)).ToList()
}).ToList();
data = data.Where(c => c.zsCount != 0)
data = data.Where(c => c.zsCount != 0 || c.bfCount != 0)
.OrderBy(c => c.FindCode.Length)
.ThenBy(c => c.FindCode)
.ThenBy(c => c.OrgCode)
......@@ -690,6 +697,10 @@ namespace JunmpPoliceStation.Controllers
zkCount = data.Sum(c => c.zkCount),
ckCount = data.Sum(c => c.ckCount),
bfCount = data.Sum(c => c.bfCount),
djgCount = data.Sum(c => c.djgCount),
djgckCount = data.Sum(c => c.djgckCount),
priceCount = data.Sum(c => c.priceCount),
content = data.Skip(page * size).Take(size)
};
......@@ -707,6 +718,10 @@ namespace JunmpPoliceStation.Controllers
zkCount = c.Where(f => f.CurrentState.Equals(0) || f.CurrentState.Equals(3)).Count(),
ckCount = c.Where(f => !(f.CurrentState == null || f.CurrentState.Equals(0) || f.CurrentState.Equals(3) || f.CurrentState.Equals(6))).Count(),
bfCount = c.Where(f => f.CurrentState.Equals(6)).Count(),
djgCount = c.Count(x => x.CurrentState == 3),
djgckCount = c.Count(x => x.CurrentState == 7),
priceCount = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null).Sum(k => k.Price),
children = c.OrderBy(z => z.TypeOneId).ThenBy(z => z.TypeTwoId).ThenBy(z => z.TypeThreeId).GroupBy(a => a.EquipmentCode).Select(c => new
{
......@@ -716,11 +731,15 @@ namespace JunmpPoliceStation.Controllers
zkCount = c.Where(f => f.CurrentState.Equals(0) || f.CurrentState.Equals(3)).Count(),
ckCount = c.Where(f => !(f.CurrentState == null || f.CurrentState.Equals(0) || f.CurrentState.Equals(3) || f.CurrentState.Equals(6))).Count(),
bfCount = c.Where(f => f.CurrentState.Equals(6)).Count(),
djgCount = c.Count(x => x.CurrentState == 3),
djgckCount = c.Count(x => x.CurrentState == 7),
priceCount = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null).Sum(k => k.Price)
}).Where(f => f.id != null && f.zsCount != 0).ToList()
}).Where(f => f.id != null && (f.zsCount != 0 || f.bfCount != 0)).ToList()
}).ToList();
data = data.Where(c => c.zsCount != 0)
data = data.Where(c => c.zsCount != 0 || c.bfCount != 0)
.OrderBy(c => c.FindCode.Length)
.ThenBy(c => c.FindCode)
.ThenBy(c => c.OrgCode)
......@@ -733,6 +752,10 @@ namespace JunmpPoliceStation.Controllers
zkCount = data.Sum(c => c.zkCount),
ckCount = data.Sum(c => c.ckCount),
bfCount = data.Sum(c => c.bfCount),
djgCount = data.Sum(c => c.djgCount),
djgckCount = data.Sum(c => c.djgckCount),
priceCount = data.Sum(c => c.priceCount),
content = data.Skip(page * size).Take(size)
};
......@@ -1526,7 +1549,7 @@ namespace JunmpPoliceStation.Controllers
MemoryCacheHelper.AddMemoryCache("orgModelList", orgModelList, 1440);
}
var idList = OrgTreeModel.GetOrgIdList(orgModelList, orgizationCode);
expressionPoliceman = t => idList.Contains(t.OrgId) && t.CurrentState != 5 && t.CurrentState != 6;
}
......
......@@ -833,21 +833,30 @@ namespace JunmpPoliceStation.Controllers
}
string id = entity?.id ?? "";
string name = entity?.name ?? "";
string orgId = entity?.orgizationId ?? "";
if (entity == null)
{
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
}
else if (string.IsNullOrEmpty(entity.name ?? ""))
else if (string.IsNullOrEmpty(name))
{
return JsonManager.SimpleCustResponse($"Name is require");
}
else if (string.IsNullOrEmpty(entity.orgizationId ?? ""))
else if (string.IsNullOrEmpty(orgId))
{
return JsonManager.SimpleCustResponse($"OrgizationId is require");
}
else if (!string.IsNullOrEmpty(id))
{
//检查重名
var old = _unitOfWork.WarehouseRepository.Get(x => x.Name == name && x.OrgizationId == orgId && x.Id != id);
if (old != null)
{
return JsonManager.SimpleCustResponse($"仓库名称重复");
}
Expression<Func<BaseJpWarehouse, bool>> expression = t => t.Id.Equals(id);
BaseJpWarehouse updateObject = _unitOfWork.WarehouseRepository.Get(expression);
if (updateObject != null)
......@@ -855,7 +864,7 @@ namespace JunmpPoliceStation.Controllers
updateObject.Name = entity.name;
updateObject.Location = entity.location;
updateObject.LocationDetail = entity.locationDetail;
updateObject.OrgizationId = entity.orgizationId;
updateObject.OrgizationId = orgId;
updateObject.Phone = entity.phone;
updateObject.UpdateTime = System.DateTime.Now;
updateObject.UpdateUser = entity.updateUser;
......@@ -887,6 +896,12 @@ namespace JunmpPoliceStation.Controllers
}
else
{
//检查重名
var old = _unitOfWork.WarehouseRepository.Get(x => x.Name == name && x.OrgizationId == orgId);
if (old != null)
{
return JsonManager.SimpleCustResponse($"仓库名称重复");
}
//新增数据
BaseJpWarehouse addObject = new BaseJpWarehouse()
{
......@@ -895,7 +910,7 @@ namespace JunmpPoliceStation.Controllers
Name = entity.name,
Location = entity.location,
LocationDetail = entity.locationDetail,
OrgizationId = entity.orgizationId,
OrgizationId = orgId,
Phone = entity.phone,
CreateTime = System.DateTime.Now,
UpdateTime = System.DateTime.Now,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论