diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml index 13be83268..305e7657e 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml @@ -345,7 +345,7 @@ update logpm_warehouse_tray_type - set num = #{num} + set total_num = #{num} where id = #{aLong} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/OldTrayTypeListener.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/OldTrayTypeListener.java index 455f8cf4c..0e4c891d5 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/OldTrayTypeListener.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/OldTrayTypeListener.java @@ -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); } }