Example #1
0
 private List<ActionResource> findResources() {
   Employee employee = (Employee) getSession().get(LOGIN_USER);
   SystemSetting setting = (SystemSetting) getApplication().get(ConstValue.SYS_SETTING);
   Boolean opened = setting.getCompanyInfo().getOpened();
   List<ActionResource> resources = employeeService.findUserResources(employee.getId(), !opened);
   Collections.sort(resources, new LftRgtTreeNodeComparator()); // 按左值排序。
   return resources;
 }
  @Test
  public void testSave() {
    SystemSetting systemSetting = SystemSetting.getInstance();

    CompanyInfo companyInfo = systemSetting.getCompanyInfo();
    companyInfo.setCompanyName("成都捷利电脑通讯有限公司");
    companyInfo.setRegisteredAddress("单位地址");
    companyInfo.setBusinessAddress("经营地址");
    companyInfo.setCorporationTax("税号:13256456");
    companyInfo.setTelephoneNumber("TEL:12345678921");
    companyInfo.setFaxNumber("FAX:123456798523");
    companyInfo.setLegalRepresentative("法人代表:常胜将军");
    companyInfo.setLocale(Locale.CHINA);
    companyInfo.setOpenningDate(DateUtils.getDayBegin(new Date()));
    SysEditOption syEditOption = systemSetting.getEditOption();
    syEditOption.setPriceScale(6);
    syEditOption.setAmountScale(3);
    syEditOption.setUniteCostMethod(false);
    syEditOption.setDefaultCostMethod(CostMethod.FIFO);
    syEditOption.setCostUnusualWarn(true);
    syEditOption.setUnusualPercent(20);
    syEditOption.setSaveBeforePrint(true);
    syEditOption.setAutoGenerateBillItem(true);
    syEditOption.setBillChangeOrderPrice(true);
    syEditOption.setPurchasePriceUnusualwarn(true);
    syEditOption.setRememberwar_emp(false);
    syEditOption.setChangeBillDate(true);
    syEditOption.setBillDateMustToday(false);
    syEditOption.setDepartmentBeNull(true);
    syEditOption.setEmployeeBeNull(false);
    syEditOption.setChangeEmployee(true);
    syEditOption.setInventoryWarn(true);
    syEditOption.setPriceBelowCostWarn(true);
    syEditOption.setPriceBelowBidWarn(true);
    syEditOption.setPriceBelowAlowWarn(true);
    syEditOption.setAutoSaveNestPrice(true);
    syEditOption.setDefaultACC_AMT(false);
    syEditOption.setDispRealStock(true);
    syEditOption.setDispARAP(true);
    syEditOption.setAutoGenSummary(true);
    syEditOption.setPerformWhenARExceed(false);
    syEditOption.setAlowNegativeStock(true);
    syEditOption.setMonthCloseDay(27);
    syEditOption.setAutoMonthClose(true);
    systemSettingService.save(systemSetting);
  }