Commit a6c3a9292668792766b293c8bb45ae34bdb3fa7e
1 parent
6bf414d7
增加消息队列发送
Showing
1 changed file
with
11 additions
and
0 deletions
src/main/java/com/zteits/irain/portal/web/irain/UpdateFreeBerthController.java
@@ -20,6 +20,8 @@ import com.alibaba.fastjson.JSONObject; | @@ -20,6 +20,8 @@ import com.alibaba.fastjson.JSONObject; | ||
20 | import com.clouds.common.cache.park.ParkingLotCacheUtil; | 20 | import com.clouds.common.cache.park.ParkingLotCacheUtil; |
21 | import com.clouds.common.cache.sys.SysCodeValueCacheUtil; | 21 | import com.clouds.common.cache.sys.SysCodeValueCacheUtil; |
22 | import com.clouds.common.constants.CodeValKindEnum; | 22 | import com.clouds.common.constants.CodeValKindEnum; |
23 | +import com.clouds.common.constants.RedisKeyEnum; | ||
24 | +import com.clouds.common.redis.RedisCacheUtil; | ||
23 | import com.clouds.common.utils.ResultUtils; | 25 | import com.clouds.common.utils.ResultUtils; |
24 | import com.clouds.common.web.vo.BizResultVO; | 26 | import com.clouds.common.web.vo.BizResultVO; |
25 | import com.google.common.collect.Lists; | 27 | import com.google.common.collect.Lists; |
@@ -62,6 +64,8 @@ public class UpdateFreeBerthController { | @@ -62,6 +64,8 @@ public class UpdateFreeBerthController { | ||
62 | private ParkLotIdleBerthsService parkLotIdleBerthsService; | 64 | private ParkLotIdleBerthsService parkLotIdleBerthsService; |
63 | @Autowired | 65 | @Autowired |
64 | private ParkingLotQueryService parkingLotQueryService; | 66 | private ParkingLotQueryService parkingLotQueryService; |
67 | + @Autowired | ||
68 | + private RedisCacheUtil redisCacheUtil; | ||
65 | 69 | ||
66 | 70 | ||
67 | @ApiOperation("更新空闲车位总数") | 71 | @ApiOperation("更新空闲车位总数") |
@@ -105,6 +109,13 @@ public class UpdateFreeBerthController { | @@ -105,6 +109,13 @@ public class UpdateFreeBerthController { | ||
105 | updaterequest.setSysCode(sysCode); | 109 | updaterequest.setSysCode(sysCode); |
106 | int freeBerths = parkLotIdleBerthsService.updateAndGetIdleBerthByParkNo(updaterequest.getInoutTime(), updaterequest.getPlNo(), updaterequest.getType(), updaterequest.getFromType(), updaterequest.getFreeBerths()); | 110 | int freeBerths = parkLotIdleBerthsService.updateAndGetIdleBerthByParkNo(updaterequest.getInoutTime(), updaterequest.getPlNo(), updaterequest.getType(), updaterequest.getFromType(), updaterequest.getFreeBerths()); |
107 | logger.info("调用后场服务:更新车位总数", freeBerths); | 111 | logger.info("调用后场服务:更新车位总数", freeBerths); |
112 | + //消息队列 | ||
113 | + JSONObject jsonObject = new JSONObject(); | ||
114 | + //空闲车位数 | ||
115 | + jsonObject.put("freeBerths", (Integer)entry.getValue()); | ||
116 | + //停车场编号 | ||
117 | + jsonObject.put("plNo", entry.getKey()); | ||
118 | + redisCacheUtil.convertAndSend(RedisKeyEnum.PARK_FREEBERTH_PLNO_FREEBERTH_TOPIC.key(),jsonObject); | ||
108 | } | 119 | } |
109 | logger.info("特殊处理-针对水岸天街左右更新空闲车位总数结束"); | 120 | logger.info("特殊处理-针对水岸天街左右更新空闲车位总数结束"); |
110 | return new BizResultVO<Boolean>().setData(true); | 121 | return new BizResultVO<Boolean>().setData(true); |