升级方式优化
This commit is contained in:
1 parent
b762ff4c7f
commit
58c26725fb
39 files changed
+1525
-1614
No files matched your search
@@ -1643,7 +1643,7 @@ namespace KJD_Web.BLL.BXX
|
||||
// 供应商货源是否已完成初始设置
|
||||
if (!string.IsNullOrEmpty(is_supplier_prod_ok))
|
||||
{
|
||||
if (is_supplier_prod_ok == "1" || is_supplier_prod_ok == "已设置")
|
||||
if (is_supplier_prod_ok == "1" || is_supplier_prod_ok == "是" || is_supplier_prod_ok == "已设置")
|
||||
where += " and wx_cat_leaf IS NOT NULL and send_to_out_server=1 and distribution_set=1";
|
||||
else
|
||||
where += " and (wx_cat_leaf IS NULL or send_to_out_server!=1 or distribution_set=0)";
|
||||
|
||||
+56
-1
@@ -2,12 +2,13 @@
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.BLL
|
||||
{
|
||||
public class UpadteManage
|
||||
public class UpdateManage
|
||||
{
|
||||
public string GetUpdate(string inputData)
|
||||
{
|
||||
@@ -62,6 +63,8 @@ namespace KJD_Web.BLL
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var path = RegexUtils.GetStringQuery(ref inputData, "path");
|
||||
|
||||
var version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt();
|
||||
var serverVersion = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateVersion"].ConnectionString;
|
||||
var UpdateNewUrl = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateNewUrl"].ConnectionString;
|
||||
@@ -71,6 +74,58 @@ namespace KJD_Web.BLL
|
||||
|
||||
if (version > LowVersion.ParseToInt())
|
||||
{
|
||||
if (path != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var fileDir = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateFileDir"].ConnectionString;
|
||||
if (path == "29wx")
|
||||
{
|
||||
var file = Directory.GetFiles(fileDir);
|
||||
var versionTmp = 0;
|
||||
foreach (var f in file)
|
||||
{
|
||||
var v = Path.GetFileName(f).Replace("Update29wx", "").Replace(".zip", "").ParseToInt();
|
||||
if (v > versionTmp && v <= serverVersion.ParseToInt())
|
||||
{
|
||||
versionTmp = v;
|
||||
}
|
||||
}
|
||||
if (versionTmp > 0)
|
||||
{
|
||||
serverVersion = versionTmp.ToString();
|
||||
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
|
||||
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateNewUrl + "Update" + serverVersion + ".zip\"}";
|
||||
}
|
||||
}
|
||||
if (path == "29pdd")
|
||||
{
|
||||
var file = Directory.GetFiles(fileDir);
|
||||
var versionTmp = 0;
|
||||
foreach (var f in file)
|
||||
{
|
||||
var v = Path.GetFileName(f).Replace("Update29pdd", "").Replace(".zip", "").ParseToInt();
|
||||
if (v > versionTmp && v <= serverVersion.ParseToInt())
|
||||
{
|
||||
versionTmp = v;
|
||||
}
|
||||
}
|
||||
if (versionTmp > 0)
|
||||
{
|
||||
serverVersion = versionTmp.ToString();
|
||||
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
|
||||
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateNewUrl + "Update" + serverVersion + ".zip\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//return "{\"code\":500,\"msg\":\"升级文件查询失败\"}";
|
||||
}
|
||||
}
|
||||
|
||||
if (serverVersion.ParseToInt() > 1159)
|
||||
serverVersion = 1159.ToString();
|
||||
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
|
||||
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateNewUrl + "Update" + serverVersion + ".zip\"}";
|
||||
}
|
||||
@@ -112,7 +112,7 @@
|
||||
<Compile Include="BLL\KJD\ProductManage.cs" />
|
||||
<Compile Include="BLL\KJD\ShopManage.cs" />
|
||||
<Compile Include="BLL\KJD\ToolManage.cs" />
|
||||
<Compile Include="BLL\KJD\UpadteManage.cs" />
|
||||
<Compile Include="BLL\KJD\UpdateManage.cs" />
|
||||
<Compile Include="BLL\KJD\UserManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXExpressOptimizeManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXProductManage.cs" />
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace KJD_Web
|
||||
var jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new UpadteManage().GetUpdate(jsontext);
|
||||
result = new UpdateManage().GetUpdate(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
@@ -73,7 +73,7 @@ namespace KJD_Web
|
||||
var jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new UpadteManage().GetUpdateNew(jsontext);
|
||||
result = new UpdateManage().GetUpdateNew(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<add name="ConnKJD" connectionString="Max Pool Size=512;Database='kjd';Data Source='nj-cynosdbmysql-grp-hl51pkfr.sql.tencentcdb.com';Port=27660;User Id='kjd';Password='Temukjd0625';Charset=utf8mb4;"/>
|
||||
<add name="ConnKJDBAK" connectionString="Max Pool Size=512;Database='kjd';Data Source='nj-cynosdbmysql-grp-9s7x16mt.sql.tencentcdb.com';Port=24049;User Id='kjdbak';Password='Temukjd0126';Charset=utf8mb4;"/>
|
||||
<add name="UpdateVersion" connectionString="525"/>
|
||||
<add name="UpdateFileDir" connectionString="C:\inetpub\wwwroot\kjd_update"/>
|
||||
<add name="UpdateNewUrl" connectionString="http://weidian.e57.cn/kjd_update/"/>
|
||||
<add name="UpdateExe" connectionString="http://1.13.195.131:9000/Download/Update.exe"/>
|
||||
<add name="UpdateExeChk" connectionString="CE4A009B7AA330314F03EEA0C3AB23F9"/>
|
||||
|
||||
Reference in new issue
Block a user