Subversion Repositories SmartDukaan

Rev

Rev 4158 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4158 Rev 4499
Line 1... Line 1...
1
package in.shop2020.hotspot.dashbaord.server;
1
package in.shop2020.hotspot.dashbaord.server;
2
 
2
 
3
import in.shop2020.hotspot.dashbaord.shared.actions.PoType;
3
import in.shop2020.hotspot.dashbaord.shared.actions.PoType;
-
 
4
import in.shop2020.purchase.POStatus;
4
import in.shop2020.hotspot.dashbaord.shared.actions.PurchaseOrder;
5
import in.shop2020.purchase.PurchaseOrder;
5
import in.shop2020.thrift.clients.WarehouseClient;
6
import in.shop2020.thrift.clients.PurchaseClient;
6
import in.shop2020.utils.GmailUtils;
7
import in.shop2020.utils.GmailUtils;
7
import in.shop2020.warehouse.POStatus;
-
 
8
import in.shop2020.warehouse.Supplier;
-
 
9
import in.shop2020.warehouse.WarehouseService.Client;
-
 
10
 
8
 
11
import java.util.ArrayList;
9
import java.util.ArrayList;
12
import java.util.List;
10
import java.util.List;
13
 
11
 
14
import org.slf4j.Logger;
12
import org.slf4j.Logger;
Line 52... Line 50...
52
        return statuses;
50
        return statuses;
53
    }
51
    }
54
    
52
    
55
    public static void sendPurchaseOrder(long purchaseOrderId){
53
    public static void sendPurchaseOrder(long purchaseOrderId){
56
        try {
54
        try {
57
            WarehouseClient warehouseServiceClient = new WarehouseClient();
55
            PurchaseClient purchaseClient = new PurchaseClient();
58
            Client client = warehouseServiceClient.getClient();
56
            in.shop2020.purchase.PurchaseService.Client client = purchaseClient.getClient();
59
            in.shop2020.warehouse.PurchaseOrder purchaseOrder = client.getPurchaseOrder(purchaseOrderId);
57
            in.shop2020.purchase.PurchaseOrder purchaseOrder = client.getPurchaseOrder(purchaseOrderId);
60
            Supplier supplier = client.getSupplier(purchaseOrder.getSupplierId());
58
            in.shop2020.purchase.Supplier supplier = client.getSupplier(purchaseOrder.getSupplierId());
61
            
59
            
62
            String filename = PoSheetGenerator.generatePdfSheet(purchaseOrder, supplier);
60
            String filename = PoSheetGenerator.generatePdfSheet(purchaseOrder, supplier);
63
         // FIXME Hardcoding need to be removed.
61
         // FIXME Hardcoding need to be removed.
64
            String[] sendTo = { supplier.getContactEmail(), supplier.getHeadEmail(), "nishu_nath786@yahoo.co.in" };
62
            String[] sendTo = { supplier.getContactEmail(), supplier.getHeadEmail(), "nishu_nath786@yahoo.co.in" };
65
            String emailSubjectTxt = "Purchase Order No. " + purchaseOrder.getPoNumber();
63
            String emailSubjectTxt = "Purchase Order No. " + purchaseOrder.getPoNumber();