无关风月
2025-01-16 c3e5e631dbb19f1fbdc4ceb99b775354c303a92a
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/XianNingChuXing
29个文件已修改
1097 ■■■■ 已修改文件
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/CallbackController.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/ZiOnController.java 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/HistoryVo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TransactionDetails.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITransactionDetailsService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TransactionDetailsServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MoneyInfoWarpper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTaxiMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TPubTransactionDetails.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_addFranchisee.html 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_detail.html 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_detailFranchisee.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_edit.html 199 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_updateFranchisee.html 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Company.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/controller/OrderTaxiController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/dao/mapping/OrderTaxiMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/model/TransactionDetails.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/IOrderTaxiService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/ITransactionDetailsService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/TransactionDetailsServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/warpper/OrderTaxiWarpper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/CallbackController.java
@@ -1,6 +1,12 @@
package com.stylefeng.guns.modular.api;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.model.TransactionDetails;
import com.stylefeng.guns.modular.system.service.IDriverService;
import com.stylefeng.guns.modular.system.service.IReassignService;
import com.stylefeng.guns.modular.system.service.ITransactionDetailsService;
import com.stylefeng.guns.modular.system.util.PayMoneyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -9,6 +15,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.util.Map;
/**
@@ -78,4 +85,43 @@
            e.printStackTrace();
        }
    }
    @Autowired
    private ITransactionDetailsService transactionDetailsService;
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Autowired
    private IDriverService driverService;
    @ResponseBody
    @PostMapping("/wxRecharge")
    public void wxRecharge(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            if (null != map) {
                String out_trade_no = map.get("out_trade_no");
                String transaction_id = map.get("transaction_id");
                String result = map.get("result");
                TransactionDetails transactionDetails = transactionDetailsService.selectOne(new EntityWrapper<TransactionDetails>()
                        .eq("code", out_trade_no));
                if (transactionDetails!=null){
                    if (transactionDetails.getState()==2){
                        return;
                    }
                    Driver driver = driverService.selectById(transactionDetails.getUserId());
                    if (driver!=null){
                        driver.setBalance(driver.getBalance() + transactionDetails.getMoney());
                        driverService.updateById(driver);
                    }
                    transactionDetails.setState(2);
                    transactionDetailsService.updateById(transactionDetails);
                    PrintWriter out = response.getWriter();
                    out.write(result);
                    out.flush();
                    out.close();
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/ZiOnController.java
@@ -1,4 +1,5 @@
package com.stylefeng.guns.modular.api;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
@@ -11,8 +12,10 @@
import com.stylefeng.guns.modular.system.dao.TUseMoneyMapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.PayMoneyUtil;
import com.stylefeng.guns.modular.system.util.PushUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.UUIDUtil;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
@@ -60,10 +63,10 @@
    private IWithdrawalService withdrawalService;
    @Autowired
    private ITRechargeMoneyService rechargeMoneyService;
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Autowired
    private TUseMoneyMapper useMoneyMapper;
    @ResponseBody
    @PostMapping ("/money/get")
    @ApiOperation(value = "拿到后台配置的充值金额")
@@ -80,9 +83,39 @@
    @ResponseBody
    @PostMapping ("/recharge")
    @ApiOperation(value = "微信充值操作")
    public ResultUtil recharge(BigDecimal money,HttpServletRequest request){
        return ResultUtil.success();
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
            @ApiImplicitParam(value = "充值金额", name = "money", required = true, dataType = "double"),
    })
    public ResultUtil recharge(BigDecimal money,HttpServletRequest request) throws Exception {
        Integer uid = driverService.getUserIdFormRedis(request);
        if (null == uid) {
            return ResultUtil.tokenErr();
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String s = sdf.format(new Date()) + UUIDUtil.getRandomCode(3);
        ResultUtil weixinpay = payMoneyUtil.weixinpay("充值",
                "",
                s,
                money.toString(),
                "/base/wxRecharge",
                "APP");
        if (weixinpay.getCode()==200){
            // 新增扣除使用费记录
            TransactionDetails transactionDetails = new TransactionDetails();
            transactionDetails.setCode(s);
            transactionDetails.setUserId(uid);
            transactionDetails.setInsertTime(new Date());
            transactionDetails.setRemark("充值");
            // 将money转化为double类型
            transactionDetails.setMoney(money.doubleValue());
            transactionDetails.setState(1);
            transactionDetails.setType(1);
            transactionDetails.setUserType(2);
            transactionDetails.setOrderType(5);
            iTransactionDetailsService.insert(transactionDetails);
        }
        return weixinpay;
    }
@@ -231,13 +264,21 @@
            if (state!=null&&state==2){
                eq.eq("state",2);
            }
            eq.orderBy("insertTime",false);
            List<TransactionDetails> transactionDetails = iTransactionDetailsService.selectList(eq);
            if ((state!=null&&state==1)||(state!=null&&state==2)){
                List<HistoryVo> historyVos = new ArrayList<>();
                for (TransactionDetails transactionDetail : transactionDetails) {
                    HistoryVo historyVo  = new HistoryVo();
                    if (transactionDetail.getState()==1){
                        historyVo.setState("充值");
                        switch (transactionDetail.getOrderType()){
                            case 2:
                                historyVo.setState("订单收入");
                                break;
                            default:
                                historyVo.setState("充值");
                                break;
                        }
                        historyVo.setAddordown(1);
                    }else {
                        historyVo.setState("扣除");
@@ -262,7 +303,14 @@
            for (TransactionDetails transactionDetail : transactionDetails) {
                HistoryVo historyVo  = new HistoryVo();
                if (transactionDetail.getState()==1){
                    historyVo.setState("充值");
                    switch (transactionDetail.getOrderType()){
                        case 2:
                            historyVo.setState("订单收入");
                            break;
                        default:
                            historyVo.setState("充值");
                            break;
                    }
                    historyVo.setAddordown(1);
                }else {
                    historyVo.setState("扣除");
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/HistoryVo.java
@@ -9,6 +9,7 @@
public class HistoryVo {
    Date createTime;
    String state;
    // 0减少 1增加
    Integer addordown;
    Double money;
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TransactionDetails.java
@@ -23,6 +23,8 @@
     */
    @TableField("userId")
    private Integer userId;
    @TableField("code")
    private String code;
    /**
     * 添加时间
     */
