Subversion Repositories SmartDukaan

Rev

Rev 34287 | Rev 34390 | 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;
34384 ranu 4
import com.spice.profitmandi.dao.model.DateWiseSoldCatalogQtyModel;
33177 tejus.loha 5
import com.spice.profitmandi.dao.model.LastSaleDateModel;
6
 
7
import javax.persistence.*;
21596 ashik.ali 8
import java.io.Serializable;
25726 amit.gupta 9
import java.time.LocalDate;
21596 ashik.ali 10
import java.time.LocalDateTime;
22243 ashik.ali 11
import java.time.format.DateTimeFormatter;
21596 ashik.ali 12
 
13
@Entity
31860 tejbeer 14
@Table(name = "fofo.fofo_order")
21596 ashik.ali 15
 
27579 tejbeer 16
@NamedQueries({
17
 
31860 tejbeer 18
        @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 19
 
31860 tejbeer 20
        @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 21
 
31860 tejbeer 22
        @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 23
 
31860 tejbeer 24
        @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 25
 
31860 tejbeer 26
        @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 27
 
31860 tejbeer 28
        @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 29
 
31860 tejbeer 30
        @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 31
 
31860 tejbeer 32
        @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 33
 
31860 tejbeer 34
        @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 35
 
32906 amit.gupta 36
        @NamedQuery(name = "FofoOrder.selectSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel(" +
37
                "  fs.warehouseId, fs.id,i.catalogItemId, sum(case when foi.quantity is null then 0 else  foi.quantity end))" +
38
                " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  " +
39
                " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId " +
40
                " join Item i on i.id = tl.itemId" +
41
                " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate" +
42
                " and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId and  i.categoryId=10006 group by i.catalogItemId, fs.id"),
28474 tejbeer 43
 
31008 amit.gupta 44
 
32906 amit.gupta 45
        @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 46
                " 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 47
                " ca.city, ca.pinCode, fo.invoiceNumber, p.purchaseReference, fo.customerGstNumber, fo.cancelledTimestamp, p.completeTimestamp, hd.hygieneRating,hd.rating, hd.status, hd.remark," +
48
                " hd.createdTimestamp, hd.disposedTimestamp, hd.nextTimestamp, ai.activationTimestamp, ai.createTimestamp, c.label)" +
34121 ranu 49
                " 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 50
 
31860 tejbeer 51
        @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 52
 
34066 aman.kumar 53
        @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 54
 
31008 amit.gupta 55
 
31860 tejbeer 56
        @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 57
 
31860 tejbeer 58
        @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 59
 
31860 tejbeer 60
        @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 61
 
32906 amit.gupta 62
        //String sellerName, String hsnCode, String gstNumber, String stateName
63
        @NamedQuery(name = "FofoOrder.selectPartnerBillingSummaryReport", query = "select new com.spice.profitmandi.dao.model.PartnerBillingSummaryModel(o.id,  o.createTimestamp, o.billingTimestamp," +
64
                " o.deliveryTimestamp, o.partnerGrnTimestamp, o.transactionId, case when o.logisticsTransactionId is null then 'NA' else o.logisticsTransactionId end,o.airwayBillNumber,  " +
65
                " 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," +
66
                " l.igstRate, l.cgstRate, l.sgstRate, org.name, l.hsnCode,  s.gstin, state.name )" +
67
                " 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 68
                " 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 69
                " where 1=1 and  o.billingTimestamp between :startDate and :endDate and o.retailerId = :fofoId "),
31423 amit.gupta 70
 
33873 ranu 71
        @NamedQuery(name = "FofoOrder.soldAllItemByToday",
72
                query = "select new com.spice.profitmandi.dao.model.SoldAllCatalogitemQtyByPartnerModel" +
73
                        "(i.catalogItemId, foi.modelNumber, SUM(foi.quantity)) " +
74
                        "FROM FofoOrder fo " +
75
                        "JOIN FofoOrderItem foi ON fo.id = foi.orderId " +
76
                        "JOIN Item i ON foi.itemId = i.id " +
77
                        "JOIN Catalog c ON i.catalogItemId = c.id " +
78
                        "WHERE fo.createTimestamp BETWEEN :startOfDay AND :endOfDay and fo.fofoId = :fofoId " +
79
                        "GROUP BY i.catalogItemId")
31860 tejbeer 80
 
33873 ranu 81
 
27579 tejbeer 82
})
31860 tejbeer 83
 
