Commit 12005cfa authored by dahai's avatar dahai

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

# Conflicts:
#	src/main/java/com/yxproject/start/api/FailedCardApi.java
#	src/main/java/com/yxproject/start/api/TaskListApi.java
parents fac08ecb 5b5a3977
......@@ -2,11 +2,15 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.DetailReceiptListEntity;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -20,6 +24,8 @@ public class CardDetailedListApi {
@Autowired
private CardDetailedListService cardDetailedListService;
Logger logger= Logger.getLogger(CardDetailedListApi.class);
/**
* 查询身份证详单
*通过身份证号
......@@ -27,8 +33,16 @@ public class CardDetailedListApi {
* @return
*/
@RequestMapping("findCardDetailedList")
public List<DetailReceiptListEntity> findCardDetailedList(@RequestParam("idCard") String idCard) {
List<DetailReceiptListEntity> list = cardDetailedListService.findCardDetailedListByIdCard(idCard);
public List<DetailReceiptListEntity> findCardDetailedList(@RequestParam("idCard") String idCard, HttpServletRequest requ) {
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;
}
......@@ -40,8 +54,16 @@ public class CardDetailedListApi {
* @return
*/
@RequestMapping("findAllCardDetailedList")
public List<Map<String,Object>> findAllCardDetailedList(@RequestParam("idCard") String idCard) {
List<Map<String,Object>> list = cardDetailedListService.findAllCardDetailedListByIdCard(idCard);
public List<Map<String,Object>> findAllCardDetailedList(@RequestParam("idCard") String idCard, HttpServletRequest requ) {
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;
}
......
......@@ -6,6 +6,7 @@ import com.yxproject.start.utils.ExportExcel;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -31,6 +32,8 @@ public class ExportExcelApi {
@Autowired
private ReceiptService receiptService;
Logger logger= Logger.getLogger(ExportExcelApi.class);
/**
* 导出公安网数据
*/
......@@ -42,7 +45,7 @@ public class ExportExcelApi {
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list"));
// String type = jsonObject.get("type").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.setCharacterEncoding("UTF-8");
String dateTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd");
......@@ -59,21 +62,31 @@ public class ExportExcelApi {
return b;
} catch (FileNotFoundException e) {
e.printStackTrace();
logger.error("导出文件名:" + fout);
logger.error("FileNotFoundException 导出公安网数据未找到异常", e);
} catch (IOException e) {
e.printStackTrace();
logger.error("导出文件名:" + fout);
logger.error("IOException 导出公安网数据IO异常", e);
}
return null;
}
/**
* 导出交接单
*/
@RequestMapping("printReceiptExcelData")
public Map<String, Object> printReceiptExcelData(@RequestBody String list) {
JSONObject jsonObject = JSONObject.fromObject(list);
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list"));
String type = jsonObject.get("type").toString();
Map<String, Object> map = receiptService.selectReceiptList(jsonArray, Long.valueOf(type));
public Map<String, Object> printReceiptExcelData(@RequestBody String list, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONObject jsonObject = null;
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.setCharacterEncoding("UTF-8");
// String dateTime = DateFormatUtils.format(new Date(), "yyyy_MM_dd");
......@@ -97,6 +110,11 @@ public class ExportExcelApi {
// e.printStackTrace();
// }
// return null;
}catch (Exception e) {
e.printStackTrace();
logger.error("异常参数:" + jsonObject);
logger.error("Exception 导出交接单异常", e);
}
return map;
}
......
......@@ -7,6 +7,8 @@ import com.yxproject.start.service.FilesService;
import com.yxproject.start.service.NewFilesService;
import com.yxproject.start.service.PreproPersonService;
import com.yxproject.start.utils.ZipUtils;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
......@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
......@@ -39,13 +42,16 @@ public class ExportXMLApi {
@Autowired
private FilesService filesService;
Logger logger= Logger.getLogger(ExportXMLApi.class);
/**
* 导出制证数据包
*/
@RequestMapping("printXmlData")
// @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实现文件下载的时候,避免浏览器自动打开文件
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));
......@@ -140,6 +146,8 @@ public class ExportXMLApi {
xml = createToMakePackageXML(preproPersonEntityList1, filesEntity, "\\zhang");
} catch (IOException e) {
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);
}
......@@ -155,6 +163,8 @@ public class ExportXMLApi {
out = new ZipOutputStream(response.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
logger.error("制证包数据打包名:" + zipName);
logger.error("IOException 制证包数据打包下载IO异常", e);
}
try {
for (String document : documentList) {
......@@ -163,15 +173,17 @@ public class ExportXMLApi {
}
} catch (Exception e) {
e.printStackTrace();
logger.error("制证包数据打包名:" + zipName);
logger.error("Exception 制证包数据打包下载异常", e);
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
logger.error("制证包数据打包名:" + zipName);
logger.error("IOException 制证包数据打包下载IO异常", e);
}
}
}
return null;
}
......@@ -283,6 +295,7 @@ public class ExportXMLApi {
writer.close();
} catch (IOException e) {
e.printStackTrace();
logger.error("IOException XML文件生成异常", e);
}
System.out.println("XML文件生成成功..." + new Date());
return "D:\\XML\\" + "ZAGL_ZZJH_" + filesEntity.getDwdm() + simpleDateFormat.format(new Date()) + cardType + files_seq + ".xml";
......
......@@ -8,6 +8,7 @@ import com.yxproject.start.service.FailedCardService;
import com.yxproject.start.service.TaskListService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -34,14 +35,23 @@ public class FailedCardApi {
@Autowired
private TaskListService taskListService;
Logger logger= Logger.getLogger(FailedCardApi.class);
/**
* 查询所有废证类型
*
* @return
*/
@RequestMapping("selectFailedCardDic")
public List<FailedCardReasonDicEntity> selectFailedCardDic() {
List<FailedCardReasonDicEntity> resultList = failedCardService.selectFailedCardDic();
public List<FailedCardReasonDicEntity> selectFailedCardDic(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<FailedCardReasonDicEntity> resultList = new ArrayList <FailedCardReasonDicEntity>();
try {
resultList = failedCardService.selectFailedCardDic();
}catch (Exception e){
logger.error("Exception 查询所有废证类型异常", e);
}
return resultList;
}
......@@ -52,9 +62,13 @@ public class FailedCardApi {
* @return
*/
@RequestMapping("selectInfoByCardId")
public List<Map<String, Object>> selectInfoByCardId(@RequestBody String jsonStr ) {
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
public List<Map<String, Object>> selectInfoByCardId(@RequestBody String jsonStr, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONArray jsonarray = new JSONArray();
List<Map<String, Object>> resultList = new ArrayList<>();
try {
jsonarray = JSONArray.fromObject(jsonStr);
for (Object o : jsonarray) {
String acceptNo = o.toString().replace("e", "E").replace("g", "G").replace("l","L");
Map<String, Object> resultMap = failedCardService.selectInfoByCardId(acceptNo);
......@@ -66,12 +80,16 @@ public class FailedCardApi {
}
resultList.add(resultMap);
}
}catch (Exception e){
logger.error("身份证号或受理号:" + jsonarray);
logger.error("Exception 根据身份证号或受理号查询身份信息及组号异常", e);
}
return resultList;
}
/**
* 查询提交人上传的废证详情
*
* @param date 提交日期
* @param name 提交人姓名
* @param startDate 提交起始日期
* @param endDate 提交结束日期
......@@ -93,8 +111,17 @@ public class FailedCardApi {
* @return
*/
@RequestMapping("deleteFailedCardInfo")
public boolean deleteFailedCardInfo(@RequestParam("failedCardId") String failedCardId) {
return failedCardService.deleteFailedCardInfo(failedCardId);
public boolean deleteFailedCardInfo(@RequestParam("failedCardId") String failedCardId, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
boolean failedCardInfo = true;
try {
failedCardInfo = failedCardService.deleteFailedCardInfo(failedCardId);
}catch (Exception e){
logger.error("废证ID:" + failedCardId);
logger.error("Exception 删除提交人上传的废证详情异常", e);
}
return failedCardInfo;
}
......@@ -106,22 +133,30 @@ public class FailedCardApi {
*/
@RequestMapping("insertFailedCard")
@Transactional(rollbackFor = Exception.class)
public Boolean insertFailedCard(@RequestBody String jsonStr) {
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
public Boolean insertFailedCard(@RequestBody String jsonStr, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONArray jsonarray = new JSONArray();
try{
jsonarray = JSONArray.fromObject(jsonStr);
for (Object o : jsonarray) {
JSONObject jsonObject = (JSONObject) o;
String name = ((JSONObject) o).getString("name");
String acceptNo = formateAcceptNo(((JSONObject) o).getString("cardId"));
String result = failedCardService.selectSpecialCard(acceptNo);
String result = failedCardService.selectSpecialCard(((JSONObject) o).getString("cardId"));
Map<String, Object> idMap;
//判断是否是特殊证件
if (result != null && result != "") {
idMap = failedCardService.selectDataById(acceptNo);
idMap = failedCardService.selectDataById(jsonObject.getString("cardId"));
} else {
idMap = failedCardService.selectCountIdByCardId(acceptNo);
idMap = failedCardService.selectCountIdByCardId(jsonObject.getString("cardId"));
}
int initiator = 5;
failedCardService.insertFailedCard(jsonObject.getString("failedCardReasonId"), idMap.get("ACCEPT_NO").toString(), idMap.get("TASK_ID").toString(), String.valueOf(initiator), jsonObject.getString("note"), idMap.get("WORK_GROUP").toString(),name);
failedCardService.insertFailedCard(jsonObject.getString("failedCardReasonId"), idMap.get("ACCEPT_NO").toString(), idMap.get("TASK_ID").toString(), String.valueOf(initiator), jsonObject.getString("note"), idMap.get("WORK_GROUP").toString(), name);
}
}catch (Exception e){
logger.error("身份证号或受理号:" + jsonarray);
logger.error("Exception 添加废证异常", e);
}
return true;
}
......@@ -134,15 +169,22 @@ public class FailedCardApi {
*/
@RequestMapping("insertRemaining")
@Transactional(rollbackFor = Exception.class)
public Boolean insertRemaining(@RequestBody String jsonStr) {
JSONObject jsonObject = JSONObject.fromObject(jsonStr);
JSONArray jsonarray = JSONArray.fromObject(jsonObject.get("list"));
String name = jsonObject.get("name").toString();
TaskEntity taskEntity = new TaskEntity();
public Boolean insertRemaining(@RequestBody String jsonStr, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONObject jsonObject = new JSONObject();
JSONArray jsonarray = new JSONArray();
String name;
TaskEntity taskEntity;
try {
jsonObject = JSONObject.fromObject(jsonStr);
jsonarray = JSONArray.fromObject(jsonObject.get("list"));
name = jsonObject.get("name").toString();
taskEntity = new TaskEntity();
for (int i = 0; i < jsonarray.size(); i++) {
/*查询生成任务单需要的数据*/
Map<String, Object> resultMap = failedCardService.selectTaskListDate((jsonarray.get(i)+"").replace("e","E").replace("g","G"));
Map<String, Object> resultMap = failedCardService.selectTaskListDate((String) jsonarray.get(i));
String countyCode = resultMap.get("COUNTY_CODE").toString();
Long cardType = Long.valueOf((BigDecimal) resultMap.get("CARD_TYPE") + "");
String acceptNo = (String) resultMap.get("ACCEPT_NO");
......@@ -167,6 +209,10 @@ public class FailedCardApi {
specialCardEntity.setGroupNo(acceptNo.substring(0, 8));
failedCardService.addSpecialCard(specialCardEntity);
}
}catch (Exception e){
logger.error("身份证号或受理号:" + jsonObject);
logger.error("Exception 生成余证异常", e);
}
return true;
}
......@@ -176,8 +222,15 @@ public class FailedCardApi {
* @return List
*/
@RequestMapping("selectCardType")
public List<String> selectCardType() {
List<String> result = failedCardService.selectCardType();
public List<String> selectCardType(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<String> result = new ArrayList <>();
try {
result = failedCardService.selectCardType();
}catch (Exception e){
logger.error("Exception 查询所有证件类型异常", e);
}
return result;
}
......@@ -189,10 +242,14 @@ public class FailedCardApi {
*/
@RequestMapping("insertBackCard")
@Transactional(rollbackFor = Exception.class)
public boolean insertBackCard(@RequestBody String jsonStr) {
public Boolean insertBackCard(@RequestBody String jsonStr, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
TaskEntity taskEntity;
JSONArray jsonarray = new JSONArray();
try {
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
TaskEntity taskEntity = new TaskEntity();
jsonarray = JSONArray.fromObject(jsonStr);
taskEntity = new TaskEntity();
String str2 = null;
for (int i = 0; i < jsonarray.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonarray.get(i);
......@@ -222,6 +279,8 @@ public class FailedCardApi {
failedCardService.insertGroupNo(String.valueOf(groupDataMap.get("GROUP_NO")), String.valueOf(groupDataMap.get("TASK_ID")), (Long) groupDataMap.get("VALID_COUNT"), (Long) groupDataMap.get("INVALID_COUNT"));
}
} catch (NullPointerException e) {
logger.error("身份证号或受理号:" + jsonarray);
logger.error("生成历史回迁证异常", e);
return false;
}
return true;
......
package com.yxproject.start.api;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("FilesAnalysis")
public class FilesAnalysisApi {
@Autowired
private PersonPostService personPostService;
Logger logger= Logger.getLogger(FilesAnalysisApi.class);
/**
* 文件解析 修改解析状态
* @param fileId
......@@ -19,8 +25,15 @@ public class FilesAnalysisApi {
* @return
*/
@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) {
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;
}
}
......@@ -3,12 +3,16 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.NewFilesEntity;
import com.yxproject.start.service.InfoManagementService;
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.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
@RestController
......@@ -17,6 +21,8 @@ public class InfoManagementApi {
@Autowired
private InfoManagementService infoManagementService;
Logger logger= Logger.getLogger(InfoManagementApi.class);
/**
* 按条件查询制证信息数据
* @param beginFileName
......@@ -29,8 +35,16 @@ public class InfoManagementApi {
* @return
*/
@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){
List<NewFilesEntity> resultList = infoManagementService.selectInfoManagement(beginFileName, endFileName, gajgMc, replaceDate(beginDate), replaceDate(endDate), Long.valueOf(currPage),Long.valueOf(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) {
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;
}
......@@ -45,8 +59,16 @@ public class InfoManagementApi {
* @return
*/
@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){
long count= infoManagementService.count(beginFileId,endFileId,gajgMc,replaceDate(beginDate),replaceDate(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) {
String remoteAddr = requ.getRemoteAddr();
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 {
*/
@RequestMapping("deleteInfo")
@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){
boolean result= infoManagementService.deleteInfo(beginFileName,endFileName,gajgMc,replaceDate(beginDate),replaceDate(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) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
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;
}
......
......@@ -9,6 +9,8 @@ import com.yxproject.start.utils.YXJSONResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -40,6 +42,8 @@ public class ReadExcelApi {
@Autowired
FileNameDicService fileNameDicService;
Logger logger= Logger.getLogger(ReadExcelApi.class);
/**
* 导入个人邮寄信息表
*/
......@@ -48,6 +52,8 @@ public class ReadExcelApi {
@Produces(MediaType.APPLICATION_JSON)
@Transactional(rollbackFor = Exception.class)
public boolean ReadPersonPost(@RequestParam("formStartTime") String startDate,@RequestParam("formDeadLine") String endDate, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxresp = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
......@@ -80,7 +86,7 @@ public class ReadExcelApi {
// 如果fileitem中封装的是普通输入项的数据
// 如果fileitem中封装的是上传文件
// 得到上传的文件名称
filename = item.getName();
filename = item.getOriginalFilename();
try {
// 如果fileitem中封装的是普通输入项的数据
// 如果fileitem中封装的是上传文件
......@@ -92,6 +98,8 @@ public class ReadExcelApi {
item.transferTo(file);
} catch (IOException e) {
e.printStackTrace();
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("", e);
}
ReadExcel readExcel = new ReadExcel();
List list1 = readExcel.readExcel(file);
......@@ -142,6 +150,8 @@ public class ReadExcelApi {
personPostService.savePersonPost(entityList);
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("", e);
yxresp.outPutError("Exception", "上传文件时发生错误,非法XML文件:" + filename);
continue;
} finally {
......@@ -150,6 +160,8 @@ public class ReadExcelApi {
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("", e);
yxresp.outPutError("FileUploadException", "文件上载发生异常:" + e.getMessage());
} finally {
return true;
......@@ -158,7 +170,8 @@ public class ReadExcelApi {
}
}
}catch (Exception e){
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("Exception 导入个人邮寄信息表异常", e);
}finally {
}
......@@ -174,10 +187,17 @@ public class ReadExcelApi {
* @return
*/
@RequestMapping("queryPersonPost")
public String queryPersonPost(@RequestParam("fileName") String fileName,@RequestParam("analysisState") String analysisState,@RequestParam("uploadDate") String uploadDate, @RequestParam("currPage") String currPage,@RequestParam("pageSize") String pageSize) {
List<FileNameDicEntity> fileNameDicEntities = fileNameDicService.queryFileNameDic(replaceDate(uploadDate),replaceNullString(fileName), Long.valueOf(analysisState), Long.valueOf(currPage), Long.valueOf(pageSize));
public String queryPersonPost(@RequestParam("fileName") String fileName,@RequestParam("analysisState") String analysisState,@RequestParam("uploadDate") String uploadDate, @RequestParam("currPage") String currPage,@RequestParam("pageSize") String pageSize, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
try {
List<FileNameDicEntity> fileNameDicEntities = fileNameDicService.queryFileNameDic(replaceDate(uploadDate),replaceNullString(fileName), Long.valueOf(analysisState), Long.valueOf(currPage), Long.valueOf(pageSize));
yxjsonResponse.outPutSuccess(fileNameDicEntities);
}catch (Exception e){
logger.error("文件名:" + fileName + "是否解析1-解析,0-未解析:" + analysisState + "上传时间:" + uploadDate + "页数:" + currPage + "条数:" + pageSize);
logger.error("Exception 查询个人邮寄解析信息异常", e);
}
return yxjsonResponse.toJSONString();
}
......@@ -188,19 +208,34 @@ public class ReadExcelApi {
* @return
*/
@RequestMapping("queryPersonPostCount")
public String queryPersonPostCount(@RequestParam("fileName") String fileName,@RequestParam("analysisState") String analysisState,@RequestParam("uploadDate") String uploadDate) {
int i = fileNameDicService.queryFileNameDicCount(replaceDate(uploadDate),replaceNullString(fileName), Long.valueOf(analysisState));
public String queryPersonPostCount(@RequestParam("fileName") String fileName,@RequestParam("analysisState") String analysisState,@RequestParam("uploadDate") String uploadDate, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
try {
int i = fileNameDicService.queryFileNameDicCount(replaceDate(uploadDate),replaceNullString(fileName), Long.valueOf(analysisState));
yxjsonResponse.outPutSuccess(i+"");
}catch (Exception e){
logger.error("文件名:" + fileName + "是否解析1-解析,0-未解析:" + analysisState + "上传时间:" + uploadDate);
logger.error("Exception 查询个人邮寄解析信息总数量异常", e);
}
return yxjsonResponse.toJSONString();
}
@RequestMapping("deleteByFileId")
public Map<String,String> deleteFileById(@RequestParam("fileId")String fileId){
public Map<String,String> deleteFileById(@RequestParam("fileId")String fileId, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String,String> map = null;
try {
map = new HashMap<>();
fileNameDicService.deleteFileByFileId(fileId);
Map<String,String> map = new HashMap<>();
map.put("msg","删除成功");
}catch (Exception e){
logger.error("文件名:" + fileId);
logger.error("Exception 通过file_ID删除个人邮寄解析信息异常", e);
}
return map;
}
......
......@@ -9,6 +9,8 @@ import com.yxproject.start.utils.YXJSONResponse;
import com.yxproject.start.utils.YXStringUtils;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.dom4j.DocumentException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -36,6 +38,8 @@ public class ReadXmlApi {
@Autowired
private ImportXmlService importXmlService;
Logger logger= Logger.getLogger(ReadXmlApi.class);
/**
* 导入检测XML
*
......@@ -49,6 +53,8 @@ public class ReadXmlApi {
@Produces(MediaType.APPLICATION_JSON)
@Transactional(rollbackFor = Exception.class)
public boolean getXMLToCheck(@Context HttpServletResponse resp, @Context HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxresp = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
String filename = "";
......@@ -89,18 +95,26 @@ public class ReadXmlApi {
idcardsFactory(idCardFactory.extractIDCard(str,date));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
logger.error("上传文件名" + filename );
logger.error("UnsupportedEncodingException 上传文件时发现文件编码错误", e);
yxresp.outPutError("UnsupportedEncodingException", "上传文件时发现文件编码错误:" + e.getMessage());
continue;
} catch (IOException e) {
e.printStackTrace();
logger.error("上传文件名" + filename );
logger.error("IOException 上传文件时发生IO错误", e);
yxresp.outPutError("IOException", "上传文件时发生IO错误:" + e.getMessage());
continue;
} catch (DocumentException e) {
e.printStackTrace();
logger.error("上传文件名" + filename );
logger.error("DocumentException 上传文件时发生IO错误", e);
yxresp.outPutError("DocumentException", "上传文件时发生IO错误:" + e.getMessage());
continue;
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名" + filename );
logger.error("Exception 上传文件时发生错误,非法XML文件", e);
yxresp.outPutError("Exception", "上传文件时发生错误,非法XML文件:" + filename);
continue;
}
......@@ -109,6 +123,8 @@ public class ReadXmlApi {
}
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名" + filename );
logger.error("FileUploadException 文件上传发生异常", e);
yxresp.outPutError("FileUploadException", "文件上传发生异常:" + e.getMessage());
} finally {
return true;
......@@ -128,9 +144,12 @@ public class ReadXmlApi {
* @return
*/
@RequestMapping("queryPersonXML")
public String queryPersonXMLCount(@RequestParam("importDate") String importDate,@RequestParam("currPage") String currPage,@RequestParam("pageSize") String pageSize, HttpServletResponse resp) {
public String queryPersonXMLCount(@RequestParam("importDate") String importDate,@RequestParam("currPage") String currPage,@RequestParam("pageSize") String pageSize, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
try {
List<CountDataEntity> countDataEntities = importXmlService.queryPersonXml(replaceDate(importDate),Long.valueOf(currPage)*Long.valueOf(pageSize) ,(Long.valueOf(currPage)-1)*Long.valueOf(pageSize)+1);
Map<String,Object> map = new LinkedHashMap<>();
for (int i=0;i<countDataEntities.size();i++){
if(map!=null && map.containsKey(countDataEntities.get(i).getUploadDate()+"")){
......@@ -179,12 +198,12 @@ public class ReadXmlApi {
}else {
resultMap.put("mapList",mapList);
}
resultMap.put("count",mapList.size());
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(resultMap);
}catch (Exception e){
logger.error("上传时间:" + importDate + "页数:" + currPage + "条数:" + pageSize);
logger.error("Exception 查询XML解析信息异常", e);
}
return yxjsonResponse.toJSONString();
}
......@@ -195,11 +214,18 @@ public class ReadXmlApi {
* @return
*/
@RequestMapping("queryPersonXMLCount")
public String queryPersonXMLCount(@RequestParam("importDate") String importDate, HttpServletResponse resp) {
int i = importXmlService.queryPersonXmlCount(replaceDate(importDate));
public String queryPersonXMLCount(@RequestParam("importDate") String importDate, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
try {
int i = importXmlService.queryPersonXmlCount(replaceDate(importDate));
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(i+"");
}catch (Exception e){
logger.error("上传时间:" + importDate);
logger.error("Exception 查询XML解析信息异常", e);
}
return yxjsonResponse.toJSONString();
}
......
......@@ -3,11 +3,15 @@ package com.yxproject.start.api;
import com.yxproject.start.service.DataAuditingService;
import com.yxproject.start.service.ReceiptService;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -26,6 +30,8 @@ public class ReportApi {
@Autowired
private ReceiptService receiptService;
Logger logger= Logger.getLogger(ReportApi.class);
/**
* 查询报表
* 数据核验
......@@ -34,8 +40,16 @@ public class ReportApi {
* @return
*/
@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) {
List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingReport(replaceDate(startDate), replaceDate(endDate),policeName,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) {
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;
}
......@@ -47,8 +61,16 @@ public class ReportApi {
* @return
*/
@RequestMapping("queryFilmPrintReport")
public List<Map<String, Object>> queryFilmPrintReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate) {
List<Map<String, Object>> mapList = taskListService.selectFilmReport(replaceDate(startDate), replaceDate(endDate));
public List<Map<String, Object>> queryFilmPrintReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate, HttpServletRequest requ) {
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;
}
......@@ -61,9 +83,17 @@ public class ReportApi {
* @return
*/
@RequestMapping("queryWorkGroupReport")
public List<Map<String,Object>> queryWorkGroupReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "workGroup") String workGroup) {
List<Map<String,Object>> map = taskListService.selectWorkGroupReport(replaceDate(startDate), replaceDate(endDate), workGroup);
return map;
public List<Map<String,Object>> queryWorkGroupReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "workGroup") String workGroup, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
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 {
* @return
*/
@RequestMapping("querySortingReport")
public List<Map<String, Object>> querySortingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "name") String name) {
List<Map<String, Object>> mapList = receiptService.selectReceiptReport(replaceDate(startDate), replaceDate(endDate), name);
public List<Map<String, Object>> querySortingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "name") String name, HttpServletRequest requ) {
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;
}
......@@ -88,8 +126,16 @@ public class ReportApi {
* @return
*/
@RequestMapping("queryQualityCheckReport")
public List<Map<String, Object>> queryQualityCheckReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate) {
List<Map<String, Object>> mapList = taskListService.selectQualityCheckReport(replaceDate(startDate), replaceDate(endDate));
public List<Map<String, Object>> queryQualityCheckReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate, HttpServletRequest requ) {
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;
}
......
package com.yxproject.start.api;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -23,10 +26,16 @@ public class SelectApi {
@Autowired
private SelectSerialNumberService selectSerialNumberService;
Logger logger= Logger.getLogger(SelectApi.class);
@RequestMapping(value = "selectByCard")
public Map<String, Object> selectByCard(@RequestParam("id") String string) {
String id = formateAcceptNo(string);
Map<String, Object> resultMap = new HashMap<>();
public Map<String, Object> selectByCard(@RequestParam("id") String id, HttpServletRequest requ) {
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<>();
......@@ -35,7 +44,7 @@ public class SelectApi {
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>> workOrderData = selectSerialNumberService.selectByGroupNo(id);
List<Map<String, Object>> ACCdata = new ArrayList<>();
List<Map<String, Object>> PRODData = new ArrayList<>();
resultMap.put("workOrderData", workOrderData);
......@@ -44,16 +53,16 @@ public class SelectApi {
} else if (id.length() == 10 || id.length() == 18) {
//查询是否是特证,如果是,返回新的任务单信息
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList2(id.replace("e","E").replace("g","G"));
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.replace("e","E").replace("g","G"));
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>> PRODData = selectSerialNumberService.selectByAcceptNoOrCardIdFromPROD(id.replace("e","E").replace("g","G"));
List<Map<String, Object>> ACCdata = selectSerialNumberService.selectByAcceptNoOrCardIdFromACC(id);
List<Map<String, Object>> PRODData = selectSerialNumberService.selectByAcceptNoOrCardIdFromPROD(id);
resultMap.put("ACCdata", ACCdata);
resultMap.put("PRODData", PRODData);
......@@ -61,6 +70,10 @@ public class SelectApi {
} else {
// return null;
}
}catch (Exception e){
logger.error("传入的组号8位、受理号10位、身份证号18位、任务单号11位" + id);
logger.error("Exception SelectApi异常", e);
}
return resultMap;
}
......
package com.yxproject.start.api;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -19,13 +23,24 @@ public class SpecialCardApi {
@Autowired
private SpecialCardService specialCardService;
Logger logger= Logger.getLogger(SpecialCardApi.class);
/**
* 查询特殊证件详情
* @param groupNo 组号
* @return
*/
@RequestMapping("selectSpecialCard")
public List<Map> updateState2(@RequestParam("groupNo") String groupNo) {
return specialCardService.selectSpecialCardByGroupNo(groupNo);
public List<Map> updateState2(@RequestParam("groupNo") String groupNo, HttpServletRequest requ) {
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;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("updateState")
public class UpdateStateApi {
@Autowired
PreproPersonService preproPersonService;
Logger logger= Logger.getLogger(UpdateStateApi.class);
@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) {
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;
}
......
......@@ -2,6 +2,8 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.UserInfo;
import net.sf.json.JSONObject;
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException;
......@@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.LinkedHashMap;
import java.util.Map;
......@@ -22,8 +25,12 @@ import java.util.Map;
@RequestMapping("user")
public class UserApi {
Logger logger= Logger.getLogger(UserApi.class);
@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);
String username = jsonObject.getString("username");
String password = jsonObject.getString("password");
......@@ -40,22 +47,34 @@ public class UserApi {
} catch (UnknownAccountException e) {
resultMap.put("status", 201);
resultMap.put("message", "账号不存在!");
logger.error("不存在的用户名:" + username);
logger.error("", e);
} catch (IncorrectCredentialsException e1) {
resultMap.put("status", 202);
resultMap.put("message", "密码错误!");
logger.error("用户密码错误,用户名:" + username + "错误密码:" + password);
logger.error("", e1);
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message", "用户名密码错误");
logger.error("用户名错误:" + username + "错误密码:" + password);
logger.error("Exception 用户登录异常", e);
}
return resultMap;
}
@RequestMapping("logout")
public void logout() {
public void logout( HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
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;
import com.yxproject.start.entity.PreproPersonEntity;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -21,14 +24,21 @@ import java.util.Map;
public class queryPreproPerson {
@Autowired
private PreproPersonService preproPersonService;
Logger logger= Logger.getLogger(queryPreproPerson.class);
/**
* 查询制证数据
*/
@RequestMapping("queryPreproPerson")
// @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) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String,Object> map = null;
try {
map = new LinkedHashMap<>();
List<Map<String, Object>> preproPersonEntities = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate),currPage,pageSize,downloadState);
Map<String,Object> 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());
......@@ -49,6 +59,10 @@ public class queryPreproPerson {
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);
}
return map;
}
......@@ -57,13 +71,21 @@ public class queryPreproPerson {
*/
@RequestMapping("updatePreproPerson")
// @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) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String,Object> map = null;
try {
PreproPersonEntity preproPersonEntity = new PreproPersonEntity();
preproPersonEntity.setId(Long.valueOf(id));
preproPersonEntity.setIsValid(Long.valueOf(isValid));
preproPersonService.updatePreproPersonIsValid(preproPersonEntity);
Map<String,Object> map = new LinkedHashMap<>();
map = new LinkedHashMap<>();
map.put("msg","成功更新制证数据是否有效");
} catch (Exception e){
logger.error("制证信息ID:" + id + "是否有效(1有效,0无效):" + isValid );
logger.error("Exception 更新制证数据是否有效异常", e);
}
return map;
}
......@@ -72,11 +94,19 @@ public class queryPreproPerson {
*/
@RequestMapping("queryPreproPersonCount")
// @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){
Map<String,Object> map = new LinkedHashMap<>();
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) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String,Object> map = null;
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;
}
......
......@@ -4,7 +4,7 @@ server:
spring:
datasource:
driver-class-name: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@192.168.1.102:1521:yingxin
url: jdbc:oracle:thin:@192.168.10.208:1521:yingxin
username: yingxin
password: yingxin
servlet:
......
package com.yxproject.start;
import com.yxproject.start.api.SelectApi;
public class test {
public static void main(String[] args){
SelectApi selectApi = new SelectApi();
selectApi.selectByCard("20190305001");
}
}
//package com.yxproject.start;
//
//import com.yxproject.start.api.SelectApi;
//
//public class test {
// public static void main(String[] args){
// SelectApi selectApi = new SelectApi();
// selectApi.selectByCard("20190305001");
// }
//}
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