Subversion Repository Public Repository

Pharmacy_09_03_18

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

import com.bestray.healthcarecommonutil.exception.DataAccessException;
import com.bestray.healthcarecommonutil.exception.HealthCareException;
import com.bestray.healthcarecommonutil.exception.ProcessingException;
import com.bestray.healthcarecommonutil.vo.TInventoryMaster;
import com.bestray.healthcarecommonutil.vo.TPharmacySales;
import com.bestray.healthcarepharmacy.dao.SalesBillingDao;
import com.bestray.healthcarepharmacy.service.SalesBillingService;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author user3
 */
@Service
public class SalesBillingServiceImpl implements SalesBillingService {
    
     @Autowired
     private SalesBillingDao salesBillingdao;

    @Override
    public List<TPharmacySales> saveSalesDetails(List<TPharmacySales> sales) throws ProcessingException {
         try{
           return salesBillingdao.saveSalesDetails(sales);
        }catch(DataAccessException e){
            e.printStackTrace();
            throw new ProcessingException();
        }
    }

    @Override
    public String getSalesBillingNo(String s) throws ProcessingException {
        try{
                String str = null;
                String  billNo =salesBillingdao.getSalesBillingNo(s);
                if(billNo.length()>1){
                    str=billNo.substring(1);
                }else{
                str=billNo;
                }
                long bnumber=Integer.parseInt(str);
                bnumber+=1;
              
                return String.valueOf(bnumber);
              
            }catch(DataAccessException | NumberFormatException e){
                e.printStackTrace();
                throw new HealthCareException("Failed To Get The Max Billing Number");
            }
    }

    @Override
      public List<TPharmacySales> getSalesDetailBeforeGivenDate(TInventoryMaster inventoryMaster,Date fromDate) throws ProcessingException {
           try{
             return salesBillingdao.getSalesDetailBeforeGivenDate(inventoryMaster,fromDate);
          }catch(DataAccessException e){
              e.printStackTrace();
              throw new ProcessingException();
          }
      }
    
    @Override
      public List<TPharmacySales> getSalesDetailBetweenTwoDate(TInventoryMaster inventoryMaster,Date fromDate,Date toDate) throws ProcessingException {
           try{
             return salesBillingdao.getSalesDetailBetweenTwoDate(inventoryMaster,fromDate,toDate);
          }catch(DataAccessException e){
              throw new ProcessingException();
          }
      }
    
}

Commits for Pharmacy_09_03_18/Dr Gyana ProjectSpace/DrGyanaPharmacy/src/main/java/com/bestray/healthcarepharmacy/serviceimpl/SalesBillingServiceImpl.java

Diff revisions: vs.
Revision Author Commited Message
1 girijabapi picture girijabapi Fri 27 Jul, 2018 07:30:57 +0000