Subversion Repositories SmartDukaan

Rev

Rev 34121 | Rev 34384 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21714 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
21596 ashik.ali 2
 
33177 tejus.loha 3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
4
import com.spice.profitmandi.dao.model.LastSaleDateModel;
5
 
6
import javax.persistence.*;
21596 ashik.ali 7
import java.io.Serializable;
25726 amit.gupta 8
import java.time.LocalDate;
21596 ashik.ali 9
import java.time.LocalDateTime;
22243 ashik.ali 10
import java.time.format.DateTimeFormatter;
21596 ashik.ali 11
 
12
@Entity
31860 tejbeer 13
@Table(name = "fofo.fofo_order")
21596 ashik.ali 14
 
27579 tejbeer 15
@NamedQueries({
16
 
31860 tejbeer 17
        @NamedQuery(name = "FofoOrder.SelectItemWiseTertiary", query = "select new com.spice.profitmandi.dao.model.ItemWiseTertiaryModel(foi.brand," + "foi.modelName, foi.modelNumber, foi.color, foi.quantity, foi.mop)" + " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId where fo.cancelledTimestamp is null and fo.fofoId = :fofoId" + " and fo.createTimestamp between :startDate and :endDate"),
27579 tejbeer 18
 
31860 tejbeer 19
        @NamedQuery(name = "FofoOrder.selectOrderByModelsAndSaleBetween", query = "select fo from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId" + " join Item i on i.id=foi.itemId where fo.cancelledTimestamp is null and i.catalogItemId in :catalogItemIds" + " and fo.createTimestamp between :startDate and :endDate"),
30641 amit.gupta 20
 
31860 tejbeer 21
        @NamedQuery(name = "FofoOrder.selectGroupByBrandPartnerTertiary", query = "select new com.spice.profitmandi.dao.model.BrandWiseTertiaryModel(foi.brand, " + "sum(case when foi.createTimestamp >= :today then CAST(foi.quantity*foi.mop  AS int) else 0 end)," + "sum(case when foi.createTimestamp >= :threedays  and foi.createTimestamp < :endDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end)," + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end)," + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end)," + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmsEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end)," + "sum(case when foi.createTimestamp >= :today then foi.quantity else 0 end)," + "sum(case when foi.createTimestamp >= :threedays and foi.createTimestamp < :endDate then foi.quantity else 0 end)," + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), " + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end)," + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmsEndDate  then foi.quantity else 0 end)" + "	)" + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId " + "  where fo.cancelledTimestamp is null and fs.active = true " + " and foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId" + " group by foi.brand "),
27723 tejbeer 22
 
31860 tejbeer 23
        @NamedQuery(name = "FofoOrder.selectItemPartnerTertiaryByBrand", query = "select new com.spice.profitmandi.dao.model.BrandItemWiseTertiaryModel(foi.brand, i.modelName," + " i.modelNumber, i.color, foi.quantity*foi.mop, foi.quantity)" + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join " + " Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true " + " and foi.createTimestamp >= :startDate and foi.createTimestamp < :endDate and fs.warehouseId in :warehouseId and foi.brand in :brand order by foi.itemId desc"),
27738 tejbeer 24
 
31860 tejbeer 25
        @NamedQuery(name = "FofoOrder.selectTodayItemPartnerTertiaryByBrand", query = "select new com.spice.profitmandi.dao.model.BrandItemWiseTertiaryModel(foi.brand, i.modelName," + " i.modelNumber, i.color, foi.quantity*foi.mop, foi.quantity)" + " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join " + " Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true " + " and foi.createTimestamp >= :startDate and fs.warehouseId in :warehouseId and foi.brand in :brand order by foi.itemId desc"),
27738 tejbeer 26
 
31860 tejbeer 27
        @NamedQuery(name = "FofoOrder.selectValueOfActivatedImeis", query = "select new com.spice.profitmandi.common.model.ActivatedImeisWithSellingPrice(" + "  fo.fofoId, foi.brand, sum(CAST(foi.mop  AS int) * foi.quantity)) " + " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId join FofoLineItem fli on foi.id = fli.fofoOrderItemId join ActivatedImei ai on " + " fli.serialNumber = ai.serialNumber where  fo.createTimestamp between :startDate and :endDate and  fo.fofoId = :fofoId and fo.cancelledTimestamp is null group by foi.brand"),
28020 tejbeer 28
 
31860 tejbeer 29
        @NamedQuery(name = "FofoOrder.selectPartnersSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel(" + "  fs.warehouseId, fs.id,sum(case when foi.quantity is null then 0 else  foi.quantity end))" + " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  " + " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId " + " join Item i on i.id = tl.itemId" + " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId in :catalogItemId and  i.categoryId=10006 group by fs.id"),
27884 tejbeer 30
 
31860 tejbeer 31
        @NamedQuery(name = "FofoOrder.selectPartnersSaleByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel(" + " fs.warehouseId, fs.id,sum(case when foi.quantity is null then 0 else  foi.quantity end),i.brand,i.modelName,i.modelNumber,i.catalogItemId)" + " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  " + " join FofoOrderItem foi on foi.orderId = fo.id join TagListing tl on tl.itemId = foi.itemId " + " join Item i on i.id = tl.itemId" + " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null " + " and fo.createTimestamp > :startDate and tl.mop between :startPrice and :endPrice and  i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
28004 tejbeer 32
 
31860 tejbeer 33
        @NamedQuery(name = "FofoOrder.selectPartnersSaleItemByCatalogIdFofoId", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel(" + "  fs.warehouseId, fs.id,sum(foi.quantity),i.brand,i.modelName,i.modelNumber,i.catalogItemId)" + " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  " + " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId " + " join Item i on i.id = tl.itemId" + " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId in :catalogItemId and  i.categoryId=10006 and fs.id = :fofoId group by i.catalogItemId, i.brand,i.modelName,i.modelNumber"),
28032 tejbeer 34
 
32906 amit.gupta 35
        @NamedQuery(name = "FofoOrder.selectSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel(" +
36
                "  fs.warehouseId, fs.id,i.catalogItemId, sum(case when foi.quantity is null then 0 else  foi.quantity end))" +
37
                " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  " +
38
                " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId " +
39
                " join Item i on i.id = tl.itemId" +
40
                " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate" +
41
                " and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId and  i.categoryId=10006 group by i.catalogItemId, fs.id"),
28474 tejbeer 42
 
31008 amit.gupta 43
 
32906 amit.gupta 44
        @NamedQuery(name = "FofoOrder.selectFocoSaleReport", query = "select new com.spice.profitmandi.dao.model.FocoSaleReportModel(fs.code, ua.name,ua.city, ua.state, w.displayName, foi.itemId," +
34121 ranu 45
                " foi.brand, foi.modelName, foi.modelNumber, foi.color, fli.quantity, cast(foi.dp As int), cast(foi.sellingPrice As int), cast(foi.mop As int), fli.serialNumber, foi.createTimestamp, coalesce( ca.name, cus.firstName), ca.phoneNumber," +
32906 amit.gupta 46
                " ca.city, ca.pinCode, fo.invoiceNumber, p.purchaseReference, fo.customerGstNumber, fo.cancelledTimestamp, p.completeTimestamp, hd.hygieneRating,hd.rating, hd.status, hd.remark," +
47
                " hd.createdTimestamp, hd.disposedTimestamp, hd.nextTimestamp, ai.activationTimestamp, ai.createTimestamp, c.label)" +
34121 ranu 48
                " from FofoStore fs join Warehouse w on w.id=fs.warehouseId join com.spice.profitmandi.dao.entity.user.User u on u.id=fs.id join Address ua on u.addressId = ua.id join FofoOrder fo on fo.fofoId=fs.id left join FofoOrderItem foi" + " on foi.orderId=fo.id left join Customer cus on cus.id = fo.customerId join Item i on i.id=foi.itemId join Category c on c.id=i.categoryId left join CustomerAddress ca on ca.id=fo.customerAddressId left join FofoLineItem fli on fli.fofoOrderItemId=foi.id" + " left join InventoryItem ii on ii.id=fli.inventoryItemId left join Purchase p on ii.purchaseId=p.id left join HygieneData hd on hd.orderId=fo.id left join ActivatedImei ai on ai.serialNumber=fli.serialNumber" + " where 1=1 and (foi.createTimestamp between :startDate and :endDate or foi.createTimestamp is null) and fs.code= :code and fs.id=:fofoId  group by fli.id "),
30160 manish 49
 
31860 tejbeer 50
        @NamedQuery(name = "FofoOrder.selectFocoSaleReportByBrand", query = "select new com.spice.profitmandi.dao.model.FocoSaleReportModel(fs.code, ua.name,ua.city, ua.state, w.displayName, foi.itemId," + " foi.brand, foi.modelName, foi.modelNumber, foi.color, foi.quantity, cast(foi.dp As int), cast(foi.sellingPrice As int), cast(foi.mop As int), fli.serialNumber, foi.createTimestamp, ca.name, ca.phoneNumber," + " ca.city, ca.pinCode, fo.invoiceNumber, p.purchaseReference, fo.customerGstNumber, fo.cancelledTimestamp, p.completeTimestamp, hd.hygieneRating,hd.rating, hd.status, hd.remark," + " hd.createdTimestamp, hd.disposedTimestamp, hd.nextTimestamp, ai.activationTimestamp, ai.createTimestamp, c.label)" + " from FofoStore fs join Warehouse w on w.id=fs.warehouseId join com.spice.profitmandi.dao.entity.user.User u on u.id=fs.id join Address ua on u.addressId = ua.id join FofoOrder fo on fo.fofoId=fs.id left join FofoOrderItem foi" + " on foi.orderId=fo.id join Item i on i.id=foi.itemId join Category c on c.id=i.categoryId left join CustomerAddress ca on ca.id=fo.customerAddressId left join FofoLineItem fli on fli.fofoOrderItemId=foi.id" + " left join InventoryItem ii on ii.id=fli.inventoryItemId left join Purchase p on ii.purchaseId=p.id left join HygieneData hd on hd.orderId=fo.id left join ActivatedImei ai on ai.serialNumber=fli.serialNumber" + " where (foi.createTimestamp between :startDate and :endDate or foi.createTimestamp is null) and fs.id=:fofoId and i.brand=:brand group by fo.id "),
31008 amit.gupta 51
 
34066 aman.kumar 52
        @NamedQuery(name = "FofoOrder.selectWalletSummaryReport", query = "select new com.spice.profitmandi.dao.model.WalletSummaryReportModel(uwh.id, fs.code, ua.name, " + " u.emailId, ua.phoneNumber, uwh.amount, uwh.refundableAmount, uwh.reference, uwh.referenceType, uwh.timestamp, uwh.businessTimestamp, uwh.description)" + " from FofoStore fs join com.spice.profitmandi.dao.entity.user.User u on u.id=fs.id join" + " Address ua on u.addressId=ua.id join UserWallet uw on  uw.userId=fs.id join UserWalletHistory uwh on uwh.walletId=uw.id " + " where 1=1 and uwh.timestamp between :startDate and :endDate and fs.id=:fofoId order by uwh.timestamp asc "),
30160 manish 53
 
31008 amit.gupta 54
 
31860 tejbeer 55
        @NamedQuery(name = "FofoOrder.selectPendingIndentReport", query = "select new com.spice.profitmandi.dao.model.PendingIndentReportModel(o.transactionId , o.id, o.createTimestamp," + "  l.itemId, l.brand, l.modelName, l.modelNumber, l.color, l.quantity, l.unitPrice, o.walletAmount,case o.status when 3 then  'In Process' when 4  then 'Accepted' " + "  when 7  then 'Billed' when 9   then 'Shipped' when 12  then 'Delivered' when 13  then 'Cancellation in process' when 15 then 'Cancelled,amount refunded to wallet' " + "  when 31  then 'Returned to Origin, refunded' when 34 then 'Low inventory cancellation, refunded' " + "  else o.statusDescription end as Description, o.invoiceNumber, o.billingTimestamp ) from Order o join LineItem l on l.orderId=o.id " + "  where o.partnerGrnTimestamp is null and o.retailerId= :fofoId and o.status != 1 and o.createTimestamp between :startDate and :endDate group by o.status,o.createTimestamp "),
30160 manish 56
 
31860 tejbeer 57
        @NamedQuery(name = "FofoOrder.selectSchemePayoutReport", query = "select new com.spice.profitmandi.dao.model.SchemePayoutReportModel(i.id, i.brand, i.modelName, i.modelNumber," + " i.color,ii.unitPrice-ii.priceDropAmount,case when foi.dp is not null then foi.dp else 0 end, s.id, s.name, s.type, s.amountType, s.amount,p.purchaseReference, fo.invoiceNumber,(case when sio.rolledBackTimestamp is null " + " then sio.amount when sio.rolledBackTimestamp  is not null then 0 end),sio.status, sio.statusDescription, sio.createTimestamp, sio.rolledBackTimestamp, ii.serialNumber ) from " + " SchemeInOut sio join InventoryItem ii on sio.inventoryItemId=ii.id join com.spice.profitmandi.dao.entity.catalog.Item i on i.id=ii.itemId join FofoStore fs on fs.id=ii.fofoId " + " join com.spice.profitmandi.dao.entity.user.User u on u.id = fs.id join Address ua on u.addressId = ua.id join Scheme s on sio.schemeId=s.id join Purchase p on p.id=ii.purchaseId" + " left join FofoLineItem fli on fli.inventoryItemId=ii.id left join FofoOrderItem foi on foi.id=fli.fofoOrderItemId left join FofoOrder fo on fo.id=foi.orderId where  " + " (foi.createTimestamp  between :startDate and :endDate " + " or ii.createTimestamp  between :startDate and :endDate )" + "and ii.fofoId= :fofoId "),
31423 amit.gupta 58
 
31860 tejbeer 59
        @NamedQuery(name = "FofoOrder.selectInvoiceSchemeOutSummaryReport", query = "select new com.spice.profitmandi.dao.model.FocoSchemeOutReportModel(fo.invoiceNumber, foi.quantity, foi.brand," + " foi.modelName, foi.modelNumber, foi.color,  sum(cast(sio.amount As float)) ) FROM FofoOrderItem foi join FofoOrder fo on fo.id=foi.orderId join FofoLineItem fli on " + " fli.fofoOrderItemId=foi.id join SchemeInOut sio on sio.inventoryItemId=fli.inventoryItemId join Scheme s on s.id=sio.schemeId where s.type ='IN' and fo.fofoId= :fofoId and" + " fo.createTimestamp between :startDate and :endDate and sio.rolledBackTimestamp is null group by fo.id, foi.id "),
31423 amit.gupta 60
 
32906 amit.gupta 61
        //String sellerName, String hsnCode, String gstNumber, String stateName
62
        @NamedQuery(name = "FofoOrder.selectPartnerBillingSummaryReport", query = "select new com.spice.profitmandi.dao.model.PartnerBillingSummaryModel(o.id,  o.createTimestamp, o.billingTimestamp," +
63
                " o.deliveryTimestamp, o.partnerGrnTimestamp, o.transactionId, case when o.logisticsTransactionId is null then 'NA' else o.logisticsTransactionId end,o.airwayBillNumber,  " +
64
                " os.statusSubGroup, os.statusName, o.retailerId, o.retailerName, i.id, i.brand, i.modelName, i.modelNumber, i.color, l.unitPrice, l.quantity, l.totalPrice,  o.invoiceNumber," +
65
                " l.igstRate, l.cgstRate, l.sgstRate, org.name, l.hsnCode,  s.gstin, state.name )" +
66
                " From Order o join LineItem l on l.orderId = o.id join Item i on l.itemId = i.id join Category c on i.categoryId = c.id join OrderStatus os on os.status=o.status" +
32907 amit.gupta 67
                " join FofoStore fs on fs.id=o.retailerId join Seller s on s.id=o.sellerId join State state on s.stateId=state.id join Organisation org on org.id=s.organisationId" +
32906 amit.gupta 68
                " where 1=1 and  o.billingTimestamp between :startDate and :endDate and o.retailerId = :fofoId "),
31423 amit.gupta 69
 
33873 ranu 70
        @NamedQuery(name = "FofoOrder.soldAllItemByToday",
71
                query = "select new com.spice.profitmandi.dao.model.SoldAllCatalogitemQtyByPartnerModel" +
72
                        "(i.catalogItemId, foi.modelNumber, SUM(foi.quantity)) " +
73
                        "FROM FofoOrder fo " +
74
                        "JOIN FofoOrderItem foi ON fo.id = foi.orderId " +
75
                        "JOIN Item i ON foi.itemId = i.id " +
76
                        "JOIN Catalog c ON i.catalogItemId = c.id " +
77
                        "WHERE fo.createTimestamp BETWEEN :startOfDay AND :endOfDay and fo.fofoId = :fofoId " +
78
                        "GROUP BY i.catalogItemId")
31860 tejbeer 79
 
33873 ranu 80
 
27579 tejbeer 81
})
31860 tejbeer 82
 
83
 
84
@NamedNativeQueries({
85
 
86
 
32044 tejbeer 87
        @NamedNativeQuery(name = "FofoOrder.getLastTertiaryByFofoId", query = "select Max(fo.create_timestamp) from  fofo.fofo_order fo where fo.fofo_id = :fofoId and fo.cancelled_timestamp is null"),
31860 tejbeer 88
 
89
 
32044 tejbeer 90
        @NamedNativeQuery(name = "FofoOrder.getLastTertiaryOrders", query = "select fo.fofo_id, Max(fo.create_timestamp) as maxdate from fofo.fofo_order fo where fo.cancelled_timestamp is null group by fofo_id", resultSetMapping = "LastTertiaryDays"),
91
 
92
 
31860 tejbeer 93
})
94
 
32044 tejbeer 95
@SqlResultSetMappings({
96
 
97
        @SqlResultSetMapping(name = "LastTertiaryDays", classes = {@ConstructorResult(targetClass = LastSaleDateModel.class, columns = {@ColumnResult(name = "fofo_id", type = Integer.class), @ColumnResult(name = "maxdate ", type = LocalDateTime.class)})})
98
 
99
})
100
 
27579 tejbeer 101
public class FofoOrder implements Serializable {
102
 
31860 tejbeer 103
    private static final long serialVersionUID = 1L;
21596 ashik.ali 104
 
31860 tejbeer 105
    @Id
106
    @Column(name = "id")
107
    @GeneratedValue(strategy = GenerationType.IDENTITY)
108
    private int id;
27579 tejbeer 109
 
34287 vikas.jang 110
    @Column(name = "pending_order_id")
111
    private int pendingOrderId;
112
 
31860 tejbeer 113
    @Column(name = "fofo_id")
114
    private int fofoId;
27579 tejbeer 115
 
31860 tejbeer 116
    @Column(name = "customer_id")
117
    private int customerId;
27579 tejbeer 118
 
31860 tejbeer 119
    @Column(name = "customer_address_id")
120
    private int customerAddressId;
27579 tejbeer 121
 
31860 tejbeer 122
    @Column(name = "customer_gst_number")
123
    private String customerGstNumber;
27579 tejbeer 124
 
31860 tejbeer 125
    @Column(name = "total_amount")
126
    private float totalAmount;
27579 tejbeer 127
 
31860 tejbeer 128
    @Column(name = "invoice_number", length = 50)
129
    private String invoiceNumber;
27579 tejbeer 130
 
31860 tejbeer 131
    @Column(name = "cashback")
132
    private float cashback;
27579 tejbeer 133
 
31860 tejbeer 134
    @Convert(converter = LocalDateTimeAttributeConverter.class)
135
    @Column(name = "create_timestamp")
136
    private LocalDateTime createTimestamp = LocalDateTime.now();
27579 tejbeer 137
 
31860 tejbeer 138
    @Convert(converter = LocalDateTimeAttributeConverter.class)
139
    @Column(name = "cancelled_timestamp")
140
    private LocalDateTime cancelledTimestamp;
27579 tejbeer 141
 
31860 tejbeer 142
    // @Convert(converter = LocalDateTimeAttributeConverter.class)
143
    // @Column(name = "billing_timestamp")
144
    @Transient
145
    private LocalDateTime billingTimestamp;
27579 tejbeer 146
 
31860 tejbeer 147
    @Transient
148
    private FofoOrderItem orderItem;
27579 tejbeer 149
 
31860 tejbeer 150
    @Transient
151
    private LocalDate dateOfBirth;
27579 tejbeer 152
 
153
 
31860 tejbeer 154
    public LocalDate getDateOfBirth() {
155
        return dateOfBirth;
156
    }
27579 tejbeer 157
 
31860 tejbeer 158
    public void setDateOfBirth(LocalDate dateOfBirth) {
159
        this.dateOfBirth = dateOfBirth;
160
    }
27579 tejbeer 161
 
31860 tejbeer 162
    public FofoOrderItem getOrderItem() {
163
        return orderItem;
164
    }
27579 tejbeer 165
 
31860 tejbeer 166
    public void setOrderItem(FofoOrderItem orderItem) {
167
        this.orderItem = orderItem;
168
    }
27579 tejbeer 169
 
31860 tejbeer 170
    public LocalDateTime getCancelledTimestamp() {
171
        return cancelledTimestamp;
172
    }
27579 tejbeer 173
 
31860 tejbeer 174
    public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
175
        this.cancelledTimestamp = cancelledTimestamp;
176
    }
27579 tejbeer 177
 
31860 tejbeer 178
    public int getId() {
179
        return id;
180
    }
27579 tejbeer 181
 
31860 tejbeer 182
    public void setId(int id) {
183
        this.id = id;
184
    }
27579 tejbeer 185
 
34287 vikas.jang 186
    public int getPendingOrderId() {
187
        return pendingOrderId;
188
    }
189
 
190
    public void setPendingOrderId(int pendingOrderId) {
191
        this.pendingOrderId = pendingOrderId;
192
    }
193
 
31860 tejbeer 194
    public int getFofoId() {
195
        return fofoId;
196
    }
27579 tejbeer 197
 
31860 tejbeer 198
    public void setFofoId(int fofoId) {
199
        this.fofoId = fofoId;
200
    }
27579 tejbeer 201
 
31860 tejbeer 202
    public int getCustomerId() {
203
        return customerId;
204
    }
27579 tejbeer 205
 
31860 tejbeer 206
    public void setCustomerId(int customerId) {
207
        this.customerId = customerId;
208
    }
27579 tejbeer 209
 
31860 tejbeer 210
    public int getCustomerAddressId() {
211
        return customerAddressId;
212
    }
27579 tejbeer 213
 
31860 tejbeer 214
    public void setCustomerAddressId(int customerAddressId) {
215
        this.customerAddressId = customerAddressId;
216
    }
27579 tejbeer 217
 
31860 tejbeer 218
    public String getCustomerGstNumber() {
219
        return customerGstNumber;
220
    }
27579 tejbeer 221
 
31860 tejbeer 222
    public void setCustomerGstNumber(String customerGstNumber) {
223
        this.customerGstNumber = customerGstNumber;
224
    }
27579 tejbeer 225
 
31860 tejbeer 226
    public float getTotalAmount() {
227
        return totalAmount;
228
    }
27579 tejbeer 229
 
31860 tejbeer 230
    public void setTotalAmount(float totalAmount) {
231
        this.totalAmount = totalAmount;
232
    }
27579 tejbeer 233
 
31860 tejbeer 234
    public String getInvoiceNumber() {
235
        return invoiceNumber;
236
    }
27579 tejbeer 237
 
31860 tejbeer 238
    public void setInvoiceNumber(String invoiceNumber) {
239
        this.invoiceNumber = invoiceNumber;
240
    }
27579 tejbeer 241
 
31860 tejbeer 242
    public float getCashback() {
243
        return cashback;
244
    }
27579 tejbeer 245
 
31860 tejbeer 246
    public void setCashback(float cashback) {
247
        this.cashback = cashback;
248
    }
27579 tejbeer 249
 
31860 tejbeer 250
    public LocalDateTime getCreateTimestamp() {
251
        return createTimestamp;
252
    }
27579 tejbeer 253
 
31860 tejbeer 254
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
255
        this.createTimestamp = createTimestamp;
256
    }
27579 tejbeer 257
 
31860 tejbeer 258
    public String getFormattedDate() {
259
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
260
        return this.createTimestamp.format(formatter);
261
    }
27579 tejbeer 262
 
27586 tejbeer 263
 
31860 tejbeer 264
    @Override
265
    public int hashCode() {
266
        final int prime = 31;
267
        int result = 1;
268
        result = prime * result + ((billingTimestamp == null) ? 0 : billingTimestamp.hashCode());
269
        result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
270
        result = prime * result + Float.floatToIntBits(cashback);
271
        result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
272
        result = prime * result + customerAddressId;
273
        result = prime * result + ((customerGstNumber == null) ? 0 : customerGstNumber.hashCode());
274
        result = prime * result + customerId;
275
        result = prime * result + ((dateOfBirth == null) ? 0 : dateOfBirth.hashCode());
276
        result = prime * result + fofoId;
277
        result = prime * result + id;
278
        result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
279
        result = prime * result + ((orderItem == null) ? 0 : orderItem.hashCode());
280
        result = prime * result + Float.floatToIntBits(totalAmount);
281
        return result;
282
    }
27586 tejbeer 283
 
31860 tejbeer 284
    @Override
285
    public boolean equals(Object obj) {
286
        if (this == obj) return true;
287
        if (obj == null) return false;
288
        if (getClass() != obj.getClass()) return false;
289
        FofoOrder other = (FofoOrder) obj;
290
        if (billingTimestamp == null) {
291
            if (other.billingTimestamp != null) return false;
292
        } else if (!billingTimestamp.equals(other.billingTimestamp)) return false;
293
        if (cancelledTimestamp == null) {
294
            if (other.cancelledTimestamp != null) return false;
295
        } else if (!cancelledTimestamp.equals(other.cancelledTimestamp)) return false;
296
        if (Float.floatToIntBits(cashback) != Float.floatToIntBits(other.cashback)) return false;
297
        if (createTimestamp == null) {
298
            if (other.createTimestamp != null) return false;
299
        } else if (!createTimestamp.equals(other.createTimestamp)) return false;
300
        if (customerAddressId != other.customerAddressId) return false;
301
        if (customerGstNumber == null) {
302
            if (other.customerGstNumber != null) return false;
303
        } else if (!customerGstNumber.equals(other.customerGstNumber)) return false;
304
        if (customerId != other.customerId) return false;
305
        if (dateOfBirth == null) {
306
            if (other.dateOfBirth != null) return false;
307
        } else if (!dateOfBirth.equals(other.dateOfBirth)) return false;
308
        if (fofoId != other.fofoId) return false;
309
        if (id != other.id) return false;
310
        if (invoiceNumber == null) {
311
            if (other.invoiceNumber != null) return false;
312
        } else if (!invoiceNumber.equals(other.invoiceNumber)) return false;
313
        if (orderItem == null) {
314
            if (other.orderItem != null) return false;
315
        } else if (!orderItem.equals(other.orderItem)) return false;
316
        if (Float.floatToIntBits(totalAmount) != Float.floatToIntBits(other.totalAmount)) return false;
317
        return true;
318
    }
319
 
320
    @Override
321
    public String toString() {
322
        return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId=" + customerAddressId + ", customerGstNumber=" + customerGstNumber + ", totalAmount=" + totalAmount + ", invoiceNumber=" + invoiceNumber + ", cashback=" + cashback + ", createTimestamp=" + createTimestamp + ", cancelledTimestamp=" + cancelledTimestamp + ", billingTimestamp=" + billingTimestamp + ", orderItem=" + orderItem + ", dateOfBirth=" + dateOfBirth + " ]";
323
    }
324
 
21596 ashik.ali 325
}