Commit ca1f70e4 authored by Administrator's avatar Administrator

添加异常抛出到日志

parent 869b9229
...@@ -2,11 +2,15 @@ package com.yxproject.start.api; ...@@ -2,11 +2,15 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.DetailReceiptListEntity; import com.yxproject.start.entity.DetailReceiptListEntity;
import com.yxproject.start.service.CardDetailedListService; import com.yxproject.start.service.CardDetailedListService;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -20,6 +24,8 @@ public class CardDetailedListApi { ...@@ -20,6 +24,8 @@ public class CardDetailedListApi {
@Autowired @Autowired
private CardDetailedListService cardDetailedListService; private CardDetailedListService cardDetailedListService;
Logger logger= Logger.getLogger(CardDetailedListApi.class);
/** /**
* 查询身份证详单 * 查询身份证详单
*通过身份证号 *通过身份证号
...@@ -27,8 +33,16 @@ public class CardDetailedListApi { ...@@ -27,8 +33,16 @@ public class CardDetailedListApi {
* @return * @return
*/ */
@RequestMapping("findCardDetailedList") @RequestMapping("findCardDetailedList")
public List<DetailReceiptListEntity> findCardDetailedList(@RequestParam("idCard") String idCard) { public List<DetailReceiptListEntity> findCardDetailedList(@RequestParam("idCard") String idCard, HttpServletRequest requ) {
List<DetailReceiptListEntity> list = cardDetailedListService.findCardDetailedListByIdCard(idCard); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<DetailReceiptListEntity> list = new ArrayList<DetailReceiptListEntity>();
try{
list = cardDetailedListService.findCardDetailedListByIdCard(idCard);
} catch (Exception e){
logger.error("身份证号:" + idCard);
logger.error("Exception 通过身份证号查询身份证详单异常", e);
}
return list; return list;
} }
...@@ -40,8 +54,16 @@ public class CardDetailedListApi { ...@@ -40,8 +54,16 @@ public class CardDetailedListApi {
* @return * @return
*/ */
@RequestMapping("findAllCardDetailedList") @RequestMapping("findAllCardDetailedList")
public List<Map<String,Object>> findAllCardDetailedList(@RequestParam("idCard") String idCard) { public List<Map<String,Object>> findAllCardDetailedList(@RequestParam("idCard") String idCard, HttpServletRequest requ) {
List<Map<String,Object>> list = cardDetailedListService.findAllCardDetailedListByIdCard(idCard); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String,Object>> list = new ArrayList <>();
try{
list = cardDetailedListService.findAllCardDetailedListByIdCard(idCard);
} catch (Exception e){
logger.error("身份证号:" + idCard);
logger.error("Exception 通过身份证号查询所有的身份证详单异常", e);
}
return list; return list;
} }
......
...@@ -6,6 +6,7 @@ import com.yxproject.start.utils.ExportExcel; ...@@ -6,6 +6,7 @@ import com.yxproject.start.utils.ExportExcel;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.lang.time.DateFormatUtils; import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC; import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -31,6 +32,8 @@ public class ExportExcelApi { ...@@ -31,6 +32,8 @@ public class ExportExcelApi {
@Autowired @Autowired
private ReceiptService receiptService; private ReceiptService receiptService;
Logger logger= Logger.getLogger(ExportExcelApi.class);
/** /**
* 导出公安网数据 * 导出公安网数据
*/ */
...@@ -42,7 +45,7 @@ public class ExportExcelApi { ...@@ -42,7 +45,7 @@ public class ExportExcelApi {
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list")); JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list"));
// String type = jsonObject.get("type").toString(); // String type = jsonObject.get("type").toString();
String name = jsonObject.get("name").toString(); String name = jsonObject.get("name").toString();
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(jsonArray,name); List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(jsonArray, name);
response.setContentType("application/x-download"); response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
String dateTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd"); String dateTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd");
...@@ -59,21 +62,31 @@ public class ExportExcelApi { ...@@ -59,21 +62,31 @@ public class ExportExcelApi {
return b; return b;
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
logger.error("导出文件名:" + fout);
logger.error("FileNotFoundException 导出公安网数据未找到异常", e);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
logger.error("导出文件名:" + fout);
logger.error("IOException 导出公安网数据IO异常", e);
} }
return null; return null;
} }
/** /**
* 导出交接单 * 导出交接单
*/ */
@RequestMapping("printReceiptExcelData") @RequestMapping("printReceiptExcelData")
public Map<String, Object> printReceiptExcelData(@RequestBody String list) { public Map<String, Object> printReceiptExcelData(@RequestBody String list, HttpServletRequest requ) {
JSONObject jsonObject = JSONObject.fromObject(list); String remoteAddr = requ.getRemoteAddr();
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list")); MDC.put("ip", remoteAddr);
String type = jsonObject.get("type").toString(); JSONObject jsonObject = null;
Map<String, Object> map = receiptService.selectReceiptList(jsonArray, Long.valueOf(type)); JSONArray jsonArray;
String type = null;
Map<String, Object> map = null;
try {
jsonObject=JSONObject.fromObject(list);
type=jsonObject.get("type").toString();
jsonArray=JSONArray.fromObject(jsonObject.get("list"));
map=receiptService.selectReceiptList(jsonArray, Long.valueOf(type));
// response.setContentType("application/x-download"); // response.setContentType("application/x-download");
// response.setCharacterEncoding("UTF-8"); // response.setCharacterEncoding("UTF-8");
// String dateTime = DateFormatUtils.format(new Date(), "yyyy_MM_dd"); // String dateTime = DateFormatUtils.format(new Date(), "yyyy_MM_dd");
...@@ -97,6 +110,11 @@ public class ExportExcelApi { ...@@ -97,6 +110,11 @@ public class ExportExcelApi {
// e.printStackTrace(); // e.printStackTrace();
// } // }
// return null; // return null;
}catch (Exception e) {
e.printStackTrace();
logger.error("异常参数:" + jsonObject);
logger.error("Exception 导出交接单异常", e);
}
return map; return map;
} }
......
...@@ -7,6 +7,8 @@ import com.yxproject.start.service.FilesService; ...@@ -7,6 +7,8 @@ import com.yxproject.start.service.FilesService;
import com.yxproject.start.service.NewFilesService; import com.yxproject.start.service.NewFilesService;
import com.yxproject.start.service.PreproPersonService; import com.yxproject.start.service.PreproPersonService;
import com.yxproject.start.utils.ZipUtils; import com.yxproject.start.utils.ZipUtils;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.dom4j.Document; import org.dom4j.Document;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
import org.dom4j.Element; import org.dom4j.Element;
...@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
...@@ -39,13 +42,16 @@ public class ExportXMLApi { ...@@ -39,13 +42,16 @@ public class ExportXMLApi {
@Autowired @Autowired
private FilesService filesService; private FilesService filesService;
Logger logger= Logger.getLogger(ExportXMLApi.class);
/** /**
* 导出制证数据包 * 导出制证数据包
*/ */
@RequestMapping("printXmlData") @RequestMapping("printXmlData")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public byte[] printXmlData(@RequestParam("uploadNo") String uploadNo, @RequestParam("IDCard") String IDCard, @RequestParam("oldFile") String oldFile, @RequestParam("newFile") String newFile, @RequestParam("SSXQDM") String SSXQDM, @RequestParam("cardType") String cardType, @RequestParam("state") String state, @RequestParam("uploadDate") String uploadDate, @RequestParam("downloadState") String downloadState, HttpServletResponse response) { public byte[] printXmlData(@RequestParam("uploadNo") String uploadNo, @RequestParam("IDCard") String IDCard, @RequestParam("oldFile") String oldFile, @RequestParam("newFile") String newFile, @RequestParam("SSXQDM") String SSXQDM, @RequestParam("cardType") String cardType, @RequestParam("state") String state, @RequestParam("uploadDate") String uploadDate, @RequestParam("downloadState") String downloadState, HttpServletResponse response, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
//使用Servlet实现文件下载的时候,避免浏览器自动打开文件 //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
List<PreproPersonEntity> preproPersonEntities = preproPersonService.selectAllPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate), downloadState); List<PreproPersonEntity> preproPersonEntities = preproPersonService.selectAllPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate), downloadState);
// List<PreproPersonEntity> preproPersonEntities = preproPersonService.selectAllPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate)); // List<PreproPersonEntity> preproPersonEntities = preproPersonService.selectAllPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate));
...@@ -140,6 +146,8 @@ public class ExportXMLApi { ...@@ -140,6 +146,8 @@ public class ExportXMLApi {
xml = createToMakePackageXML(preproPersonEntityList1, filesEntity, "\\zhang"); xml = createToMakePackageXML(preproPersonEntityList1, filesEntity, "\\zhang");
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
logger.error("个人上传受理号:" + uploadNo + "个人身份证号:" + IDCard + "包号:" + oldFile + "新文件名:" + newFile + "签发机关:" + SSXQDM + "制证类型:" + cardType + "是否有效(1有效,0无效):" + state + "下载时间:" + uploadDate + "下载状态(0未下载,1已下载):" + downloadState);
logger.error("IOException 导出制证数据包IO异常", e);
} }
documentList.add(xml); documentList.add(xml);
} }
...@@ -155,6 +163,8 @@ public class ExportXMLApi { ...@@ -155,6 +163,8 @@ public class ExportXMLApi {
out = new ZipOutputStream(response.getOutputStream()); out = new ZipOutputStream(response.getOutputStream());
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
logger.error("制证包数据打包名:" + zipName);
logger.error("IOException 制证包数据打包下载IO异常", e);
} }
try { try {
for (String document : documentList) { for (String document : documentList) {
...@@ -163,15 +173,17 @@ public class ExportXMLApi { ...@@ -163,15 +173,17 @@ public class ExportXMLApi {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error("制证包数据打包名:" + zipName);
logger.error("Exception 制证包数据打包下载异常", e);
} finally { } finally {
try { try {
out.close(); out.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
logger.error("制证包数据打包名:" + zipName);
logger.error("IOException 制证包数据打包下载IO异常", e);
} }
} }
} }
return null; return null;
} }
...@@ -283,6 +295,7 @@ public class ExportXMLApi { ...@@ -283,6 +295,7 @@ public class ExportXMLApi {
writer.close(); writer.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
logger.error("IOException XML文件生成异常", e);
} }
System.out.println("XML文件生成成功..." + new Date()); System.out.println("XML文件生成成功..." + new Date());
return "D:\\XML\\" + "ZAGL_ZZJH_" + filesEntity.getDwdm() + simpleDateFormat.format(new Date()) + cardType + files_seq + ".xml"; return "D:\\XML\\" + "ZAGL_ZZJH_" + filesEntity.getDwdm() + simpleDateFormat.format(new Date()) + cardType + files_seq + ".xml";
......
package com.yxproject.start.api; package com.yxproject.start.api;
import com.yxproject.start.service.PersonPostService; import com.yxproject.start.service.PersonPostService;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@RestController @RestController
@RequestMapping("FilesAnalysis") @RequestMapping("FilesAnalysis")
public class FilesAnalysisApi { public class FilesAnalysisApi {
@Autowired @Autowired
private PersonPostService personPostService; private PersonPostService personPostService;
Logger logger= Logger.getLogger(FilesAnalysisApi.class);
/** /**
* 文件解析 修改解析状态 * 文件解析 修改解析状态
* @param fileId * @param fileId
...@@ -19,8 +25,15 @@ public class FilesAnalysisApi { ...@@ -19,8 +25,15 @@ public class FilesAnalysisApi {
* @return * @return
*/ */
@RequestMapping("anailsis") @RequestMapping("anailsis")
public boolean filesAnailsis(@RequestParam(value = "fileId") String fileId,@RequestParam(value = "creatTime") String creatTime){ public boolean filesAnailsis(@RequestParam(value = "fileId") String fileId,@RequestParam(value = "creatTime") String creatTime, HttpServletRequest requ) {
personPostService.updateIsPost(fileId,creatTime); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
try {
personPostService.updateIsPost(fileId,creatTime);
}catch (Exception e){
logger.error("文件ID:" + fileId + "生成时间:" + creatTime);
logger.error("Exception 文件解析 修改解析状态异常", e);
}
return true; return true;
} }
} }
...@@ -3,12 +3,16 @@ package com.yxproject.start.api; ...@@ -3,12 +3,16 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.NewFilesEntity; import com.yxproject.start.entity.NewFilesEntity;
import com.yxproject.start.service.InfoManagementService; import com.yxproject.start.service.InfoManagementService;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@RestController @RestController
...@@ -17,6 +21,8 @@ public class InfoManagementApi { ...@@ -17,6 +21,8 @@ public class InfoManagementApi {
@Autowired @Autowired
private InfoManagementService infoManagementService; private InfoManagementService infoManagementService;
Logger logger= Logger.getLogger(InfoManagementApi.class);
/** /**
* 按条件查询制证信息数据 * 按条件查询制证信息数据
* @param beginFileName * @param beginFileName
...@@ -29,8 +35,16 @@ public class InfoManagementApi { ...@@ -29,8 +35,16 @@ public class InfoManagementApi {
* @return * @return
*/ */
@RequestMapping("selectInfoManagement") @RequestMapping("selectInfoManagement")
public List<NewFilesEntity>selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate, @RequestParam("currPage")String currPage, @RequestParam("pageSize")String pageSize){ public List<NewFilesEntity>selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate, @RequestParam("currPage")String currPage, @RequestParam("pageSize")String pageSize, HttpServletRequest requ) {
List<NewFilesEntity> resultList = infoManagementService.selectInfoManagement(beginFileName, endFileName, gajgMc, replaceDate(beginDate), replaceDate(endDate), Long.valueOf(currPage),Long.valueOf(pageSize)); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<NewFilesEntity> resultList = new ArrayList<NewFilesEntity>();
try {
infoManagementService.selectInfoManagement(beginFileName, endFileName, gajgMc, replaceDate(beginDate), replaceDate(endDate), Long.valueOf(currPage),Long.valueOf(pageSize));
}catch (Exception e){
logger.error("起始文件名:" + beginFileName + "截止文件名:" + endFileName + "公安机关名称:" + gajgMc + "起始时间:" + beginDate + "截止时间:" + endDate + "页数:" + currPage + "行数:" + pageSize);
logger.error("Exception 按条件查询制证信息数据异常", e);
}
return resultList; return resultList;
} }
...@@ -45,9 +59,17 @@ public class InfoManagementApi { ...@@ -45,9 +59,17 @@ public class InfoManagementApi {
* @return * @return
*/ */
@RequestMapping("selectCount") @RequestMapping("selectCount")
public long selectCount(@Param("beginFileId")String beginFileId, @Param("endFileId")String endFileId, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate){ public long selectCount(@Param("beginFileId")String beginFileId, @Param("endFileId")String endFileId, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate, HttpServletRequest requ) {
long count= infoManagementService.count(beginFileId,endFileId,gajgMc,replaceDate(beginDate),replaceDate(endDate)); String remoteAddr = requ.getRemoteAddr();
return count; MDC.put("ip", remoteAddr);
long count= 0;
try {
count = infoManagementService.count(beginFileId,endFileId,gajgMc,replaceDate(beginDate),replaceDate(endDate));
}catch (Exception e){
logger.error( "公安机关名称:" + gajgMc + "起始时间:" + beginDate + "截止时间:" + endDate);
logger.error("Exception 查询制证信息数据条数异常", e);
}
return count;
} }
/** /**
...@@ -61,10 +83,18 @@ public class InfoManagementApi { ...@@ -61,10 +83,18 @@ public class InfoManagementApi {
*/ */
@RequestMapping("deleteInfo") @RequestMapping("deleteInfo")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean deleteInfo(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate){ public boolean deleteInfo(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate, HttpServletRequest requ) {
boolean result= infoManagementService.deleteInfo(beginFileName,endFileName,gajgMc,replaceDate(beginDate),replaceDate(endDate)); String remoteAddr = requ.getRemoteAddr();
//更改新文件状态 MDC.put("ip", remoteAddr);
infoManagementService.updatePackageNo(beginFileName,endFileName,gajgMc,replaceDate(beginDate),replaceDate(endDate)); boolean result = true;
try {
result = infoManagementService.deleteInfo(beginFileName,endFileName,gajgMc,replaceDate(beginDate),replaceDate(endDate));
//更改新文件状态
infoManagementService.updatePackageNo(beginFileName,endFileName,gajgMc,replaceDate(beginDate),replaceDate(endDate));
}catch (Exception e){
logger.error("起始文件名:" + beginFileName + "截止文件名:" + endFileName + "公安机关名称:" + gajgMc + "起始时间:" + beginDate + "截止时间:" + endDate);
logger.error("Exception 删除制证信息数据异常", e);
}
return result; return result;
} }
......
...@@ -3,11 +3,15 @@ package com.yxproject.start.api; ...@@ -3,11 +3,15 @@ package com.yxproject.start.api;
import com.yxproject.start.service.DataAuditingService; import com.yxproject.start.service.DataAuditingService;
import com.yxproject.start.service.ReceiptService; import com.yxproject.start.service.ReceiptService;
import com.yxproject.start.service.TaskListService; import com.yxproject.start.service.TaskListService;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -26,6 +30,8 @@ public class ReportApi { ...@@ -26,6 +30,8 @@ public class ReportApi {
@Autowired @Autowired
private ReceiptService receiptService; private ReceiptService receiptService;
Logger logger= Logger.getLogger(ReportApi.class);
/** /**
* 查询报表 * 查询报表
* 数据核验 * 数据核验
...@@ -34,8 +40,16 @@ public class ReportApi { ...@@ -34,8 +40,16 @@ public class ReportApi {
* @return * @return
*/ */
@RequestMapping("queryDataAuditingReport") @RequestMapping("queryDataAuditingReport")
public List<Map<String, Object>> queryDataAuditingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "policeName") String policeName,@RequestParam(value = "policeCode") String policeCode) { public List<Map<String, Object>> queryDataAuditingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "policeName") String policeName,@RequestParam(value = "policeCode") String policeCode, HttpServletRequest requ) {
List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingReport(replaceDate(startDate), replaceDate(endDate),policeName,policeCode); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList <>();
try {
mapList = dataAuditingService.selectDataAuditingReport(replaceDate(startDate), replaceDate(endDate),policeName,policeCode);
}catch (Exception e){
logger.error("开始时间:" + startDate + "结束时间:" + endDate + "公安机关名称:" + policeName + "公安机关代码:" + policeCode);
logger.error("Exception 查询数据核验报表异常", e);
}
return mapList; return mapList;
} }
...@@ -47,8 +61,16 @@ public class ReportApi { ...@@ -47,8 +61,16 @@ public class ReportApi {
* @return * @return
*/ */
@RequestMapping("queryFilmPrintReport") @RequestMapping("queryFilmPrintReport")
public List<Map<String, Object>> queryFilmPrintReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate) { public List<Map<String, Object>> queryFilmPrintReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate, HttpServletRequest requ) {
List<Map<String, Object>> mapList = taskListService.selectFilmReport(replaceDate(startDate), replaceDate(endDate)); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList <>();
try {
mapList = taskListService.selectFilmReport(replaceDate(startDate), replaceDate(endDate));
}catch (Exception e){
logger.error("开始时间:" + startDate + "结束时间:" + endDate);
logger.error("Exception 查询膜打印报表异常", e);
}
return mapList; return mapList;
} }
...@@ -61,9 +83,17 @@ public class ReportApi { ...@@ -61,9 +83,17 @@ public class ReportApi {
* @return * @return
*/ */
@RequestMapping("queryWorkGroupReport") @RequestMapping("queryWorkGroupReport")
public List<Map<String,Object>> queryWorkGroupReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "workGroup") String workGroup) { public List<Map<String,Object>> queryWorkGroupReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "workGroup") String workGroup, HttpServletRequest requ) {
List<Map<String,Object>> map = taskListService.selectWorkGroupReport(replaceDate(startDate), replaceDate(endDate), workGroup); String remoteAddr = requ.getRemoteAddr();
return map; MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList <>();
try {
mapList = taskListService.selectWorkGroupReport(replaceDate(startDate), replaceDate(endDate), workGroup);
}catch (Exception e){
logger.error("开始时间:" + startDate + "结束时间:" + endDate + "工作组:" + workGroup);
logger.error("Exception 查询工作组报表异常", e);
}
return mapList;
} }
/** /**
...@@ -75,8 +105,16 @@ public class ReportApi { ...@@ -75,8 +105,16 @@ public class ReportApi {
* @return * @return
*/ */
@RequestMapping("querySortingReport") @RequestMapping("querySortingReport")
public List<Map<String, Object>> querySortingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "name") String name) { public List<Map<String, Object>> querySortingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "name") String name, HttpServletRequest requ) {
List<Map<String, Object>> mapList = receiptService.selectReceiptReport(replaceDate(startDate), replaceDate(endDate), name); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList <>();
try {
mapList = receiptService.selectReceiptReport(replaceDate(startDate), replaceDate(endDate), name);
}catch (Exception e){
logger.error("开始时间:" + startDate + "结束时间:" + endDate + "分拣人员:" + name);
logger.error("Exception 查询分拣报表异常", e);
}
return mapList; return mapList;
} }
...@@ -88,8 +126,16 @@ public class ReportApi { ...@@ -88,8 +126,16 @@ public class ReportApi {
* @return * @return
*/ */
@RequestMapping("queryQualityCheckReport") @RequestMapping("queryQualityCheckReport")
public List<Map<String, Object>> queryQualityCheckReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate) { public List<Map<String, Object>> queryQualityCheckReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate, HttpServletRequest requ) {
List<Map<String, Object>> mapList = taskListService.selectQualityCheckReport(replaceDate(startDate), replaceDate(endDate)); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList <>();
try {
mapList = taskListService.selectQualityCheckReport(replaceDate(startDate), replaceDate(endDate));
}catch (Exception e){
logger.error("开始时间:" + startDate + "结束时间:" + endDate);
logger.error("Exception 查询质检(仓库)报表异常", e);
}
return mapList; return mapList;
} }
......
package com.yxproject.start.api; package com.yxproject.start.api;
import com.yxproject.start.service.SelectSerialNumberService; import com.yxproject.start.service.SelectSerialNumberService;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -23,43 +26,53 @@ public class SelectApi { ...@@ -23,43 +26,53 @@ public class SelectApi {
@Autowired @Autowired
private SelectSerialNumberService selectSerialNumberService; private SelectSerialNumberService selectSerialNumberService;
@RequestMapping(value = "selectByCard") Logger logger= Logger.getLogger(SelectApi.class);
public Map<String, Object> selectByCard(@RequestParam("id") String string) {
String id = formateAcceptNo(string);
Map<String, Object> resultMap = new HashMap<>();
if (id.length() == 11) {
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByWorkOrderFromYX(id);
List<Map<String, Object>> ACCdata = new ArrayList<>();
List<Map<String, Object>> PRODData = new ArrayList<>();
resultMap.put("workOrderData", workOrderData);
resultMap.put("ACCdata", ACCdata);
resultMap.put("PRODData", PRODData);
} else if (id.length() == 8) {
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByGroupNo(id.replace("e","E").replace("g","G"));
List<Map<String, Object>> ACCdata = new ArrayList<>();
List<Map<String, Object>> PRODData = new ArrayList<>();
resultMap.put("workOrderData", workOrderData);
resultMap.put("ACCdata", ACCdata);
resultMap.put("PRODData", PRODData);
} else if (id.length() == 10 || id.length() == 18) {
//查询是否是特证,如果是,返回新的任务单信息 @RequestMapping(value = "selectByCard")
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList2(id.replace("e","E").replace("g","G")); public Map<String, Object> selectByCard(@RequestParam("id") String id, HttpServletRequest requ) {
if (workOrderData.size() != 0) { String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String, Object> resultMap = null;
try {
resultMap = new HashMap<>();
id = formateAcceptNo(id);
if (id.length() == 11) {
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByWorkOrderFromYX(id);
List<Map<String, Object>> ACCdata = new ArrayList<>();
List<Map<String, Object>> PRODData = new ArrayList<>();
resultMap.put("workOrderData", workOrderData); resultMap.put("workOrderData", workOrderData);
} else { resultMap.put("ACCdata", ACCdata);
List<Map<String, Object>> workOrderData2 = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList(id.replace("e","E").replace("g","G")); resultMap.put("PRODData", PRODData);
resultMap.put("workOrderData", workOrderData2); } else if (id.length() == 8) {
} List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByGroupNo(id);
List<Map<String, Object>> ACCdata = new ArrayList<>();
List<Map<String, Object>> PRODData = new ArrayList<>();
resultMap.put("workOrderData", workOrderData);
resultMap.put("ACCdata", ACCdata);
resultMap.put("PRODData", PRODData);
} else if (id.length() == 10 || id.length() == 18) {
//查询是否是特证,如果是,返回新的任务单信息
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList2(id);
if (workOrderData.size() != 0) {
resultMap.put("workOrderData", workOrderData);
} else {
List<Map<String, Object>> workOrderData2 = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList(id);
resultMap.put("workOrderData", workOrderData2);
}
List<Map<String, Object>> ACCdata = selectSerialNumberService.selectByAcceptNoOrCardIdFromACC(id.replace("e","E").replace("g","G")); List<Map<String, Object>> ACCdata = selectSerialNumberService.selectByAcceptNoOrCardIdFromACC(id);
List<Map<String, Object>> PRODData = selectSerialNumberService.selectByAcceptNoOrCardIdFromPROD(id.replace("e","E").replace("g","G")); List<Map<String, Object>> PRODData = selectSerialNumberService.selectByAcceptNoOrCardIdFromPROD(id);
resultMap.put("ACCdata", ACCdata); resultMap.put("ACCdata", ACCdata);
resultMap.put("PRODData", PRODData); resultMap.put("PRODData", PRODData);
} else { } else {
// return null; // return null;
}
}catch (Exception e){
logger.error("传入的组号8位、受理号10位、身份证号18位、任务单号11位" + id);
logger.error("Exception SelectApi异常", e);
} }
return resultMap; return resultMap;
} }
......
package com.yxproject.start.api; package com.yxproject.start.api;
import com.yxproject.start.service.SpecialCardService; import com.yxproject.start.service.SpecialCardService;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -19,13 +23,24 @@ public class SpecialCardApi { ...@@ -19,13 +23,24 @@ public class SpecialCardApi {
@Autowired @Autowired
private SpecialCardService specialCardService; private SpecialCardService specialCardService;
Logger logger= Logger.getLogger(SpecialCardApi.class);
/** /**
* 查询特殊证件详情 * 查询特殊证件详情
* @param groupNo 组号 * @param groupNo 组号
* @return * @return
*/ */
@RequestMapping("selectSpecialCard") @RequestMapping("selectSpecialCard")
public List<Map> updateState2(@RequestParam("groupNo") String groupNo) { public List<Map> updateState2(@RequestParam("groupNo") String groupNo, HttpServletRequest requ) {
return specialCardService.selectSpecialCardByGroupNo(groupNo); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map> map = new ArrayList<>();
try {
map = specialCardService.selectSpecialCardByGroupNo(groupNo);
}catch (Exception e){
logger.error("组号:" + groupNo );
logger.error("Exception 查询特殊证件详情异常", e);
}
return map;
} }
} }
package com.yxproject.start.api; package com.yxproject.start.api;
import com.yxproject.start.service.PreproPersonService; import com.yxproject.start.service.PreproPersonService;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@RestController @RestController
@RequestMapping("updateState") @RequestMapping("updateState")
public class UpdateStateApi { public class UpdateStateApi {
@Autowired @Autowired
PreproPersonService preproPersonService; PreproPersonService preproPersonService;
Logger logger= Logger.getLogger(UpdateStateApi.class);
@RequestMapping("updateState") @RequestMapping("updateState")
public boolean updateState(@RequestParam(value = "state") String state,@RequestParam(value = "acceptNo") String acceptNo){ public boolean updateState(@RequestParam(value = "state") String state,@RequestParam(value = "acceptNo") String acceptNo, HttpServletRequest requ) {
preproPersonService.uploadState(state,acceptNo); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
try {
preproPersonService.uploadState(state,acceptNo);
}catch (Exception e){
logger.error("状态(是否打包):" + state + "受理号:" + acceptNo);
logger.error("Exception updateState异常", e);
}
return true; return true;
} }
......
...@@ -2,6 +2,8 @@ package com.yxproject.start.api; ...@@ -2,6 +2,8 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.UserInfo; import com.yxproject.start.entity.UserInfo;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException; import org.apache.shiro.authc.UnknownAccountException;
...@@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
...@@ -22,8 +25,12 @@ import java.util.Map; ...@@ -22,8 +25,12 @@ import java.util.Map;
@RequestMapping("user") @RequestMapping("user")
public class UserApi { public class UserApi {
Logger logger= Logger.getLogger(UserApi.class);
@PostMapping("login") @PostMapping("login")
public Map<String, Object> submitLogin(@RequestBody String jsonStr) { public Map<String, Object> submitLogin(@RequestBody String jsonStr, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONObject jsonObject = JSONObject.fromObject(jsonStr); JSONObject jsonObject = JSONObject.fromObject(jsonStr);
String username = jsonObject.getString("username"); String username = jsonObject.getString("username");
String password = jsonObject.getString("password"); String password = jsonObject.getString("password");
...@@ -40,21 +47,33 @@ public class UserApi { ...@@ -40,21 +47,33 @@ public class UserApi {
} catch (UnknownAccountException e) { } catch (UnknownAccountException e) {
resultMap.put("status", 201); resultMap.put("status", 201);
resultMap.put("message", "账号不存在!"); resultMap.put("message", "账号不存在!");
logger.error("不存在的用户名:" + username);
logger.error("", e);
} catch (IncorrectCredentialsException e1) { } catch (IncorrectCredentialsException e1) {
resultMap.put("status", 202); resultMap.put("status", 202);
resultMap.put("message", "密码错误!"); resultMap.put("message", "密码错误!");
logger.error("用户密码错误,用户名:" + username + "错误密码:" + password);
logger.error("", e1);
} catch (Exception e) { } catch (Exception e) {
resultMap.put("status", 500); resultMap.put("status", 500);
resultMap.put("message", "用户名密码错误"); resultMap.put("message", "用户名密码错误");
logger.error("用户名错误:" + username + "错误密码:" + password);
logger.error("Exception 用户登录异常", e);
} }
return resultMap; return resultMap;
} }
@RequestMapping("logout") @RequestMapping("logout")
public void logout() { public void logout( HttpServletRequest requ) {
Subject subject = SecurityUtils.getSubject(); String remoteAddr = requ.getRemoteAddr();
if (subject.isAuthenticated()) { MDC.put("ip", remoteAddr);
subject.logout(); try {
Subject subject = SecurityUtils.getSubject();
if (subject.isAuthenticated()) {
subject.logout();
}
}catch (Exception e){
logger.error("Exception 用户登出异常", e);
} }
} }
......
...@@ -2,11 +2,14 @@ package com.yxproject.start.api; ...@@ -2,11 +2,14 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.PreproPersonEntity; import com.yxproject.start.entity.PreproPersonEntity;
import com.yxproject.start.service.PreproPersonService; import com.yxproject.start.service.PreproPersonService;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
...@@ -21,34 +24,45 @@ import java.util.Map; ...@@ -21,34 +24,45 @@ import java.util.Map;
public class queryPreproPerson { public class queryPreproPerson {
@Autowired @Autowired
private PreproPersonService preproPersonService; private PreproPersonService preproPersonService;
Logger logger= Logger.getLogger(queryPreproPerson.class);
/** /**
* 查询制证数据 * 查询制证数据
*/ */
@RequestMapping("queryPreproPerson") @RequestMapping("queryPreproPerson")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public Map<String,Object> printXmlData(@RequestParam("uploadNo") String uploadNo, @RequestParam("IDCard")String IDCard,@RequestParam("oldFile") String oldFile, @RequestParam("newFile")String newFile, @RequestParam("SSXQDM")String SSXQDM, @RequestParam("cardType")String cardType, @RequestParam("state")String state,@RequestParam("uploadDate")String uploadDate,@RequestParam("currPage")String currPage,@RequestParam("pageSize")String pageSize,@RequestParam("downloadState")String downloadState, HttpServletResponse response){ public Map<String,Object> printXmlData(@RequestParam("uploadNo") String uploadNo, @RequestParam("IDCard")String IDCard,@RequestParam("oldFile") String oldFile, @RequestParam("newFile")String newFile, @RequestParam("SSXQDM")String SSXQDM, @RequestParam("cardType")String cardType, @RequestParam("state")String state,@RequestParam("uploadDate")String uploadDate,@RequestParam("currPage")String currPage,@RequestParam("pageSize")String pageSize,@RequestParam("downloadState")String downloadState, HttpServletResponse response, HttpServletRequest requ) {
List<Map<String, Object>> preproPersonEntities = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate),currPage,pageSize,downloadState); String remoteAddr = requ.getRemoteAddr();
Map<String,Object> map = new LinkedHashMap<>(); MDC.put("ip", remoteAddr);
//todo Map<String,Object> map = null;
List<Map<String, Object>> preproPersonEntityList = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate),downloadState); try {
map.put("total",preproPersonEntityList.size()); map = new LinkedHashMap<>();
int youSum =0; List<Map<String, Object>> preproPersonEntities = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate),currPage,pageSize,downloadState);
int puSum=0; //todo
int invaildCount = 0; List<Map<String, Object>> preproPersonEntityList = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate),downloadState);
for (Map<String, Object> map1 :preproPersonEntityList){ map.put("total",preproPersonEntityList.size());
if ("9".equals(map1.get("CARD_TYPE_ID")+"")){ int youSum =0;
youSum++; int puSum=0;
}else if ("0".equals(map1.get("CARD_TYPE_ID")+"")){ int invaildCount = 0;
puSum++; for (Map<String, Object> map1 :preproPersonEntityList){
} if ("9".equals(map1.get("CARD_TYPE_ID")+"")){
if ("0".equals(map1.get("IS_VALID")+"")){ youSum++;
invaildCount++; }else if ("0".equals(map1.get("CARD_TYPE_ID")+"")){
puSum++;
}
if ("0".equals(map1.get("IS_VALID")+"")){
invaildCount++;
}
} }
map.put("list",preproPersonEntities);
map.put("youSum",youSum);
map.put("puSum",puSum);
map.put("invaildCount",invaildCount);
}catch (Exception e){
logger.error("oldFile:" + uploadNo + "公民身份号码:" + IDCard+ "包号:" + oldFile+ "文件名:" + newFile+ "签发机关:" + SSXQDM+ "制证类型代码(9邮寄0大批):" + cardType + "是否有效(1有效,0无效):" + state + "上传时间:" + uploadDate+ "页数:" + currPage+ "条数:" + pageSize+ "生成时间:" + downloadState);
logger.error("Exception 查询制证数据异常", e);
} }
map.put("list",preproPersonEntities);
map.put("youSum",youSum);
map.put("puSum",puSum);
map.put("invaildCount",invaildCount);
return map; return map;
} }
...@@ -57,13 +71,21 @@ public class queryPreproPerson { ...@@ -57,13 +71,21 @@ public class queryPreproPerson {
*/ */
@RequestMapping("updatePreproPerson") @RequestMapping("updatePreproPerson")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public Map<String,Object> updatePreproPerson(@RequestParam("id") String id, @RequestParam("isValid")String isValid, HttpServletResponse response){ public Map<String,Object> updatePreproPerson(@RequestParam("id") String id, @RequestParam("isValid")String isValid, HttpServletResponse response, HttpServletRequest requ) {
PreproPersonEntity preproPersonEntity = new PreproPersonEntity(); String remoteAddr = requ.getRemoteAddr();
preproPersonEntity.setId(Long.valueOf(id)); MDC.put("ip", remoteAddr);
preproPersonEntity.setIsValid(Long.valueOf(isValid)); Map<String,Object> map = null;
preproPersonService.updatePreproPersonIsValid(preproPersonEntity); try {
Map<String,Object> map = new LinkedHashMap<>(); PreproPersonEntity preproPersonEntity = new PreproPersonEntity();
map.put("msg","成功更新制证数据是否有效"); preproPersonEntity.setId(Long.valueOf(id));
preproPersonEntity.setIsValid(Long.valueOf(isValid));
preproPersonService.updatePreproPersonIsValid(preproPersonEntity);
map = new LinkedHashMap<>();
map.put("msg","成功更新制证数据是否有效");
} catch (Exception e){
logger.error("制证信息ID:" + id + "是否有效(1有效,0无效):" + isValid );
logger.error("Exception 更新制证数据是否有效异常", e);
}
return map; return map;
} }
...@@ -72,11 +94,19 @@ public class queryPreproPerson { ...@@ -72,11 +94,19 @@ public class queryPreproPerson {
*/ */
@RequestMapping("queryPreproPersonCount") @RequestMapping("queryPreproPersonCount")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public Map<String,Object> queryPreproPersonCount(@RequestParam("uploadNo") String uploadNo, @RequestParam("IDCard")String IDCard,@RequestParam("oldFile") String oldFile, @RequestParam("newFile")String newFile, @RequestParam("SSXQDM")String SSXQDM, @RequestParam("cardType")String cardType, @RequestParam("state")String state,@RequestParam("uploadDate")String uploadDate,@RequestParam("downloadState")String downloadState, HttpServletResponse response){ public Map<String,Object> queryPreproPersonCount(@RequestParam("uploadNo") String uploadNo, @RequestParam("IDCard")String IDCard,@RequestParam("oldFile") String oldFile, @RequestParam("newFile")String newFile, @RequestParam("SSXQDM")String SSXQDM, @RequestParam("cardType")String cardType, @RequestParam("state")String state,@RequestParam("uploadDate")String uploadDate,@RequestParam("downloadState")String downloadState, HttpServletResponse response, HttpServletRequest requ) {
Map<String,Object> map = new LinkedHashMap<>(); String remoteAddr = requ.getRemoteAddr();
//todo MDC.put("ip", remoteAddr);
List<Map<String, Object>> preproPersonEntityList = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate),downloadState); Map<String,Object> map = null;
map.put("total",preproPersonEntityList.size()); try {
map = new LinkedHashMap<>();
//todo
List<Map<String, Object>> preproPersonEntityList = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate),downloadState);
map.put("total",preproPersonEntityList.size());
}catch (Exception e){
logger.error("oldFile:" + uploadNo + "公民身份号码:" + IDCard+ "包号:" + oldFile+ "文件名:" + newFile+ "签发机关:" + SSXQDM+ "制证类型代码(9邮寄0大批):" + cardType + "是否有效(1有效,0无效):" + state + "上传时间:" + uploadDate+ "页数:" + "生成时间:" + downloadState);
logger.error("Exception 查询制证数据总数异常", e);
}
return map; return map;
} }
......
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