84
 
85
@NamedNativeQueries({
86
 
87
 
32044 tejbeer 88
        @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 89
 
90
 
32044 tejbeer 91
        @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"),
92
 
34384 ranu 93
        @NamedNativeQuery(name = "FofoOrder.getCatalogSoldQtyLastDaysByDate", query = "" +
94
                " SELECT i.catalog_item_id,fo.fofo_id, i.model_number, SUM(foi.quantity) AS total_quantity_sold FROM fofo.fofo_order fo" +
95
                " LEFT JOIN fofo.fofo_order_item foi ON foi.order_id = fo.id " +
96
                " JOIN catalog.item i ON i.id = foi.item_id " +
97
                " WHERE fo.fofo_id = :fofoId AND fo.create_timestamp >= :cutOffDate AND i.catalog_item_id IN (:catalogIds) " +
98
                " GROUP BY i.catalog_item_id", resultSetMapping = "lastDaysSoldQtyByDateAndCatalogId"),
32044 tejbeer 99
 
34384 ranu 100
 
31860 tejbeer 101
})
102
 
32044 tejbeer 103
@SqlResultSetMappings({
104
 
34384 ranu 105
        @SqlResultSetMapping(name = "LastTertiaryDays", classes = {@ConstructorResult(targetClass = LastSaleDateModel.class, columns = {@ColumnResult(name = "fofo_id", type = Integer.class), @ColumnResult(name = "maxdate ", type = LocalDateTime.class)})}),
32044 tejbeer 106
 
34384 ranu 107
        @SqlResultSetMapping(name = "lastDaysSoldQtyByDateAndCatalogId", classes = {
108
                @ConstructorResult(targetClass = DateWiseSoldCatalogQtyModel.class, columns = {
109
                        @ColumnResult(name = "catalog_item_id", type = Integer.class),
110
                        @ColumnResult(name = "fofo_id", type = Integer.class),
111
                        @ColumnResult(name = "model_number", type = String.class),
112
                        @ColumnResult(name = "total_quantity_sold", type = Integer.class),
113
 
114
                })}),
32044 tejbeer 115
})
116
 
