chenzx
2024-12-11 4043a2fe2103c7960b74acbccdcc876d11f83f0f
czx20241211接口更新
4个文件已删除
11个文件已修改
88 ■■■■ 已修改文件
.vs/PolicyControl/FileContentIndex/36c04139-bdd2-4f50-a9ed-989330154dc8.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/FileContentIndex/3f57061f-61a6-4fb4-9a32-e5e4454b88aa.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/FileContentIndex/900c53d9-a0d5-47aa-9dd3-7fcc1eec9d7c.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/FileContentIndex/d1d70ce3-76e6-431c-a0b6-a6d3b43b834e.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/v17/fileList.bin 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.BLL/GasolineBlend.BLL.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.BLL/TreeDiagramRecordBLL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/AgentDataDAL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/ChatHistoryDAL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/GasolineBlend.DAL.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/TreeDiagramRecordDAL.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.Entity/GasolineBlend.Entity.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/ChatHistoryController.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/TreeDiagramRecord.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/GasolineBlend.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/FileContentIndex/36c04139-bdd2-4f50-a9ed-989330154dc8.vsidx
Binary files differ
.vs/PolicyControl/FileContentIndex/3f57061f-61a6-4fb4-9a32-e5e4454b88aa.vsidx
Binary files differ
.vs/PolicyControl/FileContentIndex/900c53d9-a0d5-47aa-9dd3-7fcc1eec9d7c.vsidx
Binary files differ
.vs/PolicyControl/FileContentIndex/d1d70ce3-76e6-431c-a0b6-a6d3b43b834e.vsidx
Binary files differ
.vs/PolicyControl/v17/fileList.bin
Binary files differ
GasolineBlend.BLL/GasolineBlend.BLL.csproj
@@ -127,6 +127,7 @@
  <ItemGroup>
    <Compile Include="AccountBLL.cs" />
    <Compile Include="AccountGroupBLL.cs" />
    <Compile Include="StockDataBLL.cs" />
    <Compile Include="TreeDiagramRecordBLL.cs" />
    <Compile Include="CompanyInfoBLL.cs" />
    <Compile Include="DefaultCompanyBLL.cs" />
GasolineBlend.BLL/TreeDiagramRecordBLL.cs
@@ -27,5 +27,9 @@
            return _acc.AddTreeDiagramRecord(treeDiagramRecord);
        }
        public bool UpdateTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord)
        {
            return _acc.UpdateTreeDiagramRecord(treeDiagramRecord);
        }
    }
}
GasolineBlend.DAL/AgentDataDAL.cs
@@ -36,7 +36,7 @@
                    sql += $" and a.permission = 1 "; 
                }
                int offset = (PageNum - 1) * PageSize;
                sql += $" ORDER BY a.modificationtime DESC  LIMIT {PageSize} OFFSET {offset}";
                sql += $" ORDER BY a.userno DESC  LIMIT {PageSize} OFFSET {offset}";
                return connection.Query<AgentDataPage>(sql).ToList();
            }
@@ -84,7 +84,7 @@
                }
                
                int offset = (PageNum - 1) * PageSize;
                sql += $" ORDER BY a.modificationtime DESC  LIMIT {PageSize} OFFSET {offset}";
                sql += $" ORDER BY a.userno DESC  LIMIT {PageSize} OFFSET {offset}";
                return connection.Query<AgentDataPage>(sql).ToList();
            }
GasolineBlend.DAL/ChatHistoryDAL.cs
@@ -114,7 +114,7 @@
            using (IDbConnection connection = new MySqlConnection(connectionString))
            {
                string sqlUpdateQuestion = $"UPDATE agentdata SET questionno = COALESCE(questionno, 0) + 1 WHERE id = {AgentId}";
                string sqlCount = $"SELECT COUNT(*) FROM chathistorydata WHERE userid = {UserId}";
                string sqlCount = $"SELECT COUNT(*) FROM chathistorydata WHERE userid = {UserId} and agentid={AgentId}";
                string sqlUpdateUser = $"UPDATE agentdata SET userno = COALESCE(userno, 0) + 1 WHERE id = {AgentId}";
                int count = 0;
                connection.Open();
GasolineBlend.DAL/GasolineBlend.DAL.csproj
@@ -85,6 +85,7 @@
  <ItemGroup>
    <Compile Include="AccountDAL.cs" />
    <Compile Include="AccountGroupDAL.cs" />
    <Compile Include="StockDataDAL.cs" />
    <Compile Include="TreeDiagramRecordDAL.cs" />
    <Compile Include="CompanyInfoDAL.cs" />
    <Compile Include="DefaultCompanyDAL.cs" />
GasolineBlend.DAL/TreeDiagramRecordDAL.cs
@@ -24,8 +24,6 @@
                return connection.Query<TreeDiagramRecord>(sql).ToList();
            }
        }
        public bool AddTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord)
        {
            using (IDbConnection connection = new MySqlConnection(connectionString))
@@ -45,6 +43,27 @@
                return affectedRows > 0;
            }
        }
        public bool UpdateTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord)
        {
            using (IDbConnection connection = new MySqlConnection(connectionString))
            {
                var sql = @"
                update treediagramrecord
                set content=@Content,
                modificationtime=NOW()
                where companyname=@CompanyName";
                var parameters = new
                {
                    CompanyName = treeDiagramRecord.CompanyName,
                    Content = treeDiagramRecord.Content
                };
                connection.Open(); // 打开数据库连接
                int affectedRows = connection.Execute(sql, parameters); // 执行更新操作
                return affectedRows > 0;
            }
        }
    }
}
GasolineBlend.Entity/GasolineBlend.Entity.csproj
@@ -47,6 +47,7 @@
    <Compile Include="Account.cs" />
    <Compile Include="AccountGroup.cs" />
    <Compile Include="AccountRecAge.cs" />
    <Compile Include="StockDataPage.cs" />
    <Compile Include="TreeDiagramRecord.cs" />
    <Compile Include="CompanyInfo.cs" />
    <Compile Include="DefaultCompany.cs" />