@@ -68,6 +70,27 @@
     */
    @TableField("placeOrderWay")
    private Integer placeOrderWay;
    /**
     * 公司id
     */
    @TableField("companyId")
    private Integer companyId;
    public Integer getCompanyId() {
        return companyId;
    }
    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public Integer getPlaceOrderWay() {
        return placeOrderWay;
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITransactionDetailsService.java
@@ -20,4 +20,18 @@
     */
    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 saveData(Integer userId, String remark, Double money, Integer state,
                  Integer type, Integer userType, Integer orderType, Integer orderId,Integer companyId) throws Exception;
}
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TransactionDetailsServiceImpl.java
@@ -41,4 +41,20 @@
        transactionDetails.setUserType(userType);
        this.insert(transactionDetails);
    }
    @Override
    public void saveData(Integer userId, String remark, Double money, Integer state, Integer type, Integer userType, Integer orderType, Integer orderId, Integer companyId) 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.setCompanyId(companyId);
        this.insert(transactionDetails);
    }
}
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MoneyInfoWarpper.java
@@ -44,6 +44,16 @@
    private Double discountMoney;
    @ApiModelProperty("折扣")
    private Double discount;
    @ApiModelProperty("平台服务费")
    private Double platformFee;
    public Double getPlatformFee() {
        return platformFee;
    }
    public void setPlatformFee(Double platformFee) {
        this.platformFee = platformFee;
    }
    public Double getOrderMoney() {
        return orderMoney;
@@ -223,6 +233,7 @@
            moneyInfoWarpper.setCouponMoney(null != map.get("couponMoney") ? Double.valueOf(map.get("couponMoney").toString()) : 0D);
            moneyInfoWarpper.setDiscountMoney(null != map.get("discountMoney") ? Double.valueOf(map.get("discountMoney").toString()) : 0D);
            moneyInfoWarpper.setDiscount(null != map.get("discount") ? Double.valueOf(map.get("discount").toString()) : 0D);
            moneyInfoWarpper.setPlatformFee(null != map.get("platformFee") ? Double.valueOf(map.get("platformFee").toString()) : 0D);
        }
        return moneyInfoWarpper;
    }
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -46,7 +46,8 @@
    @Autowired
    private GDMapElectricFenceUtil gdMapElectricFenceUtil;
    @Autowired
    private ITransactionDetailsService transactionDetailsService;
    @Autowired
    private GDFalconUtil gdFalconUtil;
@@ -208,7 +209,22 @@
            Company company = companyService.selectById(driver.getCompanyId());
            orderTaxi.setState(9);
            driver.setState(2);
            driver.setBalance(driver.getBalance() - company.getFixedDeduction());
//            driver.setBalance(driver.getBalance() - company.getFixedDeduction());
            if(Objects.isNull(company)){
                company = companyService.selectById(driver.getCompanyId());
            }
            // 平台收入
            double money;
            if(orderTaxi.getOrderSource() == 2 || orderTaxi.getOrderSource() == 3){
                double v = company.getPercentageDeduction() / 100;
                money = v * orderTaxi.getOrderMoney();
            }else {
                money = company.getFixedDeduction();
            }
            driver.setBalance(driver.getBalance() - money);
            // 新增扣除使用费记录
            transactionDetailsService.saveData(driver.getId(), "软件使用费", money, 2, 1, 2, 6, orderTaxi.getId(),company.getId());
            driverService.updateById(driver);
            Car car = carService.selectById(driver.getCarId());
@@ -438,33 +454,37 @@
                orderTaxi.setGetoffLat(lat);
                orderTaxi.setGetoffAddress(address);
                orderTaxi.setGetoffTime(new Date());
                orderTaxi.setState(6);
                if(orderTaxi.getPayManner()==3){
                    orderTaxi.setState(9);
                }else {
                    orderTaxi.setState(6);
                }
                orderTaxi.setEndServiceTime(new Date());
//                List<TUseMoney> money = useMoneyMapper.selectList(null);
                Driver driver = driverService.selectById(orderTaxi.getDriverId());
                Company company = companyService.selectById(driver.getCompanyId());
                TransactionDetails transactionDetails = new TransactionDetails();
                if(orderTaxi.getOrderSource() == 2 || orderTaxi.getOrderSource() == 3){
                    double v = company.getPercentageDeduction() / 100;
                    v = v * orderTaxi.getOrderMoney();
                    driver.setBalance(driver.getBalance() - v);
                    transactionDetails.setMoney(v);
                }else {
                    driver.setBalance(driver.getBalance() - company.getFixedDeduction());
                    transactionDetails.setMoney(company.getFixedDeduction());
                }
                // 新增扣除使用费记录
                transactionDetails.setUserId(driver.getId());
                transactionDetails.setInsertTime(new Date());
                transactionDetails.setRemark("软件使用费");
                transactionDetails.setState(2);
                transactionDetails.setType(1);
                transactionDetails.setUserType(2);
                transactionDetails.setOrderType(6);
                transactionDetails.setOrderId(orderTaxi.getId());
                transactionDetailsMapper.insert(transactionDetails);
                driverService.updateById(driver);
//                Driver driver = driverService.selectById(orderTaxi.getDriverId());
//                Company company = companyService.selectById(driver.getCompanyId());
//                TransactionDetails transactionDetails = new TransactionDetails();
//                if(orderTaxi.getOrderSource() == 2 || orderTaxi.getOrderSource() == 3){
//                    double v = company.getPercentageDeduction() / 100;
//                    v = v * orderTaxi.getOrderMoney();
//                    driver.setBalance(driver.getBalance() - v);
//                    transactionDetails.setMoney(v);
//                }else {
//                    driver.setBalance(driver.getBalance() - company.getFixedDeduction());
//                    transactionDetails.setMoney(company.getFixedDeduction());
//                }
//                // 新增扣除使用费记录
//                transactionDetails.setUserId(driver.getId());
//                transactionDetails.setInsertTime(new Date());
//                transactionDetails.setRemark("软件使用费");
//                transactionDetails.setState(2);
//                transactionDetails.setType(1);
//                transactionDetails.setUserType(2);
//                transactionDetails.setOrderType(6);
//                transactionDetails.setOrderId(orderTaxi.getId());
//                transactionDetailsMapper.insert(transactionDetails);
//                driverService.updateById(driver);
                pushUtil.removeTask(orderId, 2);//删除定时任务,结束推送数据
                systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderTaxi.getUserId());
                break;
@@ -500,9 +520,11 @@
        if(type == 2){//其他支付,不需要操作,直接完成订单
            orderTaxi = this.setMoney1(orderTaxi, travelFee, parkingFee, crossingFee);
            orderTaxi.setState(7);
        }else{
        }else if (type == 1){
            orderTaxi = this.setMoney2(orderTaxi, parkingFee, crossingFee);
            orderTaxi.setState(7);
        }else {
            orderTaxi.setState(8);
        }
        this.updateById(orderTaxi);
@@ -776,10 +798,18 @@
        if(orderTaxi.getState() == 5 || orderTaxi.getState() == 6){//服务中的时候获取实时费用数据
            if(orderTaxi.getPayManner() == 2){//其他支付,不需要操作,直接完成订单
                orderTaxi = this.setMoney1(orderTaxi, 0D, 0D, 0D);
            }else{
            }else if(orderTaxi.getPayManner() == 1){
                orderTaxi = this.setMoney2(orderTaxi, 0D, 0D);
            }else {
                // 无
            }
        }
        // 查询平台服务费
        TransactionDetails transactionDetails = transactionDetailsService.selectOne(new EntityWrapper<TransactionDetails>()
                .eq("orderId", orderId)
                .eq("orderType", 6)
                .last("LIMIT 1"));
        Map<String, Object> map = new HashMap<>();
        map.put("orderMoney", orderTaxi.getOrderMoney());//订单金额
@@ -799,6 +829,7 @@
        map.put("couponMoney", orderTaxi.getCouponMoney());//优惠券抵扣金额
        map.put("discountMoney", orderTaxi.getDiscountMoney());//折扣抵扣金额
        map.put("discount", orderTaxi.getDiscount());//折扣
        map.put("platformFee", transactionDetails.getMoney());//折扣
        return map;
    }
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java
@@ -145,6 +145,11 @@
        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";
    }
@@ -168,6 +173,10 @@
        //经营区域
        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";
    }
@@ -192,6 +201,10 @@
        //系统用户对象
        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";
    }
@@ -219,6 +232,11 @@
        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";
    }
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
@@ -586,13 +586,13 @@
        // 查询司机订单
        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
@@ -625,19 +625,15 @@
                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));
            }
        }
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java
@@ -14,6 +14,7 @@
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;
@@ -106,15 +107,28 @@
        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 {
@@ -390,6 +404,7 @@
            tOrderTaxi.setSubstitute(0);
            tOrderTaxi.setOrderSource(5);
            tOrderTaxi.setIsDelete(1);
            tOrderTaxi.setPayManner(3);
            tOrderTaxiService.insert(tOrderTaxi);
            if(tOrderTaxi.getState() == 1){
                //推送司机抢单
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTaxiMapper.xml
@@ -250,9 +250,9 @@
    <!--查询所有总收益-->
    <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'))
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TPubTransactionDetails.java
@@ -62,7 +62,18 @@
     * 订单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;
ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
@@ -83,13 +83,13 @@
//                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;
    }
}
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_addFranchisee.html
@@ -114,7 +114,7 @@
                                <label class="col-sm-2 control-label">起步价设置:</label>
                                <div class="col-sm-10">
                                    起步价为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num1" id="num1" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元,
                                    起步包含&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num2" id="num2"  class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                    起步包含&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num2" id="num2"  class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                    &nbsp;<input type="text" onblur="checkIsMinute(this)" name="num3" id="num3"  class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟
                                    <br/>
                                </div>
@@ -148,17 +148,17 @@
                            <div class="form-group">
                                <label class="col-sm-2 control-label">远途费设置:</label>
                                <div class="col-sm-10">
                                    总里程超过&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num6" id="num6"  class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                    不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num7" id="num7" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                    超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this, 'exclusivePriceSettings')" name="num8" id="num8" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                    总里程超过&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num6" id="num6"  class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                    不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num7" id="num7" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                    超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this, 'content')" name="num8" id="num8" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                    <br>
                                    <br>
                                    超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num9" id="num9" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                    不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num10" id="num10" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里时,
                                    超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num9" id="num9" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                    不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num10" id="num10" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里时,
                                    超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num11" id="num11" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                    <br/>
                                    <br>
                                    超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num12" id="num12" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里以后,
                                    超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num12" id="num12" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里以后,
                                    超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num13" id="num13" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                    <br/>
                                </div>
