📄 reportbizimpl.java
字号:
package biz.report.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import web.condition.customers.CustomersCondition;
import web.condition.service.ServiceCondition;
import biz.basedata.IBaseDataBIZ;
import biz.customers.CustomerBiz;
import biz.lost.ILostBIZ;
import biz.report.IReportBIZ;
import biz.service.IServiceBIZ;
import dao.customers.IOrdersDAO;
import entity.BaseData;
import entity.Customers;
import entity.Lost;
public class ReportBIZImpl implements IReportBIZ {
IOrdersDAO odao = null;
CustomerBiz cbiz = null;
IBaseDataBIZ bbiz = null;
IServiceBIZ sbiz = null;
ILostBIZ lbiz =null;
public IOrdersDAO getOdao() {
return odao;
}
public void setOdao(IOrdersDAO odao) {
this.odao = odao;
}
/* (non-Javadoc)
* @see biz.report.impl.IReportBIZ#contributeAnalyse()
*/
public Map<Customers,String> contributeAnalyse(String name,String year){
List list = null;
String hql="select sum(o.goodsSumTotal) ,o.customers.customersId from Orders as o where 1=1 " ;
if(null!=year&&""!=year){
hql+=" and o.ordersDatetime > '"+year+"-01-01' and o.ordersDatetime<'"+year+"-12-31'";
}
if(null!=name&&""!=name){
hql+=" and o.customers.customersName like '"+name+"'";
}
hql+=" group by o.customers.customersId order by col_0_0_ desc";
list = odao.search(hql);
Map<Customers, String> map = new HashMap<Customers, String>();
for(int i=0;i<list.size();i++){
Object[] objs = (Object[])list.get(i);
Customers cus = cbiz.getById(Integer.valueOf(objs[1].toString()));
map.put(cus,objs[0].toString());
}
return map;
}
/* (non-Javadoc)
* @see biz.report.impl.IReportBIZ#composingAnalyse()
*/
public Map<Object,String> composingAnalyse(String type){
Map<Object,String> map =new HashMap<Object, String>(0);
CustomersCondition condition = new CustomersCondition();
if("Credits".equalsIgnoreCase(type)){
for(int i=1;i<=5;i++){
condition.setCustomersCredits(i);
int count = cbiz.getCount(condition);
StringBuffer star = new StringBuffer();
for(int j=0;j<i;j++){
star.append("★");
}
map.put(star, String.valueOf(count));
}
return map;
}
else if("Satisfaction".equalsIgnoreCase(type)){
for(int i=1;i<=5;i++){
condition.setCustomersSatisfaction(i);
int count = cbiz.getCount(condition);
map.put(i+"级满意度", String.valueOf(count));
}
return map;
}
else{
BaseData baseData = new BaseData();
baseData.setBaseTypeName("企业等级");
List data = bbiz.searchAllDataByCondition(baseData);
for(Object obj:data){
BaseData names = (BaseData)obj;
CustomersCondition cus = new CustomersCondition();
cus.setGrade(names.getBaseName());
int count = cbiz.getCount(cus);
map.put(names.getBaseName(), String.valueOf(count));
}
return map;
}
}
/* (non-Javadoc)
* @see biz.report.impl.IReportBIZ#serviceAnalyse()
*/
public Map<String,Integer> serviceAnalyse(String year){
Map<String,Integer> map = new HashMap<String, Integer>(0);
BaseData baseData = new BaseData();
baseData.setBaseTypeName("服务类型");
List datalist = bbiz.searchAllDataByCondition(baseData);
for(Object obj:datalist){
BaseData data = (BaseData)obj;
ServiceCondition condition = new ServiceCondition();
if(null!=year&&""!=year){
condition.setCreaterDatetimeStr(year);
}
condition.setType(data.getBaseName());
Integer count = sbiz.getCountOfServices(condition);
map.put(data.getBaseName(), count);
}
return map;
}
/* (non-Javadoc)
* @see biz.report.impl.IReportBIZ#lostAnalyse()
*/
public List lostAnalyse(Lost lost){
return lbiz.searchByCondition(lost);
}
public CustomerBiz getCbiz() {
return cbiz;
}
public void setCbiz(CustomerBiz cbiz) {
this.cbiz = cbiz;
}
public IBaseDataBIZ getBbiz() {
return bbiz;
}
public void setBbiz(IBaseDataBIZ bbiz) {
this.bbiz = bbiz;
}
public IServiceBIZ getSbiz() {
return sbiz;
}
public void setSbiz(IServiceBIZ sbiz) {
this.sbiz = sbiz;
}
public ILostBIZ getLbiz() {
return lbiz;
}
public void setLbiz(ILostBIZ lbiz) {
this.lbiz = lbiz;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -