Commit cb08be0c authored by Matija Obreza's avatar Matija Obreza
Browse files

MCPD: Added Genesys CROPCODE to MCPD export

parent 82557b7c
......@@ -102,61 +102,106 @@ public class DownloadServiceImpl implements DownloadService {
private final String NEW_LINE = "\n";
private static final int COL_INSTCODE = 0;
private static final int COL_DOI = 1;
private static final int COL_ACCENUMB = 2;
private static final int COL_HISTORIC = 3;
// taxonomy
private static final int COL_GENUS = 4;
private static final int COL_SPECIES = 5;
private static final int COL_SPAUTHOR = 6;
private static final int COL_SUBTAXA = 7;
private static final int COL_SUBTAUTHOR = 8;
private static final int COL_GRIN_TAXON_ID = 9;
private static final int COL_GRIN_NAME = 10;
private static final int COL_GRIN_AUTHOR = 11;
private static final int COL_CROPNAME = 12;
private static final int COL_SAMPSTAT = 13;
//
private static final int COL_ACQDATE = 14;
private static final int COL_ACCENAME = 15;
// provenance
private static final int COL_ORIGCTY = 16;
private static final int COL_COLLSITE = 17;
private static final int COL_DECLATITUDE = 18;
private static final int COL_DECLONGITUDE = 19;
private static final int COL_COORDUNCERT = 20;
private static final int COL_COORDDATUM = 21;
private static final int COL_GEOREFMETH = 22;
private static final int COL_ELEVATION = 23;
// collecting
private static final int COL_COLLDATE = 24;
private static final int COL_COLLSRC = 25;
private static final int COL_COLLNUMB = 26;
private static final int COL_COLLCODE = 27;
private static final int COL_COLLNAME = 28;
private static final int COL_COLLINSTADDR = 29;
private static final int COL_COLLMISSID = 30;
// donor
private static final int COL_DONORCODE = 31;
private static final int COL_DONORNAME = 32;
private static final int COL_DONORNUMB = 33;
private static final int COL_OTHERNUMB = 34;
// breeder
private static final int COL_BREDCODE = 35;
private static final int COL_BREDNAME = 36;
private static final int COL_ANCEST = 37;
// dupl
private static final int COL_DUPLSITE = 38;
// private static final int COL_DUPLINSTNAME= 39;
// status
private static final int COL_STORAGE = 40;
private static final int COL_MLSSTAT = 41;
private static final int COL_ACCEURL = 42;
private static final int COL_REMARKS = 43;
private static final int COL_DATAPROVIDERID = 44;
private static final int COL_UUID = 45;
private static final int COL_LASTMODIFIED = 46;
private static final int COL_INSTCODE;
private static final int COL_DOI;
private static final int COL_ACCENUMB;
private static final int COL_HISTORIC;
private static final int COL_GENUS;
private static final int COL_SPECIES;
private static final int COL_SPAUTHOR;
private static final int COL_SUBTAXA;
private static final int COL_SUBTAUTHOR;
private static final int COL_GRIN_TAXON_ID;
private static final int COL_GRIN_NAME;
private static final int COL_GRIN_AUTHOR;
private static final int COL_CROPNAME;
private static final int COL_CROPCODE; // Genesys
private static final int COL_SAMPSTAT;
private static final int COL_ACQDATE;
private static final int COL_ACCENAME;
private static final int COL_ORIGCTY;
private static final int COL_COLLSITE;
private static final int COL_DECLATITUDE;
private static final int COL_DECLONGITUDE;
private static final int COL_COORDUNCERT;
private static final int COL_COORDDATUM;
private static final int COL_GEOREFMETH;
private static final int COL_ELEVATION;
private static final int COL_COLLDATE;
private static final int COL_COLLSRC;
private static final int COL_COLLNUMB;
private static final int COL_COLLCODE;
private static final int COL_COLLNAME;
private static final int COL_COLLINSTADDR;
private static final int COL_COLLMISSID;
private static final int COL_DONORCODE;
private static final int COL_DONORNAME;
private static final int COL_DONORNUMB;
private static final int COL_OTHERNUMB;
private static final int COL_BREDCODE;
private static final int COL_BREDNAME;
private static final int COL_ANCEST;
private static final int COL_DUPLSITE;
private static final int COL_DUPLINSTNAME; // Not populated
private static final int COL_STORAGE;
private static final int COL_MLSSTAT;
private static final int COL_ACCEURL;
private static final int COL_REMARKS;
private static final int COL_DATAPROVIDERID;
private static final int COL_UUID;
private static final int COL_LASTMODIFIED;
static {
int col = 0;
COL_INSTCODE = col++;
COL_DOI = col++;
COL_ACCENUMB = col++;
COL_HISTORIC = col++;
COL_GENUS = col++;
COL_SPECIES = col++;
COL_SPAUTHOR = col++;
COL_SUBTAXA = col++;
COL_SUBTAUTHOR = col++;
COL_GRIN_TAXON_ID = col++;
COL_GRIN_NAME = col++;
COL_GRIN_AUTHOR = col++;
COL_CROPNAME = col++;
COL_CROPCODE = col++;
COL_SAMPSTAT = col++;
COL_ACQDATE = col++;
COL_ACCENAME = col++;
COL_ORIGCTY = col++;
COL_COLLSITE = col++;
COL_DECLATITUDE = col++;
COL_DECLONGITUDE = col++;
COL_COORDUNCERT = col++;
COL_COORDDATUM = col++;
COL_GEOREFMETH = col++;
COL_ELEVATION = col++;
COL_COLLDATE = col++;
COL_COLLSRC = col++;
COL_COLLNUMB = col++;
COL_COLLCODE = col++;
COL_COLLNAME = col++;
COL_COLLINSTADDR = col++;
COL_COLLMISSID = col++;
COL_DONORCODE = col++;
COL_DONORNAME = col++;
COL_DONORNUMB = col++;
COL_OTHERNUMB = col++;
COL_BREDCODE = col++;
COL_BREDNAME = col++;
COL_ANCEST = col++;
COL_DUPLSITE = col++;
COL_DUPLINSTNAME= col++;
COL_STORAGE = col++;
COL_MLSSTAT = col++;
COL_ACCEURL = col++;
COL_REMARKS = col++;
COL_DATAPROVIDERID = col++;
COL_UUID = col++;
COL_LASTMODIFIED = col++;
}
@Autowired
private AccessionProcessor accessionProcessor;
......@@ -352,7 +397,9 @@ public class DownloadServiceImpl implements DownloadService {
row.createCell(COL_INSTCODE).setCellValue(accession.getInstitute().getCode());
row.createCell(COL_ACCENUMB).setCellValue(accession.getAccessionNumber());
AccessionCollect collect = accession.getAccessionId().getColl();
AccessionId accessionId = accession.getAccessionId();
AccessionCollect collect = accessionId.getColl();
if (collect != null) {
updateCell(row, COL_COLLNUMB, collect.getCollNumb());
updateCell(row, COL_COLLCODE, collect.getCollCode());
......@@ -363,8 +410,8 @@ public class DownloadServiceImpl implements DownloadService {
updateCell(row, COL_COLLDATE, collect.getCollDate());
}
updateCell(row, COL_BREDCODE, accession.getAccessionId().getBreederCode());
updateCell(row, COL_BREDNAME, accession.getAccessionId().getBreederName());
updateCell(row, COL_BREDCODE, accessionId.getBreederCode());
updateCell(row, COL_BREDNAME, accessionId.getBreederName());
updateCell(row, COL_ANCEST, accession.getAncest());
Taxonomy2 taxonomy = accession.getTaxonomy();
......@@ -384,6 +431,9 @@ public class DownloadServiceImpl implements DownloadService {
}
updateCell(row, COL_CROPNAME, accession.getCropName());
if (accession.getCrop() != null) {
updateCell(row, COL_CROPCODE, accession.getCrop().getShortName());
}
updateCell(row, COL_ACQDATE, accession.getAcquisitionDate());
Country origin = accession.getCountryOfOrigin();
......@@ -391,7 +441,7 @@ public class DownloadServiceImpl implements DownloadService {
updateCell(row, COL_ORIGCTY, origin.getCode3());
}
AccessionId aid = accession.getAccessionId();
AccessionId aid = accessionId;
if (aid != null) {
updateCell(row, COL_DECLATITUDE, aid.getLatitude());
updateCell(row, COL_DECLONGITUDE, aid.getLongitude());
......@@ -413,12 +463,12 @@ public class DownloadServiceImpl implements DownloadService {
}
}
updateCell(row, COL_DUPLSITE, accession.getAccessionId().getDuplSite());
updateCell(row, COL_DUPLSITE, accessionId.getDuplSite());
// updateCell(row, COL_DUPLSITENAME, accession.getAccessionId().getDuplSiteName()));
updateCell(row, COL_STORAGE, accession.getAccessionId().getStorage());
updateCell(row, COL_STORAGE, accessionId.getStorage());
updateCell(row, COL_MLSSTAT, accession.getMlsStatus());
List<AccessionAlias> names = accession.getAccessionId().getAliases();
List<AccessionAlias> names = accessionId.getAliases();
if (names != null && names.size() > 0) {
String acceName = null;
String otherNumb = null;
......@@ -457,7 +507,7 @@ public class DownloadServiceImpl implements DownloadService {
updateCell(row, COL_ACCEURL, accession.getAcceUrl());
}
List<AccessionRemark> remarks = accession.getAccessionId().getRemarks();
List<AccessionRemark> remarks = accessionId.getRemarks();
if (remarks != null && remarks.size() > 0) {
String r = "";
for (AccessionRemark remark : remarks) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment