3个文件已删除
1 文件已重命名
7个文件已修改
7个文件已添加
| | |
| | | <ItemGroup> |
| | | <Compile Include="AccountBLL.cs" /> |
| | | <Compile Include="AccountGroupBLL.cs" /> |
| | | <Compile Include="TreeDiagramRecordBLL.cs" /> |
| | | <Compile Include="CompanyInfoBLL.cs" /> |
| | | <Compile Include="DefaultCompanyBLL.cs" /> |
| | | <Compile Include="PushDataBLL.cs" /> |
| New file |
| | |
| | | using GasolineBlend.DAL; |
| | | using GasolineBlend.Entity; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using static GasolineBlend.Entity.TreeDiagramRecord; |
| | | |
| | | namespace GasolineBlend.BLL |
| | | { |
| | | public class TreeDiagramRecordBLL |
| | | { |
| | | private TreeDiagramRecordDAL _acc = new TreeDiagramRecordDAL(); |
| | | |
| | | /// <summary> |
| | | /// 获取用益信托网记录数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<TreeDiagramRecord> GetTreeDiagramRecordIsName(string CompanyName) |
| | | { |
| | | return _acc.GetTreeDiagramRecordIsName(CompanyName); |
| | | } |
| | | |
| | | public bool AddTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord) |
| | | { |
| | | return _acc.AddTreeDiagramRecord(treeDiagramRecord); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | using (IDbConnection connection = new MySqlConnection(connectionString)) |
| | | { |
| | | var sql = $"SELECT a.id,a.name,a.prompt,a.permission,a.creationtime,a.modificationtime,a.avatarlink,a.creatorid,a.agenttype,a.description,a.userno,a.questionno,CASE WHEN s.agentid IS NOT NULL THEN 1 ELSE 0 END AS favoriteflag FROM agentdata a LEFT JOIN staragent s ON a.id = s.agentid AND s.userid = '{CreatorId}' WHERE 1=1"; |
| | | var sql = $"SELECT a.id,a.name,a.prompt,a.permission,a.creationtime,a.modificationtime,a.avatarlink,a.creatorid,a.agenttype,a.description,a.userno,a.questionno,a.modelapi,a.modelkey,CASE WHEN s.agentid IS NOT NULL THEN 1 ELSE 0 END AS favoriteflag FROM agentdata a LEFT JOIN staragent s ON a.id = s.agentid AND s.userid = '{CreatorId}' WHERE 1=1"; |
| | | if (!string.IsNullOrEmpty(Keyword)) { |
| | | sql += $" and a.name like '%{Keyword.Trim()}%' "; |
| | | } |
| | |
| | | { |
| | | using (IDbConnection connection = new MySqlConnection(connectionString)) |
| | | { |
| | | var sql = $"SELECT a.id,a.name,a.prompt,a.permission,a.creationtime,a.modificationtime,a.avatarlink,a.creatorid,a.agenttype,a.description,a.userno,a.questionno,CASE WHEN s.agentid IS NOT NULL THEN 1 ELSE 0 END AS favoriteflag FROM agentdata a LEFT JOIN staragent s ON a.id = s.agentid AND s.userid = '{CreatorId}' WHERE a.creatorid = '{CreatorId.Trim()}' "; |
| | | var sql = $"SELECT a.id,a.name,a.prompt,a.permission,a.creationtime,a.modificationtime,a.avatarlink,a.creatorid,a.agenttype,a.description,a.userno,a.questionno,a.modelapi,a.modelkey,CASE WHEN s.agentid IS NOT NULL THEN 1 ELSE 0 END AS favoriteflag FROM agentdata a LEFT JOIN staragent s ON a.id = s.agentid AND s.userid = '{CreatorId}' WHERE a.creatorid = '{CreatorId.Trim()}' "; |
| | | if (!string.IsNullOrEmpty(Keyword)) |
| | | { |
| | | sql += $" and a.name like '%{Keyword.Trim()}%' "; |
| | |
| | | agenttype = @AgentType, |
| | | modificationTime = NOW(), |
| | | avatarLink = @AvatarLink, |
| | | description = @Description |
| | | description = @Description, |
| | | modelapi = @ModelApi, |
| | | modelkey = @ModelKey |
| | | WHERE id = @Id"; |
| | | |
| | | var parameters = new |
| | |
| | | AvatarLink = agentDataPage.AvatarLink, |
| | | Id = agentDataPage.Id, |
| | | AgentType = agentDataPage.AgentType, |
| | | Description = agentDataPage.Description |
| | | Description = agentDataPage.Description, |
| | | ModelApi = agentDataPage.ModelApi, |
| | | ModelKey = agentDataPage.ModelKey |
| | | }; |
| | | |
| | | connection.Open(); // 打开数据库连接 |
| | |
| | | using (IDbConnection connection = new MySqlConnection(connectionString)) |
| | | { |
| | | var sql = @" |
| | | INSERT INTO agentdata (name, prompt, permission, creationtime, modificationtime, avatarLink, creatorid,agenttype,description) |
| | | VALUES ( @Name, @Prompt, @Permission,NOW(), NOW(), @AvatarLink, @CreatorId,@AgentType,@Description)"; |
| | | INSERT INTO agentdata (name, prompt, permission, creationtime, modificationtime, avatarLink, creatorid,agenttype,description,modelapi,modelkey) |
| | | VALUES ( @Name, @Prompt, @Permission,NOW(), NOW(), @AvatarLink, @CreatorId,@AgentType,@Description,@ModelApi,@ModelKey)"; |
| | | |
| | | var parameters = new |
| | | { |
| | |
| | | AvatarLink = agentDataPage.AvatarLink, |
| | | CreatorId = agentDataPage.CreatorId, |
| | | AgentType = agentDataPage.AgentType, |
| | | Prompt = agentDataPage.Prompt |
| | | Prompt = agentDataPage.Prompt, |
| | | ModelApi = agentDataPage.ModelApi, |
| | | ModelKey = agentDataPage.ModelKey |
| | | }; |
| | | |
| | | connection.Open(); // 打开数据库连接 |
| | |
| | | <ItemGroup> |
| | | <Compile Include="AccountDAL.cs" /> |
| | | <Compile Include="AccountGroupDAL.cs" /> |
| | | <Compile Include="TreeDiagramRecordDAL.cs" /> |
| | | <Compile Include="CompanyInfoDAL.cs" /> |
| | | <Compile Include="DefaultCompanyDAL.cs" /> |
| | | <Compile Include="PushDataDAL.cs" /> |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Drawing.Printing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using CommonHelper; |
| | | using Dapper; |
| | | using GasolineBlend.Entity; |
| | | using Google.Protobuf.WellKnownTypes; |
| | | using Microsoft.Office.Interop.Excel; |
| | | using MySql.Data.MySqlClient; |
| | | |
| | | namespace GasolineBlend.DAL |
| | | { |
| | | public class TreeDiagramRecordDAL : BaseMySQLDAL |
| | | { |
| | | public List<TreeDiagramRecord> GetTreeDiagramRecordIsName(string CompanyName) |
| | | { |
| | | using (IDbConnection connection = new MySqlConnection(connectionString)) |
| | | { |
| | | var sql = $"select * from treediagramrecord WHERE companyname='{CompanyName}';"; |
| | | return connection.Query<TreeDiagramRecord>(sql).ToList(); |
| | | } |
| | | } |
| | | |
| | | |
| | | public bool AddTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord) |
| | | { |
| | | using (IDbConnection connection = new MySqlConnection(connectionString)) |
| | | { |
| | | var sql = @" |
| | | INSERT INTO treediagramrecord (companyname, content, modificationtime) |
| | | VALUES ( @CompanyName, @Content,NOW())"; |
| | | |
| | | var parameters = new |
| | | { |
| | | CompanyName = treeDiagramRecord.CompanyName, |
| | | Content = treeDiagramRecord.Content |
| | | }; |
| | | |
| | | connection.Open(); // 打开数据库连接 |
| | | int affectedRows = connection.Execute(sql, parameters); // 执行更新操作 |
| | | return affectedRows > 0; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | /// |
| | | public int UserNo { get; set; } |
| | | /// <summary> |
| | | ///模型api |
| | | /// </summary> |
| | | /// |
| | | public string ModelApi { get; set; } |
| | | /// <summary> |
| | | ///模型key |
| | | /// </summary> |
| | | /// |
| | | public string ModelKey { get; set; } |
| | | /// <summary> |
| | | ///回答次数 |
| | | /// </summary> |
| | | /// |
| | |
| | | <Compile Include="Account.cs" /> |
| | | <Compile Include="AccountGroup.cs" /> |
| | | <Compile Include="AccountRecAge.cs" /> |
| | | <Compile Include="TreeDiagramRecord.cs" /> |
| | | <Compile Include="CompanyInfo.cs" /> |
| | | <Compile Include="DefaultCompany.cs" /> |
| | | <Compile Include="PushDataPage.cs" /> |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace GasolineBlend.Entity |
| | | { |
| | | public class TreeDiagramRecord |
| | | { |
| | | /// <summary> |
| | | /// 序号 |
| | | /// </summary> |
| | | public int Id { get; set; } |
| | | /// <summary> |
| | | /// 标题 |
| | | /// </summary> |
| | | public string CompanyName { get; set; } |
| | | /// <summary> |
| | | /// 提示词 |
| | | /// </summary> |
| | | public string Content { get; set; } |
| | | /// <summary> |
| | | ///修改时间 |
| | | /// </summary> |
| | | public DateTime ModificationTime { get; set; } |
| | | public class PaginatedResult<T> |
| | | { |
| | | public List<T> Data { get; set; } |
| | | public int TotalCount { get; set; } |
| | | public int TotalPages { get; set; } |
| | | |
| | | public PaginatedResult(List<T> totalData, int totalCount, int totalPages) |
| | | { |
| | | Data = totalData; |
| | | TotalCount = totalCount; |
| | | TotalPages = totalPages; |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | using CommonHelper; |
| | | using GasolineBlend.BLL; |
| | | using GasolineBlend.Entity; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Web; |
| | | using System.Web.Mvc; |
| | | |
| | | |
| | | namespace GasolineBlend.Controllers |
| | | { |
| | | public class TreeDiagramRecordController : BaseController |
| | | { |
| | | private TreeDiagramRecordBLL _acc = new TreeDiagramRecordBLL(); |
| | | /// <summary> |
| | | ///获取地区智能体数据 |
| | | /// </summary> |
| | | /// <param name="CompanyName"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public ActionResult GetTreeDiagramRecordIsName(string CompanyName) |
| | | { |
| | | try |
| | | { |
| | | var list = _acc.GetTreeDiagramRecordIsName(CompanyName); |
| | | if (list != null && list.Count > 0) |
| | | { |
| | | return SuccessNoShow(data: list); |
| | | } |
| | | return SuccessNoShow(data: null); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LogHelper.Write(Level.Error, "获取地区智能体数据 GetTreeDiagramRecordIsId", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName); |
| | | return Error(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | ///添加智能体 |
| | | /// </summary> |
| | | /// <param name="Keyword"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public ActionResult AddTreeDiagramRecord(TreeDiagramRecord treeDiagramRecord) |
| | | { |
| | | try |
| | | { |
| | | bool isDeleted = _acc.AddTreeDiagramRecord(treeDiagramRecord); |
| | | return isDeleted ? SuccessNoShow() : Error(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LogHelper.Write(Level.Error, "添加智能体 AddTreeDiagramRecord" + |
| | | "" + |
| | | "", 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\TreeDiagramRecord.cs" /> |
| | | <Compile Include="Controllers\CompanyInfoController.cs" /> |
| | | <Compile Include="Controllers\DefaultCompanyController.cs" /> |
| | | <Compile Include="Controllers\PushDataController.cs" /> |