| | |
| | | }*/ |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | | // 判断是否有其他未完成的单子 |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(orderPrivateCar.getUserId(), 1, 1, 3,4, 5,6); |
| | | if(!CollectionUtils.isEmpty(orderPrivateCars)){ |
| | | return ResultUtil.error("有未完成的服务订单"); |
| | | } |
| | | orderPrivateCar.setState(3); |
| | | orderPrivateCar.setSetOutTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderPrivateCar.getUserId()); |
| | |
| | | @Override |
| | | public ResultUtil confirmFees(Integer orderId, Integer type, Double parkingFee, Double crossingFee) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | if(Objects.nonNull(orderPrivateCar.getPriceAuditState()) && orderPrivateCar.getPriceAuditState() == 1){ |
| | | return ResultUtil.error("待平台审核中"); |
| | | } |
| | | if(orderPrivateCar.getState() != 5){ |
| | | return ResultUtil.error("异常操作,请刷新订单"); |
| | | } |
| | |
| | | if(orderNumber<=0){//判断是否是首单 |
| | | //判断是否免单 |
| | | UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId()); |
| | | if(userInfo.getFreeMoney().doubleValue()>0d){ |
| | | if(Objects.nonNull(userInfo.getFreeMoney()) && userInfo.getFreeMoney().doubleValue()>0d){ |
| | | if(orderPrivateCar.getOrderMoney()<=userInfo.getFreeMoney().doubleValue()){ |
| | | orderPrivateCar.setState(8); |
| | | orderPrivateCar.setIsFree(2); |
| | |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | incomeService.saveDriverData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue(),driver.getBalance()); |
| | | }else{ |
| | | orderPrivateCar.setState(7); |
| | | orderPrivateCar.setOrderMoney(orderPrivateCar.getOrderMoney()-userInfo.getFreeMoney().doubleValue()); |
| | |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | incomeService.saveDriverData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue(), driver.getBalance()); |
| | | }else { |
| | | orderPrivateCar.setState(7); |
| | | } |
| | |
| | | if(BigDecimal.valueOf(orderPrivateCar.getOrderMoney()).subtract(new BigDecimal(orderPrivateCar.getEstimatedPrice())).abs().doubleValue() > 3){ |
| | | orderPrivateCar.setIsException(1); |
| | | } |
| | | if(orderPrivateCar.getIsException() == 1){ |
| | | orderPrivateCar.setState(13); |
| | | } |
| | | // if(orderPrivateCar.getIsException() == 1){ |
| | | // orderPrivateCar.setState(13); |
| | | // } |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | |
| | |
| | | orderPrivateCar.setPriceAuditState(1); |
| | | orderPrivateCar.setState(6); |
| | | this.updateById(orderPrivateCar); |
| | | // 推送新的价格给用户 |
| | | pushUtil.pushOrderMoney(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, updatePrice, 0); |
| | | pushUtil.pushOrderMoney(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, updatePrice, 0); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | /** |
| | | * 司机余额 |
| | | */ |
| | | @TableField("driverBalance") |
| | | private Double driverBalance; |
| | | |
| | | public Double getDriverBalance() { |
| | | return driverBalance; |
| | | } |
| | | |
| | | public void setDriverBalance(Double driverBalance) { |
| | | this.driverBalance = driverBalance; |
| | | } |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | |
| | | */ |
| | | @TableField("orderId") |
| | | private Integer orderId; |
| | | /** |
| | | * 司机余额 |
| | | */ |
| | | @TableField("driverBalance") |
| | | private Double driverBalance; |
| | | |
| | | public Double getDriverBalance() { |
| | | return driverBalance; |
| | | } |
| | | |
| | | public void setDriverBalance(Double driverBalance) { |
| | | this.driverBalance = driverBalance; |
| | | } |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | |
| | | */ |
| | | @TableField("bankName") |
| | | private String bankName ; |
| | | /** |
| | | * 司机余额 |
| | | */ |
| | | @TableField("driverBalance") |
| | | private Double driverBalance; |
| | | |
| | | public Double getDriverBalance() { |
| | | return driverBalance; |
| | | } |
| | | |
| | | public void setDriverBalance(Double driverBalance) { |
| | | this.driverBalance = driverBalance; |
| | | } |
| | | |
| | | public String getBankName() { |
| | | return bankName; |
| | |
| | | * @throws Exception |
| | | */ |
| | | void saveData(Integer userType, Integer objectId, Integer type, Integer incomeId, Integer orderType, Double money) throws Exception; |
| | | /** |
| | | * 添加数据 |
| | | * @param userType |
| | | * @param objectId |
| | | * @param type |
| | | * @param incomeId |
| | | * @param money |
| | | * @throws Exception |
| | | */ |
| | | void saveDriverData(Integer userType, Integer objectId, Integer type, Integer incomeId, Integer orderType, Double money, Double driverBalance) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | void saveData(Integer userId, String remark, Double money, Integer state, |
| | | Integer type, Integer userType, Integer orderType, Integer orderId) throws Exception; |
| | | /** |
| | | * 添加数据 |
| | | * @param userId 对象id |
| | | * @param remark 备注 |
| | | * @param money 金额 |
| | | * @param state 状态(1=添加,2=减少) |
| | | * @param type 类型(1=金额,2=积分) |
| | | * @param userType 用户类型(1=用户,2=司机) |
| | | * @param orderType 订单类型(1=专车,2=快车,3=城际,4=小件物流,5=余额充值,6=余额提现) |
| | | * @param orderId |
| | | * @throws Exception |
| | | */ |
| | | void saveDriverData(Integer userId, String remark, Double money, Integer state, |
| | | Integer type, Integer userType, Integer orderType, Integer orderId,Double driverBalance) throws Exception; |
| | | } |
| | |
| | | this.insert(income); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param userType |
| | | * @param objectId |
| | | * @param type |
| | | * @param incomeId |
| | | * @param money |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void saveDriverData(Integer userType, Integer objectId, Integer type, Integer incomeId, Integer orderType, Double money,Double driverBalance) throws Exception { |
| | | Income income = new Income(); |
| | | income.setUserType(userType); |
| | | income.setObjectId(objectId); |
| | | income.setType(type); |
| | | income.setIncomeId(incomeId); |
| | | income.setOrderType(orderType); |
| | | income.setMoney(money); |
| | | income.setInsertTime(new Date()); |
| | | income.setDriverBalance(driverBalance); |
| | | this.insert(income); |
| | | } |
| | | /** |
| | | * 获取列表数据 |
| | | * @param userType |
| | |
| | | driver.setBalance(new BigDecimal(balance).subtract(new BigDecimal(aDouble)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "司机改派支付", aDouble, 2, 1, 2, reassign.getOrderType(), reassign.getOrderId()); |
| | | transactionDetailsService.saveDriverData(uid, "司机改派支付", aDouble, 2, 1, 2, reassign.getOrderType(), reassign.getOrderId(), driver.getBalance()); |
| | | |
| | | |
| | | //修改改派通知状态 |
| | |
| | | query.setState(2); |
| | | query.setPayTime(new Date()); |
| | | reassignMapper.updateById(query); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "司机改派支付", aDouble, 2, 1, 2, 3, Integer.valueOf(id)); |
| | | } |
| | | Double balance = driver.getBalance(); |
| | | if(null == balance || balance < totalMoney){ |
| | |
| | | } |
| | | driver.setBalance(new BigDecimal(balance).subtract(new BigDecimal(totalMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | |
| | | for(String id : split){ |
| | | //添加交易明细 |
| | | transactionDetailsService.saveDriverData(uid, "司机改派支付", aDouble, 2, 1, 2, 3, Integer.valueOf(id),driver.getBalance()); |
| | | } |
| | | |
| | | //修改改派通知状态 |
| | | for(String id : split){ |
| | |
| | | PaymentRecord query = paymentRecordService.query(1, null, null, Integer.valueOf(key), 3, type, 1); |
| | | if(null != query){ |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(reassigns.get(0).getOriginalDriverId(), "司机改派支付", reassigns.get(0).getMoney(), 2, 1, 2, 3, Integer.valueOf(key)); |
| | | transactionDetailsService.saveDriverData(reassigns.get(0).getOriginalDriverId(), "司机改派支付", reassigns.get(0).getMoney(), 2, 1, 2, 3, Integer.valueOf(key),driver.getBalance()); |
| | | for(Reassign reassign : reassigns){ |
| | | reassign.setState(2); |
| | | reassign.setPayOrder(order_id); |
| | |
| | | PaymentRecord query = paymentRecordService.query(1, null, null, reassign.getOrderId(), reassign.getOrderType(), type, 1); |
| | | if(null != query){ |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(reassign.getOriginalDriverId(), "司机改派支付", reassign.getMoney(), 2, 1, 2, reassign.getOrderType(), reassign.getOrderId()); |
| | | transactionDetailsService.saveDriverData(reassign.getOriginalDriverId(), "司机改派支付", reassign.getMoney(), 2, 1, 2, reassign.getOrderType(), reassign.getOrderId(),driver.getBalance()); |
| | | reassign.setState(2); |
| | | reassign.setPayOrder(order_id); |
| | | reassign.setPayTime(new Date()); |
| | |
| | | transactionDetails.setUserType(userType); |
| | | this.insert(transactionDetails); |
| | | } |
| | | /** |
| | | * 添加数据 |
| | | * @param userId 对象id |
| | | * @param remark 备注 |
| | | * @param money 金额 |
| | | * @param state 状态(1=添加,2=减少) |
| | | * @param type 类型(1=金额,2=积分) |
| | | * @param userType 用户类型(1=用户,2=司机) |
| | | * @param orderType 订单类型(1=专车,2=快车,3=城际,4=小件物流) |
| | | * @param orderId |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void saveDriverData(Integer userId, String remark, Double money, Integer state, Integer type, Integer userType, |
| | | Integer orderType, Integer orderId, Double driverBalance) throws Exception { |
| | | |
| | | TransactionDetails transactionDetails = new TransactionDetails(); |
| | | transactionDetails.setInsertTime(new Date()); |
| | | transactionDetails.setMoney(money); |
| | | transactionDetails.setOrderId(orderId); |
| | | transactionDetails.setOrderType(orderType); |
| | | transactionDetails.setRemark(remark); |
| | | transactionDetails.setState(state); |
| | | transactionDetails.setType(type); |
| | | transactionDetails.setUserId(userId); |
| | | transactionDetails.setUserType(userType); |
| | | transactionDetails.setDriverBalance(driverBalance); |
| | | this.insert(transactionDetails); |
| | | } |
| | | } |
| | |
| | | double v = new BigDecimal(driver.getLaveBusinessMoney()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | driver.setLaveBusinessMoney(v); |
| | | } |
| | | this.insert(withdrawal); |
| | | driverService.updateById(driver); |
| | | withdrawal.setDriverBalance(driver.getBalance()); |
| | | this.insert(withdrawal); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | log.error(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | /** |
| | | * 推送订单修改价 |
| | | * @param type 1=用户,2=司机 |
| | | * @param uid 对象id |
| | | * @param orderId 订单id |
| | | * @param orderType 订单类型(1=专车,2=快车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=公务用车) |
| | | * @param orderMoney 金额 |
| | | */ |
| | | public void pushOrderMoney(Integer type, Integer uid, Integer orderId, Integer orderType, BigDecimal orderMoney, Integer time){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | | jsonObject.put("method", "ORDER_MONEY"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderId", orderId); |
| | | map.put("orderType", orderType); |
| | | map.put("orderMoney", orderMoney); |
| | | map.put("time", time); |
| | | jsonObject.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", jsonObject.toJSONString()); |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | // String s = internalRestTemplate.postForObject("http://message-push/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | log.error(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 改派完成后推送用户端提醒 |
| | |
| | | temp.put("amount",income.getMoney()); |
| | | temp.put("withType","订单号"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | temp.put("balance",income.getDriverBalance()); |
| | | res.add(temp); |
| | | } |
| | | } |
| | |
| | | temp.put("amount",income.getMoney()); |
| | | temp.put("withType","订单号"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | temp.put("balance",income.getDriverBalance()); |
| | | res.add(temp); |
| | | } |
| | | } |
| | |
| | | temp.put("amount",details.getMoney()); |
| | | temp.put("withType","交易流水号"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | temp.put("balance",details.getDriverBalance()); |
| | | res.add(temp); |
| | | } |
| | | } |
| | |
| | | temp.put("amount",details.getMoney()); |
| | | temp.put("withType","交易流水号"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | temp.put("balance",details.getDriverBalance()); |
| | | res.add(temp); |
| | | } |
| | | } |
| | |
| | | temp.put("amount",details.getMoney()); |
| | | temp.put("withType","无"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | temp.put("balance",details.getDriverBalance()); |
| | | res.add(temp); |
| | | } |
| | | } |
| | |
| | | temp.put("amount",details.getMoney()); |
| | | temp.put("withType","无"); |
| | | // todo 新增收入明细时 需要存储当前账户余额 |
| | | temp.put("balance",0); |
| | | temp.put("balance",details.getDriverBalance()); |
| | | res.add(temp); |
| | | } |
| | | } |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | incomeEntityWrapper.eq("type",2); |
| | | incomeEntityWrapper.isNotNull("money"); |
| | | if (start!=null){ |
| | | start = start + " 00:00:00"; |
| | | end = end + " 23:59:59"; |
| | | incomeEntityWrapper.ge("insertTime", start); |
| | | incomeEntityWrapper.le("insertTime", end); |
| | | } |
| | | |
| | | List<Income> incomes = incomeService.selectList( |
| | | incomeEntityWrapper |
| | | ); |
| | | List<Income> incomes = incomeService.selectList(incomeEntityWrapper); |
| | | EntityWrapper<TOrderPrivateCar> driverEntityWrapper = new EntityWrapper<>(); |
| | | driverEntityWrapper.isNotNull("driverId"); |
| | | if (start!=null){ |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | /** |
| | | * 司机收益统计 |
| | | * @author yxh |
| | | * @date 2021/4/2 17:35 |
| | | * @return java.lang.Object |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryDriverIncomeDataSum", method = RequestMethod.POST) |
| | | public Object queryDriverIncomeDataSum(String driverName, String time, Integer companyId){ |
| | | try { |
| | | String start = null; |
| | | String end = null; |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | start = time.split(" - ")[0]; |
| | | end = time.split(" - ")[1]; |
| | | } |
| | | List<Map<String, Object>> maps = driverService.queryDriverIncomeDataNoPage( driverName, start, end, companyId); |
| | | EntityWrapper<Income> incomeEntityWrapper = new EntityWrapper<>(); |
| | | incomeEntityWrapper.eq("type",2); |
| | | incomeEntityWrapper.isNotNull("money"); |
| | | if (start!=null){ |
| | | start = start + " 00:00:00"; |
| | | end = end + " 23:59:59"; |
| | | incomeEntityWrapper.ge("insertTime", start); |
| | | incomeEntityWrapper.le("insertTime", end); |
| | | } |
| | | |
| | | List<Income> incomes = incomeService.selectList(incomeEntityWrapper); |
| | | EntityWrapper<TOrderPrivateCar> driverEntityWrapper = new EntityWrapper<>(); |
| | | driverEntityWrapper.isNotNull("driverId"); |
| | | if (start!=null){ |
| | | driverEntityWrapper.ge("insertTime", start); |
| | | driverEntityWrapper.le("insertTime", end); |
| | | } |
| | | List<TOrderPrivateCar> tOrderPrivateCars = orderPrivateCarService.selectList(driverEntityWrapper); |
| | | |
| | | for (Map<String, Object> map : maps) { |
| | | Double driverMoney = 0.0; |
| | | Double platformMoney = 0.0; |
| | | |
| | | // 司机跑单收入 |
| | | List<Income> driver = incomes.stream().filter(e -> e.getUserType().equals(2) |
| | | &&map.get("id").toString().equals(e.getObjectId().toString())).collect(Collectors.toList()); |
| | | for (Income income : driver) { |
| | | driverMoney+=income.getMoney(); |
| | | } |
| | | String driverId = map.get("id").toString(); |
| | | // 查询司机订单 |
| | | List<Integer> orderIds = tOrderPrivateCars.stream().filter(e -> e.getDriverId().equals(Integer.parseInt(driverId))) |
| | | .map(TOrderPrivateCar::getId).collect(Collectors.toList()); |
| | | // 平台收入 |
| | | List<Income> platform = incomes.stream().filter(e -> e.getUserType().equals(1) |
| | | && orderIds.contains(e.getObjectId())).collect(Collectors.toList()); |
| | | for (Income income : platform) { |
| | | platformMoney+=income.getMoney(); |
| | | } |
| | | // driverMoney保留两位小数 |
| | | driverMoney = new BigDecimal(driverMoney).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | platformMoney = new BigDecimal(platformMoney).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | map.put("driverMoney", driverMoney); |
| | | map.put("platformMoney", platformMoney); |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | int totalOrderCount = maps.stream().mapToInt(e -> Integer.parseInt(e.get("privateCarTotalNum").toString())).sum(); |
| | | result.put("totalOrderCount", totalOrderCount); |
| | | double totalPayMoney = maps.stream().mapToDouble(e -> Double.parseDouble(e.get("payMoney").toString())).sum(); |
| | | result.put("totalPayMoney", totalPayMoney); |
| | | double totalIncome = maps.stream().mapToDouble(e -> Double.parseDouble(e.get("driverMoney").toString())).sum(); |
| | | result.put("totalIncome", totalIncome); |
| | | double totalPlatformMoney = maps.stream().mapToDouble(e -> Double.parseDouble(e.get("platformMoney").toString())).sum(); |
| | | result.put("totalPlatformMoney", totalPlatformMoney); |
| | | return result; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出司机收益排行 |
| | |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | /** |
| | | * 司机余额 |
| | | */ |
| | | @TableField("driverBalance") |
| | | private Double driverBalance; |
| | | |
| | | public Double getDriverBalance() { |
| | | return driverBalance; |
| | | } |
| | | |
| | | public void setDriverBalance(Double driverBalance) { |
| | | this.driverBalance = driverBalance; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | |
| | | * 订单id |
| | | */ |
| | | private Integer orderId; |
| | | /** |
| | | * 司机余额 |
| | | */ |
| | | @TableField("driverBalance") |
| | | private Double driverBalance; |
| | | |
| | | public Double getDriverBalance() { |
| | | return driverBalance; |
| | | } |
| | | |
| | | public void setDriverBalance(Double driverBalance) { |
| | | this.driverBalance = driverBalance; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | |
| | | */ |
| | | private Integer withdrawalType; |
| | | |
| | | /** |
| | | * 司机余额 |
| | | */ |
| | | @TableField("driverBalance") |
| | | private Double driverBalance; |
| | | |
| | | public Double getDriverBalance() { |
| | | return driverBalance; |
| | | } |
| | | |
| | | public void setDriverBalance(Double driverBalance) { |
| | | this.driverBalance = driverBalance; |
| | | } |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TDriverIncomeTableToolbar" role="group"> |
| | | <label>总计订单数:<span id="totalOrderCount"></span>;实付金额:<span id="totalPayMoney"></span>; |
| | | 司机收入:<span id="totalIncome"></span>;平台手续费:<span id="totalPlatformMoney"></span></label> |
| | | </div> |
| | | <#table id="TDriverIncomeTable"/> |
| | | </div> |
| | |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="司机端二维码" onfocus="TUser.tooltip()">司机端二维码</p>'] |
| | | }else if(value==2){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="紧急联系人" onfocus="TUser.tooltip()">紧急联系人</p>'] |
| | | }else if(value==3){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="取消订单短信通知" onfocus="TUser.tooltip()">取消订单短信通知</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | |
| | | * 查询车辆品牌管理列表 |
| | | */ |
| | | DriverIncomelData.search = function () { |
| | | // 统计 |
| | | var ajax = new $ax(Feng.ctxPath + "/report/queryDriverIncomeDataSum", function (data) { |
| | | // 将金额设置进label文本 |
| | | $("#totalOrderCount").text(data.totalOrderCount); |
| | | $("#totalPayMoney").text(data.totalPayMoney); |
| | | $("#totalIncome").text(data.totalIncome); |
| | | $("#totalPlatformMoney").text(data.totalPlatformMoney); |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("driverName",$("#driverName").val()); |
| | | ajax.set("time",$("#time").val()); |
| | | ajax.set("companyId",$("#company").val()); |
| | | ajax.start(); |
| | | var queryData = {}; |
| | | queryData['driverName'] = $("#driverName").val(); |
| | | queryData['time'] = $("#time").val(); |
| | |
| | | type: 1, |
| | | time: rangeDate |
| | | }) |
| | | console.log("统计统计统计统计统计统计统计") |
| | | // 统计 |
| | | var ajax = new $ax(Feng.ctxPath + "/report/queryDriverIncomeDataSum", function (data) { |
| | | // 将金额设置进label文本 |
| | | $("#totalOrderCount").text(data.totalOrderCount); |
| | | $("#totalPayMoney").text(data.totalPayMoney); |
| | | $("#totalIncome").text(data.totalIncome); |
| | | $("#totalPlatformMoney").text(data.totalPlatformMoney); |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("driverName",$("#driverName").val()); |
| | | ajax.set("time",$("#time").val()); |
| | | ajax.set("companyId",$("#company").val()); |
| | | ajax.start(); |
| | | DriverIncomelData.table = table.init(); |
| | | }); |
| | |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat){ |
| | | try { |
| | | ResultUtil<BaseWarpper> baseWarpperResultUtil = orderService.queryExpectedTime(slon, slat, elon, elat); |
| | | System.err.println(baseWarpperResultUtil); |
| | | System.err.println(baseWarpperResultUtil.getData()); |
| | | return orderService.queryExpectedTime(slon, slat, elon, elat); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | private IOpenCityService openCityService; |
| | | @Autowired |
| | | private IServerCarModelService serverCarModelService; |
| | | // @Autowired |
| | | // private ALiSendSms aLiSendSms; |
| | | |
| | | @Autowired |
| | | private IAppOpenInfoService appOpenInfoService; |
| | | |
| | | @Value("${filePath}") |
| | | private String filePath; |
| | |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double taxi = company.getSpeMoney(); |
| | | BigDecimal c =new BigDecimal(query.getMoney());//司机收入 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | incomeService.saveDriverData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue(),driver.getBalance()); |
| | | |
| | | this.deleteTask(id);//删除定时任务 |
| | | |
| | |
| | | // 第三轮取消订单 |
| | | orderPrivateCar.setState(10); |
| | | orderPrivateCarMapper.updateById(orderPrivateCar); |
| | | pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | // 添加站内信 |
| | | systemNoticeService.addSystemNotice(1, "当前区域未能及时为您匹配到合适车辆。为避免耽误您的行程,系统已自动取消订单,建议您稍后重新尝试。", orderPrivateCar.getUserId(), 1); |
| | | // TODO 0731 添加短信发送 |
| | | |
| | | // 查询是否开启短信通知 |
| | | AppOpenInfo appOpenInfo = appOpenInfoService.selectOne(new EntityWrapper<AppOpenInfo>() |
| | | .eq("type", 3)); |
| | | if(Objects.nonNull(appOpenInfo) && appOpenInfo.getIsOpen() == 1){ |
| | | // 添加短信发送 |
| | | //发送记录集合 |
| | | JSONArray records = new JSONArray(); |
| | | JSONObject record = new JSONObject(); |
| | | UserInfo userInfo = userInfoService.selectById(orderPrivateCar.getUserId()); |
| | | //手机号 |
| | | record.put("mobile", userInfo.getPhone()); |
| | | //替换变量 |
| | | JSONObject param = new JSONObject(); |
| | | record.put("tpContent", param); |
| | | records.add(record); |
| | | SMSUtil.sendSmsTp(380702L, records); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | if(Objects.nonNull(query1)){ |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | } |
| | | userInfoService.updateById(userInfo); |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double speMoney = company.getSpeMoney(); |
| | |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | incomeService.saveDriverData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue(), driver.getBalance()); |
| | | orderPrivateCar.setState(8); |
| | | }else { |
| | | if(orderPrivateCar.getOrderSource() == 2){ |
| | |
| | | orderPrivateCar.setOrderMoney(orderMoney); |
| | | orderPrivateCar.setPayMoney(orderMoney); |
| | | } |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | } |
| | | }).start(); |
| | | // new Thread(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | // pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | // } |
| | | // }).start(); |
| | | userInfoService.updateById(userInfo); |
| | | systemNoticeService.addSystemNotice(1, "您已使用余额成功完成出行订单支付,谢谢使用!", uid, 1); |
| | | if(orderPrivateCar.getState() == 1){ |
| | | this.pushOrder(orderPrivateCar); |
| | |
| | | }else { |
| | | // 后付 |
| | | orderPrivateCar.setPayMoney(orderMoney); |
| | | orderPrivateCar.setState(8); |
| | | if(orderPrivateCar.getIsplatPay()==1){ |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | incomeService.saveDriverData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue(), driver.getBalance()); |
| | | } |
| | | |
| | | |
| | |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double taxi = company.getSpeMoney(); |
| | | BigDecimal c =new BigDecimal(query.getAmount());//司机收入 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | incomeService.saveDriverData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue(), driver.getBalance()); |
| | | this.deleteTask(orderPrivateCar.getId());//删除定时任务 |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | incomeService.saveDriverData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue(), driver.getBalance()); |
| | | }else { |
| | | if(orderPrivateCar.getOrderSource() == 2){ |
| | | orderPrivateCar.setState(2); |
| | |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | incomeService.saveDriverData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue(), driver.getBalance()); |
| | | } |
| | | } |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.AppOpenInfo; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2021-04-15 |
| | | */ |
| | | public interface AppOpenInfoMapper extends BaseMapper<AppOpenInfo> { |
| | | |
| | | } |
| | |
| | | a.headImgUrl as avatar, |
| | | case when b.telX is null then a.phone else b.telX end as phone, |
| | | c.carLicensePlate as carCode, |
| | | CONCAT(F.`name`, d.`name`, '.', c.carColor) as carName, |
| | | CONCAT(f.`name`, d.`name`, '.', c.carColor) as carName, |
| | | (select sum(fraction) / count(id) from t_order_evaluate where driverId = a.id) as score, |
| | | ( |
| | | (select count(id) from t_order_private_car where state in (7, 8, 9) and driverId = a.id) + |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2021-04-15 |
| | | */ |
| | | @TableName("app_open_info") |
| | | public class AppOpenInfo extends Model<AppOpenInfo> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 1=二维码 |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 1=打开,2=关闭 |
| | | */ |
| | | private Integer isOpen; |
| | | |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getIsOpen() { |
| | | return isOpen; |
| | | } |
| | | |
| | | public void setIsOpen(Integer isOpen) { |
| | | this.isOpen = isOpen; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "AppOpenInfo{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", isOpen=" + isOpen + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | /** |
| | | * 司机余额 |
| | | */ |
| | | @TableField("driverBalance") |
| | | private Double driverBalance; |
| | | |
| | | public Double getDriverBalance() { |
| | | return driverBalance; |
| | | } |
| | | |
| | | public void setDriverBalance(Double driverBalance) { |
| | | this.driverBalance = driverBalance; |
| | | } |
| | | public Integer getId() { |
| | | return id; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.AppOpenInfo; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2021-04-15 |
| | | */ |
| | | public interface IAppOpenInfoService extends IService<AppOpenInfo> { |
| | | |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | void saveData(Integer userType, Integer objectId, Integer type, Integer incomeId, Integer orderType, Double money) throws Exception; |
| | | /** |
| | | * 添加数据 |
| | | * @param userType |
| | | * @param objectId |
| | | * @param type |
| | | * @param incomeId |
| | | * @param money |
| | | * @throws Exception |
| | | */ |
| | | void saveDriverData(Integer userType, Integer objectId, Integer type, Integer incomeId, Integer orderType, Double money, Double driverBalance) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.AppOpenInfoMapper; |
| | | import com.stylefeng.guns.modular.system.model.AppOpenInfo; |
| | | import com.stylefeng.guns.modular.system.service.IAppOpenInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2021-04-15 |
| | | */ |
| | | @Service |
| | | public class AppOpenInfoServiceImpl extends ServiceImpl<AppOpenInfoMapper, AppOpenInfo> implements IAppOpenInfoService { |
| | | |
| | | } |
| | |
| | | List<Driver> drivers = driverMapper.queryIdleDriver_(type, serverCarModelId, companyId); |
| | | List<Driver> list = new ArrayList<>(); |
| | | for(Driver driver : drivers){ |
| | | if(driver.getId() == 2448){ |
| | | System.err.println("司机名称---"+driver.getName()); |
| | | } |
| | | String value = redisUtil.getValue("DRIVER" + String.valueOf(driver.getId())); |
| | | if(null != value){ |
| | | /*Map<String, String> distance1 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, value, 0);//计算距离 |
| | |
| | | income.setInsertTime(new Date()); |
| | | this.insert(income); |
| | | } |
| | | /** |
| | | * 添加数据 |
| | | * @param userType |
| | | * @param objectId |
| | | * @param type |
| | | * @param incomeId |
| | | * @param money |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void saveDriverData(Integer userType, Integer objectId, Integer type, Integer incomeId, Integer orderType, Double money,Double driverBalance) throws Exception { |
| | | Income income = new Income(); |
| | | income.setUserType(userType); |
| | | income.setObjectId(objectId); |
| | | income.setType(type); |
| | | income.setIncomeId(incomeId); |
| | | income.setOrderType(orderType); |
| | | income.setMoney(money); |
| | | income.setInsertTime(new Date()); |
| | | income.setDriverBalance(driverBalance); |
| | | this.insert(income); |
| | | } |
| | | } |