|
@@ -1,7 +1,11 @@
|
|
|
package com.usky.dxtop.service.listener;
|
|
|
|
|
|
+import com.usky.dxtop.common.utils.StringUtils;
|
|
|
+import com.usky.dxtop.model.Staff;
|
|
|
import com.usky.dxtop.service.MsgLogService;
|
|
|
+import com.usky.dxtop.service.StaffService;
|
|
|
import com.usky.dxtop.service.config.rabbitmq.profile.ProfileProduceConfig;
|
|
|
+import com.usky.dxtop.service.constant.MsgLogBusinessCode;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.amqp.core.Message;
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
@@ -19,12 +23,20 @@ import java.nio.charset.StandardCharsets;
|
|
|
public class PersonMqListener {
|
|
|
@Autowired
|
|
|
private MsgLogService msgLogService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private StaffService staffService;
|
|
|
@RabbitListener(queues = ProfileProduceConfig.NAME, containerFactory = ProfileProduceConfig.LISTENER)
|
|
|
public void dealDeclareMessage(Message message) {
|
|
|
try {
|
|
|
String s = new String(message.getBody(), StandardCharsets.UTF_8);
|
|
|
- msgLogService.consumerSuccess(s,msgLog -> {});
|
|
|
+ msgLogService.consumerSuccess(s,msgLog -> {
|
|
|
+ String staffId = StringUtils.remove(msgLog.getBusinessId(), MsgLogBusinessCode.STAFF);
|
|
|
+ Staff staff = staffService.getById(staffId);
|
|
|
+ if (null != staff && !staff.getIsSuccess()){
|
|
|
+ staff.setIsSuccess(msgLog.getIsSuccess());
|
|
|
+ staffService.updateById(staff);
|
|
|
+ }
|
|
|
+ });
|
|
|
} catch (Exception e) {
|
|
|
log.info("charge_trans_produce"+"异常信息:" + e.getMessage());
|
|
|
} finally {
|