mirror of
https://github.com/dyiop/astute.git
synced 2025-04-05 21:10:16 -04:00
Add files via upload
This commit is contained in:
parent
0cf87cc13f
commit
1d55c5aa21
|
@ -8,6 +8,9 @@ import com.astute.service.InvoicePaymentService;
|
|||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.sql.Date;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
@Path("/invoicePayment")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
|
@ -28,15 +31,22 @@ public class InvoicePaymentResource {
|
|||
@Path("/{invoiceNum}/{invoicePaymentId}")
|
||||
@PUT
|
||||
public Response updateInvoicePayment(InvoicePaymentRequest request, @PathParam("invoiceNum") String invoiceNum, @PathParam("invoicePaymentId") int invoicePaymentId)
|
||||
throws AstuteException {
|
||||
service.updateInvoicePayment(invoiceNum,invoicePaymentId, request.getInvoiceAmount(), request.getPaymentDate());
|
||||
throws AstuteException, ParseException {
|
||||
|
||||
String dateStr = request.getPaymentDate();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = new java.sql.Date(df.parse(dateStr).getTime());
|
||||
service.updateInvoicePayment(invoiceNum,invoicePaymentId, request.getInvoiceAmount(), date);
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
|
||||
@POST
|
||||
public Response createInvoicePayment(InvoicePaymentRequest request)
|
||||
throws AstuteException {
|
||||
service.createInvoicePayment(request.getInvoiceNum(), request.getInvoicePaymentId(), request.getInvoiceAmount(),request.getPaymentDate());
|
||||
throws AstuteException, ParseException {
|
||||
String dateStr = request.getPaymentDate();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = new java.sql.Date(df.parse(dateStr).getTime());
|
||||
service.createInvoicePayment(request.getInvoiceNum(), request.getInvoicePaymentId(), request.getInvoiceAmount(),date);
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,10 @@ import com.astute.service.InvoiceService;
|
|||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.sql.Date;
|
||||
import java.sql.SQLException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
@Path("/invoice")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
|
@ -39,8 +42,12 @@ public class InvoiceResource {
|
|||
@Path("/{InvoiceNum}")
|
||||
@PUT
|
||||
public Response updateInvoiceMaster(@PathParam("InvoiceNum") String InvoiceNum, InvoiceMasterRequest request)
|
||||
throws AstuteException {
|
||||
service.updateInvoiceMaster(InvoiceNum, request.getInvoiceDate(), request.getPoNum(),
|
||||
throws AstuteException, ParseException {
|
||||
String dateStr = request.getInvoiceDate();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = new java.sql.Date(df.parse(dateStr).getTime());
|
||||
|
||||
service.updateInvoiceMaster(InvoiceNum, date, request.getPoNum(),
|
||||
request.getPmtStatus(), request.getBillAmt(), request.getSpecialNotes(), request.getCertification(), request.getInvoiceStatus());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
|
@ -55,8 +62,12 @@ public class InvoiceResource {
|
|||
}
|
||||
@POST
|
||||
public Response createInvoiceMaster(InvoiceMasterRequest request)
|
||||
throws AstuteException {
|
||||
service.createInvoiceMaster(request.getInvoiceNumber(), request.getInvoiceDate(), request.getPoNum(),
|
||||
throws AstuteException, ParseException {
|
||||
String dateStr = request.getInvoiceDate();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = new java.sql.Date(df.parse(dateStr).getTime());
|
||||
|
||||
service.createInvoiceMaster(request.getInvoiceNumber(), date, request.getPoNum(),
|
||||
request.getPmtStatus(), request.getBillAmt(), request.getSpecialNotes(), request.getCertification(), request.getInvoiceStatus());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ import javax.ws.rs.*;
|
|||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.sql.Date;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
@Path("/po")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
|
@ -25,9 +27,11 @@ public class POResource {
|
|||
public Response getPOMaster(
|
||||
@QueryParam("PONum") String PONum,
|
||||
@QueryParam("ContractNum") String contractNum,
|
||||
@QueryParam("PODate") Date PODate, String astuteProjectNumber)
|
||||
throws AstuteException {
|
||||
return new ApiResponse(POService.getPOMaster(PONum, contractNum, PODate, astuteProjectNumber)).toResponse();
|
||||
@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());
|
||||
return new ApiResponse(POService.getPOMaster(PONum, contractNum, date, astuteProjectNumber)).toResponse();
|
||||
}
|
||||
|
||||
@Path("/detail")
|
||||
|
@ -40,8 +44,12 @@ public class POResource {
|
|||
@Path("/{PONum}")
|
||||
@PUT
|
||||
public Response updatePOMaster(@PathParam("PONum") String PONum, POMasterRequest request)
|
||||
throws AstuteException {
|
||||
POService.updatePOMaster(PONum, request.getContractNum(), request.getPODate(), request.getContractAmt(), request.getAstuteProjectNumber());
|
||||
throws AstuteException, ParseException {
|
||||
String dateStr = request.getPODate();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date 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();
|
||||
}
|
||||
|
||||
|
@ -56,8 +64,12 @@ public class POResource {
|
|||
|
||||
@POST
|
||||
public Response createPOMaster(POMasterRequest request)
|
||||
throws AstuteException {
|
||||
POService.createPOMaster(request.getPoNum(), request.getContractNum(), request.getPODate(), request.getContractAmt(), request.getCustomerId(), request.getAstuteProjectNumber());
|
||||
throws AstuteException, ParseException {
|
||||
String dateStr = request.getPODate();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = new java.sql.Date(df.parse(dateStr).getTime());
|
||||
|
||||
POService.createPOMaster(request.getPoNum(), request.getContractNum(), date, request.getContractAmt(), request.getCustomerId(), request.getAstuteProjectNumber());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
@Path("/detail")
|
||||
|
|
Loading…
Reference in New Issue
Block a user