Exemplo n.º 1
0
 /**
  * 根据ID查询下一条,上一条短信详细
  *
  * @return
  */
 @Action(
     value = "followPage",
     results = {
       @Result(name = SUCCESS, location = "/sms/smssend/jsp/hadsend_content.jsp"),
       @Result(name = ERROR, location = "/error.jsp")
     })
 public String followPage() {
   if (!StringUtil.isEmpty(selectedId) && pageDirect != null) {
     entityMap = new HashMap<String, Object>();
     try {
       HashMap<String, Object> followPage = new HashMap<String, Object>();
       if (pageDirect == 0) {
         followPage.put("frontPage", Long.valueOf(selectedId));
       } else {
         followPage.put("nextPage", Long.valueOf(selectedId));
       }
       MbnSmsOperationClass smsOperationClass =
           mbnSmsOperationClassService.findByCoding(operationId);
       followPage.put("operationId", smsOperationClass.getId());
       if (!StringUtil.isEmpty(batchId)) {
         followPage.put("batchId", Long.valueOf(batchId));
       }
       Users u = (Users) super.getSession().getAttribute(ApSmsConstants.SESSION_USER_INFO);
       followPage.put("merchantPin", u.getMerchantPin());
       List<MbnSmsHadSendVO> smsList = mbnSmsHadSendService.followPage(followPage);
       if (!smsList.isEmpty()) {
         mbnSmsHadSendVO = smsList.get(0);
       } else {
         mbnSmsHadSendVO = mbnSmsHadSendService.queryByPk(Long.valueOf(selectedId));
         hasFollow = false;
       }
       // Long batchId, Long mPin, Long createBy
       // 设定只查询自己发送的信息
       boolean isQuerySelf = false;
       Long createBy = null;
       if (!StringUtils.isBlank(
           WebUtils.getPropertyByName(
               com.leadtone.mas.admin.common.ApSmsConstants.QUERYSELFINFO))) {
         isQuerySelf =
             Boolean.valueOf(
                 WebUtils.getPropertyByName(
                     com.leadtone.mas.admin.common.ApSmsConstants.QUERYSELFINFO));
         if (isQuerySelf
             && u.getUserType()
                 == com.leadtone.mas.admin.common.ApSmsConstants.USER_TYPE_ENTERPRISE_NORMAL) {
           createBy = u.getId();
         }
       }
       smsHadSendList =
           mbnSmsHadSendService.getByBatchId(
               mbnSmsHadSendVO.getBatchId(), u.getMerchantPin(), createBy);
       return SUCCESS;
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
   return ERROR;
 }
Exemplo n.º 2
0
 /**
  * 根据ID查询短信详细
  *
  * @return
  */
 @Action(
     value = "getSmsDetails",
     results = {
       @Result(name = SUCCESS, location = "/sms/smssend/jsp/hadsend_content.jsp"),
       @Result(name = ERROR, location = "/error.jsp")
     })
 public String getSmsDetails() {
   String result = SUCCESS;
   if (!StringUtil.isEmpty(selectedId)) {
     try {
       mbnSmsHadSendVO = mbnSmsHadSendService.queryByPk(Long.parseLong(selectedId));
       Users u = (Users) super.getSession().getAttribute(ApSmsConstants.SESSION_USER_INFO);
       // Long batchId, Long mPin, Long createBy
       // 设定只查询自己发送的信息
       boolean isQuerySelf = false;
       Long createBy = null;
       if (!StringUtils.isBlank(
           WebUtils.getPropertyByName(
               com.leadtone.mas.admin.common.ApSmsConstants.QUERYSELFINFO))) {
         isQuerySelf =
             Boolean.valueOf(
                 WebUtils.getPropertyByName(
                     com.leadtone.mas.admin.common.ApSmsConstants.QUERYSELFINFO));
         if (isQuerySelf
             && u.getUserType()
                 == com.leadtone.mas.admin.common.ApSmsConstants.USER_TYPE_ENTERPRISE_NORMAL) {
           createBy = u.getId();
         }
       }
       smsHadSendList =
           mbnSmsHadSendService.getByBatchId(
               mbnSmsHadSendVO.getBatchId(), u.getMerchantPin(), createBy);
     } catch (Exception e) {
       e.printStackTrace();
       result = ERROR;
     }
   }
   return result;
 }
Exemplo n.º 3
0
 @Action(
     value = "getBatchSms",
     results = {
       @Result(name = SUCCESS, location = "/sms/smssend/jsp/hadsend_result_details.jsp"),
       @Result(name = ERROR, location = "/error.jsp")
     })
 public String getBatchSms() {
   if (!StringUtil.isEmpty(batchId)) {
     try {
       Users u = (Users) super.getSession().getAttribute(ApSmsConstants.SESSION_USER_INFO);
       // Long batchId, Long mPin, Long createBy
       // 设定只查询自己发送的信息
       boolean isQuerySelf = false;
       Long createBy = null;
       if (!StringUtils.isBlank(
           WebUtils.getPropertyByName(
               com.leadtone.mas.admin.common.ApSmsConstants.QUERYSELFINFO))) {
         isQuerySelf =
             Boolean.valueOf(
                 WebUtils.getPropertyByName(
                     com.leadtone.mas.admin.common.ApSmsConstants.QUERYSELFINFO));
         if (isQuerySelf
             && u.getUserType()
                 == com.leadtone.mas.admin.common.ApSmsConstants.USER_TYPE_ENTERPRISE_NORMAL) {
           createBy = u.getId();
         }
       }
       smsHadSendList =
           mbnSmsHadSendService.getByBatchId(Long.valueOf(batchId), u.getMerchantPin(), createBy);
       if (!smsHadSendList.isEmpty()) {
         smsSendResult = new HashMap<String, Integer>();
         smsSendResult.put("success", 0);
         smsSendResult.put("failure", 0);
         smsSendResult.put("sending", 0);
         smsSendResult.put("cancel", 0);
         smsSendResult.put("waiting", 0);
         smsSendResult.put("totails", smsHadSendList.size());
         for (int i = 0; i < smsHadSendList.size(); i++) {
           MbnSmsHadSend temp = smsHadSendList.get(i);
           switch (temp.getSendResult()) {
             case -1:
               smsSendResult.put("cancel", smsSendResult.get("cancel") + 1);
               break;
             case 0:
               smsSendResult.put("waiting", smsSendResult.get("waiting") + 1);
               break;
             case 1:
               smsSendResult.put("sending", smsSendResult.get("sending") + 1);
               break;
             case 2:
               smsSendResult.put("success", smsSendResult.get("success") + 1);
               break;
             case 3:
               smsSendResult.put("failure", smsSendResult.get("failure") + 1);
               break;
           }
         }
       }
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
   return SUCCESS;
 }