|
|
@@ -55,10 +55,10 @@ namespace SuperAdmin.Controllers
|
|
|
req.rowsOnPage = req.rowsOnPage ?? "100";
|
|
|
req.seqPage = req.seqPage ?? "1";
|
|
|
req.order = req.order ?? "desc";
|
|
|
-
|
|
|
+ req.msisdn = ValidateMsisdn(req.msisdn);
|
|
|
String url = GetParameter(CommonUtils.WsType.PushUssdDetailGetList);
|
|
|
PushUssdDetailRes res = PushUssdDetailRes.Parse(SendPost(req, url));
|
|
|
-
|
|
|
+ var fdsds = "dsds";
|
|
|
return PartialView("../Partial/_ReportUssdDetail", res.list);
|
|
|
}
|
|
|
|
|
|
@@ -70,7 +70,10 @@ namespace SuperAdmin.Controllers
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
|
|
+ // Áp dụng cùng logic phân trang/thứ tự như ReportUssdDetailSearch để dữ liệu export khớp với search
|
|
|
+ req.rowsOnPage = req.rowsOnPage ?? "100";
|
|
|
+ req.seqPage = req.seqPage ?? "1";
|
|
|
+ req.order = req.order ?? "desc";
|
|
|
|
|
|
String url = GetParameter(CommonUtils.WsType.PushUssdDetailGetList);
|
|
|
PushUssdDetailRes res = PushUssdDetailRes.Parse(SendPost(req, url));
|
|
|
@@ -86,8 +89,7 @@ namespace SuperAdmin.Controllers
|
|
|
IXLWorksheet worksheet = workbook.Worksheets.Add("Campaign Detail");
|
|
|
worksheet.Column(i).Width = 15; worksheet.Cell(1, i++).Value = "No.";
|
|
|
worksheet.Column(i).Width = 20; worksheet.Cell(1, i++).Value = "Request ID";
|
|
|
- worksheet.Column(i).Width = 12; worksheet.Cell(1, i++).Value = "Campaign ID";
|
|
|
- worksheet.Column(i).Width = 12; worksheet.Cell(1, i++).Value = "Service ID";
|
|
|
+ worksheet.Column(i).Width = 30; worksheet.Cell(1, i++).Value = "Campaign";
|
|
|
worksheet.Column(i).Width = 18; worksheet.Cell(1, i++).Value = "Msisdn";
|
|
|
worksheet.Column(i).Width = 22; worksheet.Cell(1, i++).Value = "Send Time";
|
|
|
worksheet.Column(i).Width = 12; worksheet.Cell(1, i++).Value = "Send Status";
|
|
|
@@ -100,6 +102,7 @@ namespace SuperAdmin.Controllers
|
|
|
worksheet.Column(i).Width = 12; worksheet.Cell(1, i++).Value = "Is Success";
|
|
|
worksheet.Column(i).Width = 22; worksheet.Cell(1, i++).Value = "Insert Time";
|
|
|
worksheet.Column(i).Width = 22; worksheet.Cell(1, i++).Value = "Last Update";
|
|
|
+ worksheet.Column(i).Width = 50; worksheet.Cell(1, i++).Value = "Msg Content";
|
|
|
worksheet.Row(1).Style.Font.Bold = true;
|
|
|
worksheet.Row(1).Style.Fill.BackgroundColor = XLColor.Yellow;
|
|
|
|
|
|
@@ -110,21 +113,27 @@ namespace SuperAdmin.Controllers
|
|
|
i = 1;
|
|
|
var obj = list[index - 1];
|
|
|
worksheet.Cell(index + 1, i++).Value = index;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.requestId;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.campaignId;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.serviceId;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.msisdn;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.sendTime;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.sendStatus;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.totalStep;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.isStep1;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.step1Time;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.isStep2;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.step2Time;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.errorCode;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.isSuccess;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.insertTime;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.lastUpdate;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.requestId ?? "";
|
|
|
+ // Campaign: ID + Name (giống view)
|
|
|
+ string campaignDisplay = obj.campaignId ?? "";
|
|
|
+ if (!string.IsNullOrEmpty(obj.campaignName))
|
|
|
+ {
|
|
|
+ campaignDisplay += " - " + obj.campaignName;
|
|
|
+ }
|
|
|
+ worksheet.Cell(index + 1, i++).Value = campaignDisplay;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.msisdn ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.sendTime ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.sendStatus ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.totalStep ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.isStep1 ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.step1Time ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.isStep2 ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.step2Time ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.errorCode ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.isSuccess ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.insertTime ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.lastUpdate ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.msgContent ?? "";
|
|
|
}
|
|
|
}
|
|
|
using (var stream = new MemoryStream())
|
|
|
@@ -191,6 +200,11 @@ namespace SuperAdmin.Controllers
|
|
|
{
|
|
|
|
|
|
DashboardModel model = LoadDashboard(fromDate, toDate);
|
|
|
+ var listService = HttpContext.Session.GetComplexData<List<Service>>("listService");
|
|
|
+ if (listService == null)
|
|
|
+ {
|
|
|
+ PreLoadService();
|
|
|
+ }
|
|
|
//
|
|
|
return PartialView("../Partial/_Dashboard", model);
|
|
|
}
|
|
|
@@ -287,6 +301,7 @@ namespace SuperAdmin.Controllers
|
|
|
req2.subType = CommonUtils.ListSubType.Whitelist;
|
|
|
GetListSubRes res4 = GetListSubRes.Parse(SendPost(req, GetParameter(CommonUtils.WsType.listSubGetList)));
|
|
|
HttpContext.Session.SetComplexData("listSubFile", res4.list);
|
|
|
+ PreLoadService();
|
|
|
return View();
|
|
|
}
|
|
|
|
|
|
@@ -327,7 +342,6 @@ namespace SuperAdmin.Controllers
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
|
|
|
|
|
String url = GetParameter(CommonUtils.WsType.CamGetList);
|
|
|
CampaignGetListRes res = CampaignGetListRes.Parse(SendPost(req, url));
|
|
|
@@ -753,6 +767,77 @@ namespace SuperAdmin.Controllers
|
|
|
return PartialView("../Partial/_ApiWebserviceManagement", res.list);
|
|
|
}
|
|
|
|
|
|
+ [HttpPost]
|
|
|
+ public IActionResult ApiServiceExport(ApiServiceReq req)
|
|
|
+ {
|
|
|
+ if (!CheckAuthToken())
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // Ensure same paging/order behavior as search
|
|
|
+ req.rowsOnPage = "1000000";
|
|
|
+ req.seqPage = "1";
|
|
|
+ req.order = "desc";
|
|
|
+
|
|
|
+ string url = GetParameter(CommonUtils.WsType.ApiServiceLoad);
|
|
|
+ ApiServiceRes res = ApiServiceRes.Parse(SendPost(req, url));
|
|
|
+ var list = res.list ?? new List<ApiService>();
|
|
|
+
|
|
|
+ string contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
|
+ string fileName = "api_services.xlsx";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ using (var workbook = new XLWorkbook())
|
|
|
+ {
|
|
|
+ int i = 1;
|
|
|
+ IXLWorksheet worksheet = workbook.Worksheets.Add("API Services");
|
|
|
+ worksheet.Column(i).Width = 10; worksheet.Cell(1, i++).Value = "No.";
|
|
|
+ worksheet.Column(i).Width = 10; worksheet.Cell(1, i++).Value = "ID";
|
|
|
+ worksheet.Column(i).Width = 30; worksheet.Cell(1, i++).Value = "ws_name";
|
|
|
+ worksheet.Column(i).Width = 20; worksheet.Cell(1, i++).Value = "ws_code";
|
|
|
+ worksheet.Column(i).Width = 50; worksheet.Cell(1, i++).Value = "wsdl";
|
|
|
+ worksheet.Column(i).Width = 40; worksheet.Cell(1, i++).Value = "msg_template";
|
|
|
+ worksheet.Column(i).Width = 20; worksheet.Cell(1, i++).Value = "error_tag";
|
|
|
+ worksheet.Column(i).Width = 20; worksheet.Cell(1, i++).Value = "success_code";
|
|
|
+ worksheet.Column(i).Width = 12; worksheet.Cell(1, i++).Value = "Status";
|
|
|
+
|
|
|
+ worksheet.Row(1).Style.Font.Bold = true;
|
|
|
+ worksheet.Row(1).Style.Fill.BackgroundColor = XLColor.Yellow;
|
|
|
+
|
|
|
+ if (list.Count > 0)
|
|
|
+ {
|
|
|
+ for (int index = 1; index <= list.Count; index++)
|
|
|
+ {
|
|
|
+ i = 1;
|
|
|
+ var obj = list[index - 1];
|
|
|
+ worksheet.Cell(index + 1, i++).Value = index;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.ws_id;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.ws_name;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.ws_code;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.wsdl;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.msg_template;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.error_tag;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.success_code;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.isActive == "1" ? "Active" : "Inactive";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ using (var stream = new MemoryStream())
|
|
|
+ {
|
|
|
+ workbook.SaveAs(stream);
|
|
|
+ var content = stream.ToArray();
|
|
|
+ return File(content, contentType, fileName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
[HttpPost]
|
|
|
public JsonResult ApiServiceLoadInfo(ApiServiceReq request)
|
|
|
@@ -853,7 +938,7 @@ namespace SuperAdmin.Controllers
|
|
|
|
|
|
String url = GetParameter(CommonUtils.WsType.SvGetList);
|
|
|
ServiceGetListRes res = ServiceGetListRes.Parse(SendPost(req, url));
|
|
|
-
|
|
|
+ HttpContext.Session.SetComplexData("listService", res.list);
|
|
|
return PartialView("../Partial/_Services", res.list);
|
|
|
}
|
|
|
|
|
|
@@ -1105,16 +1190,26 @@ namespace SuperAdmin.Controllers
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
|
|
-
|
|
|
- String url = GetParameter(CommonUtils.WsType.SvGetList);
|
|
|
- ServiceGetListRes res = ServiceGetListRes.Parse(SendPost(req, url));
|
|
|
- var list = res.list;
|
|
|
-
|
|
|
- string contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
|
- string fileName = "services.xlsx";
|
|
|
try
|
|
|
{
|
|
|
+ // Initialize req if null
|
|
|
+ if (req == null)
|
|
|
+ {
|
|
|
+ req = new ServiceGetListReq();
|
|
|
+ }
|
|
|
+
|
|
|
+ // Set pagination to get all records, same as ServiceSearch
|
|
|
+ req.rowsOnPage = "1000000";
|
|
|
+ req.seqPage = "1";
|
|
|
+ req.order = "desc";
|
|
|
+
|
|
|
+ String url = GetParameter(CommonUtils.WsType.SvGetList);
|
|
|
+ ServiceGetListRes res = ServiceGetListRes.Parse(SendPost(req, url));
|
|
|
+ var list = res.list ?? new List<Service>();
|
|
|
+
|
|
|
+ string contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
|
+ string fileName = "services.xlsx";
|
|
|
+
|
|
|
using (var workbook = new XLWorkbook())
|
|
|
{
|
|
|
int i = 1;
|
|
|
@@ -1146,13 +1241,13 @@ namespace SuperAdmin.Controllers
|
|
|
i = 1;
|
|
|
var obj = list[index - 1];
|
|
|
worksheet.Cell(index + 1, i++).Value = index;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.name;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.shortCode;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.command;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.description;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.dateCreated;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.msgRegisterSuccess;
|
|
|
- worksheet.Cell(index + 1, i++).Value = obj.msgRegisterFlase;
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.name ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.shortCode ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.command ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.description ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.dateCreated ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.msgRegisterSuccess ?? "";
|
|
|
+ worksheet.Cell(index + 1, i++).Value = obj.msgRegisterFlase ?? "";
|
|
|
}
|
|
|
}
|
|
|
using (var stream = new MemoryStream())
|
|
|
@@ -1165,6 +1260,7 @@ namespace SuperAdmin.Controllers
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
+ log.Error("Error in ServiceExport: " + ex.Message, ex);
|
|
|
return null;
|
|
|
}
|
|
|
}
|