Subversion Repository Public Repository

TransPort_Tracking

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.transtracking.service.impl;

import com.bestray.transporttracking.DataSourceObject;
import com.bestray.transtracking.dao.BalanceSheetDao;
import com.bestray.transtracking.dao.ReceiptVoucherDao;
import com.bestray.transtracking.dao.impl.BalanceSheetDaoImpl;
import com.bestray.transtracking.dto.ClientCollectionSearchDTO;
import com.bestray.transtracking.dto.JobEntrySearchDTO;
import com.bestray.transtracking.dto.PaymentVoucherSearchDTO;
import com.bestray.transtracking.dto.VehicleExpenseSearchDTO;
import com.bestray.transtracking.service.BalanceSheetService;
import com.bestray.trastrack.domain.ClientCollection;
import com.bestray.trastrack.domain.JobEntry;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import com.bestray.transtracking.exceptions.TransTrackException;
import com.bestray.trastrack.domain.PaymentVoucher;
import com.bestray.trastrack.domain.VehicleExpense;
import com.bestray.trastrack.domain.VehicleExpenseDetails;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author user3
 */
public class BalanceSheetServiceImpl implements BalanceSheetService{
    
    private ReceiptVoucherDao voucherdao;
    private BalanceSheetDao balancedao;
    private PaymentVoucherSearchDTO search;
    
    public BalanceSheetServiceImpl(){
        
    }

    public List<JobEntry> getSearchResult(JobEntrySearchDTO search) throws TransTrackException {
       List<JobEntry> results = new ArrayList<JobEntry>();
       try{ 
       DataSource ds =  DataSourceObject.getDataSourceObject();
         balancedao = new BalanceSheetDaoImpl(ds);
         //employeeDao = new EmployeeDaoImpl(ds);
            results = balancedao.getSearchResults(search);
            for(JobEntry object :results){
                //object.setEmployee(employeeDao.findEmplRegistraion(object.getLoan_paid_by()));
            }
       }catch(Exception e){
           throw new TransTrackException("Error in Fetching Job Entry");
       }
         return results; 
    }

    public List<ClientCollection> getCollectionSearchResult(ClientCollectionSearchDTO search2) throws TransTrackException{
         List<ClientCollection> results = new ArrayList<ClientCollection>();
        try{
        DataSource ds =  DataSourceObject.getDataSourceObject();
         balancedao = new BalanceSheetDaoImpl(ds);
         //employeeDao = new EmployeeDaoImpl(ds);
             results = balancedao.getCollectionSearchResults(search2);
            for(ClientCollection object :results){
                //object.setEmployee(employeeDao.findEmplRegistraion(object.getLoan_paid_by()));
            }
            }catch(Exception e){
           throw new TransTrackException("Error in Fetching Collection Entry");
       }
         return results; 
    }

    public List<VehicleExpenseDetails> getExpenseSearchResult(VehicleExpenseSearchDTO expensesearch) throws TransTrackException {
        List<VehicleExpenseDetails> results = new ArrayList<VehicleExpenseDetails>();
        try{
        DataSource ds =  DataSourceObject.getDataSourceObject();
         balancedao = new BalanceSheetDaoImpl(ds);
         //employeeDao = new EmployeeDaoImpl(ds);
             results = balancedao.getExpenseSearchResults(expensesearch);
           
            }catch(Exception e){
           throw new TransTrackException("Error in Fetching Expense Entry");
       }
         return results; 
    }

    public List<PaymentVoucher> getPaymentSearchResult(PaymentVoucherSearchDTO paymentsearch) throws TransTrackException {
         List<PaymentVoucher> results = new ArrayList<PaymentVoucher>();
        try{
        DataSource ds =  DataSourceObject.getDataSourceObject();
         balancedao = new BalanceSheetDaoImpl(ds);
         //employeeDao = new EmployeeDaoImpl(ds);
             results = balancedao.getPaymentSearchResults(paymentsearch);
            }catch(Exception e){
           throw new TransTrackException("Error in Fetching Collection Entry");
       }
         return results; 
    }

    public Double getJobEntryTotalAmount(JobEntrySearchDTO search) throws TransTrackException {
       DataSource ds =  DataSourceObject.getDataSourceObject();
         double amount = 0.0;
         balancedao = new BalanceSheetDaoImpl(ds);
        try {
            amount = balancedao.getJobEntryTotalAmount(search);
        } catch (Exception ex) {
            Logger.getLogger(BalanceSheetServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
            throw new TransTrackException("Error in fetching Total Amount");
        }
        
         return amount;
             
    }
    
     public Double getPartyPaymentTotalAmount(PaymentVoucherSearchDTO paymentsearch)throws TransTrackException {
       DataSource ds =  DataSourceObject.getDataSourceObject();
         double amount = 0.0;
         balancedao = new BalanceSheetDaoImpl(ds);
        try {
            amount = balancedao.getPartyPaymentTotalAmount(search);
        } catch (Exception ex) {
            Logger.getLogger(BalanceSheetServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
            throw new TransTrackException("Error in fetching Total Amount");
        }
        
         return amount;
             
    }
   
    
}

Commits for TransPort_Tracking/TransPortTracking/src/main/java/com/bestray/transtracking/service/impl/BalanceSheetServiceImpl.java

Diff revisions: vs.
Revision Author Commited Message
1 girijabapi picture girijabapi Sat 28 Jul, 2018 05:29:14 +0000