|
|
|
@ -15,7 +15,9 @@ import com.logpm.oldproject.entity.TrayEntity;
|
|
|
|
|
import com.logpm.oldproject.feign.ITrayClient; |
|
|
|
|
import com.logpm.oldproject.feign.ITrayScanClient; |
|
|
|
|
import com.logpm.oldproject.feign.ITrayScanDesClient; |
|
|
|
|
import com.logpm.warehouse.dto.*; |
|
|
|
|
import com.logpm.warehouse.dto.TrayInfoDTO; |
|
|
|
|
import com.logpm.warehouse.dto.UpShelfPackageDTO; |
|
|
|
|
import com.logpm.warehouse.dto.ZeroOrderVO; |
|
|
|
|
import com.logpm.warehouse.entity.*; |
|
|
|
|
import com.logpm.warehouse.service.*; |
|
|
|
|
import com.logpm.warehouse.vo.QuestDetailVO; |
|
|
|
@ -24,11 +26,11 @@ import lombok.extern.log4j.Log4j2;
|
|
|
|
|
import org.springblade.common.annotations.LogpmAsync; |
|
|
|
|
import org.springblade.common.constant.TenantNum; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
|
import org.springblade.core.redis.cache.BladeRedis; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
@ -78,6 +80,8 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
|
|
|
|
|
private ISyncOldTrayTypeLogService syncOldTrayTypeLogService; |
|
|
|
|
@Autowired |
|
|
|
|
private ISyncTaskErrorLogService syncTaskErrorLogService; |
|
|
|
|
@Autowired |
|
|
|
|
private BladeRedis bladeRedis; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@LogpmAsync("asyncExecutor") |
|
|
|
@ -694,93 +698,127 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
|
|
|
|
|
Integer oldWarehouseId = trayInfoDTO.getWarehouseId(); |
|
|
|
|
Integer type = trayInfoDTO.getType(); |
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouseByOldId(oldWarehouseId); |
|
|
|
|
if(Objects.isNull(basicdataWarehouseEntity)){ |
|
|
|
|
log.warn("####################sendTrayInfoByOrderPackageCode: 仓库信息为空 basicdataWarehouseEntity={}",basicdataWarehouseEntity); |
|
|
|
|
throw new CustomerException(405,"仓库信息为空"); |
|
|
|
|
Boolean exists = bladeRedis.exists("trayType:T" + trayId + ":" + orderPackageCode); |
|
|
|
|
if(Boolean.TRUE.equals(exists)){ |
|
|
|
|
log.warn("#############sendTrayInfoByOrderPackageCode: orderPackageCode={} 正在打托",orderPackageCode); |
|
|
|
|
throw new CustomerException(405,"正在打托"); |
|
|
|
|
} |
|
|
|
|
Long newWarehouseId = basicdataWarehouseEntity.getId(); |
|
|
|
|
|
|
|
|
|
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode("T" + trayId); |
|
|
|
|
if(Objects.isNull(basicdataTrayEntity)){ |
|
|
|
|
log.info("############sendTrayInfoByOrderPackageCode: 托盘信息不存在 同步"); |
|
|
|
|
//如果托盘不存在就去同步该托盘
|
|
|
|
|
TrayEntity trayEntity = trayClient.getTrayById(trayId); |
|
|
|
|
basicdataTrayEntity = new BasicdataTrayEntity(); |
|
|
|
|
basicdataTrayEntity.setTenantId("627683"); |
|
|
|
|
basicdataTrayEntity.setCreateUser(1714696768639311873L); |
|
|
|
|
basicdataTrayEntity.setUpdateUser(1714696768639311873L); |
|
|
|
|
basicdataTrayEntity.setCreateDept(1649331096241836033L); |
|
|
|
|
basicdataTrayEntity.setPalletName(trayEntity.getTrayNo()); |
|
|
|
|
basicdataTrayEntity.setPalletCode("T"+trayEntity.getId()); |
|
|
|
|
basicdataTrayEntity.setWarehouseId(newWarehouseId); |
|
|
|
|
basicdataTrayEntity.setTrayStatus(trayEntity.getStatus()+""); |
|
|
|
|
basicdataTrayEntity.setType(1); |
|
|
|
|
basicdataTrayEntity.setOldId(trayId); |
|
|
|
|
// basicdataTrayEntity.setNowWarehouseId(nowNewWarehouseId);
|
|
|
|
|
Long aLong = basicdataTrayClient.addTray(basicdataTrayEntity); |
|
|
|
|
basicdataTrayEntity.setId(aLong); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TrayScanDesEntity trayScanDesEntity = trayScanDesClient.findScanTypeId(trayId, orderPackageCode, oldWarehouseId);
|
|
|
|
|
// if(Objects.isNull(trayScanDesEntity)){
|
|
|
|
|
// log.warn("####################sendTrayInfoByOrderPackageCode: 没有打托数据 trayId={}",trayId);
|
|
|
|
|
// throw new CustomerException(405,"没有打托数据");
|
|
|
|
|
// }
|
|
|
|
|
// Integer trayScanId = trayScanDesEntity.getTrayScanId();
|
|
|
|
|
// TrayScanEntity trayScanEntity = trayScanClient.getEntityByTrayScanId(trayScanId);
|
|
|
|
|
// if(Objects.isNull(trayScanEntity)){
|
|
|
|
|
// log.warn("####################sendTrayInfoByOrderPackageCode: 没有打托方式数据 trayScanId={}",trayScanId);
|
|
|
|
|
// throw new CustomerException(405,"没有打托方式数据");
|
|
|
|
|
// }
|
|
|
|
|
// Integer trayType = trayScanEntity.getType();
|
|
|
|
|
|
|
|
|
|
String newTrayType = "100"; |
|
|
|
|
if(1==type){ |
|
|
|
|
newTrayType = "60"; |
|
|
|
|
}else if(2==type){ |
|
|
|
|
newTrayType = "30"; |
|
|
|
|
}else if(3==type){ |
|
|
|
|
newTrayType = "50"; |
|
|
|
|
}else if(4==type){ |
|
|
|
|
newTrayType = "100"; |
|
|
|
|
}else if(5==type){ |
|
|
|
|
newTrayType = "10"; |
|
|
|
|
}else if(6==type){ |
|
|
|
|
newTrayType = "20"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断托盘是否有上架
|
|
|
|
|
Long allocationId = taryAllocationService.getAllocationIdByTrayId(basicdataTrayEntity.getId()); |
|
|
|
|
if(Objects.isNull(allocationId)){ |
|
|
|
|
//没有上架就直接打托
|
|
|
|
|
R response = trayTypeService.orderScanOrderPackageCodeSync(newTrayType,"T"+trayId,orderPackageCode,newWarehouseId); |
|
|
|
|
int code = response.getCode(); |
|
|
|
|
String msg = response.getMsg(); |
|
|
|
|
if(code == 4001){ |
|
|
|
|
log.info("####################sendTrayInfoByOrderPackageCode: 包件已在当前托盘打托 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
}else if(code == 4002){ |
|
|
|
|
log.info("####################sendTrayInfoByOrderPackageCode: 包件已在其他托盘打托 orderPackageCode={} ",orderPackageCode); |
|
|
|
|
QueryWrapper<WarehouseTrayGoodsEntity> trayGoodsEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
trayGoodsEntityQueryWrapper.eq("association_value",orderPackageCode); |
|
|
|
|
WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getOne(trayGoodsEntityQueryWrapper); |
|
|
|
|
if(Objects.isNull(trayGoodsEntity)){ |
|
|
|
|
log.warn("####################sendTrayInfoByOrderPackageCode: 包件未打托 orderPackageCode={}",orderPackageCode); |
|
|
|
|
}else{ |
|
|
|
|
String oldTrayCode = trayGoodsEntity.getTrayCode(); |
|
|
|
|
Long trayGoodsId = trayGoodsEntity.getId(); |
|
|
|
|
Long wid = trayGoodsEntity.getWarehouseId(); |
|
|
|
|
BasicdataTrayEntity oldTrayEntity = basicdataTrayClient.getTrayByTrayCode(oldTrayCode); |
|
|
|
|
Long oldTrayId = oldTrayEntity.getId(); |
|
|
|
|
//判断托盘是否有上架
|
|
|
|
|
Long oldAllocationId = taryAllocationService.getAllocationIdByTrayId(oldTrayId); |
|
|
|
|
if (Objects.isNull(oldAllocationId)){ |
|
|
|
|
//没有上架
|
|
|
|
|
//直接解绑托盘
|
|
|
|
|
trayGoodsService.deleteByTrayGoodsId(trayGoodsId,wid); |
|
|
|
|
try{ |
|
|
|
|
bladeRedis.set("trayType:T" + trayId + ":" + orderPackageCode, "1"); |
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouseByOldId(oldWarehouseId); |
|
|
|
|
if(Objects.isNull(basicdataWarehouseEntity)){ |
|
|
|
|
log.warn("####################sendTrayInfoByOrderPackageCode: 仓库信息为空 basicdataWarehouseEntity={}",basicdataWarehouseEntity); |
|
|
|
|
throw new CustomerException(405,"仓库信息为空"); |
|
|
|
|
} |
|
|
|
|
Long newWarehouseId = basicdataWarehouseEntity.getId(); |
|
|
|
|
|
|
|
|
|
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode("T" + trayId); |
|
|
|
|
if(Objects.isNull(basicdataTrayEntity)){ |
|
|
|
|
log.info("############sendTrayInfoByOrderPackageCode: 托盘信息不存在 同步"); |
|
|
|
|
//如果托盘不存在就去同步该托盘
|
|
|
|
|
TrayEntity trayEntity = trayClient.getTrayById(trayId); |
|
|
|
|
basicdataTrayEntity = new BasicdataTrayEntity(); |
|
|
|
|
basicdataTrayEntity.setTenantId("627683"); |
|
|
|
|
basicdataTrayEntity.setCreateUser(1714696768639311873L); |
|
|
|
|
basicdataTrayEntity.setUpdateUser(1714696768639311873L); |
|
|
|
|
basicdataTrayEntity.setCreateDept(1649331096241836033L); |
|
|
|
|
basicdataTrayEntity.setPalletName(trayEntity.getTrayNo()); |
|
|
|
|
basicdataTrayEntity.setPalletCode("T"+trayEntity.getId()); |
|
|
|
|
basicdataTrayEntity.setWarehouseId(newWarehouseId); |
|
|
|
|
basicdataTrayEntity.setTrayStatus(trayEntity.getStatus()+""); |
|
|
|
|
basicdataTrayEntity.setType(1); |
|
|
|
|
basicdataTrayEntity.setOldId(trayId); |
|
|
|
|
Long aLong = basicdataTrayClient.addTray(basicdataTrayEntity); |
|
|
|
|
basicdataTrayEntity.setId(aLong); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String newTrayType = "100"; |
|
|
|
|
if(1==type){ |
|
|
|
|
newTrayType = "60"; |
|
|
|
|
}else if(2==type){ |
|
|
|
|
newTrayType = "30"; |
|
|
|
|
}else if(3==type){ |
|
|
|
|
newTrayType = "50"; |
|
|
|
|
}else if(4==type){ |
|
|
|
|
newTrayType = "100"; |
|
|
|
|
}else if(5==type){ |
|
|
|
|
newTrayType = "10"; |
|
|
|
|
}else if(6==type){ |
|
|
|
|
newTrayType = "20"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断托盘是否有上架
|
|
|
|
|
Long allocationId = taryAllocationService.getAllocationIdByTrayId(basicdataTrayEntity.getId()); |
|
|
|
|
if(Objects.isNull(allocationId)){ |
|
|
|
|
//没有上架就直接打托
|
|
|
|
|
R response = trayTypeService.orderScanOrderPackageCodeSync(newTrayType,"T"+trayId,orderPackageCode,newWarehouseId); |
|
|
|
|
int code = response.getCode(); |
|
|
|
|
String msg = response.getMsg(); |
|
|
|
|
if(code == 4001){ |
|
|
|
|
log.info("####################sendTrayInfoByOrderPackageCode: 包件已在当前托盘打托 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
}else if(code == 4002){ |
|
|
|
|
log.info("####################sendTrayInfoByOrderPackageCode: 包件已在其他托盘打托 orderPackageCode={} ",orderPackageCode); |
|
|
|
|
QueryWrapper<WarehouseTrayGoodsEntity> trayGoodsEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
trayGoodsEntityQueryWrapper.eq("association_value",orderPackageCode); |
|
|
|
|
WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getOne(trayGoodsEntityQueryWrapper); |
|
|
|
|
if(Objects.isNull(trayGoodsEntity)){ |
|
|
|
|
log.warn("####################sendTrayInfoByOrderPackageCode: 包件未打托 orderPackageCode={}",orderPackageCode); |
|
|
|
|
}else{ |
|
|
|
|
//有上架
|
|
|
|
|
//下架
|
|
|
|
|
String oldTrayCode = trayGoodsEntity.getTrayCode(); |
|
|
|
|
Long trayGoodsId = trayGoodsEntity.getId(); |
|
|
|
|
Long wid = trayGoodsEntity.getWarehouseId(); |
|
|
|
|
BasicdataTrayEntity oldTrayEntity = basicdataTrayClient.getTrayByTrayCode(oldTrayCode); |
|
|
|
|
Long oldTrayId = oldTrayEntity.getId(); |
|
|
|
|
//判断托盘是否有上架
|
|
|
|
|
Long oldAllocationId = taryAllocationService.getAllocationIdByTrayId(oldTrayId); |
|
|
|
|
if (Objects.isNull(oldAllocationId)){ |
|
|
|
|
//没有上架
|
|
|
|
|
//直接解绑托盘
|
|
|
|
|
trayGoodsService.deleteByTrayGoodsId(trayGoodsId,wid); |
|
|
|
|
}else{ |
|
|
|
|
//有上架
|
|
|
|
|
//下架
|
|
|
|
|
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>(); |
|
|
|
|
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO(); |
|
|
|
|
upShelfPackageDTO.setOrderPackageCode(orderPackageCode); |
|
|
|
|
upShelfPackageList.add(upShelfPackageDTO); |
|
|
|
|
|
|
|
|
|
updownTypeService.downPackage(upShelfPackageList,wid,"系统包件下架"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
R r = trayTypeService.orderScanOrderPackageCodeSync(newTrayType,"T"+trayId,orderPackageCode,newWarehouseId); |
|
|
|
|
int code1 = r.getCode(); |
|
|
|
|
if(code1 != 200){ |
|
|
|
|
//存入打托信息
|
|
|
|
|
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(JSONObject.toJSONString(trayInfoDTO)); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncStatus(0); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncNum(0); |
|
|
|
|
syncOldTrayTypeLogService.save(syncOldTrayTypeLogEntity); |
|
|
|
|
log.warn("####################orderStatusHandler: 二次打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
}else{ |
|
|
|
|
log.info("####################orderStatusHandler: 二次打托成功 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
} |
|
|
|
|
}else if(code == 4003){ |
|
|
|
|
log.info("####################orderStatusHandler: 包件未打托已上架 orderPackageCode={} ",orderPackageCode); |
|
|
|
|
QueryWrapper<WarehouseUpdownGoodsEntity> updownGoodsEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
updownGoodsEntityQueryWrapper.eq("association_value", orderPackageCode); |
|
|
|
|
WarehouseUpdownGoodsEntity updownGoodsEntity = updownGoodsService.getOne(updownGoodsEntityQueryWrapper); |
|
|
|
|
if(Objects.isNull(updownGoodsEntity)){ |
|
|
|
|
log.warn("####################orderStatusHandler: 包件未上架 orderPackageCode={}",orderPackageCode); |
|
|
|
|
}else{ |
|
|
|
|
Long wid = updownGoodsEntity.getWarehouseId(); |
|
|
|
|
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>(); |
|
|
|
|
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO(); |
|
|
|
|
upShelfPackageDTO.setOrderPackageCode(orderPackageCode); |
|
|
|
@ -788,109 +826,81 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
|
|
|
|
|
|
|
|
|
|
updownTypeService.downPackage(upShelfPackageList,wid,"系统包件下架"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
R r = trayTypeService.orderScanOrderPackageCodeSync(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId); |
|
|
|
|
int code1 = r.getCode(); |
|
|
|
|
if(code1 != 200){ |
|
|
|
|
//存入打托信息
|
|
|
|
|
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(JSONObject.toJSONString(trayInfoDTO)); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncStatus(0); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncNum(0); |
|
|
|
|
syncOldTrayTypeLogService.save(syncOldTrayTypeLogEntity); |
|
|
|
|
log.warn("####################orderStatusHandler: 二次打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
}else{ |
|
|
|
|
log.info("####################orderStatusHandler: 二次打托成功 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
} |
|
|
|
|
}else if(code == 4004){ |
|
|
|
|
log.info("####################orderStatusHandler: 包件打托方式不正确 orderPackageCode={} ",orderPackageCode); |
|
|
|
|
//先去空置托盘再打托
|
|
|
|
|
trayTypeService.trayToNull("T"+trayId,"系统空置托盘"); |
|
|
|
|
|
|
|
|
|
R r = trayTypeService.orderScanOrderPackageCodeSync(newTrayType,"T"+trayId,orderPackageCode,newWarehouseId); |
|
|
|
|
int code1 = r.getCode(); |
|
|
|
|
if(code1 != 200){ |
|
|
|
|
//存入打托信息
|
|
|
|
|
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(JSONObject.toJSONString(trayInfoDTO)); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncStatus(0); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncNum(0); |
|
|
|
|
syncOldTrayTypeLogService.save(syncOldTrayTypeLogEntity); |
|
|
|
|
log.warn("####################orderStatusHandler: 二次打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
}else{ |
|
|
|
|
log.info("####################orderStatusHandler: 二次打托成功 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
} |
|
|
|
|
}else if(code == 4003){ |
|
|
|
|
log.info("####################orderStatusHandler: 包件未打托已上架 orderPackageCode={} ",orderPackageCode); |
|
|
|
|
QueryWrapper<WarehouseUpdownGoodsEntity> updownGoodsEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
updownGoodsEntityQueryWrapper.eq("association_value", orderPackageCode); |
|
|
|
|
WarehouseUpdownGoodsEntity updownGoodsEntity = updownGoodsService.getOne(updownGoodsEntityQueryWrapper); |
|
|
|
|
if(Objects.isNull(updownGoodsEntity)){ |
|
|
|
|
log.warn("####################orderStatusHandler: 包件未上架 orderPackageCode={}",orderPackageCode); |
|
|
|
|
R r = trayTypeService.orderScanOrderPackageCodeSync(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId); |
|
|
|
|
int code1 = r.getCode(); |
|
|
|
|
if(code1 != 200){ |
|
|
|
|
//存入打托信息
|
|
|
|
|
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(JSONObject.toJSONString(trayInfoDTO)); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncStatus(0); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncNum(0); |
|
|
|
|
syncOldTrayTypeLogService.save(syncOldTrayTypeLogEntity); |
|
|
|
|
log.warn("####################orderStatusHandler: 二次打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
Long wid = updownGoodsEntity.getWarehouseId(); |
|
|
|
|
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>(); |
|
|
|
|
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO(); |
|
|
|
|
upShelfPackageDTO.setOrderPackageCode(orderPackageCode); |
|
|
|
|
upShelfPackageList.add(upShelfPackageDTO); |
|
|
|
|
|
|
|
|
|
updownTypeService.downPackage(upShelfPackageList,wid,"系统包件下架"); |
|
|
|
|
} |
|
|
|
|
R r = trayTypeService.orderScanOrderPackageCodeSync(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId); |
|
|
|
|
int code1 = r.getCode(); |
|
|
|
|
if(code1 != 200){ |
|
|
|
|
//存入打托信息
|
|
|
|
|
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(JSONObject.toJSONString(trayInfoDTO)); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncStatus(0); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncNum(0); |
|
|
|
|
syncOldTrayTypeLogService.save(syncOldTrayTypeLogEntity); |
|
|
|
|
log.warn("####################orderStatusHandler: 二次打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
}else{ |
|
|
|
|
log.info("####################orderStatusHandler: 二次打托成功 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
} |
|
|
|
|
}else if(code == 4004){ |
|
|
|
|
log.info("####################orderStatusHandler: 包件打托方式不正确 orderPackageCode={} ",orderPackageCode); |
|
|
|
|
//先去空置托盘再打托
|
|
|
|
|
trayTypeService.trayToNull("T"+trayId,"系统空置托盘"); |
|
|
|
|
|
|
|
|
|
R r = trayTypeService.orderScanOrderPackageCodeSync(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId); |
|
|
|
|
int code1 = r.getCode(); |
|
|
|
|
if(code1 != 200){ |
|
|
|
|
//存入打托信息
|
|
|
|
|
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(JSONObject.toJSONString(trayInfoDTO)); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncStatus(0); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncNum(0); |
|
|
|
|
syncOldTrayTypeLogService.save(syncOldTrayTypeLogEntity); |
|
|
|
|
log.warn("####################orderStatusHandler: 二次打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
log.warn("######################orderStatusHandler: 打托失败 msg={} code={}",msg,code); |
|
|
|
|
log.warn("######################orderStatusHandler: 打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
//存入打托信息
|
|
|
|
|
SyncOldTrayTypeLogEntity syncOldTrayTypeLogEntity = new SyncOldTrayTypeLogEntity(); |
|
|
|
|
syncOldTrayTypeLogEntity.setCreateUser(1714696768639311873L); |
|
|
|
|
syncOldTrayTypeLogEntity.setUpdateUser(1714696768639311873L); |
|
|
|
|
syncOldTrayTypeLogEntity.setCreateDept(1649331096241836033L); |
|
|
|
|
syncOldTrayTypeLogEntity.setCreateTime(new Date()); |
|
|
|
|
syncOldTrayTypeLogEntity.setUpdateTime(new Date()); |
|
|
|
|
syncOldTrayTypeLogEntity.setTenantId(TenantNum.HUITONGCODE); |
|
|
|
|
syncOldTrayTypeLogEntity.setArgs(JSONObject.toJSONString(trayInfoDTO)); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncStatus(0); |
|
|
|
|
syncOldTrayTypeLogEntity.setSyncNum(0); |
|
|
|
|
syncOldTrayTypeLogService.save(syncOldTrayTypeLogEntity); |
|
|
|
|
log.warn("######################orderStatusHandler: 打托失败 msg={} code={}",msg,code); |
|
|
|
|
log.warn("######################orderStatusHandler: 打托失败 orderPackageCode={} trayCode={}",orderPackageCode,"T"+trayId); |
|
|
|
|
//有上架就上架
|
|
|
|
|
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>(); |
|
|
|
|
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO(); |
|
|
|
|
upShelfPackageDTO.setOrderPackageCode(orderPackageCode); |
|
|
|
|
upShelfPackageList.add(upShelfPackageDTO); |
|
|
|
|
updownTypeService.upShelfPackage(upShelfPackageList,allocationId,newWarehouseId,""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
//有上架就上架
|
|
|
|
|
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>(); |
|
|
|
|
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO(); |
|
|
|
|
upShelfPackageDTO.setOrderPackageCode(orderPackageCode); |
|
|
|
|
upShelfPackageList.add(upShelfPackageDTO); |
|
|
|
|
updownTypeService.upShelfPackage(upShelfPackageList,allocationId,newWarehouseId,""); |
|
|
|
|
bladeRedis.del("trayType:T" + trayId + ":" + orderPackageCode); |
|
|
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.warn("###############sendTrayInfoByOrderPackageCode: 打托失败"); |
|
|
|
|
bladeRedis.del("trayType:T" + trayId + ":" + orderPackageCode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|