|
@@ -21,6 +21,7 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
/// </summary>
|
|
|
public class PoliceDSController : BaseController
|
|
|
{
|
|
|
+ #region 注入
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly ICapPublisher _capPublisher;
|
|
|
private readonly IRepository<PoliceReceiveChainAlarmDs> _policeReceiveChainAlarmDsRepository;
|
|
@@ -57,6 +58,7 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
_hotlineClient = hotlineClient;
|
|
|
_channelConfigurationManager = channelConfigurationManager;
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
#region receive-工单受理-已完成
|
|
|
|
|
@@ -75,14 +77,14 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
var configurationPoliceDS = _channelConfigurationManager.GetConfigurationPoliceDS();
|
|
|
var sm4 = configurationPoliceDS.token1_sm4_mw;
|
|
|
|
|
|
- IApiResultR apiR;
|
|
|
+ var apiR = new DeReponse<string>();
|
|
|
try
|
|
|
{
|
|
|
// 验证dcsm
|
|
|
string dcsmMsg = CComm.checkDcsm(Request.Headers["dcsm"].ToString(), configurationPoliceDS.token1_dcsm);
|
|
|
if (!string.IsNullOrEmpty(dcsmMsg))
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed(dcsmMsg);
|
|
|
+ apiR = DeReponse<string>.Failed(dcsmMsg);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -107,7 +109,6 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- ResultR result = new();
|
|
|
if (string.IsNullOrEmpty(strResult))
|
|
|
{
|
|
|
#region 写入本地数据库
|
|
@@ -135,39 +136,22 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
data.Id = id;
|
|
|
data.OrderId = resultOrder.Result.Id;
|
|
|
await _policeReceiveChainAlarmDsRepository.UpdateAsync(data, HttpContext.RequestAborted);
|
|
|
- result.rcode = 0;
|
|
|
- result.rmsg = "调用成功";
|
|
|
+ apiR = DeReponse<string>.Succeed(null);
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
- result.rcode = 0;
|
|
|
- result.rmsg = "调用成功";
|
|
|
- }
|
|
|
+ apiR = DeReponse<string>.Failed(resultOrder.Error);
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
- result.rcode = -1;
|
|
|
- result.rmsg = "调用失败";
|
|
|
- }
|
|
|
+ apiR = DeReponse<string>.Failed(null);
|
|
|
#endregion
|
|
|
}
|
|
|
else
|
|
|
- result.rmsg = strResult;
|
|
|
-
|
|
|
- #region 返回状态
|
|
|
- if (result.rcode == -1 && false == string.IsNullOrEmpty(result.rmsg))
|
|
|
- apiR = ApiResultR.Failed(result.rmsg);
|
|
|
- else if (result.rcode == 0)
|
|
|
- apiR = ApiResultR.Succeed(result.rdata);
|
|
|
- else
|
|
|
- apiR = ApiResultR.Failed();
|
|
|
-
|
|
|
- #endregion
|
|
|
+ apiR = DeReponse<string>.Failed(strResult);
|
|
|
}
|
|
|
}
|
|
|
catch (System.Exception)
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed("接口异常");
|
|
|
+ apiR = DeReponse<string>.Failed("接口异常");
|
|
|
}
|
|
|
|
|
|
#region 处理返回数据
|
|
@@ -205,14 +189,14 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
var configurationPoliceDS = _channelConfigurationManager.GetConfigurationPoliceDS();
|
|
|
string sm4 = configurationPoliceDS.token4_sm4_mw;
|
|
|
|
|
|
- IApiResultR apiR;
|
|
|
+ var apiR = new DeReponse<string>();
|
|
|
try
|
|
|
{
|
|
|
// 验证dcsm
|
|
|
string dcsmMsg = CComm.checkDcsm(Request.Headers["dcsm"].ToString(), configurationPoliceDS.token4_dcsm);
|
|
|
if (!string.IsNullOrEmpty(dcsmMsg))
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed(dcsmMsg);
|
|
|
+ apiR = DeReponse<string>.Failed(dcsmMsg);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -238,7 +222,6 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
chainDeal.RevisitTime = null;
|
|
|
#endregion
|
|
|
|
|
|
- ResultR result = new();
|
|
|
if (string.IsNullOrEmpty(strResult))
|
|
|
{
|
|
|
#region 写入本地数据库
|
|
@@ -247,33 +230,21 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
{
|
|
|
//这里组装数据推送到业务系统
|
|
|
await InitChainDeal(data);
|
|
|
-
|
|
|
- result.rcode = 0;
|
|
|
- result.rmsg = "调用成功";
|
|
|
+ apiR = DeReponse<string>.Succeed(null);
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
- result.rcode = -1;
|
|
|
- result.rmsg = "调用失败";
|
|
|
- }
|
|
|
+ apiR = DeReponse<string>.Failed(null);
|
|
|
+
|
|
|
#endregion
|
|
|
}
|
|
|
else
|
|
|
- result.rmsg = strResult;
|
|
|
-
|
|
|
-
|
|
|
- if (result.rcode == -1 && false == string.IsNullOrEmpty(result.rmsg))
|
|
|
- apiR = ApiResultR.Failed(result.rmsg);
|
|
|
- else if (result.rcode == 0)
|
|
|
- apiR = ApiResultR.Succeed(result.rdata);
|
|
|
- else
|
|
|
- apiR = ApiResultR.Failed();
|
|
|
+ apiR = DeReponse<string>.Failed(null);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
catch (System.Exception)
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed("接口异常");
|
|
|
+ apiR = DeReponse<string>.Failed("接口异常");
|
|
|
}
|
|
|
|
|
|
// 返回数据转Json
|
|
@@ -303,14 +274,14 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
var configurationPoliceDS = _channelConfigurationManager.GetConfigurationPoliceDS();
|
|
|
string sm4 = configurationPoliceDS.token3_sm4_mw;
|
|
|
|
|
|
- IApiResultR apiR = null;
|
|
|
+ var apiR = new DeReponse<string>();
|
|
|
try
|
|
|
{
|
|
|
// 验证dcsm
|
|
|
string dcsmMsg = CComm.checkDcsm(Request.Headers["dcsm"].ToString(), configurationPoliceDS.token3_dcsm);
|
|
|
if (!string.IsNullOrEmpty(dcsmMsg))
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed(dcsmMsg);
|
|
|
+ apiR = DeReponse<string>.Failed(dcsmMsg);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -328,12 +299,12 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
if (string.IsNullOrEmpty(openData.StartDate) || !CComm.IsDate(openData.StartDate))
|
|
|
{
|
|
|
bRun = false;
|
|
|
- apiR = ApiResultR.Failed("【创建开始时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
+ apiR = DeReponse<string>.Failed("【创建开始时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
if (string.IsNullOrEmpty(openData.EndDate) || !CComm.IsDate(openData.EndDate))
|
|
|
{
|
|
|
bRun = false;
|
|
|
- apiR = ApiResultR.Failed("【创建结束时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
+ apiR = DeReponse<string>.Failed("【创建结束时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
if (bRun)
|
|
|
{
|
|
@@ -345,19 +316,19 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
.ToListAsync();
|
|
|
|
|
|
if (null == listData)
|
|
|
- apiR = ApiResultR.Failed();
|
|
|
+ apiR = DeReponse<string>.Failed(null);
|
|
|
else
|
|
|
{
|
|
|
var dto = _mapper.Map<IReadOnlyList<ChainAlarm_DS>>(listData);
|
|
|
// 返回数据
|
|
|
- apiR = ApiResultR.Succeed(System.Text.Json.JsonSerializer.Serialize(dto), "调用成功");
|
|
|
+ apiR = DeReponse<string>.Succeed(System.Text.Json.JsonSerializer.Serialize(dto), "调用成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
catch (System.Exception)
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed("接口异常");
|
|
|
+ apiR = DeReponse<string>.Failed("接口异常");
|
|
|
}
|
|
|
|
|
|
// 返回数据转Json
|
|
@@ -390,14 +361,14 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
var configurationPoliceDS = _channelConfigurationManager.GetConfigurationPoliceDS();
|
|
|
string sm4 = configurationPoliceDS.token2_sm4_mw;
|
|
|
|
|
|
- IApiResultR apiR = null;
|
|
|
+ var apiR = new DeReponse<string>();
|
|
|
try
|
|
|
{
|
|
|
// 验证dcsm
|
|
|
string dcsmMsg = CComm.checkDcsm(Request.Headers["dcsm"].ToString(), configurationPoliceDS.token2_dcsm);
|
|
|
if (!string.IsNullOrEmpty(dcsmMsg))
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed(dcsmMsg);
|
|
|
+ apiR = DeReponse<string>.Failed(dcsmMsg);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -416,12 +387,12 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
if (!string.IsNullOrEmpty(openData.StartDate) && !CComm.IsDate(openData.StartDate))
|
|
|
{
|
|
|
bRun = false;
|
|
|
- apiR = ApiResultR.Failed("【创建开始时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
+ apiR = DeReponse<string>.Failed("【创建开始时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(openData.EndDate) && !CComm.IsDate(openData.EndDate))
|
|
|
{
|
|
|
bRun = false;
|
|
|
- apiR = ApiResultR.Failed("【创建结束时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
+ apiR = DeReponse<string>.Failed("【创建结束时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
|
|
|
if (bRun)
|
|
@@ -436,19 +407,19 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
.ToListAsync();
|
|
|
|
|
|
if (null == listData)
|
|
|
- apiR = ApiResultR.Failed();
|
|
|
+ apiR = DeReponse<string>.Failed(null);
|
|
|
else
|
|
|
{
|
|
|
var dto = _mapper.Map<IReadOnlyList<ChainDeal_DS>>(listData);
|
|
|
// 返回数据
|
|
|
- apiR = ApiResultR.Succeed(System.Text.Json.JsonSerializer.Serialize(dto), "调用成功");
|
|
|
+ apiR = DeReponse<string>.Succeed(System.Text.Json.JsonSerializer.Serialize(dto), "调用成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
catch (System.Exception)
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed("接口异常");
|
|
|
+ apiR = DeReponse<string>.Failed("接口异常");
|
|
|
}
|
|
|
|
|
|
// 返回数据转Json
|
|
@@ -474,8 +445,8 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
public async Task<HttpResponseMessage> Get_Knowledge_Info()
|
|
|
{
|
|
|
// 测试Json
|
|
|
- // {"createTimeBegin":"2003-04-07 10:59:14","createTimeEnd":"2023-08-07 10:59:21","keyWord":"222"}
|
|
|
- // {"createTimeBegin":"2003-04-07 10:59:14","createTimeEnd":"2023-08-07 10:59:21","keyWord":""}
|
|
|
+ // {"createTimeBegin":"2003-04-07 10:59:14","createTimeEnd":"2023-12-07 10:59:21","keyWord":"市民"}
|
|
|
+ // {"createTimeBegin":"2003-04-07 10:59:14","createTimeEnd":"2023-12-07 10:59:21","keyWord":""}
|
|
|
|
|
|
// 测试Base64
|
|
|
// sVGPN7BDsKnDLrd6NzrGx+2IH6vVAo6bjGSenIgCJATssZduYxBOLdQi7TVdsBCy7AGk15xjKRVe4AdovL6r49fxDvWjyDlxS8K4qkukEOtYs/VyP6WIdiKQL6PC3i/T
|
|
@@ -483,14 +454,14 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
var configurationPoliceDS = _channelConfigurationManager.GetConfigurationPoliceDS();
|
|
|
string sm4 = configurationPoliceDS.token5_sm4_mw;
|
|
|
|
|
|
- IApiResultR apiR = null;
|
|
|
+ var apiR = new DeReponse<string>();
|
|
|
try
|
|
|
{
|
|
|
// 验证dcsm
|
|
|
string dcsmMsg = CComm.checkDcsm(Request.Headers["dcsm"].ToString(), configurationPoliceDS.token5_dcsm);
|
|
|
if (!string.IsNullOrEmpty(dcsmMsg))
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed(dcsmMsg);
|
|
|
+ apiR = DeReponse<string>.Failed(dcsmMsg);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -510,12 +481,12 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
if (string.IsNullOrEmpty(get_Knowledge.createTimeBegin) || !CComm.IsDate(get_Knowledge.createTimeBegin))
|
|
|
{
|
|
|
bRun = false;
|
|
|
- apiR = ApiResultR.Failed("【创建开始时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
+ apiR = DeReponse<string>.Failed("【创建开始时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
if (string.IsNullOrEmpty(get_Knowledge.createTimeEnd) || !CComm.IsDate(get_Knowledge.createTimeEnd))
|
|
|
{
|
|
|
bRun = false;
|
|
|
- apiR = ApiResultR.Failed("【创建结束时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
+ apiR = DeReponse<string>.Failed("【创建结束时间】不是日期格式 yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
if (bRun)
|
|
|
{
|
|
@@ -528,19 +499,19 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
.ToListAsync();
|
|
|
|
|
|
if (null == listData)
|
|
|
- apiR = ApiResultR.Failed();
|
|
|
+ apiR = DeReponse<string>.Failed(null);
|
|
|
else
|
|
|
{
|
|
|
var dto = _mapper.Map<IReadOnlyList<KnowledgeDto>>(listData);
|
|
|
// 返回数据
|
|
|
- apiR = ApiResultR.Succeed(System.Text.Json.JsonSerializer.Serialize(dto), "调用成功");
|
|
|
+ apiR = DeReponse<string>.Succeed(System.Text.Json.JsonSerializer.Serialize(dto), "调用成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
catch (System.Exception)
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed("接口异常");
|
|
|
+ apiR = DeReponse<string>.Failed("接口异常");
|
|
|
}
|
|
|
|
|
|
// 返回数据转Json
|
|
@@ -568,13 +539,13 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
var configurationPoliceDS = _channelConfigurationManager.GetConfigurationPoliceDS();
|
|
|
string sm4 = configurationPoliceDS.token6_sm4_mw;
|
|
|
|
|
|
- IApiResultR apiR;
|
|
|
+ var apiR = new DeReponse<string>();
|
|
|
try
|
|
|
{
|
|
|
// 验证dcsm
|
|
|
string dcsmMsg = CComm.checkDcsm(Request.Headers["dcsm"].ToString(), configurationPoliceDS.token6_dcsm);
|
|
|
if (!string.IsNullOrEmpty(dcsmMsg))
|
|
|
- apiR = ApiResultR.Failed(dcsmMsg);
|
|
|
+ apiR = DeReponse<string>.Failed(dcsmMsg);
|
|
|
else
|
|
|
{
|
|
|
string base64String = await CComm.getStreamBase64(HttpContext.Request);
|
|
@@ -591,25 +562,25 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
|
|
|
if (string.IsNullOrEmpty(get_Knowledge.id))
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed("【知识库ID】不能为空");
|
|
|
+ apiR = DeReponse<string>.Failed("【知识库ID】不能为空");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
var data = await _knowledgeRawDataRepository.GetAsync(p => p.Id == get_Knowledge.id);
|
|
|
if (null == data)
|
|
|
- apiR = ApiResultR.Failed();
|
|
|
+ apiR = DeReponse<string>.Failed(null);
|
|
|
else
|
|
|
{
|
|
|
var dto = _mapper.Map<KnowledgeContent>(data);
|
|
|
// 返回数据
|
|
|
- apiR = ApiResultR.Succeed(System.Text.Json.JsonSerializer.Serialize(dto), "调用成功");
|
|
|
+ apiR = DeReponse<string>.Succeed(System.Text.Json.JsonSerializer.Serialize(dto), "调用成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
catch (System.Exception)
|
|
|
{
|
|
|
- apiR = ApiResultR.Failed("接口异常");
|
|
|
+ apiR = DeReponse<string>.Failed("接口异常");
|
|
|
}
|
|
|
|
|
|
// 返回数据转Json
|
|
@@ -624,6 +595,7 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region 私有方法
|
|
|
/// <summary>
|
|
|
/// 工单办结
|
|
|
/// </summary>
|
|
@@ -677,5 +649,6 @@ namespace Sharing.DaoShu110.Controllers
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|