| | |
| | | orderCancelMapper.insert(orderCancel); |
| | | |
| | | //修改行程信息 |
| | | try { |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderLogistics.getTripId(), null, null, null, null); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderLogistics.getTripId(), null, null, null, null); |
| | | if(updateTrip){ |
| | | break; |
| | | } |
| | | Thread.sleep(5000L); |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderLogistics.getTripId(), null, null, null, null); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderLogistics.getTripId(), null, null, null, null); |
| | | if(updateTrip){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | tOrderPrivateCarService.updateById(orderPrivateCar); |
| | | |
| | | //修改行程数据 |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("COMPLETE", null, null, orderPrivateCar.getTripId(), null, null, null, null); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("COMPLETE", null, null, orderPrivateCar.getTripId(), null, null, null, null); |
| | | if(updateTrip){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | //上报行程 |
| | | boolean reportBillableEvent = fleetEngineUtil.reportBillableEvent(orderPrivateCar.getTripId()); |
| | | if(!reportBillableEvent){ |
| | | for (int i = 0; i < 5; i++) { |
| | | reportBillableEvent = fleetEngineUtil.reportBillableEvent(orderPrivateCar.getTripId()); |
| | | if(reportBillableEvent){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | TUser userInfo = userService.selectById(orderPrivateCar.getUserId()); |
| | | Integer language1 = userInfo.getLanguage(); |
| | |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | | TOrderPrivateCar finalOrderPrivateCar = orderPrivateCar; |
| | | new Thread(()->{ |
| | | try { |
| | | //上报google |
| | | fleetEngineUtil.reportBillableEvent(finalOrderPrivateCar.getTripId()); |
| | | log.warn("上报时间:{},tripid:{},created_at:{},completed_at:{}", System.currentTimeMillis(), finalOrderPrivateCar.getTripId(), |
| | | finalOrderPrivateCar.getInsertTime().getTime(), finalOrderPrivateCar.getEndServiceTime().getTime()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | orderCancelMapper.insert(orderCancel); |
| | | |
| | | //修改行程信息 |
| | | try { |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderPrivateCar.getTripId(), null, null, null, null); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderPrivateCar.getTripId(), null, null, null, null); |
| | | if(updateTrip){ |
| | | break; |
| | | } |
| | | Thread.sleep(5000L); |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderPrivateCar.getTripId(), null, null, null, null); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderPrivateCar.getTripId(), null, null, null, null); |
| | | if(updateTrip){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | |
| | |
| | | <!--根据条件查询小件物流订单列表--> |
| | | <select id="getLogisticsOrderList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT ui.nickName as userName,ui.phone as userPhone,CONCAT(di.firstName, " ", di.lastName,'-',di.phone) as driver,CONCAT(cb.`name`,'-',ci.carLicensePlate) as car, |
| | | ot.* FROM t_order_logistics as ot |
| | | ot.*,oc.money as cancel_money FROM t_order_logistics as ot |
| | | LEFT JOIN t_user as ui on ui.id = ot.userId |
| | | LEFT JOIN t_driver as di on di.id = ot.driverId |
| | | LEFT JOIN t_car as ci on ci.id= ot.carId |
| | | LEFT JOIN t_car_brand as cb on cb.id = ci.carBrandId) as o |
| | | LEFT JOIN t_car_brand as cb on cb.id = ci.carBrandId |
| | | left join t_order_cancel as oc on (ot.id = oc.orderId and oc.orderType = 4 and oc.state = 2) |
| | | ) as o |
| | | <where> |
| | | o.isDelete = 1 |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | |
| | | <!--根据条件查询专车订单列表--> |
| | | <select id="getPrivateCarOrderList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT ui.nickName as userName,ui.phone as userPhone,CONCAT(di.firstName, " ", di.lastName,'-',di.phone) as driver,CONCAT(cb.`name`,'-',ci.carLicensePlate) as car, |
| | | sc.chineseName as serverCarModel,ot.* FROM t_order_private_car as ot |
| | | sc.chineseName as serverCarModel,oc.money as cancel_money,ot.* FROM t_order_private_car as ot |
| | | LEFT JOIN t_user as ui on ui.id = ot.userId |
| | | LEFT JOIN t_driver as di on di.id = ot.driverId |
| | | LEFT JOIN t_car as ci on ci.id= ot.carId |
| | | LEFT JOIN t_car_brand as cb on cb.id = ci.carBrandId |
| | | LEFT JOIN t_server_carmodel as sc on sc.id = ot.serverCarModelId |
| | | left join t_order_cancel as oc on (ot.id = oc.orderId and oc.orderType = 1 and oc.state = 2) |
| | | ) as o |
| | | <where> |
| | | o.isDelete = 1 and o.type = 1 |
| | |
| | | select |
| | | aa.time, |
| | | aa.userId, |
| | | aa.userName, |
| | | aa.phone, |
| | | any_value(aa.userName) as userName, |
| | | any_value(aa.phone) as phone, |
| | | sum(aa.amount) as amount, |
| | | sum(aa.tyNum) as tyNum, |
| | | sum(aa.tyUseNum) as tyUseNum, |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.UserRedPacketRecord"> |
| | | <id column="id" property="id"/> |
| | | <result column="money" property="money"/> |
| | | <result column="expirationTime" property="expirationTime"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | <result column="companyId" property="companyId"/> |
| | | <result column="state" property="state"/> |
| | |
| | | d.nickName as `name`, |
| | | d.phone as phone, |
| | | a.money as money, |
| | | DATE_FORMAT(a.expirationTime, '%Y-%m-%d %H:%i:%s') as expirationTime, |
| | | if(a.state = 1, '未使用', if(a.state = 2, '已使用', '已过期')) as state, |
| | | DATE_FORMAT(a.endTime, '%Y-%m-%d %H:%i:%s') as endTime |
| | | from t_user_red_packet_record a |
| | |
| | | end_point.put("longitude", end_lng); |
| | | dropoffPoint.put("point", end_point); |
| | | body.put("dropoffPoint", dropoffPoint); |
| | | logger.info("创建行程请求:{}", body.toJSONString()); |
| | | logger.info("创建行程请求:{} {}", tripId, body.toJSONString()); |
| | | HttpRequest request = post.body(body.toJSONString()); |
| | | HttpResponse response = request.execute(); |
| | | logger.info("创建行程结果:{}", response.body()); |
| | |
| | | dropoffPoint.put("point", end_point); |
| | | body.put("dropoffPoint", dropoffPoint); |
| | | } |
| | | logger.info("修改行程请求:{}", body.toJSONString()); |
| | | logger.info("修改行程请求:{} {}", tripId, body.toJSONString()); |
| | | HttpRequest request = put.body(body.toJSONString()); |
| | | HttpResponse response = request.execute(); |
| | | logger.info("修改行程结果:{}", response.body()); |
| | |
| | | * @return |
| | | */ |
| | | public boolean reportBillableEvent(String tripId) { |
| | | log.info("上报行程:{}", tripId); |
| | | String billableEventId = UUIDUtil.getRandomCode(); |
| | | String url = "https://mobilitybilling.googleapis.com/v1:reportBillableEvent?regionCode=GH&key=" + key + "&billableEventId=" + billableEventId; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | |
| | | <#button name="修改" icon="fa-edit" clickFun="SettlementAllocation.setSettlementAllocation()"/> |
| | | <div class="form-group"> |
| | | <input type="radio" name="type" value="1" ${null != item && item.type == '1' ? 'checked' : ''}> |
| | | 每天 超过 <input type="number" class="date" value="${null != item && item.type == '1' ? item.maxPrice : ''}" style="background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> 必须结算 |
| | | 每天 超过 <input type="number" min="1" class="day" value="${null != item && item.type == '1' ? item.maxPrice : ''}" style="background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> 必须结算 |
| | | </div> |
| | | <div class="form-group"> |
| | | <input type="radio" name="type" value="2" ${null != item && item.type == '2' ? 'checked' : ''}> 每周 |
| | | 每周 每周<input type="number" min="1" max="7" class="date" value="${null != item && item.type == '2' ? item.day : ''}" style="background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> (几)可结算 |
| | | </div> |
| | | <div class="form-group"> |
| | | <input type="radio" name="type" value="3" ${null != item && item.type == '3' ? 'checked' : ''}> 每月 |
| | | 每月 每月<input type="number" min="1" max="31" class="date" value="${null != item && item.type == '3' ? item.day : ''}" style="background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> 号可结算 |
| | | </div> |
| | | <div class="form-group"> |
| | | <input type="radio" name="type" value="2" ${null != item && item.type == '2' ? 'checked' : ''}> 每周 |
| | | 每周 每周<input type="number" min="1" max="7" class="date" value="${null != item && item.type == '2' ? item.day : ''}" style="background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> (几)可结算 |
| | | </div> |
| | | <div class="form-group"> |
| | | 周/月 日上限超过 <input type="number" id="maxPrice" value="${null != item && item.type != '1' ? item.maxPrice : ''}" style="background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> 必须结算 |
| | | 周/月 日上限超过 <input type="number" min="0" id="maxPrice" value="${null != item && item.type != '1' ? item.maxPrice : ''}" style="background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> 必须结算 |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | |
| | | * 删除司机单单返活动 |
| | | */ |
| | | SettlementAllocation.setSettlementAllocation = function () { |
| | | let type = $('input[name="type"]:checked')[0]; |
| | | var type = $($('input[name="type"]:checked')[0]); |
| | | if(typeof type == "undefined"){ |
| | | Feng.error("请选择结算周期"); |
| | | return |
| | | } |
| | | let day = $($(type).siblings('.date')[0]).val(); |
| | | if('' == day || null == day){ |
| | | Feng.error("请输入有效的结算日期") |
| | | return |
| | | if(type.val() == '1'){ |
| | | var day = $(type.siblings('.day')[0]).val(); |
| | | if('' == day || null == day){ |
| | | Feng.error("请输入金额上限") |
| | | return |
| | | } |
| | | }else{ |
| | | var day = $(type.siblings('.date')[0]).val(); |
| | | if('' == day || null == day){ |
| | | Feng.error("请输入有效的结算日期") |
| | | return |
| | | } |
| | | } |
| | | let maxPrice = $('#maxPrice').val(); |
| | | if(1 == $(type).val()){ |
| | | var maxPrice = $('#maxPrice').val(); |
| | | if('1' == type.val()){ |
| | | maxPrice = day; |
| | | } |
| | | // if('' == maxPrice || null == maxPrice){ |
| | | // Feng.error("请输入每日结算金额") |
| | | // return |
| | | // } |
| | | if('' == maxPrice || null == maxPrice){ |
| | | Feng.error("请输入金额上限") |
| | | return |
| | | } |
| | | if(maxPrice < 0){ |
| | | Feng.error("金额上限不能小于0") |
| | | return |
| | | } |
| | | let json = { |
| | | type: $(type).val(), |
| | | type: type.val(), |
| | | day: day, |
| | | maxPrice: maxPrice |
| | | } |
| | |
| | | if(row.orderMoney != '' && row.orderMoney != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.orderMoney + '" onfocus="TUser.tooltip()">' + row.orderMoney + '</p>'] |
| | | } |
| | | if(row.state == 10){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.cancel_money + '" onfocus="TUser.tooltip()">' + row.cancel_money + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | |
| | | if(row.orderMoney != '' && row.orderMoney != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.orderMoney + '" onfocus="TUser.tooltip()">' + row.orderMoney + '</p>'] |
| | | } |
| | | if(row.state == 10){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.cancel_money + '" onfocus="TUser.tooltip()">' + row.cancel_money + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |