| | |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("未来出行 Doc") |
| | | .title("安合出行 Doc") |
| | | .description("所有接口前需要加 /user 前缀,例如:/user/base/agreement/queryByType <br>" + |
| | | "所有以 /api/*** 路径的接口需要上传签名参数sign") |
| | | // .termsOfServiceUrl("http://git.oschina.net/naan1993/guns") |
| | |
| | | resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi"); |
| | | paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 2, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | |
| | | |
| | | // if(payType == 1){//微信支付 |
| | | // String value = redisUtil.getValue("appletOpenId"); |
| | | // String appletsOpenId = null; |
| | | // if(ToolUtil.isNotEmpty(value)){ |
| | | // JSONObject jsonObject = JSON.parseObject(value); |
| | | // appletsOpenId = jsonObject.getString(uid.toString()); |
| | | // }else{ |
| | | // appletsOpenId = userInfo.getAppletsOpenId(); |
| | | // } |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + ",3", 9, 5, uid.toString(), "完成订单", orderMoney, callbackPath + "/base/wxPayOrderTaxi", "", type, appletsOpenId); |
| | | // if(map.get("code").equals("200")){ |
| | | // paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 1, orderMoney, map.get("order_id"), 1);//添加预支付数据 |
| | | // resultUtil = ResultUtil.success(map.get("data")); |
| | | // }else{ |
| | | // resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | // } |
| | | // } |
| | | // if(payType == 2){//支付宝支付 |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + ",3", 10, 5, uid.toString(), "完成订单", orderMoney, callbackPath + "/base/aliPayOrderTaxi", "", type, null); |
| | | // if(map.get("code").equals("200")){ |
| | | // paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 2, orderMoney, map.get("order_id"), 1);//添加预支付数据 |
| | | // resultUtil = ResultUtil.success(map.get("data")); |
| | | // }else{ |
| | | // resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | // } |
| | | // } |
| | | |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ |
| | | return ResultUtil.error("余额不足,无法完成支付"); |
| | |
| | | |
| | | //添加已收入明细 |
| | | Line line = lineService.selectById(orderCrossCity.getLineId()); |
| | | Double speMoney = Double.valueOf(line.getRakeRate()); |
| | | BigDecimal d = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))).setScale(2, BigDecimal.ROUND_HALF_EVEN);//企业收入 |
| | | BigDecimal c = new BigDecimal(orderCrossCity.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);//司机收入 |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | Double speMoney = driver.getIntercityCommission(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(driver.getSpecialCarCommissionType() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderCrossCity.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | if(driver.getSpecialCarCommissionType() == 1){//比例 |
| | | Double price = orderCrossCity.getOrderMoney(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | c = new BigDecimal(price).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderCrossCity.getCompanyId(), 2, orderCrossCity.getId(), 3, d.doubleValue()); |
| | | incomeService.saveData(2, orderCrossCity.getDriverId(), 2, orderCrossCity.getId(), 3, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderCrossCity.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()); |
| | |
| | | |
| | | //添加已收入明细 |
| | | Line line = lineService.selectById(orderCrossCity.getLineId()); |
| | | Double speMoney = Double.valueOf(line.getRakeRate()); |
| | | BigDecimal d = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))).setScale(2, BigDecimal.ROUND_HALF_EVEN);//企业收入 |
| | | BigDecimal c = new BigDecimal(orderCrossCity.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);//司机收入 |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | Double speMoney = driver.getIntercityCommission(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(driver.getSpecialCarCommissionType() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderCrossCity.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | if(driver.getSpecialCarCommissionType() == 1){//比例 |
| | | Double price = orderCrossCity.getOrderMoney(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | c = new BigDecimal(price).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderCrossCity.getCompanyId(), 2, orderCrossCity.getId(), 3, d.doubleValue()); |
| | | incomeService.saveData(2, orderCrossCity.getDriverId(), 2, orderCrossCity.getId(), 3, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderCrossCity.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()); |
| | |
| | | */ |
| | | List<Map<String, Object>> queryRedEnvelope(Integer uid) throws Exception; |
| | | |
| | | |
| | | |
| | | boolean pushOrder1(Integer id); |
| | | |
| | | } |
| | |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Resource |
| | | private DriverMapper driverMapper; |
| | | |
| | | @Autowired |
| | | private IDriverServiceService driverServiceService; |
| | |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | @Autowired |
| | | private IOrderCrossCityService crossCityService; |
| | | |
| | | @Autowired |
| | | private GeodesyUtil geodesyUtil; |
| | | |
| | | @Autowired |
| | | private IOrderEvaluateService orderEvaluateService; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | //推单操作 |
| | | if(orderPrivateCar.getState() == 1){ |
| | | this.pushOrder(orderPrivateCar); |
| | | Integer id = orderPrivateCar.getId(); |
| | | redisUtil.addListRight("push_order_ids", id.toString()); |
| | | } |
| | | |
| | | //添加消息 |
| | |
| | | double amount = 0; |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, orderPrivateCar.getCompanyId()); |
| | | if(null != orderPrivateCar.getDriverId() && |
| | | (orderPrivateCar.getSnatchOrderTime().getTime() + query.getMinuteNum() * 60 * 1000) < new Date().getTime()){//收费的情况 |
| | | (orderPrivateCar.getSnatchOrderTime().getTime() + query.getMinuteNum() * 60 * 1000) < System.currentTimeMillis()){//收费的情况 |
| | | if(null != query){ |
| | | amount += query.getMoney(); |
| | | } |
| | |
| | | } |
| | | }).start(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 推送抢单数据 |
| | | * @throws Exception |
| | | */ |
| | | public boolean pushOrder1(Integer id){ |
| | | try { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(id); |
| | | Company query = companyCityService.query(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | List<Driver> drivers = driverMapper.queryIdleDriver_(1, orderPrivateCar.getServerCarModelId(), query.getId()); |
| | | System.err.println("当前获取的司机:"+drivers); |
| | | |
| | | List<Driver> list = new ArrayList<>(); |
| | | |
| | | //找出距离最近且评分最高的司机 |
| | | Double dis = 100000D; |
| | | Double pf = 0d; |
| | | Driver driver1 = null; |
| | | for(Driver driver : drivers){ |
| | | List<OrderCrossCity> orderCrossCities = crossCityService.selectList(new EntityWrapper<OrderCrossCity>().eq("state", 2).eq("driverId", driver.getId())); |
| | | if (orderCrossCities!=null&& !orderCrossCities.isEmpty()){ |
| | | continue; |
| | | } |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(null != value){ |
| | | Map<String, Double> distance1 = geodesyUtil.getDistance(orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), value); |
| | | double d = Double.valueOf(distance1.get("WGS84")).doubleValue(); |
| | | List<OrderEvaluate> evaluates = orderEvaluateService.selectList(new EntityWrapper<OrderEvaluate>().eq("driverId", driver.getId())); |
| | | double fraction = evaluates.stream().mapToDouble(OrderEvaluate::getFraction).sum(); |
| | | if(fraction > 0){ |
| | | fraction = fraction / evaluates.size(); |
| | | } |
| | | if(dis > d && fraction > pf){ |
| | | dis = d; |
| | | pf = fraction; |
| | | driver1 = driver; |
| | | } |
| | | } |
| | | } |
| | | if(null != driver1){ |
| | | orderPrivateCar.setDriverId(driver1.getId()); |
| | | orderPrivateCar.setCarId(driver1.getCarId()); |
| | | orderPrivateCar.setCompanyId(driver1.getFranchiseeId() != null && driver1.getFranchiseeId() != 0 ? driver1.getFranchiseeId() : ( |
| | | driver1.getCompanyId() != null && driver1.getCompanyId() != 0 ? driver1.getCompanyId() : 1)); |
| | | orderPrivateCar.setState(2); |
| | | orderPrivateCar.setSnatchOrderTime(new Date()); |
| | | orderPrivateCarMapper.updateById(orderPrivateCar); |
| | | //修改司机状态 |
| | | //如果是预约单,则不修改司机为服务中 |
| | | if(orderPrivateCar.getOrderType() != 2 || (orderPrivateCar.getOrderType() == 2 && orderPrivateCar.getTravelTime().getTime() < System.currentTimeMillis() + 600000)){ |
| | | //修改司机为服务中 |
| | | driver1.setState(3); |
| | | driverService.updateById(driver1); |
| | | } |
| | | 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); |
| | | if(orderPrivateCar.getType() == 2){ |
| | | pushUtil.pushFerryOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, 2); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public synchronized String getOrderNum() throws Exception{ |
| | |
| | | resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi"); |
| | | paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, orderId, 1, 2, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | |
| | | |
| | | // if(payType == 1){//微信支付 |
| | | // String value = redisUtil.getValue("appletOpenId"); |
| | | // String appletsOpenId = null; |
| | | // if(ToolUtil.isNotEmpty(value)){ |
| | | // JSONObject jsonObject = JSON.parseObject(value); |
| | | // appletsOpenId = jsonObject.getString(uid.toString()); |
| | | // }else{ |
| | | // appletsOpenId = userInfo.getAppletsOpenId(); |
| | | // } |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + ",1", 9, 5, uid.toString(), "完成订单", orderMoney, callbackPath + "/base/wxPayOrderTaxi", "", type, appletsOpenId); |
| | | // if(map.get("code").equals("200")){ |
| | | // paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, orderId, 1, 1, orderMoney, map.get("order_id"), 1);//添加预支付数据 |
| | | // resultUtil = ResultUtil.success(map.get("data")); |
| | | // }else{ |
| | | // resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | // } |
| | | // } |
| | | // if(payType == 2) {//支付宝支付 |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + ",1", 10, 5, uid.toString(), "完成订单", orderMoney, callbackPath + "/base/aliPayOrderTaxi", "", type, null); |
| | | // if (map.get("code").equals("200")) { |
| | | // paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, orderId, 1, 2, orderMoney, map.get("order_id"), 1);//添加预支付数据 |
| | | // resultUtil = ResultUtil.success(map.get("data")); |
| | | // } else { |
| | | // resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | // } |
| | | // } |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ |
| | | return ResultUtil.error("余额不足,无法完成支付"); |
| | |
| | | |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double speMoney = company.getSpeMoney(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Double speMoney = driver.getSpecialCarCommission(); |
| | | if(driver.getSpecialCarCommissionType() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | if(driver.getSpecialCarCommissionType() == 1){//比例 |
| | | Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | 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()); |
| | |
| | | |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double taxi = company.getSpeMoney(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Double taxi = driver.getSpecialCarCommission(); |
| | | if(driver.getSpecialCarCommissionType() == 2){//固定 |
| | | d = new BigDecimal(taxi); |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | if(driver.getSpecialCarCommissionType() == 1){//比例 |
| | | Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(taxi).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | 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()); |
| | |
| | | package com.stylefeng.guns.modular.system.kaipiao; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.stylefeng.guns.modular.system.kaipiao.email.KaiPiaoEmail; |
| | | import com.stylefeng.guns.modular.system.kaipiao.entity.InvoiceData; |
| | | import com.stylefeng.guns.modular.system.kaipiao.entity.InvoiceDetails; |
| | | import com.stylefeng.guns.modular.system.kaipiao.entity.MaterialInfo; |
| | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class InvoiceDetails { |
| | | public class InvoiceDetails { |
| | | |
| | | private String orderNo =""; |
| | | private String fppzDm ="02"; |
| | |
| | | */ |
| | | @TableField("appletsOpenId") |
| | | private String appletsOpenId; |
| | | /** |
| | | * 专车抽成方式(1=比例,2=固定金额) |
| | | */ |
| | | private Integer specialCarCommissionType; |
| | | /** |
| | | * 专车抽成金额 |
| | | */ |
| | | private Double specialCarCommission; |
| | | /** |
| | | * 城际抽成方式(1=比例,2=固定金额) |
| | | */ |
| | | private Integer intercityCommissionType; |
| | | /** |
| | | * 城际抽成金额 |
| | | */ |
| | | private Double intercityCommission; |
| | | /** |
| | | * 提现冻结金额 |
| | | */ |
| | | private Double withdrawFrozenAmount; |
| | | |
| | | @Override |
| | | public Integer getId() { |
| | |
| | | public void setAppletsOpenId(String appletsOpenId) { |
| | | this.appletsOpenId = appletsOpenId; |
| | | } |
| | | |
| | | |
| | | public Integer getSpecialCarCommissionType() { |
| | | return specialCarCommissionType; |
| | | } |
| | | |
| | | public void setSpecialCarCommissionType(Integer specialCarCommissionType) { |
| | | this.specialCarCommissionType = specialCarCommissionType; |
| | | } |
| | | |
| | | public Double getSpecialCarCommission() { |
| | | return specialCarCommission; |
| | | } |
| | | |
| | | public void setSpecialCarCommission(Double specialCarCommission) { |
| | | this.specialCarCommission = specialCarCommission; |
| | | } |
| | | |
| | | public Integer getIntercityCommissionType() { |
| | | return intercityCommissionType; |
| | | } |
| | | |
| | | public void setIntercityCommissionType(Integer intercityCommissionType) { |
| | | this.intercityCommissionType = intercityCommissionType; |
| | | } |
| | | |
| | | public Double getIntercityCommission() { |
| | | return intercityCommission; |
| | | } |
| | | |
| | | public void setIntercityCommission(Double intercityCommission) { |
| | | this.intercityCommission = intercityCommission; |
| | | } |
| | | |
| | | public Double getWithdrawFrozenAmount() { |
| | | return withdrawFrozenAmount; |
| | | } |
| | | |
| | | public void setWithdrawFrozenAmount(Double withdrawFrozenAmount) { |
| | | this.withdrawFrozenAmount = withdrawFrozenAmount; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Driver{" + |
| | |
| | | // 接收短信的手机号码 |
| | | request.putQueryParameter("PhoneNumbers", phone); |
| | | // 短信签名名称。请在控制台签名管理页面签名名称一列查看(必须是已添加、并通过审核的短信签名)。 |
| | | request.putQueryParameter("SignName", "未来出行"); |
| | | request.putQueryParameter("SignName", "安合出行"); |
| | | // 短信模板ID |
| | | request.putQueryParameter("TemplateCode", templateCode); |
| | | // 短信模板变量对应的实际值,JSON格式。 |
| | |
| | | |
| | | //条件必填,国内短信关注,当templateId指定的模板类型为通用模板时生效且必填,必须是已审核通过的,与模板类型一致的签名名称 |
| | | //国际/港澳台短信不用关注该参数 |
| | | String signature = "未来出行"; //签名名称 |
| | | String signature = "安合出行"; //签名名称 |
| | | |
| | | //必填,全局号码格式(包含国家码),示例:+8615123456789,多个号码之间用英文逗号分隔 |
| | | String receiver = "+86" + phone; //短信接收人号码 |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 添加数据到list集合 |
| | | * @param key |
| | | * @param value |
| | | */ |
| | | public void addListRight(String key, String value){ |
| | | //发送验证码短信 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); |
| | | params.add("key", key); |
| | | params.add("value", value); |
| | | HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/addListRight", requestEntity, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject.getIntValue("code") != 200){ |
| | | System.err.println("调用redis出错了"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加数据到list集合 |
| | | * @param key |
| | | * @param value |
| | | */ |
| | | public void addListLeft(String key, String value){ |
| | | //发送验证码短信 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); |
| | | params.add("key", key); |
| | | params.add("value", value); |
| | | HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/addListLeft", requestEntity, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject.getIntValue("code") != 200){ |
| | | System.err.println("调用redis出错了"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取list集合中第一个数据 |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public String getListFirstValue(String key){ |
| | | if(ToolUtil.isNotEmpty(key)){ |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("key", key); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/getListFirstValue",requestEntity , String.class); |
| | | return s; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | |
| | | |
| | | @Autowired |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | @Scheduled(fixedRate = 1000 * 10) |
| | | public void taskFiveSeconds(){ |
| | | try { |
| | | //定时任务推送订单给司机 |
| | | String push_order_ids = redisUtil.getListFirstValue("push_order_ids"); |
| | | if(ToolUtil.isNotEmpty(push_order_ids)){ |
| | | boolean b = orderPrivateCarService.pushOrder1(Integer.valueOf(push_order_ids)); |
| | | if(!b){ |
| | | redisUtil.addListLeft("push_order_ids", push_order_ids); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |