Commit 4e840439b91efb1e171bafc4902fba92dad89765
1 parent
4b443325
车辆充电量接口按长沙的格式修改字段。
Showing
2 changed files
with
19 additions
and
19 deletions
src/main/java/com/bsth/repository/JdlReceptionRepository.java
| 1 | -package com.bsth.repository; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | - | ||
| 5 | -import org.springframework.data.jpa.repository.Query; | ||
| 6 | -import org.springframework.data.repository.PagingAndSortingRepository; | ||
| 7 | -import org.springframework.stereotype.Repository; | ||
| 8 | - | ||
| 9 | -import com.bsth.entity.JdlReception; | ||
| 10 | - | ||
| 11 | -@Repository | ||
| 12 | -public interface JdlReceptionRepository extends PagingAndSortingRepository<JdlReception, Integer>{ | ||
| 13 | - | ||
| 14 | - @Query(value = "SELECT inside_code from bsth_c_cars where REPLACE(car_plate, '-', '') = ?1 and scrap_state = 0 order by create_date desc ", nativeQuery = true) | ||
| 15 | - List<Object[]> selectNbbmByPlate(String carPlate); | ||
| 16 | - | ||
| 17 | -} | 1 | +package com.bsth.repository; |
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | + | ||
| 5 | +import org.springframework.data.jpa.repository.Query; | ||
| 6 | +import org.springframework.data.repository.PagingAndSortingRepository; | ||
| 7 | +import org.springframework.stereotype.Repository; | ||
| 8 | + | ||
| 9 | +import com.bsth.entity.JdlReception; | ||
| 10 | + | ||
| 11 | +@Repository | ||
| 12 | +public interface JdlReceptionRepository extends PagingAndSortingRepository<JdlReception, Integer>{ | ||
| 13 | + | ||
| 14 | + @Query(value = "SELECT inside_code from bsth_c_cars where REPLACE(car_plate, '-', '') = ?1 and scrap_state = 0 order by create_date desc ", nativeQuery = true) | ||
| 15 | + List<Object> selectNbbmByPlate(String carPlate); | ||
| 16 | + | ||
| 17 | +} |
src/main/java/com/bsth/server_rs/electric/ElectricService.java
| @@ -87,9 +87,9 @@ public class ElectricService { | @@ -87,9 +87,9 @@ public class ElectricService { | ||
| 87 | jdlReception.setStationName(body.getString("sumPeriod")); // 时段数 | 87 | jdlReception.setStationName(body.getString("sumPeriod")); // 时段数 |
| 88 | jdlReception.setVinCode(body.getString("vinCode")); // 车架号 | 88 | jdlReception.setVinCode(body.getString("vinCode")); // 车架号 |
| 89 | jdlReception.setCardNo(body.getString("carPlate")); // 车牌号 | 89 | jdlReception.setCardNo(body.getString("carPlate")); // 车牌号 |
| 90 | - List<Object[]> selectNbbmByPlate = jdlReceptionRepository.selectNbbmByPlate(jdlReception.getCardNo().replaceAll("-", "")); | 90 | + List<Object> selectNbbmByPlate = jdlReceptionRepository.selectNbbmByPlate(jdlReception.getCardNo().replaceAll("-", "")); |
| 91 | if(selectNbbmByPlate.size() > 0){ | 91 | if(selectNbbmByPlate.size() > 0){ |
| 92 | - jdlReception.setCarCode(selectNbbmByPlate.get(0)[0].toString()); // 车辆自编号 | 92 | + jdlReception.setCarCode(selectNbbmByPlate.get(0).toString()); // 车辆自编号 |
| 93 | } else { | 93 | } else { |
| 94 | resMap.put("Status", 1); | 94 | resMap.put("Status", 1); |
| 95 | resMap.put("Msg", "该车牌号在系统中找不到相应车辆"); | 95 | resMap.put("Msg", "该车牌号在系统中找不到相应车辆"); |