@@ -367,19 +367,19 @@
    });
    laydate.render({
        elem: '.onePriceSetting #num14'
        elem: '.content #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.onePriceSetting #num21'
        elem: '.content #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.onePriceSetting #num22'
        elem: '.content #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_detail.html
@@ -135,7 +135,7 @@
                            <label class="col-sm-2 control-label">起步价设置:</label>
                            <div class="col-sm-10">
                                起步价为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num1" id="num1" value="${contentExclusive.num1}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元,
                                起步包含&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num2" id="num2" value="${contentExclusive.num2}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                起步包含&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num2" id="num2" value="${contentExclusive.num2}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                &nbsp;<input type="text" onblur="checkIsMinute(this)" name="num3" id="num3" value="${contentExclusive.num3}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟
                                <br/>
                            </div>
@@ -160,8 +160,8 @@
                        <div class="form-group waitFee">
                            <label class="col-sm-2 control-label">等待费设置:</label>
                            <div class="col-sm-10">
                                司机到达预约地点&nbsp;<input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟过后开始收取等待费,
                                为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元/分,不足一分钟按照一分钟计算
                                司机到达预约地点&nbsp;<input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" value="${contentExclusive.num29}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟过后开始收取等待费,
                                为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" value="${contentExclusive.num30}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元/分,不足一分钟按照一分钟计算
                                <br/>
                            </div>
                        </div>
@@ -169,17 +169,17 @@
                        <div class="form-group">
                            <label class="col-sm-2 control-label">远途费设置:</label>
                            <div class="col-sm-10">
                                总里程超过&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num6" id="num6" value="${contentExclusive.num6}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num7" id="num7" value="${contentExclusive.num7}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this, 'exclusivePriceSettings')" name="num8" id="num8" value="${contentExclusive.num8}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                总里程超过&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num6" id="num6" value="${contentExclusive.num6}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num7" id="num7" value="${contentExclusive.num7}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this, 'content')" name="num8" id="num8" value="${contentExclusive.num8}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                <br>
                                <br>
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num9" id="num9" value="${contentExclusive.num9}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num10" id="num10" value="${contentExclusive.num10}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里时,
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num9" id="num9" value="${contentExclusive.num9}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num10" id="num10" value="${contentExclusive.num10}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里时,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num11" id="num11" value="${contentExclusive.num11}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                <br/>
                                <br>
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num12" id="num12" value="${contentExclusive.num12}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里以后,
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num12" id="num12" value="${contentExclusive.num12}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里以后,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num13" id="num13" value="${contentExclusive.num13}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                <br/>
                            </div>
@@ -277,19 +277,19 @@
                        </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>
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_detailFranchisee.html
@@ -62,8 +62,8 @@
                    <div class="form-group waitFee">
                        <label class="col-sm-2 control-label">等待费设置:</label>
                        <div class="col-sm-10">
                            司机到达预约地点&nbsp;<input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟过后开始收取等待费,
                            为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元/分,不足一分钟按照一分钟计算
                            司机到达预约地点&nbsp;<input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" value="${contentExclusive.num29}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟过后开始收取等待费,
                            为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" value="${contentExclusive.num30}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元/分,不足一分钟按照一分钟计算
                            <br/>
                        </div>
                    </div>
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_edit.html
@@ -114,13 +114,13 @@
                    </div>
                    <div class="form-group exclusivePriceSettings">
                    <div class="form-group content">
                        <h3 style="color: #377CCD;margin-bottom: 20px;">在线计费规则</h3>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">起步价设置:</label>
                            <div class="col-sm-10">
                                起步价为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num1" id="num1" value="${contentExclusive.num1}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元,
                                起步包含&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num2" id="num2" value="${contentExclusive.num2}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                起步包含&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num2" id="num2" value="${contentExclusive.num2}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                &nbsp;<input type="text" onblur="checkIsMinute(this)" name="num3" id="num3" value="${contentExclusive.num3}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟
                                <br/>
                            </div>
@@ -145,8 +145,8 @@
                        <div class="form-group waitFee">
                            <label class="col-sm-2 control-label">等待费设置:</label>
                            <div class="col-sm-10">
                                司机到达预约地点&nbsp;<input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟过后开始收取等待费,
                                为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元/分,不足一分钟按照一分钟计算
                                司机到达预约地点&nbsp;<input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" value="${contentExclusive.num29}" class="form-control newWidth"  placeholder="最多3位数"/>&nbsp;分钟过后开始收取等待费,
                                为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" value="${contentExclusive.num30}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元/分,不足一分钟按照一分钟计算
                                <br/>
                            </div>
                        </div>
@@ -154,17 +154,17 @@
                        <div class="form-group">
                            <label class="col-sm-2 control-label">远途费设置:</label>
                            <div class="col-sm-10">
                                总里程超过&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num6" id="num6" value="${contentExclusive.num6}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num7" id="num7" value="${contentExclusive.num7}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this, 'exclusivePriceSettings')" name="num8" id="num8" value="${contentExclusive.num8}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                总里程超过&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num6" id="num6" value="${contentExclusive.num6}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num7" id="num7" value="${contentExclusive.num7}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this, 'content')" name="num8" id="num8" value="${contentExclusive.num8}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                <br>
                                <br>
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num9" id="num9" value="${contentExclusive.num9}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num10" id="num10" value="${contentExclusive.num10}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里时,
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num9" id="num9" value="${contentExclusive.num9}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num10" id="num10" value="${contentExclusive.num10}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里时,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num11" id="num11" value="${contentExclusive.num11}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                <br/>
                                <br>
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num12" id="num12" value="${contentExclusive.num12}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里以后,
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num12" id="num12" value="${contentExclusive.num12}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里以后,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num13" id="num13" value="${contentExclusive.num13}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                <br/>
                            </div>