27579 tejbeer 117
public class FofoOrder implements Serializable {
118
 
31860 tejbeer 119
    private static final long serialVersionUID = 1L;
21596 ashik.ali 120
 
31860 tejbeer 121
    @Id
122
    @Column(name = "id")
123
    @GeneratedValue(strategy = GenerationType.IDENTITY)
124
    private int id;
27579 tejbeer 125
 
34287 vikas.jang 126
    @Column(name = "pending_order_id")
127
    private int pendingOrderId;
128
 
31860 tejbeer 129
    @Column(name = "fofo_id")
130
    private int fofoId;
27579 tejbeer 131
 
31860 tejbeer 132
    @Column(name = "customer_id")
133
    private int customerId;
27579 tejbeer 134
 
31860 tejbeer 135
    @Column(name = "customer_address_id")
136
    private int customerAddressId;
27579 tejbeer 137
 
31860 tejbeer 138
    @Column(name = "customer_gst_number")
139
    private String customerGstNumber;
27579 tejbeer 140
 
31860 tejbeer 141
    @Column(name = "total_amount")
142
    private float totalAmount;
27579 tejbeer 143
 
31860 tejbeer 144
    @Column(name = "invoice_number", length = 50)
145
    private String invoiceNumber;
27579 tejbeer 146
 
31860 tejbeer 147
    @Column(name = "cashback")
148
    private float cashback;
27579 tejbeer 149
 
31860 tejbeer 150
    @Convert(converter = LocalDateTimeAttributeConverter.class)
151
    @Column(name = "create_timestamp")
152
    private LocalDateTime createTimestamp = LocalDateTime.now();
27579 tejbeer 153
 
31860 tejbeer 154
    @Convert(converter = LocalDateTimeAttributeConverter.class)
155
    @Column(name = "cancelled_timestamp")
156
    private LocalDateTime cancelledTimestamp;
27579 tejbeer 157
 
31860 tejbeer 158
    // @Convert(converter = LocalDateTimeAttributeConverter.class)
159
    // @Column(name = "billing_timestamp")
160
    @Transient
161
    private LocalDateTime billingTimestamp;
27579 tejbeer 162
 
31860 tejbeer 163
    @Transient
164
    private FofoOrderItem orderItem;
27579 tejbeer 165
 
31860 tejbeer 166
    @Transient
167
    private LocalDate dateOfBirth;
27579 tejbeer 168
 
169
 
31860 tejbeer 170
    public LocalDate getDateOfBirth() {
171
        return dateOfBirth;
172
    }
27579 tejbeer 173
 
31860 tejbeer 174
    public void setDateOfBirth(LocalDate dateOfBirth) {
175
        this.dateOfBirth = dateOfBirth;
176
    }
27579 tejbeer 177
 
31860 tejbeer 178
    public FofoOrderItem getOrderItem() {
179
        return orderItem;
180
    }
27579 tejbeer 181
 
31860 tejbeer 182
    public void setOrderItem(FofoOrderItem orderItem) {
183
        this.orderItem = orderItem;
184
    }
27579 tejbeer 185
 
31860 tejbeer 186
    public LocalDateTime getCancelledTimestamp() {
187
        return cancelledTimestamp;
188
    }
27579 tejbeer 189
 
31860 tejbeer 190
    public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
191
        this.cancelledTimestamp = cancelledTimestamp;
192
    }
27579 tejbeer 193
 
31860 tejbeer 194
    public int getId() {
195
        return id;
196
    }
27579 tejbeer 197
 
31860 tejbeer 198
    public void setId(int id) {
199
        this.id = id;
200
    }
27579 tejbeer 201
 
34287 vikas.jang 202
    public int getPendingOrderId() {
203
        return pendingOrderId;
204
    }
205
 
206
    public void setPendingOrderId(int pendingOrderId) {
207
        this.pendingOrderId = pendingOrderId;
208
    }
209
 
31860 tejbeer 210
    public int getFofoId() {
211
        return fofoId;
212
    }
27579 tejbeer 213
 
31860 tejbeer 214
    public void setFofoId(int fofoId) {
215
        this.fofoId = fofoId;
216
    }
27579 tejbeer 217
 
31860 tejbeer 218
    public int getCustomerId() {
219
        return customerId;
220
    }
27579 tejbeer 221
 
31860 tejbeer 222
    public void setCustomerId(int customerId) {
223
        this.customerId = customerId;
224
    }
27579 tejbeer 225
 
31860 tejbeer 226
    public int getCustomerAddressId() {
227
        return customerAddressId;
228
    }
27579 tejbeer 229
 
31860 tejbeer 230
    public void setCustomerAddressId(int customerAddressId) {
231
        this.customerAddressId = customerAddressId;
232
    }
27579 tejbeer 233
 
31860 tejbeer 234
    public String getCustomerGstNumber() {
235
        return customerGstNumber;
236
    }
27579 tejbeer 237
 
31860 tejbeer 238
    public void setCustomerGstNumber(String customerGstNumber) {
239
        this.customerGstNumber = customerGstNumber;
240
    }
27579 tejbeer 241
 
31860 tejbeer 242
    public float getTotalAmount() {
243
        return totalAmount;
244
    }
27579 tejbeer 245
 
31860 tejbeer 246
    public void setTotalAmount(float totalAmount) {
247
        this.totalAmount = totalAmount;
248
    }
27579 tejbeer 249
 
31860 tejbeer 250
    public String getInvoiceNumber() {
251
        return invoiceNumber;
252
    }
