Commit 65296059 authored by suichenguang's avatar suichenguang

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

parents 6b27b843 237eef92
...@@ -8,17 +8,42 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -8,17 +8,42 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("exportExcel") @RequestMapping("exportExcel")
public class ExportExcelApi { public class ExportExcelApi {
@Autowired
private ReceiptService receiptService;
@Autowired @Autowired
private DetailReceiptListService detailReceiptListService; private DetailReceiptListService detailReceiptListService;
public Byte[] exportExcel(){ /**
* 导出公安网数据
*/
@RequestMapping("printExcelData")
public Byte[] printExcelData(String date){
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(replaceDate(date));
return null; return null;
} }
/**
* 查询公安网数据
*/
@RequestMapping("selectExcelData")
public List<Map<String,Object>> selectExcelData(String date){
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(replaceDate(date));
return mapList;
}
/**
* 去除字符串中中线
*
* @param str
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "");
}
......
...@@ -152,12 +152,6 @@ public class ExportXMLApi { ...@@ -152,12 +152,6 @@ public class ExportXMLApi {
} }
return null; return null;
} }
...@@ -167,7 +161,7 @@ public class ExportXMLApi { ...@@ -167,7 +161,7 @@ public class ExportXMLApi {
* *
* @throws IOException 可能出现文件写入不成功 * @throws IOException 可能出现文件写入不成功
*/ */
public String createToMakePackageXML(List<PreproPersonEntity> preproPersonEntities , FilesEntity filesEntity, String url) throws IOException { private String createToMakePackageXML(List<PreproPersonEntity> preproPersonEntities , FilesEntity filesEntity, String url) throws IOException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyyMMddhhmmss"); SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyyMMddhhmmss");
Document document = DocumentHelper.createDocument(); Document document = DocumentHelper.createDocument();
...@@ -251,7 +245,6 @@ public class ExportXMLApi { ...@@ -251,7 +245,6 @@ public class ExportXMLApi {
} }
preproPersonService.updatePreproPerson_NewFileName(preproPersonEntities); preproPersonService.updatePreproPerson_NewFileName(preproPersonEntities);
String files_seq = newFilesEntity.getId()+""; String files_seq = newFilesEntity.getId()+"";
FileOutputStream fout = null;
try { try {
FileOutputStream fos = new FileOutputStream("D:\\XML\\" + simpleDateFormat.format(new Date())+"-"+files_seq+ ".xml"); FileOutputStream fos = new FileOutputStream("D:\\XML\\" + simpleDateFormat.format(new Date())+"-"+files_seq+ ".xml");
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8"); OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
......
package com.yxproject.start.mapper; package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
...@@ -8,4 +12,17 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -8,4 +12,17 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface DetailReceiptListMapper { public interface DetailReceiptListMapper {
/**
* 查询导出制证数据
* @param date
* @return
*/
@Select("select DETAIL_RECEIPT_LIST.id,DETAIL_RECEIPT_LIST.ACCEPT_NO,DETAIL_RECEIPT_LIST.NAME,DETAIL_RECEIPT_LIST.UPLOAD_NO,\n" +
"DETAIL_RECEIPT_LIST.sex,DETAIL_RECEIPT_LIST.CARD_ID,DETAIL_RECEIPT_LIST.POLICE_CODE,\n" +
"to_char(RECEIPT_LIST.CHECK_DATE,'yyyyMMdd'),RECEIPT_LIST.CHECK_NAME,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.OLD_CARD_TYPE_ID,PERSON_POST.WAYBILL_NUMBER\n" +
"from DETAIL_RECEIPT_LIST left join RECEIPT_LIST on DETAIL_RECEIPT_LIST.RECEIPT_ID = RECEIPT_LIST.ID\n" +
"left join PERSON_POST on PERSON_POST.FIRST_WHITE = DETAIL_RECEIPT_LIST.UPLOAD_NO\n" +
"where to_char(RECEIPT_LIST.CHECK_DATE,'yyyyMMdd') =#{date}")
public List<Map<String,Object>> selectPostDetails(String date);
} }
package com.yxproject.start.service; package com.yxproject.start.service;
import java.util.List;
import java.util.Map;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
* 2019/3/9 14:55 * 2019/3/9 14:55
*/ */
public interface DetailReceiptListService { public interface DetailReceiptListService {
public List<Map<String,Object>> selectPostDetails(String date);
} }
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.mapper.DetailReceiptListMapper;
import com.yxproject.start.service.DetailReceiptListService; import com.yxproject.start.service.DetailReceiptListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
* 2019/3/9 14:55 * 2019/3/9 14:55
*/ */
@Service @Service
public class DetailReceiptListServiceImpl implements DetailReceiptListService { public class DetailReceiptListServiceImpl implements DetailReceiptListService {
@Autowired
private DetailReceiptListMapper detailReceiptListMapper;
@Override
public List<Map<String, Object>> selectPostDetails(String date) {
return detailReceiptListMapper.selectPostDetails(date);
}
} }
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