|
|
|
@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
|
|
|
|
import com.logpm.basic.entity.BasicPrintTemplateEntity; |
|
|
|
|
import com.logpm.basic.feign.IBasicPrintTemplateClient; |
|
|
|
@ -137,7 +138,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
|
|
|
|
|
List<BasicdataNodeVO> basicdataWarehouseVOList = goodsAreaMapper.selectFirstNode(collect); |
|
|
|
|
//遍历仓库节点查询货区节点信息
|
|
|
|
|
for (BasicdataNodeVO basicdataNodeVO : basicdataWarehouseVOList) { |
|
|
|
|
List<BasicdataNodeVO> goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue()); |
|
|
|
|
List<BasicdataNodeVO> goodeAreaNodes = goodsAllocationMapper.selectSecondNode(basicdataNodeVO.getValue(), null); |
|
|
|
|
//判断仓库下是否存在货区节点,存在则添加,不存在则设置没有下级节点
|
|
|
|
|
if (!Func.isEmpty(goodeAreaNodes)) { |
|
|
|
|
basicdataNodeVO.setChildren(goodeAreaNodes); |
|
|
|
@ -163,7 +164,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
|
|
|
|
|
public boolean insertGoodsAllocation(BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) { |
|
|
|
|
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); |
|
|
|
|
if (Func.isEmpty(basicdataGoodsAllocationDto)) { |
|
|
|
|
log.error("参数不合法:{}" , basicdataGoodsAllocationDto); |
|
|
|
|
log.error("参数不合法:{}", basicdataGoodsAllocationDto); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
BeanUtils.copyProperties(basicdataGoodsAllocationDto, basicdataGoodsAllocationEntity); |
|
|
|
@ -184,7 +185,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
|
|
|
|
|
String code = tenantCodeClient.shelfCode(user.getTenantId(), "5"); |
|
|
|
|
String allocationCode = code + "-" + basicdataGoodsAllocationEntity.getColumnNum() + "-" + basicdataGoodsAllocationEntity.getLayerNum() + "-" + basicdataGoodsAllocationEntity.getGoodsAllocationName(); |
|
|
|
|
basicdataGoodsAllocationEntity.setQrCode(allocationCode); |
|
|
|
|
return SqlHelper.retBool(goodsAllocationMapper.insert(basicdataGoodsAllocationEntity)); |
|
|
|
|
return SqlHelper.retBool(goodsAllocationMapper.insert(basicdataGoodsAllocationEntity)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -196,8 +197,8 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
|
|
|
|
|
List<Long> collect = myWatchWarehouse.stream() |
|
|
|
|
.map(BasicdataWarehouseEntity::getId) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
basicdataGoodsAllocation.put("warehouseList",collect); |
|
|
|
|
return goodsAllocationMapper.selectGoodsAllocationList(page, basicdataGoodsAllocation); |
|
|
|
|
basicdataGoodsAllocation.put("warehouseList", collect); |
|
|
|
|
return goodsAllocationMapper.selectGoodsAllocationList(page, basicdataGoodsAllocation); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -205,7 +206,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
|
|
|
|
|
public boolean updateGoodsAllocation(BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) { |
|
|
|
|
boolean result = false; |
|
|
|
|
if (Func.isEmpty(basicdataGoodsAllocationDto)) { |
|
|
|
|
log.error("参数不合法:{}" , basicdataGoodsAllocationDto); |
|
|
|
|
log.error("参数不合法:{}", basicdataGoodsAllocationDto); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); |
|
|
|
@ -265,22 +266,80 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
|
|
|
|
|
boolean update = this.update(new UpdateWrapper<BasicdataGoodsAllocationEntity>().lambda() |
|
|
|
|
.set(BasicdataGoodsAllocationEntity::getEnableStatus, 1) |
|
|
|
|
.in(BasicdataGoodsAllocationEntity::getId, Func.toLongList(ids))); |
|
|
|
|
return update?R.success("成功"):R.fail("失败"); |
|
|
|
|
return update ? R.success("成功") : R.fail("失败"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R disableGoodsAllocation(String ids) { |
|
|
|
|
log.info("传入参数>>>>>>>>>>{}",ids); |
|
|
|
|
log.info("传入参数>>>>>>>>>>{}", ids); |
|
|
|
|
//查询该货位有无货物
|
|
|
|
|
// List<Long> longs = Func.toLongList(ids);
|
|
|
|
|
Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(ids); |
|
|
|
|
if (integer>0){ |
|
|
|
|
if (integer > 0) { |
|
|
|
|
return R.fail("有货物,无法禁用"); |
|
|
|
|
} |
|
|
|
|
boolean update = this.update(new UpdateWrapper<BasicdataGoodsAllocationEntity>().lambda() |
|
|
|
|
.set(BasicdataGoodsAllocationEntity::getEnableStatus, 2) |
|
|
|
|
.in(BasicdataGoodsAllocationEntity::getId, Func.toLongList(ids))); |
|
|
|
|
return update?R.success("成功"):R.fail("失败"); |
|
|
|
|
return update ? R.success("成功") : R.fail("失败"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<BasicdataGoodsAllocationEntity> findListStockUpAllocationByName(String fragment) { |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)) { |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
return this.list(Wrappers.<BasicdataGoodsAllocationEntity>query().lambda() |
|
|
|
|
.like(BasicdataGoodsAllocationEntity::getGoodsAllocationName, fragment) |
|
|
|
|
.eq(BasicdataGoodsAllocationEntity::getWarehouseId, myCurrentWarehouse.getId()) |
|
|
|
|
.eq(BasicdataGoodsAllocationEntity::getEnableStatus, "1") |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public BasicdataGoodsAllocationEntity scanStockUpAllocationByCode(Long stockUpAreaCode) { |
|
|
|
|
return baseMapper.getAllocationIntegrityEntity(stockUpAreaCode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<BasicdataNodeVO> getStockUpAllocation() { |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseService.getMyCurrentWarehouse(); |
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<BasicdataNodeVO> nodeS = new ArrayList<>(); |
|
|
|
|
List<BasicdataNodeVO> goodeAreaNodes = goodsAllocationMapper.selectSecondNode(myCurrentWarehouse.getId().toString(), "1"); |
|
|
|
|
if (Func.isNotEmpty(goodeAreaNodes)) { |
|
|
|
|
for (BasicdataNodeVO goodeAreaNode : goodeAreaNodes) { |
|
|
|
|
List<BasicdataNodeVO> goodsShelfNode = goodsAllocationMapper.selectThirdNode(myCurrentWarehouse.getId().toString(), goodeAreaNode.getValue()); |
|
|
|
|
if (Func.isNotEmpty(goodsShelfNode)) { |
|
|
|
|
goodeAreaNode.setChildren(goodsShelfNode); |
|
|
|
|
goodeAreaNode.setLeaf(false); |
|
|
|
|
for (BasicdataNodeVO basicdataNodeVO : goodsShelfNode) { |
|
|
|
|
List<BasicdataNodeVO> goodsAllocationNode = goodsAllocationMapper.selectFourthNode(myCurrentWarehouse.getId().toString(), goodeAreaNode.getValue(), basicdataNodeVO.getValue()); |
|
|
|
|
if (Func.isNotEmpty(goodsAllocationNode)) { |
|
|
|
|
basicdataNodeVO.setChildren(goodsAllocationNode); |
|
|
|
|
basicdataNodeVO.setLeaf(false); |
|
|
|
|
}else { |
|
|
|
|
basicdataNodeVO.setLeaf(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
goodeAreaNode.setLeaf(true); |
|
|
|
|
} |
|
|
|
|
nodeS.add(goodeAreaNode); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return nodeS; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String getAllocationIntegrityName(Long goodsStockupAllocationId) { |
|
|
|
|
return baseMapper.getAllocationIntegrityName(goodsStockupAllocationId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|