Commit 6759745d by kangxiaoshan

1

parent 0388261e
......@@ -116,16 +116,16 @@ public class ContractController {
.append(c.getEndDate()).append(",")
.append(c.getPriceLevelName()).append(",")
.append(c.getMoney()).append(",")
.append(c.getPayMoney()).append(",")
// .append(c.getPayMoney()).append(",")
.append(CONTRACT_STATUS.get(c.getContractType())).append(",")
.append(CONTRACT_STATUS.get(c.getStatus())).append(",")
.append(c.getRelationCode()).append(",")
.append(c.getRelationCode() == null ? "" : c.getRelationCode()).append(",")
.append("\r\n");
}
}
String fileName = "合同管理(" + new DateTime(startDate).toString("yyyyMMdd")
+ "_" + new DateTime(endDate).toString("yyyyMMdd") + ").csv";
String fileName = "合同管理_" + new DateTime(startDate).toString("yyyyMMdd")
+ "_" + new DateTime(endDate).toString("yyyyMMdd") + ".csv";
this.exportWrite(fileName, sb.toString(), "合同管理", response);
// InputStream in = new ByteArrayInputStream(sb.toString().getBytes());
......@@ -189,22 +189,9 @@ public class ContractController {
titlebuffer.append("汇总, - , - , - , - , - , - ,").append(parseSum).append(" , - \r\n");
titlebuffer.append(sb);
String fileName = "收款开票(" + new DateTime(startDate).toString("yyyyMMdd")
+ "_" + new DateTime(endDate).toString("yyyyMMdd") + ").csv";
this.exportWrite(fileName, sb.toString(), "收款开票", response);
// InputStream in = new ByteArrayInputStream(titlebuffer.toString().getBytes());
// try {
// content = IOUtils.toByteArray(in);
// } catch (IOException e) {
// e.printStackTrace();
// }
// HttpHeaders headers = new HttpHeaders();
// response.setHeader("filename", "contract_pay.csv");
// response.setHeader("content-disposition", "attachment; filename=contract_pay.csv");
// // response.setHeader("Content-Type", "application/octet-stream;charset=UTF-8");
// response.setHeader("Content-Type", "text/csv");
// response.setContentType("APPLICATION/OCTET-STREAM");
String fileName = "收款开票_" + new DateTime(startDate).toString("yyyyMMdd")
+ "_" + new DateTime(endDate).toString("yyyyMMdd") + ".csv";
this.exportWrite(fileName, titlebuffer.toString(), "收款开票", response);
NewUserLogThread userlog = new NewUserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), platform, "导出收款开票", startDate, endDate, request, platform);
userlog.start();
......@@ -487,35 +474,10 @@ public class ContractController {
.append("\r\n");
}
}
String fileName = "分摊收入报表(" + new DateTime(startDate).toString("yyyyMMdd")
+ "_" + new DateTime(endDate).toString("yyyyMMdd") + ").csv";
String fileName = "分摊收入报表_" + new DateTime(startDate).toString("yyyyMMdd")
+ "_" + new DateTime(endDate).toString("yyyyMMdd") + ".csv";
this.exportWrite(fileName, sb.toString(), "分摊收入报表", response);
// OutputStream os = null;
// try {
// fileName = URLEncoder.encode(fileName, "UTF-8");
// response.setHeader("filename", fileName);
// response.setHeader("content-disposition", "attachment; filename=" + fileName);
// response.setHeader("Content-Type", "text/csv");
// response.setContentType("APPLICATION/OCTET-STREAM");
// response.setCharacterEncoding("UTF-8");
// os = response.getOutputStream();
// os.write(new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF});
// os.write(sb.toString().getBytes("UTF-8"));
// os.flush();
// } catch (Exception e) {
// logger.error("导出分摊收入报错", e);
// } finally {
// if (os != null) {
// try {
// os.close();
// } catch (IOException e) {
// logger.error("导出分摊收入关闭流报错", e);
// }
// }
// }
}
private void exportWrite(String fileName, String text, String exportName, HttpServletResponse response) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment