|
|
|
@ -5,15 +5,16 @@ import com.logpm.report.dto.IndexDTO;
|
|
|
|
|
import com.logpm.report.mapper.WarehouseIndexMapper; |
|
|
|
|
import com.logpm.report.service.IWarehouseIndexService; |
|
|
|
|
import com.logpm.report.vo.*; |
|
|
|
|
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.constant.DistributionTypeConstant; |
|
|
|
|
import org.springblade.common.utils.CommonUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.Calendar; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
|
|
@Service |
|
|
|
@ -26,7 +27,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
public IndexOpenOrderDataVO openOrderData(IndexDTO indexDTO) { |
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
IndexOpenOrderDataVO indexOpenOrderDataVO = new IndexOpenOrderDataVO(); |
|
|
|
|
if(warehouseIds.isEmpty()){ |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexOpenOrderDataVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -76,7 +77,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
public IndexOpenOrderIncomeVO openOrderIncome(IndexDTO indexDTO) { |
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
IndexOpenOrderIncomeVO indexOpenOrderIncomeVO = new IndexOpenOrderIncomeVO(); |
|
|
|
|
if(warehouseIds.isEmpty()){ |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexOpenOrderIncomeVO; |
|
|
|
|
} |
|
|
|
|
//总收入
|
|
|
|
@ -109,7 +110,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
public IndexHandOrderDataVO handOrderData(IndexDTO indexDTO) { |
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
IndexHandOrderDataVO indexHandOrderDataVO = new IndexHandOrderDataVO(); |
|
|
|
|
if(warehouseIds.isEmpty()){ |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexHandOrderDataVO; |
|
|
|
|
} |
|
|
|
|
//当前在库的数据 订制品 零担
|
|
|
|
@ -129,7 +130,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
public IndexAllocationDataVO allocationData(IndexDTO indexDTO) { |
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
IndexAllocationDataVO indexAllocationDataVO = new IndexAllocationDataVO(); |
|
|
|
|
if(warehouseIds.isEmpty()){ |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexAllocationDataVO; |
|
|
|
|
} |
|
|
|
|
//当前在库的数据 订制品 零担
|
|
|
|
@ -149,7 +150,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
indexAllocationDataVO.setUseNum(useAllocationNum); |
|
|
|
|
indexAllocationDataVO.setNullNum(totalAllocationNum - useAllocationNum); |
|
|
|
|
indexAllocationDataVO.setUpshelfNum(upshelfNum); |
|
|
|
|
indexAllocationDataVO.setNoUpshelfNum(totalNum-upshelfNum); |
|
|
|
|
indexAllocationDataVO.setNoUpshelfNum(totalNum - upshelfNum); |
|
|
|
|
|
|
|
|
|
return indexAllocationDataVO; |
|
|
|
|
} |
|
|
|
@ -158,7 +159,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
public IndexTrunklineHandOrderDataVO trunklineHandOrderData(IndexDTO indexDTO) { |
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = new IndexTrunklineHandOrderDataVO(); |
|
|
|
|
if(warehouseIds.isEmpty()){ |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexTrunklineHandOrderDataVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -187,7 +188,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
public IndexTrunklineCarsDataVO trunklineCarsData(IndexDTO indexDTO) { |
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
IndexTrunklineCarsDataVO indexTrunklineCarsDataVO = new IndexTrunklineCarsDataVO(); |
|
|
|
|
if(warehouseIds.isEmpty()){ |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexTrunklineCarsDataVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -200,7 +201,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
public IndexUnloadAbnormalDataVO unloadAbnormalData(IndexDTO indexDTO) { |
|
|
|
|
List<Long> warehouseIds = indexDTO.getWarehouseIds(); |
|
|
|
|
IndexUnloadAbnormalDataVO indexUnloadAbnormalDataVO = new IndexUnloadAbnormalDataVO(); |
|
|
|
|
if(warehouseIds.isEmpty()){ |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
return indexUnloadAbnormalDataVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -214,7 +215,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
indexUnloadAbnormalDataVO.setNoDealDayNum(sendDayNum - dealDayNum); |
|
|
|
|
indexUnloadAbnormalDataVO.setUnloadDayNum(unloadDayNum); |
|
|
|
|
BigDecimal dayRate = BigDecimal.ZERO; |
|
|
|
|
if(!unloadDayNum.equals(0)){ |
|
|
|
|
if (!unloadDayNum.equals(0)) { |
|
|
|
|
dayRate = new BigDecimal(sendDayNum).divide(new BigDecimal(unloadDayNum), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)); |
|
|
|
|
} |
|
|
|
|
indexUnloadAbnormalDataVO.setAbnormalDayRate(dayRate); |
|
|
|
@ -229,11 +230,66 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
|
|
|
|
|
indexUnloadAbnormalDataVO.setNoDealMonthNum(sendMonthNum - dealMonthNum); |
|
|
|
|
indexUnloadAbnormalDataVO.setUnloadMonthNum(unloadMonthNum); |
|
|
|
|
BigDecimal monthRate = BigDecimal.ZERO; |
|
|
|
|
if(!unloadMonthNum.equals(0)){ |
|
|
|
|
monthRate = new BigDecimal(sendMonthNum).divide(new BigDecimal(unloadMonthNum),4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)); |
|
|
|
|
if (!unloadMonthNum.equals(0)) { |
|
|
|
|
monthRate = new BigDecimal(sendMonthNum).divide(new BigDecimal(unloadMonthNum), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)); |
|
|
|
|
} |
|
|
|
|
indexUnloadAbnormalDataVO.setAbnormalMonthRate(monthRate); |
|
|
|
|
|
|
|
|
|
return indexUnloadAbnormalDataVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<IndexDeliveryDataVO> deliveryData(IndexDTO indexDTO) { |
|
|
|
|
//查询商市配的信息
|
|
|
|
|
List<IndexDeliveryDataVO> indexDeliveryDataVOList = new ArrayList<>(); |
|
|
|
|
List<IndexDeliveryDataVO> indexDeliveryDataVOS = warehouseIndexMapper.findDeliveryTotal(indexDTO); |
|
|
|
|
if (!indexDeliveryDataVOS.isEmpty()) { |
|
|
|
|
for (IndexDeliveryDataVO indexDeliveryDataVO : indexDeliveryDataVOS) { |
|
|
|
|
//总包件数量
|
|
|
|
|
Integer deLiveryTotalNum = warehouseIndexMapper.findDeLiveryTotalNum(indexDTO, indexDeliveryDataVO.getType()); |
|
|
|
|
indexDeliveryDataVO.setTotalDeliveryNum(deLiveryTotalNum); |
|
|
|
|
//查询总重量
|
|
|
|
|
BigDecimal totalWeight = warehouseIndexMapper.findDeliveryTotalWeight(indexDTO,indexDeliveryDataVO.getType()); |
|
|
|
|
indexDeliveryDataVO.setTotalWeight(totalWeight); |
|
|
|
|
//查询总包件体积
|
|
|
|
|
BigDecimal totalVolume = warehouseIndexMapper.findDeliveryTotalVolume(indexDTO,indexDeliveryDataVO.getType()); |
|
|
|
|
indexDeliveryDataVO.setTotalVolume(totalVolume); |
|
|
|
|
//查询在途件数
|
|
|
|
|
Integer totalRoadNum = warehouseIndexMapper.findDeLiveryTotalRoadNum(indexDTO, indexDeliveryDataVO.getType()); |
|
|
|
|
indexDeliveryDataVO.setTotalRoadNum(totalRoadNum); |
|
|
|
|
} |
|
|
|
|
indexDeliveryDataVOList.addAll(indexDeliveryDataVOS); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询自提信息
|
|
|
|
|
IndexDeliveryDataVO indexDeliveryDataVO = warehouseIndexMapper.findBillLadingTotal(indexDTO); |
|
|
|
|
if (Func.isNotEmpty(indexDeliveryDataVO)) { |
|
|
|
|
//查询自提总件数
|
|
|
|
|
Integer billLadingTotalNum = warehouseIndexMapper.findBillLadingTotalNum(indexDTO); |
|
|
|
|
indexDeliveryDataVO.setTotalDeliveryNum(billLadingTotalNum); |
|
|
|
|
//查询总重量
|
|
|
|
|
BigDecimal billLadingTotalWeight = warehouseIndexMapper.findBillLadingTotalWeight(indexDTO); |
|
|
|
|
indexDeliveryDataVO.setTotalWeight(billLadingTotalWeight); |
|
|
|
|
//查询总包件体积
|
|
|
|
|
BigDecimal billLadingTotalVolume = warehouseIndexMapper.findBillLadingTotalVolume(indexDTO); |
|
|
|
|
indexDeliveryDataVO.setTotalVolume(billLadingTotalVolume); |
|
|
|
|
indexDeliveryDataVOList.add(indexDeliveryDataVO); |
|
|
|
|
} |
|
|
|
|
//查询外协信息
|
|
|
|
|
IndexDeliveryDataVO indexTripartiteDeliveryDataVO = warehouseIndexMapper.findTripartiteTotal(indexDTO); |
|
|
|
|
if (Func.isNotEmpty(indexTripartiteDeliveryDataVO)) { |
|
|
|
|
//查询自提总件数
|
|
|
|
|
Integer tripartiteTotalNum = warehouseIndexMapper.findTripartiteTotalNum(indexDTO); |
|
|
|
|
indexDeliveryDataVO.setTotalDeliveryNum(tripartiteTotalNum); |
|
|
|
|
//查询总重量
|
|
|
|
|
BigDecimal tripartiteTotalWeight = warehouseIndexMapper.findTripartiteTotalWeight(indexDTO); |
|
|
|
|
indexDeliveryDataVO.setTotalWeight(tripartiteTotalWeight); |
|
|
|
|
//查询总包件体积
|
|
|
|
|
BigDecimal tripartiteTotalVolume = warehouseIndexMapper.findTripartiteTotalVolume(indexDTO); |
|
|
|
|
indexDeliveryDataVO.setTotalVolume(tripartiteTotalVolume); |
|
|
|
|
indexDeliveryDataVOList.add(indexDeliveryDataVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return indexDeliveryDataVOList; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|