|
|
@ -19,14 +19,11 @@ import com.logpm.warehouse.dto.ZeroOrderVO; |
|
|
|
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity; |
|
|
|
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity; |
|
|
|
import com.logpm.warehouse.entity.WarehouseTrayGoodsLogEntity; |
|
|
|
import com.logpm.warehouse.entity.WarehouseTrayGoodsLogEntity; |
|
|
|
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity; |
|
|
|
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity; |
|
|
|
|
|
|
|
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; |
|
|
|
import com.logpm.warehouse.mapper.WarehouseTrayTypeMapper; |
|
|
|
import com.logpm.warehouse.mapper.WarehouseTrayTypeMapper; |
|
|
|
import com.logpm.warehouse.service.IWarehouseTaryAllocationService; |
|
|
|
import com.logpm.warehouse.service.*; |
|
|
|
import com.logpm.warehouse.service.IWarehouseTrayGoodsLogService; |
|
|
|
|
|
|
|
import com.logpm.warehouse.service.IWarehouseTrayGoodsService; |
|
|
|
|
|
|
|
import com.logpm.warehouse.service.IWarehouseTrayTypeService; |
|
|
|
|
|
|
|
import com.logpm.warehouse.vo.*; |
|
|
|
import com.logpm.warehouse.vo.*; |
|
|
|
import com.logpm.warehouse.wrapper.WarehouseTrayTypeWrapper; |
|
|
|
import com.logpm.warehouse.wrapper.WarehouseTrayTypeWrapper; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
import org.springblade.common.constant.apiwarehouse.PalletProductTypeConstant; |
|
|
|
import org.springblade.common.constant.apiwarehouse.PalletProductTypeConstant; |
|
|
@ -35,6 +32,8 @@ import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
@ -45,24 +44,27 @@ import java.util.Objects; |
|
|
|
|
|
|
|
|
|
|
|
@Log4j2 |
|
|
|
@Log4j2 |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
@AllArgsConstructor |
|
|
|
|
|
|
|
public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayTypeMapper, WarehouseTrayTypeEntity> implements IWarehouseTrayTypeService { |
|
|
|
public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayTypeMapper, WarehouseTrayTypeEntity> implements IWarehouseTrayTypeService { |
|
|
|
|
|
|
|
|
|
|
|
private final IWarehouseTrayGoodsService warehouseTrayGoodsService; |
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IWarehouseTrayGoodsService warehouseTrayGoodsService; |
|
|
|
private final IDistributionStockArticleClient distributionStockArticleClient; |
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IDistributionStockArticleClient distributionStockArticleClient; |
|
|
|
private final IDistributionParcelListClient distributionParcelListClient; |
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IDistributionParcelListClient distributionParcelListClient; |
|
|
|
private final IBasicMaterialClient basicMaterialClient; |
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IBasicMaterialClient basicMaterialClient; |
|
|
|
private final IDistributionStockListClient distributionStockListClient; |
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IDistributionStockListClient distributionStockListClient; |
|
|
|
private final IBasicdataTrayClient basicdataTrayClient; |
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IBasicdataTrayClient basicdataTrayClient; |
|
|
|
private final IWarehouseTrayGoodsLogService warehouseTrayGoodsLogService; |
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IWarehouseTrayGoodsLogService warehouseTrayGoodsLogService; |
|
|
|
private final IWarehouseTaryAllocationService warehouseTaryAllocationService; |
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IWarehouseTaryAllocationService warehouseTaryAllocationService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
@Lazy |
|
|
|
|
|
|
|
private IWarehouseUpdownGoodsService warehouseUpdownGoodsService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<WarehouseTrayTypeVO> orderPageList(TrayTypeDTO trayTypeDTO) { |
|
|
|
public IPage<WarehouseTrayTypeVO> orderPageList(TrayTypeDTO trayTypeDTO) { |
|
|
@ -107,6 +109,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT |
|
|
|
log.warn("###############getEntityByTrayCode: 该托盘已被禁用 trayCode={}",trayCode); |
|
|
|
log.warn("###############getEntityByTrayCode: 该托盘已被禁用 trayCode={}",trayCode); |
|
|
|
throw new CustomerException(403,"该托盘已被禁用"); |
|
|
|
throw new CustomerException(403,"该托盘已被禁用"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Long trayId = basicdataTrayEntity.getId(); |
|
|
|
|
|
|
|
Long allocationId = warehouseTaryAllocationService.getAllocationIdByTrayId(trayId); |
|
|
|
|
|
|
|
if(!Objects.isNull(allocationId)){ |
|
|
|
|
|
|
|
log.warn("###############getEntityByTrayCode: 托盘已上架 allocationId={}",allocationId); |
|
|
|
|
|
|
|
throw new CustomerException(403,"托盘已上架"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//根据托盘编码查询是否有托盘编码存在打托数据
|
|
|
|
//根据托盘编码查询是否有托盘编码存在打托数据
|
|
|
|
QueryWrapper<WarehouseTrayTypeEntity> queryTrayTypeWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<WarehouseTrayTypeEntity> queryTrayTypeWrapper = new QueryWrapper<>(); |
|
|
|
queryTrayTypeWrapper.eq("tray_code",trayCode) |
|
|
|
queryTrayTypeWrapper.eq("tray_code",trayCode) |
|
|
@ -167,6 +176,14 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT |
|
|
|
qw.eq("association_value",orderPackageCode); |
|
|
|
qw.eq("association_value",orderPackageCode); |
|
|
|
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getOne(qw); |
|
|
|
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getOne(qw); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<WarehouseUpdownGoodsEntity> updownGoodsEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
updownGoodsEntityQueryWrapper.eq("association_value",orderPackageCode); |
|
|
|
|
|
|
|
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(updownGoodsEntityQueryWrapper); |
|
|
|
|
|
|
|
if(!Objects.isNull(updownGoodsEntity)){ |
|
|
|
|
|
|
|
log.warn("#########orderScanOrderPackageCode: 包件已上架 orderPackageCode={}",orderPackageCode); |
|
|
|
|
|
|
|
return R.fail(403,"包件已上架"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode); |
|
|
|
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode); |
|
|
|
if(Objects.isNull(basicdataTrayEntity)){ |
|
|
|
if(Objects.isNull(basicdataTrayEntity)){ |
|
|
|
log.warn("#########orderScanOrderPackageCode: 未找到托盘信息 trayCode={}",trayCode); |
|
|
|
log.warn("#########orderScanOrderPackageCode: 未找到托盘信息 trayCode={}",trayCode); |
|
|
@ -482,9 +499,46 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<TrayTypeDataListVO> getZeroOrderByWaybillCode(String waybillCode) { |
|
|
|
public List<TrayTypeDataListVO> getZeroOrderByWaybillCode(String waybillCode) { |
|
|
|
|
|
|
|
// List<TrayTypeDataListVO> zeroOrderByWaybillCode = baseMapper.getZeroOrderByWaybillCode(waybillCode);
|
|
|
|
|
|
|
|
// for (TrayTypeDataListVO trayTypeDataListVO:zeroOrderByWaybillCode){
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// String ordeCode = trayTypeDataListVO.getDataCode();
|
|
|
|
|
|
|
|
// Long orderId = trayTypeDataListVO.getDataId();
|
|
|
|
|
|
|
|
// //计算零担订单可用数量
|
|
|
|
|
|
|
|
// countZeroAvailableNum(orderId);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
return baseMapper.getZeroOrderByWaybillCode(waybillCode); |
|
|
|
return baseMapper.getZeroOrderByWaybillCode(waybillCode); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 计算零担订单的可用数量 |
|
|
|
|
|
|
|
* @param orderId |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private Integer countZeroAvailableNum(Long orderId) { |
|
|
|
|
|
|
|
//计算已打托数量
|
|
|
|
|
|
|
|
QueryWrapper<WarehouseTrayGoodsEntity> trayGoodsEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
trayGoodsEntityQueryWrapper.eq("association_id",orderId) |
|
|
|
|
|
|
|
.eq("association_type",1); |
|
|
|
|
|
|
|
List<WarehouseTrayGoodsEntity> trayGoodsList = warehouseTrayGoodsService.list(trayGoodsEntityQueryWrapper); |
|
|
|
|
|
|
|
QueryWrapper<WarehouseUpdownGoodsEntity> updownGoodsEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
trayGoodsEntityQueryWrapper.eq("association_id",orderId) |
|
|
|
|
|
|
|
.eq("association_type",1); |
|
|
|
|
|
|
|
List<WarehouseUpdownGoodsEntity> updownGoodsList = warehouseUpdownGoodsService.list(updownGoodsEntityQueryWrapper); |
|
|
|
|
|
|
|
for (WarehouseTrayGoodsEntity trayGoodsEntity:trayGoodsList){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (WarehouseUpdownGoodsEntity updownGoodsEntity:updownGoodsList){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R enterZeroOrderByTrayCode(String trayType,String trayCode, List<ZeroOrderVO> zeroList) { |
|
|
|
public R enterZeroOrderByTrayCode(String trayType,String trayCode, List<ZeroOrderVO> zeroList) { |
|
|
@ -1225,12 +1279,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT |
|
|
|
//删除绑定关系
|
|
|
|
//删除绑定关系
|
|
|
|
warehouseTrayGoodsService.deleteByIdList(trayGoodsList); |
|
|
|
warehouseTrayGoodsService.deleteByIdList(trayGoodsList); |
|
|
|
//删除打托方式
|
|
|
|
//删除打托方式
|
|
|
|
trayTypeEntity.setTotalNum(0); |
|
|
|
removeById(trayTypeEntity.getId()); |
|
|
|
trayTypeEntity.setOrderTotalNum(0); |
|
|
|
// trayTypeEntity.setTotalNum(0);
|
|
|
|
trayTypeEntity.setStockNum(0); |
|
|
|
// trayTypeEntity.setOrderTotalNum(0);
|
|
|
|
trayTypeEntity.setStockTotalNum(0); |
|
|
|
// trayTypeEntity.setStockNum(0);
|
|
|
|
trayTypeEntity.setIsDeleted(1); |
|
|
|
// trayTypeEntity.setStockTotalNum(0);
|
|
|
|
updateById(trayTypeEntity); |
|
|
|
// trayTypeEntity.setIsDeleted(1);
|
|
|
|
|
|
|
|
// updateById(trayTypeEntity);
|
|
|
|
//空置托盘
|
|
|
|
//空置托盘
|
|
|
|
basicdataTrayClient.updateTrayStatus(trayId,1); |
|
|
|
basicdataTrayClient.updateTrayStatus(trayId,1); |
|
|
|
} |
|
|
|
} |
|
|
|