Exemplo n.º 1
0
  // ----------------------
  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;
  }
Exemplo n.º 2
0
  @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;
  }