Browse Source

Merge branch 'dev' into pre-production

master
zhenghaoyu 8 months ago
parent
commit
7c3766b219
  1. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml
  2. 17
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/OldTrayTypeListener.java

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml

@ -345,7 +345,7 @@
<update id="updateTrayTypeNum" > <update id="updateTrayTypeNum" >
update logpm_warehouse_tray_type update logpm_warehouse_tray_type
set num = #{num} set total_num = #{num}
where id = #{aLong} where id = #{aLong}
</update> </update>

17
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.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.logpm.warehouse.dto.TrayInfoDTO; 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 com.logpm.warehouse.service.IWarehouseUpdownTypeService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.TenantNum;
import org.springframework.amqp.core.ExchangeTypes; import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange; import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue; 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.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Objects; import java.util.Objects;
@Slf4j @Slf4j
@ -23,6 +27,7 @@ import java.util.Objects;
public class OldTrayTypeListener { public class OldTrayTypeListener {
private final IWarehouseUpdownTypeService warehouseUpdownTypeService; private final IWarehouseUpdownTypeService warehouseUpdownTypeService;
private final ISyncOldTrayTypeLogService syncOldTrayTypeLogService;
@RabbitListener(bindings = @QueueBinding( @RabbitListener(bindings = @QueueBinding(
value = @Queue(name = RabbitConstant.OLD_TRAY_TYPE_QUEUE), value = @Queue(name = RabbitConstant.OLD_TRAY_TYPE_QUEUE),
@ -55,6 +60,18 @@ public class OldTrayTypeListener {
}catch (Exception e){ }catch (Exception e){
if(!Objects.isNull(oldTrayTypeId)){ if(!Objects.isNull(oldTrayTypeId)){
warehouseUpdownTypeService.updateOldTrayTypeInfoNum(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);
} }
} }

Loading…
Cancel
Save