卡片发送MQ
This commit is contained in:
parent
b214fb353a
commit
40220f8704
|
|
@ -12,10 +12,15 @@ import com.bonus.canteen.core.account.mapper.AccCardHisMapper;
|
||||||
import com.bonus.canteen.core.account.mapper.AccCardMapper;
|
import com.bonus.canteen.core.account.mapper.AccCardMapper;
|
||||||
import com.bonus.canteen.core.account.mapper.AccInfoMapper;
|
import com.bonus.canteen.core.account.mapper.AccInfoMapper;
|
||||||
import com.bonus.canteen.core.account.service.IAccCardService;
|
import com.bonus.canteen.core.account.service.IAccCardService;
|
||||||
|
import com.bonus.canteen.core.common.utils.MqUtil;
|
||||||
|
import com.bonus.canteen.core.user.domain.DeviceMqPersonalUpdateMessageDTO;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.utils.StringUtils;
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
|
import com.bonus.common.houqin.mq.constant.LeMqConstant;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -35,7 +40,7 @@ public class AccCardServiceImpl implements IAccCardService {
|
||||||
private AccInfoMapper accInfoMapper;
|
private AccInfoMapper accInfoMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AccCardHisMapper accCardHisMapper;
|
private AccCardHisMapper accCardHisMapper;
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(AccCardServiceImpl.class);
|
||||||
/**
|
/**
|
||||||
* 查询人员卡片资料
|
* 查询人员卡片资料
|
||||||
*
|
*
|
||||||
|
|
@ -85,6 +90,12 @@ public class AccCardServiceImpl implements IAccCardService {
|
||||||
}
|
}
|
||||||
int count = accCardMapper.insertAccCard(accountCard);
|
int count = accCardMapper.insertAccCard(accountCard);
|
||||||
saveAccCardChangeRecord(accountCard);
|
saveAccCardChangeRecord(accountCard);
|
||||||
|
try {
|
||||||
|
DeviceMqPersonalUpdateMessageDTO bean = new DeviceMqPersonalUpdateMessageDTO().setUpdatePersonPhoto(Math.toIntExact(accountInfo.getUserId()), "update");
|
||||||
|
MqUtil.pushToTenantAllDevice(bean, LeMqConstant.Topic.DEVICE_UPDATE_PERSONAL_CONFIG_V4);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发送MQ消息失败", e);
|
||||||
|
}
|
||||||
return count;
|
return count;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException(e.getMessage());
|
throw new ServiceException(e.getMessage());
|
||||||
|
|
@ -153,6 +164,12 @@ public class AccCardServiceImpl implements IAccCardService {
|
||||||
accountCard.setCardStatus(CardStatusEnum.REFUND.getKey());
|
accountCard.setCardStatus(CardStatusEnum.REFUND.getKey());
|
||||||
saveAccCardChangeRecord(accountCard);
|
saveAccCardChangeRecord(accountCard);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
DeviceMqPersonalUpdateMessageDTO bean = new DeviceMqPersonalUpdateMessageDTO().setUpdatePersonPhoto(Math.toIntExact(accountInfo.getUserId()), "update");
|
||||||
|
MqUtil.pushToTenantAllDevice(bean, LeMqConstant.Topic.DEVICE_UPDATE_PERSONAL_CONFIG_V4);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发送MQ消息失败", e);
|
||||||
|
}
|
||||||
return count;
|
return count;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException(e.getMessage());
|
throw new ServiceException(e.getMessage());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue