Esempio n. 1
0
 /*
  * (non-Javadoc)
  *
  * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
  */
 public void stop(BundleContext context) throws Exception {
   for (Class each : parserClass) {
     DefinedCommon.reomoveConstant(each);
   }
 }
Esempio n. 2
0
  /** 当有销售单付款状态发生变化,如回款,退货, 个人领样转销售等(销售库管审批后),除回款实时,其它定时统计 {@inheritDoc} */
  public void processOutPayChangedWithoutTransaction(
      String stafferId,
      BlackBean blackBean,
      double backValue,
      String refId,
      final Set<String> idSet) {
    int maxReDate;

    int oldMaxReDate = blackBean.getDays();

    for (String eachId : idSet) {
      blackOutDAO.deleteEntityBean(eachId);
    }

    // 检查超期最长时间的销售单是否全部回款,如果全部回款,则要从超期中二次取出最大超期天数的单据,并更新超期最长的单据数据
    List<BlackOutBean> blackOutList = blackOutDAO.queryByRefIdAndType(refId, 1);

    if (ListTools.isEmptyOrNull(blackOutList)) {
      // 二次取出最大超期天数
      maxReDate = blackOutDAO.queryMaxDaysByRefIdAndType(refId, 0);
    } else {
      maxReDate = blackBean.getDays();
    }

    _logger.info("maxReDate :" + maxReDate);

    if (maxReDate > 0 && maxReDate != oldMaxReDate) {
      List<BlackOutBean> blackOut0List = blackOutDAO.queryByRefIdAndType(refId, 0);

      for (BlackOutBean each : blackOut0List) {
        if (each.getDays() == maxReDate) {
          BlackOutBean outBean = new BlackOutBean();

          outBean.setRefId(refId);
          outBean.setType(1);
          outBean.setOutId(each.getOutId());
          outBean.setDays(each.getDays());

          blackOutDAO.saveEntityBean(outBean);
        }
      }
    }

    // 回款后仍超期应收金额(不计当天发生的)
    double reDateMoney = blackBean.getMoney() - backValue;

    if (maxReDate == 0) {
      reDateMoney = 0.0d;

      backValue = blackBean.getMoney();
    }

    int blackType = processBlackTypeInner(stafferId, reDateMoney, maxReDate, false);

    // 更新黑名单列表
    blackBean.setMoney(reDateMoney);
    blackBean.setDays(maxReDate);
    blackBean.setAllMoneys(blackBean.getAllMoneys() - backValue);
    _logger.info("blackBean.setDays :" + blackBean.getDays());
    int oldBlackType = blackBean.getCredit();

    if (oldBlackType == StafferConstant.BLACK_NO && blackType != StafferConstant.BLACK_NO) {
      blackBean.setEntryDate(TimeTools.now_short());
      blackBean.setRemoveDate("");
    } else if (oldBlackType != StafferConstant.BLACK_NO && blackType == StafferConstant.BLACK_NO) {
      blackBean.setRemoveDate(TimeTools.now_short());
    }

    blackBean.setCredit(blackType);

    _logger.info("processOutPayChangedWithoutTransaction blackBean update :" + blackBean);

    blackDAO.updateEntityBean(blackBean);

    // 通知
    if (oldBlackType != blackType) {
      String msg =
          "你的信用属性发生变化,原信用属性为:【"
              + DefinedCommon.getValue("stafferBlack", oldBlackType)
              + "】,新的信用属性为:【"
              + DefinedCommon.getValue("stafferBlack", blackType)
              + "】";

      notifyManager.notifyMessage(stafferId, msg);

      _logger.info(stafferId + "--" + msg);
    }
  }
Esempio n. 3
0
 /*
  * (non-Javadoc)
  *
  * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
  */
 public void start(BundleContext context) throws Exception {
   for (Class each : parserClass) {
     DefinedCommon.addDefinedClass(each);
   }
 }