bug修复

pro
wj 2 years ago
parent bec086ca4c
commit 64fcfe9c22

@ -137,6 +137,7 @@ public class ThrDeptServiceImpl extends ServiceImpl<ThrDeptDao, ThrDeptEntity> i
if (baseResponse.getCode() == 20000) { if (baseResponse.getCode() == 20000) {
List<UdiwmsWarehouseDetail> responseList = baseResponse.getData().getList(); List<UdiwmsWarehouseDetail> responseList = baseResponse.getData().getList();
List<ThrDeptEntity> list = new ArrayList<>(); List<ThrDeptEntity> list = new ArrayList<>();
List<ThrInvWarehouseEntity> warehouseList = new ArrayList<>();
for (UdiwmsWarehouseDetail response : responseList) { for (UdiwmsWarehouseDetail response : responseList) {
ThrDeptEntity thrDeptEntity = new ThrDeptEntity(); ThrDeptEntity thrDeptEntity = new ThrDeptEntity();
thrDeptEntity.setPid(0); thrDeptEntity.setPid(0);
@ -148,25 +149,21 @@ public class ThrDeptServiceImpl extends ServiceImpl<ThrDeptDao, ThrDeptEntity> i
thrDeptEntity.setUpdateTime(new Date()); thrDeptEntity.setUpdateTime(new Date());
list.add(thrDeptEntity); list.add(thrDeptEntity);
List<UdiwmsWarehouseDetail.SubWarehouse> subWarehouseList = response.getSubWarehouses(); ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity();
if (CollUtil.isNotEmpty(subWarehouseList)) { thrInvWarehouseEntity.setCode(response.getCode());
for (UdiwmsWarehouseDetail.SubWarehouse subWarehouse : subWarehouseList) { thrInvWarehouseEntity.setName(response.getName());
ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity(); thrInvWarehouseEntity.setRemark(response.getRemark());
thrInvWarehouseEntity.setCode(subWarehouse.getCode()); thrInvWarehouseEntity.setThirdSysFk(thirdSysFk);
thrInvWarehouseEntity.setName(subWarehouse.getName()); thrInvWarehouseEntity.setParentId(response.getCode());
thrInvWarehouseEntity.setRemark(subWarehouse.getRemark()); thrInvWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + "");
thrInvWarehouseEntity.setThirdSysFk(thirdSysFk); thrInvWarehouseEntity.setUpdateTime(new Date());
thrInvWarehouseEntity.setParentId(response.getCode()); warehouseList.add(thrInvWarehouseEntity);
thrInvWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + "");
thrInvWarehouseEntity.setUpdateTime(new Date());
thrInvWarehouseDao.insertThrInvWarehouse(thrInvWarehouseEntity);
}
}
} }
//插入数据 //插入数据
thrDeptDao.insertInvWarehouses(list); thrDeptDao.insertInvWarehouses(list);
thrInvWarehouseDao.insertThrInvWarehouses(warehouseList);
if (list.size() >= limit) { if (list.size() >= limit) {
page++; page++;
} else { } else {

Loading…
Cancel
Save