27579 tejbeer 253
 
31860 tejbeer 254
    public void setInvoiceNumber(String invoiceNumber) {
255
        this.invoiceNumber = invoiceNumber;
256
    }
27579 tejbeer 257
 
31860 tejbeer 258
    public float getCashback() {
259
        return cashback;
260
    }
27579 tejbeer 261
 
31860 tejbeer 262
    public void setCashback(float cashback) {
263
        this.cashback = cashback;
264
    }
27579 tejbeer 265
 
31860 tejbeer 266
    public LocalDateTime getCreateTimestamp() {
267
        return createTimestamp;
268
    }
27579 tejbeer 269
 
31860 tejbeer 270
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
271
        this.createTimestamp = createTimestamp;
272
    }
27579 tejbeer 273
 
31860 tejbeer 274
    public String getFormattedDate() {
275
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
276
        return this.createTimestamp.format(formatter);
277
    }
27579 tejbeer 278
 
27586 tejbeer 279
 
31860 tejbeer 280
    @Override
281
    public int hashCode() {
282
        final int prime = 31;
283
        int result = 1;
284
        result = prime * result + ((billingTimestamp == null) ? 0 : billingTimestamp.hashCode());
285
        result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
286
        result = prime * result + Float.floatToIntBits(cashback);
287
        result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
288
        result = prime * result + customerAddressId;
289
        result = prime * result + ((customerGstNumber == null) ? 0 : customerGstNumber.hashCode());
290
        result = prime * result + customerId;
291
        result = prime * result + ((dateOfBirth == null) ? 0 : dateOfBirth.hashCode());
292
        result = prime * result + fofoId;
293
        result = prime * result + id;
294
        result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
295
        result = prime * result + ((orderItem == null) ? 0 : orderItem.hashCode());
296
        result = prime * result + Float.floatToIntBits(totalAmount);
297
        return result;
298
    }
27586 tejbeer 299
 
31860 tejbeer 300
    @Override
301
    public boolean equals(Object obj) {
302
        if (this == obj) return true;
303
        if (obj == null) return false;
304
        if (getClass() != obj.getClass()) return false;
305
        FofoOrder other = (FofoOrder) obj;
306
        if (billingTimestamp == null) {
307
            if (other.billingTimestamp != null) return false;
308
        } else if (!billingTimestamp.equals(other.billingTimestamp)) return false;
309
        if (cancelledTimestamp == null) {
310
            if (other.cancelledTimestamp != null) return false;
311
        } else if (!cancelledTimestamp.equals(other.cancelledTimestamp)) return false;
312
        if (Float.floatToIntBits(cashback) != Float.floatToIntBits(other.cashback)) return false;
313
        if (createTimestamp == null) {
314
            if (other.createTimestamp != null) return false;
315
        } else if (!createTimestamp.equals(other.createTimestamp)) return false;
316
        if (customerAddressId != other.customerAddressId) return false;
317
        if (customerGstNumber == null) {
318
            if (other.customerGstNumber != null) return false;
319
        } else if (!customerGstNumber.equals(other.customerGstNumber)) return false;
320
        if (customerId != other.customerId) return false;
321
        if (dateOfBirth == null) {
322
            if (other.dateOfBirth != null) return false;
323
        } else if (!dateOfBirth.equals(other.dateOfBirth)) return false;
324
        if (fofoId != other.fofoId) return false;
325
        if (id != other.id) return false;
326
        if (invoiceNumber == null) {
327
            if (other.invoiceNumber != null) return false;
328
        } else if (!invoiceNumber.equals(other.invoiceNumber)) return false;
329
        if (orderItem == null) {
330
            if (other.orderItem != null) return false;
331
        } else if (!orderItem.equals(other.orderItem)) return false;
332
        if (Float.floatToIntBits(totalAmount) != Float.floatToIntBits(other.totalAmount)) return false;
333
        return true;
334
    }
335
 
336
    @Override
337
    public String toString() {
338
        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 + " ]";
339
    }
340
 
21596 ashik.ali 341
}