Commit 106db930 by zxw

Merge branch 'master' into 杭州自建平台

parents d9da102c 16d51677
...@@ -1555,7 +1555,9 @@ namespace JunmpPoliceStation.Controllers ...@@ -1555,7 +1555,9 @@ namespace JunmpPoliceStation.Controllers
{ {
_unitOfWork.EquipmentStateRepository.Insert(InsertState, false); _unitOfWork.EquipmentStateRepository.Insert(InsertState, false);
} }
if (_unitOfWork.SaveChanges() > 0)
var res = _unitOfWork.SaveChanges() > 0;
if (res)
{ {
//上报数据 //上报数据
var httpResult = _httpHelper.GetHtml(new HttpItem() var httpResult = _httpHelper.GetHtml(new HttpItem()
...@@ -1606,15 +1608,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -1606,15 +1608,10 @@ namespace JunmpPoliceStation.Controllers
scope.Rollback(); scope.Rollback();
return JsonManager.SimpleCustResponse(obj.msg); return JsonManager.SimpleCustResponse(obj.msg);
} }
}
scope.Commit(); scope.Commit();
return JsonManager.ReturnSuccessResponse(InvStates); return JsonManager.ReturnSuccessResponse(InvStates);
} }
else
{
scope.Rollback();
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
}
catch (Exception e) catch (Exception e)
{ {
scope.Rollback(); scope.Rollback();
...@@ -2622,7 +2619,8 @@ namespace JunmpPoliceStation.Controllers ...@@ -2622,7 +2619,8 @@ namespace JunmpPoliceStation.Controllers
{ {
_unitOfWork.EquipmentStateRepository.Insert(InsertState, false); _unitOfWork.EquipmentStateRepository.Insert(InsertState, false);
} }
if (_unitOfWork.SaveChanges() > 0) var res = _unitOfWork.SaveChanges() > 0;
if (res)
{ {
//上报数据 //上报数据
var httpResult = _httpHelper.GetHtml(new HttpItem() var httpResult = _httpHelper.GetHtml(new HttpItem()
...@@ -2673,15 +2671,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -2673,15 +2671,10 @@ namespace JunmpPoliceStation.Controllers
scope.Rollback(); scope.Rollback();
return JsonManager.SimpleCustResponse(obj.msg); return JsonManager.SimpleCustResponse(obj.msg);
} }
}
scope.Commit(); scope.Commit();
return JsonManager.ReturnSuccessResponse(InvStates); return JsonManager.ReturnSuccessResponse(InvStates);
} }
else
{
scope.Rollback();
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
}
catch (Exception e) catch (Exception e)
{ {
scope.Rollback(); scope.Rollback();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论