|
|
@@ -14,6 +14,7 @@ import java.util.Map;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.minpay.common.util.StringUtil;
|
|
|
import com.minpay.db.table.mapper.*;
|
|
|
import com.minpay.db.table.model.*;
|
|
|
@@ -396,22 +397,45 @@ public class ReportManageAction implements IMINAction {
|
|
|
DwBranchReportType branchReportType = db.selectByPrimaryKey(DwBranchReportTypeMapper.class, reportInf.getType());
|
|
|
|
|
|
DwReportData reportDataInf = db.selectByPrimaryKey(DwReportDataMapper.class, reportId);
|
|
|
-
|
|
|
- Map<String, Object> dataJSONMap = JSONObject.fromObject(reportDataInf.getData());
|
|
|
- List<List<String>> dataList = (List<List<String>>)dataJSONMap.get("excelList");
|
|
|
-
|
|
|
- String descStr = (String)dataJSONMap.get("descStr");
|
|
|
- descStr = descStr.replaceAll("<p>", "");
|
|
|
- descStr = descStr.replaceAll("</p>", System.getProperty("line.separator"));
|
|
|
- if (dataJSONMap.get("dataMap") != null) {
|
|
|
- Map<String, Object> dataMap = (Map<String, Object>)dataJSONMap.get("dataMap");
|
|
|
- for(Map.Entry<String, Object> entry : dataMap.entrySet()){
|
|
|
- String mapKey = entry.getKey();
|
|
|
- Object mapValue = entry.getValue();
|
|
|
- descStr = descStr.replaceAll("\\$\\{" + mapKey + "\\}", String.valueOf(mapValue));
|
|
|
+ Map<String, Object> dataJSONMap = new HashMap<String,Object>();
|
|
|
+ List<List<String>> dataList = new ArrayList<List<String>>();
|
|
|
+ String descStr = "";
|
|
|
+ try {
|
|
|
+ dataJSONMap = JSONObject.fromObject(reportDataInf.getData());//数据格式不对应
|
|
|
+ dataList = (List<List<String>>)dataJSONMap.get("excelList");
|
|
|
+ descStr = (String)dataJSONMap.get("descStr");
|
|
|
+ descStr = descStr.replaceAll("<p>", "");
|
|
|
+ descStr = descStr.replaceAll("</p>", System.getProperty("line.separator"));
|
|
|
+ if (dataJSONMap.get("dataMap") != null) {
|
|
|
+ Map<String, Object> dataMap = (Map<String, Object>)dataJSONMap.get("dataMap");
|
|
|
+ for(Map.Entry<String, Object> entry : dataMap.entrySet()){
|
|
|
+ String mapKey = entry.getKey();
|
|
|
+ Object mapValue = entry.getValue();
|
|
|
+ descStr = descStr.replaceAll("\\$\\{" + mapKey + "\\}", String.valueOf(mapValue));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e){
|
|
|
+ try {
|
|
|
+ String[][] temp = JSON.parseObject(reportDataInf.getData(),String[][].class);
|
|
|
+ String[] temp2 = null;
|
|
|
+ List<String> tempList = null;
|
|
|
+ if (temp != null) {
|
|
|
+ for (int i = 0; i < temp.length; i++) {
|
|
|
+ tempList = new ArrayList<String>();
|
|
|
+ temp2 = temp[i];
|
|
|
+ for (int j = 0; j < temp2.length; j++) {
|
|
|
+ tempList.add(temp2[j]);
|
|
|
+ }
|
|
|
+ dataList.add(tempList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception ee){
|
|
|
+ dataList = new ArrayList<List<String>>();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if( dataList == null){
|
|
|
+ dataList = new ArrayList<List<String>>();
|
|
|
+ }
|
|
|
// excel类型
|
|
|
if ("00".equals(branchReportType.getType())) {
|
|
|
//导出Excel
|
|
|
@@ -637,7 +661,10 @@ public class ReportManageAction implements IMINAction {
|
|
|
List<DwDdyFxb> ddyFxbList = db.selectByExample(DwDdyFxbMapper.class, ddyFxbExample, rows);
|
|
|
|
|
|
List<String> fxbIdList = CommonUtil.getIdFromList(ddyFxbList, "id");
|
|
|
-
|
|
|
+ if(fxbIdList == null || fxbIdList.isEmpty()){
|
|
|
+ fxbIdList = new ArrayList<String>();
|
|
|
+ fxbIdList.add("XXXXXXXX");
|
|
|
+ }
|
|
|
DwDdyFxbDetailExample ddyFxbDetailExample = new DwDdyFxbDetailExample();
|
|
|
ddyFxbDetailExample.createCriteria().andFxbIdIn(fxbIdList);
|
|
|
ddyFxbDetailExample.setOrderByClause("DDFD_FXB_ID");
|