Commit 71e3176e95726ee8f169b0b3272d61023a011880
1 parent
0aa930c1
青浦电量接口添加充电站名称与充电站ID字段。
Showing
2 changed files
with
16 additions
and
3 deletions
src/main/java/com/bsth/entity/JdlReception.java
| ... | ... | @@ -64,6 +64,7 @@ public class JdlReception { |
| 64 | 64 | private Integer sumTime; |
| 65 | 65 | private String operatorName; |
| 66 | 66 | private String operatorId; |
| 67 | + private String stationId; | |
| 67 | 68 | private String createBy; |
| 68 | 69 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| 69 | 70 | private Date createDate; |
| ... | ... | @@ -204,6 +205,12 @@ public class JdlReception { |
| 204 | 205 | public void setOperatorId(String operatorId) { |
| 205 | 206 | this.operatorId = operatorId; |
| 206 | 207 | } |
| 208 | + public String getStationId() { | |
| 209 | + return stationId; | |
| 210 | + } | |
| 211 | + public void setStationId(String stationId) { | |
| 212 | + this.stationId = stationId; | |
| 213 | + } | |
| 207 | 214 | public String getCreateBy() { |
| 208 | 215 | return createBy; |
| 209 | 216 | } | ... | ... |
src/main/java/com/bsth/server_rs/electric/ElectricService.java
| ... | ... | @@ -75,7 +75,6 @@ public class ElectricService { |
| 75 | 75 | String endTime = body.getString("endTime"); |
| 76 | 76 | |
| 77 | 77 | JdlReception jdlReception = new JdlReception(); |
| 78 | - jdlReception.setStationName(body.getString("stationName")); | |
| 79 | 78 | jdlReception.setConnectorId(body.getString("connectorId")); |
| 80 | 79 | jdlReception.setOrderNo(body.getString("startChargeSeq")); |
| 81 | 80 | jdlReception.setStartTime(startTime); |
| ... | ... | @@ -91,11 +90,18 @@ public class ElectricService { |
| 91 | 90 | jdlReception.setCardNo(body.getString("cardNo")); |
| 92 | 91 | jdlReception.setCarCode(body.getString("carCode")); |
| 93 | 92 | jdlReception.setCarPlate(body.getString("carPlate")); |
| 94 | - if(body.containsKey("operatorName")){ | |
| 93 | + if(body.containsKey("operatorName") && body.get("operatorName") != null){ | |
| 95 | 94 | jdlReception.setOperatorName(body.getString("operatorName")); |
| 96 | - }if(body.containsKey("operatorId")){ | |
| 95 | + } | |
| 96 | + if(body.containsKey("operatorId") && body.get("operatorId") != null){ | |
| 97 | 97 | jdlReception.setOperatorId(body.getString("operatorId")); |
| 98 | 98 | } |
| 99 | + if(body.containsKey("stationName") && body.get("stationName") != null){ | |
| 100 | + jdlReception.setStationName(body.getString("stationName")); | |
| 101 | + } | |
| 102 | + if(body.containsKey("stationId") && body.get("stationId") != null){ | |
| 103 | + jdlReception.setStationId(body.getString("stationId")); | |
| 104 | + } | |
| 99 | 105 | jdlReception.setOrigin(0); |
| 100 | 106 | jdlReception.setCreateBy("接口接入"); |
| 101 | 107 | jdlReception.setCreateDate(new Date()); | ... | ... |