📄 test.java
字号:
package com.NCL;
import java.io.*;
import java.sql.*;
import jxl.Sheet;
import jxl.Workbook;
import com.NCL.axis.*;
import com.NCL.axis.Batch.InvestJoinInsert;
import com.sinosoft.common.*;
import java.text.*;
import java.util.*;
import org.dom4j.Element;
import jxl.write.*;
public class test {
protected IndexMap propList;
protected HashSet Property;
private List strList = new ArrayList();
private boolean EOF = false;
private int COUNT;
public test(){
propList = new IndexMap();
Property = new HashSet();
Property.add("ID");
}
public boolean set(String name, Object value){
if(Property.contains(name)){
propList.put(name,value);
return true;
}else
return false;
}
public void setUpdateValue(String name,Object value){
if(this.set(name,value)){
Object[] uValue = new Object[2];
uValue[0] = name;
uValue[1] = value;
strList.add(uValue);
}
}
public String get(String name){
if (Property.contains(name)){
String value = (String)propList.get(name);
if(value != null && !value.equals(""))
return value;
else
return "";
}else
return "";
}
public int getCOUNT() {
return COUNT;
}
public void setCOUNT(int count) {
COUNT = count;
}
public boolean isEOF() {
return EOF;
}
public void setEOF(boolean eof) {
EOF = eof;
}
public void clear(){
propList.clear();
}
public static void getReport(){
List list = new ArrayList();
java.text.DecimalFormat df=new java.text.DecimalFormat("##0.00");
String[] str1a = {"3天之内","3-5天","5-7天","7-10天","10天以上"};
String[] str2 = {"办理手续上的复杂程度","办理时间长,效率比较低","非常满意无需改进","从未办理过"};
String[] str4 = {"公司直接邮寄","业务员亲自送达","自行网络打印","柜面自取等"};
String[] str5 = {"无法收到任何形式的续期缴费提醒","无法收到银行划款成功通知单","续期保费划转不成功未得到提醒","业务员离职后续服务人员无法及时跟上","非常满意无需改进","没有办理过此项业务"};
String[] str6 = {"1-3天","3-5天","5-10天"};
String[] str7 = {"短信问候","邮寄或上门递送有关公司咨询的资料","客户联谊现场活动","机票、酒店预订和商家打折服务","著名医院专家挂号及健康保健服务","全球急难救助服务"};
String[] str8 = {"拨打电话的接通率","话务人员解决问题的能力,如专业知识、对保险业务的熟悉程度","话务人员的服务态度和素质","非常满意无需改进","从未拨打过此电话"};
String[] str9 = {"柜面地理位置、大厅设施等","柜面人员服务态度和素质","业务办理程序和手续即办理时效","非常满意无需改进","从未去柜面办理过业务"};
String[] str10 = {"frennok"};
String word = "question2";
String[] str = str2;
DBAccess d = new DBAccess();
int num[] = new int[str.length];
int x = 0;
int total = 0;
StringBuffer sql = new StringBuffer("");
//计算
for(int i=0;i<str.length;i++){
sql = new StringBuffer("select t."+word+" from questionmessage t where t."+word+" like '%"+str[i]+"%'\n");
// System.out.println(sql.toString());
List l = d.parseSQL(sql.toString(), new ArrayList());
// System.out.println(l.size());
num[i] = l.size();
total += num[i];
}
//构造选项
sql = new StringBuffer("select t."+word+" from questionmessage t where t."+word+" is not null and t."+word+" !=';'\n");
List l = d.parseSQL(sql.toString(), new ArrayList());
for(int i=0;i<l.size();i++){
String tmp = (String)l.get(i);
tmp = tmp.replaceAll(";", "");
tmp = tmp.replaceAll(";", "");
for(int j=0;j<str.length;j++){
tmp = tmp.replaceAll(str[j], "");
}
if(!"".equals(tmp)){
x++;
tmp = (String)l.get(i);
for(int j=0;j<str.length;j++){
tmp = tmp.replaceAll(str[j]+";", "");
}
System.out.println(x+"=="+tmp);
list.add(tmp);
}
}
total += x;
// List l = d.parseSQL(sql.toString(), new ArrayList());
// for(int i=0;i<l.size();i++){
//
// }
//查找完全手填的项数
// sql = new StringBuffer("select t."+word+" from questionmessage t where t."+word+" not like '%"+str[0]+"%'\n");
// for(int i=1;i<str.length;i++){
// sql.append("and t."+word+" not like '%"+str[i]+"%'\n");
// }
// sql.append("and t."+word+" !=';'\n");
// System.out.println("完全手填的项数:\n"+sql.toString());
//输出结果
System.out.println("total="+total);
for(int i=0;i<num.length;i++){
System.out.print(str[i]+" ");
System.out.print(num[i]+" ");
System.out.println(df.format(num[i]*100/(double)total));
}
System.out.print("其他方面 ");
System.out.print(x+" ");
System.out.println(df.format(x*100/(double)total));
//生成excel
try{
OutputStream os = new FileOutputStream(new File("e:/kkk.xls"));
WritableWorkbook wwb = Workbook.createWorkbook(os);
WritableSheet ws = wwb.createSheet("test", 0);
for(int i=0;i<list.size();i++){
ws.addCell(new Label(0, i, (i+1)+""));
ws.addCell(new Label(1, i, (String)list.get(i)));
}
wwb.write();
wwb.close();
os.close();
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(String args[]){
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -