111
啊鑫
昨天 8b7abd97e7b69800789134ed8e809e19a5b5ba74
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using NewPdaSqlServer.DB;
using NewPdaSqlServer.entity;
using SqlSugar;
 
namespace NewPdaSqlServer.util;
 
public class LogService : RepositoryNoEntity
{
    /// <summary>
    ///     创建日志记录
    /// </summary>
    /// <param name="db">SqlSugar 数据库上下文</param>
    /// <param name="edtUserNo">用户编号</param>
    /// <param name="abtGuid">关联单据id</param>
    /// <param name="abtTable">表名称</param>
    /// <param name="detail">日志内容</param>
    /// <param name="orderNo">单据号</param>
    public void CreateLog(SqlSugarScope db, string edtUserNo, string abtGuid,
        string abtTable, string detail, string orderNo)
    {
        var edtUserGuid = db.Queryable<SysUser>()
            .Where(it => it.Account == edtUserNo)
            .Select(it => it.Guid) //
            .First();
 
        //detail = "[PDA]" + detail;
        // 执行存储过程
        db.Ado.ExecuteCommand(
            "exec prc_log_create @edtUserGuid, @abtGuid, @abtTable, @detail, @orderNo",
            new
            {
                edtUserGuid,
                abtGuid,
                abtTable,
                detail,
                orderNo
            }
        );
    }
 
 
    public void CreateLogI(
        SqlSugarScope db,
        Guid edtUserGuid,
        string abtGuid,
        string abtTable,
        string detail,
        string orderNo,
        string sendJson,
        string rtnJson,
        string xkyBeginTime,
        string xkyEndTime,
        int sendStatus,
        string executeTime)
    {
        Db.Ado.ExecuteCommand(
            "exec prc_log_create @edtUserGuid, @abtGuid, @abtTable, @detail, @hNo,@RtnLogGuid, @SendJson, @RtnJson, @xkyBeginTime, @xkyEndTime, @sendStatus, @executeTime",
            new
            {
                edtUserGuid,
                abtGuid = string.IsNullOrEmpty(abtGuid)
                    ? DBNull.Value
                    : (object)abtGuid,
                abtTable = (object)abtTable ?? DBNull.Value,
                detail,
                hNo = orderNo,
                RtnLogGuid = DBNull.Value,
                SendJson = sendJson,
                RtnJson = rtnJson,
                xkyBeginTime = (object)xkyBeginTime ?? DBNull.Value,
                xkyEndTime = (object)xkyEndTime ?? DBNull.Value,
                sendStatus = (object)sendStatus ?? DBNull.Value,
                executeTime = (object)executeTime ?? DBNull.Value
            });
    }
}