无关风月
2024-09-06 3ae40be3383cb79c2abc28a1d51e8aaab1cec1a9
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java
@@ -602,29 +602,26 @@
    }
    @RequestMapping(value = "/updateAuth")
    @ResponseBody
    public Object updateAuth(TCar tCar,String zcModel,@RequestParam String serverBox) {
    public Object updateAuth(TCar tCar,String zcModel,String xjModel,@RequestParam String serverBox) {
        //添加经营业务
        if(tCar.getAuthState()==2){
            //删除业务
            tCarServiceService.delete(new EntityWrapper<TCarService>().eq("carId",tCar.getId()));
            //添加经营业务
            String[] serverArray = serverBox.split(",");
            for (int i=0;i<serverArray.length;i++){
                TCarService tCarService = tCarServiceService.selectOne(new EntityWrapper<TCarService>().eq("carId", tCar.getId()).eq("type", Integer.valueOf(serverArray[i])));
                if(null == tCarService){
                    tCarService = new TCarService();
                    tCarService.setCarId(tCar.getId());
                    tCarService.setType(Integer.valueOf(serverArray[i]));
                    if (1 == tCarService.getType()){
                        tCarService.setServerCarModelId(Integer.valueOf(zcModel));
                    }
                    tCarServiceService.insert(tCarService);
                }else{
                    if (1 == tCarService.getType()){
                        tCarService.setServerCarModelId(Integer.valueOf(zcModel));
                    }
                    tCarServiceService.updateById(tCarService);
                TCarService service = new TCarService();
                service.setCarId(tCar.getId());
                service.setType(Integer.valueOf(serverArray[i]));
                if (1 == service.getType()){
                    service.setServerCarModelId(Integer.valueOf(zcModel));
                }else if (4 == service.getType()){
                    service.setServerCarModelId(Integer.valueOf(xjModel));
                }
                tCarServiceService.insert(service);
            }
        }
        tCarService.updateById(tCar);
        tCar = tCarService.selectById(tCar.getId());
@@ -635,6 +632,7 @@
            @Override
            public void run() {
                try {
                    Integer language = tDriver.getLanguage();
                    String path = templatePath +  "driver/index.html";
                    Document document = Jsoup.parse(new File(path), "UTF-8");
                    document.getElementById("chinese").remove();
@@ -648,17 +646,42 @@
                    document.getElementById("reward1").remove();
                    document.getElementById("rewardToday1").remove();
                    document.getElementById("driverAudit1").remove();
                    document.getElementsByTag("title").get(0).text(2 == finalTCar.getAuthState() ? "Vehicle is verified and qualified" : "Vehicle is not verified and qualified");
                    Element car_audit1_user = document.getElementById("car_audit1_user");
                    car_audit1_user.text("Hello " + tDriver.getFirstName() + " " + tDriver.getLastName() + ",");
                    Element car_audit1_content = document.getElementById("car_audit1_content");
                    if(2 == finalTCar.getAuthState()){
                        car_audit1_content.text("You vehicle application has been approved. See the I-GO platform for details.");
                    }else{
                        car_audit1_content.text("Sorry, your vehicle application was not approved. The reason for the failure is: incomplete filling of vehicle information.");
                    if(1 == language){
                        document.getElementsByTag("title").get(0).text(2 == finalTCar.getAuthState() ? "车辆审核通过" : "车辆审核不通过");
                        Element car_audit1_user = document.getElementById("car_audit1_user");
                        car_audit1_user.text("Hello " + tDriver.getFirstName() + " " + tDriver.getLastName() + ",");
                        Element car_audit1_content = document.getElementById("car_audit1_content");
                        if(2 == finalTCar.getAuthState()){
                            car_audit1_content.html("您的车辆注册申请已获批准<br>详情请查看I-GO APP");
                        }else{
                            car_audit1_content.html("我们很遗憾地通知您: 您的车辆申请已被拒绝。相关详情,请与我们的客服联系,致电0577777767或发送电子邮件至support@i-go.group");
                        }
                        EmailUtil.send(tDriver.getEmail(), 2 == finalTCar.getAuthState() ? "车辆审核通过" : "车辆审核不通过",  document.html());
                    }
                    EmailUtil.send(tDriver.getEmail(), 2 == finalTCar.getAuthState() ? "Vehicle is verified and qualified" : "Vehicle is not verified and qualified",  document.html());
                    if(2 == language){
                        document.getElementsByTag("title").get(0).text(2 == finalTCar.getAuthState() ? "Vehicle is verified and qualified" : "Vehicle is not verified and qualified");
                        Element car_audit2_user = document.getElementById("car_audit2_user");
                        car_audit2_user.text("Hello " + tDriver.getFirstName() + " " + tDriver.getLastName() + ",");
                        Element car_audit2_content = document.getElementById("car_audit2_content");
                        if(2 == finalTCar.getAuthState()){
                            car_audit2_content.html("Your vehicle application has been approved. <br>See the I-GO platform for details.");
                        }else{
                            car_audit2_content.html("We are sorry to inform you that your vehicle application was rejected. Please contact our service for relevant details, call 0577777767 or send e-mail to support@i-go.group");
                        }
                        EmailUtil.send(tDriver.getEmail(), 2 == finalTCar.getAuthState() ? "Vehicle is verified and qualified" : "Vehicle is not verified and qualified",  document.html());
                    }
                    if(3 == language){
                        document.getElementsByTag("title").get(0).text(2 == finalTCar.getAuthState() ? "Le véhicule est vérifié et qualifié" : "Le véhicule n’est pas vérifié et qualifié");
                        Element car_audit3_user = document.getElementById("car_audit3_user");
                        car_audit3_user.text("Bonjour " + tDriver.getFirstName() + " " + tDriver.getLastName() + ",");
                        Element car_audit3_content = document.getElementById("car_audit3_content");
                        if(2 == finalTCar.getAuthState()){
                            car_audit3_content.html("Votre demande de véhicule a été approuvée.<br>Veuillez consulter la plateforme I-GO pour plus de détails.");
                        }else{
                            car_audit3_content.html("Nous avons le regret de vous informer que votre demande de véhicule a été rejetée. Veuillez contacter notre service pour plus de détails, appelez 0577777767 ou envoyez un e-mail à support@i-go.group");
                        }
                        EmailUtil.send(tDriver.getEmail(), 2 == finalTCar.getAuthState() ? "Le véhicule est vérifié et qualifié" : "Le véhicule n’est pas vérifié et qualifié",  document.html());
                    }
                }catch (Exception e){
                    e.printStackTrace();
                }