@ -7,6 +7,7 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate ;
import java.time.format.DateTimeFormatter ;
import java.util.* ;
import java.util.stream.Collectors ;
import javax.servlet.ServletOutputStream ;
import javax.servlet.http.HttpServletResponse ;
@ -597,6 +598,89 @@ public class QcStaticTableController extends BaseController {
public List < HashMap > getTableHzDataSC ( @RequestBody QcStaticTable qcStaticTable ) {
return qcStaticTableService . getTableHzDataSC ( qcStaticTable ) ;
}
@Log ( title = "首检分析报表统计" , businessType = BusinessType . EXPORT )
@PostMapping ( "/exportSCTable" )
public void exportSCTable ( HttpServletResponse response , QcStaticTable qcStaticTable ) {
QcStaticTable titledto = qcStaticTableService . getTableHzTitle ( qcStaticTable ) ;
List < HashMap > list0 = qcStaticTableService . getTableHzDataSC ( qcStaticTable ) ;
List < HashMap > list = list0 . stream ( )
. filter ( hmap - > ! hmap . get ( "sampleQuality" ) . equals ( "0" ) )
. collect ( Collectors . toList ( ) ) ;
List < String > title2Cols = titledto . getColumns1 ( ) ;
//String titleRow1 = String.join(",", title2Cols);
String titleRow1 = "首检分析报表" ;
//表格结构数据
ArrayList < ExcelCol > excelCols = new ArrayList < > ( ) ;
excelCols . add ( new ExcelCol ( "时间" , "timeCol" , 15 ) ) ;
excelCols . add ( new ExcelCol ( "抽检数" , "sampleQuality" , 10 ) ) ;
for ( int n = 0 ; n < title2Cols . size ( ) ; n + + ) {
excelCols . add ( new ExcelCol ( title2Cols . get ( n ) , "col" + ( n ) , 15 ) ) ;
}
excelCols . add ( new ExcelCol ( "不良数" , "noOkQua" , 10 ) ) ;
excelCols . add ( new ExcelCol ( "不良率(%)" , "noOkRate" , 10 ) ) ;
String titleName = "首检统计分析报表" ;
SXSSFWorkbook workbook = null ;
try {
//设置响应头
response . setHeader ( "Content-disposition" ,
"attachment; filename=" + titleName ) ;
response . setContentType ( "application/octet-stream;charset=UTF-8" ) ;
ServletOutputStream outputStream = response . getOutputStream ( ) ;
//调用工具类
workbook = ExcelMapUtil . initWorkbook ( titleName , titleRow1 , excelCols , list ) ;
workbook . write ( outputStream ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
} finally {
if ( workbook ! = null ) {
workbook . dispose ( ) ;
}
}
}
@Log ( title = "来料分析报表统计" , businessType = BusinessType . EXPORT )
@PostMapping ( "/exportIncomeTable" )
public void exportIncomeTable ( HttpServletResponse response , QcStaticTable qcStaticTable ) {
QcStaticTable titledto = qcStaticTableService . getTableHzTitle ( qcStaticTable ) ;
List < HashMap > list = qcStaticTableService . getTableHzDataSC ( qcStaticTable ) ;
List < String > title2Cols = titledto . getColumns1 ( ) ;
//String titleRow1 = String.join(",", title2Cols);
String titleRow1 = "巡检分析报表" ;
//表格结构数据
ArrayList < ExcelCol > excelCols = new ArrayList < > ( ) ;
excelCols . add ( new ExcelCol ( "时间" , "timeCol" , 15 ) ) ;
excelCols . add ( new ExcelCol ( "抽检批次" , "sampleQuality" , 10 ) ) ;
for ( int n = 0 ; n < title2Cols . size ( ) ; n + + ) {
excelCols . add ( new ExcelCol ( title2Cols . get ( n ) , "col" + ( n ) , 15 ) ) ;
}
excelCols . add ( new ExcelCol ( "不良数" , "noOkQua" , 10 ) ) ;
excelCols . add ( new ExcelCol ( "不良率(%)" , "noOkRate" , 10 ) ) ;
String titleName = "来料统计分析报表" ;
SXSSFWorkbook workbook = null ;
try {
//设置响应头
response . setHeader ( "Content-disposition" ,
"attachment; filename=" + titleName ) ;
response . setContentType ( "application/octet-stream;charset=UTF-8" ) ;
ServletOutputStream outputStream = response . getOutputStream ( ) ;
//调用工具类
workbook = ExcelMapUtil . initWorkbook ( titleName , titleRow1 , excelCols , list ) ;
workbook . write ( outputStream ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
} finally {
if ( workbook ! = null ) {
workbook . dispose ( ) ;
}
}
}
@PostMapping ( "/getTableHzNoOkDataSC" )
public List < QcStaticTable > getTableHzNoOkDataSC ( @RequestBody QcStaticTable qcStaticTable ) {
return qcStaticTableService . getTableHzNoOkDataSC ( qcStaticTable ) ;
@ -619,6 +703,46 @@ public class QcStaticTableController extends BaseController {
util . exportExcel ( response , list , "巡检检验结果明细" ) ;
}
@Log ( title = "巡检检验结果统计" , businessType = BusinessType . EXPORT )
@PostMapping ( "/exportXJTable" )
public void exportXJTable ( HttpServletResponse response , QcStaticTable qcStaticTable ) {
QcStaticTable titledto = qcStaticTableService . getTableHzTitle ( qcStaticTable ) ;
List < HashMap > list = qcStaticTableService . getTableHzData ( qcStaticTable ) ;
List < String > title2Cols = titledto . getColumns1 ( ) ;
//String titleRow1 = String.join(",", title2Cols);
String titleRow1 = "巡检分析报表" ;
//表格结构数据
ArrayList < ExcelCol > excelCols = new ArrayList < > ( ) ;
excelCols . add ( new ExcelCol ( "时间" , "timeCol" , 15 ) ) ;
excelCols . add ( new ExcelCol ( "抽样数" , "sampleQuality" , 10 ) ) ;
for ( int n = 0 ; n < title2Cols . size ( ) ; n + + ) {
excelCols . add ( new ExcelCol ( title2Cols . get ( n ) , "col" + ( n ) , 15 ) ) ;
}
excelCols . add ( new ExcelCol ( "不良数" , "noOkQua" , 10 ) ) ;
excelCols . add ( new ExcelCol ( "不良率(%)" , "noOkRate" , 10 ) ) ;
String titleName = "巡检分析报表" ;
SXSSFWorkbook workbook = null ;
try {
//设置响应头
response . setHeader ( "Content-disposition" ,
"attachment; filename=" + titleName ) ;
response . setContentType ( "application/octet-stream;charset=UTF-8" ) ;
ServletOutputStream outputStream = response . getOutputStream ( ) ;
//调用工具类
workbook = ExcelMapUtil . initWorkbook ( titleName , titleRow1 , excelCols , list ) ;
workbook . write ( outputStream ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
} finally {
if ( workbook ! = null ) {
workbook . dispose ( ) ;
}
}
}
/ * *
* 定 量 值 明 细 分 析 - - 表 头 - -
* * /
@ -714,6 +838,9 @@ public class QcStaticTableController extends BaseController {
//表格结构数据
ArrayList < ExcelCol > excelCols = new ArrayList < > ( ) ;
excelCols . add ( new ExcelCol ( "CPK品类" , "cpkTypeName" , 30 ) ) ;
excelCols . add ( new ExcelCol ( "线体名称" , "lineName" , 30 ) ) ;
excelCols . add ( new ExcelCol ( "检验节点" , "checkTypeName" , 30 ) ) ;
excelCols . add ( new ExcelCol ( "检测项" , "ruleName" , 30 ) ) ;
for ( int n = 0 ; n < title2Cols . size ( ) ; n + + ) {
excelCols . add ( new ExcelCol ( title2Cols . get ( n ) , "date" + ( n + 1 ) , 20 ) ) ;
}