Browse Source

1.老系统卸分一体数据逻辑优化

training
zhenghaoyu 1 year ago
parent
commit
b2f1b7e1e7
  1. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java
  2. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java

@ -40,10 +40,10 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService {
//先判断是否两个数据已经执行完成
String ruku = bladeRedis.get("arrive-"+unitNo);
String tray = bladeRedis.get("tray-"+unitNo);
trayId = bladeRedis.get("tray-"+unitNo);
if(StringUtil.isBlank(ruku) || StringUtil.isBlank(tray)){
log.error("###############syncTrayTypeData: 数据不完整,暂不打托 ruku={} tray={}",ruku,tray);
if(StringUtil.isBlank(ruku) || Objects.isNull(trayId)){
log.error("###############syncTrayTypeData: 数据不完整,暂不打托 ruku={} trayId={}",ruku,trayId);
throw new CustomerException(403,"数据不完整,暂不打托");
}
@ -60,6 +60,7 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService {
//判断托盘是否已经存在
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode("T" + trayId);
if(Objects.isNull(basicdataTrayEntity)){
log.info("############syncTrayTypeData: 托盘信息不存在");
//如果托盘不存在就去同步该托盘
TrayEntity trayEntity = trayClient.getTrayById(trayId);
basicdataTrayEntity = new BasicdataTrayEntity();

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java

@ -73,14 +73,14 @@ public class DealWithDataHandler {
if ("4".equals(status)) {
panFactoryDataService.handleDataToPlatform(unitNo, operationTime);
}else if("2".equals(status)){
bladeRedis.setEx("tray-"+unitNo,unitNo,30L);
bladeRedis.setEx("tray-"+unitNo,trayId,30L);
}
//同步打托数据
factoryCommonService.syncTrayTypeData(unitNo,trayId,currentWarehouseId);
} catch (Exception e) {
e.printStackTrace();
log.error("#############处理异常",e);
}
}
}

Loading…
Cancel
Save