ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/AppUserInfoDto.java
@@ -23,6 +23,8 @@ private Integer points; @ApiModelProperty("当前优惠卷数量") private Integer couponNum; @ApiModelProperty("是否第一次添加车") private Integer firstAdd; @ApiModelProperty("当前绑定的车辆") private List<TAppUserCar> userCars; } ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUser.java
@@ -79,6 +79,9 @@ @ApiModelProperty(value = "积分") @TableField("points") private Integer points; @ApiModelProperty(value = "积分") @TableField("first_add") private Integer firstAdd; @ApiModelProperty(value = "省名称") @TableField("province") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserCar.java
@@ -43,6 +43,12 @@ @TableField("license_plate") private String licensePlate; @ApiModelProperty(value = "车牌") @TableField("pic") private String pic; @ApiModelProperty(value = "车辆品牌") @TableField("vehicle_brand") private String vehicleBrand; ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -523,6 +523,7 @@ tAppUserCar.setUid(tAppUserCar.getId().toString()); } appUserInfoDto.setUserCars(list); appUserInfoDto.setFirstAdd(byId.getFirstAdd()!=null?byId.getFirstAdd():0); return R.ok(appUserInfoDto); @@ -821,6 +822,7 @@ //增加积分记录 pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+point,5,userId,appUserCar.getLicensePlate(),""); byId.setPoints(byId.getPoints()+point); byId.setFirstAdd(1); appUserService.updateById(byId); @@ -854,7 +856,7 @@ } @ApiOperation(value = "根据品牌获取车型", tags = {"小程序-个人中心-车辆"}) @ApiOperation(value = "根据品牌获取车系", tags = {"小程序-个人中心-车辆"}) @GetMapping(value = "/user/car/getModel") public R getModel(String id) throws Exception { String modelById = CarBrandUtil.getModelById(id); @@ -868,5 +870,20 @@ } return R.ok(backList); } @ApiOperation(value = "根据车系获取车型", tags = {"小程序-个人中心-车辆"}) @GetMapping(value = "/user/car/getSeries") public R getSeries(String id) throws Exception { String modelById = CarBrandUtil.getSeriesById(id); JSONObject jsonObject = JSON.parseObject(modelById); JSONArray data = jsonObject.getJSONArray("data"); JSONArray backList = new JSONArray(); for (Object datum : data) { JSONObject jsonObject1 = JSON.parseObject(datum.toString()); JSONArray list = jsonObject1.getJSONArray("list"); backList.addAll(list); } return R.ok(backList); } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/carBrand/CarBrandUtil.java
@@ -117,4 +117,59 @@ } return ""; } public static String getSeriesById(String brandId) throws Exception { // Create a new request. Request httpClientRequest = new Request(); try { // Set the request parameters. // AppKey, AppSecrect, Method and Url are required parameters. // Directly writing AK/SK in code is risky. For security, encrypt your AK/SK and store them in the configuration file or environment variables. // In this example, the AK/SK are stored in environment variables for identity authentication. // Before running this example, set environment variables HUAWEICLOUD_SDK_AK and HUAWEICLOUD_SDK_SK. httpClientRequest.setKey("9a4a2b69afe141718f6843c5d39961ec"); httpClientRequest.setSecret("541845f206324bbc933065b44fc98c47"); httpClientRequest.setMethod("POST"); // Set a request URL in the format of https://{Endpoint}/{URI}. httpClientRequest.setUrl("https://vehiclequery.apistore.huaweicloud.com/vehicle/query/model"); httpClientRequest.addHeader("Content-Type", "text/plain"); httpClientRequest.addQueryStringParam("seriesId",brandId); // Set a body for http request. // httpClientRequest.setBody("put your request body here"); } catch (Exception e) { // LOGGER.error(e.getMessage()); return ""; } CloseableHttpClient client = null; try { // Sign the request. HttpRequestBase signedRequest = Client.sign(httpClientRequest, Constant.SIGNATURE_ALGORITHM_SDK_HMAC_SHA256); if (Constant.DO_VERIFY) { // creat httpClient and verify ssl certificate HostName.setUrlHostName(httpClientRequest.getHost()); client = (CloseableHttpClient) SSLCipherSuiteUtil.createHttpClientWithVerify(Constant.INTERNATIONAL_PROTOCOL); } else { // creat httpClient and do not verify ssl certificate client = (CloseableHttpClient) SSLCipherSuiteUtil.createHttpClient(Constant.INTERNATIONAL_PROTOCOL); } HttpResponse response = client.execute(signedRequest); // Print the body of the response. HttpEntity resEntity = response.getEntity(); if (resEntity != null) { // LOGGER.info("Processing Body with name: {} and value: {}", System.getProperty("line.separator"), // EntityUtils.toString(resEntity, "UTF-8")); String string = EntityUtils.toString(resEntity, "UTF-8"); return string; } } catch (Exception e) { LOGGER.error(e.getMessage()); } finally { if (client != null) { client.close(); } } return ""; } } ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/CodeController.java
@@ -10,14 +10,19 @@ import com.ruoyi.common.core.utils.MsgUtil; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.redis.service.RedisService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Objects; import java.util.concurrent.TimeUnit; @RestController @RequestMapping("/code") public class CodeController { @Autowired @@ -34,7 +39,7 @@ * @return 结果 */ @ApiOperation(value = "获取验证码",notes = "获取验证码",tags = {"更换手机号获取验证码"}) @GetMapping("getCode") @GetMapping("/getCode") public AjaxResult getCode(@RequestParam("phone") String phone) { TAppUser appUser = appUserClient.selectByPhone(phone).getData(); @@ -56,8 +61,8 @@ * @param phone 手机号 * @return 结果 */ @ApiOperation(value = "获取验证码",notes = "获取验证码",tags = {"申请建桩"}) @GetMapping("getApplyCode") @ApiOperation(value = "获取验证码",notes = "获取验证码",tags = {"申请建桩获取验证码"}) @GetMapping("/getApplyCode") public AjaxResult getApplyCode(@RequestParam("phone") String phone) { String code = MsgUtil.createCode(); ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
@@ -141,7 +141,7 @@ response.setContentType("application/force-download"); response.addHeader("Content-Disposition", "attachment;fileName=" + fileName); String url = "https://www.baidu.com?id=" + id; String filePath = "D://" + fileName; String filePath = "D:/Program Files/nginx-1.20.2/html"; QRCodeUtils.encode(url, filePath); FileInputStream inputStream = new FileInputStream(filePath); ServletOutputStream out = response.getOutputStream(); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java
@@ -37,7 +37,7 @@ @ApiOperation(tags = {"小程序-订单评价"},value = "充电订单评价标签及数量查询") @PostMapping(value = "/getTagCount") @GetMapping(value = "/getTagCount") public AjaxResult<List<TEvaluationTagVO>> getTagCount() { return AjaxResult.ok(orderEvaluateService.getTagCount()); }