/** 查询二级营销案审核列表 创建日期:2013-11-1下午4:58:48 修改日期: 作者:zhanglu TODO return */
  public HandlerResult queryReservationMarketSecondAuditList(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();
    String city = userInfoBean.getUserAreaCode();
    try {
      Page page = reservationMarketSecondService.queryReservationMarketSecondAuditList(param);

      List<ReservationMarketSecondBean> reservationSecondlist =
          (List<ReservationMarketSecondBean>) page.getRecords();
      List<ReservationMarketSecondBean> newList = new ArrayList<ReservationMarketSecondBean>();
      if (reservationSecondlist != null && reservationSecondlist.size() > 0) {
        for (int i = 0; i < reservationSecondlist.size(); i++) {
          ReservationMarketSecondBean rmsbean =
              (ReservationMarketSecondBean) reservationSecondlist.get(i);
          String verifySate = rmsbean.getVerifyState();
          if ("0".equals(verifySate)) {
            String auditAlink =
                "待审核<a href='javascript:component.updateListView(1);' title='点击审核通过'><img src='../../../resource/img/toggle_enabled.gif'/></a>";
            auditAlink +=
                "<a href='javascript:component.updateListView(2);' title='点击审核不通过'><img src='../../../resource/img/toggle_disabled.gif'/></a>";
            rmsbean.setLinkOper(auditAlink);
          } else if ("1".equals(verifySate)) {
            String auditAlink =
                "审核通过<a href='javascript:component.updateListView(2)' title='点击审核不通过'><img src='../../../resource/img/toggle_disabled.gif'/></a>";
            rmsbean.setLinkOper(auditAlink);
          } else if ("2".equals(verifySate)) {
            String auditAlink =
                "审核不通过<a href='javascript:component.updateListView(1)' title='点击审核通过'><img src='../../../resource/img/toggle_enabled.gif'/></a>";
            rmsbean.setLinkOper(auditAlink);
          }
          String viewOper =
              "<a href='javascript:component.viewOper(\""
                  + rmsbean.getMarketSecondPkId()
                  + "\",\""
                  + rmsbean.getMarketFirstName()
                  + "\")'; title='点击查看详细信息'>预览</a>";
          rmsbean.setViewOper(viewOper);
          newList.add(rmsbean);
        }
        page.setRecords(newList);
      }

      result.setRetObj(page);
      result.setRetCode(IResultCode.SYS_SUCCESS);
    } catch (Exception e) {
      e.printStackTrace();
      result.setRetCode(IResultCode.SYS_FAILED);
    }
    return result;
  }
Exemplo n.º 2
0
  /**
   * 品牌查询
   *
   * @param context brandName,brandNum,jb
   * @return
   * @author zhangel
   */
  public HandlerResult queryBrandList(HandlerRequestContext context) {
    HandlerResult result = HandlerResult.newInstance();
    HttpServletRequest request = context.getRequest();
    Map<String, String> param = BeanUtil.getMapFromRequest(request);

    try {
      Page page = brandService.queryBrandList(param);
      result.setRetObj(page);
      result.setRetCode(IResultCode.SYS_SUCCESS);
    } catch (Exception e) {
      result.setRetCode(IResultCode.SYS_FAILED);
    }
    return result;
  }
  /**
   * 省级、地市审核列表 创建日期:2013-12-17下午7:57:59 修改日期: 作者:zhanglu
   *
   * @param:
   * @return:HandlerResult
   */
  public HandlerResult queryMarketSecondForVerify(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();

    String city = userInfoBean.getUserAreaCode();
    if (StringUtil.isNull(city)) {
      //			city = userInfoBean.getUserAreaCode();
    }
    if ("0".equals(city)) { // 0 为江苏省
      city = "";
      param.put("proManager", "1");
    } else {
      param.put("cityManager", "1");
    }
    //		param.put("city", city);
    String channelNum = userInfoBean.getChannelNum();
    if (channelNum != null && !"".equals(channelNum)) {
      // 掌厅
      if ("02".equals(channelNum)) {
        channelNum = "5";
      }
      // 网厅
      if ("01".equals(channelNum)) {
        channelNum = "4";
      }
      // 短厅
      if ("03".equals(channelNum)) {
        channelNum = "6";
      }
      // 全渠道
      if ("0".equals(channelNum)) {
        channelNum = param.get("channalData");
      }
      param.put("channalData", channelNum);
    }
    try {
      Page page = reservationMarketSecondService.queryMarketForAudit(param);
      result.setRetObj(page);
      result.setRetCode(IResultCode.SYS_SUCCESS);
      result.setSysCode(SystemCodeConstants.QUERY_INFO_SUCCEED);
    } catch (Exception e) {
      e.printStackTrace();
      result.setRetCode(IResultCode.SYS_FAILED);
      result.setSysCode(SystemCodeConstants.QUERY_INFO_ERROR);
    }
    return result;
  }
