From cf71570fb38ad1983cd40e65fb09e259e509d2a3 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期一, 06 五月 2024 09:36:45 +0800 Subject: [PATCH] 修改bug --- UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java | 84 ++++++++++++++++++++++------------------- 1 files changed, 45 insertions(+), 39 deletions(-) diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java index 3db4811..945781e 100644 --- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java +++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java @@ -227,13 +227,13 @@ */ @ResponseBody @PostMapping("/api/order/queryMyTravelRecord") - @ApiOperation(value = "获取消费记录", tags = {"用户端-个人中心"}, notes = "") + @ApiOperation(value = "获取消费记录【2.0】", tags = {"用户端-个人中心"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "页码(首页1)", name = "pageNum", required = true, dataType = "int"), @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) - public ResultUtil<List<TravelRecordWarpper>> queryMyTravelRecord(Integer pageNum, Integer size, Integer language, HttpServletRequest request){ + public ResultUtil<TravelRecordWarpper> queryMyTravelRecord(Integer pageNum, Integer size, Integer language, HttpServletRequest request){ try { Integer uid = userInfoService.getUserIdFormRedis(request); if(null == uid){ @@ -260,26 +260,26 @@ for (Map<String, Object> map : list3) { map.put("name", name); } - List<TransactionDetails> transactionDetails = transactionDetailsService.selectList(new EntityWrapper<TransactionDetails>().eq("state", 1) - .eq("type", 1).eq("userType", 1).eq("userId", uid).eq("orderType", 3).like("remark", "%跨城订单取消退款%")); - List<Map<String, Object>> list4 = new ArrayList<>(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - for(TransactionDetails transactionDetails1 : transactionDetails){ - Map<String, Object> map = new HashMap<>(); - map.put("money", transactionDetails1.getMoney()); - map.put("time", DateUtil.conversionFormat(language, sdf.format(transactionDetails1.getInsertTime()))); - map.put("name", "跨城订单取消退款"); - map.put("insertTime", Double.valueOf(transactionDetails1.getInsertTime().getTime() / 1000).intValue()); - list4.add(map); - } +// List<TransactionDetails> transactionDetails = transactionDetailsService.selectList(new EntityWrapper<TransactionDetails>().eq("state", 1) +// .eq("type", 1).eq("userType", 1).eq("userId", uid).eq("orderType", 3).like("remark", "%跨城订单取消退款%")); +// List<Map<String, Object>> list4 = new ArrayList<>(); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); +// for(TransactionDetails transactionDetails1 : transactionDetails){ +// Map<String, Object> map = new HashMap<>(); +// map.put("money", transactionDetails1.getMoney()); +// map.put("time", DateUtil.conversionFormat(language, sdf.format(transactionDetails1.getInsertTime()))); +// map.put("name", "跨城订单取消退款"); +// map.put("insertTime", Double.valueOf(transactionDetails1.getInsertTime().getTime() / 1000).intValue()); +// list4.add(map); +// } list.addAll(maps); -// list.addAll(list1); -// list.addAll(list2); list.addAll(list3); // list.addAll(list4); - List<TravelRecordWarpper> orderWarpper = TravelRecordWarpper.getTravelRecordWarpper(list); - + List<TravelRecordListWarpper> orderWarpper = TravelRecordListWarpper.getTravelRecordWarpper(list); + + double sum = orderWarpper.stream().mapToDouble(TravelRecordListWarpper::getMoney).sum(); + //分页 if(orderWarpper.size() >= (pageNum + 1) * size){ orderWarpper = orderWarpper.subList(pageNum, pageNum + size); @@ -288,7 +288,10 @@ }else{ orderWarpper = new ArrayList<>(); } - return ResultUtil.success(orderWarpper); + TravelRecordWarpper travelRecordWarpper = new TravelRecordWarpper(); + travelRecordWarpper.setList(orderWarpper); + travelRecordWarpper.setTotal(sum); + return ResultUtil.success(travelRecordWarpper); }catch (Exception e){ e.printStackTrace(); return ResultUtil.runErr(); @@ -431,7 +434,7 @@ */ @ResponseBody @PostMapping("/api/order/queryOrderInfo") - @ApiOperation(value = "获取服务中的详情数据【1.0】", tags = {"用户端-服务中"}, notes = "") + @ApiOperation(value = "获取服务中的详情数据【2.0】", tags = {"用户端-服务中"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=同城小件,5=跨城小件)", name = "orderType", required = true, dataType = "int"), @@ -461,16 +464,8 @@ map.put("driverPhone", map.get("telX")); } OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map); -// String driverName = orderInfoWarpper.getDriverName(); -// if(language == 2){ -// driverName = "Master " + driverName.replace("师傅", ""); -// } -// if(language == 3){ -// driverName = "Maître " + driverName.replace("师傅", ""); -// } -// orderInfoWarpper.setDriverName(driverName); - File file = new File(filePath + orderId + "_1.txt"); + File file = new File(filePath + orderId + "_" + orderType + ".txt"); if(file.exists()){ //读取文件(字符流) BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); @@ -1003,21 +998,23 @@ */ @ResponseBody @PostMapping("/api/taxi/complaintService") - @ApiOperation(value = "添加投诉操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") + @ApiOperation(value = "添加投诉操作【2.0】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") @ApiImplicitParams({ + @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(value = "司机id", name = "driverId", required = true, dataType = "int"), @ApiImplicitParam(value = "投诉原因", name = "reason", required = true, dataType = "String"), @ApiImplicitParam(value = "投诉描述", name = "description", required = true, dataType = "String"), @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) - public ResultUtil complaintService(Integer driverId, String reason, String description, Integer language, HttpServletRequest request){ + public ResultUtil complaintService(Integer orderId, Integer orderType, Integer driverId, String reason, String description, Integer language, HttpServletRequest request){ try { Integer uid = userInfoService.getUserIdFormRedis(request); if(null == uid){ return ResultUtil.tokenErr(); } - complaintService.saveData(driverId, reason, description, uid, language); + complaintService.saveData(orderId, orderType, driverId, reason, description, uid, language); return ResultUtil.success(); }catch (Exception e){ e.printStackTrace(); @@ -1084,10 +1081,10 @@ */ @ResponseBody @PostMapping("/api/taxi/queryCoupon") - @ApiOperation(value = "获取支付页面的优惠券列表", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") + @ApiOperation(value = "获取支付页面的优惠券列表", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=小件物流)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") @@ -1182,10 +1179,10 @@ */ @ResponseBody @PostMapping("/api/taxi/orderEvaluate") - @ApiOperation(value = "订单完成后添加评价操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") + @ApiOperation(value = "订单完成后添加评价操作【2.0】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=小件物流)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(value = "评分", name = "fraction", required = true, dataType = "int"), @ApiImplicitParam(value = "评价内容", name = "content", required = false, dataType = "String"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") @@ -1210,6 +1207,11 @@ orderCrossCity.setState(9); orderCrossCityService.updateById(orderCrossCity); break; + case 4: + OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); + orderLogistics.setState(9); + orderLogisticsService.updateById(orderLogistics); + break; } } return resultUtil.getCode() == 200 ? ResultUtil.success() : resultUtil; @@ -1228,10 +1230,10 @@ */ @ResponseBody @PostMapping("/api/taxi/queryRedMoney") - @ApiOperation(value = "评论成功后获取红包金额", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") + @ApiOperation(value = "评论成功后获取红包金额", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), - @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=小件物流)", name = "orderType", required = true, dataType = "int"), @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) public ResultUtil<BaseWarpper> queryRedMoney(Integer orderId, Integer orderType){ @@ -1243,6 +1245,8 @@ return orderTaxiService.queryRedMoney(orderId); case 3: return orderCrossCityService.queryRedMoney(orderId); + case 4: + return orderLogisticsService.queryRedMoney(orderId); } return ResultUtil.success(); }catch (Exception e){ @@ -1261,7 +1265,7 @@ */ @ResponseBody @PostMapping("/api/taxi/shareRedEnvelope") - @ApiOperation(value = "分享成功后添加红包操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") + @ApiOperation(value = "分享成功后添加红包操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), @ApiImplicitParam(value = "订单类型", name = "orderType", required = true, dataType = "int"), @@ -1277,6 +1281,8 @@ return orderTaxiService.shareRedEnvelope(orderId); case 3: return orderCrossCityService.shareRedEnvelope(orderId); + case 4: + return orderLogisticsService.shareRedEnvelope(orderId, language); } return ResultUtil.success(); }catch (Exception e){ -- Gitblit v1.7.1