Commit 9a50dc74 authored by wuzhilong's avatar wuzhilong

公安网文件名称修改;

个人邮寄完善出生日期限制
parent b63037ef
......@@ -40,23 +40,22 @@ public class ExportExcelApi {
* 导出公安网数据
*/
@RequestMapping("printExcelData")
public byte[] printExcelData(@RequestParam("list") List<Integer> list, @RequestParam("name")String name, @RequestParam("isHistory")String isHistory, HttpServletResponse response, HttpServletRequest requ) {
public void printExcelData(@RequestParam("list") List<Integer> list, @RequestParam("name")String name, @RequestParam("isHistory")String isHistory, HttpServletResponse response, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
try {
List<Map<String, Object>> list1 = detailReceiptListService.selectPoliceDataById(list);
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(list, name,isHistory);
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
//使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = ExportExcel.exportExcelDate(mapList,list1,response,requ);
try {
return inputStream2byte(fout);
} catch (IOException e) {
ExportExcel.exportExcelDate(mapList,list1,response,requ);
} catch (Exception e) {
e.printStackTrace();
logger.error("导出文件名:" + fout);
logger.error("导出公安网数据异常");
logger.error("IOException 导出公安网数据IO异常", e);
}
return null;
}
/**
......
......@@ -2,6 +2,7 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.CountyDicEntity;
import com.yxproject.start.service.LogService;
import com.yxproject.start.service.PersonPostService;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,6 +24,8 @@ import static com.yxproject.start.utils.YXStringUtils.getCurrentDate2String;
public class LogApi {
@Autowired
private LogService logService;
@Autowired
private PersonPostService personPostService;
Logger logger= Logger.getLogger(LogApi.class);
......@@ -227,6 +230,16 @@ public class LogApi {
List <Map <String, Object>> resultList=logService.selectFileIdByUploadDate(printDate);
//查询身份数据
List <Map <String, Object>> dataList=logService.selectPersonPostUnanalysis(printDate);
//添加受理号匹配,出生日期不匹配订单
List <Map <String, Object>> invalidList=logService.selectInvalidPersonPost(printDate);
for (int i = 0; i < invalidList.size(); i++) {
Map<String, Object> noteMap = invalidList.get(i);
String uploadNo=noteMap.get("JMSFZSLH").toString();
String note= "出生日期不符合";
String name="system";
personPostService.cancelPostByAcceptNo(uploadNo,note,name);
}
//todo 获取所有的已解析的文件id
List <Map <String, Object>> analysusList = new ArrayList<>();
//将身份数据插入到邮寄表中
......
......@@ -46,7 +46,8 @@ public interface LogMapper {
"FROM PERSON_POST \n" +
"LEFT JOIN PREPRO_PERSON ON PERSON_POST.FIRST_WHITE = PREPRO_PERSON.JMSFZSLH\n" +
"LEFT JOIN FILES ON FILES.ID=PREPRO_PERSON.FILE_ID "+
"WHERE TO_CHAR(FILES.UPLOAD_DATE,'yyyy-mm-dd hh24:mi:ss')=#{printDate} )")
"WHERE PERSON_POST.BIRTH_DATE = PREPRO_PERSON.CSRQ " +
"AND TO_CHAR(FILES.UPLOAD_DATE,'yyyy-mm-dd hh24:mi:ss')=#{printDate} )")
public boolean changeCardTypeByPrintDate(@Param("printDate")String printDate);
@Update(" update FILE_NAME_DIC set FILE_NAME_DIC.ANALYSIS_DATE = #{printDate} where file_id=#{fileId} ")
......@@ -56,7 +57,8 @@ public interface LogMapper {
" where file_id IN (SELECT DISTINCT PERSON_POST.file_id FROM PERSON_POST " +
" LEFT JOIN PREPRO_PERSON ON PERSON_POST.FIRST_WHITE = PREPRO_PERSON.JMSFZSLH " +
" LEFT JOIN FILES ON FILES.ID=PREPRO_PERSON.FILE_ID " +
" WHERE TO_CHAR(FILES.UPLOAD_DATE,'yyyy-mm-dd hh24:mi:ss')=#{printDate} ) ")
" WHERE PERSON_POST.BIRTH_DATE = PREPRO_PERSON.CSRQ " +
" AND TO_CHAR(FILES.UPLOAD_DATE,'yyyy-mm-dd hh24:mi:ss')=#{printDate} ) ")
public boolean insertAnalysisDateByPrintDate(@Param("analysisDate")String analysisDate,@Param("printDate")String printDate);
/**
......@@ -208,6 +210,17 @@ public interface LogMapper {
"and TO_CHAR(FILES.UPLOAD_DATE,'yyyy-mm-dd hh24:mi:ss')=#{uploadDate}")
public List<Map<String, Object>> selectPersonPostUnanalysis(@Param("uploadDate")String uploadDate);
@Select("select DISTINCT PREPRO_PERSON.JMSFZSLH \n" +
"FROM PERSON_POST " +
"LEFT JOIN PREPRO_PERSON ON PERSON_POST.FIRST_WHITE = PREPRO_PERSON.JMSFZSLH \n" +
"LEFT JOIN FILES ON FILES.ID = PREPRO_PERSON.FILE_ID \n" +
"WHERE PERSON_POST.STATE1=3 \n" +
"AND PERSON_POST.BIRTH_DATE <> PREPRO_PERSON.CSRQ \n" +
"and TO_CHAR(FILES.UPLOAD_DATE,'yyyy-mm-dd hh24:mi:ss')=#{uploadDate}")
public List<Map<String, Object>> selectInvalidPersonPost(@Param("uploadDate")String uploadDate);
//身份数据插入person_post
@Update("UPDATE PERSON_POST SET ID_CARD=#{cardId},ACCEPT_THE_MATTER=#{issuing},BEGIN_USEFUL_LIFE=#{beginDate},VALID_PERIOD_END=#{endDate},STATE1=0 where PERSON_POST.FIRST_WHITE=#{firstWhite}")
public boolean insertIdData(@Param("cardId")String cardId,@Param("issuing") String issuing,@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("firstWhite")String firstWhite );
......
......@@ -50,6 +50,8 @@ public interface LogService {
public List<Map<String,Object>> selectPersonPostUnanalysis(@Param("uploadDate")String uploadDate);
public List<Map<String,Object>> selectInvalidPersonPost(@Param("uploadDate")String uploadDate);
public boolean insertIdData(String cardId, String issuing,String beginDate,String endDate,String firstWhite );
public boolean updateNullIdDate(String fileId );
......
......@@ -157,6 +157,11 @@ public class LogServiceImpl implements LogService {
return logMapper.selectPersonPostUnanalysis(uploadDate);
}
@Override
public List<Map<String, Object>> selectInvalidPersonPost(String uploadDate) {
return logMapper.selectInvalidPersonPost(uploadDate);
}
@Override
public boolean insertIdData(String cardId, String issuing, String beginDate, String endDate,String firstWhite) {
logMapper.insertIdData(cardId,issuing,beginDate,endDate,firstWhite);
......
......@@ -26,9 +26,8 @@ public class ExportExcel {
/**
* 导出公安网信息
* @param mapList 公安网信息
* @return
*/
public static String exportExcelDate(List<Map<String,Object>> mapList, List<Map<String,Object>> list, HttpServletResponse response, HttpServletRequest request){
public static void exportExcelDate(List<Map<String,Object>> mapList, List<Map<String,Object>> list, HttpServletResponse response, HttpServletRequest request){
//第一步创建workbook
HSSFWorkbook wb = new HSSFWorkbook();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
......@@ -173,9 +172,8 @@ public class ExportExcel {
cell1.setCellValue("null".equals(list.get(i).get("RECEIPT_DATE") + "") ? "" : list.get(i).get("RECEIPT_DATE") + "");
}
//第六步将生成excel文件保存到指定路径下
FileOutputStream fout = null;
try {
String fileName = "公安网签收"+getCurrentDate2String("yyyy-MM-dd")+"_"+mapList.size() + ".xls";
String fileName = "异地签收"+getCurrentDate2String("yyyy-MM-dd")+"_"+mapList.size() + ".xls";
String rtn = "";
fileName = URLEncoder.encode(fileName, "UTF8");
String userAgent = request.getHeader("User-Agent");
......@@ -194,11 +192,6 @@ public class ExportExcel {
else if (userAgent.contains("safari")) {
rtn = "filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), "ISO8859-1") + "\"";
}
/*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.contains("mozilla")) {
rtn = "filename*=UTF-8''" + fileName;
......@@ -207,17 +200,13 @@ public class ExportExcel {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;" + rtn);
response.setCharacterEncoding("UTF-8");
// fout = new FileOutputStream("E:\\Excel\\" + simpleDateFormat.format(new Date()) + countyInfoList.get(0).get("COUNTYNAME") + ".xls");
fout = new FileOutputStream("D:\\Excel\\" +"公安网签收"+getCurrentDate2String("yyyy-MM-dd")+"_"+mapList.size()+".xls");
OutputStream fout = response.getOutputStream();
wb.write(fout);
fout.flush();
fout.close();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Excel文件生成成功..." + new Date());
// return "E:\\Excel\\" + simpleDateFormat.format(new Date()) +countyInfoList.get(0).get("COUNTYNAME") + ".xls";
return "D:\\Excel\\" +"公安网签收"+getCurrentDate2String("yyyy-MM-dd")+"_"+mapList.size()+".xls";
}
......
......@@ -121,8 +121,8 @@ angular.module("AvatarCheck.confirmNotDeliveredInfo",['ngRoute', 'AvatarCheck.ht
LODOP.SET_PRINT_STYLEA(4, "Bold", 1);
LODOP.SET_PRINT_STYLEA(4, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(4, "FontSize", 12);
LODOP.PREVIEW();
// LODOP.PRINT();
// LODOP.PREVIEW();
LODOP.PRINT();
}
//接收并打印标签
......
......@@ -56,10 +56,7 @@ angular.module('AvatarCheck.searchCardMsg', ['ngRoute', 'AvatarCheck.http'])
$scope.postMsgDetail = [];
HttpService.doPostAndGetData(postData, function (data) {
$scope.postMsgDetail = data;
console.log("postData:",postData)
console.log("$scope.postMsgDetail:", $scope.postMsgDetail)
$timeout(function () {
console.log("????"+$scope.postMsgDetail.length == 1&&$scope.postMsgDetail[$scope.idx].printDate == null&&flag == true&&$scope.postMsgDetail[0].idCard==postData.idCard)
if ($scope.postMsgDetail.length == 1&&$scope.postMsgDetail[$scope.idx].printDate == null&&flag == true&&$scope.postMsgDetail[0].idCard==postData.idCard){
$scope.PreviewMytableRotate();
}
......@@ -90,7 +87,6 @@ angular.module('AvatarCheck.searchCardMsg', ['ngRoute', 'AvatarCheck.http'])
$scope.idx = 0;
$scope.changeIndex = function (index) {
$scope.idx = index;
console.log($scope.idx)
}
var nation_data = [
......@@ -196,12 +192,9 @@ angular.module('AvatarCheck.searchCardMsg', ['ngRoute', 'AvatarCheck.http'])
// myform.newaddress.value = aaa.sNewAddress;
myform.Base64.value = document.getElementById("aaa").PhotoBuffer;
// myform.fp.value = aaa.sFpState;
var imgSrc = "data:image/jpg;base64," + myform.Base64.value;
var imgSrc = "data:image/jpg;base64," + myform.Base64.value;
$("#imgDetail").attr("src", imgSrc);
postData.idCard = myform.id.value;
postData.idCard = myform.id.value;
postData.startDate = myform.yxqstart.value;
postData.endDate = myform.yxqend.value;
doPost(flag)
......@@ -220,6 +213,7 @@ angular.module('AvatarCheck.searchCardMsg', ['ngRoute', 'AvatarCheck.http'])
$scope.startReading = function () {
$rootScope.tab = '/searchCardMsg';
$rootScope.close = 1;
$scope.postMsgDetail = [];
subSomething();
};
$scope.endReading = function () {
......@@ -300,7 +294,6 @@ angular.module('AvatarCheck.searchCardMsg', ['ngRoute', 'AvatarCheck.http'])
LODOP.SET_PRINT_STYLEA(0, "AngleOfPageInside", 0);
// LODOP.PREVIEW();
if(LODOP.PRINT()){
console.log($scope.postMsgDetail[$scope.idx].sqrxm,$scope.postMsgDetail)
var id = document.getElementsByClassName("minimal")[$scope.idx].value;
HttpService.setPrintTime(id, $scope.currentTime, function (data) {
$scope.printResult = $scope.postMsgDetail[$scope.idx].applicantName+" 打印完成";
......
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