| Line 17... |
Line 17... |
| 17 |
* @author ashikali
|
17 |
* @author ashikali
|
| 18 |
*/
|
18 |
*/
|
| 19 |
|
19 |
|
| 20 |
@Entity
|
20 |
@Entity
|
| 21 |
@Table(name = "transaction.`order`", schema = "transaction")
|
21 |
@Table(name = "transaction.`order`", schema = "transaction")
|
| 22 |
@NamedQueries({@NamedQuery(name = "Order.selectAll", query = "select o from Order o"),
|
22 |
@NamedQueries({ @NamedQuery(name = "Order.selectAll", query = "select o from Order o"),
|
| 23 |
@NamedQuery(name = "Order.selectById", query = "select o from Order o where o.id= :id"),
|
23 |
@NamedQuery(name = "Order.selectById", query = "select o from Order o where o.id= :id"),
|
| 24 |
@NamedQuery(name = "Order.selectByTransactionId", query = "select t.id, t.createTimestamp, o.retailerAddress1, o.retailerAddress2, o.retailerCity, "
|
24 |
@NamedQuery(name = "Order.selectByTransactionId", query = "select t.id, t.createTimestamp, o.retailerAddress1, o.retailerAddress2, o.retailerCity, "
|
| 25 |
+ "o.retailerPinCode, o.retailerState, o.shippingCost, o.statusDescription, o.invoiceNumber, o.airwayBillNumber, o.totalAmount, li.brand, li.modelName, "
|
25 |
+ "o.retailerPinCode, o.retailerState, o.shippingCost, o.statusDescription, o.invoiceNumber, o.airwayBillNumber, o.totalAmount, li.brand, li.modelName, "
|
| 26 |
+ "li.modelNumber, li.color, li.quantity, li.unitPrice, p.id, p.name, o.shippingTimestamp, o.status, o.promisedDeliveryTime, o.retailerName, t.status, i.catalogItemId from Transaction t join Order o on o.transactionId = t.id "
|
26 |
+ "li.modelNumber, li.color, li.quantity, li.unitPrice, p.id, p.name, o.shippingTimestamp, o.status, o.promisedDeliveryTime, o.retailerName, t.status, i.catalogItemId from Transaction t join Order o on o.transactionId = t.id "
|
| 27 |
+ "join LineItem li on li.orderId = o.id left join Provider p on p.id = o.logisticsProviderId join Item i on i.id=li.itemId where o.transactionId = :transactionId"),
|
27 |
+ "join LineItem li on li.orderId = o.id left join Provider p on p.id = o.logisticsProviderId join Item i on i.id=li.itemId where o.transactionId = :transactionId"),
|
| Line 100... |
Line 100... |
| 100 |
+ " join LineItem li on o.id = li.orderId " + " join TagListing tl on tl.itemId = li.itemId "
|
100 |
+ " join LineItem li on o.id = li.orderId " + " join TagListing tl on tl.itemId = li.itemId "
|
| 101 |
+ " join Item i on i.id = tl.itemId where "
|
101 |
+ " join Item i on i.id = tl.itemId where "
|
| 102 |
+ " fs.active = 1 and fs.internal = 0 and o.status in (3,4) and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
|
102 |
+ " fs.active = 1 and fs.internal = 0 and o.status in (3,4) and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
|
| 103 |
|
103 |
|
| 104 |
@NamedQuery(name = "Order.selectFirstBilling", query = "select new com.spice.profitmandi.dao.model.FofoFirstBillingModel(fs.id, min(o.billingTimestamp) )"
|
104 |
@NamedQuery(name = "Order.selectFirstBilling", query = "select new com.spice.profitmandi.dao.model.FofoFirstBillingModel(fs.id, min(o.billingTimestamp) )"
|
| 105 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
105 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId" + " group by fs.id"),
|
| 106 |
+ " group by fs.id"),
|
- |
|
| 107 |
|
106 |
|
| 108 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
107 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
| 109 |
+ " fs.warehouseId,fs.id,sum(li.quantity ),i.brand,i.modelName,i.modelNumber,i.catalogItemId) from FofoStore fs join Order o on fs.id = o.retailerId "
|
108 |
+ " fs.warehouseId,fs.id,sum(li.quantity ),i.brand,i.modelName,i.modelNumber,i.catalogItemId) from FofoStore fs join Order o on fs.id = o.retailerId "
|
| 110 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
109 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
| 111 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
110 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
| Line 182... |
Line 181... |
| 182 |
+ " sum(case when po.name = 'SAMSUNG SURE' then cast(pot.amount As int) else 0 end),sum(cast(pot.amount As int)))"
|
181 |
+ " sum(case when po.name = 'SAMSUNG SURE' then cast(pot.amount As int) else 0 end),sum(cast(pot.amount As int)))"
|
| 183 |
+ " from PaymentOptionTransaction pot join PaymentOption po on pot.paymentOptionId=po.id join com.spice.profitmandi.dao.entity.user.User u on u.id=pot.fofoId"
|
182 |
+ " from PaymentOptionTransaction pot join PaymentOption po on pot.paymentOptionId=po.id join com.spice.profitmandi.dao.entity.user.User u on u.id=pot.fofoId"
|
| 184 |
+ " join Address a on a.id=u.addressId where 1=1 and pot.fofoId = :fofoId and pot.createTimestamp between :startDate and :endDate "
|
183 |
+ " join Address a on a.id=u.addressId where 1=1 and pot.fofoId = :fofoId and pot.createTimestamp between :startDate and :endDate "
|
| 185 |
+ " group by (pot.createTimestamp), pot.referenceType "),
|
184 |
+ " group by (pot.createTimestamp), pot.referenceType "),
|
| 186 |
|
185 |
|
| 187 |
|
- |
|
| 188 |
})
|
186 |
})
|
| 189 |
//@NamedNativeQuery(name = "Order.findByEmailAddress", query = "select * from transaction.`order` o where o.id = '1694173'", resultClass = Order.class)
|
187 |
//@NamedNativeQuery(name = "Order.findByEmailAddress", query = "select * from transaction.`order` o where o.id = '1694173'", resultClass = Order.class)
|
| 190 |
|
188 |
|
| 191 |
|
- |
|
| 192 |
@NamedNativeQueries({
|
189 |
@NamedNativeQueries({
|
| 193 |
|
190 |
|
| 194 |
@NamedNativeQuery(name = "selectPartnerSecondaryGroupByBrand", query = "select ifnull(a.customer_id,fs.id) as id,ifnull(a.sb,brand) as brand,a.secondary_plan,sum(a.total_price) as total_price,a.auth_id, a.commited_timestamp from "
|
191 |
@NamedNativeQuery(name = "selectPartnerSecondaryGroupByBrand", query = "select ifnull(a.customer_id,fs.id) as id,ifnull(a.sb,brand) as brand,a.secondary_plan,sum(a.total_price) as total_price,a.auth_id, a.commited_timestamp from "
|
| 195 |
+ "fofo.fofo_store fs left join (select o.customer_id , li.brand as sb, li.total_price, psp.fofo_id , psp.brand, psp.secondary_plan,psp.auth_id,psp.commited_timestamp from transaction.`order` o join transaction.lineitem li on "
|
192 |
+ "fofo.fofo_store fs left join (select o.customer_id , li.brand as sb, li.total_price, psp.fofo_id , psp.brand, psp.secondary_plan,psp.auth_id,psp.commited_timestamp from transaction.`order` o join transaction.lineitem li on "
|
| 196 |
+ "(o.id = li.order_id) left join auth.partner_secondary_plan psp on (psp.fofo_id = o.customer_id and date(psp.commited_timestamp) >= :startDate and "
|
193 |
+ "(o.id = li.order_id) left join auth.partner_secondary_plan psp on (psp.fofo_id = o.customer_id and date(psp.commited_timestamp) >= :startDate and "
|
| Line 205... |
Line 202... |
| 205 |
+ " from transaction.price_drop pd join transaction.price_drop_imei pdi on pdi.price_drop_id = pd.id join (select catalog_item_id, brand, model_name, model_number from catalog.item group by catalog_item_id )"
|
202 |
+ " from transaction.price_drop pd join transaction.price_drop_imei pdi on pdi.price_drop_id = pd.id join (select catalog_item_id, brand, model_name, model_number from catalog.item group by catalog_item_id )"
|
| 206 |
+ " ci on ci.catalog_item_id=pd.catalog_id join fofo.fofo_store fs on fs.id=pdi.retailer_id where pdi.retailer_id = :fofoId and pd.affected_on between :startDate and :endDate and pd.amount > 0;", resultSetMapping = "PriceDropReportModel")
|
203 |
+ " ci on ci.catalog_item_id=pd.catalog_id join fofo.fofo_store fs on fs.id=pdi.retailer_id where pdi.retailer_id = :fofoId and pd.affected_on between :startDate and :endDate and pd.amount > 0;", resultSetMapping = "PriceDropReportModel")
|
| 207 |
|
204 |
|
| 208 |
})
|
205 |
})
|
| 209 |
|
206 |
|
| 210 |
|
- |
|
| 211 |
@SqlResultSetMappings({
|
207 |
@SqlResultSetMappings({
|
| 212 |
|
208 |
|
| 213 |
@SqlResultSetMapping(name = "partnerSecondaryPlanModel", classes = {
|
209 |
@SqlResultSetMapping(name = "partnerSecondaryPlanModel", classes = {
|
| 214 |
@ConstructorResult(targetClass = PartnerSecondaryPlanModel.class, columns = {
|
210 |
@ConstructorResult(targetClass = PartnerSecondaryPlanModel.class, columns = {
|
| - |
|
211 |
@ColumnResult(name = "id", type = Integer.class),
|
| 215 |
@ColumnResult(name = "id", type = Integer.class), @ColumnResult(name = "brand", type = String.class),
|
212 |
@ColumnResult(name = "brand", type = String.class),
|
| 216 |
@ColumnResult(name = "secondary_plan", type = Long.class),
|
213 |
@ColumnResult(name = "secondary_plan", type = Long.class),
|
| 217 |
@ColumnResult(name = "total_price", type = Long.class),
|
214 |
@ColumnResult(name = "total_price", type = Long.class),
|
| 218 |
@ColumnResult(name = "auth_id", type = Integer.class),
|
215 |
@ColumnResult(name = "auth_id", type = Integer.class),
|
| 219 |
@ColumnResult(name = "commited_timestamp", type = LocalDateTime.class)})}),
|
216 |
@ColumnResult(name = "commited_timestamp", type = LocalDateTime.class) }) }),
|
| 220 |
|
217 |
|
| 221 |
@SqlResultSetMapping(name = "PriceDropReportModel", classes = {
|
218 |
@SqlResultSetMapping(name = "PriceDropReportModel", classes = {
|
| 222 |
@ConstructorResult(targetClass = PriceDropReportModel.class, columns = {
|
219 |
@ConstructorResult(targetClass = PriceDropReportModel.class, columns = {
|
| 223 |
@ColumnResult(name = "code", type = String.class),
|
220 |
@ColumnResult(name = "code", type = String.class),
|
| 224 |
@ColumnResult(name = "id", type = Integer.class),
|
221 |
@ColumnResult(name = "id", type = Integer.class),
|
| Line 229... |
Line 226... |
| 229 |
@ColumnResult(name = "amount", type = Float.class),
|
226 |
@ColumnResult(name = "amount", type = Float.class),
|
| 230 |
@ColumnResult(name = "partner_payout", type = Float.class),
|
227 |
@ColumnResult(name = "partner_payout", type = Float.class),
|
| 231 |
@ColumnResult(name = "imei", type = String.class),
|
228 |
@ColumnResult(name = "imei", type = String.class),
|
| 232 |
@ColumnResult(name = "status", type = String.class),
|
229 |
@ColumnResult(name = "status", type = String.class),
|
| 233 |
@ColumnResult(name = "update_timestamp", type = LocalDateTime.class),
|
230 |
@ColumnResult(name = "update_timestamp", type = LocalDateTime.class),
|
| 234 |
@ColumnResult(name = "rejection_reason", type = String.class),
|
231 |
@ColumnResult(name = "rejection_reason", type = String.class), }) })
|
| 235 |
})})
|
- |
|
| 236 |
|
232 |
|
| 237 |
})
|
233 |
})
|
| 238 |
|
234 |
|
| 239 |
public class Order implements Serializable {
|
235 |
public class Order implements Serializable {
|
| 240 |
|
236 |
|
| Line 534... |
Line 530... |
| 534 |
private Float shippingRefund;
|
530 |
private Float shippingRefund;
|
| 535 |
|
531 |
|
| 536 |
@Column(name = "irn_generated")
|
532 |
@Column(name = "irn_generated")
|
| 537 |
private Boolean irnGenerated;
|
533 |
private Boolean irnGenerated;
|
| 538 |
|
534 |
|
| - |
|
535 |
@Column(name = "shipment_hold")
|
| - |
|
536 |
private Boolean shipmentHold;
|
| - |
|
537 |
|
| 539 |
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
538 |
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
| 540 |
@JoinColumn(name = "id", insertable = false, updatable = false, nullable = false, referencedColumnName = "order_id")
|
539 |
@JoinColumn(name = "id", insertable = false, updatable = false, nullable = false, referencedColumnName = "order_id")
|
| 541 |
private LineItem lineItem;
|
540 |
private LineItem lineItem;
|
| 542 |
|
541 |
|
| 543 |
public Integer getId() {
|
542 |
public Integer getId() {
|
| Line 846... |
Line 845... |
| 846 |
|
845 |
|
| 847 |
public void setSerialNumber(Integer serialNumber) {
|
846 |
public void setSerialNumber(Integer serialNumber) {
|
| 848 |
this.serialNumber = serialNumber;
|
847 |
this.serialNumber = serialNumber;
|
| 849 |
}
|
848 |
}
|
| 850 |
|
849 |
|
| - |
|
850 |
public Boolean getShipmentHold() {
|
| - |
|
851 |
return shipmentHold;
|
| - |
|
852 |
}
|
| - |
|
853 |
|
| - |
|
854 |
public void setShipmentHold(Boolean shipmentHold) {
|
| - |
|
855 |
this.shipmentHold = shipmentHold;
|
| - |
|
856 |
}
|
| - |
|
857 |
|
| 851 |
public Boolean isDoaFlag() {
|
858 |
public Boolean isDoaFlag() {
|
| 852 |
return doaFlag;
|
859 |
return doaFlag;
|
| 853 |
}
|
860 |
}
|
| 854 |
|
861 |
|
| 855 |
public void setDoaFlag(Boolean doaFlag) {
|
862 |
public void setDoaFlag(Boolean doaFlag) {
|