Project

General

Profile

« Previous | Next » 

Revision 48791

- Add journal issn on csv export

View differences:

RequestDAO.java
240 240
		String requestQuery = this.getQuery(null, null, null, requestSortBy, order, requestFilter, term, statuses, args, types);
241 241
		String query = "select r.id as rid, r.status, r.date, u.firstname, u.lastname, o.name as organization," +
242 242
				" c.name as country, p.id as pid, p.acronym, p.startdate, p.enddate, p.scientificarea, " +
243
				"pub.title, pub.type, j.title as journal,(case when jp.id is not null then jp.name else mp.name end) as publisher, " +
243
				"pub.title, pub.type, j.title as journal,j.issn as issn,(case when jp.id is not null then jp.name else mp.name end) as publisher, " +
244 244
				" r.approvaldate as approvaldate, r.apc as apc,r.currency as currency,r.datepaid, r.apcpaid, r.transfercost, " +
245 245
				" r.othercost, comment.comment as comment from (" + requestQuery + ") r " +
246 246
				"left join \"user\" u on r.researcher = u.email " +
......
273 273

  
274 274
		for(Object rs[] : resultSet){
275 275

  
276
			String[] objs = new String[24];
276
			String[] objs = new String[25];
277 277
			objs[0] = rs[0].toString();
278 278
			objs[1] = String.valueOf(Request.RequestStatus.forStatus(Integer.parseInt(rs[1].toString())));
279 279
			objs[2] = rs[2]!=null?new SimpleDateFormat("yyyy/MM/dd").format(rs[2]):null;
......
291 291
			objs[13] = rs[13]!=null?rs[13].toString():null;
292 292
			objs[14] = rs[14]!=null?rs[14].toString():null;
293 293
			objs[15] = rs[15]!=null?rs[15].toString():null;
294
			objs[16] = rs[16]!=null?new SimpleDateFormat("yyyy/MM/dd").format(rs[16]):null;
295
			objs[17] = rs[20]!=null?Float.toString(Float.parseFloat(rs[17].toString())):null;
296
			objs[18] = rs[18]!=null?rs[18].toString():null;
297
			objs[19] = rs[19]!=null?new SimpleDateFormat("yyyy/MM/dd").format(rs[19]):null;
298
			objs[20] = rs[20]!=null?rs[20].toString() + "":null;
294
			objs[16] = rs[16]!=null?rs[16].toString():null;
295
			objs[17] = rs[17]!=null?new SimpleDateFormat("yyyy/MM/dd").format(rs[17]):null;
296
			objs[18] = rs[18]!=null?Float.toString(Float.parseFloat(rs[18].toString())):null;
297
			objs[19] = rs[19]!=null?rs[19].toString():null;
298
			objs[20] = rs[20]!=null?new SimpleDateFormat("yyyy/MM/dd").format(rs[20]):null;
299 299
			objs[21] = rs[21]!=null?rs[21].toString() + "":null;
300 300
			objs[22] = rs[22]!=null?rs[22].toString() + "":null;
301
			objs[23] = rs[23]!=null?rs[23].toString():null;
301
			objs[23] = rs[23]!=null?rs[23].toString() + "":null;
302
			objs[24] = rs[24]!=null?rs[24].toString():null;
302 303
			requests.add(objs);
303 304
		}
304 305

  
......
307 308

  
308 309
		csvWriter.writeNext(new String[]{"id", "Status", "Submission Date", "Firstname", "Lastname", "Organization",
309 310
				"Country", "Project id", "Acronym", "Start Date", "End Date", "Scientific Area", "Title", "Type",
310
				"Journal", "Publisher", "Date Approved", "APC requested", "Currency", "Date Paid", "APC paid",
311
				"Journal","Journal ISSN", "Publisher", "Date Approved", "APC requested", "Currency", "Date Paid", "APC paid",
311 312
				"Transfer Cost", "Other Expenses", "Rejection Reason"}, false);
312 313
		csvWriter.writeAll(requests, false);
313 314

  

Also available in: Unified diff