Commit b4d6aeaf authored by dahai's avatar dahai

修改下载XML制证数据包

parent 0c618587
package com.yxproject.start.api; package com.yxproject.start.api;
import java.io.*;
import java.net.URLEncoder;
import com.yxproject.start.service.DetailReceiptListService; import com.yxproject.start.service.DetailReceiptListService;
import com.yxproject.start.service.ReceiptService; import com.yxproject.start.service.ReceiptService;
import com.yxproject.start.utils.ExportExcel; import com.yxproject.start.utils.ExportExcel;
...@@ -17,6 +14,10 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -17,6 +14,10 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -74,61 +75,6 @@ public class ExportExcelApi { ...@@ -74,61 +75,6 @@ public class ExportExcelApi {
String fout = null; String fout = null;
fout = ExportExcel.exportReceiptExcelDate(mapList); fout = ExportExcel.exportReceiptExcelDate(mapList);
String outFile = dateTime + ""; String outFile = dateTime + "";
//
// String agent = request.getHeader("User-Agent").toUpperCase(); //获得浏览器信息并转换为大写
// if (agent.indexOf("MSIE") > 0 || (agent.indexOf("GECKO")>0 && agent.indexOf("RV:11")>0)) { //IE浏览器和Edge浏览器
// try {
// outFile = URLEncoder.encode(outFile, "UTF-8");
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// }
// } else { //其他浏览器
// try {
// outFile = new String(outFile.getBytes("UTF-8"), "iso-8859-1");
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// }
// }
//
// try {
// outFile = URLEncoder.encode(outFile, "UTF8");
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// }
// String userAgent = request.getHeader("User-Agent");
// /*针对IE或者以IE为内核的浏览器:*/
// if (userAgent != null) {
// userAgent = userAgent.toLowerCase();
// /*IE浏览器,只能采用URLEncoder编码*/
// if (userAgent.indexOf("msie") != -1) {
// outFile = "filename=\"" + outFile + "\"";
// }
// /*Opera浏览器只能采用filename**/
// else if (userAgent.indexOf("opera") != -1) {
// outFile = "filename*=UTF-8''" + outFile;
// }
// /*Safari浏览器,只能采用ISO编码的中文输出*/
// else if (userAgent.indexOf("safari") != -1) {
// try {
// outFile = "filename=\"" + new String(outFile.getBytes("UTF-8"), "ISO8859-1") + "\"";
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// }
// }
// /*Chrome浏览器,只能采用MimeUtility编码或ISO编码的中文输出*/
//// else if (userAgent.indexOf("applewebkit") != -1) {
//// fileName = MimeUtility.encodeText(fileName, "UTF8", "B");
//// rtn = "filename=\"" + fileName + "\"";
//// }
// /* FireFox浏览器,可以使用MimeUtility或filename*或ISO编码的中文输出*/
// else if (userAgent.indexOf("mozilla") != -1) {
// outFile = "filename*=UTF-8''" + outFile;
// }
// }
////
//
//
// }
try { try {
FileInputStream fis = new FileInputStream(new File(fout)); FileInputStream fis = new FileInputStream(new File(fout));
......
...@@ -39,8 +39,6 @@ public class ExportXMLApi { ...@@ -39,8 +39,6 @@ public class ExportXMLApi {
private NewFilesService newFilesService; private NewFilesService newFilesService;
@Autowired @Autowired
private FilesService filesService; private FilesService filesService;
@Autowired
private QuerySequenceSercive querySequenceSercive;
/** /**
...@@ -67,23 +65,35 @@ public class ExportXMLApi { ...@@ -67,23 +65,35 @@ public class ExportXMLApi {
} }
List<List<Map<Long,Object>>> lists = new ArrayList<>(); List<List<Map<Long,Object>>> lists = new ArrayList<>();
for (Long cardTypeId :map.keySet()){ for (Long cardTypeId :map.keySet()){
List list = new ArrayList();
List<PreproPersonEntity> preproPersonEntityList =(List<PreproPersonEntity>)map.get(cardTypeId); //区分邮寄证和大批证件类型
Map<Long,Object> mapFileId = new LinkedHashMap<>(); //大批证
for (PreproPersonEntity preproPersonEntity:preproPersonEntityList){ if (cardTypeId==0){
if (mapFileId!=null&&mapFileId.containsKey(preproPersonEntity.getFileId())){ List list = new ArrayList();
List<PreproPersonEntity> preproPersonEntityListFileId = (List<PreproPersonEntity>)mapFileId.get(preproPersonEntity.getFileId()); List<PreproPersonEntity> preproPersonEntityList =(List<PreproPersonEntity>)map.get(cardTypeId);
preproPersonEntityListFileId.add(preproPersonEntity); Map<Long,Object> mapFileId = new LinkedHashMap<>();
mapFileId.put(preproPersonEntity.getFileId(),preproPersonEntityListFileId); for (PreproPersonEntity preproPersonEntity:preproPersonEntityList){
}else { if (mapFileId!=null&&mapFileId.containsKey(preproPersonEntity.getFileId())){
List<PreproPersonEntity> preproPersonEntityListFileId =new ArrayList<>(); List<PreproPersonEntity> preproPersonEntityListFileId = (List<PreproPersonEntity>)mapFileId.get(preproPersonEntity.getFileId());
preproPersonEntityListFileId.add(preproPersonEntity); preproPersonEntityListFileId.add(preproPersonEntity);
mapFileId.put(preproPersonEntity.getFileId(),preproPersonEntityListFileId); mapFileId.put(preproPersonEntity.getFileId(),preproPersonEntityListFileId);
}else {
List<PreproPersonEntity> preproPersonEntityListFileId =new ArrayList<>();
preproPersonEntityListFileId.add(preproPersonEntity);
mapFileId.put(preproPersonEntity.getFileId(),preproPersonEntityListFileId);
}
} }
list.add(mapFileId);
lists.add(list);
}else {
//邮寄证
List list = new ArrayList();
List<PreproPersonEntity> preproPersonEntityList =(List<PreproPersonEntity>)map.get(cardTypeId);
Map<Long,Object> mapFileId = new LinkedHashMap<>();
mapFileId.put((long)1,preproPersonEntityList);
list.add(mapFileId);
lists.add(list);
} }
list.add(mapFileId);
lists.add(list);
} }
List<String> documentList = new ArrayList<>(); List<String> documentList = new ArrayList<>();
//执行生成XML文件方法 //执行生成XML文件方法
......
...@@ -39,20 +39,6 @@ public class PersonPostApi { ...@@ -39,20 +39,6 @@ public class PersonPostApi {
@Autowired @Autowired
PersonPostService personPostService; PersonPostService personPostService;
private Logger logger = LoggerFactory.getLogger(PersonPostEntity.class);
private SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
private Date getDateFromString(String gmtCreat, DateFormat dateFormat) {
if (gmtCreat != null) {
try {
return dateFormat.parse(gmtCreat);
} catch (ParseException e) {
logger.error(e.getMessage());
return null;
}
}
return null;
}
/** /**
* 查询备注信息 * 查询备注信息
* @param jsonStr * @param jsonStr
......
...@@ -23,8 +23,6 @@ public class SelectApi { ...@@ -23,8 +23,6 @@ public class SelectApi {
*/ */
@Autowired @Autowired
private SelectSerialNumberService selectSerialNumberService; private SelectSerialNumberService selectSerialNumberService;
@Autowired
private GroupNoService groupNoService;
@RequestMapping(value = "selectByCard") @RequestMapping(value = "selectByCard")
public Map<String, Object> selectByCard(@RequestParam("id") String id) { public Map<String, Object> selectByCard(@RequestParam("id") String id) {
......
...@@ -27,7 +27,6 @@ public class SpecialCardApi { ...@@ -27,7 +27,6 @@ public class SpecialCardApi {
@RequestMapping("selectSpecialCard") @RequestMapping("selectSpecialCard")
public List<Map> updateState2(@RequestParam("groupNo") String groupNo) { public List<Map> updateState2(@RequestParam("groupNo") String groupNo) {
return specialCardService.selectSpecialCardByGroupNo(groupNo); return specialCardService.selectSpecialCardByGroupNo(groupNo);
} }
} }
...@@ -43,8 +43,10 @@ public interface PersonPostMapper { ...@@ -43,8 +43,10 @@ public interface PersonPostMapper {
" <when test='orderNumber!=\"\"'> and PERSON_POST.ORDER_NUMBER=#{orderNumber} </when>" + " <when test='orderNumber!=\"\"'> and PERSON_POST.ORDER_NUMBER=#{orderNumber} </when>" +
" <if test='state== 0 '> and PERSON_POST.print_date is null </if>" + " <if test='state== 0 '> and PERSON_POST.print_date is null </if>" +
" <if test='state== 1 '> and PERSON_POST.print_date is not null </if>" + " <if test='state== 1 '> and PERSON_POST.print_date is not null </if>" +
" <if test='notNull== 1 '> and (PERSON_POST.ID_CARD is not null ) or (PERSON_POST.ACCEPT_THE_MATTER is not null ) or (PERSON_POST.BEGIN_USEFUL_LIFE is not null ) or (PERSON_POST.VALID_PERIOD_END is not null ) </if>" + // " <if test='notNull== 1 '> and (PERSON_POST.ID_CARD is not null ) or (PERSON_POST.ACCEPT_THE_MATTER is not null ) or (PERSON_POST.BEGIN_USEFUL_LIFE is not null ) or (PERSON_POST.VALID_PERIOD_END is not null ) </if>" +
" <if test='notNull== 0 '> and (PERSON_POST.ID_CARD is null) or (PERSON_POST.ACCEPT_THE_MATTER is null) or (PERSON_POST.BEGIN_USEFUL_LIFE is null) or (PERSON_POST.VALID_PERIOD_END is null) </if>" + // " <if test='notNull== 0 '> and (PERSON_POST.ID_CARD is null) or (PERSON_POST.ACCEPT_THE_MATTER is null) or (PERSON_POST.BEGIN_USEFUL_LIFE is null) or (PERSON_POST.VALID_PERIOD_END is null) </if>" +
" <if test='notNull== 1 '> and (PERSON_POST.ID_CARD is not null ) </if>" +
" <if test='notNull== 0 '> and (PERSON_POST.ID_CARD is null) </if>" +
" <when test='latticeMouthInformation!=\"\"'> and PERSON_POST.LATTICE_MOUTH_INFORMATION=#{latticeMouthInformation} </when>" + " <when test='latticeMouthInformation!=\"\"'> and PERSON_POST.LATTICE_MOUTH_INFORMATION=#{latticeMouthInformation} </when>" +
" <when test='getToCounty!=null'> and PERSON_POST.GET_TO_COUNTY in ( #{getToCounty} ) </when>" + " <when test='getToCounty!=null'> and PERSON_POST.GET_TO_COUNTY in ( #{getToCounty} ) </when>" +
" <when test='uploadDate!=\"\"'> and subStr(FILE_NAME_DIC.UPLOAD_DATE,0,8)=#{uploadDate} </when>" + " <when test='uploadDate!=\"\"'> and subStr(FILE_NAME_DIC.UPLOAD_DATE,0,8)=#{uploadDate} </when>" +
......
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