}
public static List<String> getRule(Integer a) {
List<String> sbf = new ArrayList<String>();
int j = 4;
int b = 0;
int g = 0;
for (int i = 3; i > 0; i--) {
int aa = (int) Math.pow(2, i);
b = a % aa;
g = a / aa;
a = b;
if (g > 0) {
sbf.add(String.valueOf(j));
}
j--;
}
if (b > 0) {
sbf.add("1");
}
return sbf;
}
private List<LoggerSendMailVO> processCurTotalList(
LoggerSendMailVO sendMailVO, List<String> userDetails) {
List<LoggerSendMailVO> list = new ArrayList<LoggerSendMailVO>();
if (null == userDetails) { //超级管理管理员查询当前企业
list.addAll(sendLoggerService
.getSendLoggerList(sendMailVO));
return list;
}
int userDetailSzie = userDetails.size();
if (userDetailSzie == 1) {//超级管理管理员或管理员指定用户,或者用户平台查询
sendMailVO.setUserEmail(userDetails.get(0));
list.addAll(sendLoggerService
.getSendLoggerList(sendMailVO));
return list;
}
// 超过100个用户查询时,采取每次100个用户的分批处理
int totalPage = HelperUtil.getPageSize(userDetailSzie);
List<String> subUserDetails = new ArrayList<String>();
for (int i = 0; i < totalPage; i++) {
if (i == totalPage - 1) {
subUserDetails = userDetails.subList(i * 100,
userDetails.size());
} else {
subUserDetails = userDetails.subList(i * 100, (i + 1) * 100);
}
sendMailVO.setSearchEmails(subUserDetails);
list.addAll(sendLoggerService
.getSendLoggerList(sendMailVO));
}
return list;
}
private List<String> getModelsNoList(String modelName) {
List<String> list = new ArrayList<String>();
String modelNameAndLeft = modelName + "[";
Map<String, String[]> parasMap = getRequest().getParameterMap();
for (Entry<String, String[]> e : parasMap.entrySet()) {
String paraKey = e.getKey();
if (paraKey.startsWith(modelNameAndLeft)) {
String no = StringUtils.substringBetween(paraKey, modelNameAndLeft, "]");
if (!list.contains(no)) {
list.add(no);
}
}
}
//序号排序
Collections.sort(list,new Comparator<String>() {
@Override
public int compare(String o1,String o2) {
// TODO Auto-generated method stub
int v1 = Integer.parseInt(o1);
int v2 = Integer.parseInt(o2);
if (v1 < v2) {
return -1;
}else if (v1 > v2) {
return 1;
} else {
return 0;
}
}
} );
return list;
}