Пример #1
0
  /**
   * 发布方案 创建日期:2013-11-29下午4:12:16 修改日期: 作者:zhanglu
   *
   * @param:
   * @return:HandlerResult
   */
  public HandlerResult generateProgram(HandlerRequestContext context) {
    HandlerResult result = HandlerResult.newInstance();
    HttpServletRequest request = context.getRequest();

    LoginRequestBean loginReqBean = (LoginRequestBean) request.getAttribute("reqParams");
    UserInfoBean userInfoBean = SSOUtil.checkSSOState(loginReqBean, request).getUserInfoBean();
    String[] floorids = request.getParameterValues("floorIdArray[]");
    String channelNum = request.getParameter("channelNum");

    Map<String, Object> floorMap = new HashMap<String, Object>();
    floorMap.put("floorids", floorids);
    /** 楼层方案主表 */
    FloorPlanBean floorPlanBean = new FloorPlanBean();
    Timestamp now = new Timestamp(System.currentTimeMillis());
    String planId = sequenceService.getSequence("T_FLOOR_PLAN_SEQ");
    floorPlanBean.setPlanId(planId);
    floorPlanBean.setPlanNum("F_" + planId);
    floorPlanBean.setChannelNum(channelNum);
    floorPlanBean.setCreater(userInfoBean.getLoginName());
    floorPlanBean.setCreateTime(now);
    floorPlanBean.setArrayMap(floorMap);
    // 可用
    floorPlanBean.setState("0");

    try {
      floorPlanService.batchAddFloorPlan(floorPlanBean);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return result;
  }
Пример #2
0
  /**
   * 创建楼层方案 创建日期:2013-11-26下午3:42:22 修改日期: 作者:zhanglu
   *
   * @param:
   * @return:HandlerResult
   */
  @Transactional
  public HandlerResult addFloorPlan(HandlerRequestContext context) {
    HandlerResult result = HandlerResult.newInstance();
    HttpServletRequest request = context.getRequest();

    LoginRequestBean loginReqBean = (LoginRequestBean) request.getAttribute("reqParams");
    UserInfoBean userInfoBean = SSOUtil.checkSSOState(loginReqBean, request).getUserInfoBean();

    FloorFaBean floorFaBean = (FloorFaBean) BeanUtil.getBeanFromRequest(request, FloorFaBean.class);

    String updateFlag = request.getParameter("updateFlag");

    // 区块方案
    String floorBlockFaParam = request.getParameter("floorBlockFaParam");
    List<FloorBlockFaBean> floorBlockFaBeanlist =
        (List<FloorBlockFaBean>) JsonHelper.json2List(floorBlockFaParam, FloorBlockFaBean.class);

    floorFaBean.setFloorBlockFaBeanlist(floorBlockFaBeanlist);
    FloorPlanBean floorPlanBean = new FloorPlanBean();
    Timestamp now = new Timestamp(System.currentTimeMillis());
    String planId = sequenceService.getSequence("T_FLOOR_PLAN_SEQ");
    floorPlanBean.setPlanId(planId);
    floorPlanBean.setPlanNum("F_" + planId);
    floorPlanBean.setChannelNum(floorFaBean.getChannelNum());
    floorPlanBean.setCreater(userInfoBean.getLoginName());
    floorPlanBean.setCreateTime(now);
    floorFaBean.setPlanId(new Long(planId));
    // 可用
    floorPlanBean.setState("0");
    try {
      floorPlanService.addFloorPlan(floorPlanBean);
      String floorId = sequenceService.getSequence("T_FLOOR_DA_SEQ");
      floorFaBean.setFloorId(new Long(floorId));
      // 创建楼层方案
      floorFaService.addFloorFa(floorFaBean);
      for (FloorBlockFaBean floorBlockFaBean : floorBlockFaBeanlist) {
        floorBlockFaBean.setFloorId(floorId);
      }
      // 创建楼层区块方案
      floorBlockFaService.batchInsertBlockFa(floorBlockFaBeanlist);
      result.setRetCode(IResultCode.SYS_SUCCESS);
      result.setSysCode(SystemCodeConstants.INSERT_INFO_SUCCEED);
    } catch (Exception e) {
      // TODO: handle exception
      e.printStackTrace();
      result.setRetCode(IResultCode.SYS_FAILED);
      result.setSysCode(SystemCodeConstants.INSERT_INFO_FAILED);
    }
    return result;
  }