Commit c735d02b by zonevg

1

parent 0bd5e9a2
...@@ -238,53 +238,56 @@ namespace JunmpPoliceStation.Controllers ...@@ -238,53 +238,56 @@ namespace JunmpPoliceStation.Controllers
if (result) if (result)
{ {
var httpResult = _httpHelper.GetHtml(new HttpItem() if (updateInvs.Count > 0)
{ {
URL = _httpHelper._centerServerAddress + "/api/Print/EditInventory", var httpResult = _httpHelper.GetHtml(new HttpItem()
Encoding = Encoding.UTF8,
Method = "POST",
ContentType = "application/json",
Timeout = 5000,
Postdata = _httpHelper.CreatePostData(JsonConvert.SerializeObject(new
{ {
data = updateInvs.Select(x => new URL = _httpHelper._centerServerAddress + "/api/Print/EditInventory",
Encoding = Encoding.UTF8,
Method = "POST",
ContentType = "application/json",
Timeout = 5000,
Postdata = _httpHelper.CreatePostData(JsonConvert.SerializeObject(new
{ {
editType = "UPDATE", data = updateInvs.Select(x => new
id = x.Id, {
supplierCode = x.SupplierCode, editType = "UPDATE",
epc = x.Epc, id = x.Id,
policeCode = x.PoliceCode, supplierCode = x.SupplierCode,
equipmentCode = x.EquipmentCode, epc = x.Epc,
warehouseCode = x.WarehouseCode, policeCode = x.PoliceCode,
cabinetId = x.CabinetId, equipmentCode = x.EquipmentCode,
equipmentSizecode = x.EquipmentSizecode, warehouseCode = x.WarehouseCode,
equipmentLocation = x.EquipmentLocation, cabinetId = x.CabinetId,
currentState = x.CurrentState, equipmentSizecode = x.EquipmentSizecode,
createTime = x.CreateTime, equipmentLocation = x.EquipmentLocation,
warrantyCycle = x.WarrantyCycle, currentState = x.CurrentState,
repairCycle = x.RepairCycle, createTime = x.CreateTime,
productTime = x.ProductTime, warrantyCycle = x.WarrantyCycle,
useTime = x.UseTime, repairCycle = x.RepairCycle,
price = x.Price, productTime = x.ProductTime,
isBorrowed = x.IsBorrowed, useTime = x.UseTime,
lostFlag = x.LostFlag, price = x.Price,
inventoryState = x.InventoryState, isBorrowed = x.IsBorrowed,
isInBox = x.IsInBox, lostFlag = x.LostFlag,
boxMarkId = x.BoxMarkId, inventoryState = x.InventoryState,
instantiationState = x.InstantiationState, isInBox = x.IsInBox,
}) boxMarkId = x.BoxMarkId,
})) instantiationState = x.InstantiationState,
}); })
if (httpResult.StatusCode != HttpStatusCode.OK || string.IsNullOrEmpty(httpResult.Html)) }))
{ });
scope.Rollback(); if (httpResult.StatusCode != HttpStatusCode.OK || string.IsNullOrEmpty(httpResult.Html))
return JsonManager.SimpleCustResponse("远端上报数据失败"); {
} scope.Rollback();
var obj = JsonConvert.DeserializeObject<JmpBaseResponse<object>>(httpResult.Html); return JsonManager.SimpleCustResponse("远端上报数据失败");
if (obj.code != "10000") }
{ var obj = JsonConvert.DeserializeObject<JmpBaseResponse<object>>(httpResult.Html);
scope.Rollback(); if (obj.code != "10000")
return JsonManager.SimpleCustResponse(obj.msg); {
scope.Rollback();
return JsonManager.SimpleCustResponse(obj.msg);
}
} }
scope.Commit(); scope.Commit();
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS); return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
...@@ -4578,54 +4581,57 @@ namespace JunmpPoliceStation.Controllers ...@@ -4578,54 +4581,57 @@ namespace JunmpPoliceStation.Controllers
bool result = _unitOfWork.PolicemanRepository.Update(policemanInfo, true); bool result = _unitOfWork.PolicemanRepository.Update(policemanInfo, true);
if (result) if (result)
{ {
//上报数据 if (EqInv.Count > 0)
var httpResult = _httpHelper.GetHtml(new HttpItem()
{ {
URL = _httpHelper._centerServerAddress + "/api/Print/EditInventory", //上报数据
Encoding = Encoding.UTF8, var httpResult = _httpHelper.GetHtml(new HttpItem()
Method = "POST",
ContentType = "application/json",
Timeout = 5000,
Postdata = _httpHelper.CreatePostData(JsonConvert.SerializeObject(new
{ {
data = EqInv.Select(x => new URL = _httpHelper._centerServerAddress + "/api/Print/EditInventory",
Encoding = Encoding.UTF8,
Method = "POST",
ContentType = "application/json",
Timeout = 5000,
Postdata = _httpHelper.CreatePostData(JsonConvert.SerializeObject(new
{ {
editType = "UPDATE", data = EqInv.Select(x => new
id = x.Id, {
supplierCode = x.SupplierCode, editType = "UPDATE",
epc = x.Epc, id = x.Id,
policeCode = x.PoliceCode, supplierCode = x.SupplierCode,
equipmentCode = x.EquipmentCode, epc = x.Epc,
warehouseCode = x.WarehouseCode, policeCode = x.PoliceCode,
cabinetId = x.CabinetId, equipmentCode = x.EquipmentCode,
equipmentSizecode = x.EquipmentSizecode, warehouseCode = x.WarehouseCode,
equipmentLocation = x.EquipmentLocation, cabinetId = x.CabinetId,
currentState = x.CurrentState, equipmentSizecode = x.EquipmentSizecode,
createTime = x.CreateTime, equipmentLocation = x.EquipmentLocation,
warrantyCycle = x.WarrantyCycle, currentState = x.CurrentState,
repairCycle = x.RepairCycle, createTime = x.CreateTime,
productTime = x.ProductTime, warrantyCycle = x.WarrantyCycle,
useTime = x.UseTime, repairCycle = x.RepairCycle,
price = x.Price, productTime = x.ProductTime,
isBorrowed = x.IsBorrowed, useTime = x.UseTime,
lostFlag = x.LostFlag, price = x.Price,
inventoryState = x.InventoryState, isBorrowed = x.IsBorrowed,
isInBox = x.IsInBox, lostFlag = x.LostFlag,
boxMarkId = x.BoxMarkId, inventoryState = x.InventoryState,
instantiationState = x.InstantiationState, isInBox = x.IsInBox,
}) boxMarkId = x.BoxMarkId,
})) instantiationState = x.InstantiationState,
}); })
if (httpResult.StatusCode != HttpStatusCode.OK || string.IsNullOrEmpty(httpResult.Html)) }))
{ });
scope.Rollback(); if (httpResult.StatusCode != HttpStatusCode.OK || string.IsNullOrEmpty(httpResult.Html))
return JsonManager.SimpleCustResponse("远端上报数据失败"); {
} scope.Rollback();
var obj = JsonConvert.DeserializeObject<JmpBaseResponse<object>>(httpResult.Html); return JsonManager.SimpleCustResponse("远端上报数据失败");
if (obj.code != "10000") }
{ var obj = JsonConvert.DeserializeObject<JmpBaseResponse<object>>(httpResult.Html);
scope.Rollback(); if (obj.code != "10000")
return JsonManager.SimpleCustResponse(obj.msg); {
scope.Rollback();
return JsonManager.SimpleCustResponse(obj.msg);
}
} }
scope.Commit(); scope.Commit();
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS); return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论