| | |
| | | List<Map<String, Object>> scopeList = tCompanyService.getCompanyScopeById(tCompanyId); |
| | | model.addAttribute("scopeList",scopeList); |
| | | |
| | | //计费规则 |
| | | TSystemPrice tSystemPrice = systemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("companyId", tCompanyId) |
| | | .eq("type", 2).last("LIMIT 1")); |
| | | model.addAttribute("contentExclusive",JSONObject.parseObject(tSystemPrice.getContent())); |
| | | |
| | | return PREFIX + "tCompany_detail.html"; |
| | | } |
| | | |
| | |
| | | //经营区域 |
| | | List<Map<String, Object>> scopeList = tCompanyService.getCompanyScopeById(tCompanyId); |
| | | model.addAttribute("scopeList",scopeList); |
| | | //计费规则 |
| | | TSystemPrice tSystemPrice = systemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("companyId", tCompanyId) |
| | | .eq("type", 2).last("LIMIT 1")); |
| | | model.addAttribute("contentExclusive",JSONObject.parseObject(tSystemPrice.getContent())); |
| | | return PREFIX + "tCompany_edit.html"; |
| | | } |
| | | |
| | |
| | | //系统用户对象 |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("roleType", 3).eq("objectId", tCompanyId)); |
| | | model.addAttribute("user",user); |
| | | //计费规则 |
| | | TSystemPrice tSystemPrice = systemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("companyId", tCompanyId) |
| | | .eq("type", 2).last("LIMIT 1")); |
| | | model.addAttribute("contentExclusive",JSONObject.parseObject(tSystemPrice.getContent())); |
| | | return PREFIX + "tCompany_detailFranchisee.html"; |
| | | } |
| | | |
| | |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("roleType", 3).eq("objectId", tCompanyId)); |
| | | model.addAttribute("user",user); |
| | | |
| | | //计费规则 |
| | | TSystemPrice tSystemPrice = systemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("companyId", tCompanyId) |
| | | .eq("type", 2).last("LIMIT 1")); |
| | | model.addAttribute("contentExclusive",JSONObject.parseObject(tSystemPrice.getContent())); |
| | | |
| | | return PREFIX + "tCompany_updateFranchisee.html"; |
| | | } |
| | | |
| | |
| | | // 查询司机订单 |
| | | List<TOrderTaxi> orderTaxiList = orderTaxiService.selectList(new EntityWrapper<TOrderTaxi>() |
| | | .in("driverId", driverIds)); |
| | | // 查询司机所有的扣款 |
| | | List<TPubTransactionDetails> tPubTransactionDetails = pubTransactionDetailsService.selectList(new EntityWrapper<TPubTransactionDetails>() |
| | | // 查询司机所有的收入 |
| | | List<TPubTransactionDetails> tPubTransactionDetailsIncome = pubTransactionDetailsService.selectList(new EntityWrapper<TPubTransactionDetails>() |
| | | .in("userId", driverIds) |
| | | .eq("userType", 2) |
| | | .eq("type", 1) |
| | | .eq("state", 2) |
| | | .eq("orderType", 6)); |
| | | .eq("state",1) |
| | | .eq("orderType", 2)); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | for (Map<String, Object> stringObjectMap : driverList) { |
| | | // 司机id |
| | |
| | | long sumReceivingOrders = orderTaxiList.stream().filter(orderTaxi -> orderTaxi.getDriverId().equals(id)).count(); |
| | | stringObjectMap.put("sumReceivingOrders", sumReceivingOrders); |
| | | // 今日统计收入 |
| | | Optional<BigDecimal> dayReduce = orderTaxiList.stream().filter(orderTaxi -> orderTaxi.getDriverId().equals(id) |
| | | && format.format(orderTaxi.getTravelTime()).equals(format.format(new Date())) |
| | | && orderTaxi.getState() == 6).map(TOrderTaxi::getPayMoney).reduce(BigDecimal::add); |
| | | Optional<BigDecimal> dayReduceOut = tPubTransactionDetails.stream().filter(pubTransactionDetails -> pubTransactionDetails.getUserId().equals(id) |
| | | Optional<BigDecimal> dayReduceIncome = tPubTransactionDetailsIncome.stream().filter(pubTransactionDetails -> pubTransactionDetails.getUserId().equals(id) |
| | | && format.format(pubTransactionDetails.getInsertTime()).equals(format.format(new Date()))) |
| | | .map(TPubTransactionDetails::getMoney).reduce(BigDecimal::add); |
| | | dayReduce.ifPresent(bigDecimal -> stringObjectMap.put("dayIncome", bigDecimal.subtract(dayReduceOut.get()))); |
| | | dayReduceIncome.ifPresent(bigDecimal -> stringObjectMap.put("dayIncome", bigDecimal)); |
| | | |
| | | // 过滤所有统计 |
| | | Optional<BigDecimal> sumReduce = orderTaxiList.stream().filter(orderTaxi -> orderTaxi.getDriverId().equals(id) |
| | | && orderTaxi.getState() == 6).map(TOrderTaxi::getPayMoney).reduce(BigDecimal::add); |
| | | Optional<BigDecimal> sumReduceOut = tPubTransactionDetails.stream().filter(pubTransactionDetails -> pubTransactionDetails.getUserId().equals(id)) |
| | | Optional<BigDecimal> sumReduceIncome = tPubTransactionDetailsIncome.stream().filter(pubTransactionDetails -> pubTransactionDetails.getUserId().equals(id)) |
| | | .map(TPubTransactionDetails::getMoney).reduce(BigDecimal::add); |
| | | sumReduce.ifPresent(bigDecimal -> stringObjectMap.put("sumIncome", bigDecimal.subtract(sumReduceOut.get()))); |
| | | sumReduceIncome.ifPresent(bigDecimal -> stringObjectMap.put("sumIncome", bigDecimal)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | Map<String, Object> tOrderTaxi = tOrderTaxiService.getTaxiOrderDetailById(tOrderTaxiId); |
| | | model.addAttribute("item",tOrderTaxi); |
| | | // 查询司机扣款 |
| | | TPubTransactionDetails tPubTransactionDetails = pubTransactionDetailsService.selectOne(new EntityWrapper<TPubTransactionDetails>() |
| | | List<TPubTransactionDetails> tPubTransactionDetails = pubTransactionDetailsService.selectList(new EntityWrapper<TPubTransactionDetails>() |
| | | .eq("userId", tOrderTaxi.get("driverId")) |
| | | .eq("state", 2) |
| | | .eq("orderId", tOrderTaxi.get("id")) |
| | | .eq("type", 1) |
| | | .eq("userType", 2) |
| | | .eq("orderType", 6) |
| | | .last("LIMIT 1")); |
| | | model.addAttribute("companyMoney",tPubTransactionDetails.getMoney()); |
| | | model.addAttribute("driverMoney",new BigDecimal(tOrderTaxi.get("payMoney").toString()).subtract(tPubTransactionDetails.getMoney())); |
| | | .eq("userType", 2)); |
| | | if(CollectionUtils.isEmpty(tPubTransactionDetails)){ |
| | | model.addAttribute("companyMoney",""); |
| | | model.addAttribute("driverMoney",""); |
| | | }else { |
| | | TPubTransactionDetails pubTransactionDetailCompany = tPubTransactionDetails.stream().filter(e -> e.getOrderType().equals(6)).findFirst().orElse(null); |
| | | if(Objects.nonNull(pubTransactionDetailCompany)){ |
| | | model.addAttribute("companyMoney",pubTransactionDetailCompany.getMoney()); |
| | | }else { |
| | | model.addAttribute("companyMoney",""); |
| | | } |
| | | TPubTransactionDetails pubTransactionDetailDriver = tPubTransactionDetails.stream().filter(e -> e.getOrderType().equals(2)).findFirst().orElse(null); |
| | | if(Objects.nonNull(pubTransactionDetailCompany)){ |
| | | model.addAttribute("driverMoney",pubTransactionDetailDriver.getMoney()); |
| | | }else { |
| | | model.addAttribute("driverMoney",""); |
| | | } |
| | | } |
| | | if(tOrderTaxi.get("payManner").equals("1")){ |
| | | model.addAttribute("payMannerStr","线上收款"); |
| | | }else { |
| | |
| | | tOrderTaxi.setSubstitute(0); |
| | | tOrderTaxi.setOrderSource(5); |
| | | tOrderTaxi.setIsDelete(1); |
| | | tOrderTaxi.setPayManner(3); |
| | | tOrderTaxiService.insert(tOrderTaxi); |
| | | if(tOrderTaxi.getState() == 1){ |
| | | //推送司机抢单 |
| | |
| | | |
| | | <!--查询所有总收益--> |
| | | <select id="getAllIncomeMoney" resultType="java.lang.Double"> |
| | | SELECT IFNULL(SUM(money),0) as value FROM t_income where userType = 1 |
| | | SELECT IFNULL(SUM(money),0) as value FROM t_pub_transaction_details where userType = 2 and orderType = 6 |
| | | <if test="companyId != null and companyId != ''"> |
| | | and objectId = #{companyId} |
| | | and companyId = #{companyId} |
| | | </if> |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND (insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | |
| | | * 订单id |
| | | */ |
| | | private Integer orderId; |
| | | /** |
| | | * 公司id |
| | | */ |
| | | private Integer companyId; |
| | | |
| | | public Integer getCompanyId() { |
| | | return companyId; |
| | | } |
| | | |
| | | public void setCompanyId(Integer companyId) { |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | // Map<String, String> distance1 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, value, 0);//计算距离 |
| | | Map<String, Double> distance1 = geodesyUtil.getDistance(lon + "," + lat, value); |
| | | double d = Double.valueOf(distance1.get("WGS84")).doubleValue(); |
| | | System.out.println("d="+d+",distance="+distance); |
| | | System.err.println("d="+d+",distance="+distance); |
| | | if(d < (distance * 1000)){ |
| | | list.add(driver); |
| | | } |
| | | } |
| | | } |
| | | System.out.println(list.size()); |
| | | System.err.println("满足条件司机=="+list); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | <label class="col-sm-2 control-label">起步价设置:</label> |
| | | <div class="col-sm-10"> |
| | | 起步价为 <input type="text" onblur="checkIsYuan(this)" name="num1" id="num1" value="${contentExclusive.num1}" class="form-control newWidth" placeholder="最多3位数"/> 元, |
| | | 起步包含 <input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num2" id="num2" value="${contentExclusive.num2}" class="form-control newWidth" placeholder="最多3位数"/> 公里, |
| | | 起步包含 <input type="text" onblur="checkIsGongLi(this, 'content')" name="num2" id="num2" value="${contentExclusive.num2}" class="form-control newWidth" placeholder="最多3位数"/> 公里, |
| | | <input type="text" onblur="checkIsMinute(this)" name="num3" id="num3" value="${contentExclusive.num3}" class="form-control newWidth" placeholder="最多3位数"/> 分钟 |
| | | <br/> |
| | | </div> |
| | |
| | | <div class="form-group waitFee"> |
| | | <label class="col-sm-2 control-label">等待费设置:</label> |
| | | <div class="col-sm-10"> |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | | 为 <input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" class="form-control newWidth" placeholder="最多3位数"/> 元/分,不足一分钟按照一分钟计算 |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" value="${contentExclusive.num29}" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | | 为 <input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" value="${contentExclusive.num30}" class="form-control newWidth" placeholder="最多3位数"/> 元/分,不足一分钟按照一分钟计算 |
| | | <br/> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">远途费设置:</label> |
| | | <div class="col-sm-10"> |
| | | 总里程超过 <input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num6" id="num6" value="${contentExclusive.num6}" class="form-control newWidth" placeholder="最多3位数"/> 公里 |
| | | 不足 <input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num7" id="num7" value="${contentExclusive.num7}" class="form-control newWidth" placeholder="最多3位数"/> 公里, |
| | | 超出部分每公里加收 <input type="text" onblur="checkIsYuan(this, 'exclusivePriceSettings')" name="num8" id="num8" value="${contentExclusive.num8}" class="form-control newWidth" placeholder="最多3位数"/> 元 |
| | | 总里程超过 <input type="text" onblur="checkIsGongLi(this, 'content')" name="num6" id="num6" value="${contentExclusive.num6}" class="form-control newWidth" placeholder="最多3位数"/> 公里 |
| | | 不足 <input type="text" onblur="checkIsGongLi(this, 'content')" name="num7" id="num7" value="${contentExclusive.num7}" class="form-control newWidth" placeholder="最多3位数"/> 公里, |
| | | 超出部分每公里加收 <input type="text" onblur="checkIsYuan(this, 'content')" name="num8" id="num8" value="${contentExclusive.num8}" class="form-control newWidth" placeholder="最多3位数"/> 元 |
| | | <br> |
| | | <br> |
| | | 超过 <input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num9" id="num9" value="${contentExclusive.num9}" class="form-control newWidth" placeholder="最多3位数"/> 公里 |
| | | 不足 <input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num10" id="num10" value="${contentExclusive.num10}" class="form-control newWidth" placeholder="最多3位数"/> 公里时, |
| | | 超过 <input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num9" id="num9" value="${contentExclusive.num9}" class="form-control newWidth" placeholder="最多3位数"/> 公里 |
| | | 不足 <input type="text" onblur="checkIsGongLi(this, 'content')" name="num10" id="num10" value="${contentExclusive.num10}" class="form-control newWidth" placeholder="最多3位数"/> 公里时, |
| | | 超出部分每公里加收 <input type="text" onblur="checkIsYuan(this)" name="num11" id="num11" value="${contentExclusive.num11}" class="form-control newWidth" placeholder="最多3位数"/> 元 |
| | | <br/> |
| | | <br> |
| | | 超过 <input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num12" id="num12" value="${contentExclusive.num12}" class="form-control newWidth" placeholder="最多3位数"/> 公里以后, |
| | | 超过 <input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num12" id="num12" value="${contentExclusive.num12}" class="form-control newWidth" placeholder="最多3位数"/> 公里以后, |
| | | 超出部分每公里加收 <input type="text" onblur="checkIsYuan(this)" name="num13" id="num13" value="${contentExclusive.num13}" class="form-control newWidth" placeholder="最多3位数"/> 元 |
| | | <br/> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">是否需要摆渡车:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="isNeedFerry1" value="1" disabled name="isNeedFerry" ${1 == item.isNeedFerry ? 'checked=checked' : ''} > |
| | | <label for="isNeedFerry1"> 是 </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="isNeedFerry2" value="2" disabled name="isNeedFerry" ${2 == item.isNeedFerry ? 'checked=checked' : ''}> |
| | | <label for="isNeedFerry2"> 否 </label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="form-group">--> |
| | | <!-- <label class="col-sm-2 control-label">是否需要摆渡车:</label>--> |
| | | <!-- <div class="col-sm-9" style="display: flex;align-items: center;">--> |
| | | <!-- <div class="radio radio-info radio-inline">--> |
| | | <!-- <input type="radio" id="isNeedFerry1" value="1" disabled name="isNeedFerry" ${1 == item.isNeedFerry ? 'checked=checked' : ''} >--> |
| | | <!-- <label for="isNeedFerry1"> 是 </label>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="radio radio-success radio-inline">--> |
| | | <!-- <input type="radio" id="isNeedFerry2" value="2" disabled name="isNeedFerry" ${2 == item.isNeedFerry ? 'checked=checked' : ''}>--> |
| | | <!-- <label for="isNeedFerry2"> 否 </label>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="form-group waitFee"> |
| | | <label class="col-sm-2 control-label">等待费设置:</label> |
| | | <div class="col-sm-10"> |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | | 为 <input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" class="form-control newWidth" placeholder="最多3位数"/> 元/分,不足一分钟按照一分钟计算 |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" value="${contentExclusive.num29}" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | | 为 <input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" value="${contentExclusive.num30}" class="form-control newWidth" placeholder="最多3位数"/> 元/分,不足一分钟按照一分钟计算 |
| | | <br/> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="form-group waitFee"> |
| | | <label class="col-sm-2 control-label">等待费设置:</label> |
| | | <div class="col-sm-10"> |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | | 为 <input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" class="form-control newWidth" placeholder="最多3位数"/> 元/分,不足一分钟按照一分钟计算 |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" value="${contentExclusive.num29}" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | | 为 <input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" value="${contentExclusive.num30}" class="form-control newWidth" placeholder="最多3位数"/> 元/分,不足一分钟按照一分钟计算 |
| | | <br/> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="form-group waitFee"> |
| | | <label class="col-sm-2 control-label">等待费设置:</label> |
| | | <div class="col-sm-10"> |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | | 为 <input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" class="form-control newWidth" placeholder="最多3位数"/> 元/分,不足一分钟按照一分钟计算 |
| | | 司机到达预约地点 <input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" value="${contentExclusive.num29}" class="form-control newWidth" placeholder="最多3位数"/> 分钟过后开始收取等待费, |
| | | 为 <input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" value="${contentExclusive.num30}" class="form-control newWidth" placeholder="最多3位数"/> 元/分,不足一分钟按照一分钟计算 |
| | | <br/> |
| | | </div> |
| | | </div> |