/** * 发布方案 创建日期: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; }
/** * 创建楼层方案 创建日期: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; }
/** * 更改方案状态 创建日期:2013-11-29下午4:30:25 修改日期: 作者:zhanglu * * @param: * @return:HandlerResult */ public HandlerResult changeState(HandlerRequestContext context) { HandlerResult result = HandlerResult.newInstance(); HttpServletRequest request = context.getRequest(); Map<String, String> param = BeanUtil.getMapFromRequest(request); try { floorPlanService.changeState(param); result.setRetCode(IResultCode.SYS_SUCCESS); result.setSysCode(SystemCodeConstants.UPDATE_INFO_SUCCEED); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); result.setRetCode(IResultCode.SYS_FAILED); result.setSysCode(SystemCodeConstants.UPDATE_INFO_FAILED); } return result; }
/** * 根据主键查看楼层方案 创建日期:2013-11-26下午6:42:32 修改日期: 作者:zhanglu * * @param: * @return:HandlerResult */ public HandlerResult queryFloorPlanByPkId(HandlerRequestContext context) { HandlerResult result = HandlerResult.newInstance(); HttpServletRequest request = context.getRequest(); String planId = request.getParameter("planId"); try { List<FloorPlanBean> floorPlanBeanList = floorPlanService.queryFloorPlanByPk(planId); result.setRetObj(floorPlanBeanList); result.setRetCode(IResultCode.SYS_SUCCESS); result.setSysCode(SystemCodeConstants.QUERY_INFO_SUCCEED); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); result.setRetCode(IResultCode.SYS_FAILED); result.setSysCode(SystemCodeConstants.QUERY_INFO_FAILED); } return result; }
/** * 查询楼层方案信息 创建日期:2013-11-26下午4:10:12 修改日期: 作者:zhanglu * * @param: * @return:HandlerResult */ public HandlerResult queryFloorPlan(HandlerRequestContext context) { HandlerResult result = HandlerResult.newInstance(); HttpServletRequest request = context.getRequest(); Map<String, String> param = BeanUtil.getMapFromRequest(request); LoginRequestBean loginReqBean = (LoginRequestBean) request.getAttribute("reqParams"); UserInfoBean userInfoBean = SSOUtil.checkSSOState(loginReqBean, request).getUserInfoBean(); if (!"0".equals(userInfoBean.getUserAreaCode())) { param.put("userAreaCode", userInfoBean.getUserAreaCode()); } try { Page page = floorPlanService.queryFloorPlan(param); result.setRetObj(page); result.setRetCode(IResultCode.SYS_SUCCESS); result.setSysCode(SystemCodeConstants.QUERY_INFO_SUCCEED); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); result.setRetCode(IResultCode.SYS_FAILED); result.setSysCode(SystemCodeConstants.QUERY_INFO_FAILED); } return result; }