// 删除AA202表中记录,条件是:id=选择的id 除AA203表中记录,条件是:变更清册id=选择的id
  public ActionForward remove(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    ActionMessages messages = null;
    try {
      IdAF idaf = (IdAF) form;
      SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
      String ip = securityInfo.getUserInfo().getUserIp();
      String name = securityInfo.getUserInfo().getUsername();
      String id = idaf.getId().toString();
      IChgslarybaseBS chgslarybaseBS =
          (IChgslarybaseBS)
              BSUtils.getBusinessService("chgslarybaseBS", this, mapping.getModuleConfig());
      chgslarybaseBS.deleteAllChgPaymentTailMaintain(new Integer(id), ip, name, securityInfo);
      messages = new ActionMessages();
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("删除成功!", false));
      saveErrors(request, messages);
    } catch (BusinessException e) {
      messages = new ActionMessages();
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(e.getMessage(), false));
      saveErrors(request, messages);
      return mapping.findForward("chgslarybaseTbShowAC.do");
    }

    return mapping.findForward("chgslarybaseTbShowAC.do");
  }
예제 #2
0
 /**
  * 修改划款帐号
  *
  * @param contractId 合同编号
  * @param newLoanKouAcc 新扣款帐号
  * @param oldBankAcc 旧扣款帐号
  * @param securityInfo 权限
  * @throws Exception
  * @author wsh
  */
 public void modifyGiveAccInfo(
     String contractId,
     String oldSellerPayBank,
     String oldPayBankAcc,
     String newSellerPayBank,
     String newPayBankAcc,
     String houseType,
     SecurityInfo securityInfo)
     throws Exception, BusinessException {
   // TODO Auto-generated method stub
   try {
     Houses house = housesDAO.queryById(contractId);
     if ("01".equals(houseType)) {
       house.setDeveloperPaybank(newSellerPayBank);
       house.setDeveloperPaybankAAcc(newPayBankAcc);
     } else {
       house.setBargainorPaybank(newSellerPayBank);
       house.setBargainorPaybankAcc(newPayBankAcc);
     }
     GiveAcc giveAcc = new GiveAcc();
     giveAcc.setContractId(contractId);
     giveAcc.setModifyDate(securityInfo.getUserInfo().getPlbizDate());
     giveAcc.setNewPokeBank(newSellerPayBank);
     giveAcc.setNewPokeBankAcc(newPayBankAcc);
     giveAcc.setOldPokeBank(oldSellerPayBank);
     giveAcc.setOldPokeBankAcc(oldPayBankAcc);
     giveAcc.setOprator(securityInfo.getUserName());
     giveAcc.setOpTime(new Date());
     giveAccDAO.insert(giveAcc);
     PlOperateLog plOperateLog = new PlOperateLog();
     // 插入日志PL021
     plOperateLog.setContractId(contractId);
     plOperateLog.setOpSys(new BigDecimal(BusiLogConst.OP_SYSTEM_TYPE_LOAN + ""));
     plOperateLog.setOpModel(String.valueOf(BusiLogConst.PL_OP_LOANAPPL_GATHERINGACC_DO));
     plOperateLog.setOpButton(String.valueOf(BusiLogConst.BIZLOG_ACTION_ADD));
     plOperateLog.setOpBizId(new BigDecimal(giveAcc.getPokeBankModifyId().toString()));
     plOperateLog.setOpIp(securityInfo.getUserIp());
     plOperateLog.setOpTime(new Date());
     plOperateLog.setOperator(securityInfo.getUserName());
     plOperateLogDAO.insert(plOperateLog);
   } catch (Exception e) {
     // TODO: handle exception
     e.printStackTrace();
   }
 }
 public ActionForward deleteCredencechar(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response) {
   try {
     IdAF idaf = (IdAF) form;
     String paraId = idaf.getId().toString();
     ICredencecharBS credencecharBS =
         (ICredencecharBS)
             BSUtils.getBusinessService("credencecharBS", this, mapping.getModuleConfig());
     // 权限
     SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
     // bookId
     String bookId = securityInfo.getBookId();
     // 根据ID 判断是否有记录
     boolean temp_credencechar = credencecharBS.isCredencecharById(paraId);
     if (temp_credencechar) { // 有记录
       // 判断该记录的FN102.para_id在FN201.CREDENCE_CHARACTER or FN210.CREDENCE_CHARACTER中是否存在
       boolean temp_Existence = credencecharBS.isCredencecharByParamValue(paraId, bookId);
       if (temp_Existence) { // 不存在
         // 删除 paramId 记录
         credencecharBS.deleteCredencecharInfo(paraId, securityInfo);
       } else { // 存在
         ActionMessages messages = new ActionMessages();
         messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("该条记录已被应用,不允许删除!", false));
         saveErrors(request, messages);
       }
     } else {
       // 没有记录
       ActionMessages messages = new ActionMessages();
       messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("该记录已删除!", false));
       saveErrors(request, messages);
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   return mapping.findForward("credencecharShowAC");
 }
  public ActionForward deluse(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    saveToken(request);
    ActionMessages messages = null;
    try {
      Pagination pagination = (Pagination) request.getSession().getAttribute(PAGINATION_KEY);
      IdAF idaf = (IdAF) form;
      String id = idaf.getId().toString();

      SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
      String ip = securityInfo.getUserInfo().getUserIp();
      String name = securityInfo.getUserInfo().getUsername();
      pagination.getQueryCriterions().put("id", id);

      pagination.getQueryCriterions().put("ip", ip);
      pagination.getQueryCriterions().put("name", name);

      IChgslarybaseBS chgslarybaseBS =
          (IChgslarybaseBS)
              BSUtils.getBusinessService("chgslarybaseBS", this, mapping.getModuleConfig());

      if (chgslarybaseBS.deluseChgPaymentSalaryBaseMaintain(pagination)) {
        messages = new ActionMessages();
        messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("撤消启用成功!", false));
        saveErrors(request, messages);
      }
    } catch (BusinessException e) {
      messages = new ActionMessages();
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(e.getMessage(), false));
      saveErrors(request, messages);
      return mapping.findForward("chgslarybaseTbShowAC.do");
    }

    return mapping.findForward("chgslarybaseTbShowAC.do");
  }
