SQL
This commit is contained in:
@@ -23,6 +23,7 @@ public class CropScienceAsset {
|
|||||||
String byr_campaignYearLabel; // TODO needs to be verified with Delaware
|
String byr_campaignYearLabel; // TODO needs to be verified with Delaware
|
||||||
String byr_campaignTitle;
|
String byr_campaignTitle;
|
||||||
String byr_cs_IsShouldBePublished;
|
String byr_cs_IsShouldBePublished;
|
||||||
|
String byr_cs_warehouseAvailable;
|
||||||
|
|
||||||
HashSet<String> indications = new HashSet<String>();
|
HashSet<String> indications = new HashSet<String>();
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ import com.univocity.parsers.csv.CsvWriterSettings;
|
|||||||
* ,u.FirstName
|
* ,u.FirstName
|
||||||
* ,u.LastName
|
* ,u.LastName
|
||||||
* ,u.CompanyName
|
* ,u.CompanyName
|
||||||
|
* ,ff.FulfillmentCompanyName
|
||||||
|
* ,ast.AssetStatusName -- unused?
|
||||||
|
* ,aty.AssetTypeName -- unused?
|
||||||
*
|
*
|
||||||
* FROM Assets a
|
* FROM Assets a
|
||||||
* LEFT JOIN AssetCategories c ON a.AssetCategoryID = c.AssetCategoryID
|
* LEFT JOIN AssetCategories c ON a.AssetCategoryID = c.AssetCategoryID
|
||||||
@@ -49,6 +52,9 @@ import com.univocity.parsers.csv.CsvWriterSettings;
|
|||||||
* LEFT JOIN AssetCampaignYears y ON a.AssetCampaignYearID = y.AssetCampaignYearID
|
* LEFT JOIN AssetCampaignYears y ON a.AssetCampaignYearID = y.AssetCampaignYearID
|
||||||
* LEFT JOIN Projects p ON a.ProjectID = p.ProjectID
|
* LEFT JOIN Projects p ON a.ProjectID = p.ProjectID
|
||||||
* LEFT JOIN Users u ON a.CreatedByUserID = u.UserID
|
* LEFT JOIN Users u ON a.CreatedByUserID = u.UserID
|
||||||
|
* LEFT JOIN FulfillmentCompanies ff ON a.FulfillmentCompanyID = ff.FulfillmentCompanyID
|
||||||
|
* LEFT JOIN AssetStatuses ast ON a.AssetStatusID = ast.AssetStatusID
|
||||||
|
* LEFT JOIN AssetTypes aty ON a.AssetTypeID = aty.AssetTypeID
|
||||||
*
|
*
|
||||||
* WHERE
|
* WHERE
|
||||||
* a.AssetStatusID != 101
|
* a.AssetStatusID != 101
|
||||||
@@ -1070,6 +1076,11 @@ public class ToolboxImportFileGenerator {
|
|||||||
|
|
||||||
asset.byr_cs_license_classification = "N/A";
|
asset.byr_cs_license_classification = "N/A";
|
||||||
|
|
||||||
|
if (line[25] != null && line[25].equals("HH Global"))
|
||||||
|
asset.byr_cs_warehouseAvailable = "Yes";
|
||||||
|
else
|
||||||
|
asset.byr_cs_warehouseAvailable = "No";
|
||||||
|
|
||||||
asset.byr_cs_description = "";
|
asset.byr_cs_description = "";
|
||||||
if (line[4] != null)
|
if (line[4] != null)
|
||||||
asset.byr_cs_description = line[4] + "\n\n";
|
asset.byr_cs_description = line[4] + "\n\n";
|
||||||
@@ -1086,7 +1097,7 @@ public class ToolboxImportFileGenerator {
|
|||||||
if (!line[20].equals("NULL"))
|
if (!line[20].equals("NULL"))
|
||||||
asset.byr_campaignTitle = line[20];
|
asset.byr_campaignTitle = line[20];
|
||||||
|
|
||||||
if (line[21].equals("0")) {
|
if (line[21].equals("0")) { // "Internal"
|
||||||
asset.byr_cs_IsShouldBePublished = "No";
|
asset.byr_cs_IsShouldBePublished = "No";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1152,7 +1163,7 @@ public class ToolboxImportFileGenerator {
|
|||||||
String[] csvLine = new String[] { asset.assetPath, asset.filename, asset.appendClassification, asset.byr_Title,
|
String[] csvLine = new String[] { asset.assetPath, asset.filename, asset.appendClassification, asset.byr_Title,
|
||||||
asset.byr_MarketingId, asset.byr_cs_assetApproval, asset.byr_cs_license_classification, asset.byr_cs_brand,
|
asset.byr_MarketingId, asset.byr_cs_assetApproval, asset.byr_cs_license_classification, asset.byr_cs_brand,
|
||||||
asset.byr_cs_businessUnit, asset.byr_cs_releaseDate, asset.byr_cs_retireDate, asset.byr_cs_description,
|
asset.byr_cs_businessUnit, asset.byr_cs_releaseDate, asset.byr_cs_retireDate, asset.byr_cs_description,
|
||||||
asset.byr_cs_keywords_tl, asset.byr_campaignYearLabel, asset.byr_campaignTitle, asset.byr_cs_IsShouldBePublished };
|
asset.byr_cs_keywords_tl, asset.byr_campaignYearLabel, asset.byr_campaignTitle, asset.byr_cs_IsShouldBePublished, asset.byr_cs_warehouseAvailable };
|
||||||
csvOutputList.add(csvLine);
|
csvOutputList.add(csvLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1163,7 +1174,8 @@ public class ToolboxImportFileGenerator {
|
|||||||
writer.writeHeaders("assetpath", "filename", "append classification", "fields|byr_title", "fields|byr_MarketingId",
|
writer.writeHeaders("assetpath", "filename", "append classification", "fields|byr_title", "fields|byr_MarketingId",
|
||||||
"fields|byr_cs_assetApproval", "fields|byr_cs_license_classification", "fields|byr_cs_brand", "fields|byr_cs_businessUnit",
|
"fields|byr_cs_assetApproval", "fields|byr_cs_license_classification", "fields|byr_cs_brand", "fields|byr_cs_businessUnit",
|
||||||
"fields|byr_cs_releaseDate", "fields|byr_cs_retireDate", "fields|byr_cs_Description", "fields|byr_cs_keywords_tl",
|
"fields|byr_cs_releaseDate", "fields|byr_cs_retireDate", "fields|byr_cs_Description", "fields|byr_cs_keywords_tl",
|
||||||
"fields|byr_campaignYearLabel", "fields|byr_campaignTitle", "field|byr_cs_IsShouldBePublished");
|
"fields|byr_campaignYearLabel", "fields|byr_campaignTitle", "fields|byr_cs_IsShouldBePublished",
|
||||||
|
"fields|byr_cs_warehouseAvailable");
|
||||||
writer.writeRowsAndClose(csvOutputList);
|
writer.writeRowsAndClose(csvOutputList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user