Commit c735d02b by zonevg

1

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