Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dist.1.3.0
zhaoqiaobo 10 months ago
parent
commit
1ed8f2795e
  1. 28
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  2. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java
  3. 99
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java
  4. 258
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml
  5. 9
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java
  6. 84
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java
  7. 19
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexDeliveryDataVO.java

28
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -7449,7 +7449,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
user.setNickName(distributionLoadscanEntity.getDriverName()); user.setNickName(distributionLoadscanEntity.getDriverName());
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user); Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机进行异常装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationList.get(0).getReservationCode(); content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机进行异常装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationList.get(0).getReservationCode();
//进行还未进行审核异常的签收状态标识
} }
} else { } else {
log.error("商家端异常签收存在装车非本车次计划"); log.error("商家端异常签收存在装车非本车次计划");
@ -7501,6 +7501,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadscanEntity.setSigningUser(distributionDeliverySelfEntity.getDriverName()); distributionLoadscanEntity.setSigningUser(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setSigningUserId(distributionDeliverySelfEntity.getDeliveryId()); distributionLoadscanEntity.setSigningUserId(distributionDeliverySelfEntity.getDeliveryId());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue()); distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
distributionLoadscanEntity.setIsAbnormalSigning(2);
distributionLoadscanEntity.setAbnormalNote("异常签收");
distributionLoadscanService.save(distributionLoadscanEntity); distributionLoadscanService.save(distributionLoadscanEntity);
//进行签收数量的修改 //进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(deliveryListEntity.getId()); Integer i = distributionDeliveryListMapper.updateloadingTimeById(deliveryListEntity.getId());
@ -7511,7 +7513,29 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//更新签收人 //更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user); Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机未进行装车,由商家端进行异常签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationList.get(0).getReservationCode(); content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机未进行装车,由商家端进行异常签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationList.get(0).getReservationCode();
//进行异常数据的创建
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity();
distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue());
distributionLoadscanAbnormalEntity.setStockArticleId(packageObj.getStockArticleId());
distributionLoadscanAbnormalEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
distributionLoadscanAbnormalEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanAbnormalEntity.setDriverId(Long.parseLong(distributionDeliverySelfEntity.getDriverId()));
distributionLoadscanAbnormalEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
distributionLoadscanAbnormalEntity.setDeliveryListId(deliveryListEntity.getId());
distributionLoadscanAbnormalEntity.setReservationId(reservationList.get(0).getId());
distributionLoadscanAbnormalEntity.setDeliveryType(deliveryListEntity.getType());
distributionLoadscanAbnormalEntity.setScanUser(user.getNickName());
distributionLoadscanAbnormalEntity.setScanTime(new Date());
distributionLoadscanAbnormalEntity.setLoadingQuantity(packageObj.getQuantity());
distributionLoadscanAbnormalEntity.setPackageCode(packageObj.getOrderPackageCode());
distributionLoadscanAbnormalEntity.setPackageId(packageObj.getId());
distributionLoadscanAbnormalService.save(distributionLoadscanAbnormalEntity);
//进行异常审核的标识
distributionSignforService.update(Wrappers.<DistributionSignforEntity>update().lambda()
.eq(DistributionSignforEntity::getReservationId,reservationList.get(0).getId())
.eq(DistributionSignforEntity::getDeliveryId,deliveryListEntity.getId())
.set(DistributionSignforEntity::getIsHaveAbnormalPackage,2)
);
} }
} else { } else {
log.error("一个车次内存在两个同样客户"); log.error("一个车次内存在两个同样客户");

15
blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java

@ -6,6 +6,7 @@ import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.report.dto.IndexDTO; import com.logpm.report.dto.IndexDTO;
import com.logpm.report.service.IWarehouseIndexService; import com.logpm.report.service.IWarehouseIndexService;
import com.logpm.report.vo.*; import com.logpm.report.vo.*;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors;
@Log4j2 @Log4j2
@RestController @RestController
@ -282,18 +284,19 @@ public class WarehouseIndexController {
//当前登录人选择的仓库 //当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){ if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse(); List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWarehouseList();
myWatchWarehouse.forEach(warehouseEntity -> { if (myWatchWarehouse.isEmpty()) {
warehouseIds.add(warehouseEntity.getId()); warehouseIds = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
}); }
}else{ }else{
warehouseIds.add(myCurrentWarehouse.getId()); warehouseIds.add(myCurrentWarehouse.getId());
} }
indexDTO.setWarehouseIds(warehouseIds); indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表 //查询订制品打托列表
IndexUnloadAbnormalDataVO indexUnloadAbnormalDataVO = warehouseIndexService.unloadAbnormalData(indexDTO); List<IndexDeliveryDataVO> indexDeliveryDataVO = warehouseIndexService.deliveryData(indexDTO);
return R.data(indexUnloadAbnormalDataVO); return R.data(indexDeliveryDataVO);
}catch (CustomerException e){ }catch (CustomerException e){
log.warn(e.message); log.warn(e.message);
return R.fail(e.code,e.message); return R.fail(e.code,e.message);

99
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java

@ -4,10 +4,13 @@ import com.alibaba.fastjson.JSONObject;
import com.logpm.report.dto.IndexDTO; import com.logpm.report.dto.IndexDTO;
import com.logpm.report.vo.IndexHandOrderDataVO; import com.logpm.report.vo.IndexHandOrderDataVO;
import com.logpm.report.vo.IndexTrunklineCarsDataVO; import com.logpm.report.vo.IndexTrunklineCarsDataVO;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface WarehouseIndexMapper { public interface WarehouseIndexMapper {
@ -39,4 +42,100 @@ public interface WarehouseIndexMapper {
JSONObject findAbnormalData(@Param("param") IndexDTO indexDTO); JSONObject findAbnormalData(@Param("param") IndexDTO indexDTO);
Integer findUnloadNum(@Param("param") IndexDTO indexDTO); Integer findUnloadNum(@Param("param") IndexDTO indexDTO);
/**
* 查询商市配的当前配送总数据
* @param indexDTO
* @return
*/
List<IndexDeliveryDataVO> findDeliveryTotal(@Param("param")IndexDTO indexDTO);
/**
* 查询自提当前配送总信息
* @param indexDTO
* @return
*/
IndexDeliveryDataVO findBillLadingTotal(@Param("param")IndexDTO indexDTO);
/**
* 查询配送信息
* @param type
* @param indexDTO
* @return
*/
Integer findDeLiveryTotalNum(@Param("param") IndexDTO indexDTO,@Param("type")String type);
/**
* 查询当前配送总重量
* @param indexDTO
* @param type
* @return
*/
BigDecimal findDeliveryTotalWeight(@Param("param")IndexDTO indexDTO, @Param("type")String type);
/**
* 查询当前配送总体积
* @param indexDTO
* @param type
* @return
*/
BigDecimal findDeliveryTotalVolume(@Param("param")IndexDTO indexDTO, @Param("type") String type);
/**
* 查询当前配送总重量
* @param indexDTO
* @param type
* @return
*/
Integer findDeLiveryTotalRoadNum(@Param("param")IndexDTO indexDTO,@Param("type") String type);
/**
* 查询自提总件数
* @return
*/
Integer findBillLadingTotalNum(@Param("param")IndexDTO indexDTO);
/**
* 查询自提包件总重量
* @param indexDTO
* @return
*/
BigDecimal findBillLadingTotalWeight(@Param("param")IndexDTO indexDTO);
/**
* 查询自提包件总体积
* @param indexDTO
* @return
*/
BigDecimal findBillLadingTotalVolume(@Param("param")IndexDTO indexDTO);
/**
* 查询三方配送信息
* @param indexDTO
* @return
*/
IndexDeliveryDataVO findTripartiteTotal(@Param("param")IndexDTO indexDTO);
/**
* 查询三方总件数
* @param indexDTO
* @return
*/
Integer findTripartiteTotalNum(@Param("param")IndexDTO indexDTO);
/**
* 查询三方总重量
* @param indexDTO
* @return
*/
BigDecimal findTripartiteTotalWeight(@Param("param")IndexDTO indexDTO);
/**
* 查询三方配送总体积
* @param indexDTO
* @return
*/
BigDecimal findTripartiteTotalVolume(@Param("param")IndexDTO indexDTO);
} }

258
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml

@ -126,7 +126,8 @@
IFNULL(sum(ldpl.volume),0) handleVolume IFNULL(sum(ldpl.volume),0) handleVolume
from logpm_distribution_parcel_list ldpl from logpm_distribution_parcel_list ldpl
left join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id left join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id
left join logpm_warehouse_waybill lww on ldpl.waybill_number = lww.waybill_no and lww.departure_warehouse_id = ldpl.warehouse_id left join logpm_warehouse_waybill lww on ldpl.waybill_number = lww.waybill_no and lww.departure_warehouse_id =
ldpl.warehouse_id
where 1=1 where 1=1
and ldsa.is_zero = 0 and ldsa.is_zero = 0
and ldpl.order_package_status = '20' and ldpl.order_package_status = '20'
@ -142,7 +143,8 @@
0 handleWeight, 0 handleWeight,
0 handleVolume 0 handleVolume
from logpm_distribution_stock_article ldsa from logpm_distribution_stock_article ldsa
left join logpm_warehouse_waybill lww on lww.departure_warehouse_id = ldsa.warehouse_id and lww.waybill_no = ldsa.order_code left join logpm_warehouse_waybill lww on lww.departure_warehouse_id = ldsa.warehouse_id and lww.waybill_no =
ldsa.order_code
where 1=1 where 1=1
and ldsa.hand_quantity > 0 and ldsa.hand_quantity > 0
and ldsa.is_zero = 1 and ldsa.is_zero = 1
@ -200,5 +202,257 @@
#{item} #{item}
</foreach> </foreach>
</select> </select>
<select id="findDeliveryTotal" resultType="com.logpm.report.vo.indexCount.IndexDeliveryDataVO">
SELECT
type AS type,
count( 1 ) AS totalNum
FROM
logpm_distribution_delivery_list
<where>
is_deleted = 0 AND type IS NOT NULL
<if test="param.warehouseIds != null">
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
GROUP BY
type
</select>
<select id="findBillLadingTotal" resultType="com.logpm.report.vo.indexCount.IndexDeliveryDataVO">
SELECT
3 AS type,
count( 1 )
FROM
logpm_distrilbution_bill_lading
<where>
is_deleted = 0
<if test="param.warehouseIds != null">
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findDeLiveryTotalNum" resultType="java.lang.Integer">
SELECT
sum( reservation_num + reservation_stock_list_num ) AS num
FROM
logpm_distribution_reservation
<where>
reservation_status != 40
AND is_deleted = 0
AND delivery_type = #{type}
<if test="param.warehouseIds != null">
AND warehouse IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findDeliveryTotalWeight" resultType="java.math.BigDecimal">
SELECT
IFNULL(sum( ldpl.weight ),0) AS num
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldr.id = ldrp.reservation_id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldrp.parce_list_id
<where>
ldr.reservation_status != 40
AND ldr.is_deleted = 0
AND ldrp.packet_bar_status != 2
AND ldr.delivery_type = #{type}
<if test="param.warehouseIds != null">
AND ldr.warehouse IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findDeliveryTotalVolume" resultType="java.math.BigDecimal">
SELECT
IFNULL(sum( ldpl.volume ),0) AS num
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldr.id = ldrp.reservation_id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldrp.parce_list_id
<where>
ldr.reservation_status != 40
AND ldr.is_deleted = 0
AND ldrp.packet_bar_status != 2
AND ldr.delivery_type = #{type}
<if test="param.warehouseIds != null">
AND ldr.warehouse IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findDeLiveryTotalRoadNum" resultType="java.lang.Integer">
SELECT
IFNULL(sum( ldl.package_nub ),0) AS num
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldr.id = ldrp.reservation_id
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldl.package_id = ldrp.parce_list_id
<where>
ldr.reservation_status != 40
AND ldr.is_deleted = 0
AND ldrp.packet_bar_status != 2
AND ldl.signfor_state = 1
AND ldl.is_deleted = 0
AND ldr.delivery_type = #{type}
<if test="param.warehouseIds != null">
AND ldr.warehouse IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findBillLadingTotalNum" resultType="java.lang.Integer">
SELECT
count(1) AS num
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl ON ldbp.bill_lading_id = ldbl.id
<where>
ldbp.packet_bar_status != 2
AND ldbp.is_deleted = 0
AND ldbl.is_deleted = 0
<if test="param.warehouseIds != null">
AND ldbl.warehouse IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findBillLadingTotalWeight" resultType="java.math.BigDecimal">
SELECT
IFNULL(sum(ldpl.weight),0) AS weight
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl ON ldbp.bill_lading_id = ldbl.id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldbp.parce_list_id
<where>
ldbp.packet_bar_status != 2
AND ldbp.is_deleted = 0
AND ldbl.is_deleted = 0
<if test="param.warehouseIds != null">
AND ldbl.warehouse IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findBillLadingTotalVolume" resultType="java.math.BigDecimal">
SELECT
IFNULL(sum(ldpl.volume),0) AS volume
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl ON ldbp.bill_lading_id = ldbl.id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldbp.parce_list_id
<where>
ldbp.packet_bar_status != 2
AND ldbp.is_deleted = 0
AND ldbl.is_deleted = 0
<if test="param.warehouseIds != null">
AND ldbl.warehouse IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findTripartiteTotal" resultType="com.logpm.report.vo.indexCount.IndexDeliveryDataVO">
SELECT
4 AS type,
count( 1 ) AS totalNum
FROM
logpm_distribution_delivery_list
<where>
is_deleted = 0 AND type IS NOT NULL
AND kind = 2
<if test="param.warehouseIds != null">
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findTripartiteTotalNum" resultType="java.lang.Integer">
SELECT
count(ldrp.id)
FROM
logpm_distribution_delivery_list AS lddl
LEFT JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldrp.reservation_id = lds.reservation_id
<where>
lddl.is_deleted = 0
AND lddl.type IS NOT NULL
AND lddl.kind = 2
AND ldrp.packet_bar_status != 2
<if test="param.warehouseIds != null">
and lddl.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findTripartiteTotalWeight" resultType="java.math.BigDecimal">
SELECT
IFNULL(sum(ldpl.weight),0) AS weight
FROM
logpm_distribution_delivery_list AS lddl
LEFT JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldrp.reservation_id = lds.reservation_id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id
<where>
lddl.is_deleted = 0
AND lddl.type IS NOT NULL
AND lddl.kind = 2
AND ldrp.packet_bar_status != 2
<if test="param.warehouseIds != null">
and lddl.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findTripartiteTotalVolume" resultType="java.math.BigDecimal">
SELECT
IFNULL(sum(ldpl.volume),0) AS volume
FROM
logpm_distribution_delivery_list AS lddl
LEFT JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldrp.reservation_id = lds.reservation_id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id
<where>
lddl.is_deleted = 0
AND lddl.type IS NOT NULL
AND lddl.kind = 2
AND ldrp.packet_bar_status != 2
<if test="param.warehouseIds != null">
and lddl.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>

9
blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java

@ -2,6 +2,9 @@ package com.logpm.report.service;
import com.logpm.report.dto.IndexDTO; import com.logpm.report.dto.IndexDTO;
import com.logpm.report.vo.*; import com.logpm.report.vo.*;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import java.util.List;
public interface IWarehouseIndexService { public interface IWarehouseIndexService {
IndexOpenOrderDataVO openOrderData(IndexDTO indexDTO); IndexOpenOrderDataVO openOrderData(IndexDTO indexDTO);
@ -18,4 +21,10 @@ public interface IWarehouseIndexService {
IndexUnloadAbnormalDataVO unloadAbnormalData(IndexDTO indexDTO); IndexUnloadAbnormalDataVO unloadAbnormalData(IndexDTO indexDTO);
/**
* 查询首页配送数据
* @param indexDTO
* @return
*/
List<IndexDeliveryDataVO> deliveryData(IndexDTO indexDTO);
} }

84
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

@ -5,15 +5,16 @@ import com.logpm.report.dto.IndexDTO;
import com.logpm.report.mapper.WarehouseIndexMapper; import com.logpm.report.mapper.WarehouseIndexMapper;
import com.logpm.report.service.IWarehouseIndexService; import com.logpm.report.service.IWarehouseIndexService;
import com.logpm.report.vo.*; import com.logpm.report.vo.*;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.utils.CommonUtil; import org.springblade.common.utils.CommonUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Calendar; import java.util.*;
import java.util.Date;
import java.util.List;
@Slf4j @Slf4j
@Service @Service
@ -26,7 +27,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
public IndexOpenOrderDataVO openOrderData(IndexDTO indexDTO) { public IndexOpenOrderDataVO openOrderData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds(); List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexOpenOrderDataVO indexOpenOrderDataVO = new IndexOpenOrderDataVO(); IndexOpenOrderDataVO indexOpenOrderDataVO = new IndexOpenOrderDataVO();
if(warehouseIds.isEmpty()){ if (warehouseIds.isEmpty()) {
return indexOpenOrderDataVO; return indexOpenOrderDataVO;
} }
@ -76,7 +77,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
public IndexOpenOrderIncomeVO openOrderIncome(IndexDTO indexDTO) { public IndexOpenOrderIncomeVO openOrderIncome(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds(); List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexOpenOrderIncomeVO indexOpenOrderIncomeVO = new IndexOpenOrderIncomeVO(); IndexOpenOrderIncomeVO indexOpenOrderIncomeVO = new IndexOpenOrderIncomeVO();
if(warehouseIds.isEmpty()){ if (warehouseIds.isEmpty()) {
return indexOpenOrderIncomeVO; return indexOpenOrderIncomeVO;
} }
//总收入 //总收入
@ -109,7 +110,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
public IndexHandOrderDataVO handOrderData(IndexDTO indexDTO) { public IndexHandOrderDataVO handOrderData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds(); List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexHandOrderDataVO indexHandOrderDataVO = new IndexHandOrderDataVO(); IndexHandOrderDataVO indexHandOrderDataVO = new IndexHandOrderDataVO();
if(warehouseIds.isEmpty()){ if (warehouseIds.isEmpty()) {
return indexHandOrderDataVO; return indexHandOrderDataVO;
} }
//当前在库的数据 订制品 零担 //当前在库的数据 订制品 零担
@ -129,7 +130,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
public IndexAllocationDataVO allocationData(IndexDTO indexDTO) { public IndexAllocationDataVO allocationData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds(); List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexAllocationDataVO indexAllocationDataVO = new IndexAllocationDataVO(); IndexAllocationDataVO indexAllocationDataVO = new IndexAllocationDataVO();
if(warehouseIds.isEmpty()){ if (warehouseIds.isEmpty()) {
return indexAllocationDataVO; return indexAllocationDataVO;
} }
//当前在库的数据 订制品 零担 //当前在库的数据 订制品 零担
@ -149,7 +150,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
indexAllocationDataVO.setUseNum(useAllocationNum); indexAllocationDataVO.setUseNum(useAllocationNum);
indexAllocationDataVO.setNullNum(totalAllocationNum - useAllocationNum); indexAllocationDataVO.setNullNum(totalAllocationNum - useAllocationNum);
indexAllocationDataVO.setUpshelfNum(upshelfNum); indexAllocationDataVO.setUpshelfNum(upshelfNum);
indexAllocationDataVO.setNoUpshelfNum(totalNum-upshelfNum); indexAllocationDataVO.setNoUpshelfNum(totalNum - upshelfNum);
return indexAllocationDataVO; return indexAllocationDataVO;
} }
@ -158,7 +159,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
public IndexTrunklineHandOrderDataVO trunklineHandOrderData(IndexDTO indexDTO) { public IndexTrunklineHandOrderDataVO trunklineHandOrderData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds(); List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = new IndexTrunklineHandOrderDataVO(); IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = new IndexTrunklineHandOrderDataVO();
if(warehouseIds.isEmpty()){ if (warehouseIds.isEmpty()) {
return indexTrunklineHandOrderDataVO; return indexTrunklineHandOrderDataVO;
} }
@ -187,7 +188,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
public IndexTrunklineCarsDataVO trunklineCarsData(IndexDTO indexDTO) { public IndexTrunklineCarsDataVO trunklineCarsData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds(); List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexTrunklineCarsDataVO indexTrunklineCarsDataVO = new IndexTrunklineCarsDataVO(); IndexTrunklineCarsDataVO indexTrunklineCarsDataVO = new IndexTrunklineCarsDataVO();
if(warehouseIds.isEmpty()){ if (warehouseIds.isEmpty()) {
return indexTrunklineCarsDataVO; return indexTrunklineCarsDataVO;
} }
@ -200,7 +201,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
public IndexUnloadAbnormalDataVO unloadAbnormalData(IndexDTO indexDTO) { public IndexUnloadAbnormalDataVO unloadAbnormalData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds(); List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexUnloadAbnormalDataVO indexUnloadAbnormalDataVO = new IndexUnloadAbnormalDataVO(); IndexUnloadAbnormalDataVO indexUnloadAbnormalDataVO = new IndexUnloadAbnormalDataVO();
if(warehouseIds.isEmpty()){ if (warehouseIds.isEmpty()) {
return indexUnloadAbnormalDataVO; return indexUnloadAbnormalDataVO;
} }
@ -214,7 +215,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
indexUnloadAbnormalDataVO.setNoDealDayNum(sendDayNum - dealDayNum); indexUnloadAbnormalDataVO.setNoDealDayNum(sendDayNum - dealDayNum);
indexUnloadAbnormalDataVO.setUnloadDayNum(unloadDayNum); indexUnloadAbnormalDataVO.setUnloadDayNum(unloadDayNum);
BigDecimal dayRate = BigDecimal.ZERO; 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)); dayRate = new BigDecimal(sendDayNum).divide(new BigDecimal(unloadDayNum), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
} }
indexUnloadAbnormalDataVO.setAbnormalDayRate(dayRate); indexUnloadAbnormalDataVO.setAbnormalDayRate(dayRate);
@ -229,11 +230,66 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
indexUnloadAbnormalDataVO.setNoDealMonthNum(sendMonthNum - dealMonthNum); indexUnloadAbnormalDataVO.setNoDealMonthNum(sendMonthNum - dealMonthNum);
indexUnloadAbnormalDataVO.setUnloadMonthNum(unloadMonthNum); indexUnloadAbnormalDataVO.setUnloadMonthNum(unloadMonthNum);
BigDecimal monthRate = BigDecimal.ZERO; BigDecimal monthRate = BigDecimal.ZERO;
if(!unloadMonthNum.equals(0)){ if (!unloadMonthNum.equals(0)) {
monthRate = new BigDecimal(sendMonthNum).divide(new BigDecimal(unloadMonthNum),4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)); monthRate = new BigDecimal(sendMonthNum).divide(new BigDecimal(unloadMonthNum), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
} }
indexUnloadAbnormalDataVO.setAbnormalMonthRate(monthRate); indexUnloadAbnormalDataVO.setAbnormalMonthRate(monthRate);
return indexUnloadAbnormalDataVO; 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;
}
} }

19
blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexDeliveryDataVO.java

@ -0,0 +1,19 @@
package com.logpm.report.vo.indexCount;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class IndexDeliveryDataVO implements Serializable {
private String type ;
private Integer totalNum = 0;
private Integer totalDeliveryNum = 0;
private BigDecimal totalWeight ;
private BigDecimal totalVolume ;
private Integer totalRoadNum = 0;
}
Loading…
Cancel
Save