/** * 对账文件分页查询 * * @return */ public PageResult query(Map map) throws DomainException { logger.info("Enter BatchAcctCheckImpl.process(Map map)!"); String settleDt1 = (String) map.get("date1"); String settleDt2 = (String) map.get("date2"); String mchntCd = (String) map.get("mchntCd"); PageResult pageResult = new PageResult(); int currentPage = Integer.parseInt(map.get("currentPage").toString()); StringBuffer hqlbuf = new StringBuffer(); // 组装查询语句 Map<String, Object> paramsMap = new HashMap<String, Object>(); hqlbuf.append("from TblBkeBatFile po where po.mchntCd=:mchntCd"); paramsMap.put("mchntCd", mchntCd); hqlbuf.append(" and po.fileTp in (:TP31,:TP32,:TP33,:TP34)"); paramsMap.put("TP31", Constants.BAT_FILE_TP_31); paramsMap.put("TP32", Constants.BAT_FILE_TP_32); paramsMap.put("TP33", Constants.BAT_FILE_TP_33); paramsMap.put("TP34", Constants.BAT_FILE_TP_34); logger.info("mchntCd:" + mchntCd); logger.info("settleDt1:" + settleDt1); logger.info("settleDt2:" + settleDt2); if (!StringUtil.isEmpty(settleDt1)) { hqlbuf.append(" and po.settleDt >=:settleDt1"); paramsMap.put("settleDt1", settleDt1.replaceAll("-", "")); } if (!StringUtil.isEmpty(settleDt2)) { hqlbuf.append(" and po.settleDt <=:settleDt2"); paramsMap.put("settleDt2", settleDt2.replaceAll("-", "")); } logger.info("hqlbuf:" + hqlbuf.toString()); pageResult = tblBkeBatFileDAO.findByPageHQLQueryAll(hqlbuf.toString(), currentPage, paramsMap); List<Map> list = pageResult.getResultList(); for (Map m : list) { String settleDt = (String) m.get("settleDt"); // 上传日期 String transSumAt = (String) m.get("transSumAt"); // 总金额 m.put("settleDt", CommonFunction.formatTimeString(settleDt)); m.put("transSumAt", CommonFunction.getStdFormatAmt(transSumAt)); } logger.info("Exit BatchAcctCheckImpl.process(Map map)!"); return pageResult; }
@Override public boolean busCheck(Map map) { // TODO Auto-generated method stub String settleDt1 = (String) map.get("date1"); if (!StringUtil.isEmpty(settleDt1)) { CommonFunction CommonFunction = new CommonFunction(); if (!CommonFunction.checkDt("yyyy-MM-dd", settleDt1)) { logger.error("Error in BatchAcctCheckImpl.process(Map map)!"); return false; // throw new AppException("输入的清算开始日期 不合法!"); } if (settleDt1.compareTo(CommonFunction.getCurrDate("yyyy-MM-dd")) > 0) { logger.error("Error in BatchAcctCheckImpl.process(Map map)!"); // throw new AppException("输入的清算开始日期不能大于当前日期!"); return false; } } String settleDt2 = (String) map.get("date2"); if (!StringUtil.isEmpty(settleDt2)) { if (!CommonFunction.checkDt("yyyy-MM-dd", settleDt2)) { logger.error("Error in BatchAcctCheckImpl.process(Map map)!"); return false; // throw new AppException("输入的清算结束日期 不合法!"); } if (settleDt2.compareTo(CommonFunction.getCurrDate("yyyy-MM-dd")) > 0) { logger.error("Error in BatchAcctCheckImpl.process(Map map)!"); // throw new AppException("输入的清算结束日期不能大于当前日期!"); return false; } } if (settleDt2.compareTo(settleDt1) < 0) { logger.error("Error in BatchAcctCheckImpl.process(Map map)!"); // throw new AppException("输入的清算结束日期不能小于清算开始日期!"); return false; } return true; }