Add files via upload

This commit is contained in:
gopi17701 2018-07-25 16:25:22 -04:00 committed by GitHub
parent ff7e7bc768
commit 9fc4e405f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,8 +29,11 @@ public class POResource {
@QueryParam("ContractNum") String contractNum,
@QueryParam("PODate") String PODate, String astuteProjectNumber)
throws AstuteException, ParseException {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date date = new java.sql.Date(df.parse(PODate).getTime());
Date date = null;
if (PODate != null) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
date = new java.sql.Date(df.parse(PODate).getTime());
}
return new ApiResponse(POService.getPOMaster(PONum, contractNum, date, astuteProjectNumber)).toResponse();
}
@ -45,10 +48,12 @@ public class POResource {
@PUT
public Response updatePOMaster(@PathParam("PONum") String PONum, POMasterRequest request)
throws AstuteException, ParseException {
String dateStr = request.getPODate();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date date = new java.sql.Date(df.parse(dateStr).getTime());
Date date = null;
if (request.getPODate() != null) {
String dateStr = request.getPODate();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
date = new java.sql.Date(df.parse(dateStr).getTime());
}
POService.updatePOMaster(PONum, request.getContractNum(), date, request.getContractAmt(), request.getAstuteProjectNumber());
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
}
@ -81,5 +86,3 @@ public class POResource {
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
}
}