Commit ff25c5cf by 赵剑炜

充电台数据不再上报

parent 1aeb3531
...@@ -59,79 +59,81 @@ namespace JunmpPoliceStation.Controllers ...@@ -59,79 +59,81 @@ namespace JunmpPoliceStation.Controllers
{ {
try try
{ {
if (jdata != null) //if (jdata != null)
{ //{
var entity = JsonManager.GetJsonEntity(jdata); // var entity = JsonManager.GetJsonEntity(jdata);
if (entity == null) // if (entity == null)
{ // {
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED); // return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
} // }
//第三方调用接口验证orgId正确性 // //第三方调用接口验证orgId正确性
if (!string.IsNullOrEmpty(entity._PUSHORG)) // if (!string.IsNullOrEmpty(entity._PUSHORG))
{ // {
if (entity.orgId?.ToString() != entity._PUSHORG.ToString()) // if (entity.orgId?.ToString() != entity._PUSHORG.ToString())
{ // {
return JsonManager.SimpleStatusResponse(ResultCode.ORGANIZATION_ERROR); // return JsonManager.SimpleStatusResponse(ResultCode.ORGANIZATION_ERROR);
} // }
} // }
if (string.IsNullOrEmpty(entity.orgId ?? "")) // if (string.IsNullOrEmpty(entity.orgId ?? ""))
{ // {
return JsonManager.SimpleCustResponse($"orgId is require"); // return JsonManager.SimpleCustResponse($"orgId is require");
} // }
else if (string.IsNullOrEmpty(entity.equName ?? "")) // else if (string.IsNullOrEmpty(entity.equName ?? ""))
{ // {
return JsonManager.SimpleCustResponse($"equName is require"); // return JsonManager.SimpleCustResponse($"equName is require");
} // }
else if (string.IsNullOrEmpty(entity.equCode ?? "")) // else if (string.IsNullOrEmpty(entity.equCode ?? ""))
{ // {
return JsonManager.SimpleCustResponse($"equCode is require"); // return JsonManager.SimpleCustResponse($"equCode is require");
} // }
else if (string.IsNullOrEmpty(entity.epc ?? "")) // else if (string.IsNullOrEmpty(entity.epc ?? ""))
{ // {
return JsonManager.SimpleCustResponse($"epc is require"); // return JsonManager.SimpleCustResponse($"epc is require");
} // }
else if (string.IsNullOrEmpty(entity.startTime ?? "")) // else if (string.IsNullOrEmpty(entity.startTime ?? ""))
{ // {
return JsonManager.SimpleCustResponse($"startTime is require"); // return JsonManager.SimpleCustResponse($"startTime is require");
} // }
else if (string.IsNullOrEmpty(entity.endTime ?? "")) // else if (string.IsNullOrEmpty(entity.endTime ?? ""))
{ // {
return JsonManager.SimpleCustResponse($"endTime is require"); // return JsonManager.SimpleCustResponse($"endTime is require");
} // }
else // else
{ // {
string startTime = entity.startTime; // string startTime = entity.startTime;
//新增数据 // //新增数据
BaseCharge addObject = new BaseCharge() // BaseCharge addObject = new BaseCharge()
{ // {
Id = Guid.NewGuid(), // Id = Guid.NewGuid(),
OrgId = entity.orgId, // OrgId = entity.orgId,
EquName = entity.equName, // EquName = entity.equName,
EquCode = entity.equCode, // EquCode = entity.equCode,
Epc = entity.epc, // Epc = entity.epc,
StartTime = Convert.ToDateTime(startTime), // StartTime = Convert.ToDateTime(startTime),
EndTime = System.DateTime.Now // EndTime = System.DateTime.Now
}; // };
bool result = _unitOfWork.BaseChargeRepository.Insert(addObject); // bool result = _unitOfWork.BaseChargeRepository.Insert(addObject);
if (result) // if (result)
{ // {
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS); // return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
} // }
else // else
{ // {
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR); // return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
} // }
} // }
} //}
else //else
{ //{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR); // return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
} //}
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论