private void doDelAction() {
    int result = StorageModule.showConfirmDialog("确定要删除选择的商品加工配置吗?");
    if (result == 0) {
      NSpInfo spInfo = this.getSelectedRowObject();
      OneRecordRequest deleteRequest = new OneRecordRequest();
      deleteRequest.tableName = mainPane.getTableName();
      deleteRequest.oneRecord = spInfo;

      BooleanEntity response = new BooleanEntity();
      result = CommonTools.sendSynCommand(StorageCmdCode.SPJGPZ_DEL, deleteRequest, response);
      if (0 == result) {
        this.removeRow(spInfo);

        StorageModule.showMessageDialog("删除成功!");
      }
    }
  }
  @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);
    }
  }
  private void doCXHXAction() {
    int result = StorageModule.showConfirmDialog(this, "确定撤销核销这些数据吗?");
    if (0 == result) {
      List<NPczbInfo> list = this.getSelectedRowList();
      if (null != list) {
        String YYCLCZ = null; // 车主
        for (NPczbInfo one : list) {
          if (null == YYCLCZ) {
            YYCLCZ = one.REFERENCE_NYyclcz;
          } else if (!one.REFERENCE_NYyclcz.equals(YYCLCZ)) {
            StorageModule.showMessageDialog(this, "同一车队才能进行撤销核销操作!转运车辆:" + one.CPHM + "所属“车主”不相同");
            return;
          }

          if (NPczbEnum.ENUM_JSZT.HX.key != one.ENUM_JSZT) {
            StorageModule.showMessageDialog(
                this, "只有“核销”状态下才能进行撤销核销操作!转运车辆:" + one.CPHM + "的记录状态不是“核销”状态");
            return;
          }
        }

        PczbHXRequest request = new PczbHXRequest();
        request.szInfo = StorageModule.getInstance().getSzInfo();
        request.list = new ZTOArrayList<NPczbInfo>(list, NPczbInfo.class);

        PczbHXResponse response = new PczbHXResponse();

        int iRresult =
            CommonTools.sendSynCommand(StorageCmdCode.CX_PCZB_ZYFY_HX, request, response);
        if (0 == iRresult) {
          List<NPczbInfo> responseList = response.list;
          if (null == responseList || list.size() != responseList.size()) {
            StorageModule.showMessageDialog(this, "系统错误:返回的数据和请求的数据数量上不对应!");
          } else {
            int[] selected = this.getSelectedRows();
            int index = 0;
            for (int rowIndex : selected) {
              this.setRow(rowIndex, responseList.get(index++));
            }

            StorageModule.showMessageDialog(this, "撤销核销完成!");
          }
        }
      }
    }
  }
Exemplo n.º 4
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;
  }