コード例 #1
0
/**
 * 采购订单实现类(非事务)
 *
 * @author:zhenglq<br>
 * @datetime:2009-11-6 上午11:28:18
 */
public class OrderConfirmQueryServiceImpl implements IOrderConfirmQueryService {
  @SuppressWarnings("unused")
  private LfwLogger logger = LoggerManager.getLogger(OrderConfirmQueryServiceImpl.class);

  private BaseDAO baseDao = null;

  /**
   * 获取baseDao
   *
   * @author:zhenglq <br>
   * @datetime:2009-11-6上午11:20:41
   * @return
   */
  public BaseDAO getBaseDao() {
    if (null == baseDao) baseDao = new BaseDAO();
    return baseDao;
  }

  /**
   * 查询,是否已经在外网确认过送货数量和金额
   *
   * @author:zhenglq <br>
   * @datetime:2009-12-24下午06:51:17
   * @param mainVO
   * @return
   * @throws LfwRuntimeException
   */
  @SuppressWarnings("unchecked")
  public boolean permitComplete(String orderPk) throws LfwRuntimeException {
    // 查询采购订单确认中是否存在订单发货数据
    String sql = "select * from ebs_dd_order_item_cfm where pk_dd_order_main='" + orderPk + "'";
    try {
      List<OrderItemCfmVO> predVOList =
          (List<OrderItemCfmVO>)
              getBaseDao().executeQuery(sql, new BeanListProcessor(OrderItemCfmVO.class));
      if (null != predVOList && predVOList.size() > 0) {
        return true;
      } else {
        return false;
      }
    } catch (DAOException e) {
      e.printStackTrace();
    }
    return false;
  }
}
コード例 #2
0
ファイル: OpenProcessor.java プロジェクト: dalinhuang/sdb
public class OpenProcessor extends EbscgDefaultProcessorSupportPf {
  // 获取事务service
  private IOpenService openService = null;
  // 获取非事务service
  private IOpenQueryService openQueryService = null;

  private final LfwLogger logger = LoggerManager.getLogger(OpenDelegator.class);

  @Override
  protected NCObject[] doBillLoad(IBusinessEntity entity) throws BusinessException {

    // 采购方案主键
    // 这里需要从其他地方来获取现在使用默认值,当业务真正的串联时需要统一获取
    String pk_proj_main = this.getWebContext().getParameter("projectPk");
    // 采购方案模板环节执行主键ID
    String pk_xy_step_exec_state = this.getWebContext().getParameter("stepId");

    // 点击开启来源
    String open_source = this.getWebContext().getParameter("open_source");
    // 发布环节PK
    String pubPk = this.getWebContext().getParameter("pubPk");

    BaseDAO dao = new BaseDAO();
    try {
      // 获取采购小组人员信息
      String sql =
          "select * from ebs_xy_projexec_person  where  pk_xy_proj_main ='" + pk_proj_main + "' ";
      List<ProjPersonCGVO> ppj =
          (List<ProjPersonCGVO>) dao.executeQuery(sql, new BeanListProcessor(ProjPersonCGVO.class));
      if (ppj != null || ppj.size() > 0) {
        for (ProjPersonCGVO cvo : ppj) {

          // 每轮的采购小组数据 zdy3是发布主键 zdy5是采购小组信息每条数据的主键
          String sqljzx =
              "select * from ebs_xy_projexec_personjzx  where  zdy3 = '"
                  + pubPk
                  + "' and zdy5= '"
                  + cvo.getPk_xy_proj_person()
                  + "'";
          List<ProjGroupVO> ppjjzx =
              (List<ProjGroupVO>)
                  dao.executeQuery(sqljzx, new BeanListProcessor(ProjGroupVO.class));

          if (ppjjzx != null && ppjjzx.size() > 0) {
            ProjGroupVO jzx = ppjjzx.get(0);
            jzx.setDiscard_status(cvo.getDiscard_status());
            jzx.setTicketnum(cvo.getTicketnum());
            jzx.setWeight(cvo.getWeight());
            jzx.setPk_corp(cvo.getPk_corp());
            jzx.setPk_dept(cvo.getPk_dept());
            jzx.setPk_person(cvo.getPk_person());

            dao.updateVO(
                jzx,
                new String[] {
                  "discard_status", "ticketnum", "weight", "pk_corp", "pk_dept", "pk_person"
                });
          } else {

            ProjGroupVO pg = new ProjGroupVO();
            pg.setDiscard_status(cvo.getDiscard_status());
            pg.setPk_xy_proj_main(pk_proj_main);
            // pg.setPk_xy_proj_person(cvo.getPk_xy_proj_person());
            pg.setPk_corp(cvo.getPk_corp());
            pg.setPk_dept(cvo.getPk_dept());
            pg.setPk_person(cvo.getPk_person());
            pg.setZdy3(pubPk);
            pg.setTicketnum(cvo.getTicketnum());
            pg.setWeight(cvo.getWeight());
            pg.setZdy5(cvo.getPk_xy_proj_person());
            dao.insertVO(pg);
          }
        }
      }

    } catch (Exception e) {

      Logger.error(e.getMessage(), e);
    }

    NCObject ncObj =
        ((OpenDelegator) this.billHandler)
            .doQueryOpenVOSByPK(pk_proj_main, pk_xy_step_exec_state, open_source, pubPk);
    NCObject[] s = null;
    if (pk_proj_main != null && pk_proj_main.length() > 0) {
      s = new NCObject[1];
      s[0] = ncObj;
    } else {
      s = super.doBillLoad(entity);
    }
    return s;
  }

