Ejemplo n.º 1
0
  public String deleteMaxHoldQty() {
    this.logger.debug("enter deleteMaxHoldQty");

    String[] ids = this.request.getParameterValues("ids");

    if (ids != null) {
      String prompt = "";
      int count = 0;
      for (int i = 0; i < ids.length; i++) {
        String[] idArr = ids[i].split(",");
        String firmID = idArr[0];
        String commodityID = idArr[1];
        try {
          String sysStatus = this.firmSpecialService.getSystemStatus();
          if (("5".equals(sysStatus)) || ("6".equals(sysStatus))) {
            addReturnValue(-1, 151103L, new Object[] {"此时市场状态不允许删除!"});
            count++;
            break;
          }

          FirmMaxHoldQty maxHoldQty = new FirmMaxHoldQty();
          maxHoldQty.setFirmID(firmID);
          maxHoldQty.setCommodityID(commodityID);
          getService().delete(maxHoldQty);

          writeOperateLog(
              1505,
              "删除特殊商品订货量! 交易商ID:" + maxHoldQty.getFirmID() + ",商品ID:" + maxHoldQty.getCommodityID(),
              1,
              "");
        } catch (DataIntegrityViolationException e) {
          e.getStackTrace();
          prompt = prompt + ids[i] + ",";
          addReturnValue(-1, 151103L, new Object[] {"[" + ids[i] + "]与其他数据关联,删除失败!"});
          count++;
        }
      }
      if (!prompt.equals("")) {
        prompt = prompt.substring(0, prompt.length() - 1);
        prompt = prompt + "与其他数据关联,不能删除!";
        addReturnValue(0, 151103L, new Object[] {prompt});
        count++;
      }
      if (count == 0) {
        addReturnValue(1, 119903L);
      }
    } else {
      addReturnValue(-1, 151103L, new Object[] {"删除主键为空或错误,请修改~!"});
    }

    return "success";
  }
Ejemplo n.º 2
0
  public String addMaxHoldQty() throws Exception {
    this.logger.debug("enter addMaxHoldQty");

    FirmMaxHoldQty maxHoldQty = (FirmMaxHoldQty) this.entity;
    boolean flag = existCommoditySpecial(maxHoldQty.getFirmID(), maxHoldQty.getCommodityID());
    if (flag) {
      addReturnValue(-1, 151103L, new Object[] {"添加特殊商品订货量失败,已存在!"});
    } else {
      FirmMaxHoldQty firmMaxHoldQty = (FirmMaxHoldQty) this.entity;

      firmMaxHoldQty.setModifyTime(getService().getSysDate());

      getService().add(firmMaxHoldQty);

      addReturnValue(1, 119901L);

      writeOperateLog(
          1505,
          "添加特殊商品订货量!交易商ID:"
              + firmMaxHoldQty.getFirmID()
              + ",商品ID:"
              + firmMaxHoldQty.getCommodityID(),
          1,
          "");
    }

    return "success";
  }
Ejemplo n.º 3
0
  public String updateMaxHoldQty() throws Exception {
    this.logger.debug("enter updateMaxHoldQty");

    FirmMaxHoldQty firmMaxHoldQty = (FirmMaxHoldQty) this.entity;

    firmMaxHoldQty.setModifyTime(getService().getSysDate());

    getService().update(firmMaxHoldQty);

    addReturnValue(1, 119902L);

    writeOperateLog(
        1505,
        "修改特殊商品订货量! 交易商ID:"
            + firmMaxHoldQty.getFirmID()
            + ",商品ID:"
            + firmMaxHoldQty.getCommodityID(),
        1,
        "");

    return "success";
  }