|
|
|
@ -394,19 +394,45 @@ namespace DS.WMS.PrintApi.Service
|
|
|
|
|
if (!string.IsNullOrEmpty(template.NamingRule))
|
|
|
|
|
{
|
|
|
|
|
fileName = template.NamingRule;
|
|
|
|
|
var id = sugarParams.Where(x=>x.ParameterName.ToLower()=="@id").FirstOrDefault().Value;
|
|
|
|
|
if (id != null) {
|
|
|
|
|
|
|
|
|
|
var info = tenantDb.Queryable<dynamic>().AS("op_sea_export").Where("id=@id", new { id = id }).First();
|
|
|
|
|
if (fileName.Contains("[委托编号]"))
|
|
|
|
|
{
|
|
|
|
|
fileName = fileName.Replace("[委托编号]", info.CustomerNo);
|
|
|
|
|
var id = sugarParams.Where(x => x.ParameterName.ToLower() == "@id").FirstOrDefault().Value;
|
|
|
|
|
if (template.ModuleCode == "sea_freight_f_export")//主单
|
|
|
|
|
{
|
|
|
|
|
if (id != null)
|
|
|
|
|
{
|
|
|
|
|
var info = tenantDb.Queryable<dynamic>().AS("op_sea_export").Where("id=@id", new { id = id }).First();
|
|
|
|
|
if (fileName.Contains("[委托编号]"))
|
|
|
|
|
{
|
|
|
|
|
fileName = fileName.Replace("[委托编号]", info.CustomerNo);
|
|
|
|
|
}
|
|
|
|
|
if (fileName.Contains("[提单号]"))
|
|
|
|
|
{
|
|
|
|
|
fileName = fileName.Replace("[提单号]", info.MBLNO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (fileName.Contains("[提单号]"))
|
|
|
|
|
}
|
|
|
|
|
else if (template.ModuleCode == "sea_freight_c_export") //分单
|
|
|
|
|
{
|
|
|
|
|
if (id != null)
|
|
|
|
|
{
|
|
|
|
|
fileName = fileName.Replace("[提单号]", info.MBLNO);
|
|
|
|
|
var info = tenantDb.Queryable<dynamic>().AS("op_sea_export_billmanage").Where("id=@id", new { id = id }).First();
|
|
|
|
|
if (fileName.Contains("[委托编号]"))
|
|
|
|
|
{
|
|
|
|
|
fileName = fileName.Replace("[委托编号]", info.CustomerNo);
|
|
|
|
|
}
|
|
|
|
|
if (fileName.Contains("[提单号]"))
|
|
|
|
|
{
|
|
|
|
|
fileName = fileName.Replace("[提单号]", info.MBLNO);
|
|
|
|
|
}
|
|
|
|
|
if (fileName.Contains("[分提单号]"))
|
|
|
|
|
{
|
|
|
|
|
fileName = fileName.Replace("[分提单号]", info.HBLNO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (string.IsNullOrEmpty(fileName))
|
|
|
|
|
fileName = DateTime.Now.Ticks + "-" + NumUtil.GetRandomString(3);
|
|
|
|
|