|
|
|
@ -1,16 +1,22 @@
|
|
|
|
|
package com.foreverwin.mesnac.common.aspect;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
|
|
import com.foreverwin.mesnac.common.export.ColumnConvert;
|
|
|
|
|
import com.foreverwin.mesnac.common.export.DateConvert;
|
|
|
|
|
import com.foreverwin.mesnac.common.model.ExportTemplate;
|
|
|
|
|
import com.foreverwin.mesnac.common.service.ExportTemplateService;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.DateUtil;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
|
import com.foreverwin.modular.core.exception.BusinessException;
|
|
|
|
|
import com.foreverwin.modular.core.util.CommonMethods;
|
|
|
|
|
import com.foreverwin.modular.core.util.FrontPage;
|
|
|
|
|
import com.foreverwin.modular.core.util.SpringUtil;
|
|
|
|
|
import org.apache.commons.lang.time.DateFormatUtils;
|
|
|
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
|
|
import org.aspectj.lang.ProceedingJoinPoint;
|
|
|
|
@ -26,6 +32,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
@Aspect
|
|
|
|
@ -67,7 +74,7 @@ public class ExportAspect {
|
|
|
|
|
}//for
|
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
Object result = joinPoint.proceed(args);
|
|
|
|
|
JSONObject resultJson = JSON.parseObject(JSON.toJSONString(result));
|
|
|
|
|
JSONObject resultJson = JSON.parseObject(JSON.toJSONStringWithDateFormat(result, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat));
|
|
|
|
|
if (resultJson.get("data") instanceof List) {
|
|
|
|
|
List dataList = (List)resultJson.get("data");
|
|
|
|
|
exportData(exportCode, dataList, request, attributes.getResponse());
|
|
|
|
|