Beispiel #1
0
  /**
   * 零售单审批
   *
   * @return
   */
  public String doSp() {
    LoginInfo info = (LoginInfo) getSession().getAttribute("LOGINUSER");
    String user_id = info.getUser_id();

    lsd = (Lsd) lsdService.getLsd(id); // 零售单
    lsdProducts = lsdService.getLsdProducts(id);
    iscs_flag = sysInitSetService.getQyFlag();
    isqzxlh_flag = userService.getQzxlh();
    // 只有在审批通过并且完成初始化后再判断库存是否满足
    if (sp_state.equals("3") && iscs_flag.equals("1")) {
      // 审批通过,需要判断库存是否满足
      if (!(lsdService.checkKc(lsd, lsdProducts)).equals("")) {
        this.setMsg(lsdService.checkKc(lsd, lsdProducts));
        return "input";
      }
      if (isqzxlh_flag.equals("01")) {
        if (!(lsdService.checkXlh(lsd, lsdProducts)).equals("")) {
          this.setMsg(lsdService.checkXlh(lsd, lsdProducts));
          return "input";
        }
      }
    }

    // 保存审批结果
    lsdService.saveSp(id, sp_state, user_id);

    return "success";
  }
Beispiel #2
0
  /**
   * 保存内部公告
   *
   * @return
   */
  public String save() {
    LoginInfo info = (LoginInfo) getSession().getAttribute("LOGINUSER");
    String user_id = info.getUser_id();
    xxfbNbgg.setCzr(user_id);

    xxfbNbggService.saveNbgg(xxfbNbgg);
    return "success";
  }
Beispiel #3
0
  /**
   * 保存回复信息
   *
   * @return
   */
  public String saveReplay() {
    try {
      LoginInfo info = (LoginInfo) getSession().getAttribute("LOGINUSER");
      String user_id = info.getUser_id();

      XxfbNbgg xxfbNbgg = new XxfbNbgg();
      xxfbNbgg.setContent(content);
      xxfbNbgg.setCzr(user_id);
      xxfbNbgg.setParent_id(parent_id);
      xxfbNbgg.setPub_date(DateComFunc.getToday());

      xxfbNbggService.saveNbgg(xxfbNbgg);
      content = "";
      return SUCCESS;
    } catch (Exception e) {
      log.error("保存回复信息失败,原因:" + e.getMessage());
      return ERROR;
    }
  }
Beispiel #4
0
  /**
   * 提交审批
   *
   * @return
   */
  public String submitInfo() {
    LoginInfo info = (LoginInfo) getSession().getAttribute("LOGINUSER");
    String user_id = info.getUser_id();

    lsdProducts = lsdService.getLsdProducts(lsd.getId());
    isqzxlh_flag = userService.getQzxlh();
    String msg = lsdService.checkKc(lsd, lsdProducts);
    if (!msg.equals("")) {
      this.saveMessage(msg);

      userList = userService.getAllEmployeeList();
      storeList = storeService.getAllStoreList();
      ysfs = sjzdService.getSjzdXmxxByZdId("SJZD_FKFS");
      posTypeList = posTypeService.getPosTypeList();

      return "input";
    }

    if (isqzxlh_flag.equals("01")) {
      msg = lsdService.checkXlh(lsd, lsdProducts);
      if (!msg.equals("")) {
        this.saveMessage(msg);

        userList = userService.getAllEmployeeList();
        storeList = storeService.getAllStoreList();
        ysfs = sjzdService.getSjzdXmxxByZdId("SJZD_FKFS");
        posTypeList = posTypeService.getPosTypeList();

        return "input";
      }
    }

    lsd.setCzr(user_id);

    lsd.setSp_state("2"); // 修改零售单为待审批状态
    lsd.setState("已保存"); // 修改零售单状态为已保存

    lsdService.updateLsd(lsd, lsdProducts);

    return "success";
  }
Beispiel #5
0
  /** 更新零售单信息 */
  public String update() {
    LoginInfo info = (LoginInfo) getSession().getAttribute("LOGINUSER");
    String user_id = info.getUser_id();
    lsd.setCzr(user_id);

    iscs_flag = sysInitSetService.getQyFlag();
    isqzxlh_flag = userService.getQzxlh();
    // 只有在完成初始工作后再做库存是否满足需求判断
    if (iscs_flag.equals("1")) {

      // 如果零售单状态为已提交需要判断库存是否满足出库需求
      // 如果不满足出库需求,则保存零售单,同时返回输入页面,提示用户
      if (lsd.getState().equals("已提交")) {
        if (!(lsdService.checkKc(lsd, lsdProducts)).equals("")) {
          this.setMsg(lsdService.checkKc(lsd, lsdProducts));
          lsd.setState("已保存");
          lsdService.updateLsd(lsd, lsdProducts);

          userList = userService.getAllEmployeeList();
          storeList = storeService.getAllStoreList();
          iscs_flag = sysInitSetService.getQyFlag(); // 是否完成初始标志
          ysfs = sjzdService.getSjzdXmxxByZdId("SJZD_FKFS");
          posTypeList = posTypeService.getPosTypeList();

          return INPUT;
        }
        if (isqzxlh_flag.equals("01")) {
          if (!(lsdService.checkXlh(lsd, lsdProducts)).equals("")) {
            this.setMsg(lsdService.checkXlh(lsd, lsdProducts));
            lsd.setState("已保存");
            lsdService.updateLsd(lsd, lsdProducts);

            // 页面初始数据
            storeList = storeService.getAllStoreList();
            ysfs = sjzdService.getSjzdXmxxByZdId("SJZD_FKFS");
            posTypeList = posTypeService.getPosTypeList();
            userList = userService.getAllEmployeeList();

            return INPUT;
          }
        }
      }
    }

    // 判断是否存在超低价商品,如存在则审批状态修改为待审批
    if (lsd.getState().equals("已提交") && lsdService.isExistLowLsxj(lsd, lsdProducts)) {
      if (flag.equals("1")) {
        // 提交审批
        lsd.setState("已保存");
        lsd.setSp_state("2"); // 待审批
      } else {
        // 如果不是提交审批,返回录入界面给用户提示
        lsd.setState("已保存");
        lsd.setSp_state("1"); // 需要审批
        lsdService.updateLsd(lsd, lsdProducts);

        // 页面初始数据
        storeList = storeService.getAllStoreList();
        ysfs = sjzdService.getSjzdXmxxByZdId("SJZD_FKFS");
        posTypeList = posTypeService.getPosTypeList();
        userList = userService.getAllEmployeeList();
        flag = "1";

        return INPUT;
      }
    }

    lsdService.updateLsd(lsd, lsdProducts);
    return "success";
  }