打你一下

net防伪码导出

S_CodeListFilterModel model = new S_CodeListFilterModel();
model.batchCode = Request.Form["batchparam"];

var cookieValueArray = CookieManager.GetKey(Request, "whmp_web").Split('_');
var gid = int.Parse(cookieValueArray[0]);

string str = string.Format(@" select a.ExpressCode as '物流码',SecurityCode as '防伪码','{2}'+SecurityCode as '小溯源码','{3}'+BoxCodes as '箱物流码',
'{4}'+BoxCodes AS '箱溯源码' from whmp_web_securityCode_PackingDetails a join (select * from whmp_web_securitycode where gid={0} and batchcode='{1}') as b on a.ExpressCode=b.ExpressCode where b.gid={0} and b.batchcode='{1}' order by a.ExpressCode", gid, model.batchCode, "http://" + Request.Url.Host + "/Platform/ScanCode?f=", "xx=", "http://" + "" + Request.Url.Host + "/Platform/Scancode?XX=");

DataTable dt = SystemDBInfo.WHDBSqlInstance.GetDataTableBySQL(str);
DateTime time = DateTime.Now;
ExportToExcelHelper.ResponseExcel("防伪码按批次(" + time.Year + "-" + time.Month + "-" + time.Day + ").xlsx", dt);

posted on 2020-06-13 16:57  打你一下  阅读(254)  评论(0编辑  收藏  举报

导航