|
|
@@ -1,22 +1,19 @@
|
|
|
package io.renren.modules.listener;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-
|
|
|
-import org.springframework.amqp.core.Message;
|
|
|
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.rabbitmq.client.Channel;
|
|
|
-
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
import io.renren.common.canstant.QueueConstant;
|
|
|
import io.renren.modules.qmgj.dao.WorkDao;
|
|
|
import io.renren.modules.qmgj.entity.WorkEntity;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.amqp.core.Message;
|
|
|
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.io.IOException;
|
|
|
|
|
|
@Component
|
|
|
@Slf4j
|
|
|
@@ -31,6 +28,9 @@ public class WorkListener {
|
|
|
try {
|
|
|
String s = new String(message.getBody());
|
|
|
JSONObject jsonObject = JSONObject.parseObject(s);
|
|
|
+ if (ObjectUtil.isNull(jsonObject.get("workId"))) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
Long workId = Long.parseLong(jsonObject.get("workId").toString());
|
|
|
String registrationTime = (String)jsonObject.get("registrationTime");
|
|
|
WorkEntity workEntity = workDao.selectById(workId);
|