예제 #5
0
  /**
   * Method execute
   *
   * @param mapping
   * @param form
   * @param request
   * @param response
   * @return ActionForward
   */
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

    ParticularglTaAF particularglTaAF =
        (ParticularglTaAF) request.getSession().getAttribute("toprinttcparticularglTaAF");

    SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
    String opertname = securityInfo.getRealName();
    ILoanDocNumDesignBS loanDocNumDesignBS =
        (ILoanDocNumDesignBS)
            BSUtils.getBusinessService(
                "sysloanloanDocNumDesignBS", this, mapping.getModuleConfig());
    String userName = "";
    try {
      String name = loanDocNumDesignBS.getNamePara();

      if (name.equals("1")) {
        userName = securityInfo.getUserName();
      } else {
        userName = securityInfo.getRealName();
      }

    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String time = securityInfo.getUserInfo().getPlbizDate();
    request.setAttribute("opertname", userName);
    request.setAttribute("time", time);
    request.setAttribute("particularglTaAF", particularglTaAF);
    request.getSession().setAttribute("toprinttcparticularglTaAF", null);

    return mapping.findForward("particulargl_tc_print");
  }
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    ActionMessages messages = null;
    SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
    try {

      OrgAccountInfoAF af = new OrgAccountInfoAF();
      String id = (String) request.getAttribute("id");
      String mode = request.getParameter("mode");
      String opTime = (String) request.getAttribute("opTime");
      Pagination pagination = getPagination(OrgAccountInfoTcShowAC.PAGINATION_KEY, request);
      Pagination pagination1 =
          (Pagination) request.getSession().getAttribute(OrgAccountInfoTaShowAC.PAGINATION_KEY);
      pagination.getQueryCriterions().put("opDate", pagination1.getQueryCriterions().get("opDate"));
      pagination
          .getQueryCriterions()
          .put("inOpDate", pagination1.getQueryCriterions().get("inOpDate"));
      if (id != null) {
        pagination.getQueryCriterions().put("id", id);
      }
      if (opTime != null) {
        pagination.getQueryCriterions().put("opTime", opTime);
      }
      mode = (String) pagination1.getQueryCriterions().get("mode");
      pagination.getQueryCriterions().put("mode", pagination1.getQueryCriterions().get("mode"));
      PaginationUtils.updatePagination(pagination, request);
      IOrgAccountInfoBS orgAccountInfoBS =
          (IOrgAccountInfoBS)
              BSUtils.getBusinessService("orgAccountInfoBS", this, mapping.getModuleConfig());
      List officelist = securityInfo.getOfficeList();
      List officelist1 = new ArrayList();
      OfficeDto dto = null;
      Iterator itr = officelist.iterator();
      while (itr.hasNext()) {
        dto = (OfficeDto) itr.next();
        officelist1.add(
            new org.apache.struts.util.LabelValueBean(
                dto.getOfficeName().toString(), dto.getOfficeCode().toString()));
      }
      List bankList = securityInfo.getCollBankList();
      List bankList1 = new ArrayList();
      Userslogincollbank bankdto = null;
      Iterator itr1 = bankList.iterator();
      while (itr1.hasNext()) {
        bankdto = (Userslogincollbank) itr1.next();
        bankList1.add(
            new org.apache.struts.util.LabelValueBean(
                bankdto.getCollBankName().toString(), bankdto.getCollBankId().toString()));
      }
      request.getSession(true).setAttribute("bankList1", bankList1);
      request.getSession(true).setAttribute("officelist1", officelist1);
      List list = orgAccountInfoBS.findOrgAccountInfoByDay(pagination, securityInfo);
      OrgAccountInfoTotalDTO totaldto =
          orgAccountInfoBS.findOrgAccountInfoDayTotal(pagination, securityInfo);
      request.setAttribute("orgAccountInfoTotalDTO", totaldto);
      af.setMode(pagination1.getQueryCriterions().get("mode") + "");
      request.setAttribute("orgAccountInfoAF", af);
      request.setAttribute("LIST", list);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return mapping.findForward(getForword());
  }
