zoukankan      html  css  js  c++  java
  • web

    直接打印信息到页面
    resultMap.put(Constants.Attrs.ERR_CODE, Constants.Config.STR_500);
    resultMap.put(Constants.Attrs.ERR_MSG, Constants.TipMsg.ORDER_NOT_EXIST);
    response.getWriter().write(JSON.toJSONString(resultMap));

    转发,1个request,
    request.setAttribute(Constants.Attrs.Content, Constants.TipMsg.QRCODE_HAS_USED);
    request.getRequestDispatcher("/alreadyUse.html").forward(request, response);

    重定向 2个request,变地址
    response.sendRedirect("https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appId + "&redirect_uri="+baseServer+"orderInfo/wxpay&response_type=code&scope=snsapi_userinfo&state=" + orderNum ); // + "&connect_redirect=1");

    ModelAndView mv
    mv.addAllObjects(resultMap);
    mv.setViewName("error");
    mv.setViewName("payDetail");

    WebMvcConfigurer 配置HandlerInterceptor拦截器addInterceptors、静态资源映射addResourceHandlers、MultipartConfigElement等

    BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
    out.write(result.get("paySuccess").getBytes());
    out.flush();
    out.close();

    @PostMapping("transact")
    @ApiOperation(value = "办理长租")  , notes =
    @ApiImplicitParams({
            @ApiImplicitParam(name = "longRentCars", value = "长租车辆数组", required = true, example = "[{"carPlatenum":"bgyl","parkingId":"619c2cab357e429d8f8904fb25ae1eb1"},{"carPlatenum":"silasila","parkingId":"619c2cab357e429d8f8904fb25ae1eb1"}]"),
            @ApiImplicitParam(name = "longRentRecord", value = "长租记录数据", required = true, example = "[{"type":1,"rentFee":123,"rentStartTime":"2019-01-10","rentEndTime":"2019-01-10","restDay":30,"area":"北1区","status":1,"parkingId":"619c2cab357e429d8f8904fb25ae1eb1"}]"),
            @ApiImplicitParam(name = "longRentUser", value = "长租用户数据", required = true, example = "[{"key":"longRentUser","value":"{userName:\"张学友\",conNum:\"132456789\"}","description":""}]")
    })
    public RestResponse transactLongRent(String longRentCars, String longRentRecord, String longRentUser) {
        return this.wrap(longRentService.transactLongRent(longRentCars, longRentRecord, longRentUser));
    }
    
     @Override
    public Object transactLongRent(String longRentCars, String longRentRecord, String longRentUser) {
        if (StringUtils.isEmpty(longRentCars) || StringUtils.isEmpty(longRentRecord) || StringUtils.isEmpty(longRentUser)) {
            return "参数不能为空";
        }
        List<LongRentCar> cars = JSON.parseArray(longRentCars, LongRentCar.class);
        List<LongRentRecord> rentRecords = JSON.parseArray(longRentRecord, LongRentRecord.class);
        LongRentUser user = JSON.parseObject(longRentUser, LongRentUser.class);
        if (null == user || StringUtils.isEmpty(user.getUserName())) {
            return "参数无效";
        }
    

    service层
    @Transactional(rollbackFor = Exception.class)

  • 相关阅读:
    ubuntu 安装 redis desktop manager
    ubuntu 升级内核
    Ubuntu 内核升级,导致无法正常启动
    spring mvc 上传文件,但是接收到文件后发现文件变大,且文件打不开(multipartfile)
    angular5 open modal
    POJ 1426 Find the Multiple(二维DP)
    POJ 3093 Margritas
    POJ 3260 The Fewest Coins
    POJ 1837 Balance(二维DP)
    POJ 1337 A Lazy Worker
  • 原文地址:https://www.cnblogs.com/cashew/p/11641684.html
Copyright © 2011-2022 走看看