修复流程中表单权限配置的批量设置,保存后修改的内容无法全部保存问题,修复输入模板里无法体现上下标问题,修复无法打开上传的用户版技术协议附件,因为文件名中的空格格式问题导致文件名错误问题

master
孙亮 7 months ago
parent bc2f19a10d
commit 138fc3a8ac

@ -579,12 +579,22 @@ function GetFileStream(mypk, FK_FrmAttachment) {
* @param MyPK 上传附件数据的信息主键
*/
function Down2018(mypk) {
debugger
var nodeID = GetQueryString("FK_Node");
var workID = GetQueryString("WorkID");
var url = "";
if (plant == "CCFlow") {
var handler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
handler.AddPara("WorkID", workID);
handler.AddPara("FK_Node", nodeID);
handler.AddPara("MyPK", mypk);
var fileUrl = handler.DoMethodReturnString("AttachmentUpload_Down");
if (typeof fileUrl === "string" && fileUrl.startsWith("/DataUser/")) {
window.open(window.location.origin + fileUrl);
return;
}
SetHref(basePath + "/WF/Comm/ProcessRequest?DoType=HttpHandler&DoMethod=AttachmentUpload_Down&HttpHandlerName=BP.WF.HttpHandler.WF_CCForm&WorkID=" + workID + "&FK_Node=" + nodeID + "&MyPK=" + mypk);
return;
}

@ -442,10 +442,12 @@ namespace BP.DA
}
string filePath = fileName.Substring(0, fileName.LastIndexOf('/'));
string fName = fileName.Substring(fileName.LastIndexOf('/'));
string filePath = fileName.Substring(0, fileName.LastIndexOf('/')+1);
string fName = fileName.Substring(fileName.LastIndexOf('/')+1);
fName = PraseStringToUrlFileNameExt(fName, "%", "%25");
fName = PraseStringToUrlFileNameExt(fName, " ", "%20");
fName = PraseStringToUrlFileNameExt(fName, "+", "%2B");
fName = PraseStringToUrlFileNameExt(fName, " ", "%20");
fName = PraseStringToUrlFileNameExt(fName, "/", "%2F");
@ -453,7 +455,7 @@ namespace BP.DA
fName = PraseStringToUrlFileNameExt(fName, "#", "%23");
fName = PraseStringToUrlFileNameExt(fName, "&", "%26");
fName = PraseStringToUrlFileNameExt(fName, "=", "%3D");
fName = PraseStringToUrlFileNameExt(fName, " ", "%20");
return filePath + fName;
}

@ -954,7 +954,7 @@ namespace BP.Sys.FrmUI
break;
case DBType.Oracle:
case DBType.DM:
sql = "ALTER table " + md.PTable + " modify " + attr.Field + " VARCHAR2(" + attr.MaxLen + ")";
sql = "ALTER table " + md.PTable + " modify " + attr.Field + " NVARCHAR2(" + attr.MaxLen + ")";
break;
case DBType.KingBaseR3:
case DBType.KingBaseR6:

@ -87,7 +87,7 @@ namespace BP.WF
break;
}
sql += " UNION ";
sql += " SELECT KeyOfEn AS No,Name From Sys_MapAttr WHERE UIContralType=14 AND FK_MapData='@FK_Frm'";
sql += " SELECT KeyOfEn AS No,Name From Sys_MapAttr WHERE UIContralType=14 AND FK_MapData='@FK_Frm' ORDER BY No DESC";
return sql;
}
}

@ -2,7 +2,7 @@
using System.IO;
using System.Collections.Generic;
using BP.Difference;
using System;
namespace BP.WF.HttpHandler
{
@ -13,8 +13,8 @@ namespace BP.WF.HttpHandler
{
//if (String.Compare("firefox", HttpContextHelper.RequestBrowser, StringComparison.OrdinalIgnoreCase)!=0)
// tempName = HttpUtility.UrlEncode(tempName);
HttpContextHelper.ResponseWriteFile(filepath, tempName);
HttpContextHelper.ResponseWriteFile(filepath, tempName);
}
/// <summary>

@ -4612,6 +4612,7 @@ namespace BP.WF.HttpHandler
HttpPostedFile file = HttpContextHelper.RequestFiles(i);
string fileName = System.IO.Path.GetFileName(file.FileName);
fileName = ToDBC(fileName);
#region 文件上传的iis服务器上 or db数据库里.
if (athDesc.AthSaveWay == AthSaveWay.IISServer)
@ -4668,10 +4669,10 @@ namespace BP.WF.HttpHandler
string guid = DBAccess.GenerGUID();
//string realSaveTo = savePath + "/" + guid + "." + fileName;
string realSaveTo = savePath + "/" + fileName;
string realSaveTo = savePath + "/" + guid + "." + fileName;
realSaveTo = realSaveTo.Replace("~", "-");
realSaveTo = realSaveTo.Replace("'", "-");
realSaveTo = realSaveTo.Replace("*", "-");
@ -4756,7 +4757,6 @@ namespace BP.WF.HttpHandler
dbUpload.FileFullName = dbUpload.MyPK;
}
#endregion 处理文件路径如果是保存到数据库就存储pk.
dbUpload.FileName = fileName;
dbUpload.FileSize = (float)info.Length;
dbUpload.RDT = DataType.CurrentDateTimess;
@ -4936,6 +4936,33 @@ namespace BP.WF.HttpHandler
return "{\"msg\":\"上传成功\"}";
}
/// <summary>
/// 转半角(DBC case)
/// </summary>
/// <param name="input">任意字符串</param>
/// <returns>半角字符串</returns>
public string ToDBC(string input)
{
char[] c = input.ToCharArray();
for (int i = 0; i < c.Length; i++)
{
if (c[i] == 12288)
{
c[i] = (char)32;
continue;
}
if (c[i] == 160)
{
c[i] = (char)32;
continue;
}
if (c[i] > 65280 && c[i] < 65375)
c[i] = (char)(c[i] - 65248);
}
string s = new string(c);
return s;
}
/// <summary>
/// 删除附件
/// </summary>
@ -5643,7 +5670,7 @@ namespace BP.WF.HttpHandler
FrmAttachmentDB downDB = new FrmAttachmentDB();
downDB.MyPK = this.MyPK;
downDB.Retrieve();
downDB.RetrieveFromDBSources();
FrmAttachment dbAtt = new FrmAttachment();
dbAtt.MyPK = downDB.FK_FrmAttachment;
dbAtt.Retrieve();
@ -5679,6 +5706,12 @@ namespace BP.WF.HttpHandler
else
{
filepath = downDB.FileFullName;
int splitStartIndex = filepath.IndexOf("DataUser/");
if(splitStartIndex > -1)
{
return "/" + filepath.Substring(splitStartIndex);
}
//return filepath;
}
#endregion
}
@ -5710,7 +5743,16 @@ namespace BP.WF.HttpHandler
}
BP.WF.HttpHandler.HttpHandlerGlo.DownloadFile(filepath, downDB.FileName);
return DataType.PraseStringToUrlFileName(filepath);
try
{
filepath = DataType.PraseStringToUrlFileName(filepath);
}
catch (Exception ex)
{
throw new Exception (ex.Message);
}
return filepath;
}

Loading…
Cancel
Save