예제 #7
0
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    // TODO Auto-generated method stub
    try {
      OrgkhAF af = (OrgkhAF) form;
      //      String orgId=(String)request.getParameter("orgId");
      //      String isModify="";
      String orgId = (String) request.getSession().getAttribute("orgId");
      SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
      String officecodeID = request.getParameter("officecode");
      //      isModify=bizcheckBS.queruIsBankModify(orgId);
      IOrgOpenAccountBS orgOpenAccountBS =
          (IOrgOpenAccountBS)
              BSUtils.getBusinessService("orgOpenAccountBS", this, mapping.getModuleConfig());
      Org org = orgOpenAccountBS.findOPA(new Integer(orgId));
      af.setOrg(org);
      if (request.getParameter("officecode") != null) {
        af.getOrg().getOrgInfo().setOfficecode(officecodeID);
      }
      //    取出用户权限办事处,显示在下拉菜单中
      List officeList = securityInfo.getOfficeList();
      List officeList1 = new ArrayList();
      OfficeDto officedto = null;
      Iterator itr1 = officeList.iterator();
      while (itr1.hasNext()) {
        officedto = (OfficeDto) itr1.next();
        officeList1.add(
            new org.apache.struts.util.LabelValueBean(
                officedto.getOfficeName(), officedto.getOfficeCode()));
      }

      // 得到办事处下的归集银行
      OfficeDto officeDtoTest = null;
      List collBankListTest = null;
      // 从请求参数中得到办事处id
      if (request.getParameter("officecode") != null) {
        collBankListTest = orgOpenAccountBS.queryCollBank(officecodeID);
      } else {
        officeDtoTest = (OfficeDto) officeList.get(0);
        collBankListTest = orgOpenAccountBS.queryCollBank(officeDtoTest.getOfficeCode());
      }

      // 判断该权限下的某个办事处对应的归集银行
      List collBankList = securityInfo.getCollBankList();
      List collBankList1 = new ArrayList();
      Userslogincollbank userslogincollbank = null;
      Iterator itr2 = collBankList.iterator();
      while (itr2.hasNext()) {
        userslogincollbank = (Userslogincollbank) itr2.next();
        for (int i = 0; i < collBankListTest.size(); i++) {
          CollBank collBank = (CollBank) collBankListTest.get(i);
          if (userslogincollbank.getCollBankId().equals(collBank.getCollBankId())) {
            collBankList1.add(
                new org.apache.struts.util.LabelValueBean(
                    userslogincollbank.getCollBankName().toString(),
                    userslogincollbank.getCollBankId().toString()));
          }
        }
      }
      request.getSession(true).setAttribute("officeList1", officeList1);
      request.getSession(true).setAttribute("collBankList1", collBankList1);
      request.setAttribute("orgkhAF", af);
    } catch (Exception e) {
      // TODO: handle exception
      e.printStackTrace();
    }
    return mapping.findForward("to_show_modify");
  }
