|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
package com.glxp.api.service.thrsys.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
@ -79,13 +78,13 @@ public class ThrDeptServiceImpl extends ServiceImpl<ThrDeptDao, ThrDeptEntity> i
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean insertInvWarehouse(ThrDeptEntity thrDeptEntity) {
|
|
|
|
|
return thrDeptDao.insertThrInvWarehouse(thrDeptEntity);
|
|
|
|
|
public boolean insertThrDept(ThrDeptEntity thrDeptEntity) {
|
|
|
|
|
return thrDeptDao.insertThrDept(thrDeptEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean insertInvWarehouses(List<ThrDeptEntity> thrDeptEntities) {
|
|
|
|
|
return thrDeptDao.insertInvWarehouses(thrDeptEntities);
|
|
|
|
|
public boolean insertThrDeptList(List<ThrDeptEntity> thrDeptEntities) {
|
|
|
|
|
return thrDeptDao.insertThrDeptList(thrDeptEntities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -137,6 +136,7 @@ public class ThrDeptServiceImpl extends ServiceImpl<ThrDeptDao, ThrDeptEntity> i
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
List<UdiwmsWarehouseDetail> responseList = baseResponse.getData().getList();
|
|
|
|
|
List<ThrDeptEntity> list = new ArrayList<>();
|
|
|
|
|
List<ThrInvWarehouseEntity> warehouseList = new ArrayList<>();
|
|
|
|
|
for (UdiwmsWarehouseDetail response : responseList) {
|
|
|
|
|
ThrDeptEntity thrDeptEntity = new ThrDeptEntity();
|
|
|
|
|
thrDeptEntity.setPid(0);
|
|
|
|
@ -146,27 +146,24 @@ public class ThrDeptServiceImpl extends ServiceImpl<ThrDeptDao, ThrDeptEntity> i
|
|
|
|
|
thrDeptEntity.setAdvanceType(false); //默认是仓库
|
|
|
|
|
thrDeptEntity.setStatus(1);//默认启用
|
|
|
|
|
thrDeptEntity.setUpdateTime(new Date());
|
|
|
|
|
thrDeptEntity.setId(IdUtil.getSnowflake(6, 1).nextId());
|
|
|
|
|
list.add(thrDeptEntity);
|
|
|
|
|
|
|
|
|
|
List<UdiwmsWarehouseDetail.SubWarehouse> subWarehouseList = response.getSubWarehouses();
|
|
|
|
|
if (CollUtil.isNotEmpty(subWarehouseList)) {
|
|
|
|
|
for (UdiwmsWarehouseDetail.SubWarehouse subWarehouse : subWarehouseList) {
|
|
|
|
|
ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity();
|
|
|
|
|
thrInvWarehouseEntity.setCode(subWarehouse.getCode());
|
|
|
|
|
thrInvWarehouseEntity.setName(subWarehouse.getName());
|
|
|
|
|
thrInvWarehouseEntity.setRemark(subWarehouse.getRemark());
|
|
|
|
|
thrInvWarehouseEntity.setThirdSysFk(thirdSysFk);
|
|
|
|
|
thrInvWarehouseEntity.setParentId(response.getCode());
|
|
|
|
|
thrInvWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + "");
|
|
|
|
|
thrInvWarehouseEntity.setUpdateTime(new Date());
|
|
|
|
|
thrInvWarehouseDao.insertThrInvWarehouse(thrInvWarehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity();
|
|
|
|
|
thrInvWarehouseEntity.setCode(response.getCode());
|
|
|
|
|
thrInvWarehouseEntity.setName(response.getName());
|
|
|
|
|
thrInvWarehouseEntity.setRemark(response.getRemark());
|
|
|
|
|
thrInvWarehouseEntity.setThirdSysFk(thirdSysFk);
|
|
|
|
|
thrInvWarehouseEntity.setParentId(response.getCode());
|
|
|
|
|
thrInvWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + "");
|
|
|
|
|
thrInvWarehouseEntity.setUpdateTime(new Date());
|
|
|
|
|
warehouseList.add(thrInvWarehouseEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//插入数据
|
|
|
|
|
thrDeptDao.insertInvWarehouses(list);
|
|
|
|
|
thrDeptDao.insertThrDeptList(list);
|
|
|
|
|
thrInvWarehouseDao.insertThrInvWarehouses(warehouseList);
|
|
|
|
|
if (list.size() >= limit) {
|
|
|
|
|
page++;
|
|
|
|
|
} else {
|
|
|
|
|