public class StatisticService extends Object implements IStatisticService
Modifier and Type | Field and Description |
---|---|
static String |
CONSTANT_GROUP_BY_DAY
The CONSTAN t_ grou p_ b y_ day.
|
static String |
CONSTANT_GROUP_BY_MONTH
The CONSTAN t_ grou p_ b y_ month.
|
static String |
CONSTANT_GROUP_BY_WEEK
The CONSTAN t_ grou p_ b y_ week.
|
static String |
EMPTY_STRING
The EMPT y_ string.
|
static String |
EXPORT_HEADER_DATE
The EXPOR t_ heade r_ date.
|
static String |
EXPORT_HEADER_GROUPE_DAY
The EXPOR t_ heade r_ group e_ day.
|
static String |
EXPORT_HEADER_GROUPE_MONTH
The EXPOR t_ heade r_ group e_ month.
|
static String |
EXPORT_HEADER_GROUPE_WEEK
The EXPOR t_ heade r_ group e_ week.
|
static String |
EXPORT_HEADER_NB_PRODUCTS
The EXPOR t_ heade r_ n b_ products.
|
Constructor and Description |
---|
StatisticService() |
Modifier and Type | Method and Description |
---|---|
static Timestamp |
addStatisticInterval(Timestamp timestamp,
String strTimesUnit,
int nDecal)
return a timestamp Object which correspond to the timestamp in parameter add with a number of times unit (day,week,month)specify in strTimesUnit .
|
static List<String[]> |
buildListToCSVWriter(Collection<ResultStatistic> listData,
String strTimesUnit,
Locale locale)
Converts the informations to export into a list of String[].
|
static org.jfree.chart.JFreeChart |
createXYGraph(List<ResultStatistic> listStatistic,
String strLabelX,
String strLableY,
String strTimesUnit)
create a JFreeChart Graph function of the statistic form submit.
|
void |
doManageProductSaving(ShowDTO productDTO)
Modifies a productStatistic
|
void |
doManagePurchaseSaving(ReservationDTO purchaseDTO)
Modifies a purchaseStatistic
|
void |
doRemoveProductStatisticByIdProduct(Integer nIdProduct)
remove all product statistic associated to the product identifier
|
void |
doRemovePurchaseStatisticByIdPurchase(Integer nIdPurchase)
remove all purchase statistic associated to the purchase identifier
|
Integer |
getCountProductALAffiche()
get the product showing count
|
Integer |
getCountProductAVenir()
get the product forthcoming count
|
Integer |
getCountProductsByDates(String strDateDebut,
String strDateFin)
get the products count by dates parameters
|
Integer |
getCountPurchaseOfDay()
get the purchase day count
|
Integer |
getCountPurchaseOfMonth()
get the purchase month count
|
Integer |
getCountPurchasesByDates(String strDateDebut,
String strDateFin)
get the purchase count by dates parameters.
|
List<ResultStatistic> |
getProductStatistic(String strTimesUnit,
String strDateDebut,
String strDateFin)
get a list of ResultStatistic containing all associations of date and number of product by parameters
|
List<ResultStatistic> |
getPurchaseStatistic(String strTimesUnit,
String strDateDebut,
String strDateFin)
get a list of ResultStatistic containing all associations of date and number of purchase by parameters
|
static boolean |
sameDate(Timestamp timestamp1,
Timestamp timestamp2,
String strTimesUnit)
Compare two timestamp and return true if they have the same times unit(Day,week,month).
|
public static final String CONSTANT_GROUP_BY_DAY
public static final String CONSTANT_GROUP_BY_WEEK
public static final String CONSTANT_GROUP_BY_MONTH
public static final String EXPORT_HEADER_DATE
public static final String EXPORT_HEADER_NB_PRODUCTS
public static final String EXPORT_HEADER_GROUPE_DAY
public static final String EXPORT_HEADER_GROUPE_WEEK
public static final String EXPORT_HEADER_GROUPE_MONTH
public static final String EMPTY_STRING
public static Timestamp addStatisticInterval(Timestamp timestamp, String strTimesUnit, int nDecal)
timestamp
- datestrTimesUnit
- (day,week,month)nDecal
- the number of timesUnitpublic static boolean sameDate(Timestamp timestamp1, Timestamp timestamp2, String strTimesUnit)
timestamp1
- timestamp1timestamp2
- timestamp2strTimesUnit
- (day,week,month)public void doManageProductSaving(ShowDTO productDTO)
doManageProductSaving
in interface IStatisticService
productDTO
- The product of the productStatistic to modify in databasepublic List<ResultStatistic> getProductStatistic(String strTimesUnit, String strDateDebut, String strDateFin)
getProductStatistic
in interface IStatisticService
strTimesUnit
- the time unitstrDateDebut
- the date beginstrDateFin
- teh date endpublic static org.jfree.chart.JFreeChart createXYGraph(List<ResultStatistic> listStatistic, String strLabelX, String strLableY, String strTimesUnit)
listStatistic
- the list of statistic of form submitstrLabelX
- the label of axis xstrLableY
- the label of axis xstrTimesUnit
- the times unit of axis x(Day,Week,Month)public Integer getCountProductsByDates(String strDateDebut, String strDateFin)
getCountProductsByDates
in interface IStatisticService
strDateDebut
- the date beginstrDateFin
- teh date endpublic static List<String[]> buildListToCSVWriter(Collection<ResultStatistic> listData, String strTimesUnit, Locale locale)
listData
- The list data to convertstrTimesUnit
- the str times unitlocale
- the localepublic void doManagePurchaseSaving(ReservationDTO purchaseDTO)
doManagePurchaseSaving
in interface IStatisticService
purchaseDTO
- The purchase of the purchaseStatistic to modify in databasepublic List<ResultStatistic> getPurchaseStatistic(String strTimesUnit, String strDateDebut, String strDateFin)
getPurchaseStatistic
in interface IStatisticService
strTimesUnit
- the time unitstrDateDebut
- the date beginstrDateFin
- teh date endpublic Integer getCountPurchasesByDates(String strDateDebut, String strDateFin)
getCountPurchasesByDates
in interface IStatisticService
strDateDebut
- the date beginstrDateFin
- the date endpublic Integer getCountProductALAffiche()
getCountProductALAffiche
in interface IStatisticService
public Integer getCountProductAVenir()
getCountProductAVenir
in interface IStatisticService
public Integer getCountPurchaseOfDay()
getCountPurchaseOfDay
in interface IStatisticService
public Integer getCountPurchaseOfMonth()
getCountPurchaseOfMonth
in interface IStatisticService
public void doRemoveProductStatisticByIdProduct(Integer nIdProduct)
doRemoveProductStatisticByIdProduct
in interface IStatisticService
nIdProduct
- the identifier of the productpublic void doRemovePurchaseStatisticByIdPurchase(Integer nIdPurchase)
doRemovePurchaseStatisticByIdPurchase
in interface IStatisticService
nIdPurchase
- the identifier of the productCopyright © 2020 City of Paris. All rights reserved.