@SuppressWarnings("unchecked")
  @Override
  protected void initTableData() {
    OneRecordRequest request = new OneRecordRequest();
    request.tableName = TableNameConstants.PCZB;
    request.oneRecord = this.getRelationObj();

    QueryResponse response = new QueryResponse(TableInfoFactory.getBaseInfoClass(listTableName));
    int result = CommonTools.sendSynCommand(getQueryTableCmdCode(), request, response);
    if (0 == result) {
      List<?> list = response.result;
      getManagePane().setListData((List<NPczbljgjInfo>) list);
      getManagePane().doHomeAction();

      getMapPane().setData((List<NPczbljgjInfo>) list);
    }
  }
Exemplo n.º 2
0
  @Override
  public boolean doApplyEvent() {
    NYfzkInfo sendObj = yfzkPane.getData();

    if (!isRz) {
      HxConfirmDialog confirmDialog = new HxConfirmDialog("核销", false, sendObj.YFK, sendObj.YFKX);
      confirmDialog.setVisible(true);
      if (0 == confirmDialog.getResult()) {
        double value = confirmDialog.getValue();

        if (null == sendObj.YFKX) {
          sendObj.YFKX = value;
        } else {
          sendObj.YFKX = NumberTools.add(sendObj.YFKX, value);
        }

        sendObj.WFK = NumberTools.subtract(sendObj.YFK, sendObj.YFKX);
        if (sendObj.WFK < 0) {
          StorageModule.showMessageDialog(this, "此次付款金额不能大于(应付款 - 已付款)!");
          return false;
        }
      } else {
        return false;
      }
    }

    int cmdCode = isRz ? StorageCmdCode.PTDZ_YFZK_RZ : StorageCmdCode.PTDZ_YFZK_HX;

    OneRecordRequest request = new OneRecordRequest();
    request.tableName = TableNameConstants.YFZK;
    request.oneRecord = sendObj;

    OneRecordResponse response =
        new OneRecordResponse(TableInfoFactory.getBaseInfoClass(TableNameConstants.YFZK));
    int result = CommonTools.sendSynCommand(cmdCode, request, response);
    if (0 == result) {
      relationTable.setRow(relationTable.getSelectedRow(), (NYfzkInfo) response.oneRecord);

      this.getApplyButton().setEnabled(false);

      return true;
    }

    return false;
  }