| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.util.ALiSendSms; |
| | | import com.stylefeng.guns.modular.system.model.Income; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.ActivityWarpper; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 司机控制器 |
| | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Autowired |
| | | private IOfflineTravelPaymentService offlineTravelPaymentService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | }) |
| | | public ResultUtil checkCaptcha(String phone, String code){ |
| | | try { |
| | | phone = AESUtil.decrypt(phone); |
| | | boolean b = driverService.checkCaptcha(phone, code); |
| | | if(b){ |
| | | Driver driver = driverService.queryByPhone(phone); |
| | | String encrypt = AESUtil.encrypt(phone); |
| | | Driver driver = driverService.queryByPhone(encrypt); |
| | | smsrecordService.saveData(null == driver ? 5 : 8, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"); |
| | | } |
| | | return b ? ResultUtil.success() : ResultUtil.error("验证码无效"); |
| | |
| | | }) |
| | | public ResultUtil<LoginWarpper> registeredDriver_(String phone, String code, String password){ |
| | | try { |
| | | phone = AESUtil.decrypt(phone); |
| | | return driverService.registeredDriver(phone, code, password); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | String templateCode = null; |
| | | switch (type){ |
| | | case 1: |
| | | templateCode = "SMS_229648175";//身份验证 |
| | | templateCode = "SMS_154775435";//身份验证 |
| | | break; |
| | | case 2: |
| | | templateCode = "SMS_229613335";//登录确认 |
| | | templateCode = "SMS_154775434";//登录确认 |
| | | break; |
| | | case 3: |
| | | templateCode = "SMS_229613333";//用户注册 |
| | | templateCode = "SMS_154775432";//用户注册 |
| | | break; |
| | | case 4: |
| | | templateCode = "SMS_229613329";//修改密码 |
| | | templateCode = "SMS_154775431";//修改密码 |
| | | break; |
| | | case 5: |
| | | templateCode = "SMS_229648168";//司机注册成功 |
| | | templateCode = "SMS_194650202";//司机注册成功 |
| | | break; |
| | | case 6: |
| | | templateCode = "SMS_229613326";//司机注册失败 |
| | | templateCode = "SMS_194610237";//司机注册失败 |
| | | break; |
| | | } |
| | | String s = aLiSendSms.sendSms(driver.getPhone(), templateCode, "{}"); |
| | | String phone = AESUtil.decrypt(driver.getPhone()); |
| | | String s = aLiSendSms.sendSms(phone, templateCode, "{}"); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @PostMapping("/api/driver/work") |
| | | @ApiOperation(value = "司机上下班操作", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil work(String type, HttpServletRequest request){ |
| | |
| | | @PostMapping("/api/driver/work2") |
| | | @ApiOperation(value = "司机上下班操作,同时设置接单类型", tags = {"司机端-车载端"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil work2(String type, HttpServletRequest request){ |
| | |
| | | @PostMapping("/api/driver/updateOrders") |
| | | @ApiOperation(value = "设置接单规则", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updateOrders(Integer type, HttpServletRequest request){ |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private IReassignService reassignService; |
| | | |
| | | @Autowired |
| | | private ITimeOutAppealService timeOutAppealService; |
| | | |
| | | @Autowired |
| | | private ITComplaintDeductmoneyService complaintDeductmoneyService; |
| | | |
| | | /** |
| | | * 获取扣款明细 |
| | | * @param pageNum |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | // List<Map<String, Object>> list = driverService.queryPenalties(pageNum, size, uid); |
| | | List<Reassign> list1 = reassignService.selectList(new EntityWrapper<Reassign>().eq("originalDriverId",uid)); |
| | | List<Map<String, Object>> list = driverService.queryPenalties(pageNum, size, uid); |
| | | List<BaseWarpper> data = new ArrayList<>(); |
| | | |
| | | /// 存入改派处罚扣款 |
| | | for (Reassign reassign : list1) { |
| | | for(Map<String, Object> map : list){ |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(reassign.getInsertTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setAmount(reassign.getMoney()); |
| | | baseWarpper.setName("改派处罚"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setAmount(Double.valueOf(String.valueOf(map.get("amount")))); |
| | | baseWarpper.setName(String.valueOf(map.get("name"))); |
| | | baseWarpper.setDay(String.valueOf(map.get("day"))); |
| | | data.add(baseWarpper); |
| | | } |
| | | |
| | | // List<TimeOutAppeal> list2 = timeOutAppealService.selectList(new EntityWrapper<TimeOutAppeal>().eq("driverId",uid)); |
| | | List<OrderLogistics> list2 = orderLogisticsService.selectList(new EntityWrapper<OrderLogistics>().eq("driverId",uid).gt("timeOutMoney",0)); |
| | | for (OrderLogistics timeOutAppeal : list2) { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(timeOutAppeal.getEndServiceTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setName("小件物流超时扣款"); |
| | | baseWarpper.setAmount(timeOutAppeal.getTimeOutMoney()); |
| | | data.add(baseWarpper); |
| | | } |
| | | |
| | | List<TComplaintDeductmoney> list3 = complaintDeductmoneyService.selectList(new EntityWrapper<TComplaintDeductmoney>().eq("driverId",uid)); |
| | | for (TComplaintDeductmoney tComplaintDeductmoney : list3) { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(tComplaintDeductmoney.getCreateTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setName("投诉扣款"); |
| | | baseWarpper.setAmount(tComplaintDeductmoney.getMoney()); |
| | | data.add(baseWarpper); |
| | | } |
| | | |
| | | List<BaseWarpper> collect = data.stream().sorted(Comparator.comparing(BaseWarpper::getDay).reversed()).collect(Collectors.toList()); |
| | | |
| | | List<BaseWarpper> data1 = new ArrayList<>(); |
| | | // 手动分页 |
| | | for (int i=(pageNum-1)*size; i<pageNum*size; i++){ |
| | | if (i < collect.size()){ |
| | | data1.add(collect.get(i)); |
| | | } |
| | | } |
| | | return ResultUtil.success(data1); |
| | | return ResultUtil.success(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | // List<Map<String, Object>> list = driverService.queryActivityIncome(uid, pageNum, size); |
| | | // List<BaseWarpper> data = new ArrayList<>(); |
| | | // for(Map<String, Object> map : list){ |
| | | // BaseWarpper baseWarpper = new BaseWarpper(); |
| | | // baseWarpper.setDay(String.valueOf(null != map.get("time") ? map.get("time") : "")); |
| | | // baseWarpper.setAmount(Double.valueOf(String.valueOf(null != map.get("money") ? map.get("money") : 0))); |
| | | // baseWarpper.setName("活动奖励"); |
| | | // data.add(baseWarpper); |
| | | // } |
| | | |
| | | |
| | | List<Income> list1 = incomeService.selectList(new EntityWrapper<Income>().eq("userType",2).eq("objectId",uid)); |
| | | List<Map<String, Object>> list = driverService.queryActivityIncome(uid, pageNum, size); |
| | | List<BaseWarpper> data = new ArrayList<>(); |
| | | |
| | | /// 存入改派处罚扣款 |
| | | for (Income income : list1) { |
| | | for(Map<String, Object> map : list){ |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(income.getInsertTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setAmount(income.getMoney()); |
| | | if (income.getType() == 1){ |
| | | baseWarpper.setName("活动奖励"); |
| | | data.add(baseWarpper); |
| | | } |
| | | // else if (income.getType() == 2){ |
| | | // baseWarpper.setName("跑单收入"); |
| | | // }else if (income.getType() == 6){ |
| | | // baseWarpper.setName("感谢费"); |
| | | // } |
| | | |
| | | baseWarpper.setDay(String.valueOf(null != map.get("time") ? map.get("time") : "")); |
| | | baseWarpper.setAmount(Double.valueOf(String.valueOf(null != map.get("money") ? map.get("money") : 0))); |
| | | baseWarpper.setName("活动奖励"); |
| | | data.add(baseWarpper); |
| | | } |
| | | |
| | | List<TimeOutAppeal> list2 = timeOutAppealService.selectList(new EntityWrapper<TimeOutAppeal>().eq("driverId",uid)); |
| | | for (TimeOutAppeal timeOutAppeal : list2) { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(timeOutAppeal.getCreateTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setName("小件物流超时退款"); |
| | | if (timeOutAppeal.getState() == 2){ |
| | | baseWarpper.setAmount(timeOutAppeal.getReturnMoney()); |
| | | data.add(baseWarpper); |
| | | } |
| | | } |
| | | |
| | | List<BaseWarpper> collect = data.stream().sorted(Comparator.comparing(BaseWarpper::getDay).reversed()).collect(Collectors.toList()); |
| | | List<BaseWarpper> data1 = new ArrayList<>(); |
| | | // 手动分页 |
| | | for (int i=(pageNum-1)*size; i<pageNum*size; i++){ |
| | | if (i < collect.size()){ |
| | | data1.add(collect.get(i)); |
| | | } |
| | | } |
| | | return ResultUtil.success(data1); |
| | | return ResultUtil.success(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | baseWarpper.setName("跨城小件物流"); |
| | | break; |
| | | } |
| | | |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | |
| | | |
| | | switch (Integer.valueOf(map.get("orderType").toString())){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(map.get("incomeId").toString()); |
| | |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", null != orderPrivateCar.getRoadTollMoney() ? orderPrivateCar.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes.size() > 0 ? incomes.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderPrivateCar.getThankYouFee() ? orderPrivateCar.getThankYouFee() : 0);//感谢费 |
| | | map1.put("returnMoney", 0);//超时退款金额 |
| | | } |
| | | |
| | | break; |
| | |
| | | map1.put("tipMoney", null != orderTaxi.getTipMoney() ? orderTaxi.getTipMoney(): 0);//小费 |
| | | map1.put("roadTollMoney", null != orderTaxi.getRoadTollMoney() ? orderTaxi.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes1.size() > 0 ? incomes1.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderTaxi.getThankYouFee() ? orderTaxi.getThankYouFee() : 0);//感谢费 |
| | | map1.put("returnMoney", 0);//超时退款金额 |
| | | } |
| | | |
| | | break; |
| | |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes2.size() > 0 ? incomes2.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderCrossCity.getThankYouFee() ? orderCrossCity.getThankYouFee() : 0);//感谢费 |
| | | map1.put("returnMoney", 0);//超时退款金额 |
| | | } |
| | | break; |
| | | case 4: |
| | |
| | | map1.put("tipMoney", null != orderLogistics.getTipMoney() ? orderLogistics.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes3.size() > 0 ? incomes3.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderLogistics.getThankYouFee() ? orderLogistics.getThankYouFee() : 0);//感谢费 |
| | | |
| | | |
| | | /// 小件物流超时退款 |
| | | List<Income> list1 = incomeService.selectList(new EntityWrapper<Income>().eq("userType",2) |
| | | .eq("orderType",4).eq("type",9) |
| | | .eq("objectId",orderLogistics.getDriverId()).eq("incomeId",orderLogistics.getId())); |
| | | |
| | | double returnMoney = 0; |
| | | if (ToolUtil.isNotEmpty(list1)){ |
| | | for (Income income : list1) { |
| | | returnMoney += income.getMoney(); |
| | | } |
| | | } |
| | | map1.put("returnMoney", BigDecimal.valueOf(returnMoney).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | break; |
| | | case 5: |
| | |
| | | map1.put("tipMoney", orderLogistics1.getTipMoney());//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes4.size() > 0 ? incomes4.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderLogistics1.getThankYouFee() ? orderLogistics1.getThankYouFee() : 0);//感谢费 |
| | | |
| | | /// 小件物流超时退款 |
| | | List<Income> list1 = incomeService.selectList(new EntityWrapper<Income>().eq("userType",2) |
| | | .eq("orderType",5).eq("type",9) |
| | | .eq("objectId",orderLogistics1.getDriverId()).eq("incomeId",orderLogistics1.getId())); |
| | | |
| | | double returnMoney = 0; |
| | | if (ToolUtil.isNotEmpty(list1)){ |
| | | for (Income income : list1) { |
| | | returnMoney += income.getMoney(); |
| | | } |
| | | } |
| | | map1.put("returnMoney", BigDecimal.valueOf(returnMoney).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | break; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private ITimeOutAppealService appealService; |
| | | |
| | | |
| | | /** |
| | | * 历史申诉 |
| | | * @param request |
| | | * @return |
| | | * 获取图形验证码 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/appealHistory") |
| | | @ApiOperation(value = "历史申诉", tags = {"司机端-个人中心"}, notes = "") |
| | | @GetMapping("/base/getVerifyCodeUtils") |
| | | @ApiOperation(value = "获取图形验证码", tags = {"用户端-登录"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<Map<String, Object>> getVerifyCodeUtils(){ |
| | | try { |
| | | String s = VerifyCodeUtils.generateVerifyCode(4); |
| | | File file = new File("/usr/local/server/VerifyCode" + s + ".jpg"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | FileOutputStream out = new FileOutputStream(file); |
| | | VerifyCodeUtils.outputImage(100, 40, out, s); |
| | | file = new File("/usr/local/server/VerifyCode" + s + ".jpg"); |
| | | FileInputStream inputStream = new FileInputStream(file); |
| | | byte[] data = new byte[inputStream.available()]; |
| | | inputStream.read(data); |
| | | inputStream.close(); |
| | | String string = Base64.getEncoder().encodeToString(data); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("code", MD5AndKL.MD5(s.toLowerCase())); |
| | | map.put("img", string); |
| | | file.delete(); |
| | | return ResultUtil.success(map); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/getMoneyReceivingQRCode") |
| | | @ApiOperation(value = "获取支付二维码", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<AppealWrapper>> appealHistory(Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil getMoneyReceivingQRCode(HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Map<String,Object>> list = appealService.selectMaps(new EntityWrapper<TimeOutAppeal>().eq("driverId",driverId).orderBy("id",false).last("limit " + (pageNum-1)*size+ "," + pageNum*size)); |
| | | for (Map<String, Object> map : list) { |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(map.get("orderId").toString()); |
| | | map.put("timeOutMoney",orderLogistics.getTimeOutMoney()); |
| | | map.put("travelTime",DateUtil.getTimes(orderLogistics.getTravelTime())); |
| | | map.put("endServiceTime",DateUtil.getTimes(orderLogistics.getEndServiceTime())); |
| | | map.put("timeOut", DateUtil.CalTime(DateUtil.getTime(orderLogistics.getEndServiceTime()),DateUtil.getTime(orderLogistics.getArriveTimeExpect()))); |
| | | return driverService.getMoneyReceivingQRCode(driverId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | map.put("createTime",DateUtil.getTimeMunite((Date) map.get("createTime"))); |
| | | if (ToolUtil.isNotEmpty(map.get("dealTime"))){ |
| | | map.put("dealTime",DateUtil.getTimeMunite((Date) map.get("dealTime"))); |
| | | }else { |
| | | map.put("dealTime",""); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryOfflineTravelPaymentList") |
| | | @ApiOperation(value = "获取收款支付记录", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "开始时间", name = "start", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "结束时间", name = "end", required = false, dataType = "String"), |
| | | @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<OfflineTravelPaymentWarpper> queryOfflineTravelPaymentList(String start, String end, Integer pageNum, Integer size, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(AppealWrapper.getAppealListWrapper(list)); |
| | | OfflineTravelPaymentWarpper offlineTravelPaymentWarpper = new OfflineTravelPaymentWarpper(); |
| | | List<BaseWarpper> list = offlineTravelPaymentService.queryOfflineTravelPaymentList(driverId, start, end, pageNum, size); |
| | | offlineTravelPaymentWarpper.setList(list); |
| | | Double totalMoney = offlineTravelPaymentService.getTotalMoney(driverId, start, end); |
| | | offlineTravelPaymentWarpper.setTotal(totalMoney); |
| | | return ResultUtil.success(offlineTravelPaymentWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |