/** * 创建楼层方案 创建日期: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; }
/** * 添加品牌 * * @param context * @return */ public HandlerResult saveBrand(HandlerRequestContext context) { HandlerResult result = HandlerResult.newInstance(); HttpServletRequest request = context.getRequest(); BrandBean brandBean = (BrandBean) BeanUtil.getBeanFromRequest(request, BrandBean.class); try { brandService.saveBrand(brandBean); result.setRetCode(IResultCode.SYS_SUCCESS); result.setSysCode(SystemCodeConstants.INSERT_INFO_SUCCEED); } catch (Exception e) { result.setRetCode(IResultCode.SYS_FAILED); result.setSysCode(SystemCodeConstants.INSERT_INFO_FAILED); } return result; }
/** 更新二级预约营销案审核状态 创建日期:2013-11-1下午5:00:11 修改日期: 作者:zhanglu TODO return */ public HandlerResult updateAuditState(HandlerRequestContext context) { HandlerResult result = HandlerResult.newInstance(); HttpServletRequest request = context.getRequest(); LoginRequestBean loginReqBean = (LoginRequestBean) request.getAttribute("reqParams"); UserInfoBean userInfoBean = SSOUtil.checkSSOState(loginReqBean, request).getUserInfoBean(); ReservationMarketSecondBean rmarketSecondBean = (ReservationMarketSecondBean) BeanUtil.getBeanFromRequest(request, ReservationMarketSecondBean.class); try { reservationMarketSecondService.updateAuditState(rmarketSecondBean); result.setRetCode(IResultCode.SYS_SUCCESS); result.setSysCode(SystemCodeConstants.UPDATE_INFO_SUCCEED); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); result.setRetCode(IResultCode.SYS_FAILED); result.setSysCode(SystemCodeConstants.UPDATE_INFO_FAILED); } return result; }
/** * 更新二级预约营销案测试状态 创建日期:2013-12-17下午5:24:51 修改日期: 作者:zhanglu * * @param: * @return:HandlerResult */ public HandlerResult updateTestState(HandlerRequestContext context) { HandlerResult result = HandlerResult.newInstance(); HttpServletRequest request = context.getRequest(); ReservationMarketSecondBean marketFirstBean = (ReservationMarketSecondBean) BeanUtil.getBeanFromRequest(request, ReservationMarketSecondBean.class); LoginRequestBean loginReqBean = (LoginRequestBean) request.getAttribute("reqParams"); UserInfoBean userInfoBean = SSOUtil.checkSSOState(loginReqBean, request).getUserInfoBean(); String auditContent = request.getParameter("auditContent"); String channelNum = userInfoBean.getChannelNum(); String verifyState = marketFirstBean.getTestOnlineState(); if (channelNum != null && !"".equals(channelNum)) { // 网厅 if ("01".equals(channelNum) || "4".equals(channelNum)) { marketFirstBean.setWtTestOnlineState(marketFirstBean.getTestOnlineState()); marketFirstBean.setTestOnlineState(null); } // 掌厅 } try { MarketAuditBean marketAuditBean = new MarketAuditBean(); marketAuditBean.setAuditPerson(userInfoBean.getLoginName()); marketAuditBean.setAuditContent(auditContent); marketAuditBean.setAutitState(verifyState); marketFirstBean.setMarketAuditBean(marketAuditBean); reservationMarketSecondService.updateTestState(marketFirstBean); result.setRetCode(IResultCode.SYS_SUCCESS); result.setSysCode(SystemCodeConstants.UPDATE_INFO_SUCCEED); } catch (Exception e) { e.printStackTrace(); result.setRetCode(IResultCode.SYS_FAILED); result.setSysCode(SystemCodeConstants.UPDATE_INFO_FAILED); } return result; }
public HandlerResult updateMarketSecondForVerify(HandlerRequestContext context) { HandlerResult result = HandlerResult.newInstance(); HttpServletRequest request = context.getRequest(); ReservationMarketSecondBean marketSecondBean = (ReservationMarketSecondBean) BeanUtil.getBeanFromRequest(request, ReservationMarketSecondBean.class); LoginRequestBean loginReqBean = (LoginRequestBean) request.getAttribute("reqParams"); UserInfoBean userInfoBean = SSOUtil.checkSSOState(loginReqBean, request).getUserInfoBean(); String auditContent = request.getParameter("auditContent"); String city = userInfoBean.getUserAreaCode(); String verifyState = ""; String auditLevel = ""; if ("0".equals(city)) { // 0 为江苏省 verifyState = request.getParameter("proVerifyState"); auditLevel = "1"; } else { verifyState = request.getParameter("localVerifyState"); auditLevel = "2"; } try { String channelNum = userInfoBean.getChannelNum(); if ("0".equals(city)) { // 0 为江苏省 if (channelNum != null && !"".equals(channelNum)) { // 网厅 if ("01".equals(channelNum) || "4".equals(channelNum)) { marketSecondBean.setWtProVerifyState(verifyState); marketSecondBean.setProVerifyState(null); marketSecondBean.setLocalVerifyState(null); } else if ("02".equals(channelNum) || "5".equals(channelNum)) { marketSecondBean.setWtProVerifyState(null); marketSecondBean.setProVerifyState(verifyState); marketSecondBean.setLocalVerifyState(null); } } } else { if (channelNum != null && !"".equals(channelNum)) { // 网厅 if ("01".equals(channelNum) || "4".equals(channelNum)) { marketSecondBean.setWtLocalVerifyState(verifyState); marketSecondBean.setProVerifyState(null); marketSecondBean.setLocalVerifyState(null); } else if ("02".equals(channelNum) || "5".equals(channelNum)) { marketSecondBean.setWtLocalVerifyState(null); marketSecondBean.setProVerifyState(null); marketSecondBean.setLocalVerifyState(verifyState); } } } MarketAuditBean marketAuditBean = new MarketAuditBean(); marketAuditBean.setAuditPerson(userInfoBean.getLoginName()); marketAuditBean.setAuditContent(auditContent); marketAuditBean.setAutitState(verifyState); marketAuditBean.setAuditLevel(auditLevel); marketSecondBean.setMarketAuditBean(marketAuditBean); reservationMarketSecondService.updateMarketSecondForVerify(marketSecondBean); // 更新二级营销案 result.setRetCode(IResultCode.SYS_SUCCESS); result.setSysCode(SystemCodeConstants.UPDATE_INFO_SUCCEED); } catch (Exception e) { e.printStackTrace(); result.setRetCode(IResultCode.SYS_FAILED); result.setSysCode(SystemCodeConstants.UPDATE_INFO_FAILED); } return result; }
/** 添加二级预约营销案 创建日期:2013-10-29上午11:22:08 修改日期: 作者:zhanglu TODO return */ public HandlerResult addReservationMarketSecond(HandlerRequestContext context) { HandlerResult result = HandlerResult.newInstance(); HttpServletRequest request = context.getRequest(); LoginRequestBean loginReqBean = (LoginRequestBean) request.getAttribute("reqParams"); UserInfoBean userInfoBean = SSOUtil.checkSSOState(loginReqBean, request).getUserInfoBean(); ReservationMarketSecondBean rmarketSecondBean = (ReservationMarketSecondBean) BeanUtil.getBeanFromRequest(request, ReservationMarketSecondBean.class); String remarketsecondPKId = sequenceService.getSequence("RESERVATION_SECOND_PKID_SEQ"); rmarketSecondBean.setMarketSecondPkId(remarketsecondPKId); // 从CRM获取到的礼品信息ID String giftIds = request.getParameter("giftIds"); rmarketSecondBean.setBossGiftId(giftIds); // 从CRM获取到的礼品信息名称 String giftNames = request.getParameter("giftNames"); rmarketSecondBean.setBossGiftName(giftNames); // 从CRM获取到业务信息ID String bisIds = request.getParameter("bisIds"); rmarketSecondBean.setBizCode(bisIds); // 从CRM获取到的业务信息名称 String bisNames = request.getParameter("bisNames"); rmarketSecondBean.setBizName(bisNames); // 从CRM获取到的礼品和业务信息备注 String fBz = request.getParameter("fBz"); rmarketSecondBean.setGiftBinzInfo(fBz); // 二级预约营销案BOSS编码 String fmarketLevel2Boss = request.getParameter("fmarketLevel2Boss"); rmarketSecondBean.setBossSecondCode(fmarketLevel2Boss); rmarketSecondBean.setCity(userInfoBean.getUserAreaCode()); rmarketSecondBean.setCfgUserId(userInfoBean.getLoginName()); // 新建二级预约营销案默认为有效 rmarketSecondBean.setState("1"); // 新建二级预约营销案默认为待审核状态 rmarketSecondBean.setVerifyState("0"); // 省级审核状态默认为待审核:0 rmarketSecondBean.setProVerifyState("0"); // 地市级审核状态默认为待审核:0 rmarketSecondBean.setLocalVerifyState("0"); // 是否是目标用户营销方案默认为否:0 rmarketSecondBean.setIsInGroup("0"); String moneyVal = request.getParameter("moneyVal"); if (StringUtil.isNull(moneyVal)) { moneyVal = "0"; } rmarketSecondBean.setMoneyVal(new BigDecimal(moneyVal)); try { reservationMarketSecondService.addReservationMarketSecond(rmarketSecondBean); 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; }