|
|
|
@ -3,10 +3,13 @@ package com.logpm.warehouse.receiver;
|
|
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
|
import com.logpm.warehouse.dto.TrayInfoDTO; |
|
|
|
|
import com.logpm.warehouse.entity.SyncOldTrayTypeLogEntity; |
|
|
|
|
import com.logpm.warehouse.service.ISyncOldTrayTypeLogService; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseUpdownTypeService; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
|
import org.springblade.common.constant.TenantNum; |
|
|
|
|
import org.springframework.amqp.core.ExchangeTypes; |
|
|
|
|
import org.springframework.amqp.rabbit.annotation.Exchange; |
|
|
|
|
import org.springframework.amqp.rabbit.annotation.Queue; |
|
|
|
@ -15,6 +18,7 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@ -23,6 +27,7 @@ import java.util.Objects;
|
|
|
|
|
public class OldTrayTypeListener { |
|
|
|
|
|
|
|
|
|
private final IWarehouseUpdownTypeService warehouseUpdownTypeService; |
|
|
|
|
private final ISyncOldTrayTypeLogService syncOldTrayTypeLogService; |
|
|
|
|
|
|
|
|
|
@RabbitListener(bindings = @QueueBinding( |
|
|
|
|
value = @Queue(name = RabbitConstant.OLD_TRAY_TYPE_QUEUE), |
|
|
|
@ -55,6 +60,18 @@ public class OldTrayTypeListener {
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
if(!Objects.isNull(oldTrayTypeId)){ |
|
|
|
|
warehouseUpdownTypeService.updateOldTrayTypeInfoNum(oldTrayTypeId); |
|
|
|
|
}else{ |
|
|
|
|
SyncOldTrayTypeLogEntity syncOldTrayTypeLogEntity = new SyncOldTrayTypeLogEntity(); |
|
|
|
|
syncOldTrayTypeLogEntity.setCreateUser(1714696768639311873L); |
|
|
|
|
syncOldTrayTypeLogEntity.setUpdateUser(1714696768639311873L); |
|
|
|
|
syncOldTrayTypeLogEntity.setCreateDept(1649331096241836033L); |
|
|
|
|
syncOldTrayTypeLogEntity.setTenantId(TenantNum.HUITONGCODE); |
|
|
|
|
syncOldTrayTypeLogEntity.setCreateTime(new Date()); |
|
|
|
|
syncOldTrayTypeLogEntity.setUpdateTime(new Date()); |
|
|
|
|
syncOldTrayTypeLogEntity.setArgs(com.alibaba.fastjson.JSONObject.toJSONString(trayInfoDTO)); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncStatus(0); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncNum(0); |
|
|
|
|
syncOldTrayTypeLogService.save(syncOldTrayTypeLogEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|