chenzx
2024-12-09 bb844c4dae6317ba6e8d098d0bf3b40bcba8350c
czx20241209接口更新
3个文件已删除
1 文件已重命名
7个文件已修改
7个文件已添加
220 ■■■■■ 已修改文件
.vs/PolicyControl/FileContentIndex/1fa74ead-8fdf-4dd7-92f8-b597ea884b0b.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/FileContentIndex/2134a282-4710-4964-ae66-66627cd4a12a.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
.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/FileContentIndex/e93ed239-976f-4897-89e2-a30c55b39ced.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/v17/fileList.bin 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.BLL/GasolineBlend.BLL.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.BLL/TreeDiagramRecordBLL.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/AgentDataDAL.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/GasolineBlend.DAL.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/TreeDiagramRecordDAL.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.Entity/AgentDataPage.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.Entity/GasolineBlend.Entity.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.Entity/TreeDiagramRecord.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/TreeDiagramRecord.cs 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/GasolineBlend.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/FileContentIndex/1fa74ead-8fdf-4dd7-92f8-b597ea884b0b.vsidx
Binary files differ
.vs/PolicyControl/FileContentIndex/2134a282-4710-4964-ae66-66627cd4a12a.vsidx
Binary files differ
.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/FileContentIndex/e93ed239-976f-4897-89e2-a30c55b39ced.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="TreeDiagramRecordBLL.cs" />
    <Compile Include="CompanyInfoBLL.cs" />
    <Compile Include="DefaultCompanyBLL.cs" />
    <Compile Include="PushDataBLL.cs" />
GasolineBlend.BLL/TreeDiagramRecordBLL.cs
New file
@@ -0,0 +1,31 @@
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);
        }
    }
}
GasolineBlend.DAL/AgentDataDAL.cs
@@ -20,7 +20,7 @@
        {
            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()}%' ";
                }
@@ -73,7 +73,7 @@
        {
            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()}%' ";
@@ -131,7 +131,9 @@
                    agenttype = @AgentType,
                    modificationTime = NOW(),
                    avatarLink = @AvatarLink,
                    description = @Description
                    description = @Description,
                    modelapi = @ModelApi,
                    modelkey = @ModelKey
                WHERE id = @Id";
                var parameters = new
@@ -142,7 +144,9 @@
                    AvatarLink = agentDataPage.AvatarLink,
                    Id = agentDataPage.Id,
                    AgentType = agentDataPage.AgentType,
                    Description = agentDataPage.Description
                    Description = agentDataPage.Description,
                    ModelApi = agentDataPage.ModelApi,
                    ModelKey = agentDataPage.ModelKey
                };
                connection.Open(); // 打开数据库连接
@@ -156,8 +160,8 @@
            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 
                {
@@ -167,7 +171,9 @@
                    AvatarLink = agentDataPage.AvatarLink,
                    CreatorId = agentDataPage.CreatorId,
                    AgentType = agentDataPage.AgentType,
                    Prompt = agentDataPage.Prompt
                    Prompt = agentDataPage.Prompt,
                    ModelApi = agentDataPage.ModelApi,
                    ModelKey = agentDataPage.ModelKey
                };
                connection.Open(); // 打开数据库连接
GasolineBlend.DAL/GasolineBlend.DAL.csproj
@@ -85,6 +85,7 @@
  <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" />
GasolineBlend.DAL/TreeDiagramRecordDAL.cs
New file
@@ -0,0 +1,50 @@
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;
            }
        }
    }
}
GasolineBlend.Entity/AgentDataPage.cs
@@ -66,6 +66,16 @@
        /// 
        public int UserNo { get; set; }
        /// <summary>
        ///模型api
        /// </summary>
        ///
        public string ModelApi { get; set; }
        /// <summary>
        ///模型key
        /// </summary>
        ///
        public string ModelKey { get; set; }
        /// <summary>
        ///回答次数
        /// </summary>
        /// 
GasolineBlend.Entity/GasolineBlend.Entity.csproj
@@ -47,6 +47,7 @@
    <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" />
GasolineBlend.Entity/TreeDiagramRecord.cs
New file
@@ -0,0 +1,41 @@
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;
            }
        }
    }
}
GasolineBlend/Controllers/TreeDiagramRecord.cs
New file
@@ -0,0 +1,64 @@
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();
            }
        }
    }
}
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\TreeDiagramRecord.cs" />
    <Compile Include="Controllers\CompanyInfoController.cs" />
    <Compile Include="Controllers\DefaultCompanyController.cs" />
    <Compile Include="Controllers\PushDataController.cs" />