yanghb
2023-04-21 0481353111afb43a2322e18530dde26f1d841ead
ManagementTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysReformistController.java
@@ -1,6 +1,5 @@
package com.stylefeng.guns.modular.system.controller.general;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.core.shiro.ShiroKit;
@@ -17,9 +16,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 系统设置控制器
@@ -51,15 +47,6 @@
    @Autowired
    private ITPhoneService tPhoneService;
    @Autowired
    private ITCompanyService companyService;
    @Autowired
    private ISpellOrderRuleService spellOrderRuleService;
    @Autowired
    private IShowModularService showModularService;
    /**
     * 跳转到系统设置首页
@@ -76,13 +63,13 @@
        TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", ShiroKit.getUser().getObjectId()));
        model.addAttribute("faceDistinguish",faceDistinguish);
        //快车推单(第一轮)
        //专车推单(第一轮)
        TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 1));
        model.addAttribute("zcOne",zcOne);
        //快车推单(第二轮)
        //专车推单(第二轮)
        TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 2));
        model.addAttribute("zcTwo",zcTwo);
        //快车推单(第三轮)
        //专车推单(第三轮)
        TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 3));
        model.addAttribute("zcThree",zcThree);
@@ -96,7 +83,7 @@
        TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 3));
        model.addAttribute("czcThree",czcThree);
        //普通取消设置(快车)
        //普通取消设置(专车)
        TSysCancleOrder ptCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 1));
        model.addAttribute("ptCancel1",ptCancel1);
        //普通取消设置(出租车)
@@ -106,16 +93,12 @@
        TSysCancleOrder ptCancel3 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 3));
        model.addAttribute("ptCancel3",ptCancel3);
        //预约取消设置(快车)
        //预约取消设置(专车)
        TSysCancleOrder yyCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 1));
        model.addAttribute("yyCancel1",yyCancel1);
        //预约取消设置(出租车)
        TSysCancleOrder yyCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 2));
        model.addAttribute("yyCancel2",yyCancel2);
        //拼车设置
        SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<SpellOrderRule>().eq("companyId", ShiroKit.getUser().getObjectId()));
        model.addAttribute("spellOrderRule", JSONObject.parseObject(spellOrderRule.getContent()));
        //报警电话
        TPhone phone1 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1));
@@ -126,565 +109,302 @@
        //客服电话
        TPhone phone3 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 3));
        model.addAttribute("phone3",phone3);
        //95128电召电话
        TPhone phone4 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 4));
        model.addAttribute("phone4",phone4);
        //招聘电话
        TPhone phone5 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 5));
        model.addAttribute("phone5",phone5);
        //节假日服务费
        BigDecimal holidayFee = companyService.selectById(ShiroKit.getUser().getObjectId()).getHolidayFee();
        model.addAttribute("holidayFee",holidayFee);
        //超时扣款
        TSysTimeoutMoney tSysTimeoutMoney = timeoutMoneyService.selectOne(null);
        model.addAttribute("tSysTimeoutMoney",tSysTimeoutMoney);
        //提现手续费
        TSysWithdrawalPoundage tSysWithdrawalPoundage = sysWithdrawalPoundageService.selectOne(null);
        model.addAttribute("tSysWithdrawalPoundage",tSysWithdrawalPoundage);
        //模块管理
        List<ShowModular> showModulars = showModularService.selectList(null);
        Map<String, Integer> map = new HashMap<>();
        for (ShowModular showModular : showModulars) {
            switch (showModular.getType()){
                case 1:
                    map.put("sjzp1", showModular.getUserShow());
                    map.put("sjzp2", showModular.getDriverShow());
                    break;
                case 2:
                    map.put("zuc1", showModular.getUserShow());
                    map.put("zuc2", showModular.getDriverShow());
                    break;
                case 3:
                    map.put("mc1", showModular.getUserShow());
                    map.put("mc2", showModular.getDriverShow());
                    break;
                case 4:
                    map.put("czgrcl1", showModular.getUserShow());
                    map.put("czgrcl2", showModular.getDriverShow());
                    break;
                case 5:
                    map.put("mac1", showModular.getUserShow());
                    map.put("mac2", showModular.getDriverShow());
                    break;
                case 6:
                    map.put("sjzx1", showModular.getUserShow());
                    map.put("sjzx2", showModular.getDriverShow());
                    break;
                case 7:
                    map.put("dck1", showModular.getUserShow());
                    map.put("dck2", showModular.getDriverShow());
                    break;
            }
        }
        model.addAttribute("showModulars", map);
        return PREFIX + "tSysReformist.html";
    }
    @Autowired
    private ITSysTimeoutMoneyService timeoutMoneyService;
    @Autowired
    private ITSysWithdrawalPoundageService sysWithdrawalPoundageService;
    /**
     * 删除系统设置
     */
    @RequestMapping(value = "/setUp")
    @ResponseBody
    public Object setUp(String type, BigDecimal one, Integer two, Integer three, Integer openValue,
                        Integer isSpecialCar,Integer isTaxiCar,
                        Double zc1,Integer zc2,Double zc3,
                        Double zc4,Integer zc5,Double zc6,
                        Double zc7,Integer zc8,Double zc9,
                        Double czc1,Integer czc2,Double czc3,
                        Double czc4,Integer czc5,Double czc6,
                        Double czc7,Integer czc8,Double czc9,
                        Integer ptCancel1,BigDecimal ptCancel2, Integer ptCancel3, BigDecimal ptCancel4, Integer ptCancel5, BigDecimal ptCancel6,
                        Integer yyCancel1, BigDecimal yyCancel2, Integer yyCancel3, BigDecimal yyCancel4,
                        Double pdpd1, Double pdpd2, Double pdpd3, Double pdpd4, Double pdpd5, Double pdpd6,
                        String phone1, String phone2, String phone3, String phone4, String phone5, BigDecimal holidayFee,
                        Double percentage, Integer timeOut, Double deductMoney,
                        Integer sjzp1, Integer sjzp2, Integer zuc1, Integer zuc2, Integer mc1, Integer mc2,
                        Integer czgrcl1, Integer czgrcl2, Integer mac1, Integer mac2, Integer sjzx1, Integer sjzx2,
                        Integer dck1, Integer dck2) {
    public Object setUp(@RequestParam BigDecimal one, @RequestParam Integer two, @RequestParam Integer three, @RequestParam Integer openValue,
                        @RequestParam Integer isSpecialCar,@RequestParam Integer isTaxiCar,
                        @RequestParam Double zc1,@RequestParam Integer zc2,@RequestParam Double zc3,
                        @RequestParam Double zc4,@RequestParam Integer zc5,@RequestParam Double zc6,
                        @RequestParam Double zc7,@RequestParam Integer zc8,@RequestParam Double zc9,
                        @RequestParam Double czc1,@RequestParam Integer czc2,@RequestParam Double czc3,
                        @RequestParam Double czc4,@RequestParam Integer czc5,@RequestParam Double czc6,
                        @RequestParam Double czc7,@RequestParam Integer czc8,@RequestParam Double czc9,
                        @RequestParam Integer ptCancel1,@RequestParam BigDecimal ptCancel2,@RequestParam Integer ptCancel3,@RequestParam BigDecimal ptCancel4,@RequestParam Integer ptCancel5,@RequestParam BigDecimal ptCancel6,
                        @RequestParam Integer yyCancel1,@RequestParam BigDecimal yyCancel2,@RequestParam Integer yyCancel3,@RequestParam BigDecimal yyCancel4,
                        @RequestParam String phone1,@RequestParam String phone2,@RequestParam String phone3) {
        //改派设置
        if("reassigningSet".equals(type)){
            TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", ShiroKit.getUser().getObjectId()));
            if (SinataUtil.isNotEmpty(reformist)){
                reformist.setMoney(one);
                reformist.setIsSpecialCar(isSpecialCar);
                reformist.setIsTaxiCar(isTaxiCar);
                tSysReformistService.updateById(reformist);
            }else{
                reformist = new TSysReformist();
                reformist.setCompanyId(ShiroKit.getUser().getObjectId());
                reformist.setMoney(one);
                reformist.setIsSpecialCar(isSpecialCar);
                reformist.setIsTaxiCar(isTaxiCar);
                tSysReformistService.insert(reformist);
            }
        TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", ShiroKit.getUser().getObjectId()));
        if (SinataUtil.isNotEmpty(reformist)){
            reformist.setMoney(one);
            reformist.setIsSpecialCar(isSpecialCar);
            reformist.setIsTaxiCar(isTaxiCar);
            tSysReformistService.updateById(reformist);
        }else{
            reformist = new TSysReformist();
            reformist.setCompanyId(ShiroKit.getUser().getObjectId());
            reformist.setMoney(one);
            reformist.setIsSpecialCar(isSpecialCar);
            reformist.setIsTaxiCar(isTaxiCar);
            tSysReformistService.insert(reformist);
        }
        //积分设置
        if("integralSet".equals(type)){
            TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", ShiroKit.getUser().getObjectId()));
            if (SinataUtil.isNotEmpty(integral)){
                integral.setIntegral(two);
                tSysIntegralService.updateById(integral);
            }else{
                integral = new TSysIntegral();
                integral.setCompanyId(ShiroKit.getUser().getObjectId());
                integral.setIntegral(two);
                tSysIntegralService.insert(integral);
            }
        TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", ShiroKit.getUser().getObjectId()));
        if (SinataUtil.isNotEmpty(integral)){
            integral.setIntegral(two);
            tSysIntegralService.updateById(integral);
        }else{
            integral = new TSysIntegral();
            integral.setCompanyId(ShiroKit.getUser().getObjectId());
            integral.setIntegral(two);
            tSysIntegralService.insert(integral);
        }
        //人脸识别
        if("faceRecognitionSettings".equals(type)){
            TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", ShiroKit.getUser().getObjectId()));
            if (SinataUtil.isNotEmpty(faceDistinguish)){
                faceDistinguish.setIsOpen(three);
                faceDistinguish.setMinuteNum(openValue);
                tSysFaceDistinguishService.updateById(faceDistinguish);
            }else{
                faceDistinguish = new TSysFaceDistinguish();
                faceDistinguish.setIsOpen(three);
                faceDistinguish.setMinuteNum(openValue);
                faceDistinguish.setCompanyId(ShiroKit.getUser().getObjectId());
                tSysFaceDistinguishService.insert(faceDistinguish);
            }
        TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", ShiroKit.getUser().getObjectId()));
        if (SinataUtil.isNotEmpty(faceDistinguish)){
            faceDistinguish.setIsOpen(three);
            faceDistinguish.setMinuteNum(openValue);
            tSysFaceDistinguishService.updateById(faceDistinguish);
        }else{
            faceDistinguish = new TSysFaceDistinguish();
            faceDistinguish.setIsOpen(three);
            faceDistinguish.setMinuteNum(openValue);
            faceDistinguish.setCompanyId(ShiroKit.getUser().getObjectId());
            tSysFaceDistinguishService.insert(faceDistinguish);
        }
        //推单设置
        if("pushOrderSettings".equals(type)){
            //快车推单(第一轮)
            TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 1));
            if (SinataUtil.isNotEmpty(zcOne)){
                zcOne.setPushDistance(zc1);
                zcOne.setPushTime(zc2);
                zcOne.setDriverProportion(zc3);
                tSysPushOrderService.updateById(zcOne);
            }else{
                zcOne = new TSysPushOrder();
                zcOne.setPushDistance(zc1);
                zcOne.setPushTime(zc2);
                zcOne.setDriverProportion(zc3);
                zcOne.setCompanyId(ShiroKit.getUser().getObjectId());
                zcOne.setPushType(1);
                zcOne.setType(1);
                tSysPushOrderService.insert(zcOne);
            }
            //快车推单(第二轮)
            TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 2));
            if (SinataUtil.isNotEmpty(zcTwo)){
                zcTwo.setPushDistance(zc4);
                zcTwo.setPushTime(zc5);
                zcTwo.setDriverProportion(zc6);
                tSysPushOrderService.updateById(zcTwo);
            }else{
                zcTwo = new TSysPushOrder();
                zcTwo.setPushDistance(zc4);
                zcTwo.setPushTime(zc5);
                zcTwo.setDriverProportion(zc6);
                zcTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                zcTwo.setPushType(1);
                zcTwo.setType(2);
                tSysPushOrderService.insert(zcTwo);
            }
            //快车推单(第三轮)
            TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 3));
            if (SinataUtil.isNotEmpty(zcThree)){
                zcThree.setPushDistance(zc7);
                zcThree.setPushTime(zc8);
                zcThree.setDriverProportion(zc9);
                tSysPushOrderService.updateById(zcThree);
            }else{
                zcThree = new TSysPushOrder();
                zcThree.setPushDistance(zc7);
                zcThree.setPushTime(zc8);
                zcThree.setDriverProportion(zc9);
                zcThree.setCompanyId(ShiroKit.getUser().getObjectId());
                zcThree.setPushType(1);
                zcThree.setType(3);
                tSysPushOrderService.insert(zcThree);
            }
            //出租车推单(第一轮)
            TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 1));
            if (SinataUtil.isNotEmpty(czcOne)){
                czcOne.setPushDistance(czc1);
                czcOne.setPushTime(czc2);
                czcOne.setDriverProportion(czc3);
                tSysPushOrderService.updateById(czcOne);
            }else{
                czcOne = new TSysPushOrder();
                czcOne.setPushDistance(czc1);
                czcOne.setPushTime(czc2);
                czcOne.setDriverProportion(czc3);
                czcOne.setCompanyId(ShiroKit.getUser().getObjectId());
                czcOne.setPushType(2);
                czcOne.setType(1);
                tSysPushOrderService.insert(czcOne);
            }
            //出租车推单(第二轮)
            TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 2));
            if (SinataUtil.isNotEmpty(czcTwo)){
                czcTwo.setPushDistance(czc4);
                czcTwo.setPushTime(czc5);
                czcTwo.setDriverProportion(czc6);
                tSysPushOrderService.updateById(czcTwo);
            }else{
                czcTwo = new TSysPushOrder();
                czcTwo.setPushDistance(czc4);
                czcTwo.setPushTime(czc5);
                czcTwo.setDriverProportion(czc6);
                czcTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                czcTwo.setPushType(2);
                czcTwo.setType(2);
                tSysPushOrderService.insert(czcTwo);
            }
            //出租车推单(第三轮)
            TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 3));
            if (SinataUtil.isNotEmpty(czcThree)){
                czcThree.setPushDistance(czc7);
                czcThree.setPushTime(czc8);
                czcThree.setDriverProportion(czc9);
                tSysPushOrderService.updateById(czcThree);
            }else{
                czcThree = new TSysPushOrder();
                czcThree.setPushDistance(czc7);
                czcThree.setPushTime(czc8);
                czcThree.setDriverProportion(czc9);
                czcThree.setCompanyId(ShiroKit.getUser().getObjectId());
                czcThree.setPushType(2);
                czcThree.setType(3);
                tSysPushOrderService.insert(czcThree);
            }
        //专车推单(第一轮)
        TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 1));
        if (SinataUtil.isNotEmpty(zcOne)){
            zcOne.setPushDistance(zc1);
            zcOne.setPushTime(zc2);
            zcOne.setDriverProportion(zc3);
            tSysPushOrderService.updateById(zcOne);
        }else{
            zcOne = new TSysPushOrder();
            zcOne.setPushDistance(zc1);
            zcOne.setPushTime(zc2);
            zcOne.setDriverProportion(zc3);
            zcOne.setCompanyId(ShiroKit.getUser().getObjectId());
            zcOne.setPushType(1);
            zcOne.setType(1);
            tSysPushOrderService.insert(zcOne);
        }
        //专车推单(第二轮)
        TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 2));
        if (SinataUtil.isNotEmpty(zcTwo)){
            zcTwo.setPushDistance(zc4);
            zcTwo.setPushTime(zc5);
            zcTwo.setDriverProportion(zc6);
            tSysPushOrderService.updateById(zcTwo);
        }else{
            zcTwo = new TSysPushOrder();
            zcTwo.setPushDistance(zc4);
            zcTwo.setPushTime(zc5);
            zcTwo.setDriverProportion(zc6);
            zcTwo.setCompanyId(ShiroKit.getUser().getObjectId());
            zcTwo.setPushType(1);
            zcTwo.setType(2);
            tSysPushOrderService.insert(zcTwo);
        }
        //专车推单(第三轮)
        TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 3));
        if (SinataUtil.isNotEmpty(zcThree)){
            zcThree.setPushDistance(zc7);
            zcThree.setPushTime(zc8);
            zcThree.setDriverProportion(zc9);
            tSysPushOrderService.updateById(zcThree);
        }else{
            zcThree = new TSysPushOrder();
            zcThree.setPushDistance(zc7);
            zcThree.setPushTime(zc8);
            zcThree.setDriverProportion(zc9);
            zcThree.setCompanyId(ShiroKit.getUser().getObjectId());
            zcThree.setPushType(1);
            zcThree.setType(3);
            tSysPushOrderService.insert(zcThree);
        }
        //取消设置
        if("cancelOrderSettings".equals(type)){
            //普通取消设置(快车)
            TSysCancleOrder ptCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 1));
            if (SinataUtil.isNotEmpty(ptCancelOne)){
                ptCancelOne.setMinuteNum(ptCancel1);
                ptCancelOne.setMoney(ptCancel2);
                tSysCancleOrderService.updateById(ptCancelOne);
            }else{
                ptCancelOne = new TSysCancleOrder();
                ptCancelOne.setMinuteNum(ptCancel1);
                ptCancelOne.setMoney(ptCancel2);
                ptCancelOne.setCompanyId(ShiroKit.getUser().getObjectId());
                ptCancelOne.setType(1);
                ptCancelOne.setOrderType(1);
                tSysCancleOrderService.insert(ptCancelOne);
            }
            //普通取消设置(出租车)
            TSysCancleOrder ptCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 2));
            if (SinataUtil.isNotEmpty(ptCancelTwo)){
                ptCancelTwo.setMinuteNum(ptCancel3);
                ptCancelTwo.setMoney(ptCancel4);
                tSysCancleOrderService.updateById(ptCancelTwo);
            }else{
                ptCancelTwo = new TSysCancleOrder();
                ptCancelTwo.setMinuteNum(ptCancel3);
                ptCancelTwo.setMoney(ptCancel4);
                ptCancelTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                ptCancelTwo.setType(1);
                ptCancelTwo.setOrderType(2);
                tSysCancleOrderService.insert(ptCancelTwo);
            }
            //普通取消设置(跨城出行)
            TSysCancleOrder ptCancelThree = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 3));
            if (SinataUtil.isNotEmpty(ptCancelThree)){
                ptCancelThree.setMinuteNum(ptCancel5);
                ptCancelThree.setMoney(ptCancel6);
                tSysCancleOrderService.updateById(ptCancelThree);
            }else{
                ptCancelThree = new TSysCancleOrder();
                ptCancelThree.setMinuteNum(ptCancel5);
                ptCancelThree.setMoney(ptCancel6);
                ptCancelThree.setCompanyId(ShiroKit.getUser().getObjectId());
                ptCancelThree.setType(1);
                ptCancelThree.setOrderType(3);
                tSysCancleOrderService.insert(ptCancelThree);
            }
        //出租车推单(第一轮)
        TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 1));
        if (SinataUtil.isNotEmpty(czcOne)){
            czcOne.setPushDistance(czc1);
            czcOne.setPushTime(czc2);
            czcOne.setDriverProportion(czc3);
            tSysPushOrderService.updateById(czcOne);
        }else{
            czcOne = new TSysPushOrder();
            czcOne.setPushDistance(czc1);
            czcOne.setPushTime(czc2);
            czcOne.setDriverProportion(czc3);
            czcOne.setCompanyId(ShiroKit.getUser().getObjectId());
            czcOne.setPushType(2);
            czcOne.setType(1);
            tSysPushOrderService.insert(czcOne);
        }
        //出租车推单(第二轮)
        TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 2));
        if (SinataUtil.isNotEmpty(czcTwo)){
            czcTwo.setPushDistance(czc4);
            czcTwo.setPushTime(czc5);
            czcTwo.setDriverProportion(czc6);
            tSysPushOrderService.updateById(czcTwo);
        }else{
            czcTwo = new TSysPushOrder();
            czcTwo.setPushDistance(czc4);
            czcTwo.setPushTime(czc5);
            czcTwo.setDriverProportion(czc6);
            czcTwo.setCompanyId(ShiroKit.getUser().getObjectId());
            czcTwo.setPushType(2);
            czcTwo.setType(2);
            tSysPushOrderService.insert(czcTwo);
        }
        //出租车推单(第三轮)
        TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 3));
        if (SinataUtil.isNotEmpty(czcThree)){
            czcThree.setPushDistance(czc7);
            czcThree.setPushTime(czc8);
            czcThree.setDriverProportion(czc9);
            tSysPushOrderService.updateById(czcThree);
        }else{
            czcThree = new TSysPushOrder();
            czcThree.setPushDistance(czc7);
            czcThree.setPushTime(czc8);
            czcThree.setDriverProportion(czc9);
            czcThree.setCompanyId(ShiroKit.getUser().getObjectId());
            czcThree.setPushType(2);
            czcThree.setType(3);
            tSysPushOrderService.insert(czcThree);
        }
        //预约取消设置
        if("cancelTheReservationOrderSetting".equals(type)){
            //预约取消设置(快车)
            TSysCancleOrder yyCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 1));
            if (SinataUtil.isNotEmpty(yyCancelOne)){
                yyCancelOne.setMinuteNum(yyCancel1);
                yyCancelOne.setMoney(yyCancel2);
                tSysCancleOrderService.updateById(yyCancelOne);
            }else{
                yyCancelOne = new TSysCancleOrder();
                yyCancelOne.setMinuteNum(yyCancel1);
                yyCancelOne.setMoney(yyCancel2);
                yyCancelOne.setCompanyId(ShiroKit.getUser().getObjectId());
                yyCancelOne.setType(2);
                yyCancelOne.setOrderType(1);
                tSysCancleOrderService.insert(yyCancelOne);
            }
            //预约取消设置(出租车)
            TSysCancleOrder yyCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 2));
            if (SinataUtil.isNotEmpty(yyCancelTwo)){
                yyCancelTwo.setMinuteNum(yyCancel3);
                yyCancelTwo.setMoney(yyCancel4);
                tSysCancleOrderService.updateById(yyCancelTwo);
            }else{
                yyCancelTwo = new TSysCancleOrder();
                yyCancelTwo.setMinuteNum(yyCancel3);
                yyCancelTwo.setMoney(yyCancel4);
                yyCancelTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                yyCancelTwo.setType(2);
                yyCancelTwo.setOrderType(2);
                tSysCancleOrderService.insert(yyCancelTwo);
            }
        //普通取消设置(专车)
        TSysCancleOrder ptCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 1));
        if (SinataUtil.isNotEmpty(ptCancelOne)){
            ptCancelOne.setMinuteNum(ptCancel1);
            ptCancelOne.setMoney(ptCancel2);
            tSysCancleOrderService.updateById(ptCancelOne);
        }else{
            ptCancelOne = new TSysCancleOrder();
            ptCancelOne.setMinuteNum(ptCancel1);
            ptCancelOne.setMoney(ptCancel2);
            ptCancelOne.setCompanyId(ShiroKit.getUser().getObjectId());
            ptCancelOne.setType(1);
            ptCancelOne.setOrderType(1);
            tSysCancleOrderService.insert(ptCancelOne);
        }
        //拼单派单
        if("spellOrderSetting".equals(type)){
            SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<SpellOrderRule>().eq("companyId", ShiroKit.getUser().getObjectId()));
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("num1", pdpd1);
            jsonObject.put("num2", pdpd2);
            jsonObject.put("num3", pdpd3);
            jsonObject.put("num4", pdpd4);
            jsonObject.put("num5", pdpd5);
            jsonObject.put("num6", pdpd6);
            if(SinataUtil.isNotEmpty(spellOrderRule)){
                spellOrderRule.setContent(jsonObject.toJSONString());
                spellOrderRuleService.updateById(spellOrderRule);
            }else{
                spellOrderRule = new SpellOrderRule();
                spellOrderRule.setCompanyId(ShiroKit.getUser().getObjectId());
                spellOrderRule.setContent(jsonObject.toJSONString());
                spellOrderRuleService.insert(spellOrderRule);
            }
        //普通取消设置(出租车)
        TSysCancleOrder ptCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 2));
        if (SinataUtil.isNotEmpty(ptCancelTwo)){
            ptCancelTwo.setMinuteNum(ptCancel3);
            ptCancelTwo.setMoney(ptCancel4);
            tSysCancleOrderService.updateById(ptCancelTwo);
        }else{
            ptCancelTwo = new TSysCancleOrder();
            ptCancelTwo.setMinuteNum(ptCancel3);
            ptCancelTwo.setMoney(ptCancel4);
            ptCancelTwo.setCompanyId(ShiroKit.getUser().getObjectId());
            ptCancelTwo.setType(1);
            ptCancelTwo.setOrderType(2);
            tSysCancleOrderService.insert(ptCancelTwo);
        }
        //电话设置
        if("phoneSettings".equals(type)){
            //报警电话
            TPhone phoneOne = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1));
            if (SinataUtil.isNotEmpty(phoneOne)){
                phoneOne.setPhone(phone1);
                tPhoneService.updateById(phoneOne);
            }else{
                phoneOne = new TPhone();
                phoneOne.setPhone(phone1);
                phoneOne.setCompanyId(ShiroKit.getUser().getObjectId());
                phoneOne.setType(1);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phoneOne.setPlatform(1);
                }else{
                    phoneOne.setPlatform(2);
                }
                tPhoneService.insert(phoneOne);
            }
            //客服电话
            TPhone phoneTwo = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2));
            if (SinataUtil.isNotEmpty(phoneTwo)){
                phoneTwo.setPhone(phone2);
                tPhoneService.updateById(phoneTwo);
            }else{
                phoneTwo = new TPhone();
                phoneTwo.setPhone(phone2);
                phoneTwo.setCompanyId(ShiroKit.getUser().getObjectId());
                phoneTwo.setType(2);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phoneTwo.setPlatform(1);
                }else{
                    phoneTwo.setPlatform(2);
                }
                tPhoneService.insert(phoneTwo);
            }
            //客服电话
            TPhone phone = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 3));
            if (SinataUtil.isNotEmpty(phone)){
                phone.setPhone(phone3);
                tPhoneService.updateById(phone);
            }else{
                phone = new TPhone();
                phone.setPhone(phone3);
                phone.setCompanyId(ShiroKit.getUser().getObjectId());
                phone.setType(3);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phone.setPlatform(1);
                }else{
                    phone.setPlatform(2);
                }
                tPhoneService.insert(phone);
            }
            //招聘电话
            TPhone phoneFive = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 5));
            if (SinataUtil.isNotEmpty(phoneFive)){
                phoneFive.setPhone(phone5);
                tPhoneService.updateById(phoneFive);
            }else{
                phoneFive = new TPhone();
                phoneFive.setPhone(phone5);
                phoneFive.setCompanyId(ShiroKit.getUser().getObjectId());
                phoneFive.setType(5);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phoneFive.setPlatform(1);
                }else{
                    phoneFive.setPlatform(2);
                }
                tPhoneService.insert(phoneFive);
            }
        //普通取消设置(跨城出行)
        TSysCancleOrder ptCancelThree = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 3));
        if (SinataUtil.isNotEmpty(ptCancelThree)){
            ptCancelThree.setMinuteNum(ptCancel5);
            ptCancelThree.setMoney(ptCancel6);
            tSysCancleOrderService.updateById(ptCancelThree);
        }else{
            ptCancelThree = new TSysCancleOrder();
            ptCancelThree.setMinuteNum(ptCancel5);
            ptCancelThree.setMoney(ptCancel6);
            ptCancelThree.setCompanyId(ShiroKit.getUser().getObjectId());
            ptCancelThree.setType(1);
            ptCancelThree.setOrderType(3);
            tSysCancleOrderService.insert(ptCancelThree);
        }
        //95128
        if("95128TheOnCall".equals(type)){
            //95128电召电话
            TPhone phoneFour = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 4));
            if (SinataUtil.isNotEmpty(phoneFour)){
                phoneFour.setPhone(phone4);
                tPhoneService.updateById(phoneFour);
            }else{
                phoneFour = new TPhone();
                phoneFour.setPhone(phone4);
                phoneFour.setCompanyId(ShiroKit.getUser().getObjectId());
                phoneFour.setType(4);
                if (ShiroKit.getUser().getRoleType() == 1){
                    phoneFour.setPlatform(1);
                }else{
                    phoneFour.setPlatform(2);
                }
                tPhoneService.insert(phoneFour);
            }
        //预约取消设置(专车)
        TSysCancleOrder yyCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 1));
        if (SinataUtil.isNotEmpty(yyCancelOne)){
            yyCancelOne.setMinuteNum(yyCancel1);
            yyCancelOne.setMoney(yyCancel2);
            tSysCancleOrderService.updateById(yyCancelOne);
        }else{
            yyCancelOne = new TSysCancleOrder();
            yyCancelOne.setMinuteNum(yyCancel1);
            yyCancelOne.setMoney(yyCancel2);
            yyCancelOne.setCompanyId(ShiroKit.getUser().getObjectId());
            yyCancelOne.setType(2);
            yyCancelOne.setOrderType(1);
            tSysCancleOrderService.insert(yyCancelOne);
        }
        //预约取消设置(出租车)
        TSysCancleOrder yyCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 2));
        if (SinataUtil.isNotEmpty(yyCancelTwo)){
            yyCancelTwo.setMinuteNum(yyCancel3);
            yyCancelTwo.setMoney(yyCancel4);
            tSysCancleOrderService.updateById(yyCancelTwo);
        }else{
            yyCancelTwo = new TSysCancleOrder();
            yyCancelTwo.setMinuteNum(yyCancel3);
            yyCancelTwo.setMoney(yyCancel4);
            yyCancelTwo.setCompanyId(ShiroKit.getUser().getObjectId());
            yyCancelTwo.setType(2);
            yyCancelTwo.setOrderType(2);
            tSysCancleOrderService.insert(yyCancelTwo);
        }
        ///  节假日服务费
        if("holidayServiceFeeSetting".equals(type)){
            Integer companyId = ShiroKit.getUser().getObjectId();
            TCompany company = companyService.selectById(companyId);
            company.setHolidayFee(holidayFee);
            companyService.updateById(company);
        //报警电话
        TPhone phoneOne = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1));
        if (SinataUtil.isNotEmpty(phoneOne)){
            phoneOne.setPhone(phone1);
            tPhoneService.updateById(phoneOne);
        }else{
            phoneOne = new TPhone();
            phoneOne.setPhone(phone1);
            phoneOne.setCompanyId(ShiroKit.getUser().getObjectId());
            phoneOne.setType(1);
            if (ShiroKit.getUser().getRoleType() == 1){
                phoneOne.setPlatform(1);
            }else{
                phoneOne.setPlatform(2);
            }
            tPhoneService.insert(phoneOne);
        }
        //客服电话
        TPhone phoneTwo = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2));
        if (SinataUtil.isNotEmpty(phoneTwo)){
            phoneTwo.setPhone(phone2);
            tPhoneService.updateById(phoneTwo);
        }else{
            phoneTwo = new TPhone();
            phoneTwo.setPhone(phone2);
            phoneTwo.setCompanyId(ShiroKit.getUser().getObjectId());
            phoneTwo.setType(2);
            if (ShiroKit.getUser().getRoleType() == 1){
                phoneTwo.setPlatform(1);
            }else{
                phoneTwo.setPlatform(2);
            }
            tPhoneService.insert(phoneTwo);
        }
        /// 超时扣款设置
        if("timeoutDeductionSettings".equals(type)){
            timeoutMoneyService.delete(new EntityWrapper<TSysTimeoutMoney>().ne("id",0));
            TSysTimeoutMoney tSysTimeoutMoney = new TSysTimeoutMoney();
            tSysTimeoutMoney.setDeductMoney(deductMoney);
            tSysTimeoutMoney.setTimeOut(timeOut);
            timeoutMoneyService.insert(tSysTimeoutMoney);
        }
        ///   提现手续费设置
        if("withdrawalFeeSetting".equals(type)){
            sysWithdrawalPoundageService.delete(new EntityWrapper<TSysWithdrawalPoundage>().ne("id",0));
            TSysWithdrawalPoundage tSysWithdrawalPoundage = new TSysWithdrawalPoundage();
            tSysWithdrawalPoundage.setPercentage(percentage);
            sysWithdrawalPoundageService.insert(tSysWithdrawalPoundage);
        }
        //模块设置
        if("moduleManagement".equals(type)){
            //司机招聘
            ShowModular showModular1 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 1));
            if(null == showModular1){
                showModular1 = new ShowModular();
                showModular1.setType(1);
                showModular1.setDriverShow(sjzp2);
                showModular1.setUserShow(sjzp1);
                showModularService.insert(showModular1);
        //客服电话
        TPhone phone = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 3));
        if (SinataUtil.isNotEmpty(phone)){
            phone.setPhone(phone3);
            tPhoneService.updateById(phone);
        }else{
            phone = new TPhone();
            phone.setPhone(phone3);
            phone.setCompanyId(ShiroKit.getUser().getObjectId());
            phone.setType(3);
            if (ShiroKit.getUser().getRoleType() == 1){
                phone.setPlatform(1);
            }else{
                showModular1.setDriverShow(sjzp2);
                showModular1.setUserShow(sjzp1);
                showModularService.updateById(showModular1);
                phone.setPlatform(2);
            }
            //租车
            ShowModular showModular2 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 2));
            if(null == showModular2){
                showModular2 = new ShowModular();
                showModular2.setType(2);
                showModular2.setDriverShow(zuc2);
                showModular2.setUserShow(zuc1);
                showModularService.insert(showModular2);
            }else{
                showModular2.setDriverShow(zuc2);
                showModular2.setUserShow(zuc1);
                showModularService.updateById(showModular2);
            }
            //买车
            ShowModular showModular3 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 3));
            if(null == showModular3){
                showModular3 = new ShowModular();
                showModular3.setType(3);
                showModular3.setDriverShow(mc2);
                showModular3.setUserShow(mc1);
                showModularService.insert(showModular3);
            }else{
                showModular3.setDriverShow(mc2);
                showModular3.setUserShow(mc1);
                showModularService.updateById(showModular3);
            }
            //出租个人车辆
            ShowModular showModular4 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 4));
            if(null == showModular4){
                showModular4 = new ShowModular();
                showModular4.setType(4);
                showModular4.setDriverShow(czgrcl2);
                showModular4.setUserShow(czgrcl1);
                showModularService.insert(showModular4);
            }else{
                showModular4.setDriverShow(czgrcl2);
                showModular4.setUserShow(czgrcl1);
                showModularService.updateById(showModular4);
            }
            //卖车
            ShowModular showModular5 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 5));
            if(null == showModular5){
                showModular5 = new ShowModular();
                showModular5.setType(5);
                showModular5.setDriverShow(mac2);
                showModular5.setUserShow(mac1);
                showModularService.insert(showModular5);
            }else{
                showModular5.setDriverShow(mac2);
                showModular5.setUserShow(mac1);
                showModularService.updateById(showModular5);
            }
            //商家中心
            ShowModular showModular6 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 6));
            if(null == showModular6){
                showModular6 = new ShowModular();
                showModular6.setType(6);
                showModular6.setDriverShow(sjzx2);
                showModular6.setUserShow(sjzx1);
                showModularService.insert(showModular6);
            }else{
                showModular6.setDriverShow(sjzx2);
                showModular6.setUserShow(sjzx1);
                showModularService.updateById(showModular6);
            }
            //打车卡
            ShowModular showModular7 = showModularService.selectOne(new EntityWrapper<ShowModular>().eq("type", 7));
            if(null == showModular7){
                showModular7 = new ShowModular();
                showModular7.setType(7);
                showModular7.setDriverShow(dck2);
                showModular7.setUserShow(dck1);
                showModularService.insert(showModular7);
            }else{
                showModular7.setDriverShow(dck2);
                showModular7.setUserShow(dck1);
                showModularService.updateById(showModular7);
            }
            tPhoneService.insert(phone);
        }
        return SUCCESS_TIP;
    }