You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1068 lines
36 KiB

using NFine.Application.SRM;
using NFine.Code;
using NFine.Data.Extensions;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace NFine.Web.Areas.SRM.Controllers
{
public class CertifiCationController : ControllerBase
{
CertifiCationApp App = new CertifiCationApp();
//
// GET: /SRM/CertifiCationMaintion/
public ActionResult CertifiCationMaintion()
{
return View();
}
public ActionResult TemporaryVendorSubmit()
{
return View();
}
public ActionResult CertifiCationAdd()
{
return View();
}
public ActionResult CeriIFicateItemMaintion()
{
return View();
}
public ActionResult CeriIFicateItemAdd()
{
return View();
}
public ActionResult CertificateTYPEMaintion()
{
return View();
}
public ActionResult CertificateTypeAdd()
{
return View();
}
public ActionResult CeriIFicateItemDetail()
{
return View();
}
public ActionResult CeriIFicateItemDetailSearch()
{
return View();
}
public ActionResult CertificateItemDetail()
{
return View();
}
public ActionResult CertificateItemDetailAdd()
{
return View();
}
public ActionResult CeriIFicateItemDetailSearchZL()
{
return View();
}
public ActionResult TemporaryVendor()
{
return View();
}
public ActionResult TemporaryVendorAdd()
{
return View();
}
public ActionResult TemporaryVendorByYL()
{
return View();
}
//派那审核查询列表
public ActionResult TemporaryVendorByPN()
{
return View();
}
//派那审核界面(采购)
public ActionResult TemporaryVendorAddByPN()
{
return View();
}
//派那审核界面(采购经理)
public ActionResult TemporaryVendorAddByPNJL()
{
return View();
}
public ActionResult CertifiCationMaintionRel()
{
return View();
}
public ActionResult CertifiCationMaintionRelAdd()
{
return View();
}
public ActionResult TempMessage()
{
return View();
}
/// <summary>
/// 获取资质认证项目
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJson(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJson(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
/// <summary>
/// 获取资质认证项目
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonICSCERTIFICATE2(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonICSCERTIFICATE2(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
/// <summary>
/// 获取资质认证项目
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetICSCertifiiCateItemDetail(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetICSCertifiiCateItemDetail(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetCertifiCateTpye(string CERTIFICATETPYECODE, string WorkPoint)
{
try
{
DataRow dr = App.GetCertifiCateTpye(CERTIFICATETPYECODE, WorkPoint);
var JsonData = new
{
//CERTIFICATEITEMNAME = dr["CERTIFICATEITEMNAME"].ToString(),
CERTIFICATEITEMCODE= dr["CERTIFICATEITEMCODE"].ToString(),
CERTIFICATEITEMNAME= dr["CERTIFICATEITEMNAME"].ToString(),
//CERTIFICATEITEMCODE = dr["CERTIFICATEITEMCODE"].ToString(),
ISKEYTASK = dr["ISKEYTASK"].ToString(),
NEEDUPLOADFILE = dr["NEEDUPLOADFILE"].ToString(),
PLANFINISHDAYS = dr["PLANFINISHDAYS"].ToString(),
WorkPoint = dr["WorkPoint"].ToString()
};
return Content(JsonData.ToJson());
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
[HttpGet]
//[HandlerAjaxOnly]
public ActionResult GetCertiFicateTypeName(string WorkPoint)
{
DataTable dt = App.GetCertiFicateTypeName(WorkPoint);
return Content(dt.ToJson());
}
[HttpGet]
//[HandlerAjaxOnly]
public ActionResult GetCertiFicateTypeNameRZ(string queryJson, string WorkPoint)
{
DataTable dt = App.GetCertiFicateTypeNameRZ(queryJson, WorkPoint);
return Content(dt.ToJson());
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormCFType(string keyValue,string ID)
{
try
{
App.SubmitFormCFType(keyValue,ID);
return Success("保存成功!");
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
/// <summary>
/// 删除认证项目
/// </summary>
/// <param name="keyValue"></param>
/// <returns></returns>
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DeleteCertiFicateite(string keyValue)
{
try
{
App.DeleteCertiFicateite(keyValue);
return Success("删除成功!");
}
catch (Exception ex)
{
return Error("删除失败"+ex.Message);
}
}
/// <summary>
/// 删除认证项目
/// </summary>
/// <param name="keyValue"></param>
/// <returns></returns>
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DeleteCertifiCationMaintionRelAdd(string keyValue, string CERTIFICATETPYECODE)
{
string msg = App.DeleteCertifiCationMaintionRelAdd(keyValue, CERTIFICATETPYECODE);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("删除成功!");
}
else
{
return Error("删除失败");
}
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetICSCertifiiCateItem(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetICSCertifiiCateItem(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetCeriIFicateItem(string ID)
{
try
{
DataRow dr = App.GetCeriIFicateItem(ID);
var JsonData = new
{
CERTIFICATETPYECODE = dr["CERTIFICATETPYECODE"].ToString(),
VENDORCODE = dr["VENDORCODE"].ToString(),
//WorkPoint = dr["WorkPoint"].ToString()
};
return Content(JsonData.ToJson());
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitCeriIFicate(string keyValue, string keyValue2, string WorkPoint)
{
try
{
App.SubmitCeriIFicate(keyValue, keyValue2, WorkPoint);
return Success("保存成功!");
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
/// <summary>
/// 获取资质认证项目
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetCertificateTypeMaintion(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetCertificateTypeMaintion(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
/// <summary>
/// 修改获取认证类型
/// </summary>
/// <param name="CERTIFICATETPYECODE"></param>
/// <param name="WorkPoint"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetCertificateTypeAdd(string CERTIFICATETPYECODE,string WorkPoint)
{
DataRow ListData = App.GetCertificateTypeAdd(CERTIFICATETPYECODE, WorkPoint);
var JsonData = new
{
CERTIFICATETYPENAME = ListData["CERTIFICATETYPENAME"].ToString(),
CERTIFICATETPYECODE = ListData["CERTIFICATETPYECODE"].ToString(),
};
return Content(JsonData.ToJson());
}
/// <summary>
/// 新增认证类型
/// </summary>
/// <param name="keyValue"></param>
/// <returns></returns>
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitCertificateType(string keyValue, string ID)
{
try
{
App.SubmitCertificateType(keyValue,ID);
return Success("保存成功!");
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
/// <summary>
/// 删除认证项目
/// </summary>
/// <param name="keyValue"></param>
/// <returns></returns>
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DeleteCertificateType(string keyValue)
{
string msg = App.DeleteCertificateType(keyValue);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("删除成功!");
}
else
{
return Error("删除失败");
}
}
/// <summary>
/// 删除关联类型
/// </summary>
/// <param name="keyValue"></param>
/// <returns></returns>
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DeleteCertiFicateiteRZ(string keyValue, string VENDORCODE)
{
string msg = App.DeleteCertiFicateiteRZ(keyValue, VENDORCODE);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("删除成功!");
}
else
{
return Error("删除失败");
}
}
/// <summary>
/// 获取资质认证项目
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetICSCertifiiCateItemDetailCK(Pagination pagination, string CERTIFICATETPYECODE, string VENDORCODE, string WorkPoint)
{
DataTable ListData = App.GetICSCertifiiCateItemDetailCK(CERTIFICATETPYECODE, VENDORCODE, ref pagination, WorkPoint);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
/// <summary>
/// 认证资料维护上传文件
/// </summary>
/// <param name="ID"></param>
/// <returns></returns>
[HttpPost]
public ActionResult UpLoadFileImport( string ID)
{
string FileName = "";
string PathName = "";
string UserName = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName;
//获取上传的文件集合
HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
for (int i = 0; i < httpFile.Count; i++)
{
//获取送货单号
//string STNO = Request.Form["STNO"].ToString();
string fileName = Path.GetFileNameWithoutExtension(httpFile[i].FileName)
+ Path.GetExtension(httpFile[i].FileName);
string Paths = System.Web.HttpContext.Current.Server.MapPath("~\\File\\VendorFile\\" + UserName);
if (!Directory.Exists(Paths))
{
Directory.CreateDirectory(Paths);
}
string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\VendorFile\\" + UserName +"\\"+ fileName);
int iLen = httpFile[0].ContentLength;
byte[] bData = new byte[iLen];
httpFile[0].InputStream.Read(bData, 0, iLen);
FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
fs.Write(bData, 0, bData.Length);
fs.Flush();
fs.Close();
fs.Dispose();
FileName += "" + fileName + ";";
PathName += "" + filePath + ";";
}
int count = App.UpLoadFile(FileName, PathName, ID);
if (count > 0)
{
return Success("上传成功!");
}
else
{
return Error("上传失败");
}
}
[HttpPost]
public ActionResult UpLoadFileImportXM( string ID,string WorkPoint)
{
string FileName = "";
string PathName = "";
string UserName = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName;
//获取上传的文件集合
HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
for (int i = 0; i < httpFile.Count; i++)
{
//获取送货单号
//string STNO = Request.Form["STNO"].ToString();
string fileName = Path.GetFileNameWithoutExtension(httpFile[i].FileName)
+ Path.GetExtension(httpFile[i].FileName);
string Paths = System.Web.HttpContext.Current.Server.MapPath("~\\File\\VendorFile\\" + WorkPoint);
if (!Directory.Exists(Paths))
{
Directory.CreateDirectory(Paths);
}
string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\VendorFile\\" + WorkPoint+"\\"+fileName);
int iLen = httpFile[0].ContentLength;
byte[] bData = new byte[iLen];
httpFile[0].InputStream.Read(bData, 0, iLen);
FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
fs.Write(bData, 0, bData.Length);
fs.Flush();
fs.Close();
fs.Dispose();
FileName += "" + fileName + ";";
PathName += "" + filePath + ";";
}
int count = 0;
if (ID != "")
{
count=App.UpLoadFile(FileName, PathName, ID);
}
if (count > 0)
{
return Success("上传成功!");
}
else
{
return Error("上传失败");
}
}
/// <summary>
/// 供应商维护保存
/// </summary>
/// <param name="keyValue"></param>
/// <param name="ID"></param>
/// <returns></returns>
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitCertificateItemDetail(string keyValue, string ItemID,string ID)
{
try
{
App.SubmitCertificateItemDetail(keyValue, ItemID,ID);
return Success("保存成功!");
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetICSCertifiiCateItemDetailSearch(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetICSCertifiiCateItemDetailSearch(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetCertifiCateTpyeDetail(string ItemID)
{
try
{
DataRow dr = App.GetCertifiCateTpyeDetail(ItemID);
var JsonData = new
{
CERTIFICATIONINSTITUTIONS = dr["CERTIFICATIONINSTITUTIONS"].ToString(),
BEGINDATE = dr["BEGINDATE"].ToString(),
ENDDATE = dr["ENDDATE"].ToString(),
CERTIFICATENO = dr["CERTIFICATENO"].ToString(),
CERTIFICATETYPENAME = dr["CERTIFICATETYPENAME"].ToString(),
CERTIFICATETYPENFileName = dr["CERTIFICATETYPENFileName"].ToString(),
};
return Content(JsonData.ToJson());
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
/// <summary>
/// 获取准入审核列表
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetVendorTemp(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetVendorTemp(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
/// <summary>
/// 获取准入审核列表(佑伦)
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetVendorTempByYL(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetVendorTempByYL(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetICSCertifiiCateItemDetailSearchZL(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetICSCertifiiCateItemDetailSearchZL(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
/// <summary>
/// 获取所属分类
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetCVCCode()
{
DataTable dt = App.GetCVCCode();
return Content(dt.ToJson());
}
/// <summary>
/// 获取结算方式
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetVenSSCode()
{
DataTable dt = App.GetVenSSCode();
return Content(dt.ToJson());
}
/// <summary>
/// 获取币种
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetcVenExch_name()
{
DataTable dt = App.GetcVenExch_name();
return Content(dt.ToJson());
}
/// <summary>
/// 获取银行
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetVenBankCode()
{
DataTable dt = App.GetVenBankCode();
return Content(dt.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetCertifiCateVendor(string cVenCode)
{
try
{
DataRow dr = App.GetCertifiCateVendor(cVenCode);
var JsonData = new
{
cVenType = dr["cVenType"].ToString(),
cVenStartTime = dr["cVenStartTime"].ToString(),
cVenStartEnd = dr["cVenStartEnd"].ToString(),
cVenCode = dr["cVenCode"].ToString(),
iTaxRateNum = dr["iTaxRateNum"].ToString(),
cVenName = dr["cVenName"].ToString(),
cVenAbbName = dr["cVenAbbName"].ToString(),
cVenHeadCode = dr["cVenHeadCode"].ToString(),
cVCCode = dr["cVCCode"].ToString(),
cVenSource = dr["cVenSource"].ToString(),
cVenPerson = dr["cVenPerson"].ToString(),
cVenPerson2 = dr["cVenPerson2"].ToString(),
cVenAddress = dr["cVenAddress"].ToString(),
cVenPhone = dr["cVenPhone"].ToString(),
cVenPostCode = dr["cVenPostCode"].ToString(),
cVenHand = dr["cVenHand"].ToString(),
cVenSSCode = dr["cVenSSCode"].ToString(),
cVenEmail = dr["cVenEmail"].ToString(),
cVenBankCode = dr["cVenBankCode"].ToString(),
cVenBank = dr["cVenBank"].ToString(),
cVenAccount = dr["cVenAccount"].ToString(),
iVenTaxRate = dr["iVenTaxRate"].ToString(),
cVenExch_name = dr["cVenExch_name"].ToString(),
bVenCargo = dr["bVenCargo"].ToString(),
bProxyForeign = dr["bProxyForeign"].ToString(),
bVenService = dr["bVenService"].ToString(),
bVenOverseas = dr["bVenOverseas"].ToString()
};
return Content(JsonData.ToJson());
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitVendor(string keyValue)
{
try
{
App.SubmitVendor(keyValue);
return Success("保存成功!");
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
// [HttpPost]
//[HandlerAjaxOnly]
//[ValidateAntiForgeryToken]
public ActionResult SubmitVendorRegister(string keyValue)
{
try
{
string MSD= App.SubmitVendorRegister(keyValue);
var JsonData = new
{
MSD = MSD,
ISok=true,
};
return Content(JsonData.ToJson());
}
catch (Exception ex)
{
var MSGs = ex.Message;
var JsonData = new
{
MSGs = MSGs,
ISok = false,
};
return Content(JsonData.ToJson());
// return Error(ex.Message);
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitCeriIFicateRel(string keyValue, string keyValue2)
{
try
{
App.SubmitCeriIFicateRel(keyValue, keyValue2);
return Success("保存成功!");
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
[HttpGet]
//[HandlerAjaxOnly]
public ActionResult GetCertifiCationMaintionRel(string queryJson, string WorkPoint)
{
DataTable dt = App.GetCertifiCationMaintionRel(queryJson, WorkPoint);
return Content(dt.ToJson());
}
[HttpGet]
//[HandlerAjaxOnly]
public ActionResult GetCertifiCationMaintionRelXM(string queryJson, string WorkPoint)
{
DataTable dt = App.GetCertifiCationMaintionRelXM(queryJson, WorkPoint);
return Content(dt.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetVendor(string queryJson, string WorkPoint)
{
DataTable dt = App.GetVendor(queryJson, WorkPoint);
return Content(dt.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSTNO(string WorkPoint)
{
string CERTIFICATETPYECODE = App.GetSTNO(WorkPoint);
var JsonData = new
{
CERTIFICATETPYECODE = CERTIFICATETPYECODE,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetProjectCode(string WorkPoint)
{
string CERTIFICATEITEMCODE = App.GetProjectCode(WorkPoint);
var JsonData = new
{
CERTIFICATEITEMCODE = CERTIFICATEITEMCODE,
};
return Content(JsonData.ToJson());
}
[HttpPost]
/// <summary>
/// 文件上传到本地
/// </summary>
public ActionResult UploadFile()
{
string mess = "";
try
{
HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
if (hpFiles != null && hpFiles.Count > 0)
{
string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
if (IsXls != ".xls" && IsXls != ".xlsx")
{
mess = "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
}
string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\CertifiCationFile\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
int iLen = hpFiles[0].ContentLength;
if (Directory.Exists(savePath)) mess = "文件已存在";
byte[] bData = new byte[iLen];
hpFiles[0].InputStream.Read(bData, 0, iLen);
FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
newFile.Write(bData, 0, bData.Length);
newFile.Flush();
int _FileSizeTemp = hpFiles[0].ContentLength;
newFile.Close();
newFile.Dispose();
//bool del = false;
mess = App.SetData_PR(savePath);
if (System.IO.File.Exists(savePath))//删除文件
{
System.IO.File.Delete(savePath);
}
}
}
catch (Exception ex)
{
return Error(ex.Message);
}
var JsonData = new
{
mass = mess,
};
return Content(JsonData.ToJson());
}
/// <summary>
/// 调用OA接口
/// </summary>
/// <param name="TEMPVENDORCODE">公司名称</param>
/// <returns></returns>
[HttpPost]
public ActionResult PreSubmitOARejict(string TEMPVENDORCODE, string WorkPoint,string Vendor)
{
try
{
string msg = App.PreSubmitOARejict(TEMPVENDORCODE, WorkPoint, Vendor);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("OA推送成功");
}
else
{
return Error("推送失败,失败原因:" + msg);
}
}
catch (Exception ex)
{
return Error("推送失败" + ex.Message);
}
}
/// <summary>
/// 撤销OA流程
/// </summary>
/// <param name="json"></param>
/// <returns></returns>
[HttpPost]
[HandlerAjaxOnly]
public ActionResult CleanPreSubmitOARejict(string ADDITION3, string WorkPoint, string ADDITION4, string TEMPVENDORCODE)
{
try
{
string msg = App.CleanPreSubmitOARejict(ADDITION3, WorkPoint, ADDITION4, TEMPVENDORCODE);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("OA撤销成功!");
}
else
{
return Error("OA撤销失败!");
}
}
catch (Exception ex)
{
return Error("撤销失败!失败原因:" + ex.Message);
}
}
/// <summary>
/// 上传完文件(准入审核采购人员上传文件)
/// </summary>
/// <param name="BidCode"></param>
/// <param name="ID"></param>
/// <returns></returns>
[HttpPost]
public ActionResult UpLoadFileImportBYPRVendor(string TEMPVENDORCODELS, string WorkPoint)
{
string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
string FileName = "";
string PathName = "";
//获取上传的文件集合
try
{
HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
for (int i = 0; i < httpFile.Count; i++)
{
//获取送货单号
//string STNO = Request.Form["STNO"].ToString();
string fileName = Path.GetFileNameWithoutExtension(httpFile[i].FileName)+ Path.GetExtension(httpFile[i].FileName);
string Paths = System.Web.HttpContext.Current.Server.MapPath("~\\File\\VendorFile\\" + TEMPVENDORCODELS + "\\");
if (!Directory.Exists(Paths))
{
Directory.CreateDirectory(Paths);
}
string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\VendorFile\\" + TEMPVENDORCODELS + "\\" + fileName);
int iLen = httpFile[0].ContentLength;
byte[] bData = new byte[iLen];
httpFile[0].InputStream.Read(bData, 0, iLen);
FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
fs.Write(bData, 0, bData.Length);
fs.Flush();
fs.Close();
fs.Dispose();
FileName += "" + fileName + ";";
PathName += "" + filePath + ";";
}
App.UpLoadFileBYVendor(TEMPVENDORCODELS, WorkPoint, FileName);
return Success("上传成功!");
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetVCCode()
{
DataTable dt = App.GetVCCode();
return Content(dt.ToJson());
}
/// <summary>
/// 邮件发送
/// </summary>
/// <param name="TEMPVENDORCODE">公司名称</param>
/// <returns></returns>
[HttpPost]
public ActionResult PreSendMail(string TEMPVENDORCODE, string WorkPoint, string Vendor)
{
try
{
string msg = App.PreSendMail(TEMPVENDORCODE, WorkPoint, Vendor);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("邮件发送成功");
}
else
{
return Error("邮件发送失败,失败原因:" + msg);
}
}
catch (Exception ex)
{
return Error("邮件发送失败" + ex.Message);
}
}
[HttpPost]
public void ExportAll(string WorkPoint, string VenCode, string VenName, string CERTIFICATETPYECODE, string CERTIFICATETYPENAME, string CERTIFICATEITEMCODE, string CERTIFICATEITEMNAME, string status)
{
DataTable dt = App.ExportAll( WorkPoint, VenCode, VenName, CERTIFICATETPYECODE, CERTIFICATETYPENAME, CERTIFICATEITEMCODE, CERTIFICATEITEMNAME, status);
AsposeCell.Export(dt);
}
}
}