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
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.transtracking.controller;

import com.bestray.transtracking.dto.OwnerPaymentSearchDTO;
import com.bestray.transtracking.service.CodeService;
import com.bestray.transtracking.service.PaymentVoucherService;
import com.bestray.transtracking.service.VehicleOwnerPaymentService;
import com.bestray.transtracking.service.VehicleOwnerService;
import com.bestray.transtracking.service.impl.CodeServiceImpl;
import com.bestray.transtracking.service.impl.OwnerPaymentServiceImpl;
import com.bestray.transtracking.service.impl.PaymentVoucherServiceImpl;
import com.bestray.transtracking.service.impl.VehicleOwnerServiceImpl;
import com.bestray.trastrack.domain.Code;
import com.bestray.trastrack.domain.Employee;
import com.bestray.trastrack.domain.OwnerPayment;
import com.bestray.trastrack.domain.OwnerPaymentBalanceSum;
import com.bestray.trastrack.domain.VehicleOwner;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Vector;

/**
 *
 * @author User1
 */
public class OwnerPaymentController {
    
    private PaymentVoucherService paymentservice;
    public static final String COLLECTION_CATAGORY = "COLLECTION_CATAGORY";
    private CodeService codeService;
    private VehicleOwnerPaymentService ownerPaymentService;
    private SimpleDateFormat sdf;
    private VehicleOwnerService ownerService;
    
    public OwnerPaymentController() {
        paymentservice = new PaymentVoucherServiceImpl();
        codeService = new CodeServiceImpl();
        ownerPaymentService = new OwnerPaymentServiceImpl();
         sdf = new SimpleDateFormat("dd/MM/yyyy");
         ownerService = new VehicleOwnerServiceImpl();
    }

    public Vector<Employee> getPaidByList() {
        Vector employees = new Vector();
        List<Employee> employeeList = paymentservice.getEmployeeNameList();
        for(Employee emp:employeeList){
            employees.addElement(emp);
        }
        return employees;
    }

    public Vector<VehicleOwner> getVehicleOwnerList() {
        Vector owners = new Vector();
        List<VehicleOwner> ownerList = ownerPaymentService.getVehicleOwnerList();
        for(VehicleOwner owner:ownerList){
            owners.addElement(owner);
        }
        return owners;
    }

    public Vector<Code> getCodeList() {
        Vector codes = new Vector();
        List<Code> codeList = codeService.getCodesByCodeTypeName(COLLECTION_CATAGORY);
        for(Code code:codeList){
            codes.addElement(code);
        }
        return codes;
    }

    public void deleteVehicleOwnerTransaction(Long valueOf) {
        ownerPaymentService.deleteVehicleOwnerTransaction(valueOf);
    }

    public boolean saveVehicleOwnerTransaction(OwnerPayment ownerPayment) {
        return ownerPaymentService.saveVehicleOwnerTransaction(ownerPayment);
    }
    public OwnerPaymentBalanceSum getBalanceSum(Long ownerId) {
        return ownerPaymentService.getBalanceSum(ownerId);
    }

    public Vector<Vector<String>> getSearchResults(OwnerPaymentSearchDTO search) {
        List<OwnerPayment> ownerPaymentlist = ownerPaymentService.getSearchResult(search);
          Vector<Vector<String>> returnList = new Vector<Vector<String>>();
         
           for(OwnerPayment record:ownerPaymentlist){
              Code code = new Code();
              VehicleOwner owner = new VehicleOwner();
              Vector<String> ownerPayment = new Vector<String>();
              ownerPayment.add(String.valueOf(record.getId()));
              ownerPayment.add(String.valueOf(sdf.format(record.getPayment_date())));
              owner = ownerService.getVehicleOwnerRegistrationDetails(record.getOwner_id());
               ownerPayment.add(owner.getOwnername());
              ownerPayment.add(String.valueOf(record.getAmount()));
              code=codeService.getCodeName(record.getPayment_mode_id()!=null?record.getPayment_mode_id():0);
              if(code!=null){
                  ownerPayment.add(code.getName());
              }
              ownerPayment.add(String.valueOf(record.getRemarks()));
              
              returnList.add(ownerPayment);
              }
               return returnList;
    }

    public OwnerPayment getOwnerPaymentDetails(Long valueOf) {
        return ownerPaymentService.getOwnerPaymentDetails(valueOf);
    }

    public OwnerPaymentBalanceSum getPaymentBalanceSum(Long ownerId) {
        return ownerPaymentService.getPaymentBalanceSum(ownerId);
    }

    
}

Commits for TransPort_Tracking/TransPortTracking/src/main/java/com/bestray/transtracking/controller/OwnerPaymentController.java

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