private void supplementWbDeptMap(String wbSource) { logger.info("==补足 总账系统科室 与 科室类型 对照关系(" + wbDeptMapNeedAddMap.size() + "条)=="); // 取总账科室表 IBaseDAO deptDao = new DefaultBaseDAO(DepartmentObj.class); List<DepartmentObj> deptList = deptDao.searchByClause(DepartmentObj.class, null, null, 0, Integer.MAX_VALUE); Map<String, String> deptMap = new HashMap<String, String>(); for (int i = 0; i < deptList.size(); i++) { deptMap.put(deptList.get(i).getDepartment_name(), deptList.get(i).getDepartment_code()); } Object[] wbDeptMapNeedAdd = wbDeptMapNeedAddMap.values().toArray(); List<SourceDeptMapObj> sourceDeptMapList = new ArrayList<SourceDeptMapObj>(); for (int i = 0; i < wbDeptMapNeedAdd.length; i++) { GlAccvouchObj glav = (GlAccvouchObj) wbDeptMapNeedAdd[i]; SourceDeptMapObj o = new SourceDeptMapObj(); o.setSource_system(wbSource); o.setSource_dept_name(glav.getWbDeptName()); o.setDest_dept_code(deptMap.get(glav.getWbDeptName())); // 如果总账系统中有名字直接匹配的科室则直接填充对应的部门编号 if (getZzDeptId(wbSource, glav.getWbDeptName()) == null) { sourceDeptMapList.add(o); } // // if (o.getDest_dept_code() != null) // { // wbDeptMapNeedAddMap.remove(glav.getWbDeptName());// 自动补充了就删除 // } } sourceDeptMapDao.save(sourceDeptMapList); }
// 生成总账凭证 public void import2zz(HttpServletRequest request, HttpServletResponse response) throws Exception { List<GlAccvouchObj> glAccvouchList = getDomainDao().searchByClause(GlAccvouchObj.class, null, null, 0, Integer.MAX_VALUE); logger.info("查询得到临时凭证:" + glAccvouchList.size() + "条"); // 入总账数据库 UF_glAccvouchDao.save(glAccvouchList); logger.info("凭证导入总账系统:" + glAccvouchList.size() + "条"); // 入总账现金流量数据表 List<GlCashtableObj> glCashList = getGlCashList(glAccvouchList); UF_glCashtableDao.save(glCashList); logger.info("现金流量导入总账系统:" + glCashList.size() + "条"); // 转到总账凭证查询 zzlist(request, response); }
private void initZzDeptTypeMap() { logger.info("==初始化 总账系统科室 与 科室类型 对照关系=="); zzDeptTypeMap = new HashMap<String, String>(); List list = departmentDao.searchByClause(DepartmentObj.class, null, null, 0, Integer.MAX_VALUE); for (int i = 0; i < list.size(); i++) { DepartmentObj o = (DepartmentObj) list.get(i); zzDeptTypeMap.put( o.getDepartment_code(), StringUtil.getNotEmptyStr(o.getDepartment_type_code())); } }
private void initZzAccSubReverseMap() { logger.info("==初始化 总账系统会计科目借贷平账 对照关系=="); zzAccSubReverseMap = new HashMap<String, String>(); List list = accSubDao.searchByClause(AccountingSubjectObj.class, null, null, 0, Integer.MAX_VALUE); for (int i = 0; i < list.size(); i++) { AccountingSubjectObj o = (AccountingSubjectObj) list.get(i); zzAccSubReverseMap.put(o.getAcc_code(), StringUtil.getNotEmptyStr(o.getOpposite_acc_code())); } }
// 总账凭证列表 public void zzlist(HttpServletRequest request, HttpServletResponse response) throws Exception { // 查询 domainSearchCondition.setPageCount(SystemConstant.PAGE_ROWS); // 恢复每页20行记录 IBaseDAO zzDao = new DefaultBaseDAO(domainInstance, U8_DB); PaginationObj domainPagination = zzDao.searchPaginationByDomainInstance( domainInstance, "iperiod,ino_id,inid", domainSearchCondition.getPageNo(), domainSearchCondition.getPageCount()); request.setAttribute(DOMAIN_INSTANCE, domainInstance); request.setAttribute(DOMAIN_PAGINATION, domainPagination); // 转向 request .getRequestDispatcher("/" + getBasePath() + "/zz" + BASE_METHOD_LIST + ".jsp") .forward(request, response); }
private void initWbDeptMap(String wbSource) { logger.info("==初始化 外部系统科室 与 总账系统科室 对照关系=="); wbDeptMap = new HashMap<String, String>(); List list = sourceDeptMapDao.searchByClause( SourceDeptMapObj.class, "source_system='" + wbSource + "'", null, 0, Integer.MAX_VALUE); for (int i = 0; i < list.size(); i++) { SourceDeptMapObj o = (SourceDeptMapObj) list.get(i); wbDeptMap.put(o.getSource_dept_name(), StringUtil.getNotEmptyStr(o.getDest_dept_code())); } }
private void initZzDeptTypeAccSubMap(String wbSource) { logger.info("==初始化 总账系统科室类型+外部系统科目 与 总账系统会计科目 对照关系=="); zzDeptTypeAccSubMap = new HashMap<String, String>(); List list = sourceDeptAccMapDao.searchByClause( SourceDeptAccMapObj.class, "source_system='" + wbSource + "'", null, 0, Integer.MAX_VALUE); for (int i = 0; i < list.size(); i++) { SourceDeptAccMapObj o = (SourceDeptAccMapObj) list.get(i); zzDeptTypeAccSubMap.put( o.getDept_share_type() + "-" + o.getSource_acc_subject(), StringUtil.getNotEmptyStr(o.getDest_acc_subject())); } }