예제 #1
0
  public void listOrderWSSub(BusinessRequest res) {

    OrderStateDto dto = super.getDto(OrderStateDto.class, res);
    if (StringUtils.isNullOrEmpty(dto.getUserName())) {
      dto.getOrdWebVo().getOperateResult().setResultCode("-1");
      dto.getOrdWebVo().getOperateResult().setResultContent("用户名不能为空");
      return;
    }
    if (StringUtils.isNullOrEmpty(dto.getPassWord())) {
      dto.getOrdWebVo().getOperateResult().setResultCode("-2");
      dto.getOrdWebVo().getOperateResult().setResultContent("密码不能为空");
      return;
    }
    NormalAccount normalAccount = normalAccountService.getNormalAccountByAccount(dto.getUserName());
    if (normalAccount == null) {
      dto.getOrdWebVo().getOperateResult().setResultCode("-3");
      dto.getOrdWebVo().getOperateResult().setResultContent("用户名不存在");
      return;
    }
    if (!normalAccount.getPassword().equals(dto.getPassWord())) {
      dto.getOrdWebVo().getOperateResult().setResultCode("-4");
      dto.getOrdWebVo().getOperateResult().setResultContent("密码不对");
      return;
    }
    if (!normalAccount.getNormalUser().getType().toString().equals("2")) {
      dto.getOrdWebVo().getOperateResult().setResultCode("-5");
      dto.getOrdWebVo().getOperateResult().setResultContent("用户名类型不对");
      return;
    }
    dto.setVendor(normalAccount.getNormalUser().getVendorId());
    dto.setSendFlag("0");
    // 调用对应的service方法
    ordertateService.listOrderWS(dto);
  }
예제 #2
0
  public void recievedMsgSub(BusinessRequest res) {
    OrderStateDto dto = super.getDto(OrderStateDto.class, res);
    OperateResult operateResult = new OperateResult();
    operateResult.setResultCode("-11");
    operateResult.setResultContent("falie");
    dto.setOperateResult(operateResult);

    if (StringUtils.isNullOrEmpty(dto.getUserName())) {
      dto.getOperateResult().setResultCode("-1");
      dto.getOperateResult().setResultContent("用户名不能为空");
      return;
    }
    if (StringUtils.isNullOrEmpty(dto.getPassWord())) {
      dto.getOperateResult().setResultCode("-1");
      dto.getOperateResult().setResultContent("密码不能为空");
      return;
    }
    NormalAccount normalAccount = normalAccountService.getNormalAccountByAccount(dto.getUserName());
    if (normalAccount == null) {
      dto.getOperateResult().setResultCode("-1");
      dto.getOperateResult().setResultContent("用户名或密码错误");
      return;
    }
    if (!normalAccount.getPassword().equals(dto.getPassWord())) {
      dto.getOperateResult().setResultCode("-1");
      dto.getOperateResult().setResultContent("用户名或密码错误");
      return;
    }
    if (!normalAccount.getNormalUser().getType().toString().equals("2")) {
      dto.getOperateResult().setResultCode("-1");
      dto.getOperateResult().setResultContent("用户名或密码错误");
      return;
    }

    if (StringUtils.isNullOrEmpty(dto.getOrderIdStr())) {
      dto.getOperateResult().setResultCode("-1");
      dto.getOperateResult().setResultContent("入参为空");
      return;
    }
    String[] strs = dto.getOrderIdStr().split(BaseConstants.COMMA);
    for (String id : strs) {
      OrderDetail order = commonService.get(OrderDetail.class, Long.valueOf(id));
      if (order == null) {
        dto.getOperateResult().setResultCode("-2");
        dto.getOperateResult().setResultContent("入参无效");
        continue;
      }
      if (order.getOrderVenId().longValue() != normalAccount.getNormalUser().getVendorId()) {
        dto.getOperateResult().setResultCode("-3");
        dto.getOperateResult().setResultContent("入参无效");
        continue;
      }
      if (order.getOrderState().longValue() != 1) {
        dto.getOperateResult().setResultCode("-4");
        dto.getOperateResult().setResultContent("订单状态不对");
        continue;
      }
      order.setOrderSendFlag("1");
      order.setOrderState(2l);
      commonService.saveOrUpdate(order);
      ExeState exeState = new ExeState();
      exeState.setStateId(Long.valueOf(2));
      exeState.setOrdId(order.getOrderId());
      exeState.setRemark("webservice 确认订单");
      exeState.setExedate(new java.sql.Timestamp(new Date().getTime()));
      commonService.saveOrUpdate(exeState);
    }
    if (!dto.getOperateResult().getResultCode().equals("-11")) {
      return;
    }
    dto.getOperateResult().setResultCode("0");
    dto.getOperateResult().setResultContent("success");
  }