Commit a6c3a9292668792766b293c8bb45ae34bdb3fa7e

Authored by zhaowg3
1 parent 6bf414d7

增加消息队列发送

src/main/java/com/zteits/irain/portal/web/irain/UpdateFreeBerthController.java
... ... @@ -20,6 +20,8 @@ import com.alibaba.fastjson.JSONObject;
20 20 import com.clouds.common.cache.park.ParkingLotCacheUtil;
21 21 import com.clouds.common.cache.sys.SysCodeValueCacheUtil;
22 22 import com.clouds.common.constants.CodeValKindEnum;
  23 +import com.clouds.common.constants.RedisKeyEnum;
  24 +import com.clouds.common.redis.RedisCacheUtil;
23 25 import com.clouds.common.utils.ResultUtils;
24 26 import com.clouds.common.web.vo.BizResultVO;
25 27 import com.google.common.collect.Lists;
... ... @@ -62,6 +64,8 @@ public class UpdateFreeBerthController {
62 64 private ParkLotIdleBerthsService parkLotIdleBerthsService;
63 65 @Autowired
64 66 private ParkingLotQueryService parkingLotQueryService;
  67 + @Autowired
  68 + private RedisCacheUtil redisCacheUtil;
65 69  
66 70  
67 71 @ApiOperation("更新空闲车位总数")
... ... @@ -105,6 +109,13 @@ public class UpdateFreeBerthController {
105 109 updaterequest.setSysCode(sysCode);
106 110 int freeBerths = parkLotIdleBerthsService.updateAndGetIdleBerthByParkNo(updaterequest.getInoutTime(), updaterequest.getPlNo(), updaterequest.getType(), updaterequest.getFromType(), updaterequest.getFreeBerths());
107 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 120 logger.info("特殊处理-针对水岸天街左右更新空闲车位总数结束");
110 121 return new BizResultVO<Boolean>().setData(true);
... ...