  // ------------
  // protected NCObject[] doBillLoad(IBusinessEntity entity) throws
  // BusinessException {
  //
  // String pk_xy_proj_main =
  // LfwRuntimeEnvironment.getWebContext().getParameter("projectPk");
  //
  // String pk_xy_step_pub =
  // LfwRuntimeEnvironment.getWebContext().getParameter("pk_xy_step_pub");
  // OpenDelegator pd = (OpenDelegator) this.billHandler;
  // // NCObject ncObj = pd.doQueryJzxVOSByPK(pk_xy_proj_main,
  // // pk_xy_step_pub);
  //
  // BaseDAO dao = new BaseDAO();
  // try {
  // // 获取采购小组人员信息
  // String sql =
  // "select * from ebs_xy_projexec_person  where  pk_xy_proj_main ='"+
  // pk_xy_proj_main + "' ";
  // List<ProjPersonCGVO> ppj = (List<ProjPersonCGVO>) dao.executeQuery(sql,
  // new BeanListProcessor(ProjPersonCGVO.class));
  // if (ppj != null || ppj.size() > 0) {
  // for (ProjPersonCGVO cvo : ppj) {
  //
  // // 竞争性谈判每轮的采购小组数据 zdy3是发布主键 zdy5是采购小组信息每条数据的主键
  // String sqljzx =
  // "select * from ebs_xy_projexec_personjzx  where  zdy3 = '"
  // + pk_xy_step_pub
  // + "' and zdy5= '"
  // + cvo.getPk_xy_proj_person() + "'";
  // List<ProjPersonjzxCGVO> ppjjzx = (List<ProjPersonjzxCGVO>) dao
  // .executeQuery(sqljzx, new BeanListProcessor(
  // ProjPersonjzxCGVO.class));
  //
  // if (ppjjzx != null && ppjjzx.size() > 0) {
  // ProjPersonjzxCGVO jzx = ppjjzx.get(0);
  // jzx.setDiscard_status(cvo.getDiscard_status());
  // jzx.setTicketnum(cvo.getTicketnum());
  // jzx.setWeight(cvo.getWeight());
  // jzx.setPk_corp(cvo.getPk_corp());
  // jzx.setPk_dept(cvo.getPk_dept());
  // jzx.setPk_person(cvo.getPk_person());
  //
  // dao.updateVO(jzx, new String[] { "discard_status",
  // "ticketnum", "weight", "pk_corp", "pk_dept",
  // "pk_person" });
  // }
  //
  // }
  // }
  //
  // } catch (Exception e) {
  //
  // Logger.error(e.getMessage(), e);
  //
  // }
  //
  // return null;
  // }
  // ------------

  /**
   * 获取不带事务处理的service wangzhenzhou
   *
   * @author:zhenglq <br>
   * @datetime:2009-11-11下午08:06:42
   * @return
   */
  public IOpenQueryService getOpenQueryService() {
    openQueryService = NCLocator.getInstance().lookup(IOpenQueryService.class);
    return openQueryService;
  }

  @SuppressWarnings("null")

  // 季凌峰 2012/22/25   全部开启按钮 当如果 返回全部开启
  // 则首先进行报价解密,再进行附件解密
  public String doOpen() throws LfwBusinessException, Exception {
    WebContext ctx = getWebContext();
    String open_pk = ctx.getParameter("pk_xy_open").toString();
    String opensource = ctx.getParameter("opensource");
    String pk_xy_proj_item_sup_cfm = this.getWebContext().getParameter("pk_xy_proj_item_sup_cfm");
    String pk_xy_pub_step = this.getWebContext().getParameter("pk_xy_pub_step");
    String pk_xy_proj_main = this.getWebContext().getParameter("projectPk");
    String sqlWhere =
        "  pk_xy_proj_item_sup_cfm='"
            + pk_xy_proj_item_sup_cfm
            + "' and pk_xy_proj_main='"
            + pk_xy_proj_main
            + "' and ISNULL(dr,0) = 0 ";
    // 开启功能的逻辑控制判断
    String result = ((OpenDelegator) this.billHandler).doOpen(open_pk, opensource);

    if (result == "ok") {

      String a = Opricejm(opensource, pk_xy_proj_main, pk_xy_pub_step, pk_xy_proj_item_sup_cfm);
      String b = loupadate(opensource, pk_xy_proj_main, pk_xy_pub_step, "1,2");

      if (a == "ok" && b == "ok") {

        return "开启成功";
      } else {

        throw new LfwRuntimeException("文件解密失败");
      }
    }

    return result;
  }