@@ -307,7 +307,186 @@
    laydate.render({
        elem: '#licenseEndTime'
    });
    laydate.render({
        elem: '.p1 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p1 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p1 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p2 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p2 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p2 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p3 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p3 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p3 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp1 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp1 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp1 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp2 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp2 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp2 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp3 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp3 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp3 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.exclusivePriceSettings #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.exclusivePriceSettings #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.exclusivePriceSettings #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.content #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.content #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.content #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    var regDouble = /^(0|[1-9]\d{0,2})(\.\d{1,2})?$/;
    var regInt = /^[0-9]{0,3}$/;
    function checkIsYuan(obj){
        var num = $(obj).val();
        if(!regDouble.test(num)){
            layer.msg("【元】输入框不能超过3位数,保留两位小数");
            $(obj).val('');
        }
    }
    function checkIsGongLi(obj, clazz){
        var num = $(obj).val();
        if(!regDouble.test(num)){
            layer.msg("【公里】输入框不能超过3位数,保留两位小数");
            $(obj).val('');
        }
        if (obj.id == "num7"){
            $("." + clazz + " #num9").val(num);
        }else if (obj.id == "num10"){
            $("." + clazz + " #num12").val(num);
        }
    }
    function checkIsMinute(obj){
        var num = $(obj).val();
        if(!regInt.test(num)){
            layer.msg("【分钟】输入框不能超过3位数");
            $(obj).val('');
        }
    }
    $(function() {
        TCompanyInfoDlg.checkbox2();
ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCompany/tCompany_updateFranchisee.html
@@ -39,13 +39,13 @@
                    </div>
                    <div class="form-group exclusivePriceSettings">
                    <div class="form-group content">
                        <h3 style="color: #377CCD;margin-bottom: 20px;">在线计费规则</h3>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">起步价设置:</label>
                            <div class="col-sm-10">
                                起步价为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num1" id="num1" value="${contentExclusive.num1}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元,
                                起步包含&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num2" id="num2" value="${contentExclusive.num2}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                起步包含&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num2" id="num2" value="${contentExclusive.num2}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                &nbsp;<input type="text" onblur="checkIsMinute(this)" name="num3" id="num3" value="${contentExclusive.num3}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟
                                <br/>
                            </div>
@@ -70,8 +70,8 @@
                        <div class="form-group waitFee">
                            <label class="col-sm-2 control-label">等待费设置:</label>
                            <div class="col-sm-10">
                                司机到达预约地点&nbsp;<input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟过后开始收取等待费,
                                为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元/分,不足一分钟按照一分钟计算
                                司机到达预约地点&nbsp;<input type="text" onblur="checkIsMinute(this)" name="num29" id="num29" value="${contentExclusive.num29}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;分钟过后开始收取等待费,
                                为&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num30" id="num30" value="${contentExclusive.num30}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元/分,不足一分钟按照一分钟计算
                                <br/>
                            </div>
                        </div>
@@ -79,17 +79,17 @@
                        <div class="form-group">
                            <label class="col-sm-2 control-label">远途费设置:</label>
                            <div class="col-sm-10">
                                总里程超过&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num6" id="num6" value="${contentExclusive.num6}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num7" id="num7" value="${contentExclusive.num7}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this, 'exclusivePriceSettings')" name="num8" id="num8" value="${contentExclusive.num8}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                总里程超过&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num6" id="num6" value="${contentExclusive.num6}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num7" id="num7" value="${contentExclusive.num7}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this, 'content')" name="num8" id="num8" value="${contentExclusive.num8}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                <br>
                                <br>
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num9" id="num9" value="${contentExclusive.num9}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num10" id="num10" value="${contentExclusive.num10}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里时,
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num9" id="num9" value="${contentExclusive.num9}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里
                                不足&nbsp;<input type="text" onblur="checkIsGongLi(this, 'content')" name="num10" id="num10" value="${contentExclusive.num10}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里时,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num11" id="num11" value="${contentExclusive.num11}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                <br/>
                                <br>
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'exclusivePriceSettings')" name="num12" id="num12" value="${contentExclusive.num12}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里以后,
                                超过&nbsp;<input type="text" disabled onblur="checkIsGongLi(this, 'content')" name="num12" id="num12" value="${contentExclusive.num12}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;公里以后,
                                超出部分每公里加收&nbsp;<input type="text" onblur="checkIsYuan(this)" name="num13" id="num13" value="${contentExclusive.num13}" class="form-control newWidth" placeholder="最多3位数"/>&nbsp;元
                                <br/>
                            </div>
@@ -215,6 +215,186 @@
</div>
<script src="${ctxPath}/static/modular/system/tCompany/franchisee_info.js"></script>
<script type="application/javascript">
    laydate.render({
        elem: '.p1 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p1 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p1 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p2 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p2 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p2 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p3 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p3 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.p3 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp1 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp1 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp1 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp2 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp2 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp2 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp3 #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp3 #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.wp3 #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.exclusivePriceSettings #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.exclusivePriceSettings #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.exclusivePriceSettings #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.content #num14'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.content #num21'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    laydate.render({
        elem: '.content #num22'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    var regDouble = /^(0|[1-9]\d{0,2})(\.\d{1,2})?$/;
    var regInt = /^[0-9]{0,3}$/;
    function checkIsYuan(obj){
        var num = $(obj).val();
        if(!regDouble.test(num)){
            layer.msg("【元】输入框不能超过3位数,保留两位小数");
            $(obj).val('');
        }
    }
    function checkIsGongLi(obj, clazz){
        var num = $(obj).val();
        if(!regDouble.test(num)){
            layer.msg("【公里】输入框不能超过3位数,保留两位小数");
            $(obj).val('');
        }
        if (obj.id == "num7"){
            $("." + clazz + " #num9").val(num);
        }else if (obj.id == "num10"){
            $("." + clazz + " #num12").val(num);
        }
    }
    function checkIsMinute(obj){
        var num = $(obj).val();
        if(!regInt.test(num)){
            layer.msg("【分钟】输入框不能超过3位数");
            $(obj).val('');
        }
    }
    $(function() {
        FranchiseeInfoDlg.checkbox2();
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -28,6 +28,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -90,6 +91,8 @@
    @Autowired
    private IOrderCancelService orderCancelService;
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Value("${pushMinistryOfTransport}")
    private boolean pushMinistryOfTransport;
@@ -1247,33 +1250,37 @@
    @PostMapping("/base/wxPayOrderTaxi")
    public void wxPayOrderTaxi(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = icbcPayUtil.payCallback(request);
            System.out.println("完成订单微信支付回调");
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            System.out.println("wx支付信息:"+map);
            if(null != map){
                String order_id = map.get("transaction_id");
                String out_trade_no = map.get("out_trade_no");
                String order_id = map.get("order_id");
                String s = icbcPayUtil.queryTransaction("", order_id);
                if(s.equals("0")){
                    icbcPayUtil.answer(response);//回调应答
                }
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id) && s.equals("0")){
                    String[] split = out_trade_no.split(",");
                String result = map.get("result");
                String total_fee = map.get("total_fee");
                String transaction_id = map.get("transaction_id");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    PrintWriter out = response.getWriter();
                    out.write(result);
                    out.flush();
                    out.close();
                    String[] split = out_trade_no.split("_");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                    switch (type){
                        case 1:
                            orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, 1);
                            break;
                        case 2:
                            orderTaxiService.payOrderTaxiCallback(id, order_id, 1);
                            orderTaxiService.payOrderTaxiCallback(id, order_id, 2);
                            break;
                        case 3:
                            orderCrossCityService.payOrderCrossCityCallback(id, order_id, 1);
                            break;
                        case 4:
                            orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1);
                            break;
                        case 5:
                            orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1);
                            break;
                    }
                }
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Company.java
@@ -253,7 +253,45 @@
     */
    @TableField("insertTime")
    private Date insertTime;
    /**
     * 司机接单限制
     */
    @TableField("driverRestriction")
    private Double driverRestriction;
    /**
     * 固定费用
     */
    @TableField("fixedDeduction")
    private Double fixedDeduction;
    /**
     * 线上下单扣除
     */
    @TableField("percentageDeduction")
    private Double percentageDeduction;
    public Double getFixedDeduction() {
        return fixedDeduction;
    }
    public void setFixedDeduction(Double fixedDeduction) {
        this.fixedDeduction = fixedDeduction;
    }
    public Double getPercentageDeduction() {
        return percentageDeduction;
    }
    public void setPercentageDeduction(Double percentageDeduction) {
        this.percentageDeduction = percentageDeduction;
    }
    public Double getDriverRestriction() {
        return driverRestriction;
    }
    public void setDriverRestriction(Double driverRestriction) {
        this.driverRestriction = driverRestriction;
    }
    public Integer getId() {
        return id;
    }
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/controller/OrderTaxiController.java
@@ -49,12 +49,14 @@
    })
    public ResultUtil<BaseWarpper> taxiOrder(OrderTaxiWarpper orderTaxiWarpper, HttpServletRequest request){
        try {
            System.err.println(orderTaxiWarpper);
            OrderTaxi orderTaxi = OrderTaxiWarpper.getOrderTaxi(orderTaxiWarpper);
            System.err.println(orderTaxiWarpper);
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderTaxiService.taxiOrder(orderTaxi, uid);
            return orderTaxiService.taxiOrder(orderTaxi, uid, orderTaxiWarpper.getAreaCode());
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/dao/mapping/OrderTaxiMapper.xml
@@ -213,6 +213,7 @@
        a.endLat as endLat,
        a.endAddress as endAddress,
        a.driverId as driverId,
        a.payManner as payManner,
        a.orderMoney as orderMoney,
        a.startMileage as startMileage,
        a.startMoney as startMoney,
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/model/TransactionDetails.java
@@ -68,6 +68,19 @@
     */
    @TableField("placeOrderWay")
    private Integer placeOrderWay;
    /**
     * 公司id
     */
    @TableField("companyId")
    private Integer companyId;
    public Integer getCompanyId() {
        return companyId;
    }
    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }
    public Integer getId() {
        return id;
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/IOrderTaxiService.java
@@ -26,7 +26,7 @@
     * @return
     * @throws Exception
     */
    ResultUtil<BaseWarpper> taxiOrder(OrderTaxi orderTaxi, Integer uid) throws Exception;
    ResultUtil<BaseWarpper> taxiOrder(OrderTaxi orderTaxi, Integer uid,String areaCode) throws Exception;
    /**
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/ITransactionDetailsService.java
@@ -35,4 +35,19 @@
     */
    void saveDataTaxi(Integer userId, String remark, Double money, Integer state,
                  Integer type, Integer userType, Integer orderType, Integer orderId, Integer placeOrderWay) 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=余额提现,7=积分兑换)
     * @param placeOrderWay 下单方式 1=语音下单 2=一键下单 3=后台添加订单 4=普通订单
     * @param orderId
     * @throws Exception
     */
    void saveDataTaxi(Integer userId, String remark, Double money, Integer state,
                      Integer type, Integer userType, Integer orderType, Integer orderId, Integer placeOrderWay,Integer companyId) throws Exception;
}
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -20,9 +20,11 @@
import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper;
import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper;
import com.stylefeng.guns.modular.taxi.dao.TPhoneMapper;
import com.stylefeng.guns.modular.taxi.dao.TransactionDetailsMapper;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
import com.stylefeng.guns.modular.taxi.model.TPhone;
import com.stylefeng.guns.modular.taxi.model.TransactionDetails;
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService;
@@ -164,7 +166,6 @@
    @Resource
    private TPhoneMapper tPhoneMapper;
