Commit 7ba0b811 authored by dahai's avatar dahai

push

parent f97ca76b
......@@ -37,7 +37,7 @@ public class AdminApi {
@Autowired
private SysRoleService sysRoleService;
Logger logger= Logger.getLogger(AdminApi.class);
Logger logger = Logger.getLogger(AdminApi.class);
@RequestMapping("test")
public String hello() {
......@@ -57,7 +57,7 @@ public class AdminApi {
List<UserInfo> list = new ArrayList<UserInfo>();
try {
list = userInfoService.getAllUserInfo();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 获得用户列表异常", e);
}
return list;
......@@ -90,7 +90,7 @@ public class AdminApi {
} else {
map.put("resultMsg", "添加失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("添加用户参数:" + jsonObject);
logger.error("Exception 用户添加异常", e);
}
......@@ -112,7 +112,7 @@ public class AdminApi {
map = new HashMap<>();
UserInfo userInfo = userInfoService.getUserInfoByUserId(Integer.parseInt(userId));
map.put("user", userInfo);
}catch (Exception e){
} catch (Exception e) {
logger.error("用户ID:" + userId);
logger.error("Exception 通过id查询用户异常", e);
}
......@@ -141,7 +141,7 @@ public class AdminApi {
} else {
map.put("returnMsg", "删除失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("用户ID:" + userId);
logger.error("Exception 用户删除异常", e);
}
......@@ -168,7 +168,7 @@ public class AdminApi {
} else {
map.put("returnMsg", "启用失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("用户ID:" + userId);
logger.error("Exception 用户删除异常", e);
}
......@@ -180,10 +180,10 @@ public class AdminApi {
public List<SysRole> selectAllRole(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<SysRole> list = new ArrayList <SysRole>();
List<SysRole> list = new ArrayList<SysRole>();
try {
list = sysRoleService.getAllRoleInfo();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 获取角色列表异常", e);
}
return list;
......@@ -193,10 +193,11 @@ public class AdminApi {
public List<SysPermission> selectAllPermission(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<SysPermission> list = new ArrayList <SysPermission>();;
List<SysPermission> list = new ArrayList<SysPermission>();
;
try {
list = sysPermissionService.getAllPermission();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 获取权限列表异常", e);
}
return list;
......@@ -223,7 +224,7 @@ public class AdminApi {
} else {
map.put("returnMsg", "删除失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("id:" + permissionId);
logger.error("Exception 权限删除异常", e);
}
......@@ -250,7 +251,7 @@ public class AdminApi {
} else {
map.put("returnMsg", "启用失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("id:" + permissionId);
logger.error("Exception 权限启用异常", e);
}
......@@ -272,7 +273,7 @@ public class AdminApi {
map = new HashMap<>();
SysPermission sysPermission = sysPermissionService.getPermissionByPId(Integer.parseInt(permissionId));
map.put("permission", sysPermission);
}catch (Exception e){
} catch (Exception e) {
logger.error("id:" + permissionId);
logger.error("Exception 通过id查询权限异常", e);
}
......@@ -294,7 +295,7 @@ public class AdminApi {
map = new HashMap<>();
SysRole sysRole = sysRoleService.getRoleByRoleId(Integer.parseInt(roleId));
map.put("role", sysRole);
}catch (Exception e){
} catch (Exception e) {
logger.error("id:" + roleId);
logger.error("Exception 通过id查询角色异常", e);
}
......@@ -338,7 +339,7 @@ public class AdminApi {
} else {
map.put("resultMsg", "添加失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("权限添加参数:" + jsonObject);
logger.error("Exception 添加权限异常", e);
}
......@@ -357,10 +358,10 @@ public class AdminApi {
public List<SysRole> userInfoAdd(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<SysRole> list = new ArrayList <SysRole>();
List<SysRole> list = new ArrayList<SysRole>();
try {
list = sysRoleService.getAllActiveRoleInfo();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 查询所有非锁定角色异常", e);
}
return list;
......@@ -376,10 +377,10 @@ public class AdminApi {
public List<SysPermission> getAllActivePermissionList(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<SysPermission> list = new ArrayList <SysPermission>();
List<SysPermission> list = new ArrayList<SysPermission>();
try {
list = sysPermissionService.getAllActivePermission();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 查询所有非锁定权限异常", e);
}
return list;
......@@ -430,7 +431,7 @@ public class AdminApi {
* @return
*/
@RequestMapping("roleAdd")
public Map<String, String> roleAdd(@RequestBody String jsonStr, HttpServletResponse resp,HttpServletRequest requ) {
public Map<String, String> roleAdd(@RequestBody String jsonStr, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
resp.setCharacterEncoding("UTF-8");
......@@ -454,7 +455,7 @@ public class AdminApi {
} else {
map.put("resultMsg", "添加失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("添加角色参数:" + jsonObject);
logger.error("Exception 添加角色异常", e);
}
......@@ -462,7 +463,7 @@ public class AdminApi {
}
@PostMapping("userUpdate")
public Map<String, String> userInfoUpdate(@RequestBody String json, HttpServletResponse resp,HttpServletRequest requ) {
public Map<String, String> userInfoUpdate(@RequestBody String json, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
resp.setCharacterEncoding("UTF-8");
......@@ -484,7 +485,7 @@ public class AdminApi {
} else {
map.put("resultMsg", "修改失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("更新用户参数:" + jsonObject);
logger.error("Exception 更新用户异常", e);
}
......@@ -492,32 +493,32 @@ public class AdminApi {
}
@RequestMapping("roleUpdate")
public Map roleUpdate(@RequestBody String jsonStr, HttpServletResponse resp,HttpServletRequest requ) {
public Map roleUpdate(@RequestBody String jsonStr, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
resp.setCharacterEncoding("UTF-8");
Map<String, String> map = null;
JSONObject jsonObject = new JSONObject();
try {
map=new HashMap <>();
map = new HashMap<>();
jsonObject = JSONObject.fromObject(jsonStr);
boolean flag=false;
SysRole sysRole=new SysRole();
boolean flag = false;
SysRole sysRole = new SysRole();
sysRole.setId(Integer.parseInt(jsonObject.getString("roleId")));
sysRole.setRole(jsonObject.getString("role"));
sysRole.setDescription(jsonObject.getString("description"));
String oldPermissionIds=jsonObject.getString("oldPermissionIds");
JSONArray jsonArrayOldPids=JSONArray.fromObject(oldPermissionIds);
String permissionIds=jsonObject.getString("permissionId");
JSONArray jsonArrayPids=JSONArray.fromObject(permissionIds);
flag=sysRoleService.updateRole(sysRole, jsonArrayPids, jsonArrayOldPids);
if(flag){
String oldPermissionIds = jsonObject.getString("oldPermissionIds");
JSONArray jsonArrayOldPids = JSONArray.fromObject(oldPermissionIds);
String permissionIds = jsonObject.getString("permissionId");
JSONArray jsonArrayPids = JSONArray.fromObject(permissionIds);
flag = sysRoleService.updateRole(sysRole, jsonArrayPids, jsonArrayOldPids);
if (flag) {
map.put("resultMsg", "修改成功");
} else {
map.put("resultMsg", "修改失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("更新角色参数:" + jsonObject);
logger.error("Exception 更新角色异常", e);
}
......@@ -526,30 +527,30 @@ public class AdminApi {
@PostMapping("permissionUpdate")
public Map<String, String> permissionUpdate(@RequestBody String jsonStr, HttpServletResponse resp,HttpServletRequest requ) {
public Map<String, String> permissionUpdate(@RequestBody String jsonStr, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
resp.setCharacterEncoding("UTF-8");
Map<String, String> map = null;
JSONObject jsonObject = new JSONObject();
try {
map=new HashMap <>();
map = new HashMap<>();
jsonObject = JSONObject.fromObject(jsonStr);
boolean flag=false;
SysPermission sysPermission=new SysPermission();
boolean flag = false;
SysPermission sysPermission = new SysPermission();
sysPermission.setId(Integer.parseInt(jsonObject.getString("id")));
sysPermission.setName(jsonObject.getString("name"));
sysPermission.setUrl(jsonObject.getString("url"));
sysPermission.setPermission(jsonObject.getString("permission"));
System.out.println(sysPermission);
flag=sysPermissionService.updatePermission(sysPermission);
if(flag){
flag = sysPermissionService.updatePermission(sysPermission);
if (flag) {
map.put("resultMsg", "修改成功");
} else {
map.put("resultMsg", "修改失败");
}
}catch (Exception e){
} catch (Exception e) {
logger.error("更新权限参数:" + jsonObject);
logger.error("Exception 更新权限异常", e);
}
......
......@@ -24,11 +24,12 @@ public class CardDetailedListApi {
@Autowired
private CardDetailedListService cardDetailedListService;
Logger logger= Logger.getLogger(CardDetailedListApi.class);
Logger logger = Logger.getLogger(CardDetailedListApi.class);
/**
* 查询身份证详单
*通过身份证号
* 通过身份证号
*
* @param idCard 查询身份证详单
* @return
*/
......@@ -37,9 +38,9 @@ public class CardDetailedListApi {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<DetailReceiptListEntity> list = new ArrayList<DetailReceiptListEntity>();
try{
try {
list = cardDetailedListService.findCardDetailedListByIdCard(idCard);
} catch (Exception e){
} catch (Exception e) {
logger.error("身份证号:" + idCard);
logger.error("Exception 通过身份证号查询身份证详单异常", e);
}
......@@ -49,18 +50,19 @@ public class CardDetailedListApi {
/**
* 查询所有的身份证详单
*通过身份证号
* 通过身份证号
*
* @param idCard 查询身份证详单
* @return
*/
@RequestMapping("findAllCardDetailedList")
public List<Map<String,Object>> findAllCardDetailedList(@RequestParam("idCard") String idCard, HttpServletRequest requ) {
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<Map<String, Object>> list = new ArrayList<>();
try {
list = cardDetailedListService.findAllCardDetailedListByIdCard(idCard);
} catch (Exception e){
} catch (Exception e) {
logger.error("身份证号:" + idCard);
logger.error("Exception 通过身份证号查询所有的身份证详单异常", e);
}
......@@ -68,5 +70,4 @@ public class CardDetailedListApi {
}
}
......@@ -46,7 +46,7 @@ public class DeliveredApi {
@Autowired
private ReceiptService receiptService;
Logger logger= Logger.getLogger(DeliveredApi.class);
Logger logger = Logger.getLogger(DeliveredApi.class);
/**
* 导入妥投信息表
......@@ -55,13 +55,13 @@ public class DeliveredApi {
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Transactional(rollbackFor = Exception.class)
public boolean ReadDeliveredInfo( @RequestParam("importName") String importName, HttpServletResponse resp, HttpServletRequest requ) {
public boolean ReadDeliveredInfo(@RequestParam("importName") String importName, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxresp = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
String filename = "";
Map<String,Object> map = new LinkedHashMap<>();
Map<String, Object> map = new LinkedHashMap<>();
DiskFileItemFactory factory = new DiskFileItemFactory();
// 设置缓冲区的大小为100KB,如果不指定,那么缓冲区的大小默认是10KB
......@@ -82,7 +82,7 @@ public class DeliveredApi {
Iterator<String> iter = multiRequest.getFileNames();
while (iter.hasNext()) {
List<MultipartFile> fileRows = multiRequest.getFiles(iter.next().toString());
for (MultipartFile item :fileRows){
for (MultipartFile item : fileRows) {
try {
// 如果fileitem中封装的是普通输入项的数据
// 如果fileitem中封装的是上传文件
......@@ -92,7 +92,7 @@ public class DeliveredApi {
// 如果fileitem中封装的是普通输入项的数据
// 如果fileitem中封装的是上传文件
// 得到上传的文件名称
filename = item.getOriginalFilename();
filename = item.getOriginalFilename();
File file = null;
try {
file = File.createTempFile("prefix", "_" + item.getOriginalFilename());
......@@ -108,26 +108,26 @@ public class DeliveredApi {
DeliveredImportDicEntity deliveredImportDicEntity = new DeliveredImportDicEntity();
deliveredImportDicEntity.setFileName(filename);
deliveredImportDicEntity.setImportName(importName);
deliveredImportDicEntity.setImportCount((long)list1.size());
deliveredImportDicEntity.setImportCount((long) list1.size());
deliveredService.saveDeliveredImportDic(deliveredImportDicEntity);
//保存个人邮寄信息
List<DeliveredInfoEntity> entityList = new ArrayList<>();
int success=0;
int success = 0;
int failed = 0;
for (int i = 0; i < list1.size(); i++) {
DeliveredInfoEntity deliveredInfoEntity = new DeliveredInfoEntity();
List list2 = (List) list1.get(i);
//跳过空行和第一行
if (list2 == null || i == 0 ||list2.size()<2) {
if (list2 == null || i == 0 || list2.size() < 2) {
continue;
}
deliveredInfoEntity.setWaybillNumber((String) list2.get(0));
deliveredInfoEntity.setFileId(deliveredImportDicEntity.getId());
deliveredInfoEntity.setFileId(deliveredImportDicEntity.getId());
if ("妥投".equals(list2.get(2).toString())){
deliveredInfoEntity.setDealState((long)1);
}else {
deliveredInfoEntity.setDealState((long)0);
if ("妥投".equals(list2.get(2).toString())) {
deliveredInfoEntity.setDealState((long) 1);
} else {
deliveredInfoEntity.setDealState((long) 0);
}
entityList.add(deliveredInfoEntity);
}
......@@ -154,10 +154,10 @@ public class DeliveredApi {
}
}
}
}catch (Exception e){
} catch (Exception e) {
logger.error("上传人姓名:" + importName + "文件名:" + filename);
logger.error("Exception 导入妥投信息表异常", e);
}finally {
} finally {
}
return true;
......@@ -178,7 +178,7 @@ public class DeliveredApi {
List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities = new ArrayList<>();
for (int i = 0; i < jsonarray.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonarray.get(i);
String note = jsonObject.getString("note")+"";
String note = jsonObject.getString("note") + "";
String backReason = jsonObject.getString("backReason");
String waybillNumber = jsonObject.getString("waybillNumber");
String cardId = jsonObject.getString("cardId");
......@@ -192,7 +192,7 @@ public class DeliveredApi {
deliveredFailedInfoEntities.add(deliveredFailedInfoEntity);
}
deliveredService.saveDeliveredFailedInfoList(deliveredFailedInfoEntities);
}catch (Exception e){
} catch (Exception e) {
logger.error("异常参数:" + jsonarray);
logger.error("Exception 登记投递失败信息异常", e);
}
......@@ -201,6 +201,7 @@ public class DeliveredApi {
/**
* 妥投信息报表
*
* @param startDate 运单寄出开始时间
* @param endDate 运单寄出结束时间
* @return 返回值
......@@ -208,13 +209,13 @@ public class DeliveredApi {
@RequestMapping("queryDeliveredReport")
// @RequiresPermissions("userInfo.add")//权限管理;
@Transactional(rollbackFor = Exception.class)
public List<Map<String,Object>> queryDeliveredReport(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate, HttpServletRequest requ) {
public List<Map<String, Object>> queryDeliveredReport(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> report = new ArrayList <>();
List<Map<String, Object>> report = new ArrayList<>();
try {
report=deliveredService.selectDeliveredReport(replaceDate(startDate), replaceDate(endDate));
}catch (Exception e){
report = deliveredService.selectDeliveredReport(replaceDate(startDate), replaceDate(endDate));
} catch (Exception e) {
logger.error("运单寄出开始时间:" + startDate + "运单寄出结束时间:" + endDate);
logger.error("Exception 登记投递失败信息异常", e);
}
......@@ -224,20 +225,21 @@ public class DeliveredApi {
/**
* 查询导入妥投信息
*
* @param date 导入时间
* @return 返回值
*/
@RequestMapping("queryDeliveredByImportDate")
// @RequiresPermissions("userInfo.add")//权限管理;
@Transactional(rollbackFor = Exception.class)
public List<DeliveredImportDicEntity> queryDeliveredByImportDate(@RequestParam("date") String date, HttpServletRequest requ){
public List<DeliveredImportDicEntity> queryDeliveredByImportDate(@RequestParam("date") String date, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<DeliveredImportDicEntity> deliveredImportDicEntities = new ArrayList <DeliveredImportDicEntity>();
List<DeliveredImportDicEntity> deliveredImportDicEntities = new ArrayList<DeliveredImportDicEntity>();
try {
deliveredImportDicEntities = deliveredService.selectDeliveredByImportDate(replaceDate(date));
}catch (Exception e){
logger.error("导入妥投信息时间:" + date );
} catch (Exception e) {
logger.error("导入妥投信息时间:" + date);
logger.error("Exception 查询导入妥投信息异常", e);
}
return deliveredImportDicEntities;
......@@ -245,6 +247,7 @@ public class DeliveredApi {
/**
* 查询登记妥投失败信息
*
* @param date 登记时间
* @return 返回值
*/
......@@ -254,11 +257,11 @@ public class DeliveredApi {
public List<Map<String, Object>> queryDeliveredFailedByRegisterDate(@RequestParam("date") String date, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList <>();
List<Map<String, Object>> mapList = new ArrayList<>();
try {
mapList = deliveredService.selectDeliveredFailedByRegisterDate(replaceDate(date));
}catch (Exception e){
logger.error("登记妥投失败信息时间:" + date );
} catch (Exception e) {
logger.error("登记妥投失败信息时间:" + date);
logger.error("Exception 查询登记妥投失败信息异常", e);
}
return mapList;
......@@ -266,6 +269,7 @@ public class DeliveredApi {
/**
* 库房确认接收妥投失败证件
*
* @param json 妥投失败证件号
* @return
*/
......@@ -279,28 +283,28 @@ public class DeliveredApi {
try {
jsonObject = JSONObject.fromObject(json);
JSONArray jsonArray = (JSONArray) jsonObject.get("cardIdList");
String name = jsonObject.getString("name")+"";
String name = jsonObject.getString("name") + "";
List<String> list = (List<String>) jsonArray;
for (String cardId:list){
for (String cardId : list) {
//todo 确认接收妥投失败证件
//查询出对应详单信息
List<DetailReceiptListEntity> detailReceiptListEntityList = detailReceiptListService.selectDetailReceiptListEntityByCardId(cardId);
if (detailReceiptListEntityList.size()>0){
if (detailReceiptListEntityList.size() > 0) {
//生成新的交接单信息
ReceiptListEntity receiptListEntity = new ReceiptListEntity();
DetailReceiptListEntity detailReceiptListEntity = detailReceiptListEntityList.get(0);
receiptListEntity.setPoliceCode(detailReceiptListEntity.getUploadNo().substring(0,9));
receiptListEntity.setPoliceCode(detailReceiptListEntity.getUploadNo().substring(0, 9));
receiptListEntity.setQrCode(detailReceiptListEntity.getAcceptNo());
receiptListEntity.setFinishCount((long)1);
receiptListEntity.setState((long)1);
receiptListEntity.setFinishCount((long) 1);
receiptListEntity.setState((long) 1);
receiptListEntity.setCheckName(name);
receiptListEntity.setCardTypeId((long)0);
receiptListEntity.setCardTypeId((long) 0);
long id = receiptService.saveReceiptList(receiptListEntity);
//更改对应的详单信息
detailReceiptListService.updateDetailReceiptList(detailReceiptListEntity,id);
detailReceiptListService.updateDetailReceiptList(detailReceiptListEntity, id);
}
}
}catch (Exception e){
} catch (Exception e) {
logger.error("妥投失败证件号:" + jsonObject);
logger.error("Exception 库房确认接收妥投失败证件异常", e);
}
......@@ -308,9 +312,9 @@ public class DeliveredApi {
}
/**
* 删除导入妥投信息
*
* @param fileId 文件ID
* @return 返回值
*/
......@@ -322,7 +326,7 @@ public class DeliveredApi {
MDC.put("ip", remoteAddr);
try {
deliveredService.deleteDeliveredByFileId(Long.valueOf(fileId));
}catch (Exception e){
} catch (Exception e) {
logger.error("妥投信息文件ID:" + fileId);
logger.error("Exception 删除导入妥投信息异常", e);
}
......@@ -331,6 +335,7 @@ public class DeliveredApi {
/**
* 删除登记妥投失败信息
*
* @param id 登记妥投失败信息ID
* @return 返回值
*/
......@@ -343,7 +348,7 @@ public class DeliveredApi {
boolean delivered = true;
try {
delivered = deliveredService.deleteDeliveredFailedById(Long.valueOf(id));
}catch (Exception e){
} catch (Exception e) {
logger.error("登记妥投失败信息ID:" + id);
logger.error("Exception 删除登记妥投失败信息异常", e);
}
......@@ -352,6 +357,7 @@ public class DeliveredApi {
/**
* 查询登记妥投失败类型
*
* @return 返回值
*/
@RequestMapping("queryDeliveredFailedType")
......@@ -359,17 +365,16 @@ public class DeliveredApi {
public List<DeliveredFailedReasonEntity> queryDeliveredFailedType(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<DeliveredFailedReasonEntity> list = new ArrayList <DeliveredFailedReasonEntity>();
try{
List<DeliveredFailedReasonEntity> list = new ArrayList<DeliveredFailedReasonEntity>();
try {
list = deliveredService.selectDeliveredFailedType();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 查询登记妥投失败类型异常", e);
}
return list;
}
/**
* 去除字符串中中线
*
......@@ -377,7 +382,7 @@ public class DeliveredApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
}
......@@ -32,7 +32,7 @@ public class ExportExcelApi {
@Autowired
private ReceiptService receiptService;
Logger logger= Logger.getLogger(ExportExcelApi.class);
Logger logger = Logger.getLogger(ExportExcelApi.class);
/**
* 导出公安网数据
......@@ -45,7 +45,7 @@ public class ExportExcelApi {
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list"));
String isHistory = jsonObject.get("isHistory").toString();
String name = jsonObject.get("name").toString();
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(jsonArray, name,isHistory);
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(jsonArray, name, isHistory);
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
String dateTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd");
......@@ -71,6 +71,7 @@ public class ExportExcelApi {
}
return null;
}
/**
* 导出交接单
*/
......@@ -83,10 +84,10 @@ public class ExportExcelApi {
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));
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");
......@@ -110,7 +111,7 @@ public class ExportExcelApi {
// e.printStackTrace();
// }
// return null;
}catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
logger.error("异常参数:" + jsonObject);
logger.error("Exception 导出交接单异常", e);
......
......@@ -42,7 +42,7 @@ public class ExportXMLApi {
@Autowired
private FilesService filesService;
Logger logger= Logger.getLogger(ExportXMLApi.class);
Logger logger = Logger.getLogger(ExportXMLApi.class);
/**
* 导出制证数据包
......
......@@ -35,7 +35,7 @@ public class FailedCardApi {
@Autowired
private TaskListService taskListService;
Logger logger= Logger.getLogger(FailedCardApi.class);
Logger logger = Logger.getLogger(FailedCardApi.class);
/**
* 查询所有废证类型
......@@ -46,10 +46,10 @@ public class FailedCardApi {
public List<FailedCardReasonDicEntity> selectFailedCardDic(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<FailedCardReasonDicEntity> resultList = new ArrayList <FailedCardReasonDicEntity>();
List<FailedCardReasonDicEntity> resultList = new ArrayList<FailedCardReasonDicEntity>();
try {
resultList = failedCardService.selectFailedCardDic();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 查询所有废证类型异常", e);
}
return resultList;
......@@ -70,7 +70,7 @@ public class FailedCardApi {
try {
jsonarray = JSONArray.fromObject(jsonStr);
for (Object o : jsonarray) {
String acceptNo = o.toString().replace("e", "E").replace("g", "G").replace("l","L");
String acceptNo = o.toString().replace("e", "E").replace("g", "G").replace("l", "L");
Map<String, Object> resultMap = failedCardService.selectInfoByCardId(acceptNo);
if (resultMap == null) {
resultMap = new LinkedHashMap<>();
......@@ -80,7 +80,7 @@ public class FailedCardApi {
}
resultList.add(resultMap);
}
}catch (Exception e){
} catch (Exception e) {
logger.error("身份证号或受理号:" + jsonarray);
logger.error("Exception 根据身份证号或受理号查询身份信息及组号异常", e);
}
......@@ -89,24 +89,26 @@ public class FailedCardApi {
/**
* 查询提交人上传的废证详情
* @param date 提交日期
* @param name 提交人姓名
*
* @param date 提交日期
* @param name 提交人姓名
* @param startDate 提交起始日期
* @param endDate 提交结束日期
* @param endDate 提交结束日期
* @param requ
* @return
*/
@RequestMapping("queryFailedCardInfo")
public List<Map<String, Object>> queryFailedCardInfo(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate, @RequestParam("name") String name, HttpServletRequest requ) {
public List<Map<String, Object>> queryFailedCardInfo(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, @RequestParam("name") String name, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> failedCardEntities = new ArrayList <>();
failedCardEntities = failedCardService.selectFailedCardInfo(replaceDate(startDate),replaceDate(endDate), replaceNullString(name));
List<Map<String, Object>> failedCardEntities = new ArrayList<>();
failedCardEntities = failedCardService.selectFailedCardInfo(replaceDate(startDate), replaceDate(endDate), replaceNullString(name));
return failedCardEntities;
}
/**
* 删除提交人上传的废证详情
*
* @param failedCardId 废证ID
* @return
*/
......@@ -117,7 +119,7 @@ public class FailedCardApi {
boolean failedCardInfo = true;
try {
failedCardInfo = failedCardService.deleteFailedCardInfo(failedCardId);
}catch (Exception e){
} catch (Exception e) {
logger.error("废证ID:" + failedCardId);
logger.error("Exception 删除提交人上传的废证详情异常", e);
}
......@@ -137,7 +139,7 @@ public class FailedCardApi {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONArray jsonarray = new JSONArray();
try{
try {
jsonarray = JSONArray.fromObject(jsonStr);
for (Object o : jsonarray) {
JSONObject jsonObject = (JSONObject) o;
......@@ -154,7 +156,7 @@ public class FailedCardApi {
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);
}
}catch (Exception e){
} catch (Exception e) {
logger.error("身份证号或受理号:" + jsonarray);
logger.error("Exception 添加废证异常", e);
}
......@@ -183,7 +185,7 @@ public class FailedCardApi {
taskEntity = new TaskEntity();
for (int i = 0; i < jsonarray.size(); i++) {
/*查询生成任务单需要的数据*/
/*查询生成任务单需要的数据*/
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") + "");
......@@ -197,11 +199,11 @@ public class FailedCardApi {
} else {
taskEntity.setWorkGroup(Long.valueOf(resultMap.get("WORK_GROUP") + ""));
}
/*特证数+1*/
/*特证数+1*/
failedCardService.specialCardAdd(acceptNo);
/*生成新任务单*/
/*生成新任务单*/
taskListService.saveTask(taskEntity);
/*特证表添加特证*/
/*特证表添加特证*/
SpecialCardEntity specialCardEntity = new SpecialCardEntity();
specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setInitiator(name);
......@@ -209,7 +211,7 @@ public class FailedCardApi {
specialCardEntity.setGroupNo(acceptNo.substring(0, 8));
failedCardService.addSpecialCard(specialCardEntity);
}
}catch (Exception e){
} catch (Exception e) {
logger.error("身份证号或受理号:" + jsonObject);
logger.error("Exception 生成余证异常", e);
}
......@@ -225,10 +227,10 @@ public class FailedCardApi {
public List<String> selectCardType(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<String> result = new ArrayList <>();
List<String> result = new ArrayList<>();
try {
result = failedCardService.selectCardType();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 查询所有证件类型异常", e);
}
return result;
......@@ -285,6 +287,7 @@ public class FailedCardApi {
}
return true;
}
/**
* 去除字符串中中线
*
......@@ -292,17 +295,19 @@ public class FailedCardApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
/**
* 格式化受理组号
*
* @param acceptNo
* @return
*/
private String formateAcceptNo(String acceptNo){
return acceptNo.replace("e", "E").replace("g", "G").replace("l","L");
private String formateAcceptNo(String acceptNo) {
return acceptNo.replace("e", "E").replace("g", "G").replace("l", "L");
}
/**
* 字符串去除空格
*
......
......@@ -14,23 +14,24 @@ import javax.servlet.http.HttpServletRequest;
@RequestMapping("FilesAnalysis")
public class FilesAnalysisApi {
@Autowired
private PersonPostService personPostService;
private PersonPostService personPostService;
Logger logger= Logger.getLogger(FilesAnalysisApi.class);
Logger logger = Logger.getLogger(FilesAnalysisApi.class);
/**
* 文件解析 修改解析状态
*
* @param fileId
* @param creatTime
* @return
*/
@RequestMapping("anailsis")
public boolean filesAnailsis(@RequestParam(value = "fileId") String fileId,@RequestParam(value = "creatTime") String creatTime, HttpServletRequest requ) {
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){
personPostService.updateIsPost(fileId, creatTime);
} catch (Exception e) {
logger.error("文件ID:" + fileId + "生成时间:" + creatTime);
logger.error("Exception 文件解析 修改解析状态异常", e);
}
......
......@@ -21,24 +21,26 @@ public class GreenPackageInformationApi {
/**
* 查询提交的绿包信息表
*
* @param startDate 起始时间
* @param endDate 截至时间
* @param name 查询人姓名
* @param endDate 截至时间
* @param name 查询人姓名
* @return
*/
@RequestMapping("queryGreenPackageInformationFile")
public List<GreenPackageInformationFileEntity> queryGreenPackageInformationFileEntity(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate,@RequestParam("name") String name ){
public List<GreenPackageInformationFileEntity> queryGreenPackageInformationFileEntity(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, @RequestParam("name") String name) {
List<GreenPackageInformationFileEntity> greenPackageInformationFileEntities = greenPackageInformationService.selectGreenPackageInformationFileEntity(replaceDate(startDate), replaceDate(endDate), replaceNullString(name));
return greenPackageInformationFileEntities;
}
/**
* 删除提交的绿包信息表
* @param id 流水号
*
* @param id 流水号
* @return
*/
@RequestMapping("deleteGreenPackageInformationFile")
public boolean deleteGreenPackageInformationFileEntity(@RequestParam("id") String id ){
public boolean deleteGreenPackageInformationFileEntity(@RequestParam("id") String id) {
boolean b = greenPackageInformationService.deleteGreenPackageInformationFileEntity(id);
return b;
}
......
......@@ -21,10 +21,11 @@ public class InfoManagementApi {
@Autowired
private InfoManagementService infoManagementService;
Logger logger= Logger.getLogger(InfoManagementApi.class);
Logger logger = Logger.getLogger(InfoManagementApi.class);
/**
* 按条件查询制证信息数据
*
* @param beginFileName
* @param endFileName
* @param gajgMc
......@@ -35,13 +36,13 @@ 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, HttpServletRequest requ) {
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){
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);
}
......@@ -51,22 +52,23 @@ public class InfoManagementApi {
/**
* 查询制证信息数据条数
*
* @param beginFileId 开始包号
* @param endFileId 结束包号
* @param gajgMc 派出所代码
* @param beginDate 开始时间
* @param endDate 结束时间
* @param endFileId 结束包号
* @param gajgMc 派出所代码
* @param beginDate 开始时间
* @param endDate 结束时间
* @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, HttpServletRequest requ) {
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;
long count = 0;
try {
count = infoManagementService.count(beginFileId,endFileId,gajgMc,replaceDate(beginDate),replaceDate(endDate));
}catch (Exception e){
logger.error( "公安机关名称:" + gajgMc + "起始时间:" + beginDate + "截止时间:" + endDate);
count = infoManagementService.count(beginFileId, endFileId, gajgMc, replaceDate(beginDate), replaceDate(endDate));
} catch (Exception e) {
logger.error("公安机关名称:" + gajgMc + "起始时间:" + beginDate + "截止时间:" + endDate);
logger.error("Exception 查询制证信息数据条数异常", e);
}
return count;
......@@ -74,6 +76,7 @@ public class InfoManagementApi {
/**
* 删除制证信息数据
*
* @param beginFileName
* @param endFileName
* @param gajgMc
......@@ -83,15 +86,15 @@ 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, HttpServletRequest requ) {
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));
result = infoManagementService.deleteInfo(beginFileName, endFileName, gajgMc, replaceDate(beginDate), replaceDate(endDate));
//更改新文件状态
infoManagementService.updatePackageNo(beginFileName,endFileName,gajgMc,replaceDate(beginDate),replaceDate(endDate));
}catch (Exception e){
infoManagementService.updatePackageNo(beginFileName, endFileName, gajgMc, replaceDate(beginDate), replaceDate(endDate));
} catch (Exception e) {
logger.error("起始文件名:" + beginFileName + "截止文件名:" + endFileName + "公安机关名称:" + gajgMc + "起始时间:" + beginDate + "截止时间:" + endDate);
logger.error("Exception 删除制证信息数据异常", e);
}
......@@ -105,7 +108,7 @@ public class InfoManagementApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
}
......@@ -23,23 +23,24 @@ public class MaterialManagementApi {
@Autowired
private MaterialManagementService materialManagementService;
Logger logger= Logger.getLogger(MaterialManagementApi.class);
Logger logger = Logger.getLogger(MaterialManagementApi.class);
/**
* 插入膜耗材数据
*
* @param totalCount
* @param plasticFilmType
* @param note
* @return
*/
@RequestMapping("insertFilm")
public boolean insertFilm(@Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note, @Param("name")String name,@Param("state")String state, HttpServletRequest requ) {
public boolean insertFilm(@Param("totalCount") String totalCount, @Param("plasticFilmType") String plasticFilmType, @Param("note") String note, @Param("name") String name, @Param("state") String state, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
boolean result = true;
try {
result = materialManagementService.insertFilm(totalCount, plasticFilmType, note,name,Long.valueOf(state));
}catch (Exception e){
result = materialManagementService.insertFilm(totalCount, plasticFilmType, note, name, Long.valueOf(state));
} catch (Exception e) {
logger.error("数量:" + totalCount + "膜类型(1出库2入库):" + plasticFilmType + "备注:" + note + "提交人姓名:" + name + "是否审核1审核0未审核:" + state);
logger.error("Exception 插入膜耗材数据异常", e);
}
......@@ -48,19 +49,20 @@ public class MaterialManagementApi {
/**
* 插入卡体耗材数据
*
* @param cardType
* @param totalCount
* @param note
* @return
*/
@RequestMapping("insertCardBody")
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note, @Param("name")String name, @Param("cardBodyType")String cardBodyType,@Param("state")String state, HttpServletRequest requ) {
public boolean insertCardBody(@Param("cardType") String cardType, @Param("totalCount") String totalCount, @Param("note") String note, @Param("name") String name, @Param("cardBodyType") String cardBodyType, @Param("state") String state, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
boolean result = true;
try {
result = materialManagementService.insertCardBody(cardType, totalCount, note,name,cardBodyType,Long.valueOf(state));
}catch (Exception e){
result = materialManagementService.insertCardBody(cardType, totalCount, note, name, cardBodyType, Long.valueOf(state));
} catch (Exception e) {
logger.error("数量:" + totalCount + "卡基类型(1出库2入库):" + cardType + "备注:" + note + "提交人姓名:" + name + "是否审核1审核0未审核:" + state);
logger.error("Exception 插入卡体耗材数据异常", e);
}
......@@ -94,23 +96,24 @@ public class MaterialManagementApi {
/**
* 查询卡机统计数据
*
* @param beginDate
* @param endDate
* @return
*/
@RequestMapping("selectCardBodyManagement")
public Map<String,Object> selectCardBodyManagement(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name,@Param("cardBodyType")String cardBodyType, HttpServletRequest requ) {
public Map<String, Object> selectCardBodyManagement(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name, @Param("cardBodyType") String cardBodyType, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String,Object> resultMap = new HashMap<>();
Map<String, Object> resultMap = new HashMap<>();
try {
List<CardBodyEntity> cardBodyEntities = materialManagementService.selectCardBody(replaceDate(beginDate),replaceDate(endDate),typeCode,name,cardBodyType);
String cardCount1 = materialManagementService.selectCardCount1(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
String cardCount2 = materialManagementService.selectCardCount2(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
resultMap.put("cardBody",cardBodyEntities);
resultMap.put("cardCount1",cardCount1);
resultMap.put("cardCount2",cardCount2);
}catch (Exception e){
List<CardBodyEntity> cardBodyEntities = materialManagementService.selectCardBody(replaceDate(beginDate), replaceDate(endDate), typeCode, name, cardBodyType);
String cardCount1 = materialManagementService.selectCardCount1(replaceDate(beginDate), replaceDate(endDate), typeCode, name);
String cardCount2 = materialManagementService.selectCardCount2(replaceDate(beginDate), replaceDate(endDate), typeCode, name);
resultMap.put("cardBody", cardBodyEntities);
resultMap.put("cardCount1", cardCount1);
resultMap.put("cardCount2", cardCount2);
} catch (Exception e) {
logger.error("起始时间:" + beginDate + "截止时间:" + endDate + "卡基类型(1出库2入库):" + typeCode + "提交人姓名:" + name + "1身份卡2港澳3台湾:" + cardBodyType);
logger.error("Exception 查询卡机统计数据异常", e);
}
......@@ -120,24 +123,25 @@ public class MaterialManagementApi {
/**
* 查询膜统计数据
*
* @param beginDate
* @param endDate
* @return
*/
@RequestMapping("selectPlasticFilmManagement")
public Map<String,Object> selectPlasticFilmManagement(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("typeCode")String typeCode,@Param("name")String name, HttpServletRequest requ) {
public Map<String, Object> selectPlasticFilmManagement(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String,Object> resultMap = new HashMap<>();
Map<String, Object> resultMap = new HashMap<>();
try {
List<PlasticFilmEntity> plasticFilmEntities = materialManagementService.selectFilm(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
String plasticFilmCount1=materialManagementService.selectFilmCount1(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
String plasticFilmCount2=materialManagementService.selectFilmCount2(replaceDate(beginDate),replaceDate(endDate),typeCode,name);
resultMap.put("plasticFilm",plasticFilmEntities);
resultMap.put("plasticFilmCount1",plasticFilmCount1);
resultMap.put("plasticFilmCount2",plasticFilmCount2);
}catch (Exception e){
logger.error( "起始时间:" + beginDate + "截止时间:" + endDate + "膜类型(1出库2入库):" + typeCode + "提交人姓名:" + name);
List<PlasticFilmEntity> plasticFilmEntities = materialManagementService.selectFilm(replaceDate(beginDate), replaceDate(endDate), typeCode, name);
String plasticFilmCount1 = materialManagementService.selectFilmCount1(replaceDate(beginDate), replaceDate(endDate), typeCode, name);
String plasticFilmCount2 = materialManagementService.selectFilmCount2(replaceDate(beginDate), replaceDate(endDate), typeCode, name);
resultMap.put("plasticFilm", plasticFilmEntities);
resultMap.put("plasticFilmCount1", plasticFilmCount1);
resultMap.put("plasticFilmCount2", plasticFilmCount2);
} catch (Exception e) {
logger.error("起始时间:" + beginDate + "截止时间:" + endDate + "膜类型(1出库2入库):" + typeCode + "提交人姓名:" + name);
logger.error("Exception 查询膜统计数据异常", e);
}
return resultMap;
......@@ -145,18 +149,19 @@ public class MaterialManagementApi {
/**
* 更新卡体详情状态
*
* @param id cardBodyID
* @return
*/
@RequestMapping("updateCardBody")
public boolean updateCardBody(@Param("id")String id, HttpServletRequest requ) {
public boolean updateCardBody(@Param("id") String id, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
boolean cardBody = true;
try {
cardBody = materialManagementService.updateCardBodyState(Long.valueOf(id));
}catch (Exception e){
logger.error( "卡基统计信息表ID:" + id);
} catch (Exception e) {
logger.error("卡基统计信息表ID:" + id);
logger.error("Exception 更新卡体详情状态异常", e);
}
return cardBody;
......@@ -166,35 +171,35 @@ public class MaterialManagementApi {
* 查询未审核卡体详情
*/
@RequestMapping("selectCardBody")
public List<CardBodyEntity> selectCardBody(@Param("date")String date,@Param("name")String name, HttpServletRequest requ) {
public List<CardBodyEntity> selectCardBody(@Param("date") String date, @Param("name") String name, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<CardBodyEntity> cardBody = new ArrayList<>();
try {
cardBody=materialManagementService.selectCardBody(replaceDate(date), name);
}catch (Exception e){
logger.error( "审核时间:" + date + "提交人姓名:" + name);
cardBody = materialManagementService.selectCardBody(replaceDate(date), name);
} catch (Exception e) {
logger.error("审核时间:" + date + "提交人姓名:" + name);
logger.error("Exception 查询未审核卡体详情异常", e);
}
return cardBody;
}
/**
* 更新膜详情状态
*
* @param id cardBodyID
* @return
*/
@RequestMapping("updatePlasticFilm")
public boolean updatePlasticFilm(@Param("id")String id, HttpServletRequest requ) {
public boolean updatePlasticFilm(@Param("id") String id, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
boolean plasticFilm = true;
try {
plasticFilm = materialManagementService.updatePlasticFilm(Long.valueOf(id));
}catch (Exception e){
logger.error( "塑料膜表流水号:" + id );
} catch (Exception e) {
logger.error("塑料膜表流水号:" + id);
logger.error("Exception 更新膜详情状态异常", e);
}
return plasticFilm;
......@@ -203,39 +208,40 @@ public class MaterialManagementApi {
/**
* 查询未审核膜详情
*/
@RequestMapping("selectPlasticFilm")
public List<PlasticFilmEntity> selectPlasticFilm(@Param("date")String date,@Param("name")String name, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<PlasticFilmEntity> plasticFilm = new ArrayList <PlasticFilmEntity>();
try {
plasticFilm = materialManagementService.selectPlasticFilm(replaceDate(date), name);
}catch (Exception e){
logger.error( "审核时间:" + date + "提交人姓名:" + name);
logger.error("Exception 查询未审核膜详情异常", e);
}
return plasticFilm;
@RequestMapping("selectPlasticFilm")
public List<PlasticFilmEntity> selectPlasticFilm(@Param("date") String date, @Param("name") String name, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<PlasticFilmEntity> plasticFilm = new ArrayList<PlasticFilmEntity>();
try {
plasticFilm = materialManagementService.selectPlasticFilm(replaceDate(date), name);
} catch (Exception e) {
logger.error("审核时间:" + date + "提交人姓名:" + name);
logger.error("Exception 查询未审核膜详情异常", e);
}
return plasticFilm;
}
/**
* 查询卡基报表统计数据
* @param beginDate 开始时间
* @param endDate 结束时间
* @param operateType 出入库类型
* @param name 操作人
*
* @param beginDate 开始时间
* @param endDate 结束时间
* @param operateType 出入库类型
* @param name 操作人
* @param cardBodyType 卡体类型
* @return
*/
@RequestMapping("queryCardBodyReport")
public Map<String,Object> queryCardBodyReport(@Param("beginDate")String beginDate, @Param("endDate")String endDate, @Param("operateType")String operateType, @Param("name")String name, @Param("cardBodyType")String cardBodyType, @RequestParam("currPage")String currPage, @RequestParam("pageSize")String pageSize, HttpServletRequest requ) {
public Map<String, Object> queryCardBodyReport(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("operateType") String operateType, @Param("name") String name, @Param("cardBodyType") String cardBodyType, @RequestParam("currPage") String currPage, @RequestParam("pageSize") String pageSize, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String, Object> map = null;
try {
map = materialManagementService.selectCardBodyReport(replaceDate(beginDate), replaceDate(endDate), operateType, replaceNullString(name), cardBodyType, (Long.valueOf(currPage) - 1) * Long.valueOf(pageSize) + 1, Long.valueOf(currPage) * Long.valueOf(pageSize));
}catch (Exception e){
logger.error( "起始时间:" + beginDate + "截止时间:" + endDate + "卡基类型(1出库2入库):" + operateType + "提交人姓名:" + name + "1身份卡2港澳3台湾:" + cardBodyType + "页数:" + currPage + "条数:" + pageSize);
} catch (Exception e) {
logger.error("起始时间:" + beginDate + "截止时间:" + endDate + "卡基类型(1出库2入库):" + operateType + "提交人姓名:" + name + "1身份卡2港澳3台湾:" + cardBodyType + "页数:" + currPage + "条数:" + pageSize);
logger.error("Exception 查询卡基报表统计数据异常", e);
}
return map;
......@@ -243,38 +249,40 @@ public class MaterialManagementApi {
/**
* 查询卡基报表统计数量
* @param beginDate 开始时间
* @param endDate 结束时间
* @param operateType 出入库类型
* @param name 操作人
*
* @param beginDate 开始时间
* @param endDate 结束时间
* @param operateType 出入库类型
* @param name 操作人
* @param cardBodyType 卡体类型
* @return
*/
@RequestMapping("queryCardBodyReportCount")
public int queryCardBodyReportCount(@Param("beginDate")String beginDate, @Param("endDate")String endDate, @Param("operateType")String operateType, @Param("name")String name, @Param("cardBodyType")String cardBodyType, HttpServletRequest requ) {
public int queryCardBodyReportCount(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("operateType") String operateType, @Param("name") String name, @Param("cardBodyType") String cardBodyType, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
int i = 0;
try{
try {
i = materialManagementService.selectCardBodyReportCount(replaceDate(beginDate), replaceDate(endDate), operateType, replaceNullString(name), cardBodyType);
}catch (Exception e){
logger.error( "起始时间:" + beginDate + "截止时间:" + endDate + "卡基类型(1出库2入库):" + operateType + "提交人姓名:" + name + "1身份卡2港澳3台湾:" + cardBodyType);
} catch (Exception e) {
logger.error("起始时间:" + beginDate + "截止时间:" + endDate + "卡基类型(1出库2入库):" + operateType + "提交人姓名:" + name + "1身份卡2港澳3台湾:" + cardBodyType);
logger.error("Exception 查询卡基报表统计数量异常", e);
}
return i;
}
/**
* 查询卡基操作人
*/
@RequestMapping("queryCardBodyOperation")
public List<Map<String,Object>> queryCardBodyOperation(HttpServletRequest requ) {
public List<Map<String, Object>> queryCardBodyOperation(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> maps = null;
try {
maps = materialManagementService.selectCardBodyOperation();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 查询卡基操作人异常", e);
}
return maps;
......@@ -282,21 +290,22 @@ public class MaterialManagementApi {
/**
* 查询膜报表统计数据
* @param beginDate 开始时间
* @param endDate 结束时间
*
* @param beginDate 开始时间
* @param endDate 结束时间
* @param operateType 出入库类型
* @param name 操作人
* @param name 操作人
* @return
*/
@RequestMapping("queryPlasticFilmReport")
public Map<String,Object> queryPlasticFilmReport(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("operateType")String operateType,@Param("name")String name, @RequestParam("currPage")String currPage, @RequestParam("pageSize")String pageSize, HttpServletRequest requ) {
public Map<String, Object> queryPlasticFilmReport(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("operateType") String operateType, @Param("name") String name, @RequestParam("currPage") String currPage, @RequestParam("pageSize") String pageSize, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String, Object> map = null;
try {
map = materialManagementService.selectPlasticFilmReport(replaceDate(beginDate), replaceDate(endDate), operateType,replaceNullString(name),(Long.valueOf(currPage)-1)*Long.valueOf(pageSize)+1,Long.valueOf(currPage)*Long.valueOf(pageSize));
}catch (Exception e){
logger.error( "起始时间:" + beginDate + "截止时间:" + endDate + "卡基类型(1出库2入库):" + operateType + "提交人姓名:" + name + "页数:" + currPage + "条数:" + pageSize);
map = materialManagementService.selectPlasticFilmReport(replaceDate(beginDate), replaceDate(endDate), operateType, replaceNullString(name), (Long.valueOf(currPage) - 1) * Long.valueOf(pageSize) + 1, Long.valueOf(currPage) * Long.valueOf(pageSize));
} catch (Exception e) {
logger.error("起始时间:" + beginDate + "截止时间:" + endDate + "卡基类型(1出库2入库):" + operateType + "提交人姓名:" + name + "页数:" + currPage + "条数:" + pageSize);
logger.error("Exception 查询膜报表统计数据异常", e);
}
return map;
......@@ -304,21 +313,22 @@ public class MaterialManagementApi {
/**
* 查询膜报表统计数量
* @param beginDate 开始时间
* @param endDate 结束时间
*
* @param beginDate 开始时间
* @param endDate 结束时间
* @param operateType 出入库类型
* @param name 操作人
* @param name 操作人
* @return
*/
@RequestMapping("queryPlasticFilmReportCount")
public int queryPlasticFilmReportCount(@Param("beginDate")String beginDate, @Param("endDate")String endDate, @Param("operateType")String operateType, @Param("name")String name, HttpServletRequest requ) {
public int queryPlasticFilmReportCount(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("operateType") String operateType, @Param("name") String name, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
int i = 0;
try {
i = materialManagementService.selectPlasticFilmReportCount(replaceDate(beginDate), replaceDate(endDate), operateType, replaceNullString(name));
}catch (Exception e){
logger.error( "起始时间:" + beginDate + "截止时间:" + endDate + "卡基类型(1出库2入库):" + operateType + "提交人姓名:" + name);
i = materialManagementService.selectPlasticFilmReportCount(replaceDate(beginDate), replaceDate(endDate), operateType, replaceNullString(name));
} catch (Exception e) {
logger.error("起始时间:" + beginDate + "截止时间:" + endDate + "卡基类型(1出库2入库):" + operateType + "提交人姓名:" + name);
logger.error("Exception 查询膜报表统计数量异常", e);
}
return i;
......@@ -328,13 +338,13 @@ public class MaterialManagementApi {
* 查询膜操作人
*/
@RequestMapping("queryPlasticFilmOperation")
public List<Map<String,Object>> queryPlasticFilmOperation(HttpServletRequest requ) {
public List<Map<String, Object>> queryPlasticFilmOperation(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> maps = new ArrayList <>();
List<Map<String, Object>> maps = new ArrayList<>();
try {
maps = materialManagementService.selectPlasticFilmOperation();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 查询膜操作人异常", e);
}
return maps;
......@@ -347,7 +357,7 @@ public class MaterialManagementApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
/**
......
......@@ -39,30 +39,31 @@ public class PersonPostApi {
@Autowired
PersonPostService personPostService;
Logger logger= Logger.getLogger(PersonPostApi.class);
Logger logger = Logger.getLogger(PersonPostApi.class);
/**
* 查询备注信息
*
* @param jsonStr
* @return
*/
@RequestMapping("selectNote")
@Transactional
public List<Map<String,Object>>selectNote(@RequestBody String jsonStr, HttpServletRequest requ) {
public List<Map<String, Object>> selectNote(@RequestBody String jsonStr, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String,Object>> resultList = new ArrayList <>();
List<Map<String, Object>> resultList = new ArrayList<>();
JSONArray jsonArray = new JSONArray();
try {
resultList = new ArrayList<>();
jsonArray = JSONArray.fromObject(jsonStr);
for (int i=0;i<jsonArray.size();i++){
Map<String,Object> resultMap=personPostService.selectNote((int)(jsonArray.get(i)));
for (int i = 0; i < jsonArray.size(); i++) {
Map<String, Object> resultMap = personPostService.selectNote((int) (jsonArray.get(i)));
resultList.add(resultMap);
}
}catch (Exception e){
logger.error("备注信息:" + jsonArray );
} catch (Exception e) {
logger.error("备注信息:" + jsonArray);
logger.error("Exception 查询备注信息异常", e);
}
return resultList;
......@@ -70,6 +71,7 @@ public class PersonPostApi {
/**
* 更改备注信息
*
* @param jsonStr
* @return
*/
......@@ -81,12 +83,12 @@ public class PersonPostApi {
JSONArray jsonArray = new JSONArray();
try {
jsonArray = JSONArray.fromObject(jsonStr);
for (int i=0;i<jsonArray.size();i++){
Map<String,Object> noteMap = (Map<String, Object>) jsonArray.get(i);
personPostService.addNote(noteMap.get("id").toString(),noteMap.get("note").toString());
for (int i = 0; i < jsonArray.size(); i++) {
Map<String, Object> noteMap = (Map<String, Object>) jsonArray.get(i);
personPostService.addNote(noteMap.get("id").toString(), noteMap.get("note").toString());
}
}catch (Exception e){
logger.error("备注信息:" + jsonArray );
} catch (Exception e) {
logger.error("备注信息:" + jsonArray);
logger.error("Exception 更改备注信息异常", e);
}
return true;
......@@ -95,6 +97,7 @@ public class PersonPostApi {
/**
* 按条件查询个人邮寄信息
*
* @param jsonStr
* @return
*/
......@@ -106,18 +109,18 @@ public class PersonPostApi {
JSONObject jsonObject = new JSONObject();
int count = 0;
try {
jsonObject = JSONObject.fromObject(jsonStr);
jsonObject = JSONObject.fromObject(jsonStr);
String applicantName = jsonObject.getString("applicantName");
String orderNumber = jsonObject.getString("orderNumber");
String state = jsonObject.getString("state");
String latticeMouthInformation = jsonObject.getString("latticeMouthInformation");
JSONArray jsonArray =(JSONArray)jsonObject.get("getToCounty");
JSONArray jsonArray = (JSONArray) jsonObject.get("getToCounty");
String uploadDate = replaceDate(jsonObject.getString("uploadDate"));
String emailNo = jsonObject.getString("emailNo");
String notNull = jsonObject.getString("notNull");
count = personPostService.findPersonalDataCount(applicantName,orderNumber,state,latticeMouthInformation,jsonArray,uploadDate,emailNo,notNull);
}catch (Exception e){
logger.error("个人邮寄信息:" + jsonObject );
count = personPostService.findPersonalDataCount(applicantName, orderNumber, state, latticeMouthInformation, jsonArray, uploadDate, emailNo, notNull);
} catch (Exception e) {
logger.error("个人邮寄信息:" + jsonObject);
logger.error("Exception 按条件查询个人邮寄信息异常", e);
}
return count;
......@@ -125,6 +128,7 @@ public class PersonPostApi {
/**
* 按条件查询个人邮寄信息
*
* @param jsonStr
* @return
*/
......@@ -134,22 +138,22 @@ public class PersonPostApi {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONObject jsonObject = new JSONObject();
List<PersonPostEntity> list = new ArrayList <>();
List<PersonPostEntity> list = new ArrayList<>();
try {
jsonObject = JSONObject.fromObject(jsonStr);
String applicantName = jsonObject.getString("applicantName");
String orderNumber = jsonObject.getString("orderNumber");
String state = jsonObject.getString("state");
String latticeMouthInformation = jsonObject.getString("latticeMouthInformation");
JSONArray jsonArray =(JSONArray)jsonObject.get("getToCounty");
String uploadDate =replaceDate(jsonObject.getString("uploadDate"));
JSONArray jsonArray = (JSONArray) jsonObject.get("getToCounty");
String uploadDate = replaceDate(jsonObject.getString("uploadDate"));
String firstIndex = jsonObject.getString("firstIndex");
String pageSize = jsonObject.getString("pageSize");
String emailNo = jsonObject.getString("emailNo");
int notNull = Integer.parseInt((jsonObject.getString("notNull")));
list = personPostService.findPersonalData(applicantName,orderNumber,state,latticeMouthInformation,jsonArray,uploadDate,firstIndex,pageSize,emailNo,notNull);
}catch (Exception e){
logger.error("个人邮寄信息:" + jsonObject );
list = personPostService.findPersonalData(applicantName, orderNumber, state, latticeMouthInformation, jsonArray, uploadDate, firstIndex, pageSize, emailNo, notNull);
} catch (Exception e) {
logger.error("个人邮寄信息:" + jsonObject);
logger.error("Exception 按条件查询个人邮寄信息异常", e);
}
return list;
......@@ -157,6 +161,7 @@ public class PersonPostApi {
/**
* 按条件删除个人邮寄信息
*
* @param jsonStr
* @return
*/
......@@ -171,11 +176,11 @@ public class PersonPostApi {
String orderNumber = jsonObject.getString("orderNumber");
String state = jsonObject.getString("state");
String latticeMouthInformation = jsonObject.getString("latticeMouthInformation");
JSONArray jsonArray =(JSONArray)jsonObject.get("getToCounty");
JSONArray jsonArray = (JSONArray) jsonObject.get("getToCounty");
String uploadDate = jsonObject.getString("uploadDate");
personPostService.deletePersonalData(applicantName,orderNumber,state,latticeMouthInformation,jsonArray,uploadDate);
}catch (Exception e){
logger.error("个人邮寄信息:" + jsonObject );
personPostService.deletePersonalData(applicantName, orderNumber, state, latticeMouthInformation, jsonArray, uploadDate);
} catch (Exception e) {
logger.error("个人邮寄信息:" + jsonObject);
logger.error("Exception 按条件删除个人邮寄信息异常", e);
}
return true;
......@@ -183,71 +188,73 @@ public class PersonPostApi {
/**
* 根据导入日期删除未打印的邮政信息
*
* @param importDate
* @return
*/
@RequestMapping("recordsHaveNotPrinted")
public boolean deletePersonalDataByImportDate(@RequestParam("importDate")String importDate, HttpServletRequest requ) {
public boolean deletePersonalDataByImportDate(@RequestParam("importDate") String importDate, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
try {
personPostService.deletePersonalDataByImportDate(replaceDate(importDate));
}catch (Exception e){
logger.error("导入日期:" + importDate );
} catch (Exception e) {
logger.error("导入日期:" + importDate);
logger.error("Exception 根据导入日期删除未打印的邮政信息异常", e);
}
return true;
}
/**
* 根据导入日期删除未打印的邮政信息数量
*
* @param importDate
* @return
*/
@RequestMapping("findPersonalDataCountByImportDate")
public int findPersonalDataCountByImportDate(@RequestParam("importDate")String importDate, HttpServletRequest requ) {
public int findPersonalDataCountByImportDate(@RequestParam("importDate") String importDate, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
int count = 0;
try {
count = personPostService.findPersonalDataCountByImportDate(replaceDate(importDate));
}catch (Exception e){
logger.error("导入日期:" + importDate );
} catch (Exception e) {
logger.error("导入日期:" + importDate);
logger.error("Exception 根据导入日期删除未打印的邮政信息数量异常", e);
}
return count;
}
@RequestMapping("download")
public void exportExcel(HttpServletRequest request,HttpServletResponse response,
public void exportExcel(HttpServletRequest request, HttpServletResponse response,
@RequestParam("uploadDate") String uploadDate, @RequestParam("hasPrinted") String hasPrinted,
@RequestParam("djx") List<String> djx, @RequestParam("gkxx") String gkxx, @RequestParam("ddh") String ddh,
@RequestParam("sequence")String sequence, @RequestParam("sqrxm") String sqrxm,@RequestParam("emailNo") String emailNo) throws Exception {
@RequestParam("sequence") String sequence, @RequestParam("sqrxm") String sqrxm, @RequestParam("emailNo") String emailNo) throws Exception {
String remoteAddr = request.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONArray jsonArray = new JSONArray();
try {
jsonArray = JSONArray.fromObject(djx);
List<PersonPostEntity> list = personPostService.downLoadReportForm(request,response,sqrxm,ddh,hasPrinted,gkxx,jsonArray,replaceDate(uploadDate),emailNo);
List<PersonPostEntity> list = personPostService.downLoadReportForm(request, response, sqrxm, ddh, hasPrinted, gkxx, jsonArray, replaceDate(uploadDate), emailNo);
exportExcel(request, response, list);
}catch (Exception e){
logger.error("上传时间:" + uploadDate +"类型普证-0,邮寄-9:" + hasPrinted +"格口信息:" + gkxx +"订单号:" + ddh +"申请人姓名:" + sqrxm +"运单号码:" + emailNo);
} catch (Exception e) {
logger.error("上传时间:" + uploadDate + "类型普证-0,邮寄-9:" + hasPrinted + "格口信息:" + gkxx + "订单号:" + ddh + "申请人姓名:" + sqrxm + "运单号码:" + emailNo);
logger.error("Exception 下载Excel异常", e);
}
}
/**
*刷身份证查询邮寄单信息详情
* 刷身份证查询邮寄单信息详情
*/
@RequestMapping("getPostInfo")
public List<PersonPostEntity> findPersonalData(@RequestBody ReadCardDto readCardDto, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<PersonPostEntity> list = new ArrayList <PersonPostEntity>();
List<PersonPostEntity> list = new ArrayList<PersonPostEntity>();
try {
list = personPostService.getPostInfo(readCardDto);
}catch (Exception e){
} catch (Exception e) {
logger.error("身份证号:" + readCardDto.getIdCard() + "起始时间" + readCardDto.getStartDate() + "截止时间" + readCardDto.getEndDate());
logger.error("Exception 刷身份证查询邮寄单信息详情异常", e);
}
......@@ -256,6 +263,7 @@ public class PersonPostApi {
/**
* 更改打印状态
*
* @param id
* @param printTime
* @return
......@@ -267,7 +275,7 @@ public class PersonPostApi {
boolean flag = false;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
flag = personPostService.printPostList(id, sdf.parse(printTime));
flag = personPostService.printPostList(id, sdf.parse(printTime));
} catch (ParseException e) {
e.printStackTrace();
logger.error("打印机ID" + id + "打印时间" + printTime);
......@@ -284,124 +292,123 @@ public class PersonPostApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
/**
* 创建报表
*
*/
private void exportExcel(HttpServletRequest request, HttpServletResponse response, List<PersonPostEntity> records) throws Exception {
String remoteAddr = request.getRemoteAddr();
MDC.put("ip", remoteAddr);
try {
HSSFWorkbook wb=new HSSFWorkbook();
HSSFSheet sheet=wb.createSheet("模板明细");
HSSFCellStyle style=wb.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
HSSFRow firstRow=sheet.createRow(0);
String[] rowTitle={"订单号", "寄件人姓名", "寄件人电话2", "寄件人详细地址", "收件人姓名", "收件人电话2",
"收件人邮编", "邮件号", "内件性质", "重量", "长", "宽", "高", "收件人城市", "收件人区县", "收件人详细地址",
"回单标识", "回单运单号", "商品名称", "内件号", "内件名称"};
for (int i=0; i < rowTitle.length; i++) {
HSSFCell cell=firstRow.createCell(i);
cell.setCellValue(rowTitle[i]);
cell.setCellStyle(style);
}
sheet.setColumnWidth(0, (int) ((6.67 + 0.72) * 256));
sheet.setColumnWidth(1, (int) ((12.36 + 0.72) * 256));
sheet.setColumnWidth(2, (int) ((12.36 + 0.72) * 256));
sheet.setColumnWidth(3, (int) ((27.83 + 0.72) * 256));
sheet.setColumnWidth(4, (int) ((10.55 + 0.72) * 256));
sheet.setColumnWidth(5, (int) ((12.36 + 0.72) * 256));
sheet.setColumnWidth(6, (int) ((10.55 + 0.72) * 256));
sheet.setColumnWidth(7, (int) ((14.64 + 0.72) * 256));
sheet.setColumnWidth(8, (int) ((8.55 + 0.72) * 256));
sheet.setColumnWidth(9, (int) ((4.82 + 0.72) * 256));
sheet.setColumnWidth(10, (int) ((2.91 + 0.72) * 256));
sheet.setColumnWidth(11, (int) ((2.91 + 0.72) * 256));
sheet.setColumnWidth(12, (int) ((2.91 + 0.72) * 256));
sheet.setColumnWidth(13, (int) ((10.55 + 0.72) * 256));
sheet.setColumnWidth(14, (int) ((10.55 + 0.72) * 256));
sheet.setColumnWidth(15, (int) ((74.64 + 0.72) * 256));
sheet.setColumnWidth(16, (int) ((14.09 + 0.72) * 256));
sheet.setColumnWidth(17, (int) ((14.64 + 0.72) * 256));
sheet.setColumnWidth(18, (int) ((8.55 + 0.72) * 256));
sheet.setColumnWidth(19, (int) ((6.64 + 0.72) * 256));
sheet.setColumnWidth(20, (int) ((8.55 + 0.72) * 256));
for (int i=0; i < records.size(); i++) {
HSSFRow row=sheet.createRow(i + 1);
PersonPostEntity personPostEntity=records.get(i);
HSSFCell cell=row.createCell(0);
cell.setCellValue(personPostEntity.getId());
cell=row.createCell(1);
cell.setCellValue("人口管理总队");
cell=row.createCell(2);
cell.setCellValue("010-87682315");
cell=row.createCell(3);
cell.setCellValue("北京市丰台区成寿寺路甲19号");
cell=row.createCell(4);
cell.setCellValue(personPostEntity.getRecipientName());
cell=row.createCell(5);
cell.setCellValue(personPostEntity.getRecipientPhone());
cell=row.createCell(7);
cell.setCellValue(personPostEntity.getWaybillNumber());
cell=row.createCell(8);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(1);
cell=row.createCell(9);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(100);
cell=row.createCell(13);
cell.setCellValue(personPostEntity.getGetToCity());
cell=row.createCell(14);
cell.setCellValue(personPostEntity.getGetToProvince());
cell=row.createCell(15);
cell.setCellValue(personPostEntity.getRecipientAddress());
cell=row.createCell(16);
cell.setCellValue("6");
cell=row.createCell(17);
cell.setCellValue(personPostEntity.getBackWaybillNumber());
}
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy年MM月dd日生产导出");
String fileName=simpleDateFormat.format(new Date()) + ".xls";
String rtn="";
fileName=URLEncoder.encode(fileName, "UTF8");
String userAgent=request.getHeader("User-Agent");
/*针对IE或者以IE为内核的浏览器:*/
if(userAgent != null){
userAgent=userAgent.toLowerCase();
/*IE浏览器,只能采用URLEncoder编码*/
if(userAgent.contains("msie")){
rtn="filename=\"" + fileName + "\"";
}
/*Opera浏览器只能采用filename**/
else if(userAgent.contains("opera")){
rtn="filename*=UTF-8''" + fileName;
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("模板明细");
HSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
HSSFRow firstRow = sheet.createRow(0);
String[] rowTitle = {"订单号", "寄件人姓名", "寄件人电话2", "寄件人详细地址", "收件人姓名", "收件人电话2",
"收件人邮编", "邮件号", "内件性质", "重量", "长", "宽", "高", "收件人城市", "收件人区县", "收件人详细地址",
"回单标识", "回单运单号", "商品名称", "内件号", "内件名称"};
for (int i = 0; i < rowTitle.length; i++) {
HSSFCell cell = firstRow.createCell(i);
cell.setCellValue(rowTitle[i]);
cell.setCellStyle(style);
}
/*Safari浏览器,只能采用ISO编码的中文输出*/
else if(userAgent.contains("safari")){
rtn="filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), "ISO8859-1") + "\"";
sheet.setColumnWidth(0, (int) ((6.67 + 0.72) * 256));
sheet.setColumnWidth(1, (int) ((12.36 + 0.72) * 256));
sheet.setColumnWidth(2, (int) ((12.36 + 0.72) * 256));
sheet.setColumnWidth(3, (int) ((27.83 + 0.72) * 256));
sheet.setColumnWidth(4, (int) ((10.55 + 0.72) * 256));
sheet.setColumnWidth(5, (int) ((12.36 + 0.72) * 256));
sheet.setColumnWidth(6, (int) ((10.55 + 0.72) * 256));
sheet.setColumnWidth(7, (int) ((14.64 + 0.72) * 256));
sheet.setColumnWidth(8, (int) ((8.55 + 0.72) * 256));
sheet.setColumnWidth(9, (int) ((4.82 + 0.72) * 256));
sheet.setColumnWidth(10, (int) ((2.91 + 0.72) * 256));
sheet.setColumnWidth(11, (int) ((2.91 + 0.72) * 256));
sheet.setColumnWidth(12, (int) ((2.91 + 0.72) * 256));
sheet.setColumnWidth(13, (int) ((10.55 + 0.72) * 256));
sheet.setColumnWidth(14, (int) ((10.55 + 0.72) * 256));
sheet.setColumnWidth(15, (int) ((74.64 + 0.72) * 256));
sheet.setColumnWidth(16, (int) ((14.09 + 0.72) * 256));
sheet.setColumnWidth(17, (int) ((14.64 + 0.72) * 256));
sheet.setColumnWidth(18, (int) ((8.55 + 0.72) * 256));
sheet.setColumnWidth(19, (int) ((6.64 + 0.72) * 256));
sheet.setColumnWidth(20, (int) ((8.55 + 0.72) * 256));
for (int i = 0; i < records.size(); i++) {
HSSFRow row = sheet.createRow(i + 1);
PersonPostEntity personPostEntity = records.get(i);
HSSFCell cell = row.createCell(0);
cell.setCellValue(personPostEntity.getId());
cell = row.createCell(1);
cell.setCellValue("人口管理总队");
cell = row.createCell(2);
cell.setCellValue("010-87682315");
cell = row.createCell(3);
cell.setCellValue("北京市丰台区成寿寺路甲19号");
cell = row.createCell(4);
cell.setCellValue(personPostEntity.getRecipientName());
cell = row.createCell(5);
cell.setCellValue(personPostEntity.getRecipientPhone());
cell = row.createCell(7);
cell.setCellValue(personPostEntity.getWaybillNumber());
cell = row.createCell(8);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(1);
cell = row.createCell(9);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(100);
cell = row.createCell(13);
cell.setCellValue(personPostEntity.getGetToCity());
cell = row.createCell(14);
cell.setCellValue(personPostEntity.getGetToProvince());
cell = row.createCell(15);
cell.setCellValue(personPostEntity.getRecipientAddress());
cell = row.createCell(16);
cell.setCellValue("6");
cell = row.createCell(17);
cell.setCellValue(personPostEntity.getBackWaybillNumber());
}
/*Chrome浏览器,只能采用MimeUtility编码或ISO编码的中文输出*/
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日生产导出");
String fileName = simpleDateFormat.format(new Date()) + ".xls";
String rtn = "";
fileName = URLEncoder.encode(fileName, "UTF8");
String userAgent = request.getHeader("User-Agent");
/*针对IE或者以IE为内核的浏览器:*/
if (userAgent != null) {
userAgent = userAgent.toLowerCase();
/*IE浏览器,只能采用URLEncoder编码*/
if (userAgent.contains("msie")) {
rtn = "filename=\"" + fileName + "\"";
}
/*Opera浏览器只能采用filename**/
else if (userAgent.contains("opera")) {
rtn = "filename*=UTF-8''" + fileName;
}
/*Safari浏览器,只能采用ISO编码的中文输出*/
else if (userAgent.contains("safari")) {
rtn = "filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), "ISO8859-1") + "\"";
}
/*Chrome浏览器,只能采用MimeUtility编码或ISO编码的中文输出*/
// else if (userAgent.indexOf("applewebkit") != -1) {
// fileName = MimeUtility.encodeText(fileName, "UTF8", "B");
// rtn = "filename=\"" + fileName + "\"";
// }
/* FireFox浏览器,可以使用MimeUtility或filename*或ISO编码的中文输出*/
else if(userAgent.contains("mozilla")){
rtn="filename*=UTF-8''" + fileName;
/* FireFox浏览器,可以使用MimeUtility或filename*或ISO编码的中文输出*/
else if (userAgent.contains("mozilla")) {
rtn = "filename*=UTF-8''" + fileName;
}
}
}
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;" + rtn);
response.setCharacterEncoding("UTF-8");
OutputStream outputStream=response.getOutputStream();
wb.write(outputStream);
outputStream.flush();
outputStream.close();
}catch (Exception e){
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;" + rtn);
response.setCharacterEncoding("UTF-8");
OutputStream outputStream = response.getOutputStream();
wb.write(outputStream);
outputStream.flush();
outputStream.close();
} catch (Exception e) {
logger.error("个人邮寄信息:" + records);
logger.error("Exception 创建报表异常", e);
}
......
......@@ -42,7 +42,7 @@ public class ReadExcelApi {
@Autowired
FileNameDicService fileNameDicService;
Logger logger= Logger.getLogger(ReadExcelApi.class);
Logger logger = Logger.getLogger(ReadExcelApi.class);
/**
* 导入个人邮寄信息表
......@@ -51,7 +51,7 @@ public class ReadExcelApi {
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Transactional(rollbackFor = Exception.class)
public boolean ReadPersonPost(@RequestParam("formStartTime") String startDate,@RequestParam("formDeadLine") String endDate, HttpServletResponse resp, HttpServletRequest requ) {
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();
......@@ -81,7 +81,7 @@ public class ReadExcelApi {
Iterator<String> iter = multiRequest.getFileNames();
while (iter.hasNext()) {
List<MultipartFile> fileRows = multiRequest.getFiles(iter.next().toString());
for (MultipartFile item :fileRows){
for (MultipartFile item : fileRows) {
try {
// 如果fileitem中封装的是普通输入项的数据
// 如果fileitem中封装的是上传文件
......@@ -91,7 +91,7 @@ public class ReadExcelApi {
// 如果fileitem中封装的是普通输入项的数据
// 如果fileitem中封装的是上传文件
// 得到上传的文件名称
filename = item.getOriginalFilename();
filename = item.getOriginalFilename();
File file = null;
try {
file = File.createTempFile("prefix", "_" + item.getOriginalFilename());
......@@ -109,7 +109,7 @@ public class ReadExcelApi {
fileNameDicEntity.setUploadDate(simpleDateFormat.format(new Date()));
fileNameDicEntity.setFormStartTime(replaceDate(startDate));
fileNameDicEntity.setFormDeadline(replaceDate(endDate));
fileNameDicEntity.setState((long)0);
fileNameDicEntity.setState((long) 0);
fileNameDicService.saveFileNameDic(fileNameDicEntity);
//保存个人邮寄信息
List<PersonPostEntity> entityList = new ArrayList<>();
......@@ -143,7 +143,7 @@ public class ReadExcelApi {
personPostEntity.setLatticeMouthInformation((String) list2.get(19));
personPostEntity.setNatureOfTheInternal((String) list2.get(20));
personPostEntity.setNatureOfTheInformation((String) list2.get(21));
personPostEntity.setFirstWhite(list2.get(22).toString().substring(5,27 ) );
personPostEntity.setFirstWhite(list2.get(22).toString().substring(5, 27));
personPostEntity.setFileId(fileNameDicEntity.getFileId());
entityList.add(personPostEntity);
}
......@@ -169,10 +169,10 @@ public class ReadExcelApi {
}
}
}
}catch (Exception e){
} catch (Exception e) {
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("Exception 导入个人邮寄信息表异常", e);
}finally {
} finally {
}
return true;
......@@ -180,21 +180,22 @@ public class ReadExcelApi {
/**
* 查询个人邮寄解析信息
* @param fileName 文件名称
*
* @param fileName 文件名称
* @param analysisState 解析状态
* @param currPage 当前页
* @param pageSize 每页数量
* @param currPage 当前页
* @param pageSize 每页数量
* @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, HttpServletRequest requ) {
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));
List<FileNameDicEntity> fileNameDicEntities = fileNameDicService.queryFileNameDic(replaceDate(uploadDate), replaceNullString(fileName), Long.valueOf(analysisState), Long.valueOf(currPage), Long.valueOf(pageSize));
yxjsonResponse.outPutSuccess(fileNameDicEntities);
}catch (Exception e){
} catch (Exception e) {
logger.error("文件名:" + fileName + "是否解析1-解析,0-未解析:" + analysisState + "上传时间:" + uploadDate + "页数:" + currPage + "条数:" + pageSize);
logger.error("Exception 查询个人邮寄解析信息异常", e);
}
......@@ -203,19 +204,20 @@ public class ReadExcelApi {
/**
* 查询个人邮寄解析信息总数量
* @param fileName 文件名称
*
* @param fileName 文件名称
* @param analysisState 解析状态
* @return
*/
@RequestMapping("queryPersonPostCount")
public String queryPersonPostCount(@RequestParam("fileName") String fileName,@RequestParam("analysisState") String analysisState,@RequestParam("uploadDate") String uploadDate, HttpServletRequest requ) {
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){
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);
}
......@@ -224,32 +226,33 @@ public class ReadExcelApi {
@RequestMapping("deleteByFileId")
public Map<String,String> deleteFileById(@RequestParam("fileId")String fileId, HttpServletRequest requ) {
public Map<String, String> deleteFileById(@RequestParam("fileId") String fileId, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String,String> map = null;
Map<String, String> map = null;
try {
map = new HashMap<>();
fileNameDicService.deleteFileByFileId(fileId);
map.put("msg","删除成功");
}catch (Exception e){
map.put("msg", "删除成功");
} catch (Exception e) {
logger.error("文件名:" + fileId);
logger.error("Exception 通过file_ID删除个人邮寄解析信息异常", e);
}
return map;
}
private String replaceDate(String str){
return str.replace("-","");
private String replaceDate(String str) {
return str.replace("-", "");
}
/**
* 字符串去除空格
*
* @param str 原始字符串
* @return 返回新的字符串
*/
private String replaceNullString(String str) {
if (str == ""){
private String replaceNullString(String str) {
if (str == "") {
return null;
} else return str;
}
......
......@@ -38,7 +38,7 @@ public class ReadXmlApi {
@Autowired
private ImportXmlService importXmlService;
Logger logger= Logger.getLogger(ReadXmlApi.class);
Logger logger = Logger.getLogger(ReadXmlApi.class);
/**
* 导入检测XML
......@@ -79,7 +79,7 @@ public class ReadXmlApi {
Iterator<String> iter = multiRequest.getFileNames();
while (iter.hasNext()) {
List<MultipartFile> fileRows = multiRequest.getFiles(iter.next().toString());
for (MultipartFile item: fileRows) {
for (MultipartFile item : fileRows) {
try {
// 如果fileitem中封装的是普通输入项的数据
// 如果fileitem中封装的是上传文件
......@@ -92,28 +92,28 @@ public class ReadXmlApi {
String str = YXStringUtils.inputStream2String(in, "utf-8");
in.close();
IDCardFactory idCardFactory = new IDCardFactory();
idcardsFactory(idCardFactory.extractIDCard(str,date));
idcardsFactory(idCardFactory.extractIDCard(str, date));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
logger.error("上传文件名" + filename );
logger.error("上传文件名" + filename);
logger.error("UnsupportedEncodingException 上传文件时发现文件编码错误", e);
yxresp.outPutError("UnsupportedEncodingException", "上传文件时发现文件编码错误:" + e.getMessage());
continue;
} catch (IOException e) {
e.printStackTrace();
logger.error("上传文件名" + filename );
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("上传文件名" + filename);
logger.error("DocumentException 上传文件时发生IO错误", e);
yxresp.outPutError("DocumentException", "上传文件时发生IO错误:" + e.getMessage());
continue;
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名" + filename );
logger.error("上传文件名" + filename);
logger.error("Exception 上传文件时发生错误,非法XML文件", e);
yxresp.outPutError("Exception", "上传文件时发生错误,非法XML文件:" + filename);
continue;
......@@ -123,7 +123,7 @@ public class ReadXmlApi {
}
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名" + filename );
logger.error("上传文件名" + filename);
logger.error("FileUploadException 文件上传发生异常", e);
yxresp.outPutError("FileUploadException", "文件上传发生异常:" + e.getMessage());
} finally {
......@@ -139,68 +139,69 @@ public class ReadXmlApi {
/**
* 查询XML解析信息
*
* @param importDate 上传时间
* @param resp
* @return
*/
@RequestMapping("queryPersonXML")
public String queryPersonXMLCount(@RequestParam("importDate") String importDate,@RequestParam("currPage") String currPage,@RequestParam("pageSize") String pageSize, HttpServletResponse resp, HttpServletRequest requ) {
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()+"")){
List list=(List) map.get(countDataEntities.get(i).getUploadDate()+"");
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() + "")) {
List list = (List) map.get(countDataEntities.get(i).getUploadDate() + "");
list.add(countDataEntities.get(i));
map.put(countDataEntities.get(i).getUploadDate()+"",list);
}else {
map.put(countDataEntities.get(i).getUploadDate() + "", list);
} else {
List list = new ArrayList();
list.add(countDataEntities.get(i));
map.put(countDataEntities.get(i).getUploadDate()+"",list);
map.put(countDataEntities.get(i).getUploadDate() + "", list);
}
}
List<Map<String,Object>> mapList = new ArrayList<>();
for (String date: map.keySet()){
Map<String,Object> dateMap = new LinkedHashMap<>();
List<CountDataEntity> list=(List) map.get(date);
List<Map<String, Object>> mapList = new ArrayList<>();
for (String date : map.keySet()) {
Map<String, Object> dateMap = new LinkedHashMap<>();
List<CountDataEntity> list = (List) map.get(date);
int dateCount = 0;
int commonCount = 0;
int postCount = 0;
for (CountDataEntity countDataEntity :list){
dateCount+=countDataEntity.getCardCount();
commonCount+=countDataEntity.getCommonCardCount();
postCount+=countDataEntity.getPostCardCount();
for (CountDataEntity countDataEntity : list) {
dateCount += countDataEntity.getCardCount();
commonCount += countDataEntity.getCommonCardCount();
postCount += countDataEntity.getPostCardCount();
}
dateMap.put("dateCount",dateCount);
dateMap.put("commonCount",commonCount);
dateMap.put("postCount",postCount);
dateMap.put("packageCount",list.size());
dateMap.put("date",date);
dateMap.put("dateCount", dateCount);
dateMap.put("commonCount", commonCount);
dateMap.put("postCount", postCount);
dateMap.put("packageCount", list.size());
dateMap.put("date", date);
mapList.add(dateMap);
}
Map<String,Object> resultMap = new HashMap<>();
if (mapList.size()>=Integer.parseInt(pageSize)){
int max=Integer.parseInt(currPage)*Integer.parseInt(pageSize);
int min = (Integer.parseInt(currPage)-1)*Integer.parseInt(pageSize)+1;
Map<String, Object> resultMap = new HashMap<>();
if (mapList.size() >= Integer.parseInt(pageSize)) {
int max = Integer.parseInt(currPage) * Integer.parseInt(pageSize);
int min = (Integer.parseInt(currPage) - 1) * Integer.parseInt(pageSize) + 1;
List list = new ArrayList();
if (mapList.size()<max){
for (int i=min-1;i<mapList.size();i++){
if (mapList.size() < max) {
for (int i = min - 1; i < mapList.size(); i++) {
list.add(mapList.get(i));
}
}else {
for (int i=min-1;i<max;i++){
} else {
for (int i = min - 1; i < max; i++) {
}
}
resultMap.put("mapList",list);
}else {
resultMap.put("mapList",mapList);
resultMap.put("mapList", list);
} else {
resultMap.put("mapList", mapList);
}
resultMap.put("count",mapList.size());
resultMap.put("count", mapList.size());
yxjsonResponse.outPutSuccess(resultMap);
}catch (Exception e){
} catch (Exception e) {
logger.error("上传时间:" + importDate + "页数:" + currPage + "条数:" + pageSize);
logger.error("Exception 查询XML解析信息异常", e);
}
......@@ -209,20 +210,21 @@ public class ReadXmlApi {
/**
* 查询XML解析信息总数量
*
* @param importDate 上传时间
* @param resp
* @return
*/
@RequestMapping("queryPersonXMLCount")
public String queryPersonXMLCount(@RequestParam("importDate") String importDate, HttpServletResponse resp, HttpServletRequest requ) {
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){
yxjsonResponse.outPutSuccess(i + "");
} catch (Exception e) {
logger.error("上传时间:" + importDate);
logger.error("Exception 查询XML解析信息异常", e);
}
......@@ -236,7 +238,7 @@ public class ReadXmlApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
}
......@@ -440,7 +440,7 @@ public class ReceiptApi {
/**
* 查询分局名称
*
* @param qrCode 派出所代码
* @param policeCode 派出所代码
* @return
*/
@RequestMapping("queryPoliceName")
......@@ -456,9 +456,7 @@ public class ReceiptApi {
}
return policeName;
}
public List<Map<String, Object>> queryPoliceName(@RequestParam("qrCode") String qrCode) {
return receiptService.queryPoliceName(qrCode);
}
/**
* 查询公安网数据
......
......@@ -30,23 +30,24 @@ public class ReportApi {
@Autowired
private ReceiptService receiptService;
Logger logger= Logger.getLogger(ReportApi.class);
Logger logger = Logger.getLogger(ReportApi.class);
/**
* 查询报表
* 数据核验
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param endDate 结束时间
* @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, HttpServletRequest requ) {
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 <>();
List<Map<String, Object>> mapList = new ArrayList<>();
try {
mapList = dataAuditingService.selectDataAuditingReport(replaceDate(startDate), replaceDate(endDate),policeName,policeCode);
}catch (Exception e){
mapList = dataAuditingService.selectDataAuditingReport(replaceDate(startDate), replaceDate(endDate), policeName, policeCode);
} catch (Exception e) {
logger.error("开始时间:" + startDate + "结束时间:" + endDate + "公安机关名称:" + policeName + "公安机关代码:" + policeCode);
logger.error("Exception 查询数据核验报表异常", e);
}
......@@ -56,18 +57,19 @@ public class ReportApi {
/**
* 查询报表
* 膜打印
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param endDate 结束时间
* @return
*/
@RequestMapping("queryFilmPrintReport")
public List<Map<String, Object>> queryFilmPrintReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate, HttpServletRequest requ) {
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 <>();
List<Map<String, Object>> mapList = new ArrayList<>();
try {
mapList = taskListService.selectFilmReport(replaceDate(startDate), replaceDate(endDate));
}catch (Exception e){
} catch (Exception e) {
logger.error("开始时间:" + startDate + "结束时间:" + endDate);
logger.error("Exception 查询膜打印报表异常", e);
}
......@@ -77,19 +79,20 @@ public class ReportApi {
/**
* 查询报表
* 工作组
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param endDate 结束时间
* @param workGroup 工作组
* @return
*/
@RequestMapping("queryWorkGroupReport")
public List<Map<String,Object>> queryWorkGroupReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "workGroup") String workGroup, HttpServletRequest requ) {
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 <>();
List<Map<String, Object>> mapList = new ArrayList<>();
try {
mapList = taskListService.selectWorkGroupReport(replaceDate(startDate), replaceDate(endDate), workGroup);
}catch (Exception e){
} catch (Exception e) {
logger.error("开始时间:" + startDate + "结束时间:" + endDate + "工作组:" + workGroup);
logger.error("Exception 查询工作组报表异常", e);
}
......@@ -99,19 +102,20 @@ public class ReportApi {
/**
* 查询报表
* 分拣
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param name 分拣人员
* @param endDate 结束时间
* @param name 分拣人员
* @return
*/
@RequestMapping("querySortingReport")
public List<Map<String, Object>> querySortingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "name") String name, HttpServletRequest requ) {
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 <>();
List<Map<String, Object>> mapList = new ArrayList<>();
try {
mapList = receiptService.selectReceiptReport(replaceDate(startDate), replaceDate(endDate), name);
}catch (Exception e){
} catch (Exception e) {
logger.error("开始时间:" + startDate + "结束时间:" + endDate + "分拣人员:" + name);
logger.error("Exception 查询分拣报表异常", e);
}
......@@ -121,18 +125,19 @@ public class ReportApi {
/**
* 查询报表
* 质检 仓库
*
* @param startDate 开始时间
* @param endDate 结束时间
* @param endDate 结束时间
* @return
*/
@RequestMapping("queryQualityCheckReport")
public List<Map<String, Object>> queryQualityCheckReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate, HttpServletRequest requ) {
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 <>();
List<Map<String, Object>> mapList = new ArrayList<>();
try {
mapList = taskListService.selectQualityCheckReport(replaceDate(startDate), replaceDate(endDate));
}catch (Exception e){
} catch (Exception e) {
logger.error("开始时间:" + startDate + "结束时间:" + endDate);
logger.error("Exception 查询质检(仓库)报表异常", e);
}
......@@ -146,7 +151,7 @@ public class ReportApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
......
......@@ -26,7 +26,7 @@ public class SelectApi {
@Autowired
private SelectSerialNumberService selectSerialNumberService;
Logger logger= Logger.getLogger(SelectApi.class);
Logger logger = Logger.getLogger(SelectApi.class);
@RequestMapping(value = "selectByCard")
public Map<String, Object> selectByCard(@RequestParam("id") String id, HttpServletRequest requ) {
......@@ -70,7 +70,7 @@ public class SelectApi {
} else {
// return null;
}
}catch (Exception e){
} catch (Exception e) {
logger.error("传入的组号8位、受理号10位、身份证号18位、任务单号11位" + id);
logger.error("Exception SelectApi异常", e);
}
......@@ -79,11 +79,12 @@ public class SelectApi {
/**
* 格式化受理组号
*
* @param acceptNo
* @return
*/
private String formateAcceptNo(String acceptNo){
return acceptNo.replace("e", "E").replace("g", "G").replace("l","L");
private String formateAcceptNo(String acceptNo) {
return acceptNo.replace("e", "E").replace("g", "G").replace("l", "L");
}
}
......@@ -23,10 +23,11 @@ public class SpecialCardApi {
@Autowired
private SpecialCardService specialCardService;
Logger logger= Logger.getLogger(SpecialCardApi.class);
Logger logger = Logger.getLogger(SpecialCardApi.class);
/**
* 查询特殊证件详情
*
* @param groupNo 组号
* @return
*/
......@@ -37,8 +38,8 @@ public class SpecialCardApi {
List<Map> map = new ArrayList<>();
try {
map = specialCardService.selectSpecialCardByGroupNo(groupNo);
}catch (Exception e){
logger.error("组号:" + groupNo );
} catch (Exception e) {
logger.error("组号:" + groupNo);
logger.error("Exception 查询特殊证件详情异常", e);
}
return map;
......
......@@ -35,7 +35,7 @@ public class TaskListApi {
@Autowired
private ReceiptService receiptService;
Logger logger= Logger.getLogger(TaskListApi.class);
Logger logger = Logger.getLogger(TaskListApi.class);
/**
* 更改任务单状态
......@@ -65,7 +65,7 @@ public class TaskListApi {
} else {
state = taskListService.updateState(failedList, list, process, name);
}
}catch (Exception e){
} catch (Exception e) {
logger.error("任务单状态:" + jsonObject);
logger.error("Exception 更改任务单状态(下发、预订位、平压、冲切、分拣)异常", e);
}
......@@ -89,20 +89,21 @@ public class TaskListApi {
JSONObject jsonObject = new JSONObject();
boolean state = true;
try {
jsonObject=JSONObject.fromObject(json);
JSONArray jsonArray=(JSONArray) jsonObject.get("taskIdList");
JSONArray failedList=(JSONArray) jsonObject.get("failedList");
String process=jsonObject.get("process").toString();
String name=jsonObject.get("name").toString();
jsonObject = JSONObject.fromObject(json);
JSONArray jsonArray = (JSONArray) jsonObject.get("taskIdList");
JSONArray failedList = (JSONArray) jsonObject.get("failedList");
String process = jsonObject.get("process").toString();
String name = jsonObject.get("name").toString();
// String printer = jsonObject.get("printer").toString();
List <String> list=(List <String>) jsonArray;
List<String> list = (List<String>) jsonArray;
state = taskListService.updateState2(failedList, list, process, name);
}catch (Exception e){
} catch (Exception e) {
logger.error("任务单状态:" + jsonObject);
logger.error("Exception 更改任务单状态(打印转出)异常", e);
}
return state;
return state;
}
/**
* 更改任务单工作组
* (打印转出)
......@@ -118,12 +119,12 @@ public class TaskListApi {
JSONObject jsonObject = new JSONObject();
boolean state = true;
try {
jsonObject=JSONObject.fromObject(json);
JSONArray jsonArray=(JSONArray) jsonObject.get("taskIdList");
String workGroup=jsonObject.get("workGroup").toString();
List <String> list=(List <String>) jsonArray;
jsonObject = JSONObject.fromObject(json);
JSONArray jsonArray = (JSONArray) jsonObject.get("taskIdList");
String workGroup = jsonObject.get("workGroup").toString();
List<String> list = (List<String>) jsonArray;
state = taskListService.updateWorkGroup(list, workGroup);
}catch (Exception e){
} catch (Exception e) {
logger.error("任务单状态:" + jsonObject);
logger.error("Exception 更改任务单状态(打印转出)异常", e);
}
......@@ -147,7 +148,7 @@ public class TaskListApi {
List<Object> objects = new ArrayList<>();
try {
objects = taskListService.selectByCountyAtACCU(replaceDate(date));
}catch (Exception e){
} catch (Exception e) {
logger.error("工序:" + process + "查询时间:" + date);
logger.error("Exception 查询任务单详情(受理库)异常", e);
}
......@@ -171,7 +172,7 @@ public class TaskListApi {
Map<String, Object> objects = null;
try {
objects = taskListService.selectByGroupNoAtACCU(replaceDate(date), typeCode, countyCode, Long.valueOf(currPage), Long.valueOf(pageSize));
}catch (Exception e){
} catch (Exception e) {
logger.error("查询时间:" + date + "制证类型:" + typeCode + "区县代码:" + countyCode + "页数:" + currPage + "条数:" + pageSize);
logger.error("Exception 查询组号列表详情(受理库)异常", e);
}
......@@ -191,9 +192,9 @@ public class TaskListApi {
public List<Object> queryByCountyAtAuxiliary(@RequestParam("process") String process, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Object> objects = new ArrayList <>();
List<Object> objects = new ArrayList<>();
// try {
objects = taskListService.selectByCountyAtAuxiliary(Long.valueOf(process) - 1);
objects = taskListService.selectByCountyAtAuxiliary(Long.valueOf(process) - 1);
// }catch (Exception e){
// logger.error("工序:" + process);
// logger.error("Exception 查询任务单详情(辅助库)(下发、数据核验、膜打印)异常", e);
......@@ -211,13 +212,13 @@ public class TaskListApi {
* @return
*/
@RequestMapping("queryByCountyAtAuxiliaryState1")
public Map queryByCountyAtAuxiliaryState1(@RequestParam("process") String process,@RequestParam("workGroup") String workGroup, HttpServletResponse resp, HttpServletRequest requ) {
public Map queryByCountyAtAuxiliaryState1(@RequestParam("process") String process, @RequestParam("workGroup") String workGroup, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map map = new HashMap();
try {
map = taskListService.selectByCountyAtAuxiliary2(Long.valueOf(process),workGroup);
}catch (Exception e){
map = taskListService.selectByCountyAtAuxiliary2(Long.valueOf(process), workGroup);
} catch (Exception e) {
logger.error("工序:" + process + "工作组" + workGroup);
logger.error("Exception 查询任务单详情(辅助库)(预订位、平压)异常", e);
}
......@@ -234,13 +235,13 @@ public class TaskListApi {
* @return
*/
@RequestMapping("queryByCountyAtAuxiliaryState3")
public List<Object> queryByCountyAtAuxiliaryState3(@RequestParam("process") String process,@RequestParam("workGroup")String workGroup, HttpServletResponse resp, HttpServletRequest requ) {
public List<Object> queryByCountyAtAuxiliaryState3(@RequestParam("process") String process, @RequestParam("workGroup") String workGroup, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Object> objects = new ArrayList <>();
List<Object> objects = new ArrayList<>();
try {
objects = taskListService.selectByCountyAtAuxiliary3(Long.valueOf(process) - 1,workGroup);
}catch (Exception e){
objects = taskListService.selectByCountyAtAuxiliary3(Long.valueOf(process) - 1, workGroup);
} catch (Exception e) {
logger.error("工序:" + process + "工作组" + workGroup);
logger.error("Exception 查询任务单详情(辅助库、制证库)(电写入)异常", e);
}
......@@ -259,10 +260,10 @@ public class TaskListApi {
public List<Object> queryByCountyAtAuxiliaryState4(@RequestParam("process") String process, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Object> objects = new ArrayList <>();
List<Object> objects = new ArrayList<>();
try {
objects = taskListService.selectByCountyAtAuxiliary4(Long.valueOf(process) - 1);
}catch (Exception e){
} catch (Exception e) {
logger.error("工序:" + process);
logger.error("Exception 查询任务单详情(辅助库)(下发、数据核验、膜打印)异常", e);
}
......@@ -270,7 +271,6 @@ public class TaskListApi {
}
/**
* 查询任务单详情(历史)
* (辅助库)
......@@ -284,10 +284,10 @@ public class TaskListApi {
public List<Object> queryHistoryTaskAtAuxiliary(@RequestParam("process") String process, @RequestParam("date") String date, @RequestParam("workGroup") String workGroup, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Object> objects = new ArrayList <>();
List<Object> objects = new ArrayList<>();
try {
objects = taskListService.selectHistoryTaskAtAuxiliary(Long.valueOf(process), replaceDate(date), workGroup);
}catch (Exception e){
} catch (Exception e) {
logger.error("工序:" + process + "查询时间:" + date + "工作组" + workGroup);
logger.error("Exception 查询任务单详情(历史)(辅助库)(创建、下发、膜打印、预订位、平压、冲切)异常", e);
}
......@@ -306,10 +306,10 @@ public class TaskListApi {
public List<Object> queryHistoryTaskAtAuxiliary2(@RequestParam("date") String date, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Object> objects = new ArrayList <>();
List<Object> objects = new ArrayList<>();
try {
objects = taskListService.selectHistoryTaskAtAuxiliary2(replaceDate(date));
}catch (Exception e){
} catch (Exception e) {
logger.error("查询时间:" + date);
logger.error("Exception 查询任务单详情(历史)(辅助库)(分拣)异常", e);
}
......@@ -340,23 +340,23 @@ public class TaskListApi {
//生成某几个组的区县任务单
if (jsonGroup.size() > 0) {
List<List<String>> listList = jsonGroup;
for (List<String> groupList :listList){
for (List<String> groupList : listList) {
//查询组号详情
String groupNo = "";
for (int i = 0; i < groupList.size(); i++) {
if (i != groupList.size() - 1) {
groupNo += "'" + groupList.get(i) + "',";
groupNo += "'" + groupList.get(i) + "',";
} else {
groupNo += "'" + groupList.get(i) + "'";
}
}
List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(groupNo);
boolean b = taskListService.saveTask(objects, name, 0 + "",groupNo);
boolean b = taskListService.saveTask(objects, name, 0 + "", groupNo);
}
}
map.put("msg", "成功生成任务单");
}catch (Exception e){
} catch (Exception e) {
logger.error("任务单生成参数:" + jsonObject);
logger.error("Exception 生成任务单异常", e);
}
......@@ -366,7 +366,7 @@ public class TaskListApi {
/**
* 生成快证任务单
*
* <p>
* name 提交人姓名
* acceptNo 受理组号
* cardType 制证类型(原有)
......@@ -437,7 +437,7 @@ public class TaskListApi {
specialCardEntity.setTaskId(taskEntity.getTaskId());
specialCardService.saveSpecialCard(specialCardEntity);
for (GroupNoEntity groupNoEntity : groupNoEntities) {
if (groupNoEntity.getValidCount()==1){
if (groupNoEntity.getValidCount() == 1) {
taskListService.deleteRedoTask(groupNoEntity.getTaskId());
break;
}
......@@ -446,7 +446,7 @@ public class TaskListApi {
}
}
map.put("msg", "成功添加快证任务单");
}catch (Exception e){
} catch (Exception e) {
logger.error("快证任务单生成参数:" + jsonObject);
logger.error("Exception 快证生成任务单异常", e);
}
......@@ -466,7 +466,7 @@ public class TaskListApi {
public Map<String, Object> createRedoTask(@RequestBody String object) {
// JSONObject jsonObject = JSONObject.fromObject(object);
JSONArray jsonArray = JSONArray.fromObject(object);
for(Object o :jsonArray){
for (Object o : jsonArray) {
JSONObject jsonObject = JSONObject.fromObject(o);
String acceptNo = jsonObject.getString("acceptNo");
String name = jsonObject.getString("name");
......@@ -496,21 +496,22 @@ public class TaskListApi {
/**
* 查询重做返回登记任务单
*
* @param startDate 查询起始时间
* @param endDate 查询结束时间
* @param endDate 查询结束时间
* @param requ
* @return
*/
@RequestMapping("queryRedoTask")
public List<Map<String, Object>> queryRedoTask( @RequestParam("startDate")String startDate,@RequestParam("endDate")String endDate, HttpServletRequest requ) {
public List<Map<String, Object>> queryRedoTask(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> maps = new ArrayList <>();
List<Map<String, Object>> maps = new ArrayList<>();
try {
maps = taskListService.selectRedoTask(replaceDate(startDate),replaceDate(endDate));
}catch (Exception e){
logger.error("登记时间:" + startDate+"-------"+endDate);
maps = taskListService.selectRedoTask(replaceDate(startDate), replaceDate(endDate));
} catch (Exception e) {
logger.error("登记时间:" + startDate + "-------" + endDate);
logger.error("Exception 查询重做返回登记任务单异常", e);
}
return maps;
......@@ -518,17 +519,18 @@ public class TaskListApi {
/**
* 删除重做返回登记任务单
*
* @param taskId 任务单ID
* @return
*/
@RequestMapping("deleteRedoTask")
public boolean deleteRedoTask( @RequestParam("taskId")String taskId, HttpServletRequest requ) {
public boolean deleteRedoTask(@RequestParam("taskId") String taskId, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
boolean redoTask = true;
try {
redoTask = taskListService.deleteRedoTask(Long.valueOf(taskId));
}catch (Exception e){
} catch (Exception e) {
logger.error("任务单ID:" + taskId);
logger.error("Exception 删除重做返回登记任务单异常", e);
}
......@@ -549,7 +551,7 @@ public class TaskListApi {
public Map<String, Object> addBackCard(@RequestBody String object, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String, Object> map = new LinkedHashMap <>();
Map<String, Object> map = new LinkedHashMap<>();
JSONObject jsonObject = new JSONObject();
try {
jsonObject = JSONObject.fromObject(object);
......@@ -582,7 +584,7 @@ public class TaskListApi {
specialCardService.saveSpecialCard(specialCardEntity);
}
map.put("msg", "成功添加退证");
}catch (Exception e){
} catch (Exception e) {
logger.error("生成退证参数:" + jsonObject);
logger.error("Exception 生成退证异常", e);
}
......@@ -590,18 +592,17 @@ public class TaskListApi {
}
/**
* 查询制证类型列表
*/
@RequestMapping("getTypeList")
public List<CardTypeDicEntity> getTypeList( HttpServletRequest requ) {
public List<CardTypeDicEntity> getTypeList(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<CardTypeDicEntity> list = new ArrayList <>();
List<CardTypeDicEntity> list = new ArrayList<>();
try {
list = taskListService.getTypeList();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 查询制证类型列表异常", e);
}
return list;
......@@ -610,6 +611,7 @@ public class TaskListApi {
/**
* 查询提交人上传的余证详情
*
* @param date 提交日期
* @param name 提交人姓名
* @return
......@@ -618,10 +620,10 @@ public class TaskListApi {
public List<Map<String, Object>> queryRemainderCardInfo(@RequestParam("date") String date, @RequestParam("name") String name, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> failedCardEntities = new ArrayList <>();
List<Map<String, Object>> failedCardEntities = new ArrayList<>();
try {
failedCardEntities = taskListService.selectRemainderCardInfo(replaceDate(date), name);
}catch (Exception e){
} catch (Exception e) {
logger.error("提交日期:" + date + "提交人姓名" + name);
logger.error("Exception 查询已转出数量异常", e);
}
......@@ -636,10 +638,10 @@ public class TaskListApi {
public List<Map<String, Object>> getPrintOutCount(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> printOutCount = new ArrayList <>();
List<Map<String, Object>> printOutCount = new ArrayList<>();
try {
printOutCount = taskListService.getPrintOutCount();
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 查询已转出数量异常", e);
}
return printOutCount;
......@@ -665,7 +667,7 @@ public class TaskListApi {
String workGroup = jsonObject.get("workGroup").toString();
List<String> list = (List<String>) jsonArray;
state = taskListService.updateFailedCardWorkGroup(list, workGroup);
}catch (Exception e){
} catch (Exception e) {
logger.error("废证任务单参数:" + jsonObject);
logger.error("Exception 更改废证任务单工作组(打印转出)异常", e);
}
......@@ -679,8 +681,9 @@ public class TaskListApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
/**
* 字符串去除空格
*
......
......@@ -15,15 +15,15 @@ import javax.servlet.http.HttpServletRequest;
public class UpdateStateApi {
@Autowired
PreproPersonService preproPersonService;
Logger logger= Logger.getLogger(UpdateStateApi.class);
Logger logger = Logger.getLogger(UpdateStateApi.class);
@RequestMapping("updateState")
public boolean updateState(@RequestParam(value = "state") String state,@RequestParam(value = "acceptNo") String acceptNo, HttpServletRequest requ) {
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){
preproPersonService.uploadState(state, acceptNo);
} catch (Exception e) {
logger.error("状态(是否打包):" + state + "受理号:" + acceptNo);
logger.error("Exception updateState异常", e);
}
......
......@@ -25,7 +25,7 @@ import java.util.Map;
@RequestMapping("user")
public class UserApi {
Logger logger= Logger.getLogger(UserApi.class);
Logger logger = Logger.getLogger(UserApi.class);
@PostMapping("login")
public Map<String, Object> submitLogin(@RequestBody String jsonStr, HttpServletRequest requ) {
......@@ -64,7 +64,7 @@ public class UserApi {
}
@RequestMapping("logout")
public void logout( HttpServletRequest requ) {
public void logout(HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
try {
......@@ -72,7 +72,7 @@ public class UserApi {
if (subject.isAuthenticated()) {
subject.logout();
}
}catch (Exception e){
} catch (Exception e) {
logger.error("Exception 用户登出异常", e);
}
}
......
......@@ -25,42 +25,42 @@ public class queryPreproPerson {
@Autowired
private PreproPersonService preproPersonService;
Logger logger= Logger.getLogger(queryPreproPerson.class);
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, HttpServletRequest requ) {
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;
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);
List<Map<String, Object>> preproPersonEntities = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate), currPage, pageSize, downloadState);
//todo
List<Map<String, Object>> preproPersonEntityList = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate),downloadState);
map.put("total",preproPersonEntityList.size());
int youSum =0;
int puSum=0;
List<Map<String, Object>> preproPersonEntityList = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate), downloadState);
map.put("total", preproPersonEntityList.size());
int youSum = 0;
int puSum = 0;
int invaildCount = 0;
for (Map<String, Object> map1 :preproPersonEntityList){
if ("9".equals(map1.get("CARD_TYPE_ID")+"")){
for (Map<String, Object> map1 : preproPersonEntityList) {
if ("9".equals(map1.get("CARD_TYPE_ID") + "")) {
youSum++;
}else if ("0".equals(map1.get("CARD_TYPE_ID")+"")){
} else if ("0".equals(map1.get("CARD_TYPE_ID") + "")) {
puSum++;
}
if ("0".equals(map1.get("IS_VALID")+"")){
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);
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);
}
return map;
......@@ -71,19 +71,19 @@ public class queryPreproPerson {
*/
@RequestMapping("updatePreproPerson")
// @RequiresPermissions("userInfo.add")//权限管理;
public Map<String,Object> updatePreproPerson(@RequestParam("id") String id, @RequestParam("isValid")String isValid, HttpServletResponse response, HttpServletRequest requ) {
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;
Map<String, Object> map = null;
try {
PreproPersonEntity preproPersonEntity = new PreproPersonEntity();
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 );
map.put("msg", "成功更新制证数据是否有效");
} catch (Exception e) {
logger.error("制证信息ID:" + id + "是否有效(1有效,0无效):" + isValid);
logger.error("Exception 更新制证数据是否有效异常", e);
}
return map;
......@@ -94,17 +94,17 @@ 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, HttpServletRequest requ) {
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;
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);
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;
......@@ -117,7 +117,7 @@ public class queryPreproPerson {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
......
......@@ -21,22 +21,22 @@ public interface CardDetailedListMapper {
* 生成身份证详单
*/
@Insert("INSERT INTO DETAIL_RECEIPT_LIST (UPLOAD_NO,POLICE_CODE,CARD_ID,NAME)VALUES(#{uploadNo},#{policeCode},#{cardId},#{name})")
public boolean saveCardDetailedList(@Param("uploadNo")String uploadNo,@Param("policeCode")String policeCode,@Param("cardId")String cardId,@Param("name")String name);
public boolean saveCardDetailedList(@Param("uploadNo") String uploadNo, @Param("policeCode") String policeCode, @Param("cardId") String cardId, @Param("name") String name);
/**
*查询详单数据
* 查询详单数据
*/
@Select("select * from DETAIL_RECEIPT_LIST where CARD_ID = #{idCard}")
public List<DetailReceiptListEntity> findCardDetailedListByIdCard(@Param("idCard")String idCard);
public List<DetailReceiptListEntity> findCardDetailedListByIdCard(@Param("idCard") String idCard);
/**
*查询详单数据
* 查询详单数据
*/
@Select("select DETAIL_RECEIPT_LIST.*,RECEIPT_LIST.state,PROD_TRACE_T.DOWNLOAD_DATE,PROD_TRACE_T.ELECTRIC_WRITE_DATE,PROD_TRACE_T.CHECK_DATE from DETAIL_RECEIPT_LIST \n" +
"left join PROD_CARD_T@PRODYD_LINK ON PROD_CARD_T.ID_NO=DETAIL_RECEIPT_LIST.CARD_ID\n" +
"LEFT JOIN PROD_TRACE_T@PRODYD_LINK ON PROD_TRACE_T.ACCEPT_NO = PROD_CARD_T.ACCEPT_NO\n" +
"left join RECEIPT_LIST on RECEIPT_LIST.id = DETAIL_RECEIPT_LIST.RECEIPT_ID\n" +
"where RECEIPT_ID in (select RECEIPT_ID from DETAIL_RECEIPT_LIST where CARD_ID =#{idCard} )")
public List<Map<String,Object>> findAllCardDetailedListByIdCard(@Param("idCard")String idCard);
public List<Map<String, Object>> findAllCardDetailedListByIdCard(@Param("idCard") String idCard);
}
......@@ -14,7 +14,7 @@ import java.util.Map;
public interface DataAuditingMapper {
@Insert("insert into Data_Auditing (POLICE_SUBSTATION,VALID_COUNT,inVALID_COUNT,submit_date) values (#{policeSubstation},#{validCount},#{invalidCount},sysdate) ")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "ID")
public boolean saveDataAuditingEntity(DataAuditingEntity dataAuditingEntity);
......@@ -30,7 +30,7 @@ public interface DataAuditingMapper {
" select ACCEPT_NO from ACC_ERROR_INFO_T@ACCUYD_LINK)\n" +
" and substr(ACCEPT_NO,0,8) in (#{groupNo})\n" +
" group by substr(UPLOAD_NO,0,9)) b on a.POLICE_SUBSTATION = b.POLICE_SUBSTATION ")
public List<Map<String,Object>> selectDataAuditingEntity(@Param("groupNo")String groupNo);
public List<Map<String, Object>> selectDataAuditingEntity(@Param("groupNo") String groupNo);
@Select("<script>" +
"select nvl(GAJG_DM.GAJG_MC,'000000000') GAJG_MC,DATA_AUDITING.POLICE_SUBSTATION,sum(DATA_AUDITING.VALID_COUNT) VALID_COUNT,\n" +
......@@ -41,14 +41,14 @@ public interface DataAuditingMapper {
"left join GAJG_DM on GAJG_DM.GAJG_DM = DATA_AUDITING.POLICE_SUBSTATION\n" +
"where 1=1 " +
" <if test = 'policeName != null' >" +
" and GAJG_DM.GAJG_MC like ${policeName}"+
" and GAJG_DM.GAJG_MC like ${policeName}" +
"</if>\n" +
" <if test = 'policeCode != null' >" +
" and DATA_AUDITING.POLICE_SUBSTATION like ${policeCode}"+
" and DATA_AUDITING.POLICE_SUBSTATION like ${policeCode}" +
"</if> " +
" and to_char(DATA_AUDITING.SUBMIT_DATE,'yyyyMMdd') BETWEEN ${startDate} and ${endDate} \n" +
"group by nvl(GAJG_DM.GAJG_MC,'000000000'),DATA_AUDITING.POLICE_SUBSTATION, to_char(DATA_AUDITING.SUBMIT_DATE,'yyyyMMdd'), CARD_TYPE_DIC.CARD_TYPE, CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"order by DATA_AUDITING.POLICE_SUBSTATION" +
"</script>")
public List<Map<String,Object>> selectDataAuditingReport(@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("policeName")String policeName,@Param("policeCode")String policeCode);
public List<Map<String, Object>> selectDataAuditingReport(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("policeName") String policeName, @Param("policeCode") String policeCode);
}
......@@ -13,6 +13,6 @@ import org.apache.ibatis.annotations.Options;
public interface DeliveredFailedInfoMapper {
@Insert("insert into DELIVERED_FAILED_INFO (WAYBILL_NUMBER,BACK_DATE,BACK_REASON,note,REGISTER_NAME,CARD_ID) \n" +
"VALUES (#{waybillNumber},sysdate,#{backReason},#{note},#{registerName},#{cardId})")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "ID")
public boolean saveDeliveredFailedInfo(DeliveredFailedInfoEntity deliveredFailedInfoEntity);
}
......@@ -13,6 +13,6 @@ import org.apache.ibatis.annotations.Options;
public interface DeliveredImportDicMapper {
@Insert("insert into DELIVERED_IMPORT_DIC (FILE_NAME,IMPORT_DATE,import_name,import_count) \n" +
"VALUES (#{fileName},sysdate,#{importName},#{importCount})")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "ID")
public boolean saveDeliveredImportDic(DeliveredImportDicEntity deliveredImportDicEntity);
}
......@@ -17,8 +17,8 @@ public interface DeliveredInfoMapper {
@Insert("insert into DELIVERED_INFO (WAYBILL_NUMBER,DEAL_DATE,DEAL_STATE,FILE_ID) \n" +
"VALUES (#{waybillNumber},sysdate,#{dealState},#{fileId})")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
public boolean saveDeliveredInfo(DeliveredInfoEntity deliveredInfoEntity);
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "ID")
public boolean saveDeliveredInfo(DeliveredInfoEntity deliveredInfoEntity);
@Select("select to_char(PRINT_DATE,'yyyyMMdd') PRINT_DATE ,count(PERSON_POST.WAYBILL_NUMBER) post_Count,\n" +
"sum(decode(DELIVERED_INFO.WAYBILL_NUMBER,null,0,1)) DELIVERED_count,\n" +
......@@ -27,25 +27,26 @@ public interface DeliveredInfoMapper {
"left join DELIVERED_FAILED_INFO on PERSON_POST.WAYBILL_NUMBER = DELIVERED_FAILED_INFO.WAYBILL_NUMBER\n" +
"where to_char(PRINT_DATE,'yyyyMMdd') BETWEEN #{startDate} and #{endDate} \n" +
"group by to_char(PRINT_DATE,'yyyyMMdd')")
public List<Map<String,Object>> selectReport(@Param("startDate")String startDate,@Param("endDate") String endDate);
public List<Map<String, Object>> selectReport(@Param("startDate") String startDate, @Param("endDate") String endDate);
@Select("select * from DELIVERED_IMPORT_DIC where TO_CHAR(IMPORT_DATE,'yyyyMMdd') = #{date} ")
public List<DeliveredImportDicEntity> selectDeliveredByImportDate(@Param("date")String date);
public List<DeliveredImportDicEntity> selectDeliveredByImportDate(@Param("date") String date);
@Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" +
"left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" +
"where to_char(back_date,'yyyyMMdd') = #{date}")
public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(@Param("date")String date);
public List<Map<String, Object>> selectDeliveredFailedByRegisterDate(@Param("date") String date);
@Delete("delete from DELIVERED_INFO where FILE_ID = #{fileId}")
public boolean deleteDeliveredByFileId(@Param("fileId")long fileId);
public boolean deleteDeliveredByFileId(@Param("fileId") long fileId);
@Delete("delete from DELIVERED_IMPORT_DIC where id = #{fileId}")
public boolean deleteDeliveredImportDicByFileId(@Param("fileId")long fileId);
public boolean deleteDeliveredImportDicByFileId(@Param("fileId") long fileId);
@Delete("delete from DELIVERED_FAILED_INFO where id = #{id}")
public boolean deleteDeliveredFailedById(@Param("id")long id);
public boolean deleteDeliveredFailedById(@Param("id") long id);
@Select("select * from DELIVERED_FAILED_REASON ")
public List<DeliveredFailedReasonEntity> selectDeliveredFailedType();
}
......@@ -17,6 +17,7 @@ import java.util.Map;
public interface DetailReceiptListMapper {
/**
* 查询导出制证数据
*
* @return
*/
@Select("select DETAIL_RECEIPT_LIST.id,DETAIL_RECEIPT_LIST.ACCEPT_NO,DETAIL_RECEIPT_LIST.NAME,DETAIL_RECEIPT_LIST.UPLOAD_NO,\n" +
......@@ -27,31 +28,34 @@ public interface DetailReceiptListMapper {
"where RECEIPT_LIST.id in (${str}) " +
" order by DETAIL_RECEIPT_LIST.ACCEPT_NO " +
"")
public List<Map<String,Object>> selectPostDetails(@Param("str")String str);
public List<Map<String, Object>> selectPostDetails(@Param("str") String str);
/**
* 更新下载公安网数据
*
* @return
*/
@Update("update RECEIPT_LIST set DOWNLOAD_DATE = sysdate ,DOWNLOAD_NAME = #{name}\n" +
"where RECEIPT_LIST.id in (${str}) ")
public List<Map<String,Object>> updateReceiptListEntityByCardId(@Param("str")String str, @Param("name")String name);
public List<Map<String, Object>> updateReceiptListEntityByCardId(@Param("str") String str, @Param("name") String name);
/**
* 查询详单信息
*
* @param cardId 身份证件号码
* @return
*/
@Select("select * from DETAIL_RECEIPT_LIST where CARD_ID = #{cardId} order by id desc")
public List<DetailReceiptListEntity> selectDetailReceiptListEntityByCardId(String cardId);
/**
* 更新详单信息的交接单Id
*
* @return
*/
@Update("UPDATE DETAIL_RECEIPT_LIST set RECEIPT_ID = #{reciptId} where id =#{id}")
public boolean updateDetailReceiptList(@Param("id")long id, @Param("reciptId")long reciptId);
public boolean updateDetailReceiptList(@Param("id") long id, @Param("reciptId") long reciptId);
}
......@@ -16,6 +16,7 @@ public interface FailedCardMapper {
/**
* 查询废证字典表,拿到所有废证原因
*
* @return
*/
@Select("select * from FAILED_CARD_REASON_DIC ")
......@@ -23,6 +24,7 @@ public interface FailedCardMapper {
/**
* 根据身份证号查询详细信息
*
* @param cardId
* @return
*/
......@@ -30,28 +32,29 @@ public interface FailedCardMapper {
"PROD_CARD_T.SEX_NO,\n" +
"PROD_CARD_T.ID_NO,\n" +
"SPECIAL_CARD.SPECIAL_TYPE, " +
"FAILED_CARD_REASON_DIC.FAILED_CARD_REASON \n "+
"FAILED_CARD_REASON_DIC.FAILED_CARD_REASON \n " +
"FROM PROD_CARD_T@PRODYD_LINK\n" +
"left join SPECIAL_CARD on PROD_CARD_T.ACCEPT_NO = SPECIAL_CARD.ACCEPT_NO " +
"left join failed_card on PROD_CARD_T.ACCEPT_NO = failed_card.ACCEPT_NO " +
" left join FAILED_CARD_REASON_DIC on failed_card.FAILED_CARD_REASON_ID =FAILED_CARD_REASON_DIC.FAILED_CARD_REASON_ID"+
" left join FAILED_CARD_REASON_DIC on failed_card.FAILED_CARD_REASON_ID =FAILED_CARD_REASON_DIC.FAILED_CARD_REASON_ID" +
" WHERE PROD_CARD_T.ID_NO=#{cardId} OR PROD_CARD_T.ACCEPT_NO=#{cardId}")
public Map<String,Object>selectInfoByCardId(@Param("cardId")String cardId);
public Map<String, Object> selectInfoByCardId(@Param("cardId") String cardId);
/**
* 生成废证
*
* @param failedCardReasonId 废证原因
* @param acceptNo 受理组号
* @param taskId 任务单ID
* @param initiator 发起工序
* @param note 备注
* @param workGroup 工作组
* @param name 提交人姓名
* @param acceptNo 受理组号
* @param taskId 任务单ID
* @param initiator 发起工序
* @param note 备注
* @param workGroup 工作组
* @param name 提交人姓名
* @return
*/
@Insert("INSERT INTO FAILED_CARD (FAILED_CARD_REASON_ID,ACCEPT_NO,TASK_ID,STATE,INITIATOR,NOTE,work_group,name) VALUES (#{failedCardReasonId},#{acceptNo},#{taskId},0,#{initiator},#{note},#{workGroup},#{name})\n")
public boolean insertFailedCard(@Param("failedCardReasonId")String failedCardReasonId,@Param("acceptNo")String acceptNo,@Param("taskId")String taskId,@Param("initiator")String initiator,@Param("note")String note,@Param("workGroup")String workGroup,@Param("name")String name);
public boolean insertFailedCard(@Param("failedCardReasonId") String failedCardReasonId, @Param("acceptNo") String acceptNo, @Param("taskId") String taskId, @Param("initiator") String initiator, @Param("note") String note, @Param("workGroup") String workGroup, @Param("name") String name);
@Select("SELECT PROD_CARD_T.ACCEPT_NO,GROUP_NO.TASK_ID ,task.work_group\n" +
......@@ -59,7 +62,7 @@ public interface FailedCardMapper {
"LEFT JOIN GROUP_NO ON GROUP_NO=subStr(PROD_CARD_T.ACCEPT_NO,0,8) " +
"left join task on task.TASK_ID = group_no.TASK_ID\n" +
"WHERE PROD_CARD_T.ID_NO=#{cardId} or PROD_CARD_T.ACCEPT_NO=#{cardId}")
public Map<String,Object> selectCountIdByCardId(@Param("cardId") String cardId);
public Map<String, Object> selectCountIdByCardId(@Param("cardId") String cardId);
/*余证*/
@Update("update group_no \n" +
......@@ -67,23 +70,22 @@ public interface FailedCardMapper {
"where group_no.group_no=(select group_no from PROD_CARD_T@PRODYD_LINK \n" +
"left join group_no on group_no.GROUP_NO=subStr(PROD_CARD_T.ACCEPT_NO,0,8)\n" +
"where PROD_CARD_T.accept_no =#{acceptNo}) ")
public boolean specialCardAdd(@Param("acceptNo")String acceptNo);
public boolean specialCardAdd(@Param("acceptNo") String acceptNo);
@Insert("insert into SPECIAL_CARD (ACCEPT_NO,TASK_ID,SPECIAL_TYPE,GROUP_NO,INITIATOR,FILL_IN_DATE)\n" +
"values(\n" +
"#{acceptNo},#{taskId},1," +
"#{groupNo},#{initiator},sysdate)\n")
public boolean addSpecialCard( SpecialCardEntity specialCardEntity);
public boolean addSpecialCard(SpecialCardEntity specialCardEntity);
@Select("select prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,6) as COUNTY_CODE,task.CARD_TYPE\n" +
" ,task.work_group from prod_card_t@PRODYD_LINK\n" +
"left join group_no on subStr(prod_card_t.ACCEPT_NO,0,8)=group_no.group_no "+
"left join task on group_no.task_id = task.task_id "+
"left join group_no on subStr(prod_card_t.ACCEPT_NO,0,8)=group_no.group_no " +
"left join task on group_no.task_id = task.task_id " +
"where prod_card_t.accept_no=#{acceptNo} or prod_card_t.ID_NO=#{acceptNo}")
public Map<String,Object> selectTaskListDate(@Param("acceptNo") String acceptNo);
public Map<String, Object> selectTaskListDate(@Param("acceptNo") String acceptNo);
......@@ -100,32 +102,32 @@ public interface FailedCardMapper {
public List<String> selectGroupNo(@Param("cardIdList") String cardIdList);
@Select("select SPECIAL_CARD.SPECIAL_TYPE,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,6) as COUNTY_CODE ," +
"SPECIAL_CARD.INITIATOR,PREPRO_PERSON.CARD_TYPE_ID\n" +
"from prod_card_t@PRODYD_LINK\n" +
"left join SPECIAL_CARD on prod_card_t.accept_no = SPECIAL_CARD.accept_no\n" +
"left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH=prod_card_t.UPLOAD_NO\n" +
"where prod_card_t.ID_NO=#{acceptNo}")
public Map<String,Object> selectTaskListById(@Param("id") String id);
public Map<String, Object> selectTaskListById(@Param("id") String id);
@Select("select prod_group_t.valid_count,prod_group_t.invalid_count from prod_group_t@PRODYD_LINK \n" +
"where group_no=#{groupNo}")
public Map<String,Object> selectGroupDate(@Param("groupNo") String groupNo);
public Map<String, Object> selectGroupDate(@Param("groupNo") String groupNo);
@Insert("insert into group_no (GROUP_NO,TASK_ID,VALID_COUNT,INVALID_COUNT)values(#{GROUP_NO},#{TASK_ID},#{VALID_COUNT},#{INVALID_COUNT})")
public boolean insertGroupNo(@Param("GROUP_NO")String GROUP_NO,@Param("TASK_ID")String TASK_ID,@Param("VALID_COUNT")long VALID_COUNT,@Param("INVALID_COUNT")long INVALID_COUNT);
public boolean insertGroupNo(@Param("GROUP_NO") String GROUP_NO, @Param("TASK_ID") String TASK_ID, @Param("VALID_COUNT") long VALID_COUNT, @Param("INVALID_COUNT") long INVALID_COUNT);
@Update("update FAILED_CARD set PRINT_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
public boolean updateFailedState1(FailedCardEntity failedCardEntity);
@Update("update FAILED_CARD set POSITION_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
public boolean updateFailedState2(FailedCardEntity failedCardEntity);
@Update("update FAILED_CARD set ALLOT_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
public boolean updateFailedState3(FailedCardEntity failedCardEntity);
@Update("update FAILED_CARD set FINISH_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
// public boolean updateFailedState4(FailedCardEntity failedCardEntity);
// @Update("update FAILED_CARD set FINISH_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
......@@ -146,10 +148,11 @@ public interface FailedCardMapper {
*/
@Select("select SPECIAL_CARD.ACCEPT_NO,SPECIAL_CARD.TASK_ID,task.work_group FROM SPECIAL_CARD left join task on task.TASK_ID = special_card.TASK_ID LEFT JOIN prod_card_t@PRODYD_LINK ON PROD_CARD_T.ACCEPT_NO = SPECIAL_CARD.ACCEPT_NO" +
" WHERE PROD_CARD_T.ID_NO=#{id} or PROD_CARD_T.ACCEPT_NO=#{id}")
public Map<String,Object>selectDataById(String id);
public Map<String, Object> selectDataById(String id);
/**
* 查询提交人提交的废证详情
*
* @param date 提交日期
* @param name 提交人姓名
* @return
......@@ -162,11 +165,12 @@ public interface FailedCardMapper {
"left join PROD_CARD_T@prodyd_link on failed_card.ACCEPT_NO = prod_card_t.ACCEPT_NO\n" +
"left join FAILED_CARD_REASON_DIC on failed_card.FAILED_CARD_REASON_ID = FAILED_CARD_REASON_DIC.FAILED_CARD_REASON_ID " +
"where failed_card.name = #{name} and to_char(submit_date,'yyyyMMdd') between #{startDate} and #{endDate} order by failed_card.ACCEPT_NO")
public List<Map<String,Object>> selectFailedCardInfo(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("name")String name);
public List<Map<String, Object>> selectFailedCardInfo(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("name") String name);
/**
* 删除废证详情
*
* @param failedCardId 废证ID
* @return
*/
......
......@@ -13,25 +13,28 @@ import java.util.List;
public interface FileNameDicMapper {
/**
* 保存个人邮寄信息字典表
*
* @param fileNameDicEntity
* @return
*/
@Insert("INSERT INTO FILE_NAME_DIC (FILE_NAME,UPLOAD_DATE,FORM_START_TIME,FORM_DEADLINE,state) VALUES (#{fileName},#{uploadDate},#{formStartTime},#{formDeadline},#{state})")
@Options(useGeneratedKeys=true, keyProperty="fileId", keyColumn="FILE_ID")
@Options(useGeneratedKeys = true, keyProperty = "fileId", keyColumn = "FILE_ID")
public void saveFileNameDic(FileNameDicEntity fileNameDicEntity);
/**
* 更新个人邮寄字典表的解析状态
* 更新为已解析
*
* @param fileId 文件ID
* @return
*/
@Update("Updata FILE_NAME_DIC.STATE = 1 WHERE FILE_ID = #{fileId}")
public boolean updataState(@Param("fileId")String fileId);
public boolean updataState(@Param("fileId") String fileId);
/**
* 按条件查询个人邮寄字典表
* @param fileName 文件名称
*
* @param fileName 文件名称
* @param analysisState 解析状态
* @return
*/
......@@ -50,11 +53,12 @@ public interface FileNameDicMapper {
" </where>" +
" ) where rn BETWEEN #{minNum} and #{maxNum} " +
"</script>")
public List<FileNameDicEntity> queryFileNameDic(@Param("uploadDate")String uploadDate,@Param("fileName") String fileName, @Param("analysisState") long analysisState, @Param("maxNum") long maxNum, @Param("minNum") long minNum);
public List<FileNameDicEntity> queryFileNameDic(@Param("uploadDate") String uploadDate, @Param("fileName") String fileName, @Param("analysisState") long analysisState, @Param("maxNum") long maxNum, @Param("minNum") long minNum);
/**
* 按条件查询个人邮寄字典表数量
* @param fileName 文件名称
*
* @param fileName 文件名称
* @param analysisState 解析状态
* @return
*/
......@@ -69,8 +73,8 @@ public interface FileNameDicMapper {
"<if test='fileName != null ' >" +
" and FILE_NAME = #{fileName}" +
"</if> </where> </script>")
public List<FileNameDicEntity> queryFileNameDicCount(@Param("uploadDate")String uploadDate,@Param("fileName") String fileName, @Param("analysisState") long analysisState);
public List<FileNameDicEntity> queryFileNameDicCount(@Param("uploadDate") String uploadDate, @Param("fileName") String fileName, @Param("analysisState") long analysisState);
@Delete("DELETE FROM FILE_NAME_DIC WHERE FILE_ID = #{fileId}")
public void deleteFileAndPostData(@Param("fileId")String fileId);
public void deleteFileAndPostData(@Param("fileId") String fileId);
}
......@@ -12,7 +12,7 @@ import java.util.Map;
*/
@Mapper
public interface GreenPackageInformationMapper {
@Select("select * from GAJG_DM where GAJG_MC like #{policeName}")
@Select("select * from GAJG_DM where GAJG_MC like ${policeName}")
public List<Map<String,Object>> selectPolice(@Param("policeName") String policeName);
@Insert("insert into GREEN_PACKAGE_INFORMATION (WAYBILL_NUMBER,POLICE_NAME,RECEIPT_DATE,file_id) VALUES(#{waybillNumber},#{policeName},#{receiptDate},#{fileId})")
......
......@@ -20,21 +20,20 @@ public class CardDetailedListServiceImpl implements CardDetailedListService {
@Override
public List<DetailReceiptListEntity> findCardDetailedListByIdCard(String idCard) {
List<DetailReceiptListEntity> list = cardDetailedListMapper.findCardDetailedListByIdCard(idCard);
List<DetailReceiptListEntity> list = cardDetailedListMapper.findCardDetailedListByIdCard(idCard);
return list;
}
@Override
public List<Map<String,Object>> findAllCardDetailedListByIdCard(String idCard) {
List<Map<String,Object>> list = cardDetailedListMapper.findAllCardDetailedListByIdCard(idCard);
public List<Map<String, Object>> findAllCardDetailedListByIdCard(String idCard) {
List<Map<String, Object>> list = cardDetailedListMapper.findAllCardDetailedListByIdCard(idCard);
return list;
}
@Override
public boolean saveCardDetailedList(String uploadNo, String policeCode, String cardId, String name) {
cardDetailedListMapper.saveCardDetailedList(uploadNo,policeCode,cardId,name);
cardDetailedListMapper.saveCardDetailedList(uploadNo, policeCode, cardId, name);
return true;
}
}
......@@ -24,7 +24,7 @@ public class DataAuditingServiceImpl implements DataAuditingService {
@Override
@Transactional
public boolean saveDataAuditingList(List<DataAuditingEntity> dataAuditingEntityList) {
for (DataAuditingEntity dataAuditingEntity:dataAuditingEntityList){
for (DataAuditingEntity dataAuditingEntity : dataAuditingEntityList) {
dataAuditingMapper.saveDataAuditingEntity(dataAuditingEntity);
}
return true;
......@@ -34,32 +34,33 @@ public class DataAuditingServiceImpl implements DataAuditingService {
public List<Map<String, Object>> selectDataAuditingList(String groupNo) {
return dataAuditingMapper.selectDataAuditingEntity(groupNo);
}
@Override
public List<Map<String, Object>> selectDataAuditingReport(String startDate,String endDate,String policeName,String policeCode) {
if ("".equals(policeName)){
policeName=null;
}else {
policeName="'" + policeName + "%'";
public List<Map<String, Object>> selectDataAuditingReport(String startDate, String endDate, String policeName, String policeCode) {
if ("".equals(policeName)) {
policeName = null;
} else {
policeName = "'" + policeName + "%'";
}
if ("".equals(policeCode)){
policeCode=null;
}else {
policeCode="'" + policeCode + "%'";
if ("".equals(policeCode)) {
policeCode = null;
} else {
policeCode = "'" + policeCode + "%'";
}
List<Map<String, Object>> maps = dataAuditingMapper.selectDataAuditingReport("'" + startDate + "'", "'" + endDate + "'", policeName, policeCode);
Map<String,Object> sumMap = new LinkedHashMap<>();
int validCount =0;
int invalidCount =0;
for (Map<String, Object> map :maps) {
validCount+=Integer.valueOf(map.get("VALID_COUNT").toString());
invalidCount+=Integer.valueOf(map.get("INVALID_COUNT").toString());
Map<String, Object> sumMap = new LinkedHashMap<>();
int validCount = 0;
int invalidCount = 0;
for (Map<String, Object> map : maps) {
validCount += Integer.valueOf(map.get("VALID_COUNT").toString());
invalidCount += Integer.valueOf(map.get("INVALID_COUNT").toString());
}
if (maps.size()>0){
sumMap.put("VALID_COUNT",validCount);
sumMap.put("INVALID_COUNT",invalidCount);
sumMap.put("GAJG_MC","北京制证中心");
sumMap.put("POLICE_SUBSTATION","合计");
sumMap.put("FAILURE_RATE",1-validCount/(validCount+invalidCount));
if (maps.size() > 0) {
sumMap.put("VALID_COUNT", validCount);
sumMap.put("INVALID_COUNT", invalidCount);
sumMap.put("GAJG_MC", "北京制证中心");
sumMap.put("POLICE_SUBSTATION", "合计");
sumMap.put("FAILURE_RATE", 1 - validCount / (validCount + invalidCount));
maps.add(sumMap);
}
return maps;
......
......@@ -36,7 +36,7 @@ public class DeliveredServiceImpl implements DeliveredService {
@Override
public boolean saveDeliveredInfoList(List<DeliveredInfoEntity> deliveredInfoEntityList) {
for (DeliveredInfoEntity deliveredInfoEntity: deliveredInfoEntityList) {
for (DeliveredInfoEntity deliveredInfoEntity : deliveredInfoEntityList) {
deliveredInfoMapper.saveDeliveredInfo(deliveredInfoEntity);
}
return true;
......@@ -44,7 +44,7 @@ public class DeliveredServiceImpl implements DeliveredService {
@Override
public boolean saveDeliveredFailedInfoList(List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities) {
for (DeliveredFailedInfoEntity deliveredFailedInfoEntity :deliveredFailedInfoEntities){
for (DeliveredFailedInfoEntity deliveredFailedInfoEntity : deliveredFailedInfoEntities) {
deliveredFailedInfoMapper.saveDeliveredFailedInfo(deliveredFailedInfoEntity);
}
return false;
......
......@@ -14,34 +14,35 @@ import java.util.Map;
* 2019/3/9 14:55
*/
@Service
public class DetailReceiptListServiceImpl implements DetailReceiptListService {
public class DetailReceiptListServiceImpl implements DetailReceiptListService {
@Autowired
private DetailReceiptListMapper detailReceiptListMapper;
@Override
public List<Map<String, Object>> selectPostDetails(List<Integer> stringList,String name,String isHistory) {
String str ="";
for (int i =0;i<stringList.size();i++){
if (i==stringList.size()-1){
str+=stringList.get(i);
}else {
str+=stringList.get(i)+",";
public List<Map<String, Object>> selectPostDetails(List<Integer> stringList, String name, String isHistory) {
String str = "";
for (int i = 0; i < stringList.size(); i++) {
if (i == stringList.size() - 1) {
str += stringList.get(i);
} else {
str += stringList.get(i) + ",";
}
}
// str+=")";
if ("0".equals(isHistory)){
detailReceiptListMapper.updateReceiptListEntityByCardId(str,name);
if ("0".equals(isHistory)) {
detailReceiptListMapper.updateReceiptListEntityByCardId(str, name);
}
return detailReceiptListMapper.selectPostDetails(str);
}
@Override
public List<DetailReceiptListEntity> selectDetailReceiptListEntityByCardId(String cardID) {
return detailReceiptListMapper.selectDetailReceiptListEntityByCardId(cardID);
}
@Override
public boolean updateDetailReceiptList(DetailReceiptListEntity detailReceiptListEntity,long reciptId) {
return detailReceiptListMapper.updateDetailReceiptList(detailReceiptListEntity.getId(),reciptId);
public boolean updateDetailReceiptList(DetailReceiptListEntity detailReceiptListEntity, long reciptId) {
return detailReceiptListMapper.updateDetailReceiptList(detailReceiptListEntity.getId(), reciptId);
}
}
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