leo
2022-12-28 4a43e25a1803e63b501e401b6c7896a19c3ef3d7
备份记录2022228FX
10个文件已修改
1个文件已添加
137 ■■■■ 已修改文件
GasolineBlend.BLL/TryApplyBLL.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/TryApplyDAL.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.Entity/DzAnalyzeReport.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.Entity/PatentSearchAll.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.Entity/TryApply.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/AnalystController.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/PatentSearchController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/SysController.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/TryApplyController.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Pages/index.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/bin.zip 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.BLL/TryApplyBLL.cs
@@ -20,5 +20,10 @@
        {
            return _acc.AddTryApply(tryApply);
        }
        public bool UpdateTryApply(TryApply tryApply)
        {
            return _acc.UpdateTryApply(tryApply);
        }
    }
}
GasolineBlend.DAL/TryApplyDAL.cs
@@ -28,5 +28,17 @@
                return connection.ExecuteScalar<int>(sql, tryApply) > 0;
            }
        }
        public bool UpdateTryApply(TryApply tryApply)
        {
            using (IDbConnection connection = new MySqlConnection(connectionString))
            {
                var sql = $"update try_apply set status=@status where id=@id";
                DynamicParameters paras = new DynamicParameters();
                paras.Add("status", tryApply.status);
                paras.Add("id", tryApply.id);
                return connection.Execute(sql, paras) > 0;
            }
        }
    }
}
GasolineBlend.Entity/DzAnalyzeReport.cs
@@ -65,5 +65,21 @@
        ///</summary>
        [SugarColumn(ColumnName = "description")]
        public string Description { get; set; }
        [SugarColumn(ColumnName = "language")]
        public string Language { get; set; }
        [SugarColumn(ColumnName = "topic")]
        public string Topic { get; set; }
        [SugarColumn(ColumnName = "country")]
        public string Country { get; set; }
        [SugarColumn(ColumnName = "links")]
        public string Links { get; set; }
        [SugarColumn(ColumnName = "year")]
        public string Year { get; set; }
    }
}
GasolineBlend.Entity/PatentSearchAll.cs
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
namespace GasolineBlend.Entity
GasolineBlend.Entity/TryApply.cs
@@ -48,5 +48,10 @@
        /// </summary>
        public DateTime createtime { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public string status { get; set; }
    }
}
GasolineBlend/Controllers/AnalystController.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using CommonHelper;
using CommonHelper.Redis;
@@ -17,8 +18,9 @@
    [LoginChecked()]
    public class AnalystController : BaseController
    {
        private SysService _countryService = new SysService();
        private readonly AnalystReportService _analyzeReportRepository =new AnalystReportService();
        private readonly CustomerRedis _redis = new CustomerRedis(0);
        //private readonly CustomerRedis _redis = new CustomerRedis(0);
            /// <summary>
        /// 获取新闻列表分页
@@ -26,43 +28,63 @@
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页条数</param>
        /// <returns></returns>
        [HttpGet]
        [HttpPost]
        [LoginChecked(false)]
        public ActionResult GetPage(int pageIndex = 1, int pageSize = 20)
        public ActionResult GetPage(string title="",string country="",string topic="",string language="",int pageIndex = 1, int pageSize = 20)
        {
            var resCountry = _countryService.GetDictItems("countryTerritoryCode");
            var resLanguage = _countryService.GetDictItems("languageCode");
            var resTopic = _countryService.GetDictItems("topicCode");
            var whereExp = Expressionable.Create<DzAnalyzeReport>()
                .AndIF(!string.IsNullOrWhiteSpace(title), a => a.Title.Contains(title))
                .AndIF(!string.IsNullOrWhiteSpace(language) && !language.Contains("所有"), a => a.Language == resLanguage.Where(b=>b.ItemText==language).FirstOrDefault().ItemValue)
                .AndIF(!string.IsNullOrWhiteSpace(country) && !country.Contains("所有"), a => a.Country == resCountry.Where(b => b.ItemText == country).FirstOrDefault().ItemValue)
                .AndIF(!string.IsNullOrWhiteSpace(topic) && !topic.Contains("所有"), a => a.Topic == resTopic.Where(b => b.ItemText == topic).FirstOrDefault().ItemValue)
                .ToExpression();
            if (pageIndex < 0) pageIndex = 1;
            if (pageSize < 1) pageSize = 20;
            var page = _analyzeReportRepository.GetPagesAsync(pageIndex, pageSize, null, order: a => a.CreateTime,
            var page = _analyzeReportRepository.GetPagesAsync(pageIndex, pageSize, whereExp, order: a => a.CreateTime,
                orderEnum: OrderByType.Desc).Result;
            //转换成中文
            for (int i = 0; i < page.Items.Count; i++)
            {
                page.Items[i].Language = resLanguage.Where(b => b.ItemValue == page.Items[i].Language).FirstOrDefault()
                    .ItemText;
                page.Items[i].Topic = resTopic.Where(b => b.ItemValue == page.Items[i].Topic).FirstOrDefault()
                    .ItemText;
                page.Items[i].Country = resCountry.Where(b => b.ItemValue == page.Items[i].Country).FirstOrDefault()
                    .ItemText;
            }
            return SuccessNoShowNews(data: page);
        }
        /// <summary>
        /// 获取详情
        /// 获取详情(新版本取消)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public ActionResult GetArticle(string id)
        {
            var model = _analyzeReportRepository.GetModelAsync(id).Result;
            var cache = _redis.Get<Dictionary<string,int>>("ArticleViewCount");
            if (cache == null)
            {
                cache = new Dictionary<string, int>();
                cache.Add(model.Id, model.PageViews + 1);
            }
            else if(cache.ContainsKey(model.Id))
            {
                cache[model.Id] += 1;
            }
            else
            {
                cache.Add(model.Id, model.PageViews + 1);
            }
            _redis.Set("ArticleViewCount", cache.ToJson());
            model.PageViews = cache[model.Id];
            return Success(data: model);
            //var model = _analyzeReportRepository.GetModelAsync(id).Result;
            //var cache = _redis.Get<Dictionary<string,int>>("ArticleViewCount");
            //if (cache == null)
            //{
            //    cache = new Dictionary<string, int>();
            //    cache.Add(model.Id, model.PageViews + 1);
            //}
            //else if(cache.ContainsKey(model.Id))
            //{
            //    cache[model.Id] += 1;
            //}
            //else
            //{
            //    cache.Add(model.Id, model.PageViews + 1);
            //}
            //_redis.Set("ArticleViewCount", cache.ToJson());
            //model.PageViews = cache[model.Id];
            //return Success(data: model);
            return SuccessNoShow();
        }
        /// <summary>
GasolineBlend/Controllers/PatentSearchController.cs
@@ -127,7 +127,7 @@
            try
            {
                PatentSearchAll patentSearchAll = new PatentSearchAll();
                patentSearchAll.content=content;
                patentSearchAll.content=content.Replace(",",",").Replace(";", ";");
                patentSearchAll.keywordField = keywordField;
                patentSearchAll.sortFields = sortFields;
                patentSearchAll.pageNo = pageNo;
GasolineBlend/Controllers/SysController.cs
@@ -5,9 +5,7 @@
using System.Threading.Tasks;
using System.Web.Mvc;
using CommonHelper;
using CommonHelper.Format;
using GasolineBlend.Entity;
using LinqToExcel.Extensions;
using Pissa.Service.DbService;
using Quartz.Util;
using SqlSugar;
@@ -64,7 +62,7 @@
        /// <param name="parentCode">父编码</param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GetIpcClass(int year, string parentCode = "")
        public ActionResult GetIpcClass(int year=2021, string parentCode = "")
        {
            var res = _countryService.GetIpcClass(year,parentCode);
            return SuccessNoShow(data: res);
GasolineBlend/Controllers/TryApplyController.cs
@@ -44,6 +44,7 @@
                tryApply.company = company;
                tryApply.position = position;
                tryApply.createtime = DateTime.Now;
                tryApply.status = "已提交";
                var list = _acc.AddTryApply(tryApply);
                return SuccessNoShow(data: list);
            }
@@ -54,5 +55,24 @@
                return Error();
            }
        }
        [HttpPost]
        public ActionResult UpdateTryApply(string status,int id)
        {
            try
            {
                TryApply tryApply = new TryApply();
                tryApply.id = id;
                tryApply.status = status;
                var list = _acc.UpdateTryApply(tryApply);
                return Success(data: list);
            }
            catch (Exception e)
            {
                LogHelper.Write(Level.Error, "修改申请列表  UpdateTryApply", e,
                    OperatorProvider.Instance.Current.LoginName); //
                return Error();
            }
        }
    }
}
GasolineBlend/Pages/index.html
@@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/Pages/favicon.ico"><title>探数狗 | 您身边的全球专利服务专家</title><script defer="defer" type="module" src="/Pages/js/chunk-vendors.49dc088a.js"></script><script defer="defer" type="module" src="/Pages/js/app.4d64bf57.js"></script><link href="/Pages/css/app.1f4ce606.css" rel="stylesheet"><script defer="defer" src="/Pages/js/chunk-vendors-legacy.f1bf8091.js" nomodule></script><script defer="defer" src="/Pages/js/app-legacy.a1c909f0.js" nomodule></script></head><body><noscript><strong>We're sorry but dianzhi doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/Pages/favicon.ico"><title>探数狗 | 您身边的全球专利服务专家</title><script defer="defer" type="module" src="/Pages/js/chunk-vendors.49dc088a.js"></script><script defer="defer" type="module" src="/Pages/js/app.990f461b.js"></script><link href="/Pages/css/app.ab2f4c9a.css" rel="stylesheet"><script defer="defer" src="/Pages/js/chunk-vendors-legacy.f1bf8091.js" nomodule></script><script defer="defer" src="/Pages/js/app-legacy.860cfcee.js" nomodule></script></head><body><noscript><strong>We're sorry but dianzhi doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
GasolineBlend/bin.zip
Binary files differ