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
/*
 * 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.MaintenanceDoneDao;
import com.bestray.transtracking.dao.TaskDao;
import com.bestray.transtracking.dao.VehicleDao;
import com.bestray.transtracking.dao.impl.MaintenanceDoneDaoImpl;
import com.bestray.transtracking.dao.impl.TaskDaoImpl;
import com.bestray.transtracking.dao.impl.VehicleDaoImpl;
import com.bestray.transtracking.dao.impl.VehicleMaintenanceDaoImpl;
import com.bestray.transtracking.dto.VehicleMaintenanceSearchDTO;
import com.bestray.transtracking.exceptions.TransTrackException;
import com.bestray.transtracking.service.MaintenanceDoneService;
import com.bestray.transtracking.service.VehicleService;
import com.bestray.trastrack.domain.Vehicle;
import com.bestray.trastrack.domain.VehicleMaintenance;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sql.DataSource;

/**
 *
 * @author User1
 */
public class MaintenanceDoneServiceImpl implements MaintenanceDoneService {
    
    
    private VehicleDao vehicleDao;
    private MaintenanceDoneDao vmDao;
     private TaskDao taskDao;
     private VehicleService vehicleService;
    

    public MaintenanceDoneServiceImpl() {
    }
    
    

    public List<Vehicle> getvehicleNumberList() throws TransTrackException {
        try {
            vmDao = new MaintenanceDoneDaoImpl(DataSourceObject.getDataSourceObject());
            return vmDao.findAllVehicles();
        } catch (Exception ex) {
            Logger.getLogger(VehicleMaintenanceServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
            throw new TransTrackException("Error in fetching Vehicle Maintenance List");
        }
    }

    public List<VehicleMaintenance> getSearchResult(VehicleMaintenanceSearchDTO search) throws TransTrackException {
         try {
            DataSource ds = DataSourceObject.getDataSourceObject();
            vehicleService = new VehicleServiceImpl();
            //codedao = new CodeDaoImpl(ds);
            vehicleDao = new VehicleDaoImpl(ds);
            taskDao = new TaskDaoImpl(ds);

            List<VehicleMaintenance> results = vmDao.getSearchResults(search);
            for (VehicleMaintenance object : results) {
                object.setVehicle(vehicleService.getVehicleRegistrationDetails(object.getVehicle_id()));

            }

            return results;
        } catch (Exception ex) {
            Logger.getLogger(VehicleMaintenanceServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
            throw new TransTrackException("Error in fetching Result List");
        }
    }
    
}

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

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