Commit 663e2ed5 by zxw

Merge branch 'master' into zxw

parents 8de6fa57 a8f42e6a
......@@ -27,7 +27,7 @@ namespace JmpModel.Model
[StringLength(50)]
public string Date { get; set; }
[Column("photo")]
[StringLength(50)]
[StringLength(255)]
public string Photo { get; set; }
[Column("isDeal")]
[StringLength(50)]
......
......@@ -3540,6 +3540,8 @@ Warehouse:仓库");
entity.Property(e => e.EquipmentCode).IsUnicode(false);
entity.Property(e => e.EquipmentCode1).IsUnicode(false);
entity.Property(e => e.EquipmentName).IsUnicode(false);
entity.Property(e => e.EquipmentSizecode).IsUnicode(false);
......@@ -3754,6 +3756,8 @@ Warehouse:仓库");
entity.Property(e => e.Order).IsUnicode(false);
entity.Property(e => e.PrintOrderCode).IsUnicode(false);
entity.Property(e => e.WarehouseId).IsUnicode(false);
entity.Property(e => e.WarehouseName).IsUnicode(false);
......
......@@ -47,6 +47,9 @@ namespace JmpModel.Model
[Column("equipment_name")]
[StringLength(64)]
public string EquipmentName { get; set; }
[Column("equipmentCode")]
[StringLength(36)]
public string EquipmentCode1 { get; set; }
[Column("equipment_sizecode")]
[StringLength(36)]
public string EquipmentSizecode { get; set; }
......
......@@ -27,5 +27,10 @@ namespace JmpModel.Model
public DateTime? CreateTime { get; set; }
[Column("type")]
public int Type { get; set; }
[Column("print_order_code")]
[StringLength(255)]
public string PrintOrderCode { get; set; }
[Column("print_order_time", TypeName = "datetime")]
public DateTime? PrintOrderTime { get; set; }
}
}
\ No newline at end of file
......@@ -435,7 +435,7 @@
"ObjectType": 3
}
],
"UiHint": "pc.junmppolicesqldev.dbo",
"UiHint": "PC.junmppolicesqldev",
"UseBoolPropertiesWithoutDefaultSql": false,
"UseDatabaseNames": false,
"UseDbContextSplitting": false,
......
......@@ -52,6 +52,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("AddChargeDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> AddChargeDevelop([FromBody] JObject jdata)
{
......@@ -59,79 +60,81 @@ namespace JunmpPoliceStation.Controllers
{
try
{
if (jdata != null)
{
var entity = JsonManager.GetJsonEntity(jdata);
//if (jdata != null)
//{
// var entity = JsonManager.GetJsonEntity(jdata);
if (entity == null)
{
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
}
// if (entity == null)
// {
// return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
// }
//第三方调用接口验证orgId正确性
if (!string.IsNullOrEmpty(entity._PUSHORG))
{
if (entity.orgId?.ToString() != entity._PUSHORG.ToString())
{
return JsonManager.SimpleStatusResponse(ResultCode.ORGANIZATION_ERROR);
}
}
// //第三方调用接口验证orgId正确性
// if (!string.IsNullOrEmpty(entity._PUSHORG))
// {
// if (entity.orgId?.ToString() != entity._PUSHORG.ToString())
// {
// return JsonManager.SimpleStatusResponse(ResultCode.ORGANIZATION_ERROR);
// }
// }
if (string.IsNullOrEmpty(entity.orgId ?? ""))
{
return JsonManager.SimpleCustResponse($"orgId is require");
}
else if (string.IsNullOrEmpty(entity.equName ?? ""))
{
return JsonManager.SimpleCustResponse($"equName is require");
}
else if (string.IsNullOrEmpty(entity.equCode ?? ""))
{
return JsonManager.SimpleCustResponse($"equCode is require");
}
else if (string.IsNullOrEmpty(entity.epc ?? ""))
{
return JsonManager.SimpleCustResponse($"epc is require");
}
else if (string.IsNullOrEmpty(entity.startTime ?? ""))
{
return JsonManager.SimpleCustResponse($"startTime is require");
}
else if (string.IsNullOrEmpty(entity.endTime ?? ""))
{
return JsonManager.SimpleCustResponse($"endTime is require");
}
else
{
string startTime = entity.startTime;
//新增数据
BaseCharge addObject = new BaseCharge()
{
Id = Guid.NewGuid(),
OrgId = entity.orgId,
EquName = entity.equName,
EquCode = entity.equCode,
Epc = entity.epc,
StartTime = Convert.ToDateTime(startTime),
EndTime = System.DateTime.Now
};
// if (string.IsNullOrEmpty(entity.orgId ?? ""))
// {
// return JsonManager.SimpleCustResponse($"orgId is require");
// }
// else if (string.IsNullOrEmpty(entity.equName ?? ""))
// {
// return JsonManager.SimpleCustResponse($"equName is require");
// }
// else if (string.IsNullOrEmpty(entity.equCode ?? ""))
// {
// return JsonManager.SimpleCustResponse($"equCode is require");
// }
// else if (string.IsNullOrEmpty(entity.epc ?? ""))
// {
// return JsonManager.SimpleCustResponse($"epc is require");
// }
// else if (string.IsNullOrEmpty(entity.startTime ?? ""))
// {
// return JsonManager.SimpleCustResponse($"startTime is require");
// }
// else if (string.IsNullOrEmpty(entity.endTime ?? ""))
// {
// return JsonManager.SimpleCustResponse($"endTime is require");
// }
// else
// {
// string startTime = entity.startTime;
// //新增数据
// BaseCharge addObject = new BaseCharge()
// {
// Id = Guid.NewGuid(),
// OrgId = entity.orgId,
// EquName = entity.equName,
// EquCode = entity.equCode,
// Epc = entity.epc,
// StartTime = Convert.ToDateTime(startTime),
// EndTime = System.DateTime.Now
// };
bool result = _unitOfWork.BaseChargeRepository.Insert(addObject);
// bool result = _unitOfWork.BaseChargeRepository.Insert(addObject);
if (result)
{
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
}
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
// if (result)
// {
// return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
// }
// else
// {
// return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
// }
// }
//}
//else
//{
// return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
//}
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
}
catch (Exception ex)
{
......
......@@ -123,6 +123,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetSupplierDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSignAttribute]
public async Task<HttpResponseMessage> GetSupplierDevelop([FromBody] JObject jdata)
{
......@@ -301,6 +302,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("AddOrUpdateSupplier")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> AddOrUpdateSupplier([FromBody] JObject jdata)
{
return await Task.Run(() =>
......
......@@ -158,7 +158,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("DeleteCabinet")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> DeleteCabinet([FromBody] JObject jdata)
{
return await Task.Run(() =>
......@@ -1300,13 +1300,9 @@ namespace JunmpPoliceStation.Controllers
/// {
/// "cabinetID": "0320200512000808",
/// "cabinetChildID": "1",
/// "RFIDList": [{
/// "RFID": "A12C621596CDF8A02B18538A"
/// },{
/// "RFID": "A12C6215BCE9F863C2896E0A"
/// },{
/// "RFID": "A12C6215BCE9F863C284DF0A"
/// }]
/// "RFIDList": ["A12C621596CDF8A02B18538A",
/// "RFID": "A12C6215BCE9F863C2896E0A",
/// "RFID": "A12C6215BCE9F863C284DF0A"]
/// }
///
///
......@@ -1315,6 +1311,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("UploadRFIDDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSign]
public async Task<HttpResponseMessage> UploadRFIDDevelop([FromBody] JObject jdata)
{
......@@ -1939,6 +1936,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("UploadRFIDListInnerDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> UploadRFIDListInnerDevelop([FromBody] JObject jdata)
{
return await Task.Run(() =>
......@@ -3240,6 +3238,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("AddCabinet")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> AddCabinet([FromBody] JObject jdata)
{
return await Task.Run(() =>
......@@ -4400,6 +4399,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetCabinetListDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GetCabinetListDevelop([FromBody] JObject jdata)
{
return await Task.Run(() =>
......
......@@ -267,6 +267,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetPageEquipmentDetailByTime")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GetPageEquipmentDetailByTime([FromBody] JObject jdata)
{
return await Task.Run(() =>
......
......@@ -49,6 +49,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetListEquipment")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GetListEquipment([FromBody] JObject jdata)
{
return await Task.Run(() =>
......
......@@ -200,6 +200,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetEquipmentSizeDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSignAttribute]
public async Task<HttpResponseMessage> GetEquipmentSizeDevelop([FromBody] JObject jdata)
{
......@@ -377,6 +378,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("AddOrUpdateEquipmentSize")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> AddOrUpdateEquipmentSize([FromBody] JObject jdata)
{
return await Task.Run(() =>
......
......@@ -86,7 +86,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("CreateOrder")]
//[NoSign]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> CreateOrder([FromBody] JObject jdata)
{
return await Task.Run(() =>
......@@ -3145,6 +3145,7 @@ namespace JunmpPoliceStation.Controllers
/// "size":10,
/// "page":0,
/// "wareHouseId":"当前仓库Id",
/// "orgId":"组织机构id",
/// "outInState" : 0:出库,1入库
/// "type":1 1采购,2借用,3领用,4调拨,5,维修,6报废,7跨库借用,9跨库归还 10跨库归还入库 12销毁
/// "currentState":""0 已完成,1未完成
......@@ -3177,6 +3178,15 @@ namespace JunmpPoliceStation.Controllers
string currentState = entity.currentState;
//var warehouse = _unitOfWork.WarehouseRepository.Get(p => p.Id.Equals(warehouseID)).Orgization;//当前仓库信息
Expression<Func<ViewOutInOrder, bool>> expression = t => t.Id != null;//0,调拨出库 1采购,2借用,3领用,4调拨入库,5,维修,12报废
if (!string.IsNullOrEmpty(entity.orgId))
{
string orgId = entity.orgId;
var warehouseList = _unitOfWork.WarehouseRepository
.GetList(x => x.OrgizationId == orgId)
.Select(x => x.Id)
.ToList();
expression = LambdaExtensions.AndAlso(expression, t => warehouseList.Contains(t.WarehouseId));
}
if (!String.IsNullOrEmpty(entity.wareHouseId))
{
warehouseID = entity.wareHouseId;
......@@ -3247,38 +3257,35 @@ namespace JunmpPoliceStation.Controllers
}
}
if (string.IsNullOrEmpty(warehouseID))
{
var content = new
{
totalElements = 0,
content = new List<string> { },
};
return JsonManager.ReturnSuccessResponse(content);
}
else
var outInOrders = _unitOfWork.ViewOutInOrderRepository.GetList(expression).ToList().GroupBy(t => t.Id);
var res = outInOrders
.Select(t => new
{
t.FirstOrDefault().Id,
t.FirstOrDefault().Order,
t.FirstOrDefault().Type,
t.FirstOrDefault().WarehouseId,
WarehouseName = t.Count() > 1 ? t.FirstOrDefault().WarehouseName + "等" : t.FirstOrDefault().WarehouseName,
WarehouseNameDetail = t.Select(y => y.WarehouseName),
t.FirstOrDefault().CurrentState,
t.FirstOrDefault().CreateTime,
t.FirstOrDefault().PrintOrderCode,
PrintOrderTime = t.FirstOrDefault().PrintOrderTime?.ToString("yyyy年MM月dd日"),
StateType = (t.FirstOrDefault().CurrentState.Equals(2) || t.FirstOrDefault().CurrentState.Equals(11) || t.FirstOrDefault().CurrentState.Equals(3) || (t.FirstOrDefault().CurrentState.Equals(1) && (t.FirstOrDefault().Type.Equals(1) || t.FirstOrDefault().Type.Equals(3) || t.FirstOrDefault().Type.Equals(6) || t.FirstOrDefault().Type.Equals(12)))) ? "0" :
t.FirstOrDefault().CurrentState.Equals(0) || (t.FirstOrDefault().CurrentState == null && t.FirstOrDefault().Type.Equals(1)) || (t.FirstOrDefault().CurrentState.Equals(1) && (t.FirstOrDefault().Type.Equals(0) || t.FirstOrDefault().Type.Equals(2) || t.FirstOrDefault().Type.Equals(11) || t.FirstOrDefault().Type.Equals(4) || t.FirstOrDefault().Type.Equals(5) || t.FirstOrDefault().Type.Equals(7) || t.FirstOrDefault().Type.Equals(8) || t.FirstOrDefault().Type.Equals(9) || t.FirstOrDefault().Type.Equals(10)))
? "1" : null
})
.OrderByDescending(t => t.CreateTime)
.ToList();
//var orderList= outInOrders.totalElements
var content = new
{
var outInOrders = _unitOfWork.ViewOutInOrderRepository.GetPage(expression, "-CreateTime", page, size, false);
//var orderList= outInOrders.totalElements
var content = new
{
outInOrders?.totalElements,
content = outInOrders.content.Select(t => new
{
t.Id,
t.Order,
t.Type,
t.WarehouseId,
t.WarehouseName,
t.CurrentState,
t.CreateTime,
StateType = (t.CurrentState.Equals(2) || t.CurrentState.Equals(11) || t.CurrentState.Equals(3) || (t.CurrentState.Equals(1) && (t.Type.Equals(1) || t.Type.Equals(3) || t.Type.Equals(6) || t.Type.Equals(12)))) ? "0" :
t.CurrentState.Equals(0) || (t.CurrentState == null && t.Type.Equals(1)) || (t.CurrentState.Equals(1) && (t.Type.Equals(0) || t.Type.Equals(2) || t.Type.Equals(11) || t.Type.Equals(4) || t.Type.Equals(5) || t.Type.Equals(7) || t.Type.Equals(8) || t.Type.Equals(9) || t.Type.Equals(10)))
? "1" : null
})
};
return JsonManager.ReturnSuccessResponse(content);
}
totalElements = outInOrders.Count(),
content = res.Skip(page * size).Take(size).ToList()
};
return JsonManager.ReturnSuccessResponse(content);
}
else
{
......@@ -6011,6 +6018,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("UploadRFIDDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSign]
public async Task<HttpResponseMessage> UploadRFIDDevelop([FromBody] JObject jdata)
{
......@@ -9183,7 +9191,6 @@ namespace JunmpPoliceStation.Controllers
"EquipmentSizecodeNavigation.Detail" ,
"EquipmentCodeNavigation" ,
"WarehouseCodeNavigation" ,
"WarehouseCodeNavigation.Orgization",
"CommonJpEquipmentStates",
"SupplierCodeNavigation",
"Cabinet",
......@@ -9337,10 +9344,7 @@ namespace JunmpPoliceStation.Controllers
}
var EquipmentList = _unitOfWork.EquipmentInventoryRepository.GetList(expression, c => c.CreateTime, false, param)
.OrderBy(x => x.EquipmentCode)
.ThenBy(x => x.EquipmentSizecode)
.ThenBy(x => x.WarehouseCodeNavigation.Orgization.Code)
.ThenBy(x => x.WarehouseCode)
.OrderBy(x=>x.EquipmentCodeNavigation.Code)
.ToList();
var datas = EquipmentList.Select(equipment => new
......
......@@ -507,6 +507,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetListOrg")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GetListOrg([FromBody] JObject jdata)
{
return await Task.Run(() =>
......@@ -1246,7 +1247,7 @@ namespace JunmpPoliceStation.Controllers
/// {
/// "orgId":"id",
/// "orderCode":"单号",
/// "orderType":"单据类型 借:借用 领:领用 支:调拨 价:调拨 废:报废 销:销毁"
/// "orderType":"单据类型 借:借用 领:领用 支:调拨 价:调拨 废:报废 销:销毁 入:采购"
///
/// }
///
......@@ -1378,6 +1379,27 @@ namespace JunmpPoliceStation.Controllers
printOrderTime = order.PrintOrderTime?.ToString("yyyy年MM月dd日"),
});
}
case "入":
{
order = _unitOfWork.PurchaseOrderyRepository.Get(x => x.OrderCode == orderCode);
if (order == null)
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
if (string.IsNullOrEmpty(order.PrintOrderCode))
{
CreateNewOrderCount(ref order, org, orderType, out string printOrderCode);
order.PrintOrderCode = printOrderCode;
order.PrintOrderTime = DateTime.Now;
_unitOfWork.PurchaseOrderyRepository.Update(order);
}
return JsonManager.ReturnSuccessResponse(new
{
printOrderCode = order.PrintOrderCode,
printOrderTime = order.PrintOrderTime?.ToString("yyyy年MM月dd日"),
});
}
default:
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
......
......@@ -54,6 +54,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetPolicemanDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSign]
public async Task<HttpResponseMessage> GetPolicemanDevelop([FromBody] JObject jdata)
{
......@@ -557,6 +558,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("AddOrUpdatePoliceman")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSign]
public async Task<HttpResponseMessage> AddOrUpdatePoliceman([FromBody] JObject jdata)
{
......
......@@ -248,6 +248,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetPrintList")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GetPrintList([FromBody] JObject jdata)
{
return await Task.Run(() =>
......@@ -644,6 +645,7 @@ namespace JunmpPoliceStation.Controllers
/// }
/// </remarks>
[HttpPost("UpdateEpcState")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSign]
public async Task<HttpResponseMessage> UpdateEpcState([FromBody] JObject jdata)
{
......@@ -1016,6 +1018,7 @@ namespace JunmpPoliceStation.Controllers
/// <returns></returns>
[HttpPost("GenerateExtTagEpc")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GenerateExtTagEpc([FromBody] JObject jdata)
{
return await Task.Run(() =>
......@@ -1196,6 +1199,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GenerateIntTagEpc")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GenerateIntTagEpc([FromBody] JObject jdata)
{
return await Task.Run(() =>
......@@ -1329,6 +1333,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GenerateInventory")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GenerateInventory([FromBody] JObject jdata)
{
return await Task.Run(() =>
......@@ -1703,6 +1708,7 @@ namespace JunmpPoliceStation.Controllers
/// }
/// </remarks>
[HttpPost("GenerateRangeInventoryDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GenerateRangeInventoryDevelop([FromBody] JObject jdata)
{
return await Task.Run(() =>
......
......@@ -642,16 +642,16 @@ namespace JunmpPoliceStation.Controllers
c.FirstOrDefault().OrgName,
c.FirstOrDefault().FindCode,
c.FirstOrDefault().OrgCode,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6&&f.CurrentState!=null),
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(),
priceCount = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null).Sum(k => k.Price),
children = c.OrderBy(z => z.TypeOneId).GroupBy(a => a.EquipmentCode).Select(c => new
children = c.OrderBy(z => z.TypeOneId).ThenBy(z => z.TypeTwoId).ThenBy(z => z.TypeThreeId).GroupBy(a => a.EquipmentCode).Select(c => new
{
id = c.FirstOrDefault().EquipmentCode,
name = c.FirstOrDefault().EquipmentName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 && f.CurrentState != null),
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(),
......@@ -685,16 +685,16 @@ namespace JunmpPoliceStation.Controllers
OrgName = c.OrderBy(f => f.OrgCode).FirstOrDefault().AreaName,
c.OrderBy(f => f.OrgCode).FirstOrDefault().FindCode,
c.OrderBy(f => f.OrgCode).FirstOrDefault().OrgCode,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 && f.CurrentState != null),
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(),
priceCount = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null).Sum(k => k.Price),
children = c.OrderBy(z => z.TypeOneId).GroupBy(a => a.EquipmentCode).Select(c => new
children = c.OrderBy(z => z.TypeOneId).ThenBy(z => z.TypeTwoId).ThenBy(z => z.TypeThreeId).GroupBy(a => a.EquipmentCode).Select(c => new
{
id = c.FirstOrDefault().EquipmentCode,
name = c.FirstOrDefault().EquipmentName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 && f.CurrentState != null),
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(),
......@@ -784,12 +784,13 @@ namespace JunmpPoliceStation.Controllers
OrgId = entity.orgId;
}
var param = new string[] {
"EquipmentCodeNavigation" ,
"EquipmentCodeNavigation",
"Org" ,
"Org.BaseJpCabinetOutinlogs" ,
"CommonJpEquipmentStates"
"CommonJpEquipmentStates",
};
var Infoparam = new string[] { };
Expression<Func<CommonJpEquipmentInventory, bool>> expression = t => OrgId == t.OrgId && (!t.InventoryState.Equals("loss"));
......@@ -799,17 +800,31 @@ namespace JunmpPoliceStation.Controllers
string equipmentCode = entity.equipmentCode;
expression = LambdaExtensions.AndAlso(expression, t => t.EquipmentCode.Equals(equipmentCode));
}
//var infoList=_unitOfWork.EquipmentInfoRepository.GetList(t=>t.Id!=null).ToList();
//var query = from t1 in infoList
// join t2 in infoList
// on t1.ParentId equals t2.Id
// join t3 in infoList
// on t2.ParentId equals t3.Id
// select new ViewEquipment
// {
// TypeOneId = t1.Id,
// TypeTwoId = t2.Id,
// TypeThreeId = t3.Id,
// };
var EquipmentList = _unitOfWork.EquipmentInventoryRepository.GetList(expression, null, false, param).ToList();
var datas = EquipmentList.GroupBy(p => p.EquipmentCode).Select(c => new
{
code = c.FirstOrDefault().EquipmentCodeNavigation?.Equipment?.Code,
equipmentCode = c.Key,
equipmentName = c.FirstOrDefault().EquipmentCodeNavigation.Name,
sumCount = c.Count(),
sumCount = c.Where(p=>p.CurrentState!=6).Count(),
syCount = c.Sum(c => c.Org.BaseJpCabinetOutinlogs.Where(p => p.State == "out" && p.OperationTime >= Convert.ToDateTime(startTime) && p.OperationTime <= Convert.ToDateTime(endTime)).Count()) + c.Sum(c => c.CommonJpEquipmentStates.Where(f => (f.ActionState.Equals(2) || f.ActionState.Equals(3) || f.ActionState.Equals(5) || f.ActionState.Equals(14) || f.ActionState.Equals(15)) && f.OutTime >= Convert.ToDateTime(startTime) && f.OutTime <= Convert.ToDateTime(endTime)).Count()),
wxCount = c.Sum(c => c.CommonJpEquipmentStates.Where(f => f.ActionState.Equals(6) && f.OutTime >= Convert.ToDateTime(startTime) && f.OutTime <= Convert.ToDateTime(endTime)).Count())
}).OrderByDescending(f => f.syCount).ToList();
}).OrderBy(f => f.code).ToList();
//var content = new
//{
......@@ -997,8 +1012,15 @@ namespace JunmpPoliceStation.Controllers
}
string OrgId = Guid.Empty.ToString();
string startTime = entity.startTime;
string endTime = entity.endTime;
if (!DateTime.TryParse(entity.startTime, out DateTime startTime))
{
return JsonManager.SimpleCustResponse("startTime is require");
}
if (!DateTime.TryParse(entity.endTime, out DateTime endTime))
{
return JsonManager.SimpleCustResponse("endTime is require");
}
string equipmentCode = entity.equipmentCode;
if (!String.IsNullOrEmpty(entity.orgId))
......@@ -1007,8 +1029,8 @@ namespace JunmpPoliceStation.Controllers
}
int newpage = page * size;
int newsize = size;
List<useCountResult> data = _unitOfWork.ViewEquipmentRepository.Exec_UseCount(" EXEC useCount @orgid ='" + OrgId + "',@startTime ='" + startTime + "'" +
",@endTime ='" + endTime + "'" + ",@eqcode ='" + equipmentCode + "'" + ",@newspage ='" + newpage + "'" + ",@pageSize ='" + newsize + "'").ToList();
List<useCountResult> data = _unitOfWork.ViewEquipmentRepository.Exec_UseCount(" EXEC useCount @orgid ='" + OrgId + "',@startTime ='" + startTime.ToString("yyyy-MM-dd") + "'" +
",@endTime ='" + endTime.AddDays(1).ToString("yyyy-MM-dd") + "'" + ",@eqcode ='" + equipmentCode + "'" + ",@newspage ='" + newpage + "'" + ",@pageSize ='" + newsize + "'").ToList();
//var x= data[0].result.ToString();
//JsonData requestData = JsonMapper.ToObject(x);
var res = JsonConvert.DeserializeObject(data[0]?.result?.ToString() ?? string.Empty);
......@@ -1150,7 +1172,7 @@ namespace JunmpPoliceStation.Controllers
yearEndPrice = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null && f.CreateTime?.Year <= year).Sum(k => k.Price),
yearAddCount = c.Where(f => !f.CurrentState.Equals(6) && f.CreateTime?.Year == year).Count(),
yearDelCount = c.Where(f => f.CurrentState.Equals(6) && f.CreateTime?.Year == year).Count(),
children = c.OrderBy(z => z.TypeOneId).GroupBy(a => a.EquipmentCode).Select(c => new
children = c.OrderBy(z => z.TypeOneId).ThenBy(z=>z.TypeTwoId).ThenBy(z => z.TypeThreeId).ThenBy(z => z.EquipmentCode1).GroupBy(a => a.EquipmentCode).Select(c => new
{
id = c.FirstOrDefault().EquipmentCode,
name = c.FirstOrDefault().EquipmentName,
......@@ -1196,7 +1218,7 @@ namespace JunmpPoliceStation.Controllers
yearEndPrice = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null && f.CreateTime?.Year <= year).Sum(k => k.Price),
yearAddCount = c.Where(f => !f.CurrentState.Equals(6) && f.CreateTime?.Year == year).Count(),
yearDelCount = c.Where(f => f.CurrentState.Equals(6) && f.CreateTime?.Year == year).Count(),
children = c.OrderBy(z => z.TypeOneId).GroupBy(a => a.EquipmentCode).Select(c => new
children = c.OrderBy(z => z.TypeOneId).ThenBy(z => z.TypeTwoId).ThenBy(z => z.TypeThreeId).ThenBy(z => z.EquipmentCode1).GroupBy(a => a.EquipmentCode).Select(c => new
{
id = c.FirstOrDefault().EquipmentCode,
name = c.FirstOrDefault().EquipmentName,
......@@ -1327,7 +1349,7 @@ namespace JunmpPoliceStation.Controllers
{
id = c.FirstOrDefault().TypeOneId,
name = c.FirstOrDefault().ParentName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 && f.InventoryState != "loss"),
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(),
......@@ -1335,7 +1357,7 @@ namespace JunmpPoliceStation.Controllers
{
id = c.FirstOrDefault().TypeTwoId,
name = c.FirstOrDefault().TypeName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 && f.InventoryState != "loss"),
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(),
......@@ -1343,7 +1365,7 @@ namespace JunmpPoliceStation.Controllers
{
id = c.FirstOrDefault().TypeThreeId,
name = c.FirstOrDefault().Name,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 && f.InventoryState != "loss"),
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(),
......@@ -1351,7 +1373,7 @@ namespace JunmpPoliceStation.Controllers
{
id = c.FirstOrDefault().EquipmentCode,
name = c.FirstOrDefault().EquipmentName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 && f.InventoryState != "loss"),
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(),
......@@ -1359,7 +1381,7 @@ namespace JunmpPoliceStation.Controllers
{
id = c.FirstOrDefault().EquipmentSizecode,
name = c.FirstOrDefault().SizeName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 && f.InventoryState != "loss"),
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()
......@@ -1461,14 +1483,14 @@ namespace JunmpPoliceStation.Controllers
if (level == "本级")
{
expressionPoliceman = t => t.OrgId.Equals(orgizationCode) && t.CurrentState != null;
expressionPoliceman = t => t.OrgId.Equals(orgizationCode) && t.CurrentState != null && t.CurrentState != 5 && t.CurrentState != 6;
}
else
{
dataList = GetClassID(orgizationCode);
dataList = dataList.ToList().Concat(ListEq.Where(c => c.Id.Equals(orgizationCode))).ToList();
List<string> IdList = dataList.Select(c => c.Id).ToList();
expressionPoliceman = t => IdList.Contains(t.OrgId) && t.CurrentState != null;
expressionPoliceman = t => IdList.Contains(t.OrgId) && t.CurrentState != 5 && t.CurrentState != 6;
}
......@@ -1507,9 +1529,9 @@ namespace JunmpPoliceStation.Controllers
ParentName = c.FirstOrDefault().Name,
EquipmentName = c.FirstOrDefault().EquipmentName,
SizeName = c.FirstOrDefault().SizeName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 ),
Price = c.FirstOrDefault().Price,
sumPrice = c.Count(f => f.CurrentState != null) * c.Key.Price,
sumPrice = c.Count(f => f.CurrentState != 6) * c.Key.Price,
}
).OrderBy(x => x.id)
.ThenBy(x => x.TypeTwoId)
......@@ -1632,7 +1654,7 @@ namespace JunmpPoliceStation.Controllers
rowNumber = (idx + 1) + "",
id = c.FirstOrDefault().TypeOneId,
name = c.FirstOrDefault().ParentName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6 ),
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(),
......@@ -1641,7 +1663,7 @@ namespace JunmpPoliceStation.Controllers
rowNumber = (idx + 1) + "." + (idx1 + 1),
id = c.FirstOrDefault().TypeTwoId,
name = c.FirstOrDefault().TypeName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6),
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(),
......@@ -1650,7 +1672,7 @@ namespace JunmpPoliceStation.Controllers
rowNumber = (idx + 1) + "." + (idx1 + 1) + "." + (idx2 + 1),
id = c.FirstOrDefault().TypeThreeId,
name = c.FirstOrDefault().Name,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6),
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(),
......@@ -1659,7 +1681,7 @@ namespace JunmpPoliceStation.Controllers
rowNumber = (idx + 1) + "." + (idx1 + 1) + "." + (idx2 + 1) + "." + (idx3 + 1),
id = c.FirstOrDefault().EquipmentCode,
name = c.FirstOrDefault().EquipmentName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6),
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(),
......@@ -1672,7 +1694,7 @@ namespace JunmpPoliceStation.Controllers
suplierName = c.Key.SupplierName,
price = c.Key.Price,
sumPrice = c.Count(f => f.CurrentState != null) * c.Key.Price,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != 6),
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()
......
......@@ -373,6 +373,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetListOrgWarehouse")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSign]
public async Task<HttpResponseMessage> GetListOrgWarehouse([FromBody] JObject jdata)
{
......@@ -695,6 +696,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetWarehouseDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSign]
public async Task<HttpResponseMessage> GetWarehouseDevelop([FromBody] JObject jdata)
{
......@@ -809,6 +811,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("AddOrUpdateWarehouse")]
[ServiceFilter(typeof(ActionLimitAttribute))]
//[NoSign]
public async Task<HttpResponseMessage> AddOrUpdateWarehouse([FromBody] JObject jdata)
{
......@@ -1203,7 +1206,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetWarehouseEquipmentDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> GetWarehouseEquipmentDevelop([FromBody] JObject jdata)
{
return await Task.Run(() =>
......
......@@ -581,7 +581,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("UpDevDevelop")]
[ServiceFilter(typeof(ActionLimitAttribute))]
public async Task<HttpResponseMessage> UpDevDevelop([FromBody] JObject jdata)
{
return await Task.Run(() =>
......
......@@ -25,7 +25,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://192.168.3.1:5000;http://192.168.10.88:5000;http://localhost:5001;http://localhost:5000;http://0.0.0.0:5001;"
"applicationUrl": "http://localhost:5000;http://192.168.10.88:5000;http://192.168.3.1:5001;http://localhost:5000;http://0.0.0.0:5001;"
},
"Docker": {
"commandName": "Docker",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论