Commit 882662fe by guanzhenshan

增加解析流水异常的查询方法

parent e39c175e
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.DataWareHouse
{
/// <summary>
/// 解析异常的日志记录
/// </summary>
public class flowing_parse_error
{
public int id { get; set; }
public int flowing_id { get; set; }
public int datatype { get; set; }
public string log_content { get; set; }
public int status { get; set; }
public DateTime createtime { get; set; }
/// <summary>
/// 平台
/// </summary>
public string platform { get; set; }
/// <summary>
/// 站点
/// </summary>
public string website { get; set; }
/// <summary>
/// 月份
/// </summary>
public string month { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.DataWareHouse
{
/// <summary>
/// 解析上传文件流水的异常日志
/// </summary>
public class uploadfiles_parsing_error_log
{
/// <summary>
///
/// </summary>
public int id { get; set; }
/// <summary>
/// uploadfile的关键id
/// </summary>
public int uploadfile_id { get; set; }
/// <summary>
/// 日志级别,0:记录,1:提醒,2:异常
/// </summary>
public int log_level { get; set; }
/// <summary>
/// 日志级别名称
/// </summary>
public string log_level_name { get; set; }
/// <summary>
/// 日志内容
/// </summary>
public string log_content { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime createtime { get; set; }
/// <summary>
/// 处理状态,0:未处理,1:无需处理,2:修改配置,3:重新上传文件
/// </summary>
public int status { get; set; }
/// <summary>
/// 最后更新时间
/// </summary>
public DateTime? lastupdatetime { get; set; }
/// <summary>
/// 最后更新人id
/// </summary>
public int? lastupdateuserid { get; set; }
/// <summary>
/// 最后更新人名称
/// </summary>
public string lastupdateusername { get; set; }
}
/// <summary>
/// 日志级别,0:记录,1:提醒,2:异常
/// </summary>
public enum Enum_LogLevel
{
记录 = 0,
提醒 = 1,
异常 = 2,
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Bailun.DC.Models.DataWareHouse;
using Dapper;
using MySql.Data.MySqlClient;
namespace Bailun.DC.Services.DataWareHouse
{
public class OrderFeeConfigServices
{
/// <summary>
/// 流水取数规则配置列表
/// </summary>
/// <param name="parameter"></param>
/// <param name="platform"></param>
/// <param name="website"></param>
/// <param name="datatype"></param>
/// <param name="total"></param>
/// <returns></returns>
public List<order_fee_config> ListOrderFeeConfig(Models.BtTableParameter parameter, string platform, string website,int? datatype,ref int total)
{
var list = new List<order_fee_config>();
var sql = "select * from order_fee_config where delstatus=0 ";
var sqlparam = new DynamicParameters();
if(!string.IsNullOrEmpty(platform))
{
sql += " and platform=@platform";
sqlparam.Add("platform", platform);
}
if (!string.IsNullOrEmpty(website))
{
sql += " and website = @website";
sqlparam.Add("website", website);
}
if(datatype.HasValue)
{
sql += " and datatype="+datatype.Value;
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_DW))
{
if(cn.State== System.Data.ConnectionState.Closed)
{
cn.Open();
}
if (parameter.limit == 0)
{
list = cn.Query<order_fee_config>(sql, sqlparam).AsList();
}
else
{
var obj = cn.Page<order_fee_config>(parameter.pageIndex, parameter.limit, sql, ref total, sqlparam);
list = obj.AsList();
}
}
return list;
}
/// <summary>
/// 批量删除配置
/// </summary>
/// <param name="ids"></param>
/// <param name="uid"></param>
/// <param name="username"></param>
/// <returns></returns>
public string BulkDelete(List<int> ids,int uid,string username)
{
try
{
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_DW))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var sql = $"update order_fee_config set delstatus=1 where id in ('{string.Join("','", ids)}')";
cn.Execute(sql);
}
return "";
}
catch (Exception ex)
{
return ex.Message;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Bailun.DC.Models;
using MySql.Data.MySqlClient;
using Dapper;
using System.Linq;
using Bailun.DC.Models.DataWareHouse;
namespace Bailun.DC.Services.DataWareHouse
{
/// <summary>
/// 解析错误日志服务
/// </summary>
public class ParsingErrorLogServices
{
public List<flowing_parse_error> ListParsingError(BtTableParameter parameter, string platform, string website, int? datatype,ref int total)
{
var sql = "select * from flowing_parse_error where status=0";
var sqlparam = new DynamicParameters();
if (datatype.HasValue)
{
sql += " and datatype="+datatype.Value;
}
if(!string.IsNullOrEmpty(platform))
{
sql += " and platform=@platform";
sqlparam.Add("platform", platform);
}
if (!string.IsNullOrEmpty(website))
{
sql += " and website=@website";
sqlparam.Add("website", website);
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_DW))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
if(parameter.limit==0)
{
return cn.Query<flowing_parse_error>(sql, sqlparam).ToList();
}
else
{
return cn.Page<flowing_parse_error>(parameter.pageIndex, parameter.limit, sql, ref total, sqlparam).ToList();
}
}
}
/// <summary>
/// 更新异常信息状态
/// </summary>
/// <param name="id">异常信息id</param>
/// <param name="status">状态</param>
/// <param name="note">更新理由</param>
/// <returns></returns>
public string UpdateStatus(int id, int status, string note)
{
return "";
}
}
}
...@@ -437,7 +437,6 @@ namespace Bailun.DC.Services ...@@ -437,7 +437,6 @@ namespace Bailun.DC.Services
UpdateLogisticsWaitPay(date, 0, "admin", cn); UpdateLogisticsWaitPay(date, 0, "admin", cn);
UpdateLogisticsEndAmount(date, obj.amount_end); UpdateLogisticsEndAmount(date, obj.amount_end);
} }
return ""; return "";
......
...@@ -218,5 +218,28 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers ...@@ -218,5 +218,28 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
msg = "没有找到表格的内容数据", msg = "没有找到表格的内容数据",
}); });
} }
public ActionResult ListOrderFeeConfig()
{
return View();
}
public string ListOrderFeeConfigJson(BtTableParameter parameter,string platform,string website,int? datatype)
{
var total = 0;
var _service = new Services.DataWareHouse.OrderFeeConfigServices();
var obj = _service.ListOrderFeeConfig(parameter, platform, website, datatype, ref total);
return JsonConvert.SerializeObject(new {
rows=obj,
total=total
});
}
} }
} }
...@@ -268,8 +268,6 @@ ...@@ -268,8 +268,6 @@
alert(result.msg); alert(result.msg);
} }
});*@ });*@
}) })
function list() { function list() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment