升级方式优化

This commit is contained in:
wule committed 2026-06-05 13:29:49 +08:00
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)";
@@ -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\"}";
}