合同管理修改
This commit is contained in:
@@ -659,12 +659,36 @@ namespace BLL
|
|||||||
string projectname = ProjectService.GetProjectNameByProjectId(getFireWork.ProjectId);
|
string projectname = ProjectService.GetProjectNameByProjectId(getFireWork.ProjectId);
|
||||||
string rootPath = Funs.RootPath;
|
string rootPath = Funs.RootPath;
|
||||||
|
|
||||||
string startPath = rootPath + "File\\Word\\PHTGL\\" + getFireWork.ContractNum + "-" + projectname + "-" + getFireWork.ContractName + "-合同管理资料";
|
// 清理路径中的非法字符
|
||||||
|
string CleanFileName(string input)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(input)) return "Unknown";
|
||||||
|
|
||||||
|
char[] invalidChars = Path.GetInvalidFileNameChars();
|
||||||
|
char[] invalidPathChars = Path.GetInvalidPathChars();
|
||||||
|
|
||||||
|
string result = input;
|
||||||
|
foreach (char c in invalidChars)
|
||||||
|
{
|
||||||
|
result = result.Replace(c.ToString(), "_");
|
||||||
|
}
|
||||||
|
foreach (char c in invalidPathChars)
|
||||||
|
{
|
||||||
|
result = result.Replace(c.ToString(), "_");
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
string cleanContractNum = CleanFileName(getFireWork.ContractNum);
|
||||||
|
string cleanProjectName = CleanFileName(projectname);
|
||||||
|
string cleanContractName = CleanFileName(getFireWork.ContractName);
|
||||||
|
|
||||||
|
string startPath = rootPath + "File\\Word\\PHTGL\\" + cleanContractNum + "-" + cleanProjectName + "-" + cleanContractName + "-合同管理资料";
|
||||||
if (!Directory.Exists(startPath))
|
if (!Directory.Exists(startPath))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(startPath);
|
Directory.CreateDirectory(startPath);
|
||||||
}
|
}
|
||||||
string zipPath = rootPath + "File\\Word\\PHTGL\\" + getFireWork.ContractNum + "-" + projectname + "-" + getFireWork.ContractName + "-合同管理资料.zip";
|
string zipPath = rootPath + "File\\Word\\PHTGL\\" + cleanContractNum + "-" + cleanProjectName + "-" + cleanContractName + "-合同管理资料.zip";
|
||||||
switch (getFireWork.ConfirmWay)
|
switch (getFireWork.ConfirmWay)
|
||||||
{
|
{
|
||||||
case "1":
|
case "1":
|
||||||
|
|||||||
Reference in New Issue
Block a user