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; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.ResultUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.*; /** * 系统设置控制器 * * @author fengshuonan * @Date 2020-06-09 13:43:44 */ @Controller @RequestMapping("/tSysReformist") public class TSysReformistController extends BaseController { private String PREFIX = "/system/tSysReformist/"; @Autowired private ITSysReformistService tSysReformistService; @Autowired private ITSysIntegralService tSysIntegralService; @Autowired private ITSysFaceDistinguishService tSysFaceDistinguishService; @Autowired private ITSysPushOrderService tSysPushOrderService; @Autowired private ITSysCancleOrderService tSysCancleOrderService; @Autowired private ITPhoneService tPhoneService; @Autowired private ITCompanyService companyService; @Autowired private ISpellOrderRuleService spellOrderRuleService; @Autowired private IShowModularService showModularService; @Autowired private ITCarModelService modelService; @RequestMapping("/check") public String check(Model model) { return PREFIX + "tStudentEdit_first.html"; } @RequestMapping("/electric/record") public String record(Model model) { return PREFIX + "record.html"; } @Autowired private ITElectricRecordService recordService; @Autowired ITSystemPriceService priceService; @Autowired private ITServerCarmodelService serverCarmodelService; @RequestMapping ("/check-change/{id}") @ResponseBody public ResultUtil Change(@PathVariable Integer id,String priceType,String isCheck ) { if (priceType==null||priceType.equals("")){ TServerCarmodel carModel = serverCarmodelService.selectById(id); if (isCheck.equals("是")){ carModel.setIsCheck("1"); }else { carModel.setIsCheck("0"); } serverCarmodelService.updateById(carModel); return new ResultUtil(null,0,"保存成功"); } TServerCarmodel carModel = serverCarmodelService.selectById(id); String[] split = carModel.getIsCheck().split(","); for (int i = 0; i < split.length; i++) { if (i == Integer.parseInt(priceType)){ if (isCheck.equals("是")){ split[i] ="1"; }else { split[i] = "0"; } } } String join = String.join(",", split); carModel.setIsCheck(join); serverCarmodelService.updateById(carModel); System.err.println("=================" + id + "====" + priceType); return new ResultUtil(null, 0, "保存成功"); } @RequestMapping("/checklist") @ResponseBody public Object checklist(Model model) { Integer id = ShiroKit.getUser().getId(); // List tSystemPrices = priceService.selectList(new EntityWrapper().eq("companyId", id).eq("type", 1).eq("state", 1)); // List ids = new ArrayList<>(); // for (TSystemPrice tSystemPrice : tSystemPrices) { // ids.add(tSystemPrice.getServerCarModelId()); // } List tCarModels = serverCarmodelService.selectList(new EntityWrapper().eq("state",1).eq("type",1)); TServerCarmodel type = serverCarmodelService.selectOne(new EntityWrapper().eq("type", 4)); List returnList = new ArrayList<>(); for (TServerCarmodel tCarModel : tCarModels) { String[] split = tCarModel.getIsCheck().split(","); for (int i = 0; i < split.length; i++) { TServerCarmodel carModel = new TServerCarmodel(); carModel.setId(tCarModel.getId()); carModel.setName(tCarModel.getName()); carModel.setIsCheck(split[i].equals("1") ? "是":"否"); carModel.setPriceType(i); // if (i==0){ // carModel.setPrice("独享"); // }else if (i==1){ // carModel.setPrice("一口价"); // } else if (i==2) { // carModel.setPrice("拼车"); // } returnList.add(carModel); } } if(null != type){ TServerCarmodel carModel = new TServerCarmodel(); carModel.setId(type.getId()); carModel.setName(type.getName()); carModel.setIsCheck(type.getIsCheck().equals("1") ? "是":"否"); carModel.setPriceType(null); returnList.add(carModel); } return returnList; } /** * 跳转到系统设置首页 */ @RequestMapping("") public String index(Model model) { //改派设置 TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId())); model.addAttribute("reformist",reformist); //积分设置 TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId())); model.addAttribute("integral",integral); //人脸识别 TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId())); model.addAttribute("faceDistinguish",faceDistinguish); //快车推单(第一轮) TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 1)); model.addAttribute("zcOne",zcOne); //快车推单(第二轮) TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 2)); model.addAttribute("zcTwo",zcTwo); //快车推单(第三轮) TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 3)); model.addAttribute("zcThree",zcThree); //出租车推单(第一轮) TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 1)); model.addAttribute("czcOne",czcOne); //出租车推单(第二轮) TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 2)); model.addAttribute("czcTwo",czcTwo); //出租车推单(第三轮) TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 2).eq("type", 3)); model.addAttribute("czcThree",czcThree); //普通取消设置(快车) TSysCancleOrder ptCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 1)); model.addAttribute("ptCancel1",ptCancel1); //普通取消设置(出租车) TSysCancleOrder ptCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 2)); model.addAttribute("ptCancel2",ptCancel2); //普通取消设置(跨城出行) TSysCancleOrder ptCancel3 = tSysCancleOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 3)); model.addAttribute("ptCancel3",ptCancel3); //预约取消设置(快车) TSysCancleOrder yyCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 1)); model.addAttribute("yyCancel1",yyCancel1); //预约取消设置(出租车) TSysCancleOrder yyCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 2)); model.addAttribute("yyCancel2",yyCancel2); //拼车设置 SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId())); model.addAttribute("spellOrderRule", null == spellOrderRule ? "" : JSONObject.parseObject(spellOrderRule.getContent())); //报警电话 TPhone phone1 = tPhoneService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1)); model.addAttribute("phone1",phone1); //客服电话 TPhone phone2 = tPhoneService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2)); model.addAttribute("phone2",phone2); //客服电话 TPhone phone3 = tPhoneService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 3)); model.addAttribute("phone3",phone3); //95128电召电话 TPhone phone4 = tPhoneService.selectOne(new EntityWrapper().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 4)); model.addAttribute("phone4",phone4); //招聘电话 TPhone phone5 = tPhoneService.selectOne(new EntityWrapper().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 showModulars = showModularService.selectList(null); Map 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); TDriverPayDays tDriverPayDays = driverPayDaysService.selectOne(new EntityWrapper().eq("company_id", ShiroKit.getUser().getObjectId())); if(tDriverPayDays!=null){ model.addAttribute("driverDay", tDriverPayDays.getDay()); }else { model.addAttribute("driverDay", ""); } return PREFIX + "tSysReformist.html"; } @Autowired private ITSysTimeoutMoneyService timeoutMoneyService; @Autowired private ITSysWithdrawalPoundageService sysWithdrawalPoundageService; @Autowired private ITDriverPayDaysService driverPayDaysService; @Autowired private ITSysPushTypeService tSysPushTypeService; /** * 删除系统设置 */ @RequestMapping(value = "/setUp") @ResponseBody public Object setUp(Integer openCityId, 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,Integer driverDays,Integer pushType) { //改派设置 if("reassigningSet".equals(type)){ TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper().eq("openCityId", openCityId)); if (SinataUtil.isNotEmpty(reformist)){ reformist.setOpenCityId(openCityId); reformist.setMoney(one); reformist.setIsSpecialCar(isSpecialCar); reformist.setIsTaxiCar(isTaxiCar); tSysReformistService.updateById(reformist); }else { reformist = new TSysReformist(); reformist.setOpenCityId(openCityId); reformist.setMoney(one); reformist.setIsSpecialCar(isSpecialCar); reformist.setIsTaxiCar(isTaxiCar); tSysReformistService.insert(reformist); } } if("driverPayDays".equals(type)){ TDriverPayDays tDriverPayDays = driverPayDaysService.selectOne(new EntityWrapper().eq("openCityId", openCityId)); if (SinataUtil.isNotEmpty(tDriverPayDays)){ tDriverPayDays.setDay(driverDays); tDriverPayDays.setUpdateTime(new Date()); driverPayDaysService.updateById(tDriverPayDays); }else { tDriverPayDays = new TDriverPayDays(); tDriverPayDays.setUpdateTime(new Date()); tDriverPayDays.setDay(driverDays); driverPayDaysService.insert(tDriverPayDays); } } //积分设置 if("integralSet".equals(type)){ TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper().eq("openCityId", openCityId)); if (SinataUtil.isNotEmpty(integral)){ integral.setOpenCityId(openCityId); integral.setIntegral(two); tSysIntegralService.updateById(integral); }else { integral = new TSysIntegral(); integral.setOpenCityId(openCityId); integral.setIntegral(two); tSysIntegralService.insert(integral); } } //人脸识别 if("faceRecognitionSettings".equals(type)){ TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper().eq("openCityId", openCityId)); if (SinataUtil.isNotEmpty(faceDistinguish)){ faceDistinguish.setOpenCityId(openCityId); faceDistinguish.setIsOpen(three); faceDistinguish.setMinuteNum(openValue); tSysFaceDistinguishService.updateById(faceDistinguish); }else { faceDistinguish = new TSysFaceDistinguish(); faceDistinguish.setIsOpen(three); faceDistinguish.setMinuteNum(openValue); faceDistinguish.setOpenCityId(openCityId); tSysFaceDistinguishService.insert(faceDistinguish); } } //推单设置 if("pushOrderSettings".equals(type)){ TSysPushType sysPushType = tSysPushTypeService.selectOne(new EntityWrapper().eq("openCityId", openCityId)); if(sysPushType==null){ sysPushType = new TSysPushType(); sysPushType.setOpenCityId(openCityId); sysPushType.setPushType(pushType); tSysPushTypeService.insert(sysPushType); }else{ sysPushType.setOpenCityId(openCityId); sysPushType.setPushType(pushType); tSysPushTypeService.updateById(sysPushType); } //快车推单(第一轮) TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("pushType", 1).eq("type", 1)); if (SinataUtil.isNotEmpty(zcOne)){ zcOne.setOpenCityId(openCityId); 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.setOpenCityId(openCityId); zcOne.setPushType(1); zcOne.setType(1); tSysPushOrderService.insert(zcOne); } //快车推单(第二轮) TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("pushType", 1).eq("type", 2)); if (SinataUtil.isNotEmpty(zcTwo)){ zcTwo.setOpenCityId(openCityId); 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.setOpenCityId(openCityId); zcTwo.setPushType(1); zcTwo.setType(2); tSysPushOrderService.insert(zcTwo); } //快车推单(第三轮) TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("pushType", 1).eq("type", 3)); if (SinataUtil.isNotEmpty(zcThree)){ zcThree.setOpenCityId(openCityId); 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.setOpenCityId(openCityId); zcThree.setPushType(1); zcThree.setType(3); tSysPushOrderService.insert(zcThree); } //出租车推单(第一轮) TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("pushType", 2).eq("type", 1)); if (SinataUtil.isNotEmpty(czcOne)){ czcOne.setOpenCityId(openCityId); 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.setOpenCityId(openCityId); czcOne.setPushType(2); czcOne.setType(1); tSysPushOrderService.insert(czcOne); } //出租车推单(第二轮) TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("pushType", 2).eq("type", 2)); if (SinataUtil.isNotEmpty(czcTwo)){ czcTwo.setOpenCityId(openCityId); 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.setOpenCityId(openCityId); czcTwo.setPushType(2); czcTwo.setType(2); tSysPushOrderService.insert(czcTwo); } //出租车推单(第三轮) TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("pushType", 2).eq("type", 3)); if (SinataUtil.isNotEmpty(czcThree)){ czcThree.setOpenCityId(openCityId); 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.setOpenCityId(openCityId); czcThree.setPushType(2); czcThree.setType(3); tSysPushOrderService.insert(czcThree); } } //取消设置 if("cancelOrderSettings".equals(type)){ //普通取消设置(快车) TSysCancleOrder ptCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 1).eq("orderType", 1)); if (SinataUtil.isNotEmpty(ptCancelOne)){ ptCancelOne.setOpenCityId(openCityId); ptCancelOne.setMinuteNum(ptCancel1); ptCancelOne.setMoney(ptCancel2); tSysCancleOrderService.updateById(ptCancelOne); }else { ptCancelOne = new TSysCancleOrder(); ptCancelOne.setMinuteNum(ptCancel1); ptCancelOne.setMoney(ptCancel2); ptCancelOne.setOpenCityId(openCityId); ptCancelOne.setType(1); ptCancelOne.setOrderType(1); tSysCancleOrderService.insert(ptCancelOne); } //普通取消设置(出租车) TSysCancleOrder ptCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 1).eq("orderType", 2)); if (SinataUtil.isNotEmpty(ptCancelTwo)){ ptCancelTwo.setOpenCityId(openCityId); ptCancelTwo.setMinuteNum(ptCancel3); ptCancelTwo.setMoney(ptCancel4); tSysCancleOrderService.updateById(ptCancelTwo); }else { ptCancelTwo = new TSysCancleOrder(); ptCancelTwo.setMinuteNum(ptCancel3); ptCancelTwo.setMoney(ptCancel4); ptCancelTwo.setOpenCityId(openCityId); ptCancelTwo.setType(1); ptCancelTwo.setOrderType(2); tSysCancleOrderService.insert(ptCancelTwo); } //普通取消设置(跨城出行) TSysCancleOrder ptCancelThree = tSysCancleOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 1).eq("orderType", 3)); if (SinataUtil.isNotEmpty(ptCancelThree)){ ptCancelThree.setOpenCityId(openCityId); ptCancelThree.setMinuteNum(ptCancel5); ptCancelThree.setMoney(ptCancel6); tSysCancleOrderService.updateById(ptCancelThree); }else { ptCancelThree = new TSysCancleOrder(); ptCancelThree.setMinuteNum(ptCancel5); ptCancelThree.setMoney(ptCancel6); ptCancelThree.setOpenCityId(openCityId); ptCancelThree.setType(1); ptCancelThree.setOrderType(3); tSysCancleOrderService.insert(ptCancelThree); } } //预约取消设置 if("cancelTheReservationOrderSetting".equals(type)){ //预约取消设置(快车) TSysCancleOrder yyCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 2).eq("orderType", 1)); if (SinataUtil.isNotEmpty(yyCancelOne)){ yyCancelOne.setOpenCityId(openCityId); yyCancelOne.setMinuteNum(yyCancel1); yyCancelOne.setMoney(yyCancel2); tSysCancleOrderService.updateById(yyCancelOne); }else { yyCancelOne = new TSysCancleOrder(); yyCancelOne.setMinuteNum(yyCancel1); yyCancelOne.setMoney(yyCancel2); yyCancelOne.setOpenCityId(openCityId); yyCancelOne.setType(2); yyCancelOne.setOrderType(1); tSysCancleOrderService.insert(yyCancelOne); } //预约取消设置(出租车) TSysCancleOrder yyCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 2).eq("orderType", 2)); if (SinataUtil.isNotEmpty(yyCancelTwo)){ yyCancelTwo.setOpenCityId(openCityId); yyCancelTwo.setMinuteNum(yyCancel3); yyCancelTwo.setMoney(yyCancel4); tSysCancleOrderService.updateById(yyCancelTwo); }else { yyCancelTwo = new TSysCancleOrder(); yyCancelTwo.setMinuteNum(yyCancel3); yyCancelTwo.setMoney(yyCancel4); yyCancelTwo.setOpenCityId(openCityId); yyCancelTwo.setType(2); yyCancelTwo.setOrderType(2); tSysCancleOrderService.insert(yyCancelTwo); } } //拼单派单 if("spellOrderSetting".equals(type)) { SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper().eq("openCityId", openCityId)); 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.setOpenCityId(openCityId); spellOrderRule.setContent(jsonObject.toJSONString()); spellOrderRuleService.updateById(spellOrderRule); } else { spellOrderRule = new SpellOrderRule(); spellOrderRule.setOpenCityId(openCityId); spellOrderRule.setContent(jsonObject.toJSONString()); spellOrderRuleService.insert(spellOrderRule); } } //电话设置 if("phoneSettings".equals(type)){ //报警电话 TPhone phoneOne = tPhoneService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 1)); if (SinataUtil.isNotEmpty(phoneOne)){ phoneOne.setOpenCityId(openCityId); phoneOne.setPhone(phone1); tPhoneService.updateById(phoneOne); }else { phoneOne = new TPhone(); phoneOne.setPhone(phone1); phoneOne.setOpenCityId(openCityId); phoneOne.setType(1); if (ShiroKit.getUser().getRoleType() == 1) { phoneOne.setPlatform(1); } else { phoneOne.setPlatform(2); } tPhoneService.insert(phoneOne); } //客服电话 TPhone phoneTwo = tPhoneService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 2)); if (SinataUtil.isNotEmpty(phoneTwo)){ phoneTwo.setOpenCityId(openCityId); phoneTwo.setPhone(phone2); tPhoneService.updateById(phoneTwo); }else { phoneTwo = new TPhone(); phoneTwo.setPhone(phone2); phoneTwo.setOpenCityId(openCityId); phoneTwo.setType(2); if (ShiroKit.getUser().getRoleType() == 1) { phoneTwo.setPlatform(1); } else { phoneTwo.setPlatform(2); } tPhoneService.insert(phoneTwo); } //客服电话 TPhone phone = tPhoneService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 3)); if (SinataUtil.isNotEmpty(phone)){ phone.setOpenCityId(openCityId); phone.setPhone(phone3); tPhoneService.updateById(phone); }else { phone = new TPhone(); phone.setPhone(phone3); phone.setOpenCityId(openCityId); phone.setType(3); if (ShiroKit.getUser().getRoleType() == 1) { phone.setPlatform(1); } else { phone.setPlatform(2); } tPhoneService.insert(phone); } //招聘电话 TPhone phoneFive = tPhoneService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 5)); if (SinataUtil.isNotEmpty(phoneFive)){ phoneFive.setOpenCityId(openCityId); phoneFive.setPhone(phone5); tPhoneService.updateById(phoneFive); }else { phoneFive = new TPhone(); phoneFive.setPhone(phone5); phoneFive.setOpenCityId(openCityId); phoneFive.setType(5); if (ShiroKit.getUser().getRoleType() == 1) { phoneFive.setPlatform(1); } else { phoneFive.setPlatform(2); } tPhoneService.insert(phoneFive); } } //95128 if("95128TheOnCall".equals(type)){ //95128电召电话 TPhone phoneFour = tPhoneService.selectOne(new EntityWrapper().eq("openCityId", openCityId).eq("type", 4)); if (SinataUtil.isNotEmpty(phoneFour)){ phoneFour.setOpenCityId(openCityId); phoneFour.setPhone(phone4); tPhoneService.updateById(phoneFour); }else { phoneFour = new TPhone(); phoneFour.setPhone(phone4); phoneFour.setOpenCityId(openCityId); phoneFour.setType(4); if (ShiroKit.getUser().getRoleType() == 1) { phoneFour.setPlatform(1); } else { phoneFour.setPlatform(2); } tPhoneService.insert(phoneFour); } } /// 节假日服务费 if("holidayServiceFeeSetting".equals(type)) { Integer companyId = ShiroKit.getUser().getObjectId(); TCompany company = companyService.selectById(companyId); company.setHolidayFee(holidayFee); companyService.updateById(company); } /// 超时扣款设置 if("timeoutDeductionSettings".equals(type)){ timeoutMoneyService.delete(new EntityWrapper().ne("id",0)); TSysTimeoutMoney tSysTimeoutMoney = new TSysTimeoutMoney(); tSysTimeoutMoney.setOpenCityId(openCityId); tSysTimeoutMoney.setDeductMoney(deductMoney); tSysTimeoutMoney.setTimeOut(timeOut); timeoutMoneyService.insert(tSysTimeoutMoney); } /// 提现手续费设置 if("withdrawalFeeSetting".equals(type)){ sysWithdrawalPoundageService.delete(new EntityWrapper().ne("id",0)); TSysWithdrawalPoundage tSysWithdrawalPoundage = new TSysWithdrawalPoundage(); tSysWithdrawalPoundage.setPercentage(percentage); sysWithdrawalPoundageService.insert(tSysWithdrawalPoundage); } //模块设置 if("moduleManagement".equals(type)){ //司机招聘 ShowModular showModular1 = showModularService.selectOne(new EntityWrapper().eq("type", 1)); if(null == showModular1){ showModular1 = new ShowModular(); showModular1.setType(1); showModular1.setDriverShow(sjzp2); showModular1.setUserShow(sjzp1); showModular1.setOpenCityId(openCityId); showModularService.insert(showModular1); }else{ showModular1.setDriverShow(sjzp2); showModular1.setUserShow(sjzp1); showModular1.setOpenCityId(openCityId); showModularService.updateById(showModular1); } //租车 ShowModular showModular2 = showModularService.selectOne(new EntityWrapper().eq("type", 2)); if(null == showModular2){ showModular2 = new ShowModular(); showModular2.setType(2); showModular2.setDriverShow(zuc2); showModular2.setUserShow(zuc1); showModular2.setOpenCityId(openCityId); showModularService.insert(showModular2); }else{ showModular2.setDriverShow(zuc2); showModular2.setUserShow(zuc1); showModular2.setOpenCityId(openCityId); showModularService.updateById(showModular2); } //买车 ShowModular showModular3 = showModularService.selectOne(new EntityWrapper().eq("type", 3)); if(null == showModular3){ showModular3 = new ShowModular(); showModular3.setType(3); showModular3.setDriverShow(mc2); showModular3.setUserShow(mc1); showModular3.setOpenCityId(openCityId); showModularService.insert(showModular3); }else{ showModular3.setDriverShow(mc2); showModular3.setUserShow(mc1); showModular3.setOpenCityId(openCityId); showModularService.updateById(showModular3); } //出租个人车辆 ShowModular showModular4 = showModularService.selectOne(new EntityWrapper().eq("type", 4)); if(null == showModular4){ showModular4 = new ShowModular(); showModular4.setType(4); showModular4.setDriverShow(czgrcl2); showModular4.setUserShow(czgrcl1); showModular4.setOpenCityId(openCityId); showModularService.insert(showModular4); }else{ showModular4.setDriverShow(czgrcl2); showModular4.setUserShow(czgrcl1); showModular4.setOpenCityId(openCityId); showModularService.updateById(showModular4); } //卖车 ShowModular showModular5 = showModularService.selectOne(new EntityWrapper().eq("type", 5)); if(null == showModular5){ showModular5 = new ShowModular(); showModular5.setType(5); showModular5.setDriverShow(mac2); showModular5.setUserShow(mac1); showModular5.setOpenCityId(openCityId); showModularService.insert(showModular5); }else{ showModular5.setDriverShow(mac2); showModular5.setUserShow(mac1); showModular5.setOpenCityId(openCityId); showModularService.updateById(showModular5); } //商家中心 ShowModular showModular6 = showModularService.selectOne(new EntityWrapper().eq("type", 6)); if(null == showModular6){ showModular6 = new ShowModular(); showModular6.setType(6); showModular6.setDriverShow(sjzx2); showModular6.setUserShow(sjzx1); showModular6.setOpenCityId(openCityId); showModularService.insert(showModular6); }else{ showModular6.setDriverShow(sjzx2); showModular6.setUserShow(sjzx1); showModular6.setOpenCityId(openCityId); showModularService.updateById(showModular6); } //打车卡 ShowModular showModular7 = showModularService.selectOne(new EntityWrapper().eq("type", 7)); if(null == showModular7){ showModular7 = new ShowModular(); showModular7.setType(7); showModular7.setDriverShow(dck2); showModular7.setUserShow(dck1); showModular7.setOpenCityId(openCityId); showModularService.insert(showModular7); }else{ showModular7.setDriverShow(dck2); showModular7.setUserShow(dck1); showModular7.setOpenCityId(openCityId); showModularService.updateById(showModular7); } } return SUCCESS_TIP; } private long getTime(Integer day){ Date date = new Date(); LocalDate now = LocalDate.now(); LocalDate localDate = now.plusDays(day); LocalDateTime localDateTime = localDate.atTime(1, 0, 0); long time = date.getTime(); long l = localDateTime.toInstant(ZoneOffset.ofHours(8)).toEpochMilli(); return l-time; } }