| 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 |
|
| 34390 |
tejus.loha |
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),sum(foi.quantity)) " + " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId join FofoLineItem fli on foi.id = fli.fofoOrderItemId JOIN Item i ON i.id = foi.itemId join ActivatedImei ai on " + " fli.serialNumber = ai.serialNumber where fo.createTimestamp between :startDate and :endDate and fo.fofoId = :fofoId and fo.cancelledTimestamp is null AND i.categoryId=10006 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 " +
|
| 34390 |
tejus.loha |
79 |
"GROUP BY i.catalogItemId"),
|
| 31860 |
tejbeer |
80 |
|
| 33873 |
ranu |
81 |
|
| 34390 |
tejus.loha |
82 |
@NamedQuery(name = "FofoOrder.selectValueOfActivatedImeisModelWise",
|
|
|
83 |
query = "select new com.spice.profitmandi.common.model.ActivatedImeisWithSellingPrice" +
|
|
|
84 |
"(fo.customerId,foi.brand,foi.modelNumber,foi.modelName, sum(CAST(foi.mop AS int)*foi.quantity),SUM(foi.quantity))" +
|
|
|
85 |
"FROM FofoOrder fo " +
|
|
|
86 |
"JOIN FofoOrderItem foi ON fo.id = foi.orderId " +
|
|
|
87 |
"join FofoLineItem fli on foi.id = fli.fofoOrderItemId " +
|
|
|
88 |
"JOIN Item i ON i.id = foi.itemId " +
|
|
|
89 |
"JOIN ActivatedImei ai on fli.serialNumber = ai.serialNumber " +
|
|
|
90 |
"WHERE " +
|
|
|
91 |
"fo.createTimestamp BETWEEN :startDate AND :endDate " +
|
|
|
92 |
"AND fo.fofoId = :fofoId " +
|
|
|
93 |
"AND foi.brand = :brand " +
|
|
|
94 |
"AND fo.cancelledTimestamp IS NULL " +
|
|
|
95 |
"AND i.categoryId = 10006 " +
|
|
|
96 |
"GROUP BY foi.modelNumber"
|
|
|
97 |
)
|
|
|
98 |
|
|
|
99 |
|
| 27579 |
tejbeer |
100 |
})
|
| 31860 |
tejbeer |
101 |
|
|
|
102 |
|
|
|
103 |
@NamedNativeQueries({
|
|
|
104 |
|
|
|
105 |
|
| 32044 |
tejbeer |
106 |
@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 |
107 |
|
|
|
108 |
|
| 32044 |
tejbeer |
109 |
@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"),
|
|
|
110 |
|
| 34384 |
ranu |
111 |
@NamedNativeQuery(name = "FofoOrder.getCatalogSoldQtyLastDaysByDate", query = "" +
|
|
|
112 |
" SELECT i.catalog_item_id,fo.fofo_id, i.model_number, SUM(foi.quantity) AS total_quantity_sold FROM fofo.fofo_order fo" +
|
|
|
113 |
" LEFT JOIN fofo.fofo_order_item foi ON foi.order_id = fo.id " +
|
|
|
114 |
" JOIN catalog.item i ON i.id = foi.item_id " +
|
|
|
115 |
" WHERE fo.fofo_id = :fofoId AND fo.create_timestamp >= :cutOffDate AND i.catalog_item_id IN (:catalogIds) " +
|
|
|
116 |
" GROUP BY i.catalog_item_id", resultSetMapping = "lastDaysSoldQtyByDateAndCatalogId"),
|
| 32044 |
tejbeer |
117 |
|
| 34384 |
ranu |
118 |
|
| 31860 |
tejbeer |
119 |
})
|
|
|
120 |
|
| 32044 |
tejbeer |
121 |
@SqlResultSetMappings({
|
|
|
122 |
|
| 34384 |
ranu |
123 |
@SqlResultSetMapping(name = "LastTertiaryDays", classes = {@ConstructorResult(targetClass = LastSaleDateModel.class, columns = {@ColumnResult(name = "fofo_id", type = Integer.class), @ColumnResult(name = "maxdate ", type = LocalDateTime.class)})}),
|
| 32044 |
tejbeer |
124 |
|
| 34384 |
ranu |
125 |
@SqlResultSetMapping(name = "lastDaysSoldQtyByDateAndCatalogId", classes = {
|
|
|
126 |
@ConstructorResult(targetClass = DateWiseSoldCatalogQtyModel.class, columns = {
|
|
|
127 |
@ColumnResult(name = "catalog_item_id", type = Integer.class),
|
|
|
128 |
@ColumnResult(name = "fofo_id", type = Integer.class),
|
|
|
129 |
@ColumnResult(name = "model_number", type = String.class),
|
|
|
130 |
@ColumnResult(name = "total_quantity_sold", type = Integer.class),
|
|
|
131 |
|
|
|
132 |
})}),
|
| 32044 |
tejbeer |
133 |
})
|
|
|
134 |
|
| 27579 |
tejbeer |
135 |
public class FofoOrder implements Serializable {
|
|
|
136 |
|
| 31860 |
tejbeer |
137 |
private static final long serialVersionUID = 1L;
|
| 21596 |
ashik.ali |
138 |
|
| 31860 |
tejbeer |
139 |
@Id
|
|
|
140 |
@Column(name = "id")
|
|
|
141 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
142 |
private int id;
|
| 27579 |
tejbeer |
143 |
|
| 34287 |
vikas.jang |
144 |
@Column(name = "pending_order_id")
|
|
|
145 |
private int pendingOrderId;
|
|
|
146 |
|
| 31860 |
tejbeer |
147 |
@Column(name = "fofo_id")
|
|
|
148 |
private int fofoId;
|
| 27579 |
tejbeer |
149 |
|
| 31860 |
tejbeer |
150 |
@Column(name = "customer_id")
|
|
|
151 |
private int customerId;
|
| 27579 |
tejbeer |
152 |
|
| 31860 |
tejbeer |
153 |
@Column(name = "customer_address_id")
|
|
|
154 |
private int customerAddressId;
|
| 27579 |
tejbeer |
155 |
|
| 31860 |
tejbeer |
156 |
@Column(name = "customer_gst_number")
|
|
|
157 |
private String customerGstNumber;
|
| 27579 |
tejbeer |
158 |
|
| 31860 |
tejbeer |
159 |
@Column(name = "total_amount")
|
|
|
160 |
private float totalAmount;
|
| 27579 |
tejbeer |
161 |
|
| 31860 |
tejbeer |
162 |
@Column(name = "invoice_number", length = 50)
|
|
|
163 |
private String invoiceNumber;
|
| 27579 |
tejbeer |
164 |
|
| 31860 |
tejbeer |
165 |
@Column(name = "cashback")
|
|
|
166 |
private float cashback;
|
| 27579 |
tejbeer |
167 |
|
| 31860 |
tejbeer |
168 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
169 |
@Column(name = "create_timestamp")
|
|
|
170 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
| 27579 |
tejbeer |
171 |
|
| 31860 |
tejbeer |
172 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
173 |
@Column(name = "cancelled_timestamp")
|
|
|
174 |
private LocalDateTime cancelledTimestamp;
|
| 27579 |
tejbeer |
175 |
|
| 31860 |
tejbeer |
176 |
// @Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
177 |
// @Column(name = "billing_timestamp")
|
|
|
178 |
@Transient
|
|
|
179 |
private LocalDateTime billingTimestamp;
|
| 27579 |
tejbeer |
180 |
|
| 31860 |
tejbeer |
181 |
@Transient
|
|
|
182 |
private FofoOrderItem orderItem;
|
| 27579 |
tejbeer |
183 |
|
| 31860 |
tejbeer |
184 |
@Transient
|
|
|
185 |
private LocalDate dateOfBirth;
|
| 27579 |
tejbeer |
186 |
|
|
|
187 |
|
| 31860 |
tejbeer |
188 |
public LocalDate getDateOfBirth() {
|
|
|
189 |
return dateOfBirth;
|
|
|
190 |
}
|
| 27579 |
tejbeer |
191 |
|
| 31860 |
tejbeer |
192 |
public void setDateOfBirth(LocalDate dateOfBirth) {
|
|
|
193 |
this.dateOfBirth = dateOfBirth;
|
|
|
194 |
}
|
| 27579 |
tejbeer |
195 |
|
| 31860 |
tejbeer |
196 |
public FofoOrderItem getOrderItem() {
|
|
|
197 |
return orderItem;
|
|
|
198 |
}
|
| 27579 |
tejbeer |
199 |
|
| 31860 |
tejbeer |
200 |
public void setOrderItem(FofoOrderItem orderItem) {
|
|
|
201 |
this.orderItem = orderItem;
|
|
|
202 |
}
|
| 27579 |
tejbeer |
203 |
|
| 31860 |
tejbeer |
204 |
public LocalDateTime getCancelledTimestamp() {
|
|
|
205 |
return cancelledTimestamp;
|
|
|
206 |
}
|
| 27579 |
tejbeer |
207 |
|
| 31860 |
tejbeer |
208 |
public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
|
|
|
209 |
this.cancelledTimestamp = cancelledTimestamp;
|
|
|
210 |
}
|
| 27579 |
tejbeer |
211 |
|
| 31860 |
tejbeer |
212 |
public int getId() {
|
|
|
213 |
return id;
|
|
|
214 |
}
|
| 27579 |
tejbeer |
215 |
|
| 31860 |
tejbeer |
216 |
public void setId(int id) {
|
|
|
217 |
this.id = id;
|
|
|
218 |
}
|
| 27579 |
tejbeer |
219 |
|
| 34287 |
vikas.jang |
220 |
public int getPendingOrderId() {
|
|
|
221 |
return pendingOrderId;
|
|
|
222 |
}
|
|
|
223 |
|
|
|
224 |
public void setPendingOrderId(int pendingOrderId) {
|
|
|
225 |
this.pendingOrderId = pendingOrderId;
|
|
|
226 |
}
|
|
|
227 |
|
| 31860 |
tejbeer |
228 |
public int getFofoId() {
|
|
|
229 |
return fofoId;
|
|
|
230 |
}
|
| 27579 |
tejbeer |
231 |
|
| 31860 |
tejbeer |
232 |
public void setFofoId(int fofoId) {
|
|
|
233 |
this.fofoId = fofoId;
|
|
|
234 |
}
|
| 27579 |
tejbeer |
235 |
|
| 31860 |
tejbeer |
236 |
public int getCustomerId() {
|
|
|
237 |
return customerId;
|
|
|
238 |
}
|
| 27579 |
tejbeer |
239 |
|
| 31860 |
tejbeer |
240 |
public void setCustomerId(int customerId) {
|
|
|
241 |
this.customerId = customerId;
|
|
|
242 |
}
|
| 27579 |
tejbeer |
243 |
|
| 31860 |
tejbeer |
244 |
public int getCustomerAddressId() {
|
|
|
245 |
return customerAddressId;
|
|
|
246 |
}
|
| 27579 |
tejbeer |
247 |
|
| 31860 |
tejbeer |
248 |
public void setCustomerAddressId(int customerAddressId) {
|
|
|
249 |
this.customerAddressId = customerAddressId;
|
|
|
250 |
}
|
| 27579 |
tejbeer |
251 |
|
| 31860 |
tejbeer |
252 |
public String getCustomerGstNumber() {
|
|
|
253 |
return customerGstNumber;
|
|
|
254 |
}
|
| 27579 |
tejbeer |
255 |
|
| 31860 |
tejbeer |
256 |
public void setCustomerGstNumber(String customerGstNumber) {
|
|
|
257 |
this.customerGstNumber = customerGstNumber;
|
|
|
258 |
}
|
| 27579 |
tejbeer |
259 |
|
| 31860 |
tejbeer |
260 |
public float getTotalAmount() {
|
|
|
261 |
return totalAmount;
|
|
|
262 |
}
|
| 27579 |
tejbeer |
263 |
|
| 31860 |
tejbeer |
264 |
public void setTotalAmount(float totalAmount) {
|
|
|
265 |
this.totalAmount = totalAmount;
|
|
|
266 |
}
|
| 27579 |
tejbeer |
267 |
|
| 31860 |
tejbeer |
268 |
public String getInvoiceNumber() {
|
|
|
269 |
return invoiceNumber;
|
|
|
270 |
}
|
| 27579 |
tejbeer |
271 |
|
| 31860 |
tejbeer |
272 |
public void setInvoiceNumber(String invoiceNumber) {
|
|
|
273 |
this.invoiceNumber = invoiceNumber;
|
|
|
274 |
}
|
| 27579 |
tejbeer |
275 |
|
| 31860 |
tejbeer |
276 |
public float getCashback() {
|
|
|
277 |
return cashback;
|
|
|
278 |
}
|
| 27579 |
tejbeer |
279 |
|
| 31860 |
tejbeer |
280 |
public void setCashback(float cashback) {
|
|
|
281 |
this.cashback = cashback;
|
|
|
282 |
}
|
| 27579 |
tejbeer |
283 |
|
| 31860 |
tejbeer |
284 |
public LocalDateTime getCreateTimestamp() {
|
|
|
285 |
return createTimestamp;
|
|
|
286 |
}
|
| 27579 |
tejbeer |
287 |
|
| 31860 |
tejbeer |
288 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
289 |
this.createTimestamp = createTimestamp;
|
|
|
290 |
}
|
| 27579 |
tejbeer |
291 |
|
| 31860 |
tejbeer |
292 |
public String getFormattedDate() {
|
|
|
293 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
|
|
|
294 |
return this.createTimestamp.format(formatter);
|
|
|
295 |
}
|
| 27579 |
tejbeer |
296 |
|
| 27586 |
tejbeer |
297 |
|
| 31860 |
tejbeer |
298 |
@Override
|
|
|
299 |
public int hashCode() {
|
|
|
300 |
final int prime = 31;
|
|
|
301 |
int result = 1;
|
|
|
302 |
result = prime * result + ((billingTimestamp == null) ? 0 : billingTimestamp.hashCode());
|
|
|
303 |
result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
|
|
|
304 |
result = prime * result + Float.floatToIntBits(cashback);
|
|
|
305 |
result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
|
|
|
306 |
result = prime * result + customerAddressId;
|
|
|
307 |
result = prime * result + ((customerGstNumber == null) ? 0 : customerGstNumber.hashCode());
|
|
|
308 |
result = prime * result + customerId;
|
|
|
309 |
result = prime * result + ((dateOfBirth == null) ? 0 : dateOfBirth.hashCode());
|
|
|
310 |
result = prime * result + fofoId;
|
|
|
311 |
result = prime * result + id;
|
|
|
312 |
result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
|
|
|
313 |
result = prime * result + ((orderItem == null) ? 0 : orderItem.hashCode());
|
|
|
314 |
result = prime * result + Float.floatToIntBits(totalAmount);
|
|
|
315 |
return result;
|
|
|
316 |
}
|
| 27586 |
tejbeer |
317 |
|
| 31860 |
tejbeer |
318 |
@Override
|
|
|
319 |
public boolean equals(Object obj) {
|
|
|
320 |
if (this == obj) return true;
|
|
|
321 |
if (obj == null) return false;
|
|
|
322 |
if (getClass() != obj.getClass()) return false;
|
|
|
323 |
FofoOrder other = (FofoOrder) obj;
|
|
|
324 |
if (billingTimestamp == null) {
|
|
|
325 |
if (other.billingTimestamp != null) return false;
|
|
|
326 |
} else if (!billingTimestamp.equals(other.billingTimestamp)) return false;
|
|
|
327 |
if (cancelledTimestamp == null) {
|
|
|
328 |
if (other.cancelledTimestamp != null) return false;
|
|
|
329 |
} else if (!cancelledTimestamp.equals(other.cancelledTimestamp)) return false;
|
|
|
330 |
if (Float.floatToIntBits(cashback) != Float.floatToIntBits(other.cashback)) return false;
|
|
|
331 |
if (createTimestamp == null) {
|
|
|
332 |
if (other.createTimestamp != null) return false;
|
|
|
333 |
} else if (!createTimestamp.equals(other.createTimestamp)) return false;
|
|
|
334 |
if (customerAddressId != other.customerAddressId) return false;
|
|
|
335 |
if (customerGstNumber == null) {
|
|
|
336 |
if (other.customerGstNumber != null) return false;
|
|
|
337 |
} else if (!customerGstNumber.equals(other.customerGstNumber)) return false;
|
|
|
338 |
if (customerId != other.customerId) return false;
|
|
|
339 |
if (dateOfBirth == null) {
|
|
|
340 |
if (other.dateOfBirth != null) return false;
|
|
|
341 |
} else if (!dateOfBirth.equals(other.dateOfBirth)) return false;
|
|
|
342 |
if (fofoId != other.fofoId) return false;
|
|
|
343 |
if (id != other.id) return false;
|
|
|
344 |
if (invoiceNumber == null) {
|
|
|
345 |
if (other.invoiceNumber != null) return false;
|
|
|
346 |
} else if (!invoiceNumber.equals(other.invoiceNumber)) return false;
|
|
|
347 |
if (orderItem == null) {
|
|
|
348 |
if (other.orderItem != null) return false;
|
|
|
349 |
} else if (!orderItem.equals(other.orderItem)) return false;
|
|
|
350 |
if (Float.floatToIntBits(totalAmount) != Float.floatToIntBits(other.totalAmount)) return false;
|
|
|
351 |
return true;
|
|
|
352 |
}
|
|
|
353 |
|
|
|
354 |
@Override
|
|
|
355 |
public String toString() {
|
|
|
356 |
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 + " ]";
|
|
|
357 |
}
|
|
|
358 |
|
| 21596 |
ashik.ali |
359 |
}
|