提交 723b4a61 编写于 作者: Skyeye云's avatar Skyeye云

分析报告完成

上级 9a15ff17
此差异已折叠。
此差异已折叠。
......@@ -932,6 +932,57 @@ public class ToolUtil {
return dateStr;
}
/**
*
* @Title: removeTagFromText
* @Description: 过滤html内容
* @param @param htmlStr
* @param @return 参数
* @return String 返回类型
* @throws
*/
public static String removeTagFromText(String htmlStr) {
if (htmlStr == null || "".equals(htmlStr))
return "";
String textStr = "";
java.util.regex.Pattern pattern;
java.util.regex.Matcher matcher;
try {
String regEx_remark = "<!--.+?-->";
// 定义script的正则表达式{或<script[^>]*?>[\\s\\S]*?<\\/script>
String regEx_script = "<[\\s]*?script[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?script[\\s]*?>";
// 定义style的正则表达式{或<style[^>]*?>[\\s\\S]*?<\\/style>
String regEx_style = "<[\\s]*?style[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?style[\\s]*?>";
String regEx_html = "<[^>]+>"; // 定义HTML标签的正则表达式
String regEx_html1 = "<[^>]+";
htmlStr = htmlStr.replaceAll("\n", "");
htmlStr = htmlStr.replaceAll("\t", "");
htmlStr = htmlStr.replaceAll("\r", "");
pattern = Pattern.compile(regEx_remark);// 过滤注释标签
matcher = pattern.matcher(htmlStr);
htmlStr = matcher.replaceAll("");
pattern = Pattern.compile(regEx_script, Pattern.CASE_INSENSITIVE);
matcher = pattern.matcher(htmlStr);
htmlStr = matcher.replaceAll(""); // 过滤script标签
pattern = Pattern.compile(regEx_style, Pattern.CASE_INSENSITIVE);
matcher = pattern.matcher(htmlStr);
htmlStr = matcher.replaceAll(""); // 过滤style标签
pattern = Pattern.compile(regEx_html, Pattern.CASE_INSENSITIVE);
matcher = pattern.matcher(htmlStr);
htmlStr = matcher.replaceAll(""); // 过滤html标签
pattern = Pattern.compile(regEx_html1, Pattern.CASE_INSENSITIVE);
matcher = pattern.matcher(htmlStr);
htmlStr = matcher.replaceAll(""); // 过滤html标签
htmlStr = htmlStr.replaceAll("\n[\\s| ]*\r", "");
htmlStr = htmlStr.replaceAll("<(.*)>(.*)<\\/(.*)>|<(.*)\\/>", "");
textStr = htmlStr.trim();
} catch (Exception e) {
e.printStackTrace();
}
return textStr;// 返回文本字符串
}
public static void main(String[] args) throws Exception {
List<Map<String, Object>> data = new ArrayList<>();
Map<String, Object> map = new HashMap<>();
......
......@@ -157,5 +157,5 @@ public interface DwSurveyDirectoryDao {
public List<Map<String, Object>> queryScoreGroupStat(Map<String, Object> question) throws Exception;
public List<Map<String, Object>> queryOrderQuGroupStat(Map<String, Object> question) throws Exception;
}
......@@ -1346,8 +1346,11 @@ public class DwSurveyDirectoryServiceImpl implements DwSurveyDirectoryService{
}
for(Map<String, Object> row : rows){
row.put("anAllCount", count);
List<Map<String, Object>> columns = (List<Map<String, Object>>) row.get("questionChenColumn");
for(Map<String, Object> column : columns){
column.put("anChenRadios", beans);
}
}
question.put("anChenRadios", beans);
} else if (quType.equals(QuType.CHENFBK.getActionName())){//矩阵填空题
List<Map<String, Object>> beans = dwSurveyDirectoryDao.queryChenFbkGroupStat(question);
List<Map<String, Object>> rows = (List<Map<String, Object>>) question.get("questionChenRow");
......@@ -1363,8 +1366,11 @@ public class DwSurveyDirectoryServiceImpl implements DwSurveyDirectoryService{
}
for(Map<String, Object> row : rows){
row.put("anAllCount", count);
List<Map<String, Object>> columns = (List<Map<String, Object>>) row.get("questionChenColumn");
for(Map<String, Object> column : columns){
column.put("anChenFbks", beans);
}
}
question.put("anChenFbks", beans);
} else if(quType.equals(QuType.CHENCHECKBOX.getActionName())){//矩阵多选题
List<Map<String, Object>> beans = dwSurveyDirectoryDao.queryChenCheckBoxGroupStat(question);
List<Map<String, Object>> rows = (List<Map<String, Object>>) question.get("questionChenRow");
......@@ -1380,11 +1386,20 @@ public class DwSurveyDirectoryServiceImpl implements DwSurveyDirectoryService{
}
for(Map<String, Object> row : rows){
row.put("anAllCount", count);
List<Map<String, Object>> columns = (List<Map<String, Object>>) row.get("questionChenColumn");
for(Map<String, Object> column : columns){
column.put("anChenCheckboxs", beans);
}
}
question.put("anChenCheckboxs", beans);
} else if(quType.equals(QuType.CHENSCORE.getActionName())){//矩阵评分题
List<Map<String, Object>> beans = dwSurveyDirectoryDao.queryChenScoreGroupStat(question);
question.put("anChenScores", beans);
List<Map<String, Object>> rows = (List<Map<String, Object>>) question.get("questionChenRow");
for(Map<String, Object> row : rows){
List<Map<String, Object>> columns = (List<Map<String, Object>>) row.get("questionChenColumn");
for(Map<String, Object> column : columns){
column.put("anChenScores", beans);
}
}
}else if (quType.equals(QuType.SCORE.getActionName())) {//评分题
List<Map<String, Object>> beans = dwSurveyDirectoryDao.queryScoreGroupStat(question);
List<Map<String, Object>> scores = (List<Map<String, Object>>) question.get("quScores");
......@@ -1416,5 +1431,5 @@ public class DwSurveyDirectoryServiceImpl implements DwSurveyDirectoryService{
}
return question;
}
}
......@@ -1060,5 +1060,4 @@
sumOrderNum
</select>
</mapper>
\ No newline at end of file
......@@ -33,4 +33,6 @@ readCpu(); 读取CPU信息
listToTree(); 将JSONArray数组转为树状结构
javaBean2Map(); 实体类转map
randomStr(); 获取指定的随机值
removeTagFromText(); 过滤html内容
......@@ -47,6 +47,14 @@ layui.config({
}
});
hdb.registerHelper('compare8', function(v1, v2, v31, v4, options) {
if(v1 == v3 && v2 == v4){
return options.fn(this);
}else{
return options.inverse(this);
}
});
},
ajaxSendAfter:function(json){
......@@ -72,25 +80,17 @@ layui.config({
if(amchartdivId != null) {
var amchartdivObj = $("#" + amchartdivId);
if(!amchartdivObj[0]) {
var url = "${ctx}/da/survey-report!chartData.action";
var data = "quId=" + quId;
$.ajax({
url: url,
data: data,
type: "post",
success: function(msg) {
$("#amchart_" + quId).find(".higChartSvg").hide();
if(thClass.indexOf("linechart_pic") > 0) {
higLineChart(msg, quId);
} else if(thClass.indexOf("piechart_pic") > 0) {
higPieChart(msg, quId);
} else if(thClass.indexOf("barchart_pic") > 0) {
higBarChart(msg, quId);
} else if(thClass.indexOf("columnchart_pic") > 0) {
higColumnChart(msg, quId);
}
}
});
var msg = {};
$("#amchart_" + quId).find(".higChartSvg").hide();
if(thClass.indexOf("linechart_pic") > 0) {
higLineChart(msg, quId);
} else if(thClass.indexOf("piechart_pic") > 0) {
higPieChart(msg, quId);
} else if(thClass.indexOf("barchart_pic") > 0) {
higBarChart(msg, quId);
} else if(thClass.indexOf("columnchart_pic") > 0) {
higColumnChart(msg, quId);
}
} else {
$("#amchart_" + quId).find(".higChartSvg").hide();
amchartdivObj.show();
......@@ -121,7 +121,7 @@ layui.config({
if(charType === "Line") {
seriesType = 'line';
}
if(quType === "CHENRADIO" || quType === "CHENCHECKBOX" || quType === "CHENSCORE") {
if(quType === "11" || quType === "13" || quType === "18") {
if(charType === "PIE") {
seriesData = new Array();
var rowItemTrs = quItemBody.find(".rowItemTr");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册