public String relatedRightForward() {
   this.logger.debug("enter relatedRight");
   Map<String, Object> map =
       EcsideUtil.getQurey(this.request, "", new Boolean(false).booleanValue());
   QueryConditions qc = getQueryConditions(map);
   String userId = this.request.getParameter("userId");
   User user = this.userService.loadUserById(userId, false, true, false);
   String logonIdString = AclCtrl.getLogonID(this.request);
   User logonUser = this.userService.loadUserById(logonIdString, false, true, false);
   boolean flag = false;
   for (Role role : logonUser.getRoleSet()) {
     if (role.getType().equals(ActionConstant.DEF_SUPERADMIN)) {
       flag = true;
     }
   }
   if (!flag) {
     this.request.setAttribute("roleList", logonUser.getOperateRoleSet());
   } else {
     qc.addCondition(
         "primary.memberNo",
         "=",
         this.request.getSession().getAttribute(ActionConstant.REGISTERID));
     List<Role> roleList = this.roleService.getList(qc, null);
     this.request.setAttribute("roleList", roleList);
   }
   this.request.setAttribute("user", user);
   this.request.setAttribute(
       "ISSUPTERADMIN", this.request.getSession().getAttribute("ISSUPERADMIN"));
   return getReturnValue();
 }
 public ModelAndView fastVoucher(
     HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
     throws Exception {
   this.logger.debug("entering 'fastVoucher' method...");
   VoucherService localVoucherService = (VoucherService) SysData.getBean("f_voucherService");
   ModelAndView localModelAndView = null;
   try {
     String str1 = null;
     String str2 = paramHttpServletRequest.getParameter("summaryNo");
     String str3 = paramHttpServletRequest.getParameter("summary");
     String str4 = paramHttpServletRequest.getParameter("debitCode");
     String str5 = paramHttpServletRequest.getParameter("creditCode");
     String str6 = paramHttpServletRequest.getParameter("contractNo");
     String str7 = paramHttpServletRequest.getParameter("money");
     String str8 = AclCtrl.getLogonID(paramHttpServletRequest);
     int i = localVoucherService.createVoucherFast(str2, str3, str4, str5, str6, str8, str7);
     if (i > 0) {
       str1 = "快捷创建凭证成功!";
     } else {
       str1 = "快捷创建凭证失败!";
     }
     localModelAndView = new ModelAndView("finance/public/doneFast", "resultMsg", str1);
     localModelAndView.addObject("result", new Integer(i));
   } catch (Exception localException) {
     localException.printStackTrace();
   }
   return localModelAndView;
 }
 public ModelAndView setVoucherBDate(
     HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
     throws Exception {
   this.logger.debug("entering 'setVoucherBDate' method...");
   VoucherService localVoucherService = (VoucherService) SysData.getBean("f_voucherService");
   String str1 = paramHttpServletRequest.getParameter("minDate");
   String str2 = paramHttpServletRequest.getParameter("b_date");
   String str3 = paramHttpServletRequest.getParameter("maxDate");
   String str4 = paramHttpServletRequest.getParameter("sign");
   String str5 = null;
   String str6 = null;
   String str7 = AclCtrl.getLogonID(paramHttpServletRequest);
   this.logger.debug("sign:" + str4);
   this.logger.debug("b_date:" + str2);
   if ("true".equals(str4)) {
     str5 = str3;
     this.logger.debug("endDate:" + str5);
   } else {
     str5 = str2;
   }
   int i = localVoucherService.setVoucherBDate(str1, str5, str7);
   if (i >= 0) {
     str6 = "设置结算日期成功!";
   } else {
     str6 = "设置结算日期失败";
   }
   ModelAndView localModelAndView =
       new ModelAndView("finance/public/doneIntoVoucher", "resultMsg", str6);
   localModelAndView.addObject("result", new Integer(i));
   localModelAndView.addObject("result1", new Integer(i));
   return localModelAndView;
 }
 public ModelAndView auditVoucher(
     HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
     throws Exception {
   this.logger.debug("entering 'auditVoucher' method...");
   Long localLong =
       org.springframework.web.bind.ServletRequestUtils.getLongParameter(
           paramHttpServletRequest, "voucherNo");
   Boolean localBoolean =
       org.springframework.web.bind.ServletRequestUtils.getBooleanParameter(
           paramHttpServletRequest, "isPass");
   VoucherService localVoucherService = (VoucherService) SysData.getBean("f_voucherService");
   Voucher localVoucher = localVoucherService.getVoucherByNo(localLong);
   localVoucher.setAuditor(AclCtrl.getLogonID(paramHttpServletRequest));
   localVoucherService.updateVoucherNotEntrys(localVoucher);
   int i = localVoucherService.auditVoucher(localLong, localBoolean.booleanValue());
   String str = "";
   if (i == -1) {
     str = "凭证审核失败!请确认摘要与科目是否正确。";
   } else if (i == -2) {
     str = "凭证审核失败!造成201余额为负值。";
   } else {
     str = "凭证审核成功!";
   }
   return new ModelAndView("finance/public/done", "resultMsg", str);
 }
Example #5
0
  public String delete() {
    this.logger.debug("enter delete");
    String[] ids = this.request.getParameterValues("ids");
    int resultValue = 1;
    if ((ids != null) && (ids.length > 0)) {
      for (String id : ids) {
        String[] primarys = id.split(",");
        HoldQty holdQuantily = (HoldQty) this.obj;
        holdQuantily.setFirmId(primarys[0]);
        holdQuantily.setCommodityId(primarys[1]);
        Clone clone = getService().get(holdQuantily);

        OperateLog operateLog = new OperateLog();
        operateLog.setObj(clone);
        operateLog.setMark(
            (String) this.request.getSession().getAttribute(ActionConstant.REGISTERID));
        this.logger.debug("enter delete operateLog:" + this.obj);
        operateLog.setOperator(AclCtrl.getLogonID(this.request));
        ThreadStore.put(ThreadStoreConstant.OPERATELOGFORLOG, operateLog);
        resultValue = getService().delete(holdQuantily);
      }
    } else {
      resultValue = -2;
    }
    addResultSessionMsg(this.request, resultValue);
    return getReturnValue();
  }
 public String relatedRight() {
   this.logger.debug("enter relatedRight");
   String userId = this.request.getParameter("userId");
   Map<String, Object> map =
       EcsideUtil.getQurey(this.request, "", new Boolean(false).booleanValue());
   QueryConditions qc = getQueryConditions(map);
   String[] cksString = this.request.getParameterValues("ck");
   String[] operateCks = this.request.getParameterValues("operateCk");
   qc.addCondition(
       "primary.memberNo", "=", this.request.getSession().getAttribute(ActionConstant.REGISTERID));
   List<List<String>> inStrings =
       this.userService.getRelatedIds(
           userId, AclCtrl.getLogonID(this.request), cksString, qc, operateCks);
   int value =
       this.userService.relatedRight(
           userId,
           AclCtrl.getLogonID(this.request),
           inStrings,
           (String) this.request.getSession().getAttribute(ActionConstant.REGISTERID));
   addResultMsg(this.request, value);
   return getReturnValue();
 }
 public ModelAndView voucherDelete(
     HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
     throws Exception {
   this.logger.debug("entering 'deleteVoucher' method...");
   long[] arrayOfLong =
       org.springframework.web.bind.ServletRequestUtils.getLongParameters(
           paramHttpServletRequest, "delCheck");
   String str = AclCtrl.getLogonID(paramHttpServletRequest);
   VoucherService localVoucherService = (VoucherService) SysData.getBean("f_voucherService");
   for (int i = 0; i < arrayOfLong.length; i++) {
     localVoucherService.deleteVoucher(new Long(arrayOfLong[i]), str);
   }
   return new ModelAndView("finance/public/done", "resultMsg", "删除凭证成功!");
 }
 public ModelAndView voucherAdd(
     HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
     throws Exception {
   this.logger.debug("entering 'voucherAdd' method...");
   Voucher localVoucher = new Voucher();
   localVoucher.setInputTime(new Date());
   localVoucher.setInputUser(AclCtrl.getLogonID(paramHttpServletRequest));
   localVoucher.setStatus("editing");
   fillVoucher(paramHttpServletRequest, localVoucher);
   VoucherService localVoucherService = (VoucherService) SysData.getBean("f_voucherService");
   localVoucherService.createVoucher(localVoucher);
   return new ModelAndView(
       "finance/public/done", "resultMsg", "创建凭证成功!凭证号:" + localVoucher.getVoucherNo());
 }
 public ModelAndView voucherList(
     HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
     throws Exception {
   this.logger.debug("entering 'voucherList' method...");
   String str1 = AclCtrl.getLogonID(paramHttpServletRequest);
   VoucherService localVoucherService = (VoucherService) SysData.getBean("f_voucherService");
   QueryConditions localQueryConditions =
       QueryHelper.getQueryConditionsFromRequest(paramHttpServletRequest);
   PageInfo localPageInfo = QueryHelper.getPageInfoFromRequest(paramHttpServletRequest);
   String str2 = paramHttpServletRequest.getParameter("sign");
   if (str2 != null) {
     if (localQueryConditions == null) {
       localQueryConditions = new QueryConditions();
     }
     if ("edit".equals(str2)) {
       localQueryConditions.addCondition("status", "=", "editing");
     }
     if ("confirm".equals(str2)) {
       localQueryConditions.addCondition("status", "=", "editing");
     }
     if ("audit".equals(str2)) {
       localQueryConditions.addCondition("status", "=", "auditing");
     }
   }
   String str3 = paramHttpServletRequest.getParameter("accountCode");
   String str4 = null;
   if ((str3 != null) && (!"".equals(str3.trim()))) {
     str4 =
         " and VoucherNo in (select VoucherNo from F_VoucherEntry where AccountCode like '"
             + str3
             + "')";
   }
   if (localPageInfo == null) {
     localPageInfo = new PageInfo(1, 15, "voucherNo", false);
   }
   List localList = localVoucherService.getVouchers(localQueryConditions, localPageInfo, str4);
   Map localMap = WebUtils.getParametersStartingWith(paramHttpServletRequest, "_");
   ModelAndView localModelAndView =
       new ModelAndView("finance/voucher/listVoucher", "resultList", localList);
   localModelAndView.addObject("pageInfo", localPageInfo);
   localModelAndView.addObject("oldParams", localMap);
   localModelAndView.addObject("sign", str2);
   localModelAndView.addObject("accountCode", str3);
   localModelAndView.addObject("logonUser", str1);
   return localModelAndView;
 }
Example #10
0
 public ModelAndView summaryDelete(
     HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
     throws Exception {
   this.logger.debug("entering 'summaryDelete' method...");
   String[] arrayOfString = paramHttpServletRequest.getParameterValues("delCheck");
   String str1 = "";
   String str2 = AclCtrl.getLogonID(paramHttpServletRequest);
   VoucherService localVoucherService = (VoucherService) SysData.getBean("f_voucherService");
   for (int i = 0; i < arrayOfString.length; i++) {
     int j = j = localVoucherService.deleteSummary(arrayOfString[i], str2);
     if (j < 1) {
       str1 = str1 + arrayOfString[i] + ",";
     }
   }
   if (!"".equals(str1)) {
     str1 = str1.substring(0, str1.length() - 1) + "有相关联凭证不能删除";
   } else {
     str1 = "删除摘要成功!";
   }
   return new ModelAndView("finance/public/done", "resultMsg", str1);
 }
Example #11
0
 public ModelAndView balanceVoucher(
     HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
     throws Exception {
   this.logger.debug("entering 'balanceVoucher' method...");
   VoucherService localVoucherService = (VoucherService) SysData.getBean("f_voucherService");
   String str1 = null;
   String str2 = AclCtrl.getLogonID(paramHttpServletRequest);
   int i = localVoucherService.balanceVoucher(null, str2);
   if (i == 1) {
     str1 = "结算成功!";
   } else if (i == 0) {
     str1 = "操作异常";
   } else if (i == -1) {
     str1 = "订单结算不成功";
   } else if (i == -2) {
     str1 = "存在小于等于订单当前结算日的流水,未设结算日";
   } else if (i == -3) {
     str1 = "警告:系统已经在结算中,不能多人同时结算";
   }
   ModelAndView localModelAndView = new ModelAndView("finance/public/done", "resultMsg", str1);
   return localModelAndView;
 }