Commit eaf95f0a9dea388aca23924b0440b0e4c0b1dd66
1 parent
8b3c55b3
增加针对水岸天街左右区分的空闲车位更新
Showing
1 changed file
with
25 additions
and
1 deletions
src/main/java/com/zteits/irain/portal/web/irain/UpdateFreeBerthController.java
... | ... | @@ -2,11 +2,13 @@ package com.zteits.irain.portal.web.irain; |
2 | 2 | |
3 | 3 | import java.util.List; |
4 | 4 | import java.util.Map; |
5 | +import java.util.Map.Entry; | |
5 | 6 | |
6 | 7 | import org.slf4j.Logger; |
7 | 8 | import org.slf4j.LoggerFactory; |
8 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
9 | 10 | import org.springframework.beans.factory.annotation.Value; |
11 | +import org.springframework.util.CollectionUtils; | |
10 | 12 | import org.springframework.web.bind.annotation.GetMapping; |
11 | 13 | import org.springframework.web.bind.annotation.PostMapping; |
12 | 14 | import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -80,11 +82,33 @@ public class UpdateFreeBerthController { |
80 | 82 | updaterequest.setPlNo(plNo); |
81 | 83 | updaterequest.setFromType(fromType); |
82 | 84 | updaterequest.setSysCode(sysCode); |
83 | - logger.info("请求参数:"+JSONObject.toJSONString(request)); | |
85 | + logger.info("请求参数:"+JSONObject.toJSONString(updaterequest)); | |
84 | 86 | int freeBerths = parkLotIdleBerthsService.updateAndGetIdleBerthByParkNo(updaterequest.getInoutTime(), updaterequest.getPlNo(), updaterequest.getType(), updaterequest.getFromType(), updaterequest.getFreeBerths()); |
85 | 87 | logger.info("调用后场服务:更新车位总数", freeBerths); |
86 | 88 | return new BizResultVO<Boolean>().setData(true); |
87 | 89 | } |
88 | 90 | |
91 | + @ApiOperation("特殊处理-针对水岸天街左右更新空闲车位总数") | |
92 | + @GetMapping("updateFreeBerthForSpecial") | |
93 | + public BizResultVO<Boolean> updateFreeBerthForSpecial(@RequestParam Map<String,Integer> freeBerthsMap){ | |
94 | + //通过上报停车场编号查询对应的自己内部停车场编号 | |
95 | + logger.info("特殊处理-针对水岸天街左右更新空闲车位总数请求参数:"+JSONObject.toJSONString(freeBerthsMap)); | |
96 | + if(freeBerthsMap==null||freeBerthsMap.isEmpty()){ | |
97 | + return new BizResultVO<Boolean>().setData(true); | |
98 | + } | |
99 | + for (Entry<String, Integer> entry : freeBerthsMap.entrySet()) { | |
100 | + //更新空闲车位数 | |
101 | + UpdateFreeBerthRequest updaterequest=new UpdateFreeBerthRequest(); | |
102 | + updaterequest.setFreeBerths(entry.getValue()); | |
103 | + updaterequest.setPlNo(entry.getKey()); | |
104 | + updaterequest.setFromType(2); | |
105 | + updaterequest.setSysCode(sysCode); | |
106 | + int freeBerths = parkLotIdleBerthsService.updateAndGetIdleBerthByParkNo(updaterequest.getInoutTime(), updaterequest.getPlNo(), updaterequest.getType(), updaterequest.getFromType(), updaterequest.getFreeBerths()); | |
107 | + logger.info("调用后场服务:更新车位总数", freeBerths); | |
108 | + } | |
109 | + logger.info("特殊处理-针对水岸天街左右更新空闲车位总数结束"); | |
110 | + return new BizResultVO<Boolean>().setData(true); | |
111 | + } | |
112 | + | |
89 | 113 | |
90 | 114 | } | ... | ... |