Commit 6607adba authored by wuzhilong's avatar wuzhilong

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

parents 7836158e 50566cf9
......@@ -48,11 +48,12 @@ public class ExportExcelApi {
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list"));
String isHistory = jsonObject.get("isHistory").toString();
String name = jsonObject.get("name").toString();
List<Map<String, Object>> list1 = detailReceiptListService.selectPoliceDataById(jsonArray);
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(jsonArray, name,isHistory);
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
//使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = ExportExcel.exportExcelDate(mapList);
String fout = ExportExcel.exportExcelDate(mapList,list1);
try {
response.addHeader("Content-Disposition", "attachment;filename=" + getCurrentDate2String("yyyy-MM-dd") + "公安网信息表" + ".xls");
return inputStream2byte(fout);
......
......@@ -40,6 +40,17 @@ public interface DetailReceiptListMapper {
"where RECEIPT_LIST.id in (${str}) ")
public boolean updateReceiptListEntityByCardId(@Param("str") String str, @Param("name") String name);
/**
* 查询交接单
* @return
*/
@Select("select QR_CODE,to_char(receipt_date,'yyyyMMddHH24') receipt_date ,\n" +
"POLICE_CODE,FINISH_COUNT,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,CARD_TYPE_DIC.CARD_TYPE\n" +
"from RECEIPT_LIST \n" +
"left join PROD_DBA.DIC_UPLOAD_UNIT_T@PROD_LINK on DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO = RECEIPT_LIST.POLICE_CODE\n" +
"left join CARD_TYPE_DIC on RECEIPT_LIST.CARD_TYPE_ID = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"where DOWNLOAD_DATE is null and RECEIPT_LIST.id in (${str}) order by receipt_date")
public List<Map<String, Object>> selectPoliceDataById(@Param("str") String str);
/**
* 查询详单信息
......
......@@ -10,6 +10,8 @@ import java.util.Map;
* 2019/3/9 14:55
*/
public interface DetailReceiptListService {
public List<Map<String,Object>> selectPoliceDataById(List<Integer> stringList);
public List<Map<String,Object>> selectPostDetails(List<Integer> stringList,String name,String isHistory);
public List<DetailReceiptListEntity> selectDetailReceiptListEntityByCardId(String cardID);
......
......@@ -18,6 +18,19 @@ public class DetailReceiptListServiceImpl implements DetailReceiptListService {
@Autowired
private DetailReceiptListMapper detailReceiptListMapper;
@Override
public List<Map<String, Object>> selectPoliceDataById(List<Integer> stringList) {
String str ="";
for (int i =0;i<stringList.size();i++){
if (i==stringList.size()-1){
str+=stringList.get(i);
}else {
str+=stringList.get(i)+",";
}
}
return detailReceiptListMapper.selectPoliceDataById(str);
}
@Override
public List<Map<String, Object>> selectPostDetails(List<Integer> stringList, String name, String isHistory) {
String str = "";
......
......@@ -82,7 +82,7 @@ public class ImportXmlServiceImpl implements ImportXmlService {
}
preproPersonDto.setTpPath(url);
preproPersonMapper.savePreproPersonEntity(preproPersonDto);
preproPersonMapper.savePreproPersonCLOB(preproPersonDto);
// preproPersonMapper.savePreproPersonCLOB(preproPersonDto);
}
return true;
}
......
......@@ -85,7 +85,7 @@ public class LogServiceImpl implements LogService {
File file = new File(preproPerson.getTpPath());
file.delete();
}
logMapper.deleteFilesDataCLOB(id);
// logMapper.deleteFilesDataCLOB(id);
logMapper.deleteFilesData(id);
return true;
}
......
......@@ -21,7 +21,7 @@ public class ExportExcel {
* @param mapList 公安网信息
* @return
*/
public static String exportExcelDate(List<Map<String,Object>> mapList){
public static String exportExcelDate(List<Map<String,Object>> mapList,List<Map<String,Object>> list){
//第一步创建workbook
HSSFWorkbook wb = new HSSFWorkbook();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
......@@ -108,6 +108,54 @@ public class ExportExcel {
cell = row.createCell(13); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("NOTE")+"")?"":mapList.get(i).get("NOTE")+"");
}
HSSFSheet sheet1 = wb.createSheet("公安网信息交接表");
sheet1.setColumnWidth(0, 30 * 110);
sheet1.setColumnWidth(1, 30 * 110);
sheet1.setColumnWidth(2, 30 * 110);
sheet1.setColumnWidth(3, 30 * 110);
sheet1.setColumnWidth(4, 30 * 110);
sheet1.setColumnWidth(5, 30 * 110);
//第三步创建行row:添加表头0行
HSSFRow row1 = sheet1.createRow(0);
HSSFCellStyle style1 = wb.createCellStyle();//样式
style1.setWrapText(true);//设置自动换行
HSSFFont font1 = wb.createFont();
font1.setFontHeightInPoints((short) 12);
style1.setFont(font1);
row1 = sheet1.createRow(0); //创建下标为0的单元格
row1.setHeightInPoints(Short.parseShort("20"));//设置行高
HSSFCell cell1 = row1.createCell(0); //设定值
cell1.setCellValue("封签编号");
cell1 = row1.createCell(1); //设定值
cell1.setCellValue("上传单位代码");
cell1 = row1.createCell(2); //设定值
cell1.setCellValue("上传单位名称");
cell1 = row1.createCell(3); //设定值
cell1.setCellValue("数量");
cell1 = row1.createCell(4); //设定值
cell1.setCellValue("制证类型");
cell1 = row1.createCell(5); //设定值
cell1.setCellValue("交接日期");
for (int i =0;i<list.size();i++) {
row1 = sheet1.createRow(i + 1);
cell1 = row1.createCell(0); //设定值
cell1.setCellValue("null".equals(list.get(i).get("QR_CODE") + "") ? "" : list.get(i).get("QR_CODE") + "");
cell1 = row1.createCell(1); //设定值
cell1.setCellValue("null".equals(list.get(i).get("POLICE_CODE") + "") ? "" : list.get(i).get("POLICE_CODE") + "");
cell1 = row1.createCell(2); //设定值
cell1.setCellValue("null".equals(list.get(i).get("GAJG_MC") + "") ? "" : list.get(i).get("GAJG_MC") + "");
cell1 = row1.createCell(3); //设定值
cell1.setCellValue("null".equals(list.get(i).get("FINISH_COUNT") + "") ? "" : list.get(i).get("FINISH_COUNT") + "");
cell1 = row1.createCell(4); //设定值
cell1.setCellValue("null".equals(list.get(i).get("CARD_TYPE") + "") ? "" : list.get(i).get("CARD_TYPE") + "");
cell1 = row1.createCell(5); //设定值
cell1.setCellValue("null".equals(list.get(i).get("RECEIPT_DATE") + "") ? "" : list.get(i).get("RECEIPT_DATE") + "");
}
//第六步将生成excel文件保存到指定路径下
FileOutputStream fout = null;
try {
......
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