Add files via upload

This commit is contained in:
gopi17701 2018-08-22 17:31:50 -04:00 committed by GitHub
parent be901b0025
commit 17a6be72bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,12 +29,7 @@ public class POResource {
@QueryParam("ContractNum") String contractNum,
@QueryParam("PODate") String PODate, String astuteProjectNumber)
throws AstuteException, ParseException {
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();
return new ApiResponse(POService.getPOMaster(PONum, contractNum, PODate, astuteProjectNumber)).toResponse();
}
@Path("/detail")
@ -48,13 +43,9 @@ public class POResource {
@PUT
public Response updatePOMaster(@PathParam("PONum") String PONum, POMasterRequest request)
throws AstuteException, ParseException {
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(), request.getTitle());
System.out.println("PODate in Resource is "+ request.getPODate());
POService.updatePOMaster(PONum, request.getContractNum(), request.getPODate(), request.getContractAmt(), request.getAstuteProjectNumber(), request.getTitle());
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
}
@ -70,14 +61,8 @@ public class POResource {
@POST
public Response createPOMaster(POMasterRequest request)
throws AstuteException, ParseException {
String dateStr = request.getPODate();
Date date = null;
if (dateStr != null) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
date = new java.sql.Date(df.parse(dateStr).getTime());
}
POService.createPOMaster(request.getPoNum(), request.getContractNum(), date, request.getContractAmt(), request.getCustomerId(), request.getAstuteProjectNumber(),request.getTitle());
POService.createPOMaster(request.getPoNum(), request.getContractNum(), request.getPODate(), request.getContractAmt(), request.getCustomerId(), request.getAstuteProjectNumber(),request.getTitle());
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
}
@Path("/detail")