@@ -177,7 +178,8 @@
     * @throws Exception
     */
    @Override
    public synchronized ResultUtil<BaseWarpper> taxiOrder(OrderTaxi orderTaxi, Integer uid) throws Exception {
    public synchronized ResultUtil<BaseWarpper> taxiOrder(OrderTaxi orderTaxi, Integer uid,String areaCode) throws Exception {
        System.out.println("出租车==========================================="+orderTaxi);
        //定义用户所属公司
        UserInfo userInfo1 = userInfoService.selectById(uid);
        if (userInfo1.getIsBlack()==1){
@@ -577,8 +579,9 @@
                        placeOrderWay = 3;
                        break;
                }
                Company company = companyService.selectById(orderTaxi.getCompanyId());
                //添加交易明细
                transactionDetailsService.saveDataTaxi(uid, "取消订单", query.getMoney(), 2, 1, 1, 2, id,placeOrderWay);
                transactionDetailsService.saveDataTaxi(uid, "取消订单", query.getMoney(), 2, 1, 1, 2, id,placeOrderWay,company.getId());
                userInfoService.updateById(userInfo);
                //解除小号绑定
@@ -778,7 +781,7 @@
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralMapper.query(orderTaxi.getCompanyId());
            userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
//            userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            Integer placeOrderWay = null;
            switch (orderTaxi.getOrderSource()){
                case 2:
@@ -798,7 +801,7 @@
                    break;
            }
            //添加交易明细
            transactionDetailsService.saveDataTaxi(uid, "完成订单", orderMoney, 2, 1, 1, 2, orderId,placeOrderWay);
//            transactionDetailsService.saveDataTaxi(uid, "完成订单", orderMoney, 2, 1, 1, 2, orderId,placeOrderWay);
            userInfoService.updateById(userInfo);
            orderTaxi.setState(8);
@@ -818,24 +821,46 @@
            }
            //添加已收入明细
            Company company = companyService.selectById(orderTaxi.getCompanyId());
            Double taxi = company.getTaxiMoney();
            BigDecimal d = null;//企业收入
            BigDecimal c = null;//司机收入
            if(company.getIsTaxiFixedOrProportional() == 2){//固定
                d = new BigDecimal(taxi);
                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机
            }
            if(company.getIsTaxiFixedOrProportional() == 1){//比例
                d = new BigDecimal(orderTaxi.getTravelMoney()).multiply(new BigDecimal(taxi).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            incomeService.saveData(1, orderTaxi.getCompanyId(), 2, orderTaxi.getId(), 2, d.doubleValue());
            incomeService.saveData(2, orderTaxi.getDriverId(), 2, orderTaxi.getId(), 2, c.doubleValue());
//            Company company = companyService.selectById(orderTaxi.getCompanyId());
//            Double taxi = company.getTaxiMoney();
//            BigDecimal d = null;//企业收入
//            BigDecimal c = null;//司机收入
//            if(company.getIsTaxiFixedOrProportional() == 2){//固定
//                d = new BigDecimal(taxi);
//                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机
//            }
//            if(company.getIsTaxiFixedOrProportional() == 1){//比例
//                d = new BigDecimal(orderTaxi.getTravelMoney()).multiply(new BigDecimal(taxi).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
//                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
//            }
//            incomeService.saveData(1, orderTaxi.getCompanyId(), 2, orderTaxi.getId(), 2, d.doubleValue());
//            incomeService.saveData(2, orderTaxi.getDriverId(), 2, orderTaxi.getId(), 2, c.doubleValue());
            Driver driver = driverService.selectById(orderTaxi.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());
//            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(driver.getFranchiseeId());
            if(Objects.isNull(company)){
                company = companyService.selectById(driver.getCompanyId());
            }
            // 司机收入
            double moneyTwo;
            // 平台收入
            double money;
            if(orderTaxi.getOrderSource() == 2 || orderTaxi.getOrderSource() == 3){
                double v = company.getPercentageDeduction() / 100;
                money = v * orderTaxi.getOrderMoney();
                moneyTwo = orderTaxi.getOrderMoney()-money;
            }else {
                money = company.getFixedDeduction();
                moneyTwo = orderTaxi.getOrderMoney()-money;
            }
            driver.setBalance(driver.getBalance() + moneyTwo);
            // 新增扣除使用费记录
            transactionDetailsService.saveDataTaxi(driver.getId(), "软件使用费", money, 2, 1, 2, 6, orderTaxi.getId(),placeOrderWay,company.getId());
            // 司机订单收入
            transactionDetailsService.saveDataTaxi(driver.getId(), "完成订单", moneyTwo, 1, 1, 2, 2, orderTaxi.getId(),placeOrderWay,company.getId());
            driverService.updateById(driver);
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
@@ -1076,8 +1101,8 @@
            if(null == distance){
                System.err.println("查询距离出错了");
            }else{
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000),2, RoundingMode.HALF_UP).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60),2, RoundingMode.HALF_UP) + "";
            }
            orderServerWarpper.setReservationMileage("0");
            orderServerWarpper.setReservationTime("0");
@@ -1226,8 +1251,9 @@
                    placeOrderWay = 3;
                    break;
            }
            //添加交易明细
            transactionDetailsService.saveDataTaxi(orderTaxi.getUserId(), "完成订单", query.getAmount(), 2, 1, 1, 2, query.getOrderId(),placeOrderWay);
//            Company company = companyService.selectById(orderTaxi.getCompanyId());
//            //添加交易明细
//            transactionDetailsService.saveDataTaxi(orderTaxi.getUserId(), "完成订单", query.getAmount(), 2, 1, 1, 2, query.getOrderId(),placeOrderWay,company.getId());
            orderTaxi.setState(8);
            orderTaxi.setPayType(type);
            orderTaxi.setPayMoney(query.getAmount());
@@ -1258,24 +1284,46 @@
            paymentRecordService.updateById(query);
            //添加已收入明细
            Company company = companyService.selectById(orderTaxi.getCompanyId());
            Double taxi = company.getTaxiMoney();
            BigDecimal d = null;//企业收入
            BigDecimal c = null;//司机收入
            if(company.getIsTaxiFixedOrProportional() == 2){//固定
                d = new BigDecimal(taxi);
                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            if(company.getIsTaxiFixedOrProportional() == 1){//比例
                d = new BigDecimal(orderTaxi.getTravelMoney()).multiply(new BigDecimal(taxi).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            incomeService.saveData(1, orderTaxi.getCompanyId(), 2, orderTaxi.getId(), 2, d.doubleValue());
            incomeService.saveData(2, orderTaxi.getDriverId(), 2, orderTaxi.getId(), 2, c.doubleValue());
//            Company company = companyService.selectById(orderTaxi.getCompanyId());
//            Double taxi = company.getTaxiMoney();
//            BigDecimal d = null;//企业收入
//            BigDecimal c = null;//司机收入
//            if(company.getIsTaxiFixedOrProportional() == 2){//固定
//                d = new BigDecimal(taxi);
//                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
//            }
//            if(company.getIsTaxiFixedOrProportional() == 1){//比例
//                d = new BigDecimal(orderTaxi.getTravelMoney()).multiply(new BigDecimal(taxi).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
//                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
//            }
//            incomeService.saveData(1, orderTaxi.getCompanyId(), 2, orderTaxi.getId(), 2, d.doubleValue());
//            incomeService.saveData(2, orderTaxi.getDriverId(), 2, orderTaxi.getId(), 2, c.doubleValue());
            Driver driver = driverService.selectById(orderTaxi.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());
//            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(driver.getFranchiseeId());
            if(Objects.isNull(company)){
                company = companyService.selectById(driver.getCompanyId());
            }
            // 司机收入
            double moneyTwo;
            // 平台收入
            double money;
            if(orderTaxi.getOrderSource() == 2 || orderTaxi.getOrderSource() == 3){
                double v = company.getPercentageDeduction() / 100;
                money = v * orderTaxi.getOrderMoney();
                moneyTwo = orderTaxi.getOrderMoney()-money;
            }else {
                money = company.getFixedDeduction();
                moneyTwo = orderTaxi.getOrderMoney()-money;
            }
            driver.setBalance(driver.getBalance() + moneyTwo);
            // 新增扣除使用费记录
            transactionDetailsService.saveDataTaxi(driver.getId(), "软件使用费", money, 2, 1, 2, 6, orderTaxi.getId(),placeOrderWay,company.getId());
            // 司机订单收入
            transactionDetailsService.saveDataTaxi(driver.getId(), "完成订单", moneyTwo, 1, 1, 2, 2, orderTaxi.getId(),placeOrderWay,company.getId());
            driverService.updateById(driver);
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
@@ -1338,8 +1386,9 @@
                    placeOrderWay = 3;
                    break;
            }
            Company company = companyService.selectById(orderTaxi.getCompanyId());
            //添加交易明细
            transactionDetailsService.saveDataTaxi(orderTaxi.getUserId(), "取消订单", query.getAmount(), 2, 1, 1, 2, query.getOrderId(),placeOrderWay);
            transactionDetailsService.saveDataTaxi(orderTaxi.getUserId(), "取消订单", query.getAmount(), 2, 1, 1, 2, query.getOrderId(),placeOrderWay,company.getId());
            orderTaxi.setState(10);
            //解除小号绑定
            if(orderTaxi.getBindId() != null){
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/TransactionDetailsServiceImpl.java
@@ -74,4 +74,33 @@
        transactionDetails.setPlaceOrderWay(placeOrderWay);
        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=小件物流,5=余额充值,6=余额提现,7=积分兑换)
     * @param placeOrderWay 下单方式 1=语音下单 2=一键下单 3=后台添加订单 4=普通订单
     * @param orderId
     * @throws Exception
     */
    @Override
    public void saveDataTaxi(Integer userId, String remark, Double money, Integer state, Integer type, Integer userType, Integer orderType, Integer orderId, Integer placeOrderWay,Integer companyId) 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.setPlaceOrderWay(placeOrderWay);
        transactionDetails.setCompanyId(companyId);
        this.insert(transactionDetails);
    }
}
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/warpper/OrderTaxiWarpper.java
@@ -48,6 +48,16 @@
    private Integer oldPeople;
    @ApiModelProperty(dataType = "int", required = true, value = "支付方式 1=平台支付 2=其他支付")
    private Integer payManner;
    @ApiModelProperty(dataType = "int", required = true, value = "区域code")
    private String areaCode;
    public String getAreaCode() {
        return areaCode;
    }
    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }
    public Integer getPayManner() {
        return payManner;