  // 季凌峰 2012/12/25 附件解密
  public String loupadate(
      String opensource, String pk_xy_proj_main, String pk_xy_pub_step, String price_type) {
    String keyValue = null;
    // 附件解密方法
    Properties props = new Properties();
    // 文件存放的路径。评标会解密的附件压缩
    String ebsfile = "";
    BaseDAO dao = new BaseDAO();
    InputStream is = null;
    try {
      // 读取应用下的配置文件
      String path =
          RuntimeEnv.getInstance().getNCHome()
              + File.separatorChar
              + "hotwebs"
              + File.separatorChar
              + "ebscg"
              + File.separatorChar
              + "WEB-INF"
              + File.separatorChar
              + "conf"
              + File.separatorChar
              + "system.properties";
      is = new FileInputStream(path);
      props.load(is);
      keyValue = props.getProperty(EbsOperaitonConst.CHECK_KEY);
    } catch (Exception e) {
      Logger.error("读取系统配置错误!", e);
      try {
        if (is != null) is.close();
      } catch (Exception et) {
        Logger.error("读取系统配置错误!", et);
      }
    } finally {
      try {
        if (is != null) is.close();
      } catch (IOException e) {
        Logger.error("读取系统配置错误!", e);
      }
    }

    // 如果为1的时候则对文件解密
    if (keyValue != null) {

      // 因为没有从js获取,没有打开界面调用数据,所以参数需要自己定义和获取。
      String openvalue = "2";

      // 模块类型  model_type    7门户上传附件
      String modelType = "7";
      // 来源单据类型  bill_type  //发标应答  E059   发布应答     E05A
      String billType = "E059"; // 发标应答  E059
      if (opensource != null && opensource.equals("0")) {
        billType = "E05A"; // 发布应答     E05A				
      }
      // 所属单据ID bill_id   采购方案主键
      String billId = pk_xy_proj_main;
      // 所属单据明细ID itemid  供应商确定主键
      try {

        String sql =
            "select * from ebs_xy_proj_item_sup_cfm  where pk_xy_proj_main = '"
                + pk_xy_proj_main
                + "' and isnull(dr,0) = 0 ";
        List<ProjItemSupCfmVO> sp =
            (List<ProjItemSupCfmVO>)
                dao.executeQuery(sql, new BeanListProcessor(ProjItemSupCfmVO.class));
        if (sp != null && sp.size() > 0) {
          for (ProjItemSupCfmVO sup : sp) {
            // 获取每次供应商的附件
            // 修改下面的方法,主要是为了取得对应的附件类型。

            String sqls =
                "select * from ebs_da_att where model_type='"
                    + modelType
                    + "' and bill_type= '"
                    + billType
                    + "' and bill_id='"
                    + billId
                    + "' and itemid='"
                    + sup.getPk_xy_proj_item_sup_cfm()
                    + "' and zdy3='"
                    + pk_xy_pub_step
                    + "' and price_type in ("
                    + price_type
                    + ") and ISNULL(dr,0) = 0      ";

            List<AttVO> list =
                (List<AttVO>) dao.executeQuery(sqls, new BeanListProcessor(AttVO.class));
            // List<AttVO> list = getOpenQueryService().getCaFileByPara(modelType, billType, billId,
            // sup.getPk_xy_proj_item_sup_cfm());
            EbscgFileUploadHandler fileHandler =
                (EbscgFileUploadHandler)
                    LfwClassUtil.newInstance(EbscgFileUploadHandler.class.getName());
            if (list != null && list.size() > 0) {
              SignVO signvo = null;
              byte[] baOutPlaintext = null;
              for (AttVO attvo : list) {
                if (attvo != null && attvo.getAfter_ca() != null && attvo.getAfter_ca() == 1) {
                  continue;
                }
                try {
                  // 采用数据库读取文件数据
                  DataFileFactory dff = DataFileFactory.getInstance();
                  IDataBaseFileOper ibfo = dff.getFileDealServer();
                  byte[] content = null;
                  content = ibfo.obtainFileMess(attvo.getPk_da_att(), "ca_content");

                  EncrypteDecrypte3DES des = new EncrypteDecrypte3DES();
                  BASE64Decoder base64 = new BASE64Decoder();
                  des.setKey(base64.decodeBuffer(keyValue));
                  des.setIv(base64.decodeBuffer("zz7cZtYpVR4="));

                  baOutPlaintext = des.decrypt(base64.decodeBuffer(new String(content).trim()));
                  ibfo.updateFileMess(attvo.getPk_da_att(), baOutPlaintext, "content");

                  attvo.setAfter_ca(1);
                  // 设置文档解密状态
                  dao.updateVO(attvo, new String[] {"after_ca"});
                } catch (Exception ex) {
                  // TODO Auto-generated catch block
                  logger.error(ex.getMessage(), ex);
                  return "文件解密失败";
                  /*throw new LfwRuntimeException("文件解密失败");*/
                }
              }
            }
          }
        }
      } catch (Exception e) {
        logger.error(e.getMessage(), e);
        return "文件解密失败";
        /*throw new LfwRuntimeException("文件解密失败");*/
      }
    }
    return "ok";
  }

  // 季凌峰 2012/12-26  开启价格 当点开启价格时如果返回开启成功则
  // 对报价进行解密
  public String doPriceOpen() throws LfwBusinessException, Exception {
    WebContext ctx = getWebContext();
    String open_pk = ctx.getParameter("pk_xy_open").toString();
    String opensource = ctx.getParameter("opensource");

    // 开启功能的逻辑控制判断

    String result = ((OpenDelegator) this.billHandler).doPriceOpen(open_pk, opensource);
    String pk_xy_proj_item_sup_cfm = this.getWebContext().getParameter("pk_xy_proj_item_sup_cfm");
    String pk_xy_pub_step = this.getWebContext().getParameter("pk_xy_pub_step");
    String pk_xy_proj_main = this.getWebContext().getParameter("projectPk");

    if (result == "ok") { // 如果开启成功则 进行 报价解密

      // -季凌峰 附件解密2013 1- 5 开启价格

      loupadate(opensource, pk_xy_proj_main, pk_xy_pub_step, "1");
      Opricejm(opensource, pk_xy_proj_main, pk_xy_pub_step, pk_xy_proj_item_sup_cfm); // 价格解密

    } else {
      return result;
    }

    return "成功开启";
  }

