@Override
  protected void editing() {
    Object value = KasaSwingTools.getComponentValue(editorComponent);
    if (null != value) {
      int sl = (Integer) value;
      if (sl > 0) {
        NYsdlistInfo ysdlistInfo = xTable.getRowObject(editingRow);

        Double dwtj = ysdlistInfo.DWTJ;
        if (null != dwtj && dwtj > 0) {
          ysdlistInfo.setValue("ZTJ", NumberTools.multiplyScale(10, dwtj, sl));
        }

        Double dwzl = ysdlistInfo.DWZL;
        if (null != dwzl && dwzl > 0) {
          ysdlistInfo.setValue("ZZL", NumberTools.multiplyScale(10, dwzl, sl));
        }

        Double dwje = ysdlistInfo.DWJE;
        if (null != dwje && dwje > 0) {
          ysdlistInfo.setValue("ZJE", NumberTools.multiplyScale(10, dwje, sl));
        }
        xTable.refreshRow(editingRow);
      }
    }
  }
  @Override
  protected void editing() {
    NHzInfo hzInfo = StorageModule.getInstance().getHzInfo();

    NSpInfo zhspInfo = businessDialog.getHeadPane().getData(); // 组合商品

    NSpjgpzInfo rowObject = xTable.getRowObject(editingRow);

    NSpInfo spInfo = (NSpInfo) KasaSwingTools.getComponentValue(editorComponent);
    if (null == spInfo) {
      rowObject.REFERENCE_NSp_yl = null; // 原料商品 not null
      rowObject.REFERENCE_NSp_yl_desc = null;
      rowObject.SPDH = null; // 商品代号 null
      rowObject.SPGG = null; // 商品规格 null
      rowObject.GJTM = null; // 国际条码 null
      rowObject.YS = null; // 颜色 null
      rowObject.KS = null; // 款式 null
      rowObject.REFERENCE_NSpdw_D = null;
      rowObject.REFERENCE_NSpdw_D_desc = null;
      rowObject.REFERENCE_NSpdw_X = null;
      rowObject.REFERENCE_NSpdw_X_desc = null;
      rowObject.DXZHL = null;
      rowObject.SPCBJ = null; // 商品成本价 null
      rowObject.SPLSJ = null; // 商品零售价 null
    } else {
      if (isExist(spInfo)) {
        KasaSwingTools.resetComponent(editorComponent);

        StorageModule.showMessageDialog(businessDialog, "商品重复!");
      } else {
        rowObject.REFERENCE_NJt = hzInfo.REFERENCE_NJt; // 集团 not null
        rowObject.REFERENCE_NJt_desc = hzInfo.REFERENCE_NJt_desc; // 集团 not null
        rowObject.REFERENCE_NSp = zhspInfo.ID; // 组合商品 not null
        rowObject.REFERENCE_NSp_desc = zhspInfo.SPMC;
        rowObject.REFERENCE_NSp_yl = spInfo.ID; // 原料商品 not null
        rowObject.REFERENCE_NSp_yl_desc = spInfo.SPMC;
        rowObject.SPDH = spInfo.SPDH; // 商品代号 null
        rowObject.SPGG = spInfo.SPGG; // 商品规格 null
        rowObject.GJTM = spInfo.GJTM; // 国际条码 null
        rowObject.YS = spInfo.YS; // 颜色 null
        rowObject.KS = spInfo.KS; // 款式 null
        rowObject.REFERENCE_NSpdw_D = spInfo.REFERENCE_NSpdw_D;
        rowObject.REFERENCE_NSpdw_D_desc = spInfo.REFERENCE_NSpdw_D_desc;
        rowObject.REFERENCE_NSpdw_X = spInfo.REFERENCE_NSpdw_X;
        rowObject.REFERENCE_NSpdw_X_desc = spInfo.REFERENCE_NSpdw_X_desc;
        rowObject.DXZHL = spInfo.DXZHL;
        rowObject.SPCBJ = spInfo.SPCBJ; // 商品成本价 null
        rowObject.SPLSJ = spInfo.SPLSJ; // 商品零售价 null
      }
    }

    xTable.refreshRow(editingRow);
  }
  @Override
  protected void editing() {
    NPsdthomsInfo rowObject = xTable.getRowObject(editingRow);

    NSpInfo spInfo = (NSpInfo) KasaSwingTools.getComponentValue(editorComponent);
    if (null == spInfo) {
      DdSpFastSelectDlg.updateRowObject(rowObject, null);
    } else {
      if (isExist(spInfo)) {
        KasaSwingTools.resetComponent(editorComponent);

        StorageModule.showMessageDialog(businessDialog, "商品重复!");
      } else {
        DdSpFastSelectDlg.updateRowObject(rowObject, spInfo);
      }
    }

    xTable.refreshRow(editingRow);
  }
Пример #4
0
  @Override
  public boolean verify() {
    if (super.verify()) {
      KasaEnum yjfw = (KasaEnum) yjfw_comboBox.getSelectedItem();
      if (NZxyjbzEnum.ENUM_YJFW.JG.key == yjfw.key) {
        if (null == zzjgfwSelect.getObject()) {
          StorageModule.showMessageDialog(ZxyjbzPane.this, "当预警范围为机构时,请选择机构!");
          return false;
        }
      }
      if (NZxyjbzEnum.ENUM_YJFW.SZ.key == yjfw.key) {
        if (null == szfwSelect.getObject()) {
          StorageModule.showMessageDialog(ZxyjbzPane.this, "当预警范围为所站时,请选择所站!");
          return false;
        }
      } else if (NZxyjbzEnum.ENUM_YJFW.KQ.key == yjfw.key) {
        if (null == kqfwSelect.getObject()) {
          StorageModule.showMessageDialog(ZxyjbzPane.this, "当预警范围为库区时,请选择库区!");
          return false;
        }
      } else if (NZxyjbzEnum.ENUM_YJFW.CW.key == yjfw.key) {
        if (null == cwfwSelect.getObject()) {
          StorageModule.showMessageDialog(ZxyjbzPane.this, "当预警范围为储位时,请选择储位!");
          return false;
        }
      }

      if (null == zzjgfwSelect.getObject()) {
        StorageModule.showMessageDialog(ZxyjbzPane.this, "请设置组织机构");
        return false;
      }

      Integer zxts = (Integer) KasaSwingTools.getComponentValue(ZXTS);
      if (null == zxts || zxts.intValue() <= 0) {
        StorageModule.showMessageDialog(ZxyjbzPane.this, "请输入滞销天数,且必须大于0!");
        return false;
      }

      KasaEnum ke = (KasaEnum) yjfs_comboBox.getSelectedItem();
      if (NZxyjbzEnum.ENUM_YJFS.JT.key == ke.key) {

        Integer zxsl = (Integer) KasaSwingTools.getComponentValue(ZXSL);
        if (null == zxsl || zxsl.intValue() <= 0) {
          StorageModule.showMessageDialog(ZxyjbzPane.this, "请输入滞销数量,且必须大于0!");
          return false;
        }
      } else if (NZxyjbzEnum.ENUM_YJFS.DT.key == ke.key) {
        Double zxbl = (Double) KasaSwingTools.getComponentValue(ZXBL);

        if (null == zxbl || zxbl.doubleValue() <= 0 || 1 <= zxbl.doubleValue()) {
          StorageModule.showMessageDialog(ZxyjbzPane.this, "请输入滞销比例,且必须在0~1之间!");
          return false;
        }

        Integer zxtjts = (Integer) KasaSwingTools.getComponentValue(ZXTJTS);
        if (null == zxtjts || zxtjts.intValue() < zxts.intValue()) {
          StorageModule.showMessageDialog(ZxyjbzPane.this, "请输入统计滞销天数,且不能小于等于滞销天数!");
          return false;
        }
      } else {
        StorageModule.showMessageDialog(ZxyjbzPane.this, "预警方式选择异常!");
        return false;
      }

      return true;
    }
    return false;
  }