Commit 410c74c6 authored by Administrator's avatar Administrator

修改了下载交接单的方法

parent ecddba2d
...@@ -29,6 +29,8 @@ import java.text.ParseException; ...@@ -29,6 +29,8 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import static java.lang.Integer.*;
/** /**
* @author Administrator * @author Administrator
*/ */
...@@ -291,7 +293,7 @@ public class UserApi { ...@@ -291,7 +293,7 @@ public class UserApi {
public String findFailedinfo(@RequestParam("id") String id, HttpServletResponse resp) { public String findFailedinfo(@RequestParam("id") String id, HttpServletResponse resp) {
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
List<Map<String, Object>> maps = failedCardService.selectFailedinfo(Integer.valueOf(id)); List<Map<String, Object>> maps = failedCardService.selectFailedinfo(valueOf(id));
yxjsonResponse.outPutSuccess(maps + "------添加成功---" + maps.size()); yxjsonResponse.outPutSuccess(maps + "------添加成功---" + maps.size());
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
...@@ -306,7 +308,7 @@ public class UserApi { ...@@ -306,7 +308,7 @@ public class UserApi {
public String findProductionTaskListByState(@RequestParam("state") String state, HttpServletResponse resp) { public String findProductionTaskListByState(@RequestParam("state") String state, HttpServletResponse resp) {
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
List<Map<String, Object>> productionTaskInfoList = taskService.findProductionTaskListEntityByState(Integer.valueOf(state)); List<Map<String, Object>> productionTaskInfoList = taskService.findProductionTaskListEntityByState(valueOf(state));
yxjsonResponse.outPutSuccess(productionTaskInfoList); yxjsonResponse.outPutSuccess(productionTaskInfoList);
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
...@@ -611,228 +613,290 @@ public class UserApi { ...@@ -611,228 +613,290 @@ public class UserApi {
return null; return null;
} }
// /** /**
// * 下载交接单 * 下载交接单
// */ */
// @RequestMapping("printConnectList") @RequestMapping("printReceiptList")
//// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
// public byte[] printConnectList(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, HttpServletResponse response) { public byte[] printConnectList(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, HttpServletResponse response) {
//// cyclesheetID ="20180802032"; // cyclesheetID ="20180802032";
// response.setContentType("application/x-download"); response.setContentType("application/x-download");
// response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
// String dateTime = DateFormatUtils.format(new Date(), "yyyyMMddHH"); String dateTime = DateFormatUtils.format(new Date(), "yyyyMMddHH");
//// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件 // //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
// String fout = null; String fout = null;
// List<ReceiptListEntity> receiptListEntity = receiptListService.getReceiptList(startDate,endDate); List<ReceiptListEntity> receiptListEntity = receiptListService.getReceiptList(startDate,endDate);
// fout = receiptListExcel(receiptListEntity, receiptListEntity.get(0).getXiaoJi() + "", 6000, receiptListEntity.get(0).getBoxCount(), dateTime, startDate, endDate); fout = receiptListExcel(receiptListEntity, receiptListEntity.get(0).getXiaoJi() + "", 6000, receiptListEntity.get(0).getBoxCount(),receiptListEntity.get(0).getCountyName(), dateTime, startDate, endDate);
// String outFile = dateTime + "二代身份证交接单"; String outFile = dateTime + "二代身份证交接单";
// try { try {
// FileInputStream fis = new FileInputStream(new File(fout)); FileInputStream fis = new FileInputStream(new File(fout));
// byte[] b = new byte[fis.available()]; byte[] b = new byte[fis.available()];
// fis.read(b); fis.read(b);
// fis.close(); fis.close();
// response.addHeader("Content-Disposition", "attachment;filename=" + outFile + ".xls"); response.addHeader("Content-Disposition", "attachment;filename=" + outFile + ".xls");
// return b; return b;
// } catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
// e.printStackTrace(); e.printStackTrace();
// } catch (IOException e) { } catch (IOException e) {
// e.printStackTrace(); e.printStackTrace();
// } }
// return null; return null;
// } }
//
// /** /**
// * 下载交接单 * 下载交接单
// * *
// * @param receiptListEntity 交接单信息 * @param countyName 区县名称
// * @param typeName 制证类型 * @param receiptListEntity 交接单信息
// * @param sum 总数 * @param typeName 制证类型
// * @param boxCount 区县代码 * @param sum 总数
// * @param countyName 区县名称 * @param boxCount 区县代码
// */ */
// private String receiptListExcel( List<ReceiptListEntity> receiptListEntity, String typeName, int sum, String boxCount, String dateTime, String startDate ,String endDate) { private String receiptListExcel( List<ReceiptListEntity> receiptListEntity, String typeName, int sum , long boxCount, String countyName, String dateTime, String startDate , String endDate) {
// if (typeName.contains("null")) { if (typeName.contains("null")) {
// typeName = typeName.replace("null", ""); typeName = typeName.replace("null", "");
// } }
// //第一步创建workbook //第一步创建workbook
// HSSFWorkbook wb = new HSSFWorkbook(); HSSFWorkbook wb = new HSSFWorkbook();
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
// HSSFSheet sheet = wb.createSheet("二代身份证交接单"); HSSFSheet sheet = wb.createSheet("二代身份证交接单");
// sheet.setColumnWidth(0, 30 * 100); sheet.setColumnWidth(0, 30 * 100);
// sheet.setColumnWidth(1, 30 * 70); sheet.setColumnWidth(1, 30 * 75);
// sheet.setColumnWidth(2, 30 * 80); sheet.setColumnWidth(2, 30 * 60);
// sheet.setColumnWidth(3, 30 * 50); sheet.setColumnWidth(3, 30 * 170);
// sheet.setColumnWidth(4, 30 * 110); sheet.setColumnWidth(4, 30 * 170);
// sheet.setColumnWidth(5, 30 * 110);
// HSSFPrintSetup ps = sheet.getPrintSetup(); sheet.setColumnWidth(6, 30 * 110);
// ps.setLandscape(true); // 打印方向,true:横向,false:纵向 sheet.setColumnWidth(7, 30 * 75);
// ps.setPaperSize(HSSFPrintSetup.B5_PAPERSIZE); //纸张 sheet.setColumnWidth(8, 30 * 110);
// sheet.setColumnWidth(0, (int) 35.7 * 100); sheet.setColumnWidth(9, 30 * 110);
// //第三步创建行row:添加表头0行 sheet.setColumnWidth(10, 30 * 75);
// HSSFRow row = sheet.createRow(0); sheet.setColumnWidth(11, 30 * 60);
// HSSFCellStyle style = wb.createCellStyle();//样式 sheet.setColumnWidth(12, 30 * 60);
//
// style.setVerticalAlignment(HSSFCellStyle.ALIGN_LEFT); //设置垂直居中
// style.setAlignment(HSSFCellStyle.ALIGN_LEFT); HSSFPrintSetup ps = sheet.getPrintSetup();
// style.setWrapText(true);//设置自动换行 ps.setLandscape(true); // 打印方向,true:横向,false:纵向
// ps.setPaperSize(HSSFPrintSetup.B5_PAPERSIZE); //纸张
// style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 sheet.setColumnWidth(0, (int) 35.7 * 100);
// style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 //第三步创建行row:添加表头0行
// style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 HSSFRow row = sheet.createRow(0);
// style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 HSSFCellStyle style = wb.createCellStyle();//样式
//
// HSSFFont font = wb.createFont(); style.setVerticalAlignment(HSSFCellStyle.ALIGN_LEFT); //设置垂直居中
// font.setFontHeightInPoints((short) 12); style.setAlignment(HSSFCellStyle.ALIGN_LEFT);
// style.setFont(font); style.setWrapText(true);//设置自动换行
// HSSFCellStyle style2 = wb.createCellStyle(); //表头样式
// style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
// style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); //设置垂直居中 style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
// style2.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
// style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
// HSSFFont font2 = wb.createFont();
// font2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 HSSFFont font = wb.createFont();
// font2.setFontHeightInPoints((short) 14); font.setFontHeightInPoints((short) 12);
// style2.setFont(font2); style.setFont(font);
// HSSFCellStyle style2 = wb.createCellStyle(); //表头样式
// row = sheet.createRow(0); //创建下标为0的单元格
// row.setHeightInPoints(Short.parseShort("20"));//设置行高 style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); //设置垂直居中
// HSSFCell cell = row.createCell(0); //设定值 style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// cell.setCellValue("二代身份证交接单");
// cell.setCellStyle(style2); HSSFFont font2 = wb.createFont();
// for (int i = 0; i < 12; i++) { font2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
// cell = row.createCell(i + 1); font2.setFontHeightInPoints((short) 14);
// cell.setCellValue(""); style2.setFont(font2);
// cell.setCellStyle(style2);
// } row = sheet.createRow(0); //创建下标为0的单元格
// CellRangeAddress callRangeAddress = new CellRangeAddress(0, 0, 0, 12);//起始行,结束行,起始列,结束列 row.setHeightInPoints(Short.parseShort("20"));//设置行高
// sheet.addMergedRegion(callRangeAddress); HSSFCell cell = row.createCell(0); //设定值
// cell.setCellValue("二代身份证交接单");
// row = sheet.createRow(1); cell.setCellStyle(style2);
// row.setHeightInPoints(Short.parseShort("16"));//设置行高 for (int i = 0; i < 12; i++) {
// cell = row.createCell(i + 1);
// cell = row.createCell(0); cell.setCellValue("");
// cell.setCellValue("区县"); //设定值 cell.setCellStyle(style2);
// cell.setCellStyle(style); //内容居中 }
// CellRangeAddress callRangeAddress = new CellRangeAddress(0, 0, 0, 12);//起始行,结束行,起始列,结束列
// cell = row.createCell(1); //第二个单元格 sheet.addMergedRegion(callRangeAddress);
// cell.setCellValue("普通证");
// cell.setCellStyle(style); row = sheet.createRow(1);
// row.setHeightInPoints(Short.parseShort("16"));//设置行高
// cell = row.createCell(2); //第三个单元格
// cell.setCellValue("快证"); cell = row.createCell(0);
// cell.setCellStyle(style); cell.setCellValue("区县"); //设定值
// cell.setCellStyle(style); //内容居中
// cell = row.createCell(3); //第四个单元格
// cell.setCellValue("省内异地快速通道邮"); cell = row.createCell(1); //第二个单元格
// cell.setCellStyle(style); cell.setCellValue("普通证");
// cell.setCellStyle(style);
// cell = row.createCell(4); //第五个单元格
// cell.setCellValue("省内异地快速通道普"); cell = row.createCell(2); //第三个单元格
// cell.setCellStyle(style); cell.setCellValue("快证");
// cell.setCellStyle(style);
// cell = row.createCell(5); //第六个单元格
// cell.setCellValue("省内异地邮"); cell = row.createCell(3); //第四个单元格
// cell.setCellStyle(style); cell.setCellValue("省内异地快速通道邮");
// cell.setCellStyle(style);
// cell = row.createCell(6); //第七个单元格
// cell.setCellValue("省内异地普"); cell = row.createCell(4); //第五个单元格
// cell.setCellStyle(style); cell.setCellValue("省内异地快速通道普");
// cell.setCellStyle(style);
// cell = row.createCell(7); //第八个单元格
// cell.setCellValue("军人证"); cell = row.createCell(5); //第六个单元格
// cell.setCellStyle(style); cell.setCellValue("省内异地邮");
// cell.setCellStyle(style);
// cell = row.createCell(8); //第九个单元格
// cell.setCellValue("快速通道普"); cell = row.createCell(6); //第七个单元格
// cell.setCellStyle(style); cell.setCellValue("省内异地普");
// cell.setCellStyle(style);
// cell = row.createCell(9); //第十个单元格
// cell.setCellValue("快速通道邮"); cell = row.createCell(7); //第八个单元格
// cell.setCellStyle(style); cell.setCellValue("军人证");
// cell.setCellStyle(style);
// cell = row.createCell(10); //第十一个单元格
// cell.setCellValue("邮寄证"); cell = row.createCell(8); //第九个单元格
// cell.setCellStyle(style); cell.setCellValue("快速通道普");
// cell.setCellStyle(style);
// cell = row.createCell(11); //第十二个单元格
// cell.setCellValue("小计"); cell = row.createCell(9); //第十个单元格
// cell.setCellStyle(style); cell.setCellValue("快速通道邮");
// cell.setCellStyle(style);
// cell = row.createCell(12); //第十三个单元格
// cell.setCellValue("盒数"); cell = row.createCell(10); //第十一个单元格
// cell.setCellStyle(style); cell.setCellValue("邮寄证");
// cell.setCellStyle(style);
// row = sheet.createRow(2);//i+2行之后开始创建
// row.setHeightInPoints(Short.parseShort("16"));//设置行高 cell = row.createCell(11); //第十二个单元格
// //创建单元格并且添加数据 cell.setCellValue("小计");
// cell = row.createCell(0); cell.setCellStyle(style);
// cell.setCellValue(countyCode);
// cell.setCellStyle(style); cell = row.createCell(12); //第十三个单元格
// for (int i = 0; i < 12; i++) { cell.setCellValue("盒数");
// cell = row.createCell(i + 1); cell.setCellStyle(style);
// cell.setCellValue("");
// cell.setCellStyle(style); row = sheet.createRow(2);//i+2行之后开始创建
// } row.setHeightInPoints(Short.parseShort("16"));//设置行高
// //创建单元格并且添加数据
// //第五步插入数据 cell = row.createCell(0);
// int num = 0; cell.setCellValue(countyName);
// for (int i = 0; i < countyListEntity.size(); i++) { cell.setCellStyle(style);
// Map<String, Object> map =(Map <String, Object>) countyListEntity.get(i); for (int i = 0; i < 12; i++) {
// //创建行 cell = row.createCell(i + 1);
// row = sheet.createRow(i + 3);//i+2行之后开始创建 cell.setCellValue("");
// row.setHeightInPoints(Short.parseShort("16"));//设置行高 cell.setCellStyle(style);
// //创建单元格并且添加数据 }
// cell = row.createCell(0);
// cell.setCellValue((String) map.get("COUNTYNAME")); //第五步插入数据
// cell.setCellStyle(style); for (int i = 0; i < receiptListEntity.size(); i++) {
// ReceiptListEntity receiptListEntity1=receiptListEntity.get(i);
// cell = row.createCell(1); //创建行
// cell.setCellValue(map.get("DOWNLOAD").toString().equals("0") ? "" : map.get("DOWNLOAD").toString()); row = sheet.createRow(i + 2);//i+2行之后开始创建
// cell.setCellStyle(style); row.setHeightInPoints(Short.parseShort("16"));//设置行高
// //创建单元格并且添加数据
// cell = row.createCell(2); cell = row.createCell(0);
// cell.setCellValue(""); cell.setCellValue(receiptListEntity1.getCountyName());
// cell.setCellStyle(style); cell.setCellStyle(style);
//
// cell = row.createCell(3); cell = row.createCell(1);
// cell.setCellValue(((Integer.parseInt(map.get("DOWNLOAD").toString()) % 250 == 0 ? Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 : Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 + 1)) + ""); cell.setCellValue(receiptListEntity1.getPTZ());
// num += ((Integer.parseInt(map.get("DOWNLOAD").toString()) % 250 == 0 ? Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 : Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 + 1)); cell.setCellStyle(style);
// cell.setCellStyle(style);
// cell = row.createCell(2);
// cell = row.createCell(4); cell.setCellValue(receiptListEntity1.getKZ());
// cell.setCellValue(""); cell.setCellStyle(style);
// cell.setCellStyle(style);
// cell = row.createCell(3);
// cell = row.createCell(5); cell.setCellValue(receiptListEntity1.getYDKSY());
// cell.setCellValue(""); cell.setCellStyle(style);
// cell.setCellStyle(style);
// cell = row.createCell(4);
// cell = row.createCell(6); cell.setCellValue(receiptListEntity1.getYDKSP());
// cell.setCellValue(""); cell.setCellStyle(style);
// cell.setCellStyle(style);
// cell = row.createCell(5);
// cell = row.createCell(7); cell.setCellValue(receiptListEntity1.getYDY());
// cell.setCellValue(""); cell.setCellStyle(style);
// cell.setCellStyle(style);
// cell = row.createCell(6);
// cell = row.createCell(8); cell.setCellValue(receiptListEntity1.getYDP());
// cell.setCellValue(""); cell.setCellStyle(style);
// cell.setCellStyle(style);
// cell = row.createCell(7);
// cell = row.createCell(9); cell.setCellValue(receiptListEntity1.getJRZ());
// cell.setCellValue(""); cell.setCellStyle(style);
// cell.setCellStyle(style);
// cell = row.createCell(8);
// cell = row.createCell(10); cell.setCellValue(receiptListEntity1.getKSY());
// cell.setCellValue(""); cell.setCellStyle(style);
// cell.setCellStyle(style);
// cell = row.createCell(9);
// cell = row.createCell(11); cell.setCellValue(receiptListEntity1.getKSP());
// cell.setCellValue(""); cell.setCellStyle(style);
// cell.setCellStyle(style);
// cell = row.createCell(10);
// } cell.setCellValue(receiptListEntity1.getYJZ());
// } cell.setCellStyle(style);
cell = row.createCell(11);
cell.setCellValue(receiptListEntity1.getXiaoJi());
cell.setCellStyle(style);
cell = row.createCell(12);
cell.setCellValue(receiptListEntity1.getBoxCount());
cell.setCellStyle(style);
row = sheet.createRow(receiptListEntity.size() + i);// 行之后开始创建
row.setHeightInPoints(Short.parseShort("16"));//设置行高
//创建单元格并且添加数据
cell = row.createCell(0);
cell.setCellValue("仓库签字:");
cell.setCellStyle(style);
for (int j = 0; j < 6; j++) {
cell = row.createCell(j +1);
cell.setCellValue("");
cell.setCellStyle(style);
}
CellRangeAddress callRangeAddress0=new CellRangeAddress(receiptListEntity.size() + i+2, receiptListEntity.size() + i+2, 1, 5);
sheet.addMergedRegion(callRangeAddress0);
cell = row.createCell(6);
cell.setCellValue("邮局签字:");
cell.setCellStyle(style);
for (int j = 0; j < 6; j++) {
cell = row.createCell(j + 7);
cell.setCellValue(" ");
cell.setCellStyle(style);
}
CellRangeAddress callRangeAddress1=new CellRangeAddress(receiptListEntity.size() + i+2, receiptListEntity.size() + i+2, 7, 12);
sheet.addMergedRegion(callRangeAddress1);
row = sheet.createRow(receiptListEntity.size() + 1 + i);// 行之后开始创建
row.setHeightInPoints(Short.parseShort("16"));//设置行高
//创建单元格并且添加数据
cell = row.createCell(0);
cell.setCellValue("交接日期:");
cell.setCellStyle(style);
for (int j = 0; j < 12; j++) {
cell = row.createCell(j + 1);
cell.setCellValue("");
cell.setCellStyle(style);
}
CellRangeAddress callRangeAddress2=new CellRangeAddress(receiptListEntity.size() + i+3, receiptListEntity.size() + i+3, 1, 12);
sheet.addMergedRegion(callRangeAddress2);
}
FileOutputStream fout = null;
try {
fout = new FileOutputStream("E:\\Excel\\" + simpleDateFormat.format(new Date())+ "二代身份证交接单" + ".xls");
// fout = new FileOutputStream("D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("COUNTYNAME") + ".xls");
wb.write(fout);
fout.close();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Excel文件生成成功..." + new Date());
return "E:\\Excel\\" + simpleDateFormat.format(new Date()) + "二代身份证交接单" + ".xls";
// return "D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("COUNTYNAME") + ".xls";
}
/** /**
* 下载装箱单 * 下载装箱单
...@@ -951,8 +1015,8 @@ public class UserApi { ...@@ -951,8 +1015,8 @@ public class UserApi {
cell.setCellValue(""); cell.setCellValue("");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(3); cell = row.createCell(3);
cell.setCellValue(((Integer.parseInt(map.get("DOWNLOAD").toString()) % 250 == 0 ? Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 : Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 + 1)) + ""); cell.setCellValue(((parseInt(map.get("DOWNLOAD").toString()) % 250 == 0 ? parseInt(map.get("DOWNLOAD").toString()) / 250 : parseInt(map.get("DOWNLOAD").toString()) / 250 + 1)) + "");
num += ((Integer.parseInt(map.get("DOWNLOAD").toString()) % 250 == 0 ? Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 : Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 + 1)); num += ((parseInt(map.get("DOWNLOAD").toString()) % 250 == 0 ? parseInt(map.get("DOWNLOAD").toString()) / 250 : parseInt(map.get("DOWNLOAD").toString()) / 250 + 1));
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(4); cell = row.createCell(4);
cell.setCellValue(""); cell.setCellValue("");
...@@ -1215,15 +1279,15 @@ public class UserApi { ...@@ -1215,15 +1279,15 @@ public class UserApi {
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(1); cell = row.createCell(1);
cell.setCellValue(map.get("DOWNLOAD") + ""); cell.setCellValue(map.get("DOWNLOAD") + "");
mergeSum += Integer.valueOf(map.get("DOWNLOAD") + ""); mergeSum += valueOf(map.get("DOWNLOAD") + "");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(2); cell = row.createCell(2);
cell.setCellValue(""); cell.setCellValue("");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(3); cell = row.createCell(3);
cell.setCellStyle(style); cell.setCellStyle(style);
cell.setCellValue(((Integer.parseInt(map.get("DOWNLOAD") + "") % 250 == 0 ? Integer.parseInt(map.get("DOWNLOAD") + "") / 250 : Integer.parseInt(map.get("DOWNLOAD") + "") / 250 + 1)) + ""); cell.setCellValue(((parseInt(map.get("DOWNLOAD") + "") % 250 == 0 ? parseInt(map.get("DOWNLOAD") + "") / 250 : parseInt(map.get("DOWNLOAD") + "") / 250 + 1)) + "");
boxNum += ((Integer.parseInt(map.get("DOWNLOAD") + "") % 250 == 0 ? Integer.parseInt(map.get("DOWNLOAD") + "") / 250 : Integer.parseInt(map.get("DOWNLOAD") + "") / 250 + 1)); boxNum += ((parseInt(map.get("DOWNLOAD") + "") % 250 == 0 ? parseInt(map.get("DOWNLOAD") + "") / 250 : parseInt(map.get("DOWNLOAD") + "") / 250 + 1));
cell = row.createCell(4); cell = row.createCell(4);
cell.setCellValue(""); cell.setCellValue("");
cell.setCellStyle(style); cell.setCellStyle(style);
...@@ -1415,7 +1479,7 @@ public class UserApi { ...@@ -1415,7 +1479,7 @@ public class UserApi {
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(3); cell = row.createCell(3);
cell.setCellStyle(style); cell.setCellStyle(style);
cell.setCellValue(((Integer.parseInt(map.get("DOWNLOAD") + "") % 250 == 0 ? Integer.parseInt(map.get("DOWNLOAD") + "") / 250 : Integer.parseInt(map.get("DOWNLOAD") + "") / 250 + 1)) + ""); cell.setCellValue(((parseInt(map.get("DOWNLOAD") + "") % 250 == 0 ? parseInt(map.get("DOWNLOAD") + "") / 250 : parseInt(map.get("DOWNLOAD") + "") / 250 + 1)) + "");
cell = row.createCell(4); cell = row.createCell(4);
cell.setCellValue(""); cell.setCellValue("");
cell.setCellStyle(style); cell.setCellStyle(style);
...@@ -1440,7 +1504,7 @@ public class UserApi { ...@@ -1440,7 +1504,7 @@ public class UserApi {
cell.setCellValue("合计"); cell.setCellValue("合计");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(1); cell = row.createCell(1);
cell.setCellValue(Integer.valueOf(map.get("DOWNLOAD") + "")); cell.setCellValue(valueOf(map.get("DOWNLOAD") + ""));
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(2); cell = row.createCell(2);
cell.setCellValue("制证车间"); cell.setCellValue("制证车间");
...@@ -1456,7 +1520,7 @@ public class UserApi { ...@@ -1456,7 +1520,7 @@ public class UserApi {
} }
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(3); cell = row.createCell(3);
cell.setCellValue(((Integer.parseInt(map.get("DOWNLOAD") + "") % 250 == 0 ? Integer.parseInt(map.get("DOWNLOAD") + "") / 250 : Integer.parseInt(map.get("DOWNLOAD") + "") / 250 + 1)) + ""); cell.setCellValue(((parseInt(map.get("DOWNLOAD") + "") % 250 == 0 ? parseInt(map.get("DOWNLOAD") + "") / 250 : parseInt(map.get("DOWNLOAD") + "") / 250 + 1)) + "");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(4); cell = row.createCell(4);
cell.setCellValue(permanentPositionDate); cell.setCellValue(permanentPositionDate);
......
...@@ -180,5 +180,4 @@ public class ReceiptListEntity { ...@@ -180,5 +180,4 @@ public class ReceiptListEntity {
} }
} }
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
WITH WITH
t_county t_county
AS( AS(
SELECT COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,SUM(COUNTY_LIST.OUT_STORAGE_COUNT) AS TYPE_COUNT,floor(SUM(COUNTY_LIST.OUT_STORAGE_COUNT)/250)+1 AS BOX_COUNT,SAVE_DATE SELECT COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,SUM(COUNTY_LIST.OUT_STORAGE_COUNT) AS TYPE_COUNT,floor(SUM(COUNTY_LIST.OUT_STORAGE_COUNT)/250)+1 AS boxCount,SAVE_DATE
FROM (SELECT CARD_TYPE_ID,CARD_TYPE FROM CARD_TYPE_DIC GROUP BY CARD_TYPE_ID,CARD_TYPE ) CARD_TYPE_DIC FROM (SELECT CARD_TYPE_ID,CARD_TYPE FROM CARD_TYPE_DIC GROUP BY CARD_TYPE_ID,CARD_TYPE ) CARD_TYPE_DIC
LEFT JOIN (SELECT TASK_ID,CARD_TYPE FROM TASK GROUP BY TASK_ID,CARD_TYPE) TASK ON CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE LEFT JOIN (SELECT TASK_ID,CARD_TYPE FROM TASK GROUP BY TASK_ID,CARD_TYPE) TASK ON CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE
LEFT JOIN (SELECT COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE FROM COUNTY_LIST GROUP BY COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE) COUNTY_LIST ON COUNTY_LIST.TASK_ID = TASK.TASK_ID LEFT JOIN (SELECT COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE FROM COUNTY_LIST GROUP BY COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE) COUNTY_LIST ON COUNTY_LIST.TASK_ID = TASK.TASK_ID
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
), ),
t_total_count t_total_count
AS( AS(
SELECT * FROM (SELECT COUNTYNAME,CARD_TYPE,TYPE_COUNT,BOX_COUNT,SAVE_DATE FROM t_county) PIVOT(SUM(TYPE_COUNT) FOR CARD_TYPE IN ('普通证' AS PTZ,'快证' AS KZ,'省内异地快速通道邮' AS YDKSY,'省内异地快速通道 SELECT * FROM (SELECT COUNTYNAME,CARD_TYPE,TYPE_COUNT,boxCount,SAVE_DATE FROM t_county) PIVOT(SUM(TYPE_COUNT) FOR CARD_TYPE IN ('普通证' AS PTZ,'快证' AS KZ,'省内异地快速通道邮' AS YDKSY,'省内异地快速通道
普' AS YDKSP,'省内异地邮' AS YDY,'省内异地普' AS YDP,'军人证' AS JRZ,'快速通道普' AS KSP,'快速通道邮' AS KSY,'邮寄证' AS YJZ)) 普' AS YDKSP,'省内异地邮' AS YDY,'省内异地普' AS YDP,'军人证' AS JRZ,'快速通道普' AS KSP,'快速通道邮' AS KSY,'邮寄证' AS YJZ))
), ),
county_xiaoji county_xiaoji
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
SUM(KSY)KSY, SUM(KSY)KSY,
SUM(YJZ)YJZ, SUM(YJZ)YJZ,
SUM(XIAOJI)XIAOJI, SUM(XIAOJI)XIAOJI,
SUM(BOX_COUNT)BOX_COUNT SUM(boxCount)boxCount
FROM t_total_count,county_xiaoji WHERE t_total_count.COUNTYNAME=county_xiaoji.COUNTYNAME AND substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8) >= #{startDate} AND #{endDate} >= substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8) FROM t_total_count,county_xiaoji WHERE t_total_count.COUNTYNAME=county_xiaoji.COUNTYNAME AND substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8) >= #{startDate} AND #{endDate} >= substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8)
GROUP BY ROLLUP(t_total_count.COUNTYNAME) GROUP BY ROLLUP(t_total_count.COUNTYNAME)
</select> </select>
......
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