From 4a43e25a1803e63b501e401b6c7896a19c3ef3d7 Mon Sep 17 00:00:00 2001
From: leo <182004222@qq.com>
Date: 星期三, 28 十二月 2022 22:48:53 +0800
Subject: [PATCH] 备份记录2022228FX
---
GasolineBlend.Entity/TryApply.cs | 5 +
GasolineBlend.Entity/DzAnalyzeReport.cs | 16 +++++
GasolineBlend/Controllers/PatentSearchController.cs | 2
GasolineBlend/Controllers/SysController.cs | 4 -
GasolineBlend/Pages/index.html | 2
GasolineBlend/Controllers/TryApplyController.cs | 20 ++++++
GasolineBlend.DAL/TryApplyDAL.cs | 12 ++++
GasolineBlend.Entity/PatentSearchAll.cs | 3 -
GasolineBlend/bin.zip | 0
GasolineBlend/Controllers/AnalystController.cs | 68 +++++++++++++++-------
GasolineBlend.BLL/TryApplyBLL.cs | 5 +
11 files changed, 106 insertions(+), 31 deletions(-)
diff --git a/GasolineBlend.BLL/TryApplyBLL.cs b/GasolineBlend.BLL/TryApplyBLL.cs
index 4e89e44..77d75b6 100644
--- a/GasolineBlend.BLL/TryApplyBLL.cs
+++ b/GasolineBlend.BLL/TryApplyBLL.cs
@@ -20,5 +20,10 @@
{
return _acc.AddTryApply(tryApply);
}
+
+ public bool UpdateTryApply(TryApply tryApply)
+ {
+ return _acc.UpdateTryApply(tryApply);
+ }
}
}
diff --git a/GasolineBlend.DAL/TryApplyDAL.cs b/GasolineBlend.DAL/TryApplyDAL.cs
index 6ea2125..99a6105 100644
--- a/GasolineBlend.DAL/TryApplyDAL.cs
+++ b/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;
+ }
+ }
}
}
diff --git a/GasolineBlend.Entity/DzAnalyzeReport.cs b/GasolineBlend.Entity/DzAnalyzeReport.cs
index 5de16d0..f4ac3d4 100644
--- a/GasolineBlend.Entity/DzAnalyzeReport.cs
+++ b/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; }
}
}
diff --git a/GasolineBlend.Entity/PatentSearchAll.cs b/GasolineBlend.Entity/PatentSearchAll.cs
index 442fbeb..b3e99ce 100644
--- a/GasolineBlend.Entity/PatentSearchAll.cs
+++ b/GasolineBlend.Entity/PatentSearchAll.cs
@@ -1,8 +1,5 @@
锘縰sing System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using SqlSugar;
namespace GasolineBlend.Entity
diff --git a/GasolineBlend.Entity/TryApply.cs b/GasolineBlend.Entity/TryApply.cs
index dee3a56..560dfd6 100644
--- a/GasolineBlend.Entity/TryApply.cs
+++ b/GasolineBlend.Entity/TryApply.cs
@@ -48,5 +48,10 @@
/// </summary>
public DateTime createtime { get; set; }
+ /// <summary>
+ /// 鐘舵��
+ /// </summary>
+ public string status { get; set; }
+
}
}
diff --git a/GasolineBlend/Controllers/AnalystController.cs b/GasolineBlend/Controllers/AnalystController.cs
index 07893e4..9d57889 100644
--- a/GasolineBlend/Controllers/AnalystController.cs
+++ b/GasolineBlend/Controllers/AnalystController.cs
@@ -1,5 +1,6 @@
锘縰sing 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>
diff --git a/GasolineBlend/Controllers/PatentSearchController.cs b/GasolineBlend/Controllers/PatentSearchController.cs
index 2196de4..189ee14 100644
--- a/GasolineBlend/Controllers/PatentSearchController.cs
+++ b/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;
diff --git a/GasolineBlend/Controllers/SysController.cs b/GasolineBlend/Controllers/SysController.cs
index 0c8a04e..a67c327 100644
--- a/GasolineBlend/Controllers/SysController.cs
+++ b/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);
diff --git a/GasolineBlend/Controllers/TryApplyController.cs b/GasolineBlend/Controllers/TryApplyController.cs
index cc7eb77..10f2860 100644
--- a/GasolineBlend/Controllers/TryApplyController.cs
+++ b/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();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/GasolineBlend/Pages/index.html b/GasolineBlend/Pages/index.html
index deb8f89..849d12c 100644
--- a/GasolineBlend/Pages/index.html
+++ b/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>
\ No newline at end of file
+<!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>
\ No newline at end of file
diff --git a/GasolineBlend/bin.zip b/GasolineBlend/bin.zip
new file mode 100644
index 0000000..ca5a56b
--- /dev/null
+++ b/GasolineBlend/bin.zip
Binary files differ
--
Gitblit v1.8.0