  public String Opricejm(
      String opensource,
      String pk_xy_proj_main,
      String pk_xy_pub_step,
      String pk_xy_proj_item_sup_cfm)
      throws Exception {

    String sqlWhere =
        "  pk_xy_proj_item_sup_cfm='"
            + pk_xy_proj_item_sup_cfm
            + "' and pk_xy_proj_main='"
            + pk_xy_proj_main
            + "' and ISNULL(dr,0) = 0 ";

    BaseDAO dao = new BaseDAO();
    // 查询本采购环节发标环节主键
    String pubstrwhere =
        "pk_xy_proj_main='"
            + pk_xy_proj_main
            + "' and  step_type="
            + EbsOperaitonConst.OPERATION_PUR_STEP_SENDBID
            + " and isnull(dr,0)=0 ";
    Collection<StepPubEntityVO> pubcol = dao.retrieveByClause(StepPubEntityVO.class, pubstrwhere);
    StepPubEntityVO[] pubvo = null;
    pubvo = new StepPubEntityVO[pubcol.size()];
    pubvo = pubcol.toArray(pubvo);
    if (pubvo != null && pubvo.length > 0) {
      // 发布应答的开启

      if ("0".equals(opensource)) {

        // 发布环节的报价详细
        //	sqlWhere +=" and pk_xy_step_pub !='"+pubvo[0].getPk_xy_step_pub()+"' ";
      } else {
        // 发标环节的报价详细
        sqlWhere += " and pk_xy_step_pub ='" + pubvo[0].getPk_xy_step_pub() + "' ";
      }
    }

    if (pk_xy_pub_step != null && !"null".equals(pk_xy_pub_step)) {

      sqlWhere += " and pk_xy_step_pub ='" + pk_xy_pub_step + "' ";
    }

    String orderBy = " current_price_count";
    ProjSupQuoteVO[] svo = null;
    NCObject[] ncobjects = null;
    int current_count = 0;
    Collection<ProjSupQuoteVO> collection =
        dao.retrieveByClause(ProjSupQuoteVO.class, sqlWhere, orderBy);
    if (collection != null && collection.size() > 0) {
      ArrayList<ProjSupQuoteVO> projSupQuoteVOs = new ArrayList<ProjSupQuoteVO>();
      ArrayList<ProjSupQuoteVO> currentCountVOs = new ArrayList<ProjSupQuoteVO>();
      svo = new ProjSupQuoteVO[collection.size()];
      svo = collection.toArray(svo);
      // 进行解密
      for (int i = 0; i < svo.length; i++) {
        EncrypteDecrypte3DES des = new EncrypteDecrypte3DES();
        BASE64Decoder base64 = new BASE64Decoder();
        try {
          des.setKey(base64.decodeBuffer("EpzmL6tl+uvu70nG0gbaBEG0GhUlcjIb"));
          des.setIv(base64.decodeBuffer("zz7cZtYpVR4="));
          // byte[] discounted_unit_price_encrypt =des.decrypt(base64.decodeBuffer(new
          // String(svo[i].getDiscounted_unit_price_encrypt().getBytes())));
          // byte[] discounted_encrypt =des.decrypt(base64.decodeBuffer(new
          // String(svo[i].getDiscount_encrypt().getBytes())));
          if (svo[i].getDiscounted_amount_encrypt() != null) {
            byte[] discounted_amount_encrypt =
                des.decrypt(
                    base64.decodeBuffer(
                        new String(svo[i].getDiscounted_amount_encrypt().getBytes())));

            // svo[i].setDiscounted_unit_price(new UFDouble(new
            // String(discounted_unit_price_encrypt)));
            // svo[i].setDiscount(new UFDouble(new String(discounted_encrypt)));
            try {
              svo[i].setDiscounted_amount(
                  new UFDouble(new String(discounted_amount_encrypt).trim()));
            } catch (Exception e) {

            }
          }

          svo[i].setPrice_count(String.valueOf(svo[i].getCurrent_price_count()));

          if (svo[i].getCata_unit_price_encrypt() != null) {

            byte[] cata_unit_price_encrypt =
                des.decrypt(
                    base64.decodeBuffer(
                        new String(svo[i].getCata_unit_price_encrypt().getBytes())));

            try {
              svo[i].setCata_unit_price(new UFDouble(new String(cata_unit_price_encrypt).trim()));
            } catch (Exception e) {

            }
          }

        } catch (IOException e) {
          // TODO Auto-generated catch block
          Logger.error("报价明细解密失败!");
          Logger.error(e.getMessage(), e);
        }
      }

      dao.updateVOArray(svo, new String[] {"cata_unit_price", "discounted_amount"});
    }
    return "ok";
  }

  // 季凌峰 2012/12-26  开启价格 当点开启非价格时如果返回开启成功则
  // 对附件进行解密
  public String doNoPriceOpen() throws LfwBusinessException {
    WebContext ctx = getWebContext();
    String pk_xy_proj_main = this.getWebContext().getParameter("projectPk");
    String open_pk = ctx.getParameter("pk_xy_open").toString();
    String opensource = ctx.getParameter("opensource");

    String pk_xy_pub_step = this.getWebContext().getParameter("pk_xy_pub_step");

    // 开启功能的逻辑控制判断

    String result = ((OpenDelegator) this.billHandler).doNoPriceOpen(open_pk, opensource);

    if (result == "ok") {
      String a = loupadate(opensource, pk_xy_proj_main, pk_xy_pub_step, "2");
      if (a == "ok") {
        return "开启成功";
      } else {
        throw new LfwRuntimeException("解密失败");
      }

    } else {
      return result;
    }
  }

  public String isDutyPerson() throws LfwBusinessException {
    WebContext ctx = getWebContext();
    String open_pk = ctx.getParameter("projectPk").toString();

    // 获得当前登录人ID
    String loginUserId = LfwRuntimeEnvironment.getUserVO().getPrimaryKey();
    // 开启功能的逻辑控制判断

    String personPk = ((OpenDelegator) this.billHandler).isDutyPerson(open_pk);

    if (loginUserId.equals(personPk)) {
      return "Y";
    } else {
      return "N";
    }
  }

  private String addDrWhere(String where) {
    // if(true)
    // return null;
    if (where == null) where = "";

    if (where.equals("")) where = " ISNULL(dr, 0)=0";
    else where += " AND ISNULL(dr, 0)=0";
    return where;
  }

  /**
   * 判断供应商是否明细 wangzhenzhou
   *
   * @author:zhenglq <br>
   * @datetime:2009-12-02上午19:09:23
   * @param list
   * @return
   */
  public String isItem() {
    return getDelegator().isItem();
  }

  private OpenDelegator getDelegator() {
    OpenDelegator delegator = (OpenDelegator) this.billHandler;
    return delegator;
  }

  /**
   * 判断是否上传文件
   *
   * @return
   */
  public String isupload() {
    return getDelegator().isupload();
  }

  /**
   * 判断是否有报价说明
   *
   * @return
   */
  public String isQuoteOther() {
    return getDelegator().isQuoteOther();
  }

  /**
   * 打开附件
   *
   * @return
   */
  public String cafileproce() {
    return getDelegator().cafileproce();

    //		return null;
  }

  /** 签到 */
  // ----------------------
  public String sdbSyn() throws LfwBusinessException {
    WebContext ctx = getWebContext();
    String pk_xy_step_pub = ctx.getParameter("pk_xy_step_pub");
    String pk_xy_proj_main = ctx.getParameter("pk_xy_proj_main");
    String success = "ok";
    String operatorID = LfwRuntimeEnvironment.getUserVO().getPrimaryKey();

    BaseDAO dao = new BaseDAO();
    try {
      String sqlb =
          "select * from ebs_xy_projexec_personjzx  where ( discard_status != '3' or discard_status is null ) and  zdy3 ='"
              + pk_xy_step_pub
              + "' and pk_person in "
              + "(select pk_psndoc from bd_psndoc where pk_psnbasdoc in "
              + "(select pk_psndoc from sm_userandclerk where userid  = '"
              + operatorID
              + "'))";
      List<ProjGroupVO> listb =
          (List<ProjGroupVO>) dao.executeQuery(sqlb, new BeanListProcessor(ProjGroupVO.class));

      if (listb != null && listb.size() > 0) {
        ProjGroupVO pcg = listb.get(0);
        String judgment = pcg.getZdy1();
        if ("是".equals(judgment)) {
          success = "N";
        } else {
          pcg.setZdy1("是");
          dao.updateVO(pcg, new String[] {"zdy1"});
        }

      } else {
        success = "你不属于采购小组人员或者采购小组人员变化了,请重新打开采购执行界面!";
      }
    } catch (Exception e) {
      Logger.error("签到失败");
      Logger.error(e.getMessage(), e);
      success = "签到失败";
    }

    return success;
  }

  /** 同意开启 */
  // ---------------
  public String agree() throws LfwBusinessException {
    WebContext ctx = getWebContext();
    String pk_xy_step_pub = ctx.getParameter("pk_xy_step_pub");
    String pk_xy_proj_main = ctx.getParameter("pk_xy_proj_main");

    String success = "ok";
    String operatorID = LfwRuntimeEnvironment.getUserVO().getPrimaryKey();

    BaseDAO dao = new BaseDAO();
    try {
      String sqlb =
          "select * from ebs_xy_projexec_personjzx  where ( discard_status != '3' or discard_status is null ) and  zdy3 ='"
              + pk_xy_step_pub
              + "' and pk_person in "
              + "(select pk_psndoc from bd_psndoc where pk_psnbasdoc in "
              + "(select pk_psndoc from sm_userandclerk where userid  = '"
              + operatorID
              + "'))";
      List<ProjGroupVO> listb =
          (List<ProjGroupVO>) dao.executeQuery(sqlb, new BeanListProcessor(ProjGroupVO.class));

      String sqld =
          "select * from ebs_xy_projexec_personjzx  where ( discard_status != '3' or discard_status is null ) and zdy3 = '"
              + pk_xy_step_pub
              + "' and pk_xy_proj_main ='"
              + pk_xy_proj_main
              + "' and pk_person in "
              + "(select pk_psndoc from bd_psndoc where pk_psnbasdoc in "
              + "(select pk_psndoc from sm_userandclerk where userid  in "
              + "(select operatorid from ebs_xy_proj_main where pk_xy_proj_main ='"
              + pk_xy_proj_main
              + "')))";

      List<ProjGroupVO> listd =
          (List<ProjGroupVO>) dao.executeQuery(sqld, new BeanListProcessor(ProjGroupVO.class));

      if (listb != null && listb.size() > 0) {
        ProjGroupVO pcg = listb.get(0);
        String judgment = pcg.getZdy1();
        if (!listd.get(0).getPk_person().equals(pcg.getPk_person())) {
          if ("是".equals(listd.get(0).getZdy2())) {
            if ("是".equals(pcg.getZdy2())) {
              success = "NO";
              return success;
            } else {
              if ("是".equals(judgment)) {
                pcg.setZdy2("是");
                dao.updateVO(pcg, new String[] {"zdy2"});
              } else {
                success = "N";
              }
            }
          } else {
            success = "operNO";
            return success;
          }
        } else {
          if ("是".equals(pcg.getZdy2())) {
            success = "NO";
            return success;
          } else {
            if ("是".equals(judgment)) {
              pcg.setZdy2("是");
              dao.updateVO(pcg, new String[] {"zdy2"});
            } else {
              success = "N";
            }
          }
        }

      } else {
        success = "你不属于采购小组人员或者采购小组人员变化了,请重新打开采购执行界面!";
      }
    } catch (Exception e) {
      Logger.error("同意开启失败");
      Logger.error(e.getMessage(), e);
      success = "同意开启失败";
    }

    return success;
  }

  // 季凌峰 2012/11/5 采购方案执行 询价 查询状态为已经完成的数据
  public String dealbutton() throws DAOException {
    BaseDAO dao = new BaseDAO();
    String pk_xy_proj_main = getWebContext().getParameter("pk_xy_proj_main");
    String dosql =
        "select * from ebs_xy_step_exec_state  s  where s.step_id='3'  and  pk_xy_proj_main='"
            + pk_xy_proj_main
            + "' ";

    List<StepExecStateVO> dofines =
        (List<StepExecStateVO>)
            dao.executeQuery(dosql, new BeanListProcessor(StepExecStateVO.class));
    if (dofines != null) {
      if ("2".equals(dofines.get(0).getStep_status().toString())) {
        return "Y";
      }
    }
    return null;
  }
}
コード例 #3
0
 @Override
 public void init(ServletConfig config) throws ServletException {
   super.init(config);
   logger = LoggerManager.getLogger(ImportExcelBodyData.class);
 }