| | |
| | | <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" /> |
| | |
| | | return _acc.AddTreeDiagramRecord(treeDiagramRecord); |
| | | } |
| | | |
| | | public bool UpdateTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord) |
| | | { |
| | | return _acc.UpdateTreeDiagramRecord(treeDiagramRecord); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | } |
| | | |
| | | 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(); |
| | | } |
| | |
| | | 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(); |
| | |
| | | <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" /> |
| | |
| | | return connection.Query<TreeDiagramRecord>(sql).ToList(); |
| | | } |
| | | } |
| | | |
| | | |
| | | public bool AddTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord) |
| | | { |
| | | using (IDbConnection connection = new MySqlConnection(connectionString)) |
| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <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" /> |
| | |
| | | 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--) { |
| | |
| | | AgentId = AgentId, |
| | | Role = ro |
| | | }; |
| | | bool plus = _acc.UpdataUserNoById(AgentId, UserId); |
| | | int chatHistoryId = _acc.AddChatHistoryData(chatHistoryDataPage); |
| | | if (i == 0) |
| | | { |
| | |
| | | return Error(); |
| | | } |
| | | } |
| | | bool plus = _acc.UpdataUserNoById(AgentId, UserId); |
| | | int Count = _acc.GetChatHistoryCountList(UserId, AgentId,null); |
| | | JObject obj = JObject.Parse(responseContent); |
| | | obj.Add("Count", Count); |
| | |
| | | } |
| | | } |
| | | /// <summary> |
| | | ///删除智能体 |
| | | ///删除对话记录 |
| | | /// </summary> |
| | | /// <param name="Keyword"></param> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | 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(); |
| | |
| | | { |
| | | private TreeDiagramRecordBLL _acc = new TreeDiagramRecordBLL(); |
| | | /// <summary> |
| | | ///获取地区智能体数据 |
| | | ///获取查询历史数据 |
| | | /// </summary> |
| | | /// <param name="CompanyName"></param> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | ///添加智能体 |
| | | ///添加历史数据 |
| | | /// </summary> |
| | | /// <param name="Keyword"></param> |
| | | /// <returns></returns> |
| | |
| | | { |
| | | 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) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /// <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(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | <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" /> |