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
94cdace84d
commit
06a58cd59c
|
@ -1,13 +1,16 @@
|
|||
package com.astute.resources;
|
||||
|
||||
import com.astute.exceptions.AstuteException;
|
||||
import com.astute.requests.LoginRequest;
|
||||
import com.astute.response.ApiResponse;
|
||||
import com.astute.service.AuthService;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@Path("auth")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
@ -21,7 +24,7 @@ public class AuthResource {
|
|||
}
|
||||
|
||||
@POST
|
||||
public Response login(LoginRequest request) throws SQLException, Exception {
|
||||
public Response login(LoginRequest request) throws AstuteException {
|
||||
String sessionId = service.login(request.getUsername(), request.getPassword());
|
||||
if (sessionId != null) {
|
||||
return new ApiResponse(sessionId).toResponse();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.astute.resources;
|
||||
|
||||
import com.astute.exceptions.AstuteException;
|
||||
import com.astute.requests.ChangeOrderRequest;
|
||||
import com.astute.response.ApiResponse;
|
||||
import com.astute.service.ChangeOrderService;
|
||||
|
@ -21,21 +22,21 @@ public class ChangeOrderResource {
|
|||
|
||||
@GET
|
||||
public Response getChangeOrders(@QueryParam("poNum") String poNum)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
return new ApiResponse(service.getChangeOrders(poNum)).toResponse();
|
||||
}
|
||||
|
||||
@Path("/{PONum}/{changeOrderNum}")
|
||||
@PUT
|
||||
public Response updateChangeOrder(ChangeOrderRequest request, @PathParam("PONum") String PONum, @PathParam("changeOrderNum") int changeOrderNum)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
service.updateChangeOrder(PONum,changeOrderNum, request.getChangeOrderAmt(), request.getChangeOrderDate(), request.getDescription());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
|
||||
@POST
|
||||
public Response createChangeOrder(ChangeOrderRequest request)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
return new ApiResponse(service.createChangeOrder(request.getPoNum(), request.getChangeOrderNum(), request.getChangeOrderAmt(),
|
||||
request.getChangeOrderDate(), request.getDescription())).toResponse();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.astute.resources;
|
||||
|
||||
import com.astute.exceptions.AstuteException;
|
||||
import com.astute.requests.CustomerRequest;
|
||||
import com.astute.response.ApiResponse;
|
||||
import com.astute.service.CustomerService;
|
||||
|
@ -21,14 +22,14 @@ public class CustomerResource {
|
|||
|
||||
@GET
|
||||
public Response getCustomers(@QueryParam("customerId") int customerId)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
return new ApiResponse(service.getCustomers(customerId)).toResponse();
|
||||
}
|
||||
|
||||
@Path("/{customerId}")
|
||||
@PUT
|
||||
public Response updateCustomer(@PathParam("customerId") int customerId, CustomerRequest request)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
System.out.println("in updateCustomer()");
|
||||
service.updateCustomer(customerId, request.getCustomerName(), request.getBillToDept(), request.getAdd1(),
|
||||
request.getAdd2(), request.getCity(), request.getState(), request.getZip(), request.getZiplast4(), request.getEmail(), request.getPhone(), request.getFax());
|
||||
|
@ -37,7 +38,7 @@ public class CustomerResource {
|
|||
|
||||
@POST
|
||||
public Response createCustomer(CustomerRequest request)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
System.out.println("in AstuteSyste createCustomer()");
|
||||
return new ApiResponse(service.createCustomer(request.getCustomerName(), request.getBillToDept(), request.getAdd1(),
|
||||
request.getAdd2(), request.getCity(), request.getState(), request.getZip(), request.getZiplast4(), request.getEmail(), request.getPhone(), request.getFax())).toResponse();
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
package com.astute.resources;
|
||||
|
||||
import com.astute.requests.ChangeOrderRequest;
|
||||
import com.astute.exceptions.AstuteException;
|
||||
import com.astute.requests.InvoicePaymentRequest;
|
||||
import com.astute.response.ApiResponse;
|
||||
import com.astute.service.ChangeOrderService;
|
||||
import com.astute.service.InvoicePaymentService;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@Path("/invoicePayment")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public class InvoicePaymentResource {
|
||||
|
||||
// private com.astute.service.InvoicePaymentService service = new InvoicePaymentService();
|
||||
private com.astute.service.InvoicePaymentService service = new InvoicePaymentService();
|
||||
|
||||
public InvoicePaymentResource() {
|
||||
}
|
||||
|
||||
// @GET
|
||||
// public Response getInvoicePayments(@QueryParam("invoiceNum") String invoiceNum)
|
||||
// throws SQLException, Exception {
|
||||
// return new ApiResponse(service.getInvoicePayments(invoiceNum)).toResponse();
|
||||
// }
|
||||
//
|
||||
// @Path("/{invoiceNum}/{changeOrderNum}")int invoicePaymentId, Double paymentAmount, Date paymentDate
|
||||
// @PUT
|
||||
// public Response updateInvoicePayment(InvoicePaymentRequest request, @PathParam("invoiceNum") String invoiceNum, @PathParam("invoicePaymentId") int invoicePaymentId)
|
||||
// throws SQLException, Exception {
|
||||
// service.updateChangeOrder(PONum,changeOrderNum, request.getChangeOrderAmt(), request.getChangeOrderDate(), request.getDescription());
|
||||
// return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
// }
|
||||
@GET
|
||||
public Response getInvoicePayments(@QueryParam("invoiceNum") String invoiceNum)
|
||||
throws AstuteException {
|
||||
return new ApiResponse(service.getInvoicePayments(invoiceNum)).toResponse();
|
||||
}
|
||||
|
||||
// @POST
|
||||
// public Response createChangeOrder(ChangeOrderRequest request)
|
||||
// throws SQLException, Exception {
|
||||
// return new ApiResponse(service.createChangeOrder(request.getPoNum(), request.getChangeOrderNum(), request.getChangeOrderAmt(),
|
||||
// request.getChangeOrderDate(), request.getDescription())).toResponse();
|
||||
// }
|
||||
@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());
|
||||
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());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package com.astute.resources;
|
||||
|
||||
import com.astute.exceptions.*;
|
||||
import com.astute.requests.*;
|
||||
import com.astute.exceptions.AstuteException;
|
||||
import com.astute.exceptions.DatabaseException;
|
||||
import com.astute.requests.InvoiceDetailRequest;
|
||||
import com.astute.requests.InvoiceMasterRequest;
|
||||
import com.astute.response.ApiResponse;
|
||||
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;
|
||||
|
||||
@Path("/invoice")
|
||||
|
@ -23,14 +24,14 @@ public class InvoiceResource {
|
|||
|
||||
@GET
|
||||
public Response getInvoiceMaster(@QueryParam("invoiceNumber") String invoiceNumber, @QueryParam("pmtStatus") int pmtStatus)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
return new ApiResponse(service.getInvoiceMaster(invoiceNumber, pmtStatus)).toResponse();
|
||||
}
|
||||
|
||||
@Path("/detail")
|
||||
@GET
|
||||
public Response getInvoiceDetail(@QueryParam("invoiceNumber") String invoiceNumber, @QueryParam("lineItemNo") int lineItemNo)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
|
||||
return new ApiResponse(service.getInvoiceDetail(invoiceNumber,lineItemNo)).toResponse();
|
||||
}
|
||||
|
@ -38,7 +39,7 @@ public class InvoiceResource {
|
|||
@Path("/{InvoiceNum}")
|
||||
@PUT
|
||||
public Response updateInvoiceMaster(@PathParam("InvoiceNum") String InvoiceNum, InvoiceMasterRequest request)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
service.updateInvoiceMaster(InvoiceNum, request.getInvoiceDate(), request.getPoNum(), request.getChangeOrderNum(),
|
||||
request.getPmtStatus(), request.getBillAmt(), request.getSpecialNotes(), request.getCertification());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
|
@ -47,14 +48,14 @@ public class InvoiceResource {
|
|||
@Path("/detail/{InvoiceNum}/{lineItemNum}")
|
||||
@PUT
|
||||
public Response updateInvoiceDetail(@PathParam("InvoiceNum") String InvoiceNum, @PathParam("lineItemNum") int lineItemNum, InvoiceDetailRequest request)
|
||||
throws DatabaseException, Exception {
|
||||
throws AstuteException {
|
||||
service.updateInvoiceDetail(InvoiceNum, lineItemNum, request.getPoLineItemNum(), request.getServiceTypeId(),
|
||||
request.getDesc(), request.getPercentCompletion(), request.getHours(), request.getAnount());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
@POST
|
||||
public Response createInvoiceMaster(InvoiceMasterRequest request)
|
||||
throws DatabaseException, Exception {
|
||||
throws AstuteException {
|
||||
service.createInvoiceMaster(request.getInvoiceNumber(), request.getInvoiceDate(), request.getPoNum(), request.getChangeOrderNum(),
|
||||
request.getPmtStatus(), request.getBillAmt(), request.getSpecialNotes(), request.getCertification());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
|
@ -62,7 +63,7 @@ public class InvoiceResource {
|
|||
@Path("/detail")
|
||||
@POST
|
||||
public Response createInvoiceDetail(InvoiceDetailRequest request)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
service.createInvoiceDetail(request.getInvoiceNum(), request.getLineItemNum(), request.getPoLineItemNum(), request.getServiceTypeId(),
|
||||
request.getDesc(), request.getPercentCompletion(), request.getHours(), request.getAnount());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
|
@ -70,14 +71,14 @@ public class InvoiceResource {
|
|||
|
||||
@Path("/generatedInvoice/{InvoiceNum}")
|
||||
@GET
|
||||
public Response getGeneratedInvoice(@PathParam("InvoiceNum") String InvoiceNum) throws SQLException, Exception {
|
||||
public Response getGeneratedInvoice(@PathParam("InvoiceNum") String InvoiceNum) throws AstuteException {
|
||||
|
||||
return new ApiResponse(service.getGeneratedInvoice(InvoiceNum)).toResponse();
|
||||
}
|
||||
|
||||
@Path("/generateInvoiceNumber/{PONum}")
|
||||
@GET
|
||||
public Response generateInvoiceNumber(@PathParam("PONum") String PONum) throws SQLException, Exception {
|
||||
public Response generateInvoiceNumber(@PathParam("PONum") String PONum) throws AstuteException {
|
||||
|
||||
return new ApiResponse(service.generateInvoiceNumber(PONum)).toResponse();
|
||||
}
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
package com.astute.resources;
|
||||
|
||||
import com.astute.exceptions.AstuteException;
|
||||
import com.astute.requests.PODetailRequest;
|
||||
import com.astute.requests.POMasterRequest;
|
||||
import com.astute.response.ApiResponse;
|
||||
import com.astute.service.POService;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import com.astute.exceptions.*;
|
||||
import com.astute.requests.*;
|
||||
import com.astute.response.*;
|
||||
import com.astute.service.*;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@Path("/po")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
|
@ -27,21 +26,21 @@ public class POResource {
|
|||
@QueryParam("PONum") String PONum,
|
||||
@QueryParam("ContractNum") String contractNum,
|
||||
@QueryParam("PODate") Date PODate)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
return new ApiResponse(POService.getPOMaster(PONum, contractNum, PODate)).toResponse();
|
||||
}
|
||||
|
||||
@Path("/detail")
|
||||
@GET
|
||||
public Response getPODetail(@QueryParam("PONum") String PONum, @QueryParam("lineItemNo") int lineItemNo)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
return new ApiResponse(POService.getPODetail(PONum, lineItemNo)).toResponse();
|
||||
}
|
||||
|
||||
@Path("/{PONum}")
|
||||
@PUT
|
||||
public Response updatePOMaster(@PathParam("PONum") String PONum, POMasterRequest request)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
POService.updatePOMaster(PONum, request.getContractNum(), request.getPODate(), request.getContractAmt());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
|
@ -49,24 +48,24 @@ public class POResource {
|
|||
@Path("/detail/{PONum}/{lineItemNo}")
|
||||
@PUT
|
||||
public Response updatePODetail(@PathParam("PONum") String PONum, @PathParam("lineItemNo") int lineItemNo, PODetailRequest request)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
POService.updatePODetail(PONum, lineItemNo, request.getServiceDesc(), request.getFeeTypeId(),
|
||||
request.getQty(), request.getServiceTypeId(), request.getSchedule(), request.getDeliverBy());
|
||||
request.getQty(), request.getServiceTypeId());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
|
||||
@POST
|
||||
public Response createPOMaster(POMasterRequest request)
|
||||
throws SQLException, Exception {
|
||||
throws AstuteException {
|
||||
POService.createPOMaster(request.getPoNum(), request.getContractNum(), request.getPODate(), request.getContractAmt(), request.getCustomerId());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
@Path("/detail")
|
||||
@POST
|
||||
public Response createPODetail(PODetailRequest request)
|
||||
throws SQLException, Exception {
|
||||
POService.createPODetail(request.getPONum(), request.getLineItemNo(), request.getServiceDesc(), request.getFeeTypeId(),
|
||||
request.getQty(), request.getServiceTypeId(), request.getSchedule(), request.getDeliverBy());
|
||||
throws AstuteException {
|
||||
POService.createPODetail(request.getPoNum(), request.getLineItemNo(), request.getServiceDesc(), request.getFeeTypeId(),
|
||||
request.getQty(), request.getServiceTypeId());
|
||||
return new ApiResponse(ApiResponse.UPDATE_ACCESS_SUCESS).toResponse();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user