Browse Source

1.打托逻辑优化

master
zhenghaoyu 8 months ago
parent
commit
0a750ba432
  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 logpm_warehouse_tray_type
set num = #{num}
set total_num = #{num}
where id = #{aLong}
</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.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);
}
}

Loading…
Cancel
Save