From d56eb9b8c519945957c2a90e4204efb48abd463b Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 27 七月 2023 14:18:56 +0800 Subject: [PATCH] 更新接口 --- DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java | 44 ++++++++++++++++++++++++++++---------------- 1 files changed, 28 insertions(+), 16 deletions(-) diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java index de5520d..89fb2ce 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java @@ -172,7 +172,19 @@ //发送验证码短信 redisUtil.setStrValue(phone, authCode, 5 * 60);//设置五分钟过期 - SMSUtil.send_huawei_sms("b793ae3d41a049059197bfe92cf8bc83", "+" + phone, "[\"" + authCode + "\"]"); + String templateId = ""; + switch (language){ + case 1: + templateId = "b793ae3d41a049059197bfe92cf8bc83"; + break; + case 2: + templateId = "058c7d11ce594d668841cceb49fb5c9a"; + break; + case 3: + templateId = "4edbe604da6546808ffda582085b3c83"; + break; + } + SMSUtil.send_huawei_sms(templateId, "+" + phone, "[\"" + authCode + "\"]"); System.out.println(sms); return ResultUtil.success(); } @@ -258,8 +270,8 @@ * @throws Exception */ @Override - public boolean checkCaptcha(String phone, String code) throws Exception { - Object value = redisUtil.getValue(phone); + public boolean checkCaptcha(String email, String phone, String code) throws Exception { + Object value = redisUtil.getValue(ToolUtil.isNotEmpty(email) ? email : phone); if("1246".equals(code)){ return true; } @@ -399,7 +411,7 @@ */ @Override public ResultUtil<LoginWarpper> registeredDriver(String phoneOperator, String phone, String code, String password,Integer uid,Integer uType, Integer language) throws Exception { - boolean b = this.checkCaptcha(phone, code); + boolean b = this.checkCaptcha("", phone, code); if(!b){ return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); } @@ -601,7 +613,7 @@ */ @Override public ResultUtil resetPassword(String phone, String code, String password, Integer language) throws Exception { - boolean b = this.checkCaptcha(phone, code); + boolean b = this.checkCaptcha("", phone, code); if(!b){ return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); } @@ -818,7 +830,7 @@ Driver driver = this.selectById(uid); if(null != driverWork){//作下班操作 //检测是否有未完成的订单 - List<Map<String, Object>> list = orderService.queryOrderList(1, 1, 10, uid); + List<Map<String, Object>> list = orderService.queryOrderList(1, 1, 10, uid, language); if(list.size() > 0){ return ResultUtil.error(language == 1 ? "还有未完成的订单,不能进行下班操作" : language == 2 ? "There are still outstanding orders, can not be off-duty operation" : "Il y a encore des commandes en suspens qui ne peuvent pas être exécutées"); } @@ -883,7 +895,7 @@ Driver driver = this.selectById(uid); if(null != driverWork){//作下班操作 //检测是否有未完成的订单 - List<Map<String, Object>> list = orderService.queryOrderList(1, 1, 10, uid); + List<Map<String, Object>> list = orderService.queryOrderList(1, 1, 10, uid, language); if(list.size() > 0){ return ResultUtil.error(language == 1 ? "还有未完成的订单,不能进行下班操作" : language == 2 ? "There are still outstanding orders, can not be off-duty operation" : "Il y a encore des commandes en suspens qui ne peuvent pas être exécutées"); } @@ -941,14 +953,14 @@ * @throws Exception */ @Override - public Map<String, Object> queryHomeNum(Integer uid) throws Exception { + public Map<String, Object> queryHomeNum(Integer uid, Integer language) throws Exception { Map<String, Object> map = new HashMap<>(); //出租车 List<Map<String, Object>> list = orderTaxiService.queryOrderList(1, uid); map.put("service", list.size());//服务中 list = orderTaxiService.queryOrderList(2, uid); map.put("reservation", list.size());//预约 - List<Map<String, Object>> list1 = orderLogisticsService.queryOrderList(uid); + List<Map<String, Object>> list1 = orderLogisticsService.queryOrderList(uid, language); map.put("small", list1.size());//小件 int size = this.queryMyActivity(uid, new Date()).size(); map.put("activity", size);//活动 @@ -963,7 +975,7 @@ * @throws Exception */ @Override - public List<BaseWarpper> queryMyBusiness(Integer uid) throws Exception { + public List<BaseWarpper> queryMyBusiness(Integer uid, Integer language) throws Exception { List<DriverService> list = driverServiceMapper.queryMyBusiness(uid); List<BaseWarpper> maps = new ArrayList<>(); for (DriverService d : list){ @@ -971,19 +983,19 @@ baseWarpper.setId(d.getType()); switch (d.getType()){ case 1: - baseWarpper.setName("专车"); + baseWarpper.setName(language == 1 ? "专车" : language == 2 ? "Special car" : "véhicules"); break; case 2: - baseWarpper.setName("出租车"); + baseWarpper.setName(language == 1 ? "出租车" : language == 2 ? "taxi" : "taxi"); break; case 3: - baseWarpper.setName("跨城出行"); + baseWarpper.setName(language == 1 ? "跨城出行" : language == 2 ? "Cross-town travel" : "Se déplacer à travers la ville"); break; case 4: - baseWarpper.setName("市内小件物流"); + baseWarpper.setName(language == 1 ? "市内小件物流" : language == 2 ? "Small parts logistics in the city" : "Logistique de petites pièces dans la ville"); break; case 5: - baseWarpper.setName("跨城小件物流"); + baseWarpper.setName(language == 1 ? "跨城小件物流" : language == 2 ? "Cross-city small parts logistics" : "Logistique des petites pièces à travers la ville"); break; } maps.add(baseWarpper); @@ -1034,7 +1046,7 @@ if(null != driver){ return ResultUtil.error(language == 1 ? "电话号码已被注册" : language == 2 ? "he phone number is registered" : "Le numéro de téléphone a été enregistré"); } - boolean b = this.checkCaptcha(phone, code); + boolean b = this.checkCaptcha("", phone, code); if(!b){ return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); } -- Gitblit v1.7.1