| | |
| | | return ResponseWarpper.success(ResultUtil.error("账号已冻结")); |
| | | } |
| | | } |
| | | String numberRandom = UUIDUtil.getNumberRandom(4); |
| | | String numberRandom = UUIDUtil.getNumberRandom(5); |
| | | SendSmsRequest request = new SendSmsRequest(); |
| | | request.setDestAddress(phone); |
| | | request.setTemplateId("TPL202410290001"); |
| | |
| | | name = UUIDUtil.getRandomCode() + name.substring(name.lastIndexOf(".")); |
| | | File file1 = FileUtil.writeFromStream(inputStream, new File(filePath + name)); |
| | | HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image"); |
| | | HttpRequest form = post.form("file", file1); |
| | | HttpResponse execute = form.execute(); |
| | | post.form("file", file1); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(200 != status){ |
| | | throw new RuntimeException("上传图片异常"); |
| | |
| | | import com.supersavedriving.driver.modular.system.util.weChat.WeChatUtil; |
| | | import com.supersavedriving.driver.modular.system.util.weChat.model.Code2Session; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | |
| | | * @author pzb |
| | | * @Date 2023/2/8 18:52 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class DriverServiceImpl extends ServiceImpl<DriverMapper, Driver> implements IDriverService { |
| | | |
| | |
| | | String pictureName = "driver_" + driverId + ".png"; |
| | | File file = FileUtil.writeFromStream(release, new File(filePath + pictureName)); |
| | | HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image"); |
| | | HttpRequest form = post.form("file", file); |
| | | HttpResponse execute = form.execute(); |
| | | post.form("file", file); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(200 != status){ |
| | | throw new RuntimeException("上传图片异常"); |
| | |
| | | String pictureName = "driver_" + driverId + ".png"; |
| | | File file = FileUtil.writeFromStream(release, new File(filePath + pictureName)); |
| | | HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image"); |
| | | HttpRequest form = post.form("file", file); |
| | | HttpResponse execute = form.execute(); |
| | | post.form("file", file); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(200 != status){ |
| | | throw new RuntimeException("上传图片异常"); |
| | |
| | | return ResultUtil.success(tokenWarpper); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String s = ShiroKit.md5(MD5AndKL.MD5("123456"), "i#sm4"); |
| | | System.out.println(s); |
| | | } |
| | | |
| | | /** |
| | | * 司机密码登录 |
| | |
| | | Double lat = driverPositionWarpper.getLat(); |
| | | Integer driverId = driverPositionWarpper.getDriverId(); |
| | | Integer orderId = driverPositionWarpper.getOrderId(); |
| | | log.info("存储地理空间:{}", driverPositionWarpper); |
| | | redisUtil.setStrValue("daijia:DRIVER" + driverId, lon + "," + lat, 30); |
| | | Query query = Query.query(Criteria.where("driverId").is(driverId)); |
| | | Location old = this.mongoTemplate.findOne(query, Location.class); |
| | |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 6) |
| | | .eq("companyType",1) |
| | | .eq("companyId",1) |
| | | .last("LIMIT 1")); |
| | | .last(" LIMIT 0, 1")); |
| | | Double num1 = JSON.parseObject(systemConfig.getContent()).getDouble("num1"); |
| | | List<Driver> drivers = driverService.selectList(new EntityWrapper<Driver>().eq("approvalStatus", 2).eq("status", 1).lt("balance", num1)); |
| | | for (Driver driver : drivers) { |
| | |
| | | this.setApiUrl("https://test-zhongtai.stqcloud.com:10070"); |
| | | this.setBucketName("bucuTest0625"); |
| | | this.setAppId("wxcc3c9058e2b294db"); |
| | | this.setEndPoint("http://119.4.112.68:27741/v1"); |
| | | this.setEndPoint("http://10.30.52.45:27741/v1"); |
| | | this.setAccount("d8bef0a04db511f0b79d01a3e2b7587e"); |
| | | this.setAccessKey("TYMFTFD5SIIT15DCCUD7"); |
| | | this.setSecretKey("AoI1dkH3yoAvXoaQlREO3ed9mwQJFluLTliS9T1z"); |
| | | } |
| | | if("prod".equals(activeProfile)){ |
| | | this.setAppkey("10001104"); |
| | | this.setPrivateKeyPath("/root/server/app/key/private_key.pem"); |
| | | this.setPrivateKeyPath("/etraffic/server/private_key.pem"); |
| | | this.setUserName("xiwang"); |
| | | this.setStatus("1"); |
| | | this.setApiUrl("http://jjzhongtai.stqcloud.com:10010"); |
| | | this.setBucketName("qyt20250702"); |
| | | this.setAppId("wxcc3c9058e2b294db"); |
| | | this.setEndPoint("http://119.4.112.68:27741/v1"); |
| | | this.setEndPoint("http://10.30.52.45:27741/v1"); |
| | | this.setAccount("d8bef0a04db511f0b79d01a3e2b7587e"); |
| | | this.setAccessKey("TYMFTFD5SIIT15DCCUD7"); |
| | | this.setSecretKey("AoI1dkH3yoAvXoaQlREO3ed9mwQJFluLTliS9T1z"); |
| | |
| | | port: 7007 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | swagger-open: false #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | |
| | | port: 7007 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | swagger-open: false #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | |
| | | } |
| | | if("prod".equals(activeProfile)){ |
| | | this.setAppkey("10001104"); |
| | | this.setPrivateKeyPath("/root/server/app/key/private_key.pem"); |
| | | this.setPrivateKeyPath("/etraffic/server/private_key.pem"); |
| | | this.setUserName("xiwang"); |
| | | this.setStatus("1"); |
| | | this.setApiUrl("http://jjzhongtai.stqcloud.com:10010"); |
| | |
| | | <button class="switch-btn active" value="2" onclick="switchTab(this, '按单')">按单</button> |
| | | @} |
| | | </div> |
| | | |
| | | @if(type == 1){ |
| | | <div id="month" class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span class="control-label" >抽成,每月平台抽取分公司</span> |
| | | <input class="control-label" id="num2" name="num2" value="${num2}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(type == 2){ |
| | | <div id="monad" class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span class="control-label" >抽成,每单平台抽取分公司</span> |
| | | <input class="control-label" id="num3" name="num3" value="${num3}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSystemConfig.extractionRulesSubmit()"/> |
| | |
| | | <button class="switch-btn active" value="1" onclick="switchTab(this, '包月')">包月</button> |
| | | <button class="switch-btn" value="2" onclick="switchTab(this, '按单')">按单</button> |
| | | </div> |
| | | @if(roleType == 1){ |
| | | <div id="month" class="initialLevel col-sm-12 control-label form-group month" style="text-align: left" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span class="control-label" >抽成,每月平台抽取分公司</span> |
| | | <input class="control-label" id="num2" name="num2" value="${num2}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | <div id="monad" hidden="hidden" class="initialLevel col-sm-12 control-label form-group monad" style="text-align: left" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span class="control-label" >抽成,每单平台抽取分公司</span> |
| | | <input class="control-label" id="num3" name="num3" value="${num3}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | @} |
| | | |
| | | @if(roleType == 2){ |
| | | <div id="month" class="initialLevel col-sm-12 control-label form-group month" style="text-align: left" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span class="control-label" >抽成,每月分公司抽取司机</span> |
| | | <input class="control-label" id="num2" name="num2" value="${num2}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | <div id="monad" hidden="hidden" class="initialLevel col-sm-12 control-label form-group monad" style="text-align: left" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span class="control-label" >抽成,每单分公司抽取司机</span> |
| | | <input class="control-label" id="num3" name="num3" value="${num3}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSystemConfig.extractionRulesSubmit()"/> |
| | |
| | | name = UUIDUtil.getRandomCode() + name.substring(name.lastIndexOf(".")); |
| | | File file1 = FileUtil.writeFromStream(inputStream, new File(filePath + name)); |
| | | HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image"); |
| | | HttpRequest form = post.form("file", file1); |
| | | HttpResponse execute = form.execute(); |
| | | post.form("file", file1); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(200 != status){ |
| | | throw new RuntimeException("上传图片异常"); |
| | |
| | | import com.supersavedriving.user.modular.system.util.weChat.WeChatUtil; |
| | | import com.supersavedriving.user.modular.system.warpper.DriverRegisterWarpper; |
| | | import com.supersavedriving.user.modular.system.warpper.NearbyDriverWarpper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.geo.Circle; |
| | |
| | | * @author pzb |
| | | * @Date 2023/2/8 18:52 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class DriverServiceImpl extends ServiceImpl<DriverMapper, Driver> implements IDriverService { |
| | | |
| | |
| | | // 构造query对象 |
| | | Query query = Query.query(Criteria.where("location").withinSphere(circle)); |
| | | List<Location> locations = mongoTemplate.find(query, Location.class); |
| | | log.info("地理空间检索结果:{}", locations); |
| | | List<Integer> collect = locations.stream().map(Location::getDriverId).collect(Collectors.toList()); |
| | | if(collect.size() == 0){ |
| | | return list; |
| | |
| | | String pictureName = "driver_" + driverId + ".png"; |
| | | File file = FileUtil.writeFromStream(release, new File(filePath + pictureName)); |
| | | HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image"); |
| | | HttpRequest form = post.form("file", file); |
| | | HttpResponse execute = form.execute(); |
| | | post.form("file", file); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(200 != status){ |
| | | throw new RuntimeException("上传图片异常"); |
| | |
| | | this.setApiUrl("https://test-zhongtai.stqcloud.com:10070"); |
| | | this.setBucketName("bucuTest0625"); |
| | | this.setAppId("wxcc3c9058e2b294db"); |
| | | this.setEndPoint("http://119.4.112.68:27741/v1"); |
| | | this.setEndPoint("http://10.30.52.45:27741/v1"); |
| | | this.setAccount("d8bef0a04db511f0b79d01a3e2b7587e"); |
| | | this.setAccessKey("TYMFTFD5SIIT15DCCUD7"); |
| | | this.setSecretKey("AoI1dkH3yoAvXoaQlREO3ed9mwQJFluLTliS9T1z"); |
| | | } |
| | | if("prod".equals(activeProfile)){ |
| | | this.setAppkey("10001104"); |
| | | this.setPrivateKeyPath("/root/server/app/key/private_key.pem"); |
| | | this.setPrivateKeyPath("/etraffic/server/private_key.pem"); |
| | | this.setUserName("xiwang"); |
| | | this.setStatus("1"); |
| | | this.setApiUrl("http://jjzhongtai.stqcloud.com:10010"); |
| | | this.setBucketName("qyt20250702"); |
| | | this.setAppId("wxcc3c9058e2b294db"); |
| | | this.setEndPoint("http://119.4.112.68:27741/v1"); |
| | | this.setEndPoint("http://10.30.52.45:27741/v1"); |
| | | this.setAccount("d8bef0a04db511f0b79d01a3e2b7587e"); |
| | | this.setAccessKey("TYMFTFD5SIIT15DCCUD7"); |
| | | this.setSecretKey("AoI1dkH3yoAvXoaQlREO3ed9mwQJFluLTliS9T1z"); |
| | |
| | | port: 7006 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | swagger-open: false #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | |
| | | port: 7006 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | swagger-open: false #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | |
| | | public List<SwaggerResource> get() { |
| | | List resource=new ArrayList<>(); |
| | | //name可以随便写,location前缀要与zuul配置的path一致。zuul开了token验证,要加上token,否则不用加?token=1 |
| | | resource.add(swaggerResource("user","/user-server/v2/api-docs","1.0")); |
| | | resource.add(swaggerResource("driver","/driver-server/v2/api-docs","1.0")); |
| | | // resource.add(swaggerResource("user","/user-server/v2/api-docs","1.0")); |
| | | // resource.add(swaggerResource("driver","/driver-server/v2/api-docs","1.0")); |
| | | return resource; |
| | | } |
| | | |