Exemplo n.º 4
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;
  }
Exemplo n.º 5
0
  /**
   * 添加品牌
   *
   * @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;
  }
Exemplo n.º 6
0
  /**
   * 更改方案状态 创建日期: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;
  }
Exemplo n.º 7
0
  /**
   * 品牌查询 brandName,brandNum,jb(可传入以","分开的jb)
   *
   * @param context
   * @return
   * @author zhangel
   */
  public HandlerResult queryBrandListEx(HandlerRequestContext context) {
    HandlerResult result = HandlerResult.newInstance();
    HttpServletRequest request = context.getRequest();
    Map<String, Object> param = BeanUtil.getMapFromRequestAdn(request);

    try {
      String jb = (String) param.get("jb");
      if (StringUtils.isNotBlank(jb)) {
        param.put("jb", jb.split(","));
      }
      List<BrandBean> brandBeans = brandService.queryBrandListEx(param);
      result.setRetObj(brandBeans);
      result.setRetCode(IResultCode.SYS_SUCCESS);
    } catch (Exception e) {
      result.setRetCode(IResultCode.SYS_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-10-25下午5:51:20 修改日期: 作者:zhanglu TODO return */
 public HandlerResult queryReservationMarketSecondList(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();
   String city = userInfoBean.getUserAreaCode();
   param.put("city", city);
   // 查询有效的,即未删除的营销案
   param.put("state", "1");
   try {
     Page page = reservationMarketSecondService.queryReservationMarketSecondList(param);
     List<ReservationMarketSecondBean> reservationSecondlist =
         (List<ReservationMarketSecondBean>) page.getRecords();
     List<ReservationMarketSecondBean> newList = new ArrayList<ReservationMarketSecondBean>();
     if (reservationSecondlist != null && reservationSecondlist.size() > 0) {
       for (int i = 0; i < reservationSecondlist.size(); i++) {
         ReservationMarketSecondBean rmsbean =
             (ReservationMarketSecondBean) reservationSecondlist.get(i);
         String isViewList = rmsbean.getIsListView();
         if ("0".equals(isViewList)) {
           String isViewAlink =
               "<a href='javascript:component.updateListView();' title='点击更新为在列表中展示'>未展示<img src='../../../resource/img/toggle_enabled.gif'/></a>";
           rmsbean.setLinkOper(isViewAlink);
         } else {
           String isViewAlink =
               "<a href='javascript:component.updateListView()' title='点击更新为在列表中不展示'>展示<img src='../../../resource/img/toggle_disabled.gif'/></a>";
           rmsbean.setLinkOper(isViewAlink);
         }
         newList.add(rmsbean);
       }
       page.setRecords(newList);
     }
     result.setRetObj(page);
     result.setRetCode(IResultCode.SYS_SUCCESS);
   } catch (Exception e) {
     e.printStackTrace();
     result.setRetCode(IResultCode.SYS_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;
  }
Exemplo n.º 11
0
 /**
  * 查询楼层方案信息 创建日期: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;
 }
  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;
  }