@Override
 public void initTemplate(CpGzTemplateVO templateVo) throws TplBusinessException {
   try {
     BaseDAO dao = new BaseDAO();
     dao.insertVO(templateVo);
   } catch (DAOException e) {
     LfwLogger.error(e);
     throw new TplBusinessException(e.getMessage(), e);
   }
 }
Beispiel #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;
  }