Subversion Repositories SmartDukaan

Rev

Rev 32907 | Rev 33873 | 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," +
33177 tejus.loha 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, ca.name, 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)" +
33177 tejus.loha 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 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
 
31860 tejbeer 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 group by uwh.timestamp"),
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
 
31860 tejbeer 70
 
27579 tejbeer 71
})
31860 tejbeer 72
 
73
 
74
@NamedNativeQueries({
75
 
76
 
32044 tejbeer 77
        @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 78
 
79
 
32044 tejbeer 80
        @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"),
81
 
82
 
31860 tejbeer 83
})
84
 
32044 tejbeer 85
@SqlResultSetMappings({
86
 
87
        @SqlResultSetMapping(name = "LastTertiaryDays", classes = {@ConstructorResult(targetClass = LastSaleDateModel.class, columns = {@ColumnResult(name = "fofo_id", type = Integer.class), @ColumnResult(name = "maxdate ", type = LocalDateTime.class)})})
88
 
89
})
90
 
27579 tejbeer 91
public class FofoOrder implements Serializable {
92
 
31860 tejbeer 93
    private static final long serialVersionUID = 1L;
21596 ashik.ali 94
 
31860 tejbeer 95
    @Id
96
    @Column(name = "id")
97
    @GeneratedValue(strategy = GenerationType.IDENTITY)
98
    private int id;
27579 tejbeer 99
 
31860 tejbeer 100
    @Column(name = "fofo_id")
101
    private int fofoId;
27579 tejbeer 102
 
31860 tejbeer 103
    @Column(name = "customer_id")
104
    private int customerId;
27579 tejbeer 105
 
31860 tejbeer 106
    @Column(name = "customer_address_id")
107
    private int customerAddressId;
27579 tejbeer 108
 
31860 tejbeer 109
    @Column(name = "customer_gst_number")
110
    private String customerGstNumber;
27579 tejbeer 111
 
31860 tejbeer 112
    @Column(name = "total_amount")
113
    private float totalAmount;
27579 tejbeer 114
 
31860 tejbeer 115
    @Column(name = "invoice_number", length = 50)
116
    private String invoiceNumber;
27579 tejbeer 117
 
31860 tejbeer 118
    @Column(name = "cashback")
119
    private float cashback;
27579 tejbeer 120
 
31860 tejbeer 121
    @Convert(converter = LocalDateTimeAttributeConverter.class)
122
    @Column(name = "create_timestamp")
123
    private LocalDateTime createTimestamp = LocalDateTime.now();
27579 tejbeer 124
 
31860 tejbeer 125
    @Convert(converter = LocalDateTimeAttributeConverter.class)
126
    @Column(name = "cancelled_timestamp")
127
    private LocalDateTime cancelledTimestamp;
27579 tejbeer 128
 
31860 tejbeer 129
    // @Convert(converter = LocalDateTimeAttributeConverter.class)
130
    // @Column(name = "billing_timestamp")
131
    @Transient
132
    private LocalDateTime billingTimestamp;
27579 tejbeer 133
 
31860 tejbeer 134
    @Transient
135
    private FofoOrderItem orderItem;
27579 tejbeer 136
 
31860 tejbeer 137
    @Transient
138
    private LocalDate dateOfBirth;
27579 tejbeer 139
 
140
 
31860 tejbeer 141
    public LocalDate getDateOfBirth() {
142
        return dateOfBirth;
143
    }
27579 tejbeer 144
 
31860 tejbeer 145
    public void setDateOfBirth(LocalDate dateOfBirth) {
146
        this.dateOfBirth = dateOfBirth;
147
    }
27579 tejbeer 148
 
31860 tejbeer 149
    public FofoOrderItem getOrderItem() {
150
        return orderItem;
151
    }
27579 tejbeer 152
 
31860 tejbeer 153
    public void setOrderItem(FofoOrderItem orderItem) {
154
        this.orderItem = orderItem;
155
    }
27579 tejbeer 156
 
31860 tejbeer 157
    public LocalDateTime getCancelledTimestamp() {
158
        return cancelledTimestamp;
159
    }
27579 tejbeer 160
 
31860 tejbeer 161
    public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
162
        this.cancelledTimestamp = cancelledTimestamp;
163
    }
27579 tejbeer 164
 
31860 tejbeer 165
    public int getId() {
166
        return id;
167
    }
27579 tejbeer 168
 
31860 tejbeer 169
    public void setId(int id) {
170
        this.id = id;
171
    }
27579 tejbeer 172
 
31860 tejbeer 173
    public int getFofoId() {
174
        return fofoId;
175
    }
27579 tejbeer 176
 
31860 tejbeer 177
    public void setFofoId(int fofoId) {
178
        this.fofoId = fofoId;
179
    }
27579 tejbeer 180
 
31860 tejbeer 181
    public int getCustomerId() {
182
        return customerId;
183
    }
27579 tejbeer 184
 
31860 tejbeer 185
    public void setCustomerId(int customerId) {
186
        this.customerId = customerId;
187
    }
27579 tejbeer 188
 
31860 tejbeer 189
    public int getCustomerAddressId() {
190
        return customerAddressId;
191
    }
27579 tejbeer 192
 
31860 tejbeer 193
    public void setCustomerAddressId(int customerAddressId) {
194
        this.customerAddressId = customerAddressId;
195
    }
27579 tejbeer 196
 
31860 tejbeer 197
    public String getCustomerGstNumber() {
198
        return customerGstNumber;
199
    }
27579 tejbeer 200
 
31860 tejbeer 201
    public void setCustomerGstNumber(String customerGstNumber) {
202
        this.customerGstNumber = customerGstNumber;
203
    }
27579 tejbeer 204
 
31860 tejbeer 205
    public float getTotalAmount() {
206
        return totalAmount;
207
    }
27579 tejbeer 208
 
31860 tejbeer 209
    public void setTotalAmount(float totalAmount) {
210
        this.totalAmount = totalAmount;
211
    }
27579 tejbeer 212
 
31860 tejbeer 213
    public String getInvoiceNumber() {
214
        return invoiceNumber;
215
    }
27579 tejbeer 216
 
31860 tejbeer 217
    public void setInvoiceNumber(String invoiceNumber) {
218
        this.invoiceNumber = invoiceNumber;
219
    }
27579 tejbeer 220
 
31860 tejbeer 221
    public float getCashback() {
222
        return cashback;
223
    }
27579 tejbeer 224
 
31860 tejbeer 225
    public void setCashback(float cashback) {
226
        this.cashback = cashback;
227
    }
27579 tejbeer 228
 
31860 tejbeer 229
    public LocalDateTime getCreateTimestamp() {
230
        return createTimestamp;
231
    }
27579 tejbeer 232
 
31860 tejbeer 233
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
234
        this.createTimestamp = createTimestamp;
235
    }
27579 tejbeer 236
 
31860 tejbeer 237
    public String getFormattedDate() {
238
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
239
        return this.createTimestamp.format(formatter);
240
    }
27579 tejbeer 241
 
27586 tejbeer 242
 
31860 tejbeer 243
    @Override
244
    public int hashCode() {
245
        final int prime = 31;
246
        int result = 1;
247
        result = prime * result + ((billingTimestamp == null) ? 0 : billingTimestamp.hashCode());
248
        result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
249
        result = prime * result + Float.floatToIntBits(cashback);
250
        result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
251
        result = prime * result + customerAddressId;
252
        result = prime * result + ((customerGstNumber == null) ? 0 : customerGstNumber.hashCode());
253
        result = prime * result + customerId;
254
        result = prime * result + ((dateOfBirth == null) ? 0 : dateOfBirth.hashCode());
255
        result = prime * result + fofoId;
256
        result = prime * result + id;
257
        result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
258
        result = prime * result + ((orderItem == null) ? 0 : orderItem.hashCode());
259
        result = prime * result + Float.floatToIntBits(totalAmount);
260
        return result;
261
    }
27586 tejbeer 262
 
31860 tejbeer 263
    @Override
264
    public boolean equals(Object obj) {
265
        if (this == obj) return true;
266
        if (obj == null) return false;
267
        if (getClass() != obj.getClass()) return false;
268
        FofoOrder other = (FofoOrder) obj;
269
        if (billingTimestamp == null) {
270
            if (other.billingTimestamp != null) return false;
271
        } else if (!billingTimestamp.equals(other.billingTimestamp)) return false;
272
        if (cancelledTimestamp == null) {
273
            if (other.cancelledTimestamp != null) return false;
274
        } else if (!cancelledTimestamp.equals(other.cancelledTimestamp)) return false;
275
        if (Float.floatToIntBits(cashback) != Float.floatToIntBits(other.cashback)) return false;
276
        if (createTimestamp == null) {
277
            if (other.createTimestamp != null) return false;
278
        } else if (!createTimestamp.equals(other.createTimestamp)) return false;
279
        if (customerAddressId != other.customerAddressId) return false;
280
        if (customerGstNumber == null) {
281
            if (other.customerGstNumber != null) return false;
282
        } else if (!customerGstNumber.equals(other.customerGstNumber)) return false;
283
        if (customerId != other.customerId) return false;
284
        if (dateOfBirth == null) {
285
            if (other.dateOfBirth != null) return false;
286
        } else if (!dateOfBirth.equals(other.dateOfBirth)) return false;
287
        if (fofoId != other.fofoId) return false;
288
        if (id != other.id) return false;
289
        if (invoiceNumber == null) {
290
            if (other.invoiceNumber != null) return false;
291
        } else if (!invoiceNumber.equals(other.invoiceNumber)) return false;
292
        if (orderItem == null) {
293
            if (other.orderItem != null) return false;
294
        } else if (!orderItem.equals(other.orderItem)) return false;
295
        if (Float.floatToIntBits(totalAmount) != Float.floatToIntBits(other.totalAmount)) return false;
296
        return true;
297
    }
298
 
299
    @Override
300
    public String toString() {
301
        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 + " ]";
302
    }
303
 
21596 ashik.ali 304
}