예제 #8
0
  /**
   * * 插入FN311 OP_SYS=财务系统 OP_MODEL=初始数据 OP_BUTTON=2 OP_IP=操作员ip OP_TIME=系统时间 OPERATOR=操作员 插入FN201:
   * BOOK_ID=所属账套 SUBJECT_CODE=科目代码 SUMMAY=1 DEBIT=累计借方 CREDIT=累计贷方 MAKEBILL=操作员 OFFICE=所选办事处
   *
   * @param datainitializeDTO 张列
   * @param securityInfo
   * @throws Exception
   */
  public void insertSummaryOffice(List list, SecurityInfo securityInfo) throws Exception {
    try {
      if (list.size() != 0) {
        DatainitializeDTO datainitializeDTO1 = (DatainitializeDTO) list.get(0);
        // 插入FN311
        FnOperateLog fnOperateLog = new FnOperateLog();
        fnOperateLog.setOpSys(BusiLogConst.OP_SYSTEM_TYPE_FINANCE + "");
        fnOperateLog.setOpModel(BusiLogConst.FN_OP_BOOKMNG_DATAINITIALIZE + "");
        fnOperateLog.setOpButton("1");
        fnOperateLog.setOpIp(securityInfo.getUserIp());
        fnOperateLog.setOpTime(new Date());
        fnOperateLog.setOperator(securityInfo.getUserName());
        fnOperateLog.setBookId(datainitializeDTO1.getBookId());
        fnOperateLogDAO.insert(fnOperateLog);
        Iterator it = list.iterator();
        while (it.hasNext()) {
          DatainitializeDTO datainitializeDTO = (DatainitializeDTO) it.next();
          //          if(datainitializeDTO.getDebit().equals("0") &&
          // datainitializeDTO.getCredit().equals("0")){
          //            continue;
          //          }else{
          // 插入 FN201
          AccountantCredence accountantCredence = new AccountantCredence();
          accountantCredence.setBookId(datainitializeDTO.getBookId());
          accountantCredence.setSubjectCode(datainitializeDTO.getSubjectCode());
          accountantCredence.setSummay(bookParameterDAO.getSummay(datainitializeDTO.getBookId()));

          accountantCredence.setDebit(new BigDecimal(datainitializeDTO.getDebit()));
          accountantCredence.setCredit(new BigDecimal(datainitializeDTO.getCredit()));

          accountantCredence.setMakebill(securityInfo.getUserName());
          accountantCredence.setOffice(datainitializeDTO.getOfficeName());
          accountantCredence.setCredenceSt("2");
          // 年
          String date1 = bookDAO.getUseYearmonth(datainitializeDTO.getBookId()) + "01";
          DateFormat df = new SimpleDateFormat("yyyyMMdd");
          String year = "";
          try {
            Date d1 = df.parse(date1);
            // System.out.println("d1=="+df.format(d1));
            Calendar g = Calendar.getInstance();
            g.setTime(d1);
            g.add(Calendar.DATE, -1);
            Date d2 = g.getTime();
            // System.out.println("d2======="+df.format(d2));
            year = df.format(d2);
          } catch (ParseException exx) {
            exx.printStackTrace();
          }
          accountantCredence.setCredenceDate(year);
          accountantCredence.setSettDate(year);
          // 如果是(损益类科目)直接把FN201中的(损益结转字段置为2)
          if (subjectDAO
              .getSortcodeByCode_WL(datainitializeDTO.getSubjectCode(), securityInfo)
              .equals("4")) {
            accountantCredence.setIncDecSt("2");
          }
          if (subjectDAO
              .getProperyByCode_WL(datainitializeDTO.getSubjectCode(), securityInfo)
              .equals("0")) {
            // 如果是(银行属性的科目)直接把(银行账结转状态置为2)
            accountantCredence.setBankAccSt("2");
          }
          if (subjectDAO
              .getProperyByCode_WL(datainitializeDTO.getSubjectCode(), securityInfo)
              .equals("1")) {
            // 如果是(现金属性的科目)直接把(现金账结转状态置为2)
            accountantCredence.setCashAccSt("2");
          }
          accountantCredenceDAO.insert(accountantCredence);
          //          }
        }
        Iterator it1 = list.iterator();
        while (it1.hasNext()) {
          DatainitializeDTO datainitializeDTO11 = (DatainitializeDTO) it1.next();
          //          if(datainitializeDTO11.getYesterdayRemainingSum().equals("0") ||
          // datainitializeDTO11.getBalaceDirection().equals("2")){
          //            continue;
          //          }
          AccountantCredence accountantCredence = new AccountantCredence();
          accountantCredence.setBookId(datainitializeDTO11.getBookId());
          accountantCredence.setSubjectCode(datainitializeDTO11.getSubjectCode());
          accountantCredence.setSummay(
              bookParameterDAO.getSummay4(datainitializeDTO11.getBookId()));
          if (datainitializeDTO11.getBalaceDirection().equals("0")) {
            BigDecimal temp =
                new BigDecimal(datainitializeDTO11.getYesterdayRemainingSum())
                    .subtract(new BigDecimal(datainitializeDTO11.getDebit()))
                    .add(new BigDecimal(datainitializeDTO11.getCredit()))
                    .subtract(new BigDecimal(datainitializeDTO11.getYesterdayDebit()))
                    .add(new BigDecimal(datainitializeDTO11.getYesterdayCredit()));
            accountantCredence.setDebit(temp);
            accountantCredence.setCredit(new BigDecimal("0.00"));
          }
          if (datainitializeDTO11.getBalaceDirection().equals("1")) {
            BigDecimal temp =
                new BigDecimal(datainitializeDTO11.getYesterdayRemainingSum())
                    .subtract(new BigDecimal(datainitializeDTO11.getCredit()))
                    .add(new BigDecimal(datainitializeDTO11.getDebit()))
                    .subtract(new BigDecimal(datainitializeDTO11.getYesterdayCredit()))
                    .add(new BigDecimal(datainitializeDTO11.getYesterdayDebit()));
            accountantCredence.setDebit(new BigDecimal("0.00"));
            accountantCredence.setCredit(temp);
          }
          if (datainitializeDTO11.getBalaceDirection().equals("2")) {
            {
              BigDecimal temp_yeaterdayDebit =
                  new BigDecimal(datainitializeDTO11.getYesterdayDebit());
              BigDecimal temp_debit = new BigDecimal(datainitializeDTO11.getDebit());
              BigDecimal temp_yeaterdayCredit =
                  new BigDecimal(datainitializeDTO11.getYesterdayCredit());
              BigDecimal temp_credit = new BigDecimal(datainitializeDTO11.getCredit());
              //            BigDecimal temp =
              // temp_yeaterdayDebit.add(temp_debit).subtract(temp_yeaterdayCredit).subtract(temp_credit);
              BigDecimal temp =
                  temp_yeaterdayCredit
                      .add(temp_credit)
                      .subtract(temp_yeaterdayDebit)
                      .subtract(temp_debit);
              if (temp.compareTo(new BigDecimal(0)) > 0) {
                accountantCredence.setDebit(temp.abs());
                accountantCredence.setCredit(new BigDecimal("0.00"));
              }
              if (temp.compareTo(new BigDecimal(0)) < 0) {
                accountantCredence.setDebit(new BigDecimal("0.00"));
                accountantCredence.setCredit(temp.abs());
              }
              if (temp.compareTo(new BigDecimal(0)) == 0) {
                //                if(temp_yeaterdayDebit.compareTo(new BigDecimal(0))==0 &&
                // temp_debit.compareTo(new BigDecimal(0))==0 && temp_yeaterdayCredit.compareTo(new
                // BigDecimal(0))==0 && temp_credit.compareTo(new BigDecimal(0))==0 ){
                //                  continue;
                //                }else{
                accountantCredence.setDebit(new BigDecimal("0.00"));
                accountantCredence.setCredit(new BigDecimal("0.00"));
                //                }
              }
            }
          }

          accountantCredence.setMakebill(securityInfo.getUserName());
          accountantCredence.setOffice(datainitializeDTO11.getOfficeName());
          accountantCredence.setCredenceSt("2");

          // 年
          String year =
              (Integer.parseInt(
                          bookDAO.getUseYearmonth(datainitializeDTO11.getBookId()).substring(0, 4))
                      - 2)
                  + "1231";
          accountantCredence.setCredenceDate(year);
          accountantCredence.setSettDate(year);

          // 如果是(损益类科目)直接把FN201中的(损益结转字段置为2)
          if (subjectDAO
              .getSortcodeByCode_WL(datainitializeDTO11.getSubjectCode(), securityInfo)
              .equals("4")) {
            accountantCredence.setIncDecSt("2");
          }
          if (subjectDAO
              .getProperyByCode_WL(datainitializeDTO11.getSubjectCode(), securityInfo)
              .equals("0")) {
            // 如果是(银行属性的科目)直接把(银行账结转状态置为2)
            accountantCredence.setBankAccSt("2");
          }
          if (subjectDAO
              .getProperyByCode_WL(datainitializeDTO11.getSubjectCode(), securityInfo)
              .equals("1")) {
            // 如果是(现金属性的科目)直接把(现金账结转状态置为2)
            accountantCredence.setCashAccSt("2");
          }
          accountantCredenceDAO.insert(accountantCredence);
        }
        Iterator it2 = list.iterator();
        while (it2.hasNext()) {
          DatainitializeDTO datainitializeDTO2 = (DatainitializeDTO) it2.next();
          //          if(datainitializeDTO2.getYesterdayDebit().equals("0") &&
          // datainitializeDTO2.getYesterdayCredit().equals("0")){
          //            continue;
          //          }
          AccountantCredence accountantCredence = new AccountantCredence();
          accountantCredence.setBookId(datainitializeDTO2.getBookId());
          accountantCredence.setSubjectCode(datainitializeDTO2.getSubjectCode());
          accountantCredence.setSummay(bookParameterDAO.getSummay5(datainitializeDTO2.getBookId()));

          accountantCredence.setDebit(new BigDecimal(datainitializeDTO2.getYesterdayDebit()));
          accountantCredence.setCredit(new BigDecimal(datainitializeDTO2.getYesterdayCredit()));

          accountantCredence.setMakebill(securityInfo.getUserName());
          accountantCredence.setOffice(datainitializeDTO2.getOfficeName());
          accountantCredence.setCredenceSt("2");

          // 年
          String year =
              (Integer.parseInt(
                          bookDAO.getUseYearmonth(datainitializeDTO2.getBookId()).substring(0, 4))
                      - 1)
                  + "1231";
          accountantCredence.setCredenceDate(year);
          accountantCredence.setSettDate(year);

          // 如果是(损益类科目)直接把FN201中的(损益结转字段置为2)
          if (subjectDAO
              .getSortcodeByCode_WL(datainitializeDTO2.getSubjectCode(), securityInfo)
              .equals("4")) {
            accountantCredence.setIncDecSt("2");
          }
          if (subjectDAO
              .getProperyByCode_WL(datainitializeDTO2.getSubjectCode(), securityInfo)
              .equals("0")) {
            // 如果是(银行属性的科目)直接把(银行账结转状态置为2)
            accountantCredence.setBankAccSt("2");
          }
          if (subjectDAO
              .getProperyByCode_WL(datainitializeDTO2.getSubjectCode(), securityInfo)
              .equals("1")) {
            // 如果是(现金属性的科目)直接把(现金账结转状态置为2)
            accountantCredence.setCashAccSt("2");
          }
          accountantCredenceDAO.insert(accountantCredence);
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    // TODO Auto-generated method stub
    ActionMessages messages = null;
    String paramValue = "";
    String contractId = null;
    String comeFromType = null;
    String afterSure = null;
    EndorsecontractTaAF endorsecontractTaAF = new EndorsecontractTaAF();
    SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
    String insert = (String) request.getSession().getAttribute("insert");
    IEndorsecontractBS endorsecontractBS =
        (IEndorsecontractBS)
            BSUtils.getBusinessService("endorsecontractBS", this, mapping.getModuleConfig());
    Pagination pagination = getPagination(PAGINATION_KEY, request);
    List loanBankNameList = new ArrayList(); // 银行
    List bankList = securityInfo.getDkUserBankList();
    Userslogincollbank userslogincollbank = null;
    Iterator bank = bankList.iterator();
    while (bank.hasNext()) {
      userslogincollbank = (Userslogincollbank) bank.next();
      loanBankNameList.add(
          new org.apache.struts.util.LabelValueBean(
              userslogincollbank.getCollBankName(), userslogincollbank.getCollBankId().toString()));
    }
    try {
      comeFromType = (String) request.getAttribute("comeFromType"); // 用来判断是否为维护传来的状态
      afterSure = (String) request.getAttribute("afterSure");
      paramValue = endorsecontractBS.queryParamValue(securityInfo); // 参数值('AB'
      String temp_an = (String) request.getAttribute("temp_an");
      if (temp_an == null) {
        if (comeFromType != null) { // 先判断是否是点击维护修改按钮过来
          contractId = (String) request.getSession().getAttribute("contractId");
          loanBankNameList = endorsecontractBS.queryBankList(contractId, securityInfo);

          endorsecontractTaAF =
              endorsecontractBS.queryContractInfo_(contractId, pagination, securityInfo, request);
          endorsecontractTaAF.setIsComeFromT5("0"); // 是从维护按钮过来,合同编号按钮禁用
        } else if ("afterSure".equals(afterSure)) { // 点击确定后过来的
          contractId = (String) request.getSession().getAttribute("contractId");
          loanBankNameList = endorsecontractBS.queryBankList(contractId, securityInfo);

          endorsecontractTaAF =
              endorsecontractBS.queryContractInfo_(contractId, pagination, securityInfo, request);
          String error = (String) request.getAttribute("error");
          if (error == null) {
            endorsecontractTaAF.setIsComeFromT5("0"); // 是从维护按钮过来,合同编号按钮禁用
          } else {
            endorsecontractTaAF = new EndorsecontractTaAF();
          }
        } else {
          // 从其他页面过来的
          contractId = (String) request.getSession().getAttribute("contractId");
          // 下面这行代码,点击节点进入时,银行下拉框将为空
          loanBankNameList = endorsecontractBS.queryBankList(contractId, securityInfo);
          endorsecontractTaAF =
              endorsecontractBS.queryContractInfo(
                  contractId, pagination, securityInfo, request, insert);
        }
      }
    } catch (BusinessException bex) {
      bex.printStackTrace();
      messages = new ActionMessages();
      messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(bex.getMessage(), false));
      saveErrors(request, messages);
    }

    request.setAttribute("loanBankNameList", loanBankNameList);
    endorsecontractTaAF.setParamValue(paramValue);
    String temp_beentruster = endorsecontractTaAF.getBeentruster();
    endorsecontractTaAF.setTemp_beentruster(temp_beentruster);
    String aftermaintain = (String) request.getSession().getAttribute("aftermaintain");
    if (aftermaintain != null && !"".equals(aftermaintain)) {
      request.getSession().setAttribute("aftermaintain", null);
    }
    String taIsNeedDel = (String) request.getAttribute("taIsNeedDel");
    endorsecontractTaAF.setIsNeedDel(taIsNeedDel);
    request.setAttribute("endorsecontractTaAF", endorsecontractTaAF);
    request.getSession().setAttribute("afterSure", null);
    return mapping.findForward("to_endorsecontractTa");
  }
예제 #10
0
 public ActionForward execute(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response) {
   ActionMessages messages = null;
   try {
     /** 分页 */
     Pagination pagination = getPagination(PAGINATION_KEY, request);
     PaginationUtils.updatePagination(pagination, request);
     saveToken(request);
     RateShowAF rateShowAF = new RateShowAF();
     IRatemngBS ratemngBS =
         (IRatemngBS) BSUtils.getBusinessService("ratemngBS", this, mapping.getModuleConfig());
     List list = ratemngBS.findRatemngList_sy(pagination);
     // 以下程序是判断是否启用按钮好用。
     SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
     List temp_list = securityInfo.getAllOfficeList();
     List temp_officecode = new ArrayList();
     OfficeDto officeDto = null;
     String info = "";
     String loadsMassage = "";
     // 确定有几个没有启用
     if (!temp_list.isEmpty()) {
       for (int i = 0; i < temp_list.size(); i++) {
         officeDto = (OfficeDto) temp_list.get(i);
         String officecode = officeDto.getOfficeCode();
         info = ratemngBS.checkOfficeCode(officecode);
         if (!info.equals("") && info.equals("nohi")) {
           temp_officecode.add(info);
         }
       }
     }
     // 办事处个数和没启用个数相等的时候启用按钮可用
     if (temp_list.size() == temp_officecode.size()) {
       loadsMassage = "hi";
     }
     RatemngAF ratemngAF = new RatemngAF();
     ratemngAF.setLoadsMassage(loadsMassage);
     ratemngAF.setList(list);
     List officeList = securityInfo.getAllOfficeList();
     List officeList1 = new ArrayList();
     OfficeDto officedto = null;
     Iterator itr1 = officeList.iterator();
     while (itr1.hasNext()) {
       officedto = (OfficeDto) itr1.next();
       officeList1.add(
           new org.apache.struts.util.LabelValueBean(
               officedto.getOfficeName(), officedto.getOfficeCode()));
     }
     request.getSession(true).setAttribute("officeList1", officeList1);
     ratemngAF.setOfficecode("");
     rateShowAF.setRatetypemap(BusiTools.listBusiProperty(BusiConst.CHGTYPESTATUS));
     request.setAttribute("ratemngAF", ratemngAF);
     request.setAttribute("rateShowAF", rateShowAF);
     ratemngAF.reset(mapping, request);
   } catch (Exception ex) {
     ex.printStackTrace();
   }
   return mapping.findForward("to_ratemng_list");
 }
예제 #11
0
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    response.setContentType("text/html;charset=UTF-8");
    response.setHeader("Cache-Control", "no-cache");
    ActionMessages messages = null;
    SecurityInfo securityInfo = (SecurityInfo) request.getSession().getAttribute("SecurityInfo");
    try {
      String id = (String) request.getParameter("id"); // 转出单位ID
      ItranoutBS tranoutBS =
          (ItranoutBS) BSUtils.getBusinessService("tranoutBS", this, mapping.getModuleConfig());

      Org org = null;
      String name = "";
      BigDecimal monthIncome = new BigDecimal(0.00);
      boolean b = false;
      boolean c = false;
      String f = "";
      String str = "";
      String yg = "";
      String yg_a = "";
      if (id != null && !id.equals("")) {
        org = tranoutBS.fingOrgInfo(id, securityInfo);

        if (org != null) {
          yg = tranoutBS.FindAA103_DayTime(org.getOrgInfo().getCollectionBankId());
          if (securityInfo.getUserInfo().getBizDate().equals(yg)) {
            yg_a = "a";
          } else {
            yg_a = "b";
          }
          name = org.getOrgInfo().getName();
          b = tranoutBS.findAdjustWrongFAccountByOrgid(org.getId().toString(), securityInfo);
          c = tranoutBS.check(org.getId().toString());
          if (b) {
            str = "此单位存在未记账的错账调整业务!";
          }
          if (c) {
            f = "提示";
          }
        }
        String text = null;
        String paginationKey = getPaginationKey();
        Pagination pagination = (Pagination) request.getSession().getAttribute(paginationKey);
        pagination.getQueryCriterions().put("id", id);
        pagination.getQueryCriterions().put("name", name);
        pagination.getQueryCriterions().put("monthIncome", monthIncome);

        if (name == null || name.equals("") || name.length() < 1) name = "";

        text =
            "displays('"
                + id
                + "','"
                + name
                + "','"
                + monthIncome
                + "','"
                + str
                + "','"
                + f
                + "','"
                + yg_a
                + "')";
        response.getWriter().write(text);
        response.getWriter().close();
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }