mmsuserstatisticsareaaction.java
来自「移动彩信管理平台」· Java 代码 · 共 175 行
JAVA
175 行
package com.my7g.zj.mobile.mms.web.action;
import java.util.List;
//import java.util.Map;
//import jxl.Workbook;
//import jxl.format.Alignment;
//import jxl.format.Border;
//import jxl.format.BorderLineStyle;
//import jxl.format.UnderlineStyle;
//import jxl.format.VerticalAlignment;
//import jxl.write.Formula;
//import jxl.write.Label;
//import jxl.write.WritableCellFormat;
//import jxl.write.WritableFont;
//import jxl.write.WritableSheet;
//import jxl.write.WritableWorkbook;
//import jxl.write.WriteException;
import com.my7g.zj.mobile.mms.bean.MmsSelectBean;
import com.my7g.zj.mobile.mms.bean.MmsUserStatisticsBean;
import com.my7g.zj.mobile.mms.bean.User;
import com.my7g.zj.mobile.mms.business.IMmsUserStatisticsService;
import com.my7g.zj.mobile.mms.sys.Constant;
import com.opensymphony.xwork2.ActionSupport;
//拦截session
//import org.apache.struts2.interceptor.SessionAware;
//import org.apache.struts2.interceptor.RequestAware;
//import org.apache.struts2.interceptor.ServletResponseAware;
public class MmsUserStatisticsAreaAction extends ActionSupport{
//**************所有request、session等属性及方法********************
/**
* 初次进入此页面调用此方法 只初始化下拉框
* */
public void firstExecute()
{
// 生成下拉框列表
mmsSelectBeanList_Area = immsUserStatistics.getAreaList();
// for(int i=0;i<mmsSelectBeanList_Area.size();i++)
// {
// System.out.println(mmsSelectBeanList_Area.get(i));
// }
}
/**
* 在此页面重复请求查询调用此方法
* */
public void otherExecute()
{
String userGroup = User.getUserInfo().getUsergroup();
//userGroup = "4";
//userID = "60";
// 生成判断语句
String conditions = selectArea;
if(conditions == null || conditions.equals("all"))
conditions = " ";
else
conditions = " and city_id = "+conditions;
// 生成下拉框列表
mmsSelectBeanList_Area = immsUserStatistics.getAreaList();
// 生成查询结果集
if(userGroup.equals(Constant.sUserType_CP))
mmsUserStatisticsBeanList_Area = immsUserStatistics.getUserStatisticsListFromHistory(conditions, endTime, 22);
else
mmsUserStatisticsBeanList_Area = immsUserStatistics.getUserStatisticsListFromHistory(conditions, endTime, 42);
// if(userGroup.equals(Constant.sUserType_CP))
// mmsUserStatisticsBeanList_Area = immsUserStatistics.getUserStatisticsList(conditions, endTime, 22);
// else
// mmsUserStatisticsBeanList_Area = immsUserStatistics.getUserStatisticsList(conditions, endTime, 42);
}
/**
* 将查询获得的结果保存为Excel
* */
public void createExcelExecute()
{
String userGroup = User.getUserInfo().getUsergroup();
//userGroup = "4";
//userID = "60";
// 生成判断语句
String conditions = selectArea;
if(conditions == null || conditions.equals("all"))
conditions = " ";
else
conditions = " and city_id = "+conditions;
// 生成下拉框列表
mmsSelectBeanList_Area = immsUserStatistics.getAreaList();
// 生成查询结果集
if(userGroup.equals(Constant.sUserType_CP))
mmsUserStatisticsBeanList_Area = immsUserStatistics.getUserStatisticsListFromHistory(conditions, endTime, 22);
else
mmsUserStatisticsBeanList_Area = immsUserStatistics.getUserStatisticsListFromHistory(conditions, endTime, 42);
// if(userGroup.equals(Constant.sUserType_CP))
// mmsUserStatisticsBeanList_Area = immsUserStatistics.getUserStatisticsList(conditions, endTime, 22);
// else
// mmsUserStatisticsBeanList_Area = immsUserStatistics.getUserStatisticsList(conditions, endTime, 42);
// 生成 Excel文件
// ...
}
//***************execute()方法************************************
@Override
public String execute() throws Exception {
if(argument == null)
argument = "first";
if(argument.equals("other"))
otherExecute();
else if(argument.equals("ourput"))
createExcelExecute();
else
firstExecute();
return SUCCESS;
}
//*****************业务属性及方法**************************************
IMmsUserStatisticsService immsUserStatistics;
List<MmsUserStatisticsBean> mmsUserStatisticsBeanList_Area;// 地市查询
List<MmsSelectBean> mmsSelectBeanList_Area;// 地市下拉框列表
public IMmsUserStatisticsService getImmsUserStatistics() {
return immsUserStatistics;
}
public void setImmsUserStatistics(IMmsUserStatisticsService immsUserStatistics) {
this.immsUserStatistics = immsUserStatistics;
}
public List<MmsUserStatisticsBean> getMmsUserStatisticsBeanList_Area() {
return mmsUserStatisticsBeanList_Area;
}
public void setMmsUserStatisticsBeanList_Area(
List<MmsUserStatisticsBean> mmsUserStatisticsBeanList_Area) {
this.mmsUserStatisticsBeanList_Area = mmsUserStatisticsBeanList_Area;
}
public List<MmsSelectBean> getMmsSelectBeanList_Area() {
return mmsSelectBeanList_Area;
}
public void setMmsSelectBeanList_Area(List<MmsSelectBean> mmsSelectBeanList_Area) {
this.mmsSelectBeanList_Area = mmsSelectBeanList_Area;
}
//******************页面数据属性及方法****************************************
String selectArea;
String argument;
String endTime;
public String getSelectArea() {
return selectArea;
}
public void setSelectArea(String selectArea) {
this.selectArea = selectArea;
}
public String getArgument() {
return argument;
}
public void setArgument(String argument) {
this.argument = argument;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?