| | |
| | | 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", 6) |
| | | .eq("payState", 2) |
| | | .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){ |
| | | //推送司机抢单 |