GasolineBlend/Controllers/ChatHistoryController.cs
@@ -59,6 +59,7 @@
                Prompt = Prompt.Replace("\t", "").Replace("\n", "").Replace("\r", "").Replace("\f", "");
                Prompt = Prompt.Replace(" ", "");
                Prompt = Prompt.Replace("\"", "“");
                Prompt = Prompt.Replace("\\", "\\\\");
                var list = _acc.GetChatHistory6List(AgentId, UserId);
                string historylist = "";
               for (int i = list.Count - 1; i >= 0; i--) {
@@ -128,6 +129,7 @@
                                AgentId = AgentId,
                                Role = ro
                            };
                            bool plus = _acc.UpdataUserNoById(AgentId, UserId);
                            int chatHistoryId = _acc.AddChatHistoryData(chatHistoryDataPage);
                            if (i == 0)
                            {
@@ -139,7 +141,6 @@
                                return Error();
                            }
                        }
                        bool plus = _acc.UpdataUserNoById(AgentId, UserId);
                        int Count = _acc.GetChatHistoryCountList(UserId, AgentId,null);
                        JObject obj = JObject.Parse(responseContent);
                        obj.Add("Count", Count);
@@ -161,7 +162,7 @@
            }
        }
        /// <summary>
        ///删除智能体
        ///删除对话记录
        /// </summary>
        /// <param name="Keyword"></param>
        /// <returns></returns>
@@ -175,7 +176,7 @@
            }
            catch (Exception e)
            {
                LogHelper.Write(Level.Error, "删除智能体 DelChatHistoryDataById" +
                LogHelper.Write(Level.Error, "删除对话记录 DelChatHistoryDataById" +
                    "" +
                    "", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName);
                return Error();
GasolineBlend/Controllers/TreeDiagramRecord.cs
@@ -15,7 +15,7 @@
    {
        private TreeDiagramRecordBLL _acc = new TreeDiagramRecordBLL();
        /// <summary>
        ///获取地区智能体数据
        ///获取查询历史数据
        /// </summary>
        /// <param name="CompanyName"></param>
        /// <returns></returns>
@@ -39,7 +39,7 @@
        }
        /// <summary>
        ///添加智能体
        ///添加历史数据
        /// </summary>
        /// <param name="Keyword"></param>
        /// <returns></returns>
@@ -48,8 +48,13 @@
        {
            try
            {
                bool isDeleted = _acc.AddTreeDiagramRecord(treeDiagramRecord);
                return isDeleted ? SuccessNoShow() : Error();
                var list = _acc.GetTreeDiagramRecordIsName(treeDiagramRecord.CompanyName);
                if (list.Count == 0)
                {
                    bool isAdd = _acc.AddTreeDiagramRecord(treeDiagramRecord);
                    return isAdd ? SuccessNoShow() : Error();
                }
                return SuccessNoShow(data: null);
            }
            catch (Exception e)
            {
@@ -60,5 +65,36 @@
            }
        }
        /// <summary>
        ///修改历史数据
        /// </summary>
        /// <param name="Keyword"></param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult UpdateTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord)
        {
            try
            {
                var list = _acc.GetTreeDiagramRecordIsName(treeDiagramRecord.CompanyName);
                if (list != null && list.Count != 0)
                {
                    bool isUpdata = _acc.UpdateTreeDiagramRecord(treeDiagramRecord);
                    return isUpdata ? SuccessNoShow() : Error();
                }
                else {
                    bool isUpdata = _acc.AddTreeDiagramRecord(treeDiagramRecord);
                }
                return SuccessNoShow(data: null);
            }
            catch (Exception e)
            {
                LogHelper.Write(Level.Error, "修改智能体 UpdateTreeDiagramRecord" +
                    "" +
                    "", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName);
                return Error();
            }
        }
    }
}
GasolineBlend/GasolineBlend.csproj
@@ -222,6 +222,7 @@
    <Compile Include="App_Start\FilterConfig.cs" />
    <Compile Include="App_Start\RouteConfig.cs" />
    <Compile Include="App_Start\WebExceptionFilterAttribute.cs" />
    <Compile Include="Controllers\StockDataController.cs" />
    <Compile Include="Controllers\TreeDiagramRecord.cs" />
    <Compile Include="Controllers\CompanyInfoController.cs" />
    <Compile Include="Controllers\DefaultCompanyController.cs" />