private void jbInit() throws Exception {
    this.setLayout(gridBagLayout1);
    jLabel1.setText("集团:");
    jtSelect.setTableName(TableNameConstants.JT);
    jtSelect.setRelationName("集团");

    this.add(
        jLabel1,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(10, 10, 10, 10),
            0,
            0));
    this.add(
        jtSelect,
        new GridBagConstraints(
            1,
            0,
            1,
            1,
            1.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(10, 10, 10, 10),
            0,
            0));
  }
Exemplo n.º 2
0
  public ZxyjbzPane(String tableName, UIProperties[] properties, int panelType) {
    super(tableName, properties, panelType);

    spSelect.setBind(false);
    initStatusByYjfw();
    initStatusByYjfs();
    yjfw_comboBox
        .getModel()
        .addListDataListener(
            new ListDataListener() {
              public void intervalAdded(ListDataEvent e) {}

              public void intervalRemoved(ListDataEvent e) {}

              public void contentsChanged(ListDataEvent e) {
                initStatusByYjfw();
                initStatusByYjfs();
              }
            });

    yjfs_comboBox
        .getModel()
        .addListDataListener(
            new ListDataListener() {
              public void intervalAdded(ListDataEvent e) {}

              public void intervalRemoved(ListDataEvent e) {}

              public void contentsChanged(ListDataEvent e) {
                initStatusByYjfs();
              }
            });

    SelectVerifyAction action = new SelectVerifyAction();
    kqfwSelect.setSelectVerifyListener(action);
    cwfwSelect.setSelectVerifyListener(action);
    spSelect.setSelectVerifyListener(action);

    spSelect.addObjectChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent e) {
            NSpInfo spInfo = (NSpInfo) spSelect.getObject();
            if (null == spInfo) {
              SPDH.setText("");
              SPMC.setText("");
              SPGG.setText("");
            } else {
              SPDH.setText(spInfo.SPDH);
              SPMC.setText(spInfo.SPMC);
              SPGG.setText(spInfo.SPGG);
            }
          }
        });
  }
Exemplo n.º 3
0
  public void selectEvent() {
    NJtInfo jt = businessDialog.getJt();

    if (null == jt) {
      StorageModule.showMessageDialog(this, "请先选择货主!");
      return;
    }

    List<Condition> filterList = new ArrayList<Condition>();
    Condition condition = new Condition();
    condition.fieldName = ReferenceConstants.JT_REFERENCE_NAME;
    condition.fieldDesc = "集团";
    condition.operator = Operator.equal.id;
    condition.value.data = jt;
    filterList.add(condition);

    this.setFilterConditon(filterList);

    super.selectEvent();
  }
Exemplo n.º 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;
  }
Exemplo n.º 5
0
  private void initStatusByYjfw() {
    KasaEnum ke = (KasaEnum) yjfw_comboBox.getSelectedItem();
    if (NZxyjbzEnum.ENUM_YJFW.JG.key == ke.key) {
      zzjgfwSelect.setObject(StorageModule.getInstance().getZzjgInfo());
      kqfwSelect.setEnabled(false);
      cwfwSelect.setEnabled(false);

      szfwSelect.setObject(null);
      kqfwSelect.setObject(null);
      cwfwSelect.setObject(null);
    } else if (NZxyjbzEnum.ENUM_YJFW.SZ.key == ke.key) {
      zzjgfwSelect.setObject(StorageModule.getInstance().getZzjgInfo());
      szfwSelect.setObject(StorageModule.getInstance().getSzInfo());
      kqfwSelect.setEnabled(false);
      cwfwSelect.setEnabled(false);

      kqfwSelect.setObject(null);
      cwfwSelect.setObject(null);
    } else if (NZxyjbzEnum.ENUM_YJFW.KQ.key == ke.key) {
      zzjgfwSelect.setObject(StorageModule.getInstance().getZzjgInfo());
      szfwSelect.setObject(StorageModule.getInstance().getSzInfo());
      kqfwSelect.setEnabled(true);
      cwfwSelect.setEnabled(false);

      cwfwSelect.setObject(null);
    } else if (NZxyjbzEnum.ENUM_YJFW.CW.key == ke.key) {
      zzjgfwSelect.setObject(StorageModule.getInstance().getZzjgInfo());
      szfwSelect.setObject(StorageModule.getInstance().getSzInfo());
      kqfwSelect.setEnabled(true);
      cwfwSelect.setEnabled(true);
    }
  }
 public void setCurrentJt(NJtInfo jt) {
   jtSelect.setObject(jt);
 }
 public NJtInfo getSelectedJt() {
   return (NJtInfo) jtSelect.getObject();
 }