Exemplo n.º 1
0
  /**
   * 保存中继站的日计划填写信息
   *
   * @param planId String 中继站日计划编号
   * @param planPatrolResultBean PlanPatrolResultBean 中继站填写信息
   * @return String 返回执行动作状态编号
   * @throws Exception
   */
  public String insertPlanPatrolResult(String planId, PlanPatrolResultBean planPatrolResultBean)
      throws Exception {
    super.setBaseDao(new PlanPatrolResultDayDAO());
    PlanPatrolResultDay planPatrolResult = new PlanPatrolResultDay();

    if (super.queryExistById(planPatrolResultBean.getTid(), PlanPatrolResultDay.class)) {
      planPatrolResult =
          (PlanPatrolResultDay)
              super.baseDao.load(planPatrolResultBean.getTid(), PlanPatrolResultDay.class);
      Date createDate = planPatrolResult.getCreateDate();
      BeanUtil.objectCopy(planPatrolResultBean, planPatrolResult);
      planPatrolResult.setCreateDate(createDate);
      Object object = super.baseDao.update(planPatrolResult);
      if (object != null) {
        return ExecuteCode.SUCCESS_CODE;
      }
    } else {
      BeanUtil.objectCopy(planPatrolResultBean, planPatrolResult);
      planPatrolResult.setTid(ora.getSeq("PLAN_PATROL_RESULT_DAY", 18));
      planPatrolResult.setCreateDate(new Date());
      Object object = super.baseDao.insert(planPatrolResult);
      if (object != null) {
        return ExecuteCode.SUCCESS_CODE;
      }
    }
    return ExecuteCode.FAIL_CODE;
  }
Exemplo n.º 2
0
 /**
  * 获取单位单位下所有巡检人员的计划模板
  *
  * @param deptid
  * @return
  */
 public List getPatrolStencilList(String deptid) {
   /* 取得所有巡检员信息*/
   String hql = "from PatrolMan  where parentid=:deptid and state is  NULL"; //
   List patrollist = new ArrayList();
   Session session = bdao.getSession();
   Transaction tx = null;
   try {
     PatrolManBean pmb = null;
     tx = session.beginTransaction();
     Query query = session.createQuery(hql);
     query.setParameter("deptid", deptid);
     // query.setParameter("state", "1");
     Iterator it = query.iterate();
     while (it.hasNext()) {
       pmb = new PatrolManBean();
       PatrolMan pm = (PatrolMan) it.next();
       logger.info("巡检组名" + pm.getPatrolName());
       BeanUtil.objectCopy(pm, pmb);
       String hql_stencil = "from  StencilTask where patrolid=:patrolid";
       Query query_st = session.createQuery(hql_stencil);
       query_st.setParameter("patrolid", pm.getPatrolID());
       Iterator it_st = query_st.iterate();
       while (it_st.hasNext()) {
         StencilTaskBean stencil = new StencilTaskBean();
         StencilTask st = (StencilTask) it_st.next();
         BeanUtil.objectCopy(st, stencil);
         pmb.getTemp().add(stencil);
       }
       patrollist.add(pmb);
     }
     return patrollist;
   } catch (Exception e) {
     logger.error(e);
     e.printStackTrace();
     return null;
   }
 }
Exemplo n.º 3
0
  /**
   * 根据日计划编号和中继站编号读取中继站填写信息
   *
   * @param stationId String 中继站编号
   * @param planId String 日计划编号
   * @return PlanPatrolResultBean 返回中继站填写信息
   * @throws Exception
   */
  public PlanPatrolResultBean viewPlanStationResult(String stationId, String planId)
      throws Exception {
    super.setBaseDao(new PlanPatrolResultDayDAO());
    PlanPatrolResultBean planPatrolResultBean = new PlanPatrolResultBean();

    String condition = " and repeater_station_id='" + stationId + "' and plan_id='" + planId + "' ";
    PlanPatrolResultDay planPatrolResult =
        (PlanPatrolResultDay) super.baseDao.find("PlanPatrolResultDay", condition);
    if (planPatrolResult != null) {
      BeanUtil.objectCopy(planPatrolResult, planPatrolResultBean);
      return planPatrolResultBean;
    } else {
      return null;
    }
  }