Browse Source

Merge branch 'dev' into pre-production

pre-production
pref_mail@163.com 3 months ago
parent
commit
ba2d4df9ff
  1. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java
  2. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java
  3. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java
  4. 41
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpTrayDetailVO.java
  5. 26
      blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/ReportConfigOrderAllEntity.java
  6. 27
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java
  7. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  8. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  9. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  10. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  11. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  12. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  13. 204
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  14. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java
  15. 25
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportConfigController.java
  16. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportTimeController.java
  17. 13
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/DestinationWarehouseDTO.java
  18. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportConfigDTO.java
  19. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java
  20. 13
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportConfigOrderAllMapper.java
  21. 31
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportConfigOrderAllMapper.xml
  22. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.java
  23. 302
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  24. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportConfigOrderAllService.java
  25. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportTimeService.java
  26. 51
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportConfigAllTrunklineServiceImpl.java
  27. 85
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportConfigOrderAllServiceImpl.java
  28. 98
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java
  29. 103
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOrderAllTimeVO.java

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java

@ -204,4 +204,7 @@ public class DistributionStockEntity extends TenantEntity {
@ApiModelProperty(value = "取消操作人")
private String cancelUser;
@ApiModelProperty(value = "是否整托备货 0-否 1-是")
private Integer isTray;
}

1
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java

@ -49,6 +49,7 @@ public class DistributionAppStockUpClientVO implements Serializable {
private List<DistributionAppStockUpInventoryDetailVO> stockUpInventoryDetailVOList;
private List<DistributionAppStockUpZeroOrderDetailVO> stockUpZeroOrderDetailVOList;
private List<DistributionAppStockUpPackageDetailVO> deliveryPackageDetailList;
private List<DistributionAppStockUpTrayDetailVO> deliveryTrayList;

10
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java

@ -31,12 +31,10 @@ import java.util.List;
public class DistributionAppStockUpScanDetailVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long Id;
private String orderPackageCode;
private String typeName;
private String goodsName;
private String orderCode;
private String stockupAllocation;
private String trayName;
private String trayCode;
private Integer planNum;
private Integer scanNum;
}

41
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpTrayDetailVO.java

@ -0,0 +1,41 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.vo.app;
import lombok.Data;
import java.io.Serializable;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpTrayDetailVO implements Serializable {
private Long orderId;
private Long packageId;
private String waybillNumber;
private String orderCode;
private String categoryName;
private Integer planNum;
private String scanNum;
}

26
blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/ReportConfigOrderAllEntity.java

@ -0,0 +1,26 @@
package com.logpm.report.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.*;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_reportconfig_order_all")
@ApiModel(value = " ReportConfigOrderAll对象", description = "订单整体时效报表配置")
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ReportConfigOrderAllEntity extends TenantEntity {
private Long departureWarehouseId;
private String departureWarehouseName;
private Long destinationWarehouseId;
private String destinationWarehouseName;
private String brand;
private Integer dayTime;
}

27
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java

@ -1113,9 +1113,6 @@ public class DistributionStockupAppController extends BladeController {
if (Objects.isNull(stockupDTO.getReservationId())){
return R.fail("stockupDTO.getReservationId()参数缺失");
}
if (Objects.isNull(stockupDTO.getOrderId())){
return R.fail("stockupDTO.getOrderId()参数缺失");
}
if (Objects.isNull(stockupDTO.getTypeService())){
return R.fail("stockupDTO.getTypeService()参数缺失");
}
@ -1132,6 +1129,30 @@ public class DistributionStockupAppController extends BladeController {
}
}
@ResponseBody
@PostMapping("/trayDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "客户订单包件列表", notes = "传入stockupDTO")
public R trayDetail(@RequestBody StockupDTO stockupDTO) {
if (Objects.isNull(stockupDTO.getReservationId())){
return R.fail("stockupDTO.getReservationId()参数缺失");
}
if (Objects.isNull(stockupDTO.getTypeService())){
return R.fail("stockupDTO.getTypeService()参数缺失");
}
String typeService = stockupDTO.getTypeService();
Long orderId = stockupDTO.getOrderId();
Long reservationId = stockupDTO.getReservationId();
switch (typeService){
case "1": case "2":
return distributionStockupService.handleDeliveryTrayDetailList(reservationId);
case "3":
return distributionStockupService.handleBillTrayDetailList(reservationId);
default:
return R.fail("未知的typeService");
}
}
@ResponseBody
@PostMapping("/stockupScan")
@ApiOperationSupport(order = 1)

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java

@ -26,9 +26,11 @@ import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionReservationExcel;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionAppStockUpTrayDetailVO;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Map;
@ -438,4 +440,12 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
* @return
*/
Integer getZeroPackagePlanNum(@Param("orderId")Long orderId,@Param("reservationId") Long reservationId,@Param("packageId") Long packageId);
/**
* 查询商市配可备货托盘
* @param reservationId
* @return
*/
List<DistributionAppStockUpTrayDetailVO> deliveryTrayDetailList(@Param("reservationId") Long reservationId);
}

40
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -72,6 +72,46 @@
WHERE
reservation_id = #{reservationId} AND parce_list_id = #{packageId}
</delete>
<select id="deliveryTrayDetailList" resultType="com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO" >
SELECT
t.trayName,
t.trayCode,
t.planNum,
t.scanNum,
SUM( lwtg.num )
FROM
(
SELECT
ldpl.pallet AS trayName,
lwt.pallet_code AS trayCode,
IFNULL( sum( ldpl.quantity ), 0 ) AS planNum,
ldpl.warehouse_id,
IFNULL( SUM( lds.stock_quantity ), 0 ) AS scanNum
FROM
logpm_distribution_reservation_package AS ldrp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldrp.parce_list_id AND ldpl.is_deleted = 0 AND ldpl.is_transfer = 0
LEFT JOIN logpm_warehouse_tray AS lwt ON ldpl.pallet = lwt.pallet_name
AND lwt.warehouse_id = ldpl.warehouse_id
LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldrp.reservation_id
AND lds.type = 1
AND lds.outbound_type != 3
AND lds.cancel_status != 1
WHERE
ldrp.is_deleted = 0 AND ldrp.packet_bar_status != 2
AND ldrp.reservation_id = #{reservationId}
GROUP BY
ldpl.pallet
HAVING
IFNULL( sum( ldpl.quantity ), 0 ) > 0
) AS t
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.tray_code = t.trayCode
AND lwtg.is_deleted = 0
AND lwtg.warehouse_id = t.warehouse_id
GROUP BY
lwtg.tray_id
HAVING
t.planNum >= SUM( lwtg.num )
</select>
<update id="cancelReservationZeroPackage">
UPDATE logpm_distribution_reservation_zero_package AS ldrzp
SET ldrzp.quantity = ( ldrzp.quantity - #{retentionQuantity})

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -2347,7 +2347,7 @@
WHERE
ldrp.is_deleted = 0
AND ldrp.packet_bar_status != 2
AND ldrp.reservation_id = #{reservationId} AND ldrp.stock_article_id = #{orderId}
AND ldrp.reservation_id = #{reservationId}
</select>
<select id="selectBillPackageDetailList"
resultType="com.logpm.distribution.vo.app.DistributionAppStockUpPackageDetailVO">
@ -2368,7 +2368,7 @@
WHERE
ldbp.is_deleted = 0
AND ldbp.packet_bar_status != 2
AND ldbp.bill_lading_id = #{billId} AND ldbp.stock_article_id = #{orderId}
AND ldbp.bill_lading_id = #{billId}
</select>
</mapper>

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java

@ -25,6 +25,7 @@ import com.logpm.distribution.dto.app.BillLadingAppDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionAppStockUpTrayDetailVO;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingDetailVO;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderMainVO;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
@ -214,7 +215,7 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
List<DisStockListDetailEntity> selectInventoryListByBill(@Param("billId")Long billId);
List<DistributionAppStockUpTrayDetailVO> billTrayDetailList(@Param("billId")Long billId);
// Page<DistrilbutionBillLadingAppVO> getInventoryPage(IPage<Object> page, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity);

41
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -1124,6 +1124,47 @@
<select id="selectInventoryListByBill" resultType="com.logpm.distribution.entity.DisStockListDetailEntity">
SELECT * FROM logpm_dis_stock_list_detail WHERE reservation_id = #{billId} AND stock_package_status != 2
</select>
<select id="billTrayDetailList"
resultType="com.logpm.distribution.vo.app.DistributionAppStockUpTrayDetailVO">
SELECT
t.trayName,
t.trayCode,
t.planNum,
t.scanNum,
SUM( lwtg.num )
FROM
(
SELECT
ldpl.pallet AS trayName,
lwt.pallet_code AS trayCode,
IFNULL( sum( ldpl.quantity ), 0 ) AS planNum,
ldpl.warehouse_id,
IFNULL( SUM( lds.stock_quantity ), 0 ) AS scanNum
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldbp.parce_list_id AND ldpl.is_deleted = 0 AND ldpl.is_transfer = 0
LEFT JOIN logpm_warehouse_tray AS lwt ON ldpl.pallet = lwt.pallet_name
AND lwt.warehouse_id = ldpl.warehouse_id
LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldbp.bill_lading_id
AND lds.type = 1
AND lds.outbound_type = 3
AND lds.cancel_status != 1
WHERE
ldbp.is_deleted = 0 AND ldbp.packet_bar_status != 2
AND ldbp.bill_lading_id = #{billId}
GROUP BY
ldpl.pallet
HAVING
IFNULL( sum( ldpl.quantity ), 0 ) > 0
) AS t
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.tray_code = t.trayCode
AND lwtg.is_deleted = 0
AND lwtg.warehouse_id = t.warehouse_id
GROUP BY
lwtg.tray_id
HAVING
t.planNum >= SUM( lwtg.num )
</select>
</mapper>

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java

@ -421,4 +421,18 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
R cancelStock(StockupDTO stockupDTO);
boolean judgeIsPickingStaff(BladeUser user);
/**
* 查询客货下可备货托盘
* @param reservationId
* @return
*/
R handleDeliveryTrayDetailList(Long reservationId);
/**
* 查询自提托盘备货详情列表
* @param reservationId
* @return
*/
R handleBillTrayDetailList(Long reservationId);
}

204
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -105,14 +105,7 @@ import com.logpm.distribution.vo.DistributionStockupTrayVO;
import com.logpm.distribution.vo.DistributionStockupVO;
import com.logpm.distribution.vo.PackageStockupVO;
import com.logpm.distribution.vo.StockListInfoListVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpClientVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpInventoryConfiglVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpInventoryDetailVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpOrderDetailVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpPackageDetailVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpZeroOrderDetailVO;
import com.logpm.distribution.vo.app.*;
import com.logpm.distribution.wrapper.DistributionStockupWrapper;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
@ -1985,8 +1978,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanFail(PdaAudioLingoStatus.baojianbucunzai.getName(), PdaAudioLingoStatus.baojianbucunzai.getName());
}
//查询托盘上面的包件
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(stockupDTO.getTrayId(), stockupDTO.getTrayBarCode());
List<DistributionStockPackageVO> voList = new ArrayList<>();
List<DistributionStockPackageVO> finalList = list;
@ -4651,12 +4642,96 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
case 3:
//配送零担备货
return handleDeliveryZeroStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
case 4:
//配送零担备货
return handleDeliveryTrayStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
default:
log.error(method + "未知scanType");
return Resp.scanFail("未知操作类型", "未知操作类型");
}
}
private R handleDeliveryTrayStockUp(StockupDTO stockupDTO, BasicdataWarehouseEntity myCurrentWarehouse, Long reservationId, DistributionStockupEntity stockupEntity) {
String method = "#######################DistributionStockupServiceImpl.handleDeliveryTrayStockUp";
if (Objects.isNull(stockupDTO.getTrayBarCode())){
log.info(method+"参数缺失>>>>>>>>>>>>>>>>>>stockupDTO.getOrderId()");
return R.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(AuthUtil.getUser())){
log.info(method+"参数缺失>>>>>>>>>>>>>>>>>>AuthUtil.getUser():{}",AuthUtil.getUser());
return R.fail("请重新登陆后操作");
}
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Objects.isNull(reservationEntity)) {
return Resp.scanFail("当前计划信息错误", "当前计划信息错误");
}
BladeUser user = AuthUtil.getUser();
//校验托盘
BasicdataTrayEntity trayByTrayCode = basicdataTrayClient.getTrayByTrayCode(stockupDTO.getTrayBarCode());
if (Objects.isNull(trayByTrayCode)){
log.info(method+"当前托盘信息不存在>>>>>>>>>>>>>>>>>>当前托盘信息不存在:{}",AuthUtil.getUser());
return R.fail("当前托盘信息不存在");
}
//查询当前托盘上货物是否都存在计划内
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(String.valueOf(trayByTrayCode.getId()), trayByTrayCode.getPalletCode());
if (trayIdList.isEmpty()) {
return R.fail("当前托盘无货物信息");
}
boolean isAllPackage = trayIdList.stream().allMatch(a -> "3".equals(a.getAssociationType()));
if (!isAllPackage) {
return R.fail("当前托盘存在其他类型货物");
}
//查询计划包件信息
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
if (distributionParcelListEntities.isEmpty()) {
log.info(method+"查询预约包件计划信息错误>>>>>>>>>>>>>>>>>>>>>>reservationId:{}",reservationId);
return R.fail("查询计划信息错误");
}
List<Long> trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
List<DistributionParcelListEntity> packageData = distributionParcelListEntities.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList());
if (packageData.isEmpty()) {
return R.fail("当前托盘无此客户的货物");
}
warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId());
//生成扫描数据
List<DistributionStockEntity> stockEntityList = generateDeliveryTrayPackageStockEntity(reservationEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId());
if (!stockEntityList.isEmpty()) {
distributionStockService.saveBatch(stockEntityList);
}
return Resp.scanSuccess("操作成功"," ");
}
private List<DistributionStockEntity> generateDeliveryTrayPackageStockEntity(DistributionReservationEntity reservationEntity,
List<DistributionParcelListEntity> packageData,
BasicdataWarehouseEntity warehouse,
BladeUser user,
Long stockUpId) {
List<DistributionStockEntity> list= new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : packageData) {
DistributionStockEntity distributionStockEntity = new DistributionStockEntity();
distributionStockEntity.setWarehouseId(warehouse.getId());
distributionStockEntity.setWarehouseName(warehouse.getName());
distributionStockEntity.setReservationId(reservationEntity.getId());
distributionStockEntity.setReservationCode(reservationEntity.getReservationCode());
distributionStockEntity.setStockQuantity(parcelListEntity.getQuantity());
distributionStockEntity.setOrderSelfNumbering(parcelListEntity.getOrderCode());
distributionStockEntity.setStockArticle(parcelListEntity.getStockArticleId());
distributionStockEntity.setParcelListId(parcelListEntity.getId());
distributionStockEntity.setCoding(parcelListEntity.getOrderPackageCode());
distributionStockEntity.setOutboundType(reservationEntity.getDeliveryType());
distributionStockEntity.setStockupId(stockUpId);
distributionStockEntity.setGoodsName(parcelListEntity.getThirdProduct());
distributionStockEntity.setType(1);
distributionStockEntity.setMaterialId(parcelListEntity.getMaterialId());
distributionStockEntity.setMarketId(reservationEntity.getMallId());
distributionStockEntity.setScanUser(user.getNickName());
distributionStockEntity.setIsTray(Integer.parseInt(IsOrNoConstant.yes.getValue()));
list.add(distributionStockEntity);
}
return list;
}
/**
*
* @param stockupDTO
@ -5172,12 +5247,96 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
case 3:
//零担
return handleBillZeroStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
case 4:
//零担
return handleBilltrayStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
default:
log.error(method + "未知scanType");
return Resp.scanFail("未知操作类型", "未知操作类型");
}
}
private R handleBilltrayStockUp(StockupDTO stockupDTO, BasicdataWarehouseEntity myCurrentWarehouse, Long reservationId, DistributionStockupEntity stockupEntity) {
String method = "#######################DistributionStockupServiceImpl.handleBilltrayStockUp";
if (Objects.isNull(stockupDTO.getTrayBarCode())){
log.info(method+"参数缺失>>>>>>>>>>>>>>>>>>stockupDTO.getTrayBarCode()");
return R.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(AuthUtil.getUser())){
log.info(method+"参数缺失>>>>>>>>>>>>>>>>>>AuthUtil.getUser():{}",AuthUtil.getUser());
return R.fail("请重新登陆后操作");
}
DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingService.getById(reservationId);
if (Objects.isNull(billLadingEntity)) {
return Resp.scanFail("当前计划信息错误", "当前计划信息错误");
}
BladeUser user = AuthUtil.getUser();
//校验托盘
BasicdataTrayEntity trayByTrayCode = basicdataTrayClient.getTrayByTrayCode(stockupDTO.getTrayBarCode());
if (Objects.isNull(trayByTrayCode)){
log.info(method+"当前托盘信息不存在>>>>>>>>>>>>>>>>>>当前托盘信息不存在:{}",AuthUtil.getUser());
return R.fail("当前托盘信息不存在");
}
//查询当前托盘上货物是否都存在计划内
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(String.valueOf(trayByTrayCode.getId()), trayByTrayCode.getPalletCode());
if (trayIdList.isEmpty()) {
return R.fail("当前托盘无货物信息");
}
boolean isAllPackage = trayIdList.stream().allMatch(a -> "3".equals(a.getAssociationType()));
if (!isAllPackage) {
return R.fail("当前托盘存在其他类型货物");
}
//查询计划包件信息
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
if (distributionParcelListEntities.isEmpty()) {
log.info(method+"查询预约包件计划信息错误>>>>>>>>>>>>>>>>>>>>>>reservationId:{}",reservationId);
return R.fail("查询计划信息错误");
}
List<Long> trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
List<DistributionParcelListEntity> packageData = distributionParcelListEntities.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList());
if (packageData.isEmpty()) {
return R.fail("当前托盘无此客户的货物");
}
warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId());
//生成扫描数据
List<DistributionStockEntity> stockEntityList = generateBillTrayPackageStockEntity(billLadingEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId());
if (!stockEntityList.isEmpty()) {
distributionStockService.saveBatch(stockEntityList);
}
return Resp.scanSuccess("操作成功"," ");
}
private List<DistributionStockEntity> generateBillTrayPackageStockEntity(DistrilbutionBillLadingEntity billLadingEntity,
List<DistributionParcelListEntity> packageData,
BasicdataWarehouseEntity myCurrentWarehouse,
BladeUser user,
Long stockupId) {
List<DistributionStockEntity> list= new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : packageData) {
DistributionStockEntity distributionStockEntity = new DistributionStockEntity();
distributionStockEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionStockEntity.setWarehouseName(myCurrentWarehouse.getName());
distributionStockEntity.setReservationId(billLadingEntity.getId());
distributionStockEntity.setReservationCode(billLadingEntity.getPickupBatch());
distributionStockEntity.setStockQuantity(parcelListEntity.getQuantity());
distributionStockEntity.setOrderSelfNumbering(parcelListEntity.getOrderCode());
distributionStockEntity.setStockArticle(parcelListEntity.getStockArticleId());
distributionStockEntity.setParcelListId(parcelListEntity.getId());
distributionStockEntity.setCoding(parcelListEntity.getOrderPackageCode());
distributionStockEntity.setOutboundType("3");
distributionStockEntity.setStockupId(stockupId);
distributionStockEntity.setGoodsName(parcelListEntity.getThirdProduct());
distributionStockEntity.setType(1);
distributionStockEntity.setMaterialId(parcelListEntity.getMaterialId());
distributionStockEntity.setMarketId(billLadingEntity.getClientId());
distributionStockEntity.setScanUser(user.getNickName());
distributionStockEntity.setIsTray(Integer.parseInt(IsOrNoConstant.yes.getValue()));
list.add(distributionStockEntity);
}
return list;
}
private R handleBillZeroStockUp(StockupDTO stockupDTO, BasicdataWarehouseEntity myCurrentWarehouse, Long reservationId, DistributionStockupEntity stockupEntity) {
String method = "#######################DistributionStockupServiceImpl.handleDeliveryZeroStockUp";
if (Objects.isNull(stockupDTO.getOrderId())){
@ -5392,9 +5551,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
List<DistributionAppStockUpZeroOrderDetailVO> stockUpZeroOrderDetailVOList = this.handleStockupDeliveryZeroOrder(reservationEntity);
if (!stockUpZeroOrderDetailVOList.isEmpty()) {
stockUpClientVO.setStockUpZeroOrderDetailVOList(stockUpZeroOrderDetailVOList);
}
//零担
break;
}
default:
log.info("未知orderStatus>>>>>>>>>>>>>>orderStatus:{}",orderStatus);
}
break;
case "3":
@ -5426,6 +5586,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
stockUpClientVO.setStockUpZeroOrderDetailVOList(stockupBillZeroOrder);
}
break;
default:
log.info("未知orderStatus>>>>>>>>>>>>>>orderStatus:{}",orderStatus);
}
break;
default:
@ -5435,6 +5597,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return R.data(stockUpClientVO);
}
@Override
public void maintainDeliveryStockUpEntity(Long stockupId) {
//查询此备货任务所关联的包件信息
@ -5892,6 +6056,17 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return false;
}
@Override
public R handleDeliveryTrayDetailList(Long reservationId) {
return R.data(distributionReservationMapper.deliveryTrayDetailList(reservationId));
}
@Override
public R handleBillTrayDetailList(Long reservationId) {
return R.data(distrilbutionBillLadingMapper.billTrayDetailList(reservationId));
}
/**
* 自提库存品备货
*
@ -6430,6 +6605,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionReservationPackageEntity::getPacketBarCode, packetBarCode)
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (!packageEntityList.isEmpty()) {
return Resp.scanFail("无此备货计划","无此备货计划");
}
if (packageEntityList.size() > 1) {
return Resp.scanFail("当前包件计划重复", "当前包件计划重复");
}

10
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java

@ -106,12 +106,12 @@ public class FactoryCommonController {
map.put("flagType", "OrderStatusLog");
// 将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.ORDER_STATUS_EXCHANGE, RabbitConstant.ORDER_STATUS_ROUTING, map);
map.put("type", "DealWith");
// map.put("type", "DealWith");
// if (StringUtil.equals(sendDataProperties.getSend(), "old")) {
rabbitTemplate.convertAndSend(RabbitConstant.DEAL_WITH_EXCHANGE, RabbitConstant.DEAL_WITH_ROUTING, map, message -> {
message.getMessageProperties().setHeader("x-delay", 2000);
return message;
});
// rabbitTemplate.convertAndSend(RabbitConstant.DEAL_WITH_EXCHANGE, RabbitConstant.DEAL_WITH_ROUTING, map, message -> {
// message.getMessageProperties().setHeader("x-delay", 2000);
// return message;
// });
// }
// R r = factoryDataService.handleStatusData(orderStatusDTO);

25
blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportConfigController.java

@ -24,6 +24,7 @@ public class ReportConfigController extends BladeController {
private final IReportConfigDespatchService reportConfigDespatchService;
private final IReportConfigTransferService reportConfigTransferService;
private final IReportConfigAllTrunklineService reportConfigAllTrunklineService;
private final IReportConfigOrderAllService reportConfigOrderAllService;
//-------------------------开单及时率
@ -139,4 +140,28 @@ public class ReportConfigController extends BladeController {
return reportConfigAllTrunklineService.deleteAllTrunklineConfig(reportConfigDTO);
}
//--------------------订单整体准时
@PostMapping("/orderAllConfigPage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单整体准时配置", notes = "订单整体准时配置")
public R orderAllConfigPage(@RequestBody ReportConfigDTO reportConfigDTO) {
return reportConfigOrderAllService.orderAllConfigPage(reportConfigDTO);
}
@PostMapping("/addOrderAllConfig")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增订单整体准时配置", notes = "新增订单整体准时配置")
public R addOrderAllConfig(@RequestBody ReportConfigDTO reportConfigDTO) {
return reportConfigOrderAllService.addOrderAllConfig(reportConfigDTO);
}
@PostMapping("/deleteOrderAllConfig")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "删除订单整体准时配置", notes = "删除订单整体准时配置")
public R deleteOrderAllConfig(@RequestBody ReportConfigDTO reportConfigDTO) {
return reportConfigOrderAllService.deleteOrderAllConfig(reportConfigDTO);
}
}

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

@ -150,5 +150,20 @@ public class ReportTimeController extends BladeController {
reportTimeService.zeroAllTrunklineTimeExport(reportTimeDTO,response);
}
//-----------------------订单整体时效------------------------
@PostMapping("/orderAllTimePage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单整体时效报表", notes = "订单整体时效报表")
public R orderAllTimePage(@RequestBody ReportTimeDTO reportTimeDTO) {
return reportTimeService.orderAllTimePage(reportTimeDTO);
}
@PostMapping("/orderAllTimeExport")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单整体时效导出", notes = "订单整体时效导出")
public void orderAllTimeExport(@RequestBody ReportTimeDTO reportTimeDTO, HttpServletResponse response) {
reportTimeService.orderAllTimeExport(reportTimeDTO,response);
}
}

13
blade-service/logpm-report/src/main/java/com/logpm/report/dto/DestinationWarehouseDTO.java

@ -0,0 +1,13 @@
package com.logpm.report.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class DestinationWarehouseDTO implements Serializable {
private Long warehouseId;
private String warehouseName;
}

3
blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportConfigDTO.java

@ -21,12 +21,15 @@ public class ReportConfigDTO implements Serializable {
private String brand;
private Integer hoursTime;
private Integer dayTime;
private Long id;
private List<Long> departureWarehouseIds;
private List<Long> destinationWarehouseIds;
private List<DestinationWarehouseDTO> destinationWarehouseDTOList;
private Long departureWarehouseId;
private String departureWarehouseName;

14
blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java

@ -25,5 +25,19 @@ public class ReportTimeDTO implements Serializable {
private Date endTime;
private Integer hoursTime;
private Integer dayTime;
private String orderCode;
private String waybillCode;
private String brand;
private String shipper;
private String consignee;
private String departureWarehouseName;
private String destinationWarehouseName;
private String trainNumber;
private String loadCode;
}

13
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportConfigOrderAllMapper.java

@ -0,0 +1,13 @@
package com.logpm.report.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.report.dto.ReportConfigDTO;
import com.logpm.report.entity.ReportConfigOrderAllEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ReportConfigOrderAllMapper extends BaseMapper<ReportConfigOrderAllEntity> {
IPage<ReportConfigOrderAllEntity> orderAllConfigPage(IPage<Object> page, @Param("param") ReportConfigDTO reportConfigDTO);
}

31
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportConfigOrderAllMapper.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.ReportConfigOrderAllMapper">
<select id="orderAllConfigPage" resultType="com.logpm.report.entity.ReportConfigOrderAllEntity">
select *
from logpm_reportconfig_order_all rat
<where>
and rat.is_deleted = 0
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0">
and rat.departure_warehouse_id in
<foreach collection="param.departureWarehouseIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0">
and rat.destination_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.brands != null and param.brands.size() > 0">
and rat.brand in
<foreach collection="param.brands" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>

5
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.java

@ -2,6 +2,7 @@ package com.logpm.report.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.report.dto.ReportTimeDTO;
import com.logpm.report.entity.ReportConfigOrderAllEntity;
import com.logpm.report.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -43,4 +44,8 @@ public interface ReportTimeMapper {
IPage<ReportPackgeAllTrunklineTimeVO> zeroAllTrunklineTimePage(IPage<Object> page, @Param("param") ReportTimeDTO reportTimeDTO);
List<ReportPackgeAllTrunklineTimeVO> zeroAllTrunklineTimeExport(@Param("param") ReportTimeDTO reportTimeDTO);
IPage<ReportOrderAllTimeVO> orderAllTimePage(IPage<Object> page, @Param("param") ReportTimeDTO reportTimeDTO);
List<ReportConfigOrderAllEntity> orderAllTimeExport(@Param("param") ReportTimeDTO reportTimeDTO);
}

302
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml

@ -829,12 +829,10 @@
IFNULL(round(sum(IFNULL(t.sevenToTenNum,0))/sum(lww.total_count)*100,2),'0.00') sevenToTenArriveRate,
sum(IFNULL(t.moreTenNum,0)) moreTenArriveNum,
IFNULL(round(sum(IFNULL(t.moreTenNum,0))/sum(lww.total_count)*100,2),'0.00') moreTenArriveRate
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
left join (select ldpl.waybill_id,
from (select ldpl.waybill_id,
sum(ldpl.quantity) totalNum,
sum(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time )) timeSecond,
sum(if(ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,0) HOUR ),1,0)) onTimeNum,
sum(if(ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),1,0)) onTimeNum,
sum(if(ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ),1,0)) oneNum,
sum(if(DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ) &lt;ldpl.create_time and ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ),1,0)) twoNum,
sum(if(DATE_ADD( ltad.create_time, INTERVAL 48 HOUR )&lt;ldpl.create_time and ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ),1,0)) threeNum,
@ -850,24 +848,6 @@
where ldpl.conditions != 3
and ldpl.send_warehouse_id != ldpl.accept_warehouse_id
and ltad.create_time > '2024-10-22 00:00:00'
<if test="param.brandList != null and param.brandList.size() > 0">
and ltad.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0">
and ldpl.send_warehouse_id in
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0">
and ldpl.accept_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.startTime != null ">
and ltad.create_time &gt;= #{param.startTime}
</if>
@ -876,10 +856,10 @@
</if>
and ldpl.warehouse_id = ldpl.accept_warehouse_id
and ldpl.warehouse_id != ldpl.send_warehouse_id
group by ldpl.waybill_id) t on t.waybill_id = lww.id
where lww.waybill_type = 1
and lww.departure_warehouse_id != lww.destination_warehouse_id
and lww.create_time > '2024-10-22 00:00:00'
group by ldpl.waybill_id) t
left join logpm_warehouse_waybill lww on lww.id = t.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
where 1=1
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
@ -887,29 +867,23 @@
</foreach>
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lww.brand in
and ltad.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0">
and lww.departure_warehouse_id in
and ldpl.send_warehouse_id in
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0">
and lww.destination_warehouse_id in
and ldpl.accept_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.startTime != null ">
and lww.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.create_time &lt;= #{param.endTime}
</if>
group by waw.business_line,
lww.departure_warehouse_name,
lww.destination_warehouse_name,
@ -948,12 +922,10 @@
IFNULL(concat(round(sum(IFNULL(t.sevenToTenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sevenToTenArriveRate,
sum(IFNULL(t.moreTenNum,0)) moreTenArriveNum,
IFNULL(concat(round(sum(IFNULL(t.moreTenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') moreTenArriveRate
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
left join (select ldpl.waybill_id,
from (select ldpl.waybill_id,
sum(ldpl.quantity) totalNum,
sum(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time )) timeSecond,
sum(if(ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,0) HOUR ),1,0)) onTimeNum,
sum(if(ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),1,0)) onTimeNum,
sum(if(ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ),1,0)) oneNum,
sum(if(DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ) &lt;ldpl.create_time and ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ),1,0)) twoNum,
sum(if(DATE_ADD( ltad.create_time, INTERVAL 48 HOUR )&lt;ldpl.create_time and ldpl.create_time &lt;= DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ),1,0)) threeNum,
@ -969,24 +941,6 @@
where ldpl.conditions != 3
and ldpl.send_warehouse_id != ldpl.accept_warehouse_id
and ltad.create_time > '2024-10-22 00:00:00'
<if test="param.brandList != null and param.brandList.size() > 0">
and ltad.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0">
and ldpl.send_warehouse_id in
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0">
and ldpl.accept_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.startTime != null ">
and ltad.create_time &gt;= #{param.startTime}
</if>
@ -995,10 +949,10 @@
</if>
and ldpl.warehouse_id = ldpl.accept_warehouse_id
and ldpl.warehouse_id != ldpl.send_warehouse_id
group by ldpl.waybill_id) t on t.waybill_id = lww.id
where lww.waybill_type = 1
and lww.departure_warehouse_id != lww.destination_warehouse_id
and lww.create_time > '2024-10-22 00:00:00'
group by ldpl.waybill_id) t
left join logpm_warehouse_waybill lww on lww.id = t.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
where 1=1
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
@ -1006,29 +960,23 @@
</foreach>
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lww.brand in
and ltad.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0">
and lww.departure_warehouse_id in
and ldpl.send_warehouse_id in
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0">
and lww.destination_warehouse_id in
and ldpl.accept_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.startTime != null ">
and lww.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.create_time &lt;= #{param.endTime}
</if>
group by waw.business_line,
lww.departure_warehouse_name,
lww.destination_warehouse_name,
@ -1399,4 +1347,218 @@
lww.brand
</select>
<select id="orderAllTimePage" resultType="com.logpm.report.vo.ReportOrderAllTimeVO">
select ltad.order_code orderCode,
ltad.waybill_no waybillNo,
ltad.brand brand,
lww.shipper shipper,
lww.consignee consignee,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
GROUP_CONCAT(DISTINCT ltad.train_number) trainNumber,
GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) loadCode,
count(ltad.id) totalNum,
min(ltad.create_time) createTime,
min(ldpls.create_time) startIncomingTime,
min(ltcll.start_date) startTime,
min(ldplm.create_time) endIncomingTime,
min(lww.create_time) openTime,
min(lqd.delivery_plan_time) deliveryPlanTime,
min(lqd.sign_time) signTime,
min(lqd.review_time) reviewTime,
min(ltcllm.unload_date) endUnloadTime,
IFNULL(oat.day_time,#{param.dayTime}) dayTime,
IF(min(lqd.sign_time) IS NULL,'否','是') isUploadSignOrder,
IF(min(lqd.sign_time) IS NULL,'否','是') isUploadPut,
CEIL(TIMESTAMPDIFF(SECOND,min(ltad.create_time),min(ldplm.create_time))/3600/24) realdayTime,
CEIL(TIMESTAMPDIFF(SECOND,min(ltad.create_time),min(ldplm.create_time))/3600/24)-IFNULL(oat.day_time,#{param.dayTime}) delayTime,
if(CEIL(TIMESTAMPDIFF(SECOND,min(ltad.create_time),min(ldplm.create_time))/3600/24)-IFNULL(oat.day_time,#{param.dayTime}) > 0,'是','否') delayStatus,
case when sum(if(ldplm.order_package_status='70',1,0))=0 then '未签收'
when count(ltad.id) != sum(if(ldplm.order_package_status='70',1,0)) then '部分签收'
when count(ltad.id) = sum(if(ldplm.order_package_status='70',1,0)) then '已签收'
else '未知' end signStatus,
sum(if(ldplm.order_package_status='70',1,0)) signNum
from logpm_trunkline_advance_detail ltad
left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id
left join logpm_distribution_parcel_list ldpls on ldpls.warehouse_id = lww.departure_warehouse_id and ldpls.order_package_code = ltad.order_package_code
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpls.order_package_code and ltcls.warehouse_id = ldpls.warehouse_id
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
left join logpm_distribution_parcel_list ldplm on ldplm.warehouse_id = lww.destination_warehouse_id and ldplm.order_package_code = ltad.order_package_code
left join logpm_trunkline_cars_load_scan ltclsm on ltclsm.scan_code = ldplm.order_package_code and ltclsm.unload_node_id = ldplm.warehouse_id
left join logpm_trunkline_cars_load_line ltcllm on ltcllm.load_id = ltclsm.load_id and ltcllm.node_id = ltclsm.unload_node_id
left join logpm_quality_deliver lqd on lqd.order_package_code = ltad.order_package_code and lqd.retention_time is null
left join logpm_reportconfig_order_all oat on oat.departure_warehouse_id = lww.departure_warehouse_id and oat.destination_warehouse_id = lww.destination_warehouse_id and oat.brand = lww.brand
where ltad.waybill_id is not null
and ltad.create_time > '2024-10-22 00:00:00'
and lww.departure_warehouse_id != lww.destination_warehouse_id
<if test="param.startTime != null ">
and ltad.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and ltad.create_time &lt;= #{param.endTime}
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lww.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0">
and lww.departure_warehouse_id in
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0">
and lww.destination_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.brand != null and param.brand !='' ">
and ltad.brand = #{param.brand}
</if>
<if test="param.orderCode != null and param.orderCode !='' ">
and ltad.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test="param.waybillCode != null and param.waybillCode !='' ">
and ltad.waybill_no like concat('%',#{param.waybillCode},'%')
</if>
<if test="param.shipper != null and param.shipper !='' ">
and lww.shipper like concat('%',#{param.shipper},'%')
</if>
<if test="param.consignee != null and param.consignee !='' ">
and lww.consignee like concat('%',#{param.consignee},'%')
</if>
<if test="param.departureWarehouseName != null and param.departureWarehouseName !='' ">
and lww.departure_warehouse_name like concat('%',#{param.departureWarehouseName},'%')
</if>
<if test="param.destinationWarehouseName != null and param.destinationWarehouseName !='' ">
and lww.destination_warehouse_name like concat('%',#{param.destinationWarehouseName},'%')
</if>
<if test="param.trainNumber != null and param.trainNumber !='' ">
and GROUP_CONCAT(DISTINCT ltad.train_number) like concat('%',#{param.trainNumber},'%')
GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) loadCode,
</if>
<if test="param.loadCode != null and param.loadCode !='' ">
and GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) like concat('%',#{param.loadCode},'%')
</if>
group by ltad.order_code,
ltad.waybill_no,
ltad.brand,
lww.shipper,
lww.consignee,
lww.departure_warehouse_name,
lww.destination_warehouse_name,
oat.day_time
</select>
<select id="orderAllTimeExport" resultType="com.logpm.report.vo.ReportOrderAllTimeVO">
select ltad.order_code orderCode,
ltad.waybill_no waybillNo,
ltad.brand brand,
lww.shipper shipper,
lww.consignee consignee,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
GROUP_CONCAT(DISTINCT ltad.train_number) trainNumber,
GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) loadCode,
count(ltad.id) totalNum,
min(ltad.create_time) createTime,
min(ldpls.create_time) startIncomingTime,
min(ltcll.start_date) startTime,
min(ldplm.create_time) endIncomingTime,
min(lww.create_time) openTime,
min(lqd.delivery_plan_time) deliveryPlanTime,
min(lqd.sign_time) signTime,
min(lqd.review_time) reviewTime,
min(ltcllm.unload_date) endUnloadTime,
IFNULL(oat.day_time,#{param.dayTime}) dayTime,
IF(min(lqd.sign_time) IS NULL,'否','是') isUploadSignOrder,
IF(min(lqd.sign_time) IS NULL,'否','是') isUploadPut,
CEIL(TIMESTAMPDIFF(SECOND,min(ltad.create_time),min(ldplm.create_time))/3600/24) realdayTime,
CEIL(TIMESTAMPDIFF(SECOND,min(ltad.create_time),min(ldplm.create_time))/3600/24)-IFNULL(oat.day_time,#{param.dayTime}) delayTime,
if(CEIL(TIMESTAMPDIFF(SECOND,min(ltad.create_time),min(ldplm.create_time))/3600/24)-IFNULL(oat.day_time,#{param.dayTime}) > 0,'是','否') delayStatus,
case when sum(if(ldplm.order_package_status='70',1,0))=0 then '未签收'
when count(ltad.id) != sum(if(ldplm.order_package_status='70',1,0)) then '部分签收'
when count(ltad.id) = sum(if(ldplm.order_package_status='70',1,0)) then '已签收'
else '未知' end signStatus,
sum(if(ldplm.order_package_status='70',1,0)) signNum
from logpm_trunkline_advance_detail ltad
left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id
left join logpm_distribution_parcel_list ldpls on ldpls.warehouse_id = lww.departure_warehouse_id and ldpls.order_package_code = ltad.order_package_code
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpls.order_package_code and ltcls.warehouse_id = ldpls.warehouse_id
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
left join logpm_distribution_parcel_list ldplm on ldplm.warehouse_id = lww.destination_warehouse_id and ldplm.order_package_code = ltad.order_package_code
left join logpm_trunkline_cars_load_scan ltclsm on ltclsm.scan_code = ldplm.order_package_code and ltclsm.unload_node_id = ldplm.warehouse_id
left join logpm_trunkline_cars_load_line ltcllm on ltcllm.load_id = ltclsm.load_id and ltcllm.node_id = ltclsm.unload_node_id
left join logpm_quality_deliver lqd on lqd.order_package_code = ltad.order_package_code and lqd.retention_time is null
left join logpm_reportconfig_order_all oat on oat.departure_warehouse_id = lww.departure_warehouse_id and oat.destination_warehouse_id = lww.destination_warehouse_id and oat.brand = lww.brand
where ltad.waybill_id is not null
and ltad.create_time > '2024-10-22 00:00:00'
and lww.departure_warehouse_id != lww.destination_warehouse_id
<if test="param.startTime != null ">
and ltad.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and ltad.create_time &lt;= #{param.endTime}
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lww.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0">
and lww.departure_warehouse_id in
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0">
and lww.destination_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.brand != null and param.brand !='' ">
and ltad.brand = #{param.brand}
</if>
<if test="param.orderCode != null and param.orderCode !='' ">
and ltad.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test="param.waybillCode != null and param.waybillCode !='' ">
and ltad.waybill_no like concat('%',#{param.waybillCode},'%')
</if>
<if test="param.shipper != null and param.shipper !='' ">
and lww.shipper like concat('%',#{param.shipper},'%')
</if>
<if test="param.consignee != null and param.consignee !='' ">
and lww.consignee like concat('%',#{param.consignee},'%')
</if>
<if test="param.departureWarehouseName != null and param.departureWarehouseName !='' ">
and lww.departure_warehouse_name like concat('%',#{param.departureWarehouseName},'%')
</if>
<if test="param.destinationWarehouseName != null and param.destinationWarehouseName !='' ">
and lww.destination_warehouse_name like concat('%',#{param.destinationWarehouseName},'%')
</if>
<if test="param.trainNumber != null and param.trainNumber !='' ">
and GROUP_CONCAT(DISTINCT ltad.train_number) like concat('%',#{param.trainNumber},'%')
GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) loadCode,
</if>
<if test="param.loadCode != null and param.loadCode !='' ">
and GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) like concat('%',#{param.loadCode},'%')
</if>
group by ltad.order_code,
ltad.waybill_no,
ltad.brand,
lww.shipper,
lww.consignee,
lww.departure_warehouse_name,
lww.destination_warehouse_name,
oat.day_time
</select>
</mapper>

14
blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportConfigOrderAllService.java

@ -0,0 +1,14 @@
package com.logpm.report.service;
import com.logpm.report.dto.ReportConfigDTO;
import com.logpm.report.entity.ReportConfigOrderAllEntity;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
public interface IReportConfigOrderAllService extends BaseService<ReportConfigOrderAllEntity> {
R orderAllConfigPage(ReportConfigDTO reportConfigDTO);
R addOrderAllConfig(ReportConfigDTO reportConfigDTO);
R deleteOrderAllConfig(ReportConfigDTO reportConfigDTO);
}

4
blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportTimeService.java

@ -39,4 +39,8 @@ public interface IReportTimeService {
R zeroAllTrunklineTimePage(ReportTimeDTO reportTimeDTO);
void zeroAllTrunklineTimeExport(ReportTimeDTO reportTimeDTO, HttpServletResponse response);
R orderAllTimePage(ReportTimeDTO reportTimeDTO);
void orderAllTimeExport(ReportTimeDTO reportTimeDTO, HttpServletResponse response);
}

51
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportConfigAllTrunklineServiceImpl.java

@ -1,8 +1,10 @@
package com.logpm.report.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.report.dto.DestinationWarehouseDTO;
import com.logpm.report.dto.ReportConfigDTO;
import com.logpm.report.entity.ReportConfigAdvanceDetailOpenEntity;
import com.logpm.report.entity.ReportConfigAllTrunklineEntity;
@ -14,6 +16,8 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Service
@ -35,27 +39,38 @@ public class ReportConfigAllTrunklineServiceImpl extends BaseServiceImpl<ReportC
public R addAllTrunklineConfig(ReportConfigDTO reportConfigDTO) {
Long departureWarehouseId = reportConfigDTO.getDepartureWarehouseId();
String departureWarehouseName = reportConfigDTO.getDepartureWarehouseName();
Long destinationWarehouseId = reportConfigDTO.getDestinationWarehouseId();
String destinationWarehouseName = reportConfigDTO.getDestinationWarehouseName();
List<DestinationWarehouseDTO> destinationWarehouseDTOList = reportConfigDTO.getDestinationWarehouseDTOList();
String brand = reportConfigDTO.getBrand();
QueryWrapper<ReportConfigAllTrunklineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("departure_warehouse_name",departureWarehouseName)
.eq("destination_warehouse_name",destinationWarehouseName)
.eq("is_deleted",0);
ReportConfigAllTrunklineEntity reportConfigAllTrunklineEntity = baseMapper.selectOne(queryWrapper);
if(!Objects.isNull(reportConfigAllTrunklineEntity)){
reportConfigAllTrunklineEntity.setHoursTime(reportConfigDTO.getHoursTime());
}else{
reportConfigAllTrunklineEntity = ReportConfigAllTrunklineEntity.builder()
.departureWarehouseId(departureWarehouseId)
.departureWarehouseName(departureWarehouseName)
.destinationWarehouseId(destinationWarehouseId)
.destinationWarehouseName(destinationWarehouseName)
.hoursTime(reportConfigDTO.getHoursTime())
.build();
List<ReportConfigAllTrunklineEntity> list = new ArrayList<>();
destinationWarehouseDTOList.forEach(destinationWarehouseDTO -> {
Long destinationWarehouseId = destinationWarehouseDTO.getWarehouseId();
String destinationWarehouseName = destinationWarehouseDTO.getWarehouseName();
QueryWrapper<ReportConfigAllTrunklineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("departure_warehouse_name",departureWarehouseName)
.eq("destination_warehouse_name",destinationWarehouseName)
.eq("is_deleted",0);
ReportConfigAllTrunklineEntity reportConfigAllTrunklineEntity = baseMapper.selectOne(queryWrapper);
if(!Objects.isNull(reportConfigAllTrunklineEntity)){
reportConfigAllTrunklineEntity.setHoursTime(reportConfigDTO.getHoursTime());
}else{
reportConfigAllTrunklineEntity = ReportConfigAllTrunklineEntity.builder()
.departureWarehouseId(departureWarehouseId)
.departureWarehouseName(departureWarehouseName)
.destinationWarehouseId(destinationWarehouseId)
.destinationWarehouseName(destinationWarehouseName)
.hoursTime(reportConfigDTO.getHoursTime())
.build();
}
list.add(reportConfigAllTrunklineEntity);
});
if(CollUtil.isNotEmpty(list)){
saveOrUpdateBatch(list);
}
saveOrUpdate(reportConfigAllTrunklineEntity);
return R.success("保存成功");
}

85
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportConfigOrderAllServiceImpl.java

@ -0,0 +1,85 @@
package com.logpm.report.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.report.dto.DestinationWarehouseDTO;
import com.logpm.report.dto.ReportConfigDTO;
import com.logpm.report.entity.ReportConfigOrderAllEntity;
import com.logpm.report.mapper.ReportConfigOrderAllMapper;
import com.logpm.report.service.IReportConfigOrderAllService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Service
@Slf4j
@AllArgsConstructor
public class ReportConfigOrderAllServiceImpl extends BaseServiceImpl<ReportConfigOrderAllMapper, ReportConfigOrderAllEntity> implements IReportConfigOrderAllService {
@Override
public R orderAllConfigPage(ReportConfigDTO reportConfigDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(reportConfigDTO.getPageNum());
page.setSize(reportConfigDTO.getPageSize());
IPage<ReportConfigOrderAllEntity> ipage = baseMapper.orderAllConfigPage(page, reportConfigDTO);
return R.data(ipage);
}
@Override
public R addOrderAllConfig(ReportConfigDTO reportConfigDTO) {
Long departureWarehouseId = reportConfigDTO.getDepartureWarehouseId();
String departureWarehouseName = reportConfigDTO.getDepartureWarehouseName();
// Long destinationWarehouseId = reportConfigDTO.getDestinationWarehouseId();
// String destinationWarehouseName = reportConfigDTO.getDestinationWarehouseName();
List<DestinationWarehouseDTO> destinationWarehouseDTOList = reportConfigDTO.getDestinationWarehouseDTOList();
String brand = reportConfigDTO.getBrand();
List<ReportConfigOrderAllEntity> list = new ArrayList<>();
destinationWarehouseDTOList.forEach(destinationWarehouseDTO -> {
Long destinationWarehouseId = destinationWarehouseDTO.getWarehouseId();
String destinationWarehouseName = destinationWarehouseDTO.getWarehouseName();
QueryWrapper<ReportConfigOrderAllEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("departure_warehouse_name",departureWarehouseName)
.eq("destination_warehouse_name",destinationWarehouseName)
.eq("is_deleted",0);
ReportConfigOrderAllEntity reportConfigOrderAllEntity = baseMapper.selectOne(queryWrapper);
if(!Objects.isNull(reportConfigOrderAllEntity)){
reportConfigOrderAllEntity.setDayTime(reportConfigDTO.getDayTime());
}else{
reportConfigOrderAllEntity = ReportConfigOrderAllEntity.builder()
.departureWarehouseId(departureWarehouseId)
.departureWarehouseName(departureWarehouseName)
.destinationWarehouseId(destinationWarehouseId)
.destinationWarehouseName(destinationWarehouseName)
.dayTime(reportConfigDTO.getDayTime())
.build();
}
list.add(reportConfigOrderAllEntity);
});
if(CollUtil.isNotEmpty(list)){
saveOrUpdateBatch(list);
}
return R.success("保存成功");
}
@Override
public R deleteOrderAllConfig(ReportConfigDTO reportConfigDTO) {
Long id = reportConfigDTO.getId();
removeById(id);
return R.success("删除成功");
}
}

98
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java

@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.report.dto.ReportTimeDTO;
import com.logpm.report.entity.ReportConfigAdvanceDetailOpenEntity;
import com.logpm.report.entity.ReportConfigCheckWaybillEntity;
import com.logpm.report.entity.ReportConfigDespatchEntity;
import com.logpm.report.entity.ReportConfigTransferEntity;
import com.logpm.report.entity.*;
import com.logpm.report.mapper.ReportTimeMapper;
import com.logpm.report.service.*;
import com.logpm.report.vo.*;
@ -32,6 +29,8 @@ public class ReportTimeServiceImpl implements IReportTimeService {
private final IReportConfigCheckWaybillService checkWaybillService;
private final IReportConfigDespatchService despatchService;
private final IReportConfigTransferService transferService;
private final IReportConfigAllTrunklineService allTrunklineService;
private final IReportConfigOrderAllService orderAllService;
@Override
@ -320,6 +319,17 @@ public class ReportTimeServiceImpl implements IReportTimeService {
reportTimeDTO.setStartTime(CommonUtil.getStartByDateStr(reportTimeDTO.getStartTimeStr()));
reportTimeDTO.setEndTime(CommonUtil.getEndByDateStr(reportTimeDTO.getEndTimeStr()));
reportTimeDTO.setHoursTime(0);
QueryWrapper<ReportConfigAllTrunklineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("departure_warehouse_name","全部")
.eq("destination_warehouse_name","全部")
.eq("is_deleted",0);
ReportConfigAllTrunklineEntity allTrunklineEntity = allTrunklineService.getOne(queryWrapper);
if(!Objects.isNull(allTrunklineEntity)){
reportTimeDTO.setHoursTime(allTrunklineEntity.getHoursTime());
}
IPage<ReportPackgeAllTrunklineTimeVO> iPage = reportTimeMapper.packageAllTrunklineTimePage(page,reportTimeDTO);
@ -331,6 +341,17 @@ public class ReportTimeServiceImpl implements IReportTimeService {
reportTimeDTO.setStartTime(CommonUtil.getStartByDateStr(reportTimeDTO.getStartTimeStr()));
reportTimeDTO.setEndTime(CommonUtil.getEndByDateStr(reportTimeDTO.getEndTimeStr()));
reportTimeDTO.setHoursTime(0);
QueryWrapper<ReportConfigAllTrunklineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("departure_warehouse_name","全部")
.eq("destination_warehouse_name","全部")
.eq("is_deleted",0);
ReportConfigAllTrunklineEntity allTrunklineEntity = allTrunklineService.getOne(queryWrapper);
if(!Objects.isNull(allTrunklineEntity)){
reportTimeDTO.setHoursTime(allTrunklineEntity.getHoursTime());
}
List<ReportPackgeAllTrunklineTimeVO> list = reportTimeMapper.packageAllTrunklineTimeExport(reportTimeDTO);
//导出ls
@ -346,6 +367,18 @@ public class ReportTimeServiceImpl implements IReportTimeService {
reportTimeDTO.setStartTime(CommonUtil.getStartByDateStr(reportTimeDTO.getStartTimeStr()));
reportTimeDTO.setEndTime(CommonUtil.getEndByDateStr(reportTimeDTO.getEndTimeStr()));
reportTimeDTO.setHoursTime(0);
QueryWrapper<ReportConfigAllTrunklineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("departure_warehouse_name","全部")
.eq("destination_warehouse_name","全部")
.eq("is_deleted",0);
ReportConfigAllTrunklineEntity allTrunklineEntity = allTrunklineService.getOne(queryWrapper);
if(!Objects.isNull(allTrunklineEntity)){
reportTimeDTO.setHoursTime(allTrunklineEntity.getHoursTime());
}
IPage<ReportPackgeAllTrunklineTimeVO> iPage = reportTimeMapper.zeroAllTrunklineTimePage(page,reportTimeDTO);
@ -357,9 +390,66 @@ public class ReportTimeServiceImpl implements IReportTimeService {
reportTimeDTO.setStartTime(CommonUtil.getStartByDateStr(reportTimeDTO.getStartTimeStr()));
reportTimeDTO.setEndTime(CommonUtil.getEndByDateStr(reportTimeDTO.getEndTimeStr()));
reportTimeDTO.setHoursTime(0);
QueryWrapper<ReportConfigAllTrunklineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("departure_warehouse_name","全部")
.eq("destination_warehouse_name","全部")
.eq("is_deleted",0);
ReportConfigAllTrunklineEntity allTrunklineEntity = allTrunklineService.getOne(queryWrapper);
if(!Objects.isNull(allTrunklineEntity)){
reportTimeDTO.setHoursTime(allTrunklineEntity.getHoursTime());
}
List<ReportPackgeAllTrunklineTimeVO> list = reportTimeMapper.zeroAllTrunklineTimeExport(reportTimeDTO);
//导出ls
ExcelUtil.export(response, "零担干线整体时效报表导出", "零担干线整体时效报表导出", list, ReportPackgeAllTrunklineTimeVO.class);
}
@Override
public R orderAllTimePage(ReportTimeDTO reportTimeDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(reportTimeDTO.getPageNum());
page.setSize(reportTimeDTO.getPageSize());
reportTimeDTO.setStartTime(CommonUtil.getStartByDateStr(reportTimeDTO.getStartTimeStr()));
reportTimeDTO.setEndTime(CommonUtil.getEndByDateStr(reportTimeDTO.getEndTimeStr()));
reportTimeDTO.setDayTime(0);
QueryWrapper<ReportConfigOrderAllEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("departure_warehouse_name","全部")
.eq("destination_warehouse_name","全部")
.eq("is_deleted",0);
ReportConfigOrderAllEntity orderAllEntity = orderAllService.getOne(queryWrapper);
if(!Objects.isNull(orderAllEntity)){
reportTimeDTO.setDayTime(orderAllEntity.getDayTime());
}
IPage<ReportOrderAllTimeVO> iPage = reportTimeMapper.orderAllTimePage(page,reportTimeDTO);
return R.data(iPage);
}
@Override
public void orderAllTimeExport(ReportTimeDTO reportTimeDTO, HttpServletResponse response) {
reportTimeDTO.setStartTime(CommonUtil.getStartByDateStr(reportTimeDTO.getStartTimeStr()));
reportTimeDTO.setEndTime(CommonUtil.getEndByDateStr(reportTimeDTO.getEndTimeStr()));
reportTimeDTO.setDayTime(0);
QueryWrapper<ReportConfigOrderAllEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("departure_warehouse_name","全部")
.eq("destination_warehouse_name","全部")
.eq("is_deleted",0);
ReportConfigOrderAllEntity orderAllEntity = orderAllService.getOne(queryWrapper);
if(!Objects.isNull(orderAllEntity)){
reportTimeDTO.setDayTime(orderAllEntity.getDayTime());
}
List<ReportConfigOrderAllEntity> list = reportTimeMapper.orderAllTimeExport(reportTimeDTO);
//导出ls
ExcelUtil.export(response, "订单整体时效报表导出", "订单整体时效报表导出", list, ReportConfigOrderAllEntity.class);
}
}

103
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOrderAllTimeVO.java

@ -0,0 +1,103 @@
package com.logpm.report.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class ReportOrderAllTimeVO implements Serializable {
@ExcelProperty(value = "品牌")
private String brand;
@ExcelProperty(value = "发货单位")
private String shipper;
@ExcelProperty(value = "收货单位")
private String consignee;
@ExcelProperty(value = "订单号")
private String orderCode;
@ExcelProperty(value = "运单号")
private String waybillNo;
@ExcelProperty(value = "订单件数")
private Integer totalNum;
@ExcelProperty(value = "始发仓")
private String departureWarehouseName;
@ExcelProperty(value = "目的仓")
private String destinationWarehouseName;
@ExcelProperty(value = "客户车次号")
private String trainNumber;
@ExcelProperty(value = "干线车次号")
private String loadCode;
@ExcelProperty(value = "创建时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@ExcelProperty(value = "始发仓入库时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date startIncomingTime;
@ExcelProperty(value = "发车时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
@ExcelProperty(value = "目的仓入库")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date endIncomingTime;
@ExcelProperty(value = "目的仓卸车确认时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date endUnloadTime;
@ExcelProperty(value = "开单时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date openTime;
@ExcelProperty(value = "配送计划时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date deliveryPlanTime;
@ExcelProperty(value = "签收时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date signTime;
@ExcelProperty(value = "复核时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date reviewTime;
@ExcelProperty(value = "是否上传签收单")
private String isUploadSignOrder;
@ExcelProperty(value = "是否上传摆放照")
private String isUploadPut;
@ExcelProperty(value = "标准时效")
private Integer dayTime;
@ExcelProperty(value = "实际时效")
private Integer realdayTime;
@ExcelProperty(value = "延期时效")
private Integer delayTime;
@ExcelProperty(value = "是否超时")
private String delayStatus;
@ExcelProperty(value = "签收状态")
private String signStatus;
@ExcelProperty(value = "签收件数")
private Integer signNum;
}
Loading…
Cancel
Save