Commit dcde5c44 authored by xuwang's avatar xuwang

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/com/yxproject/start/mapper/TaskMapper.java
parents 3a1614ea 28db2beb
...@@ -19,6 +19,7 @@ import org.dom4j.Attribute; ...@@ -19,6 +19,7 @@ import org.dom4j.Attribute;
import org.dom4j.Document; import org.dom4j.Document;
import org.dom4j.Element; import org.dom4j.Element;
import org.dom4j.io.*; import org.dom4j.io.*;
import org.hibernate.loader.plan.spi.Return;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -29,6 +30,8 @@ import java.text.ParseException; ...@@ -29,6 +30,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 +294,7 @@ public class UserApi { ...@@ -291,7 +294,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 +309,7 @@ public class UserApi { ...@@ -306,7 +309,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();
} }
...@@ -518,30 +521,30 @@ public class UserApi { ...@@ -518,30 +521,30 @@ public class UserApi {
* *
* @return * @return
*/ */
@RequestMapping("reviseBoundCount") @RequestMapping("reviseStorageCount")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public String reviseBoundCount(@RequestParam("countyListId") String countyListId,@RequestParam("outStorageCount") String out_Storage_Count,@RequestParam("inStorageCount") String in_Storage_Count, HttpServletResponse resp) { public String reviseStorageCount(@RequestParam("taskListId") String taskListId,@RequestParam("countyCode") String countyCode,@RequestParam("inStorageCount") String in_Storage_Count, @RequestParam("outStorageCount") String out_Storage_Count, HttpServletResponse resp) {
int i=countyListService.reviseBoundCount(countyListId, out_Storage_Count, in_Storage_Count); int i=countyListService.reviseStorageCount(taskListId,countyCode, in_Storage_Count, out_Storage_Count);
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(i+"--更新成功--"); yxjsonResponse.outPutSuccess(i+"--更新成功--");
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
/** // /**
* 更新入库时间 // * 更新入库时间
* 前端空值 // * 前端空值
* @return // * @return
*/ // */
@RequestMapping("updateInStorageDate") // @RequestMapping("updateInStorageDate")
// @RequiresPermissions("userInfo.add")//权限管理; //// @RequiresPermissions("userInfo.add")//权限管理;
public String updateInStorageDate(@RequestParam("taskListId") String taskListId,@RequestParam("inStorageCount") String inStorageCount,@RequestParam("outStorageCount") String outStorageCount, HttpServletResponse resp) { // public String updateInStorageDate(@RequestParam("taskListId") String taskListId,@RequestParam("inStorageCount") String inStorageCount,@RequestParam("outStorageCount") String outStorageCount, HttpServletResponse resp) {
int i = taskService.updateStorageDate(taskListId,inStorageCount,outStorageCount); // int i = taskService.updateStorageDate(taskListId,inStorageCount,outStorageCount);
YXJSONResponse yxjsonResponse = new YXJSONResponse(); // YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); // resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(i + "更新成功"); // yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString(); // return yxjsonResponse.toJSONString();
} // }
// /** // /**
// * 更新出库时间 // * 更新出库时间
...@@ -581,21 +584,20 @@ public class UserApi { ...@@ -581,21 +584,20 @@ public class UserApi {
} }
/** /**
* 下载装箱 * 下载回执
*/ */
@RequestMapping("printPackingList") @RequestMapping("printOfficialReceipt")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public byte[] printPackingList(@RequestParam("cyclesheetID") String taskID, HttpServletResponse response) { public byte[] printOfficialReceipt(@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<Map<String, Object>> countyInfoList = groupNoService.findCountyInfoList(taskID); List<ReceiptListEntity> receiptListEntity = receiptListService.getReceiptList(startDate,endDate);
List<TaskEntity> taskEntities = taskService.findProductionTaskListEntityByID(Long.valueOf(taskID)); fout = officialReceiptExcel(receiptListEntity, receiptListEntity.get(0).getXiaoJi() + "", 6000, receiptListEntity.get(0).getBoxCount(),receiptListEntity.get(0).getCountyName(), dateTime, startDate, endDate);
fout = exportExcel(countyInfoList, taskEntities.get(0).getCard_Type() + "", "p1", 6000, taskEntities.get(0).getCitycode(), dateTime, taskID); String outFile = dateTime + "身份证专递回执单";
String outFile = dateTime + taskEntities.get(0).getCitycode() + "二代身份证统计表";
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()];
...@@ -611,67 +613,25 @@ public class UserApi { ...@@ -611,67 +613,25 @@ public class UserApi {
return null; return null;
} }
// /** private String officialReceiptExcel( List<ReceiptListEntity> receiptListEntity, String typeName, int sum , long boxCount, String countyName, String dateTime, String startDate , String endDate) {
// * 下载交接单 if(typeName.contains("null")){
// */ typeName=typeName.replace("null", "");
// @RequestMapping("printConnectList") }
//// @RequiresPermissions("userInfo.add")//权限管理; //第一步创建workbook
// public byte[] printConnectList(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, HttpServletResponse response) { HSSFWorkbook wb=new HSSFWorkbook();
//// cyclesheetID ="20180802032"; SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
// response.setContentType("application/x-download"); // HSSFSheet sheet=wb.createSheet("身份证专递回执单");
// response.setCharacterEncoding("UTF-8"); // sheet.setColumnWidth(0, 100 * 255);
// String dateTime = DateFormatUtils.format(new Date(), "yyyyMMddHH");
//// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件 for (ReceiptListEntity receiptList :receiptListEntity){
// String fout = null; HSSFSheet sheet = wb.createSheet("回执单" + receiptList.getCountyName());
// List<ReceiptListEntity> receiptListEntity = receiptListService.getReceiptList(startDate,endDate); HSSFPrintSetup ps=sheet.getPrintSetup();
// fout = receiptListExcel(receiptListEntity, receiptListEntity.get(0).getXiaoJi() + "", 6000, receiptListEntity.get(0).getBoxCount(), dateTime, startDate, endDate); ps.setLandscape(true); // 打印方向,true:横向,false:纵向
// String outFile = dateTime + "二代身份证交接单"; ps.setPaperSize(HSSFPrintSetup.B5_PAPERSIZE); //纸张
// try { sheet.setColumnWidth(0, (int) 100 * 255);
// FileInputStream fis = new FileInputStream(new File(fout)); //第三步创建行row:添加表头0行
// byte[] b = new byte[fis.available()]; HSSFRow row=sheet.createRow(0);
// fis.read(b); // HSSFCellStyle style=wb.createCellStyle();//样式
// fis.close();
// response.addHeader("Content-Disposition", "attachment;filename=" + outFile + ".xls");
// return b;
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
// return null;
// }
//
// /**
// * 下载交接单
// *
// * @param receiptListEntity 交接单信息
// * @param typeName 制证类型
// * @param sum 总数
// * @param boxCount 区县代码
// * @param countyName 区县名称
// */
// private String receiptListExcel( List<ReceiptListEntity> receiptListEntity, String typeName, int sum, String boxCount, String dateTime, String startDate ,String endDate) {
// if (typeName.contains("null")) {
// typeName = typeName.replace("null", "");
// }
// //第一步创建workbook
// HSSFWorkbook wb = new HSSFWorkbook();
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
// HSSFSheet sheet = wb.createSheet("二代身份证交接单");
// sheet.setColumnWidth(0, 30 * 100);
// sheet.setColumnWidth(1, 30 * 70);
// sheet.setColumnWidth(2, 30 * 80);
// sheet.setColumnWidth(3, 30 * 50);
// sheet.setColumnWidth(4, 30 * 110);
//
// HSSFPrintSetup ps = sheet.getPrintSetup();
// ps.setLandscape(true); // 打印方向,true:横向,false:纵向
// ps.setPaperSize(HSSFPrintSetup.B5_PAPERSIZE); //纸张
// sheet.setColumnWidth(0, (int) 35.7 * 100);
// //第三步创建行row:添加表头0行
// HSSFRow row = sheet.createRow(0);
// HSSFCellStyle style = wb.createCellStyle();//样式
//
// style.setVerticalAlignment(HSSFCellStyle.ALIGN_LEFT); //设置垂直居中 // style.setVerticalAlignment(HSSFCellStyle.ALIGN_LEFT); //设置垂直居中
// style.setAlignment(HSSFCellStyle.ALIGN_LEFT); // style.setAlignment(HSSFCellStyle.ALIGN_LEFT);
// style.setWrapText(true);//设置自动换行 // style.setWrapText(true);//设置自动换行
...@@ -680,159 +640,385 @@ public class UserApi { ...@@ -680,159 +640,385 @@ public class UserApi {
// style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 // style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
// style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 // style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
// style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 // style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
// // HSSFFont font=wb.createFont();
// HSSFFont font = wb.createFont(); // font.setFontHeightInPoints((short) 32);
// font.setFontHeightInPoints((short) 12);
// style.setFont(font); // style.setFont(font);
// HSSFCellStyle style2 = wb.createCellStyle(); //表头样式
// HSSFCellStyle style2=wb.createCellStyle(); //表头样式
// style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); //设置垂直居中 style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); //设置垂直居中
// style2.setAlignment(HSSFCellStyle.ALIGN_CENTER); style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);
//
// HSSFFont font2 = wb.createFont(); HSSFFont font2=wb.createFont();
// font2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 font2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
// font2.setFontHeightInPoints((short) 14); font2.setFontHeightInPoints((short) 36);
// style2.setFont(font2); style2.setFont(font2);
//
// row = sheet.createRow(0); //创建下标为0的单元格 HSSFCellStyle style3=wb.createCellStyle(); //表头样式
// row.setHeightInPoints(Short.parseShort("20"));//设置行高 style3.setVerticalAlignment(HSSFCellStyle.ALIGN_RIGHT); //设置垂直靠右
// HSSFCell cell = row.createCell(0); //设定值 style3.setAlignment(HSSFCellStyle.ALIGN_RIGHT);
// cell.setCellValue("二代身份证交接单");
// cell.setCellStyle(style2); HSSFFont font3=wb.createFont();
// for (int i = 0; i < 12; i++) { font3.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
// cell = row.createCell(i + 1); font3.setFontHeightInPoints((short) 24);
// cell.setCellValue(""); style3.setFont(font3);
// cell.setCellStyle(style2);
// } HSSFCellStyle style4=wb.createCellStyle(); //表头样式
// CellRangeAddress callRangeAddress = new CellRangeAddress(0, 0, 0, 12);//起始行,结束行,起始列,结束列 style4.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); //设置垂直居中
// sheet.addMergedRegion(callRangeAddress); style4.setAlignment(HSSFCellStyle.ALIGN_CENTER);
//
// row = sheet.createRow(1); HSSFFont font4=wb.createFont();
// row.setHeightInPoints(Short.parseShort("16"));//设置行高 font4.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);//粗体显示
// font4.setFontHeightInPoints((short) 18);
// cell = row.createCell(0); style4.setFont(font4);
// cell.setCellValue("区县"); //设定值 // ReceiptListEntity receiptListEntity1=receiptListEntity.get(i);
// cell.setCellStyle(style); //内容居中 row=sheet.createRow(0); //创建下标为0的单元格
// row.setHeightInPoints(Short.parseShort("67"));//设置行高
// cell = row.createCell(1); //第二个单元格 HSSFCell cell=row.createCell(0); //设定值
// cell.setCellValue("普通证"); cell.setCellValue("身份证专递回执单");
// cell.setCellStyle(style); cell.setCellStyle(style2);
//
// cell = row.createCell(2); //第三个单元格 row=sheet.createRow(1);
// cell.setCellValue("快证"); row.setHeightInPoints(Short.parseShort("192"));//设置行高
// cell.setCellStyle(style); cell=row.createCell(0);
// cell.setCellValue(" " + receiptList.getCountyName() + "\\县于" + simpleDateFormat.format(new Date()) + "出库身份证\r\n普通证" + receiptList.getPTZ()+ "人,快证" + receiptList.getKZ() + "人,省内异地快速通\r\n道邮" + receiptList.getYDKSY() + "人,省内异地快速通道普" + receiptList.getYDKSP() + "人,省内\r\n异地邮" + receiptList.getYDY() + "人,省内异地普" + receiptList.getYDP() + "人,军人证" + receiptList.getJRZ() + "人,\r\n快速通道普" + receiptList.getKSP() + "人,快速通道邮" + receiptList.getKSY() + "人,邮寄证\r\n" + receiptList.getYJZ() + "人,国内异地证____人,共" + receiptList.getBoxCount() + "盒。(请核\r\n对签字后,使用传真发至0371-69179397;或交\r\n至本地速递局身份证项目经理寄回。)"); //设定值
// cell = row.createCell(3); //第四个单元格 cell.setCellStyle(style4); //内容居中
// cell.setCellValue("省内异地快速通道邮"); row=sheet.createRow(2);//i+2行之后开始创建
// cell.setCellStyle(style); row.setHeightInPoints(Short.parseShort("50"));//设置行高
// //创建单元格并且添加数据
// cell = row.createCell(4); //第五个单元格 cell=row.createCell(0);
// cell.setCellValue("省内异地快速通道普"); cell.setCellValue("收件人签字:__________");
// cell.setCellStyle(style); cell.setCellStyle(style3);
// }
// cell = row.createCell(5); //第六个单元格 FileOutputStream fout = null;
// cell.setCellValue("省内异地邮"); try {
// cell.setCellStyle(style); fout = new FileOutputStream("E:\\Excel\\" + simpleDateFormat.format(new Date())+ "身份证专递回执单" + ".xls");
// // fout = new FileOutputStream("D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("COUNTYNAME") + ".xls");
// cell = row.createCell(6); //第七个单元格 wb.write(fout);
// cell.setCellValue("省内异地普"); fout.close();
// cell.setCellStyle(style); } catch (IOException e) {
// e.printStackTrace();
// cell = row.createCell(7); //第八个单元格 }
// cell.setCellValue("军人证");
// cell.setCellStyle(style); System.out.println("Excel文件生成成功..." + new Date());
// return "E:\\Excel\\" + simpleDateFormat.format(new Date()) + "身份证专递回执单" + ".xls";
// cell = row.createCell(8); //第九个单元格 // return "D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("COUNTYNAME") + ".xls";
// cell.setCellValue("快速通道普"); }
// cell.setCellStyle(style);
// /**
// cell = row.createCell(9); //第十个单元格 * 下载交接单
// cell.setCellValue("快速通道邮"); */
// cell.setCellStyle(style); @RequestMapping("printReceiptList")
// // @RequiresPermissions("userInfo.add")//权限管理;
// cell = row.createCell(10); //第十一个单元格 public byte[] printReceiptList(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, HttpServletResponse response) {
// cell.setCellValue("邮寄证"); // cyclesheetID ="20180802032";
// cell.setCellStyle(style); response.setContentType("application/x-download");
// response.setCharacterEncoding("UTF-8");
// cell = row.createCell(11); //第十二个单元格 String dateTime = DateFormatUtils.format(new Date(), "yyyyMMddHH");
// cell.setCellValue("小计"); // //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
// cell.setCellStyle(style); String fout = null;
// List<ReceiptListEntity> receiptListEntity = receiptListService.getReceiptList(startDate,endDate);
// cell = row.createCell(12); //第十三个单元格 fout = receiptListExcel(receiptListEntity, receiptListEntity.get(0).getXiaoJi() + "", 6000, receiptListEntity.get(0).getBoxCount(),receiptListEntity.get(0).getCountyName(), dateTime, startDate, endDate);
// cell.setCellValue("盒数"); String outFile = dateTime + "二代身份证交接单";
// cell.setCellStyle(style); try {
// FileInputStream fis = new FileInputStream(new File(fout));
// row = sheet.createRow(2);//i+2行之后开始创建 byte[] b = new byte[fis.available()];
// row.setHeightInPoints(Short.parseShort("16"));//设置行高 fis.read(b);
// //创建单元格并且添加数据 fis.close();
// cell = row.createCell(0); response.addHeader("Content-Disposition", "attachment;filename=" + outFile + ".xls");
// cell.setCellValue(countyCode); return b;
// cell.setCellStyle(style); } catch (FileNotFoundException e) {
// for (int i = 0; i < 12; i++) { e.printStackTrace();
// cell = row.createCell(i + 1); } catch (IOException e) {
// cell.setCellValue(""); e.printStackTrace();
// cell.setCellStyle(style); }
// } return null;
// }
// //第五步插入数据
// int num = 0; /**
// for (int i = 0; i < countyListEntity.size(); i++) { * 下载交接单
// Map<String, Object> map =(Map <String, Object>) countyListEntity.get(i); *
// //创建行 * @param countyName 区县名称
// row = sheet.createRow(i + 3);//i+2行之后开始创建 * @param receiptListEntity 交接单信息
// row.setHeightInPoints(Short.parseShort("16"));//设置行高 * @param typeName 制证类型
// //创建单元格并且添加数据 * @param sum 总数
// cell = row.createCell(0); * @param boxCount 区县代码
// cell.setCellValue((String) map.get("COUNTYNAME")); */
// cell.setCellStyle(style); private String receiptListExcel( List<ReceiptListEntity> receiptListEntity, String typeName, int sum , long boxCount, String countyName, String dateTime, String startDate , String endDate) {
// if (typeName.contains("null")) {
// cell = row.createCell(1); typeName = typeName.replace("null", "");
// cell.setCellValue(map.get("DOWNLOAD").toString().equals("0") ? "" : map.get("DOWNLOAD").toString()); }
// cell.setCellStyle(style); //第一步创建workbook
// HSSFWorkbook wb = new HSSFWorkbook();
// cell = row.createCell(2); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
// cell.setCellValue(""); HSSFSheet sheet = wb.createSheet("二代身份证交接单");
// cell.setCellStyle(style); sheet.setColumnWidth(0, 30 * 100);
// sheet.setColumnWidth(1, 30 * 75);
// cell = row.createCell(3); sheet.setColumnWidth(2, 30 * 60);
// 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)) + ""); sheet.setColumnWidth(3, 30 * 170);
// num += ((Integer.parseInt(map.get("DOWNLOAD").toString()) % 250 == 0 ? Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 : Integer.parseInt(map.get("DOWNLOAD").toString()) / 250 + 1)); sheet.setColumnWidth(4, 30 * 170);
// cell.setCellStyle(style); sheet.setColumnWidth(5, 30 * 110);
// sheet.setColumnWidth(6, 30 * 110);
// cell = row.createCell(4); sheet.setColumnWidth(7, 30 * 75);
// cell.setCellValue(""); sheet.setColumnWidth(8, 30 * 110);
// cell.setCellStyle(style); sheet.setColumnWidth(9, 30 * 110);
// sheet.setColumnWidth(10, 30 * 75);
// cell = row.createCell(5); sheet.setColumnWidth(11, 30 * 60);
// cell.setCellValue(""); sheet.setColumnWidth(12, 30 * 60);
// cell.setCellStyle(style);
//
// cell = row.createCell(6); HSSFPrintSetup ps = sheet.getPrintSetup();
// cell.setCellValue(""); ps.setLandscape(true); // 打印方向,true:横向,false:纵向
// cell.setCellStyle(style); ps.setPaperSize(HSSFPrintSetup.B5_PAPERSIZE); //纸张
// sheet.setColumnWidth(0, (int) 35.7 * 100);
// cell = row.createCell(7); //第三步创建行row:添加表头0行
// cell.setCellValue(""); HSSFRow row = sheet.createRow(0);
// cell.setCellStyle(style); HSSFCellStyle style = wb.createCellStyle();//样式
//
// cell = row.createCell(8); style.setVerticalAlignment(HSSFCellStyle.ALIGN_LEFT); //设置垂直居中
// cell.setCellValue(""); style.setAlignment(HSSFCellStyle.ALIGN_LEFT);
// cell.setCellStyle(style); style.setWrapText(true);//设置自动换行
//
// cell = row.createCell(9); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
// cell.setCellValue(""); style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
// cell.setCellStyle(style); style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
// style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
// cell = row.createCell(10);
// cell.setCellValue(""); HSSFFont font = wb.createFont();
// cell.setCellStyle(style); font.setFontHeightInPoints((short) 12);
// style.setFont(font);
// cell = row.createCell(11); HSSFCellStyle style2 = wb.createCellStyle(); //表头样式
// cell.setCellValue("");
// cell.setCellStyle(style); style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); //设置垂直居中
// style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// }
// } HSSFFont font2 = wb.createFont();
font2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
font2.setFontHeightInPoints((short) 14);
style2.setFont(font2);
row = sheet.createRow(0); //创建下标为0的单元格
row.setHeightInPoints(Short.parseShort("20"));//设置行高
HSSFCell cell = row.createCell(0); //设定值
cell.setCellValue("二代身份证交接单");
cell.setCellStyle(style2);
for (int i = 0; i < 12; i++) {
cell = row.createCell(i + 1);
cell.setCellValue("");
cell.setCellStyle(style2);
}
CellRangeAddress callRangeAddress = new CellRangeAddress(0, 0, 0, 12);//起始行,结束行,起始列,结束列
sheet.addMergedRegion(callRangeAddress);
row = sheet.createRow(1);
row.setHeightInPoints(Short.parseShort("16"));//设置行高
cell = row.createCell(0);
cell.setCellValue("区县"); //设定值
cell.setCellStyle(style); //内容居中
cell = row.createCell(1); //第二个单元格
cell.setCellValue("普通证");
cell.setCellStyle(style);
cell = row.createCell(2); //第三个单元格
cell.setCellValue("快证");
cell.setCellStyle(style);
cell = row.createCell(3); //第四个单元格
cell.setCellValue("省内异地快速通道邮");
cell.setCellStyle(style);
cell = row.createCell(4); //第五个单元格
cell.setCellValue("省内异地快速通道普");
cell.setCellStyle(style);
cell = row.createCell(5); //第六个单元格
cell.setCellValue("省内异地邮");
cell.setCellStyle(style);
cell = row.createCell(6); //第七个单元格
cell.setCellValue("省内异地普");
cell.setCellStyle(style);
cell = row.createCell(7); //第八个单元格
cell.setCellValue("军人证");
cell.setCellStyle(style);
cell = row.createCell(8); //第九个单元格
cell.setCellValue("快速通道普");
cell.setCellStyle(style);
cell = row.createCell(9); //第十个单元格
cell.setCellValue("快速通道邮");
cell.setCellStyle(style);
cell = row.createCell(10); //第十一个单元格
cell.setCellValue("邮寄证");
cell.setCellStyle(style);
cell = row.createCell(11); //第十二个单元格
cell.setCellValue("小计");
cell.setCellStyle(style);
cell = row.createCell(12); //第十三个单元格
cell.setCellValue("盒数");
cell.setCellStyle(style);
row = sheet.createRow(2);//i+2行之后开始创建
row.setHeightInPoints(Short.parseShort("16"));//设置行高
//创建单元格并且添加数据
cell = row.createCell(0);
cell.setCellValue(countyName);
cell.setCellStyle(style);
for (int i = 0; i < 12; i++) {
cell = row.createCell(i + 1);
cell.setCellValue("");
cell.setCellStyle(style);
}
//第五步插入数据
for (int i = 0; i < receiptListEntity.size(); i++) {
ReceiptListEntity receiptListEntity1=receiptListEntity.get(i);
//创建行
row = sheet.createRow(i + 2);//i+2行之后开始创建
row.setHeightInPoints(Short.parseShort("16"));//设置行高
//创建单元格并且添加数据
cell = row.createCell(0);
cell.setCellValue(receiptListEntity1.getCountyName());
cell.setCellStyle(style);
cell = row.createCell(1);
cell.setCellValue(receiptListEntity1.getPTZ());
cell.setCellStyle(style);
cell = row.createCell(2);
cell.setCellValue(receiptListEntity1.getKZ());
cell.setCellStyle(style);
cell = row.createCell(3);
cell.setCellValue(receiptListEntity1.getYDKSY());
cell.setCellStyle(style);
cell = row.createCell(4);
cell.setCellValue(receiptListEntity1.getYDKSP());
cell.setCellStyle(style);
cell = row.createCell(5);
cell.setCellValue(receiptListEntity1.getYDY());
cell.setCellStyle(style);
cell = row.createCell(6);
cell.setCellValue(receiptListEntity1.getYDP());
cell.setCellStyle(style);
cell = row.createCell(7);
cell.setCellValue(receiptListEntity1.getJRZ());
cell.setCellStyle(style);
cell = row.createCell(8);
cell.setCellValue(receiptListEntity1.getKSY());
cell.setCellStyle(style);
cell = row.createCell(9);
cell.setCellValue(receiptListEntity1.getKSP());
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() + 2);// 行之后开始创建
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() +2, receiptListEntity.size() +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() +2, receiptListEntity.size() +2, 7, 12);
sheet.addMergedRegion(callRangeAddress1);
row = sheet.createRow(receiptListEntity.size() +3);// 行之后开始创建
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() +3, receiptListEntity.size() +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";
}
/**
* 下载装箱单
*/
@RequestMapping("printPackingList")
// @RequiresPermissions("userInfo.add")//权限管理;
public byte[] printPackingList(@RequestParam("cyclesheetID") String taskID, HttpServletResponse response) {
// cyclesheetID ="20180802032";
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
String dateTime = DateFormatUtils.format(new Date(), "yyyyMMddHH");
// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = null;
List<Map<String, Object>> countyInfoList = groupNoService.findCountyInfoList(taskID);
List<TaskEntity> taskEntities = taskService.findProductionTaskListEntityByID(Long.valueOf(taskID));
fout = exportExcel(countyInfoList, taskEntities.get(0).getCard_Type() + "", "p1", 6000, taskEntities.get(0).getCitycode(), dateTime, taskID);
String outFile = dateTime + taskEntities.get(0).getCitycode() + "二代身份证统计表";
try {
FileInputStream fis = new FileInputStream(new File(fout));
byte[] b = new byte[fis.available()];
fis.read(b);
fis.close();
response.addHeader("Content-Disposition", "attachment;filename=" + outFile + ".xls");
return b;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/** /**
* 下载装箱单 * 下载装箱单
...@@ -951,8 +1137,8 @@ public class UserApi { ...@@ -951,8 +1137,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 +1401,15 @@ public class UserApi { ...@@ -1215,15 +1401,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 +1601,7 @@ public class UserApi { ...@@ -1415,7 +1601,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 +1626,7 @@ public class UserApi { ...@@ -1440,7 +1626,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 +1642,7 @@ public class UserApi { ...@@ -1456,7 +1642,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 {
} }
} }
...@@ -17,9 +17,12 @@ import java.util.Map; ...@@ -17,9 +17,12 @@ import java.util.Map;
@Mapper @Mapper
public interface CountyListMapper { public interface CountyListMapper {
public List<CountyEntity> findCountyList(@Param("taskListId") String taskListId,@Param("taskStateId") String taskStateId,@Param("cardType") String cardType); public List<CountyEntity> findCountyList(@Param("taskListId") String taskListId,@Param("taskStateId") String taskStateId,@Param("cardType") String cardType);
public int updateBoundCount(@Param("county_List_Id") String county_List_Id,@Param("out_Storage_Count") String out_Storage_Count,@Param("in_Storage_Count") String in_Storage_Count); public int reviseStorageCount( @Param("taskListId") String taskListId, @Param("countyCode") String countyCode,@Param("in_Storage_Count") String in_Storage_Count,@Param("out_Storage_Count") String out_Storage_Count);
public List<ReceiptListEntity> getReceiptList( @Param("startDate")String startDate , @Param("endDate") String endDate); public List<ReceiptListEntity> getReceiptList( @Param("startDate")String startDate , @Param("endDate") String endDate);
public List<CountyListEntity> findStorageCountByTaskListId(String taskListId); public List<CountyListEntity> findStorageCountByTaskListId(String taskListId);
public int totalFinshCount ();
public int totalInStorageCount ();
public int totalOutStorageCount ();
// public List<Map<String, Object>> PrintCountyListXML(); // public List<Map<String, Object>> PrintCountyListXML();
} }
...@@ -18,10 +18,9 @@ public interface TaskMapper { ...@@ -18,10 +18,9 @@ public interface TaskMapper {
public List<TaskEntity> findTaskEntityByAcceptNo(String acceptNo); public List<TaskEntity> findTaskEntityByAcceptNo(String acceptNo);
public List<TaskEntity> findTaskEntityByState(int state); public List<TaskEntity> findTaskEntityByState(int state);
public int replaceExceptionInformation(TaskEntity taskEntity); public int replaceExceptionInformation(TaskEntity taskEntity);
public int totalNum (int i);
public List<TypeListEntity> findTypeListByTaskStateId(String taskStateId); public List<TypeListEntity> findTypeListByTaskStateId(String taskStateId);
public List <CityListEntity> findCityList(@Param("taskStateId") String taskStateId,@Param("cardType") String cardType); public List <CityListEntity> findCityList(@Param("taskStateId") String taskStateId,@Param("cardType") String cardType);
public int updateOutStorageDate( @Param("taskListId")String taskId, @Param("inStorageCount")String inStorageCount, @Param("outStorageCount")String outStorageCount); public int updateOutStorageDate(String taskListId);
public int updateInStorageDate(String taskListId,String inStorageCount,String outStorageCount); public int updateInStorageDate(String taskListId);
public List<Map<String,Object>> findStationCountByDealDate(@Param("submitDate") String submitDate,@Param("state") String state); public int updateStorageDate(String taskListId);
} }
...@@ -9,5 +9,5 @@ import java.util.Map; ...@@ -9,5 +9,5 @@ import java.util.Map;
public interface CountyListService { public interface CountyListService {
public List<CountyListEntity> findStorageCountByTaskListId(String taskListId); public List<CountyListEntity> findStorageCountByTaskListId(String taskListId);
public int reviseBoundCount(String county_List_Id, String out_Storage_Count, String in_Storage_Count); public int reviseStorageCount(String taskListId,String countyCode, String in_Storage_Count, String out_Storage_Count);
} }
...@@ -28,7 +28,7 @@ public interface TaskService { ...@@ -28,7 +28,7 @@ public interface TaskService {
public int addExceptionState(TaskEntity state); public int addExceptionState(TaskEntity state);
public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount); // public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount);
......
...@@ -2,10 +2,12 @@ package com.yxproject.start.service.impl; ...@@ -2,10 +2,12 @@ package com.yxproject.start.service.impl;
import com.yxproject.start.entity.CountyListEntity; import com.yxproject.start.entity.CountyListEntity;
import com.yxproject.start.mapper.CountyListMapper; import com.yxproject.start.mapper.CountyListMapper;
import com.yxproject.start.mapper.TaskMapper;
import com.yxproject.start.service.CountyListService; import com.yxproject.start.service.CountyListService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -18,19 +20,27 @@ import java.util.Map; ...@@ -18,19 +20,27 @@ import java.util.Map;
public class CountyListServiceImpl implements CountyListService { public class CountyListServiceImpl implements CountyListService {
@Autowired @Autowired
public CountyListMapper countyListMapper; public CountyListMapper countyListMapper;
@Autowired
public TaskMapper taskMapper;
@Override @Override
public int reviseBoundCount(String county_List_Id, String out_Storage_Count, String in_Storage_Count) { public int reviseStorageCount(String taskListId,String countyCode, String in_Storage_Count, String out_Storage_Count) {
int i= 0; int i = 0;
if(out_Storage_Count.equals(0)&&!in_Storage_Count.equals(0)){ int totalFinshCount = 0;
i=countyListMapper.updateBoundCount(county_List_Id, out_Storage_Count, in_Storage_Count); int totalInStorageCount = 0;
int totalOutStorageCount = 0;
totalFinshCount = countyListMapper.totalFinshCount();
totalInStorageCount = countyListMapper.totalInStorageCount();
totalOutStorageCount = countyListMapper.totalOutStorageCount();
i = countyListMapper.reviseStorageCount(taskListId, countyCode, in_Storage_Count, out_Storage_Count);
if(totalInStorageCount == totalFinshCount){
taskMapper.updateInStorageDate(taskListId);
} }
if(!out_Storage_Count.equals(0)&&in_Storage_Count.equals(0)){ if(totalOutStorageCount == totalFinshCount){
i=countyListMapper.updateBoundCount(county_List_Id, out_Storage_Count, in_Storage_Count); taskMapper.updateOutStorageDate(taskListId);
} }
if(!out_Storage_Count.equals(0)&&!in_Storage_Count.equals(0)){ if(totalInStorageCount == totalFinshCount && totalOutStorageCount == totalFinshCount){
i=countyListMapper.updateBoundCount(county_List_Id, out_Storage_Count, in_Storage_Count); taskMapper.updateStorageDate(taskListId);
} }
return i; return i;
} }
......
...@@ -433,24 +433,24 @@ public class TaskServiceImpl implements TaskService { ...@@ -433,24 +433,24 @@ public class TaskServiceImpl implements TaskService {
return i; return i;
} }
/** // /**
* 更新出入库时间 // * 更新出入库时间
* @param // * @param
* @return // * @return
*/ // */
@Override // @Override
public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount ) { // public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount ) {
int i=0; // int j=0;
i= taskMapper.totalNum(i); // j= taskMapper.totalNum(j);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss"); // SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
if (inStorageCount.equals(i)){ // if (inStorageCount.equals(j)){
return taskMapper.updateInStorageDate(taskListId,inStorageCount,outStorageCount); // taskMapper.updateInStorageDate(taskListId,inStorageCount,outStorageCount);
} // }
if(outStorageCount.equals(i)){ // if(outStorageCount.equals(j)){
return taskMapper.updateOutStorageDate(taskListId,inStorageCount,outStorageCount); // taskMapper.updateOutStorageDate(taskListId,inStorageCount,outStorageCount);
} // }
return 0; // return 0;
} // }
/** /**
......
...@@ -21,15 +21,11 @@ ...@@ -21,15 +21,11 @@
WHERE TASK.TASK_ID=#{taskListId} AND TASK.CARD_TYPE=#{cardType} AND TASK.TASK_STATE_ID=#{taskStateId} WHERE TASK.TASK_ID=#{taskListId} AND TASK.CARD_TYPE=#{cardType} AND TASK.TASK_STATE_ID=#{taskStateId}
</select> </select>
<update id="updateBoundCount" parameterType="String" >
update COUNTY_LIST SET OUT_STORAGE_COUNT =#{out_Storage_Count},IN_STORAGE_COUNT =#{in_Storage_Count} where COUNTY_LIST_ID =#{county_List_Id}
</update>
<select id="getReceiptList" resultType="com.yxproject.start.entity.ReceiptListEntity" parameterType="String"> <select id="getReceiptList" resultType="com.yxproject.start.entity.ReceiptListEntity" parameterType="String">
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 +34,7 @@ ...@@ -38,7 +34,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
...@@ -46,18 +42,18 @@ ...@@ -46,18 +42,18 @@
SELECT COUNTYNAME,SUM(TYPE_COUNT) AS XIAOJI FROM t_county GROUP BY COUNTYNAME SELECT COUNTYNAME,SUM(TYPE_COUNT) AS XIAOJI FROM t_county GROUP BY COUNTYNAME
) )
SELECT DECODE(GROUPING(t_total_count.COUNTYNAME),1,'总计',t_total_count.COUNTYNAME)COUNTYNAME, SELECT DECODE(GROUPING(t_total_count.COUNTYNAME),1,'总计',t_total_count.COUNTYNAME)COUNTYNAME,
SUM(PTZ)PTZ, nvl(SUM(PTZ),0)AS PTZ ,
SUM(KZ)KZ, nvl(SUM(KZ),0)AS KZ,
SUM(YDKSY)YDKSY, nvl(SUM(YDKSY),0) AS YDKSY,
SUM(YDKSP)YDKSP, nvl(SUM(YDKSP),0)AS YDKSP,
SUM(YDY)YDY, nvl(SUM(YDY),0)AS YDY,
SUM(YDP)YDP, nvl(SUM(YDP),0)AS YDP,
SUM(JRZ)JRZ, nvl(SUM(JRZ),0)AS JRZ,
SUM(KSP)KSP, nvl(SUM(KSP),0)AS KSP,
SUM(KSY)KSY, nvl(SUM(KSY),0)AS KSY,
SUM(YJZ)YJZ, nvl(SUM(YJZ),0)AS 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>
...@@ -69,6 +65,23 @@ ...@@ -69,6 +65,23 @@
WHERE TASK_ID=#{task_Id} WHERE TASK_ID=#{task_Id}
</select> </select>
<insert id="reviseStorageCount" parameterType="String" >
INSERT INTO COUNTY_LIST (TASK_ID,COUNTY_CODE,IN_STORAGE_COUNT,OUT_STORAGE_COUNT) VALUES ( #{taskListId},#{countyCode},#{in_Storage_Count},#{out_Storage_Count} )
</insert>
<select id="totalFinshCount" resultType="Integer">
select nvl(SUM(FINISH_COUNT),0) FROM COUNTY_LIST
</select>
<select id="totalInStorageCount" resultType="Integer">
select nvl(SUM(IN_STORAGE_COUNT),0) FROM COUNTY_LIST
</select>
<select id="totalOutStorageCount" resultType="Integer">
select nvl(SUM(OUT_STORAGE_COUNT),0) FROM COUNTY_LIST
</select>
<!--<select id="PrintCountyListXML" resultType="com.yxproject.start.entity.CountyListEntity" parameterType="String">--> <!--<select id="PrintCountyListXML" resultType="com.yxproject.start.entity.CountyListEntity" parameterType="String">-->
<!--SELECT * FROM COUNTY_LIST--> <!--SELECT * FROM COUNTY_LIST-->
<!--</select>--> <!--</select>-->
......
...@@ -72,16 +72,16 @@ ...@@ -72,16 +72,16 @@
update TASK set exception_Information = NULL and IS_EXCEPTION =#{is_Exception} where TASK_ID =#{task_Id} update TASK set exception_Information = NULL and IS_EXCEPTION =#{is_Exception} where TASK_ID =#{task_Id}
</update> </update>
<select id="totalNum" resultType="Integer"> <update id="updateOutStorageDate">
select nvl(SUM(VALID_COUNT),0) FROM GROUP_NO UPDATE TASK SET OUT_STORAGE_DATE = SYSDATE WHERE TASK_ID = #{taskListId}
</select> </update>
<update id="updateOutStorageDate" parameterType="String"> <update id="updateInStorageDate" >
update TASK SET OUT_STORAGE_DATE = SYSDATE where TASK_ID =#{task_Id} UPDATE TASK SET IN_STORAGE_DATE = SYSDATE WHERE TASK_ID = #{taskListId}
</update> </update>
<update id="updateInStorageDate" parameterType="String"> <update id="updateStorageDate" >
update TASK SET IN_STORAGE_DATE = SYSDATE where TASK_ID =#{task_Id} UPDATE TASK SET IN_STORAGE_DATE = SYSDATE , OUT_STORAGE_DATE = SYSDATE WHERE TASK_ID = #{taskListId}
</update> </update>
<select id="findTypeListByTaskStateId" resultType="com.yxproject.start.entity.TypeListEntity" parameterType="String"> <select id="findTypeListByTaskStateId" resultType="com.yxproject.start.entity.TypeListEntity